@workday/canvas-kit-preview-react 14.0.0-alpha.1127-next.0 → 14.0.0-alpha.1133-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/MultiSelect.d.ts +76 -532
- package/dist/commonjs/multi-select/lib/MultiSelect.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectCard.d.ts +10 -70
- package/dist/commonjs/multi-select/lib/MultiSelectCard.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectInput.d.ts +72 -108
- 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/multi-select/lib/MultiSelectItem.d.ts +15 -92
- package/dist/commonjs/multi-select/lib/MultiSelectItem.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectedItem.d.ts +12 -71
- package/dist/commonjs/multi-select/lib/MultiSelectedItem.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectedList.d.ts +5 -35
- package/dist/commonjs/multi-select/lib/MultiSelectedList.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/useMultiSelectItemRemove.d.ts +5 -35
- package/dist/commonjs/multi-select/lib/useMultiSelectItemRemove.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/useMultiSelectModel.d.ts +59 -413
- package/dist/commonjs/multi-select/lib/useMultiSelectModel.d.ts.map +1 -1
- 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/SegmentedControl.d.ts +45 -315
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +2 -14
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +16 -16
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +2 -14
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +4 -4
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +4 -15
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +45 -315
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -1
- 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/MultiSelect.d.ts +76 -532
- package/dist/es6/multi-select/lib/MultiSelect.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectCard.d.ts +10 -70
- package/dist/es6/multi-select/lib/MultiSelectCard.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectInput.d.ts +72 -108
- 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/multi-select/lib/MultiSelectItem.d.ts +15 -92
- package/dist/es6/multi-select/lib/MultiSelectItem.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectedItem.d.ts +12 -71
- package/dist/es6/multi-select/lib/MultiSelectedItem.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectedList.d.ts +5 -35
- package/dist/es6/multi-select/lib/MultiSelectedList.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/useMultiSelectItemRemove.d.ts +5 -35
- package/dist/es6/multi-select/lib/useMultiSelectItemRemove.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/useMultiSelectModel.d.ts +59 -413
- package/dist/es6/multi-select/lib/useMultiSelectModel.d.ts.map +1 -1
- 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/SegmentedControl.d.ts +45 -315
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +2 -14
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlItem.js +16 -16
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +2 -14
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlList.js +4 -4
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +4 -15
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +45 -315
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -1
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSegmentedControlModel.d.ts","sourceRoot":"","sources":["../../../../../segmented-control/lib/hooks/useSegmentedControlModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,wBAAwB;IAGjC;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;;OAIG
|
|
1
|
+
{"version":3,"file":"useSegmentedControlModel.d.ts","sourceRoot":"","sources":["../../../../../segmented-control/lib/hooks/useSegmentedControlModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,wBAAwB;IAGjC;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAxBH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CL,CAAC"}
|
|
@@ -10,19 +10,19 @@ export const panelStencil = createStencil({
|
|
|
10
10
|
expandedWidth: '',
|
|
11
11
|
collapsedWidth: '',
|
|
12
12
|
},
|
|
13
|
-
base: { name: "
|
|
13
|
+
base: { name: "h6y24g", 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: "h6y24h", styles: "background-color:var(--cnvs-sys-color-bg-default);box-shadow:var(--cnvs-sys-depth-5);" },
|
|
17
|
+
standard: { name: "h6y24i", styles: "background-color:var(--cnvs-sys-color-bg-alt-softer);" }
|
|
18
18
|
},
|
|
19
19
|
expanded: {
|
|
20
|
-
true: { name: "
|
|
21
|
-
false: { name: "
|
|
20
|
+
true: { name: "h6y24j", styles: "width:var(--expandedWidth-panel-bd9477);max-width:var(--expandedWidth-panel-bd9477);" },
|
|
21
|
+
false: { name: "h6y24k", 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: "h6y24l", styles: "" },
|
|
25
|
+
false: { name: "h6y24m", 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: "h6y245", 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: "h6y246", styles: "margin:0;transform:scaleX(1);:dir(rtl){transform:scaleX(-1);}" },
|
|
15
|
+
collapsed: { name: "h6y247", styles: "margin:auto;inset-inline-start:0;inset-inline-end:0;transform:scaleX(1);:dir(rtl){transform:scaleX(-1);}" },
|
|
16
|
+
expanded: { name: "h6y248", styles: "margin:0;transform:scaleX(-1);:dir(rtl){transform:scaleX(1);}" },
|
|
17
|
+
expanding: { name: "h6y249", 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: "h6y24a", styles: "" },
|
|
21
|
+
right: { name: "h6y24b", styles: "" }
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
compound: [
|
|
25
25
|
{
|
|
26
26
|
modifiers: { state: 'collapsed', origin: 'right' },
|
|
27
|
-
styles: { name: "
|
|
27
|
+
styles: { name: "h6y24c", styles: "transform:scaleX(-1);" }
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
modifiers: { state: 'collapsing', origin: 'right' },
|
|
31
|
-
styles: { name: "
|
|
31
|
+
styles: { name: "h6y24d", 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: "h6y24e", 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: "h6y24f", 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: "h6y254", 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: "h6y255", 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: "h6y256", 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: "h6y257", 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: "h6y258", 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: "h6y259", 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: "h6y25a", 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: "h6y25b", 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: "h6y25c", 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: "h6y25d", 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: "h6y25e", 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: "h6y25f", 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: "h6y25g", 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: "h6y253", 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.1133-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.1133-next.0",
|
|
50
|
+
"@workday/canvas-kit-styling": "^14.0.0-alpha.1133-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": "eb3759bc235f1a76edeae94e6e09d4395bcb90a4"
|
|
62
62
|
}
|