@workday/canvas-kit-react 10.3.2 → 10.3.5
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/collection/lib/useCursorListModel.tsx +86 -90
- package/collection/lib/useListItemAllowChildStrings.ts +3 -3
- package/collection/lib/useListRenderItem.tsx +1 -1
- package/combobox/lib/hooks/useComboboxKeyboardTypeAhead.ts +3 -3
- package/combobox/lib/hooks/useComboboxModel.tsx +1 -2
- package/common/README.md +32 -14
- package/common/lib/styles/errorRing.ts +2 -2
- package/common/lib/styles/focusRing.ts +4 -17
- package/dist/commonjs/avatar/lib/Avatar.js +1 -1
- package/dist/commonjs/banner/lib/Banner.js +1 -1
- package/dist/commonjs/button/lib/BaseButton.js +22 -22
- package/dist/commonjs/button/lib/DeleteButton.js +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.js +2 -2
- package/dist/commonjs/button/lib/SecondaryButton.js +2 -2
- package/dist/commonjs/button/lib/TertiaryButton.js +15 -15
- package/dist/commonjs/button/lib/ToolbarDropdownButton.js +6 -1
- package/dist/commonjs/button/lib/ToolbarIconButton.js +6 -1
- package/dist/commonjs/button/lib/deprecated_Button.js +2 -2
- package/dist/commonjs/checkbox/lib/Checkbox.js +14 -2
- package/dist/commonjs/collection/lib/useCursorListModel.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListItemAllowChildStrings.d.ts +2 -1
- package/dist/commonjs/collection/lib/useListItemAllowChildStrings.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListItemAllowChildStrings.js +1 -1
- package/dist/commonjs/collection/lib/useListRenderItem.js +1 -1
- package/dist/commonjs/combobox/lib/hooks/useComboboxKeyboardTypeAhead.js +2 -3
- package/dist/commonjs/combobox/lib/hooks/useComboboxModel.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/hooks/useComboboxModel.js +1 -2
- package/dist/commonjs/common/lib/AccessibleHide.js +1 -1
- package/dist/commonjs/common/lib/CanvasProvider.js +1 -1
- package/dist/commonjs/common/lib/styles/errorRing.js +2 -2
- package/dist/commonjs/common/lib/styles/focusRing.d.ts.map +1 -1
- package/dist/commonjs/common/lib/styles/focusRing.js +5 -16
- package/dist/commonjs/radio/lib/Radio.js +17 -3
- package/dist/commonjs/select/lib/Select.d.ts +2 -1
- package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
- package/dist/commonjs/select/lib/Select.js +5 -3
- package/dist/commonjs/select/lib/hooks/useSelectInput.d.ts +6 -1
- package/dist/commonjs/select/lib/hooks/useSelectInput.d.ts.map +1 -1
- package/dist/commonjs/select/lib/hooks/useSelectInput.js +45 -4
- package/dist/commonjs/select/lib/hooks/useSelectModel.d.ts.map +1 -1
- package/dist/commonjs/select/lib/hooks/useSelectModel.js +1 -2
- package/dist/commonjs/switch/lib/Switch.js +2 -2
- package/dist/commonjs/tabs/lib/TabsItem.js +1 -1
- package/dist/commonjs/text-input/lib/TextInput.js +3 -3
- package/dist/es6/avatar/lib/Avatar.js +1 -1
- package/dist/es6/banner/lib/Banner.js +1 -1
- package/dist/es6/button/lib/BaseButton.js +22 -22
- package/dist/es6/button/lib/DeleteButton.js +1 -1
- package/dist/es6/button/lib/PrimaryButton.js +2 -2
- package/dist/es6/button/lib/SecondaryButton.js +2 -2
- package/dist/es6/button/lib/TertiaryButton.js +15 -15
- package/dist/es6/button/lib/ToolbarDropdownButton.js +6 -1
- package/dist/es6/button/lib/ToolbarIconButton.js +6 -1
- package/dist/es6/button/lib/deprecated_Button.js +2 -2
- package/dist/es6/checkbox/lib/Checkbox.js +14 -2
- package/dist/es6/collection/lib/useCursorListModel.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListItemAllowChildStrings.d.ts +2 -1
- package/dist/es6/collection/lib/useListItemAllowChildStrings.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListItemAllowChildStrings.js +1 -1
- package/dist/es6/collection/lib/useListRenderItem.js +1 -1
- package/dist/es6/combobox/lib/hooks/useComboboxKeyboardTypeAhead.js +2 -3
- package/dist/es6/combobox/lib/hooks/useComboboxModel.d.ts.map +1 -1
- package/dist/es6/combobox/lib/hooks/useComboboxModel.js +1 -2
- package/dist/es6/common/lib/AccessibleHide.js +1 -1
- package/dist/es6/common/lib/CanvasProvider.js +1 -1
- package/dist/es6/common/lib/styles/errorRing.js +2 -2
- package/dist/es6/common/lib/styles/focusRing.d.ts.map +1 -1
- package/dist/es6/common/lib/styles/focusRing.js +5 -16
- package/dist/es6/radio/lib/Radio.js +17 -3
- package/dist/es6/select/lib/Select.d.ts +2 -1
- package/dist/es6/select/lib/Select.d.ts.map +1 -1
- package/dist/es6/select/lib/Select.js +5 -3
- package/dist/es6/select/lib/hooks/useSelectInput.d.ts +6 -1
- package/dist/es6/select/lib/hooks/useSelectInput.d.ts.map +1 -1
- package/dist/es6/select/lib/hooks/useSelectInput.js +43 -5
- package/dist/es6/select/lib/hooks/useSelectModel.d.ts.map +1 -1
- package/dist/es6/select/lib/hooks/useSelectModel.js +1 -2
- package/dist/es6/switch/lib/Switch.js +2 -2
- package/dist/es6/tabs/lib/TabsItem.js +1 -1
- package/dist/es6/text-input/lib/TextInput.js +3 -3
- package/package.json +4 -4
- package/select/lib/Select.tsx +50 -4
- package/select/lib/hooks/useSelectInput.ts +86 -44
- package/select/lib/hooks/useSelectModel.tsx +1 -2
- package/text-input/lib/TextInput.tsx +3 -3
|
@@ -28,27 +28,27 @@ const layout_1 = require("@workday/canvas-kit-react/layout");
|
|
|
28
28
|
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
29
29
|
const tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
30
30
|
const Button_1 = require("./Button");
|
|
31
|
-
const tertiaryStyles = canvas_kit_styling_1.createStyles({ name: "
|
|
31
|
+
const tertiaryStyles = canvas_kit_styling_1.createStyles({ name: "fuwbd5", styles: "padding-inline:var(--cnvs-sys-space-x2, calc(0.25rem * 2));min-width:auto;text-decoration:underline;border:0px;--cnvs-button-default-background:transparent;--cnvs-button-default-border:transparent;--cnvs-button-default-borderRadius:var(--cnvs-sys-shape-x1, 0.25rem);--cnvs-button-default-label-emotion-safe:var(--cnvs-brand-primary-base, rgba(8,117,225,1));--cnvs-button-default-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--cnvs-button-hover-background:var(--cnvs-base-palette-soap-200, rgba(240,241,242,1));--cnvs-button-hover-border:transparent;--cnvs-button-hover-label-emotion-safe:var(--cnvs-brand-primary-dark, rgba(0,92,185,1));--cnvs-button-hover-icon:var(--cnvs-base-palette-black-pepper-500, rgba(30,30,30,1));--cnvs-button-focus-background:transparent;--cnvs-button-focus-border:transparent;--cnvs-button-focus-label-emotion-safe:var(--cnvs-brand-primary-base, rgba(8,117,225,1));--cnvs-button-focus-icon:var(--cnvs-base-palette-black-pepper-500, rgba(30,30,30,1));--cnvs-button-focus-boxShadowInner:var(--cnvs-brand-common-focus-outline, rgba(8,117,225,1));--cnvs-button-focus-boxShadowOuter:var(--cnvs-brand-common-focus-outline, rgba(8,117,225,1));--cnvs-button-active-background:var(--cnvs-base-palette-soap-300, rgba(232,235,237,1));--cnvs-button-active-border:transparent;--cnvs-button-active-label-emotion-safe:var(--cnvs-brand-primary-dark, rgba(0,92,185,1));--cnvs-button-active-icon:var(--cnvs-base-palette-black-pepper-500, rgba(30,30,30,1));--cnvs-button-disabled-background:transparent;--cnvs-button-disabled-border:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--cnvs-button-disabled-label-emotion-safe:var(--cnvs-brand-primary-base, rgba(8,117,225,1));--cnvs-button-disabled-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--cnvs-button-disabled-opacity:0.4;&:focus-visible, &.focus{box-shadow:0 0 0 0px var(--cnvs-base-palette-french-vanilla-100), 0 0 0 2px var(--cnvs-brand-common-focus-outline);}" });
|
|
32
32
|
exports.tertiaryButtonModifiers = canvas_kit_styling_1.createModifiers({
|
|
33
33
|
isThemeable: {
|
|
34
|
-
true: canvas_kit_styling_1.createStyles({ name: "
|
|
34
|
+
true: canvas_kit_styling_1.createStyles({ name: "6a60el", styles: "--cnvs-button-default-icon:var(--cnvs-brand-primary-base, rgba(8,117,225,1));--cnvs-button-hover-icon:var(--cnvs-brand-primary-dark, rgba(0,92,185,1));--cnvs-button-focus-icon:var(--cnvs-brand-primary-base, rgba(8,117,225,1));--cnvs-button-active-icon:var(--cnvs-brand-primary-dark, rgba(0,92,185,1));--cnvs-button-disabled-icon:var(--cnvs-brand-primary-base, rgba(8,117,225,1));" }),
|
|
35
35
|
},
|
|
36
36
|
variant: {
|
|
37
|
-
inverse: canvas_kit_styling_1.createStyles({ name: "
|
|
37
|
+
inverse: canvas_kit_styling_1.createStyles({ name: "1n00uny", styles: "--cnvs-button-default-background:transparent;--cnvs-button-default-border:transparent;--cnvs-button-default-label-emotion-safe:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--cnvs-button-default-icon:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--cnvs-button-hover-background:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--cnvs-button-hover-border:transparent;--cnvs-button-hover-label-emotion-safe:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--cnvs-button-hover-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--cnvs-button-focus-background:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--cnvs-button-focus-border:transparent;--cnvs-button-focus-label-emotion-safe:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--cnvs-button-focus-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--cnvs-button-active-background:var(--cnvs-base-palette-soap-200, rgba(240,241,242,1));--cnvs-button-active-border:transparent;--cnvs-button-active-label-emotion-safe:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--cnvs-button-active-icon:var(--cnvs-base-palette-black-pepper-400, rgba(51,51,51,1));--cnvs-button-disabled-background:transparent;--cnvs-button-disabled-border:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--cnvs-button-disabled-label-emotion-safe:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));--cnvs-button-disabled-icon:var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1));&:focus-visible, &.focus{box-shadow:inset 0 0 0 2px var(--cnvs-base-palette-black-pepper-400), 0 0 0 2px var(--cnvs-base-palette-french-vanilla-100);}" }),
|
|
38
38
|
},
|
|
39
39
|
iconPosition: {
|
|
40
|
-
largeOnly: canvas_kit_styling_1.createStyles({ name: "
|
|
41
|
-
largeStart: canvas_kit_styling_1.createStyles({ name: "
|
|
42
|
-
largeEnd: canvas_kit_styling_1.createStyles({ name: "
|
|
43
|
-
mediumOnly: canvas_kit_styling_1.createStyles({ name: "
|
|
44
|
-
mediumStart: canvas_kit_styling_1.createStyles({ name: "
|
|
45
|
-
mediumEnd: canvas_kit_styling_1.createStyles({ name: "
|
|
46
|
-
smallOnly: canvas_kit_styling_1.createStyles({ name: "
|
|
47
|
-
smallStart: canvas_kit_styling_1.createStyles({ name: "
|
|
48
|
-
smallEnd: canvas_kit_styling_1.createStyles({ name: "
|
|
49
|
-
extraSmallOnly: canvas_kit_styling_1.createStyles({ name: "
|
|
50
|
-
extraSmallStart: canvas_kit_styling_1.createStyles({ name: "
|
|
51
|
-
extraSmallEnd: canvas_kit_styling_1.createStyles({ name: "
|
|
40
|
+
largeOnly: canvas_kit_styling_1.createStyles({ name: "xih0j4", styles: "border-radius:999px;padding:0;min-width:calc(var(--cnvs-sys-space-x4, calc(0.25rem * 4)) * 3);" }),
|
|
41
|
+
largeStart: canvas_kit_styling_1.createStyles({ name: "13w6ubi", styles: "padding-inline-start:0.5rem;padding-inline-end:0.75rem;" }),
|
|
42
|
+
largeEnd: canvas_kit_styling_1.createStyles({ name: "1g2rd08", styles: "padding-inline-start:0.75rem;padding-inline-end:0.5rem;" }),
|
|
43
|
+
mediumOnly: canvas_kit_styling_1.createStyles({ name: "10i0ly8", styles: "padding:0;min-width:2.5rem;border-radius:999px;" }),
|
|
44
|
+
mediumStart: canvas_kit_styling_1.createStyles({ name: "13w6ubi", styles: "padding-inline-start:0.5rem;padding-inline-end:0.75rem;" }),
|
|
45
|
+
mediumEnd: canvas_kit_styling_1.createStyles({ name: "1g2rd08", styles: "padding-inline-start:0.75rem;padding-inline-end:0.5rem;" }),
|
|
46
|
+
smallOnly: canvas_kit_styling_1.createStyles({ name: "18m1kdv", styles: "padding:0;min-width:2rem;border-radius:999px;" }),
|
|
47
|
+
smallStart: canvas_kit_styling_1.createStyles({ name: "13w6ubi", styles: "padding-inline-start:0.5rem;padding-inline-end:0.75rem;" }),
|
|
48
|
+
smallEnd: canvas_kit_styling_1.createStyles({ name: "1g2rd08", styles: "padding-inline-start:0.75rem;padding-inline-end:0.5rem;" }),
|
|
49
|
+
extraSmallOnly: canvas_kit_styling_1.createStyles({ name: "1pnzsxn", styles: "padding:0;min-width:1.5rem;border-radius:999px;" }),
|
|
50
|
+
extraSmallStart: canvas_kit_styling_1.createStyles({ name: "1ixecau", styles: "padding-inline-start:0.25rem;padding-inline-end:0.5rem;" }),
|
|
51
|
+
extraSmallEnd: canvas_kit_styling_1.createStyles({ name: "f1t4k2", styles: "padding-inline-start:0.5rem;padding-inline-end:0.25rem;" }),
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
exports.TertiaryButton = common_1.createComponent('button')({
|
|
@@ -31,7 +31,12 @@ const StyledToolbarDropdownButton = common_1.styled(BaseButton_1.BaseButton)({
|
|
|
31
31
|
width: 18, // decrease the space between a custom icon and the chevron per design
|
|
32
32
|
},
|
|
33
33
|
'&:focus-visible, &.focus': {
|
|
34
|
-
...
|
|
34
|
+
...common_1.focusRing({
|
|
35
|
+
width: 2,
|
|
36
|
+
separation: 0,
|
|
37
|
+
innerColor: 'transparent',
|
|
38
|
+
outerColor: canvas_tokens_web_1.brand.common.focusOutline,
|
|
39
|
+
}),
|
|
35
40
|
},
|
|
36
41
|
});
|
|
37
42
|
exports.ToolbarDropdownButton = common_1.createComponent('button')({
|
|
@@ -32,7 +32,12 @@ const StyledToolbarIconButton = common_1.styled(BaseButton_1.BaseButton)({
|
|
|
32
32
|
height: 20,
|
|
33
33
|
},
|
|
34
34
|
'&:focus-visible, &.focus': {
|
|
35
|
-
...
|
|
35
|
+
...common_1.focusRing({
|
|
36
|
+
width: 2,
|
|
37
|
+
separation: 0,
|
|
38
|
+
innerColor: 'transparent',
|
|
39
|
+
outerColor: canvas_tokens_web_1.brand.common.focusOutline,
|
|
40
|
+
}),
|
|
36
41
|
},
|
|
37
42
|
});
|
|
38
43
|
exports.ToolbarIconButton = common_1.createComponent('button')({
|
|
@@ -130,11 +130,11 @@ const Container = styled_1.default('button')({
|
|
|
130
130
|
'&:not([disabled])': {
|
|
131
131
|
'&:focus': {
|
|
132
132
|
borderColor: buttonColors.focusBorder,
|
|
133
|
-
...
|
|
133
|
+
...common_1.focusRing(),
|
|
134
134
|
},
|
|
135
135
|
'&:active': {
|
|
136
136
|
borderColor: buttonColors.activeBorder,
|
|
137
|
-
...
|
|
137
|
+
...common_1.focusRing(),
|
|
138
138
|
},
|
|
139
139
|
},
|
|
140
140
|
...common_1.mouseFocusBehavior({
|
|
@@ -98,10 +98,22 @@ const CheckboxInput = common_1.styled('input')(({ theme: { canvas: { palette: {
|
|
|
98
98
|
borderColor: variant === 'inverse' ? tokens_1.colors.blackPepper400 : themePrimary.main,
|
|
99
99
|
borderWidth: '2px',
|
|
100
100
|
boxShadow: 'none',
|
|
101
|
-
...
|
|
101
|
+
...common_1.focusRing({
|
|
102
|
+
width: variant === 'inverse' ? 2 : 0,
|
|
103
|
+
separation: 0,
|
|
104
|
+
animate: false,
|
|
105
|
+
innerColor: variant === 'inverse' ? tokens_1.colors.blackPepper400 : undefined,
|
|
106
|
+
outerColor: variant === 'inverse' ? tokens_1.colors.frenchVanilla100 : undefined,
|
|
107
|
+
}),
|
|
102
108
|
},
|
|
103
109
|
'&:checked:focus ~ div:first-of-type, &:indeterminate:focus ~ div:first-of-type': {
|
|
104
|
-
...
|
|
110
|
+
...common_1.focusRing({
|
|
111
|
+
width: 2,
|
|
112
|
+
separation: 2,
|
|
113
|
+
animate: false,
|
|
114
|
+
innerColor: variant === 'inverse' ? tokens_1.colors.blackPepper400 : undefined,
|
|
115
|
+
outerColor: variant === 'inverse' ? tokens_1.colors.frenchVanilla100 : themeFocusOutline,
|
|
116
|
+
}),
|
|
105
117
|
borderColor: variant === 'inverse' ? tokens_1.colors.frenchVanilla100 : themePrimary.main,
|
|
106
118
|
borderWidth: '2px',
|
|
107
119
|
'& span': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCursorListModel.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useCursorListModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0B,OAAO,EAAC,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAmB,IAAI,EAAC,MAAM,oBAAoB,CAAC;AAE1D,aAAK,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,EAAE,OAAO,CAAC,CAAC;AAE5E;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;0CACsC;IACtC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;mCAC+B;IAC/B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,0CAA0C;IAC1C,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/D;2FACuF;IACvF,OAAO,EAAE,mBAAmB,CAAC;IAC7B;uCACmC;IACnC,UAAU,EAAE,mBAAmB,CAAC;IAChC;+FAC2F;IAC3F,WAAW,EAAE,mBAAmB,CAAC;IACjC;0CACsC;IACtC,cAAc,EAAE,mBAAmB,CAAC;IACpC;kBACc;IACd,aAAa,EAAE,mBAAmB,CAAC;I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KAAC;IAIvB;;;;;OAKG;;IAKH;;;OAGG;;IAKH;;;;;OAKG;;IAOH;;;;;OAKG;;IAKH,mDAAmD;;IAKnD,kDAAkD;;;;;;;;;;;;;;;;;;QA3ElD,wDAAwD;;QAExD;;;;WAIG;;QAEH;;;WAGG;;QAEH;;;;;;WAMG;;8BArCyD,MAAM;;;;;;;;;;;;;;;;;;;QA2ClE,mEAAmE;mBACxD;YAAC,EAAE,EAAE,MAAM,CAAA;SAAC;QAIvB;;;;;WAKG;;QAKH;;;WAGG;;QAKH;;;;;WAKG;;QAOH;;;;;WAKG;;QAKH,mDAAmD;;QAKnD,kDAAkD;;;;;;;;;;;;;;;;;;;EA0BpD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Item } from '@workday/canvas-kit-react/collection';
|
|
1
2
|
/**
|
|
2
3
|
* This elemProps hook allows for children values to be considered identifiers if the children are
|
|
3
4
|
* strings. This can be useful for autocomplete or select components that allow string values. This
|
|
@@ -47,7 +48,7 @@ export declare const useListItemAllowChildStrings: import("@workday/canvas-kit-r
|
|
|
47
48
|
indexRef: import("react").MutableRefObject<number>;
|
|
48
49
|
nonInteractiveIds: string[];
|
|
49
50
|
isVirtualized: boolean;
|
|
50
|
-
items:
|
|
51
|
+
items: Item<any>[];
|
|
51
52
|
};
|
|
52
53
|
events: {
|
|
53
54
|
select(data: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useListItemAllowChildStrings.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemAllowChildStrings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useListItemAllowChildStrings.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemAllowChildStrings.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,IAAI,EAAC,MAAM,sCAAsC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxC,CAAC"}
|
|
@@ -30,7 +30,7 @@ const collection_1 = require("@workday/canvas-kit-react/collection");
|
|
|
30
30
|
*/
|
|
31
31
|
exports.useListItemAllowChildStrings = common_1.createElemPropsHook(collection_1.useListModel)((_, __, elemProps = {}) => {
|
|
32
32
|
const props = {};
|
|
33
|
-
if (!elemProps['data-id'] && typeof elemProps.children === 'string') {
|
|
33
|
+
if (!elemProps['data-id'] && !elemProps.item && typeof elemProps.children === 'string') {
|
|
34
34
|
props['data-id'] = elemProps.children;
|
|
35
35
|
}
|
|
36
36
|
return props;
|
|
@@ -52,12 +52,11 @@ exports.useComboboxKeyboardTypeAhead = common_1.createElemPropsHook(useComboboxM
|
|
|
52
52
|
}
|
|
53
53
|
return -1;
|
|
54
54
|
};
|
|
55
|
-
const
|
|
56
|
-
const cursorFocusedIndex = currentItem.index;
|
|
55
|
+
const currentItemIndex = model.state.items.length > 0 ? model.navigation.getItem(model.state.cursorId, model).index : 0;
|
|
57
56
|
const handleKeyboardTypeAhead = (key, numOptions) => {
|
|
58
57
|
// If the starting point is beyond the list of options, reset it
|
|
59
58
|
// to the beginning of the list
|
|
60
|
-
const startNumber = keySofar.current.length === 0 ?
|
|
59
|
+
const startNumber = keySofar.current.length === 0 ? currentItemIndex + 1 : currentItemIndex;
|
|
61
60
|
const start = startNumber === numOptions ? 0 : startNumber;
|
|
62
61
|
// Keeps track of the current key types and adds to it
|
|
63
62
|
// if you type `de` vs `d` for denver
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComboboxModel.d.ts","sourceRoot":"","sources":["../../../../../combobox/lib/hooks/useComboboxModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B;;;;;;GAMG;AACH,eAAO,MAAM,aAAa;;oBAIN,MAAM,WAAW,CAAC,gBAAgB,CAAC;;sBAAnC,MAAM,WAAW,CAAC,gBAAgB,CAA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AC;;;;EAwErD,CAAC"}
|
|
@@ -55,8 +55,7 @@ exports.useComboboxModel = common_1.createModelHook({
|
|
|
55
55
|
const input = exports.useInputModel(config);
|
|
56
56
|
const menu = menu_1.useMenuModel(menu_1.useMenuModel.mergeConfig(config, {
|
|
57
57
|
onSelect({ id }) {
|
|
58
|
-
|
|
59
|
-
common_1.dispatchInputEvent(menu.state.targetRef.current, textValue);
|
|
58
|
+
common_1.dispatchInputEvent(menu.state.targetRef.current, id);
|
|
60
59
|
},
|
|
61
60
|
}));
|
|
62
61
|
const [width, setWidth] = react_1.default.useState(0);
|
|
@@ -39,7 +39,7 @@ exports.accessibleHide = {
|
|
|
39
39
|
padding: 0,
|
|
40
40
|
border: 0,
|
|
41
41
|
};
|
|
42
|
-
const accessibleHideStyles = canvas_kit_styling_1.createStyles({ name: "
|
|
42
|
+
const accessibleHideStyles = canvas_kit_styling_1.createStyles({ name: "1jqqftm", styles: "clip:rect(1px, 1px, 1px, 1px);clip-path:polygon(0px 0px, 0px 0px, 0px 0px, 0px 0px);position:absolute;overflow:hidden;white-space:nowrap;height:1px;width:1px;margin:-1px;padding:0px;border:0px;" });
|
|
43
43
|
/**
|
|
44
44
|
* A convenient component wrapper to visually hide content, while still making it accessible to screen readers
|
|
45
45
|
*/
|
|
@@ -28,7 +28,7 @@ const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
|
28
28
|
const css_1 = require("@emotion/css");
|
|
29
29
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
30
30
|
// copied from brand/_variables.css
|
|
31
|
-
const defaultBranding = canvas_kit_styling_1.createStyles({ name: "
|
|
31
|
+
const defaultBranding = canvas_kit_styling_1.createStyles({ name: "192nfdp", styles: "--cnvs-brand-error-darkest:rgba(128,22,14,1);--cnvs-brand-common-alert-inner:var(--cnvs-base-palette-cantaloupe-400);--cnvs-brand-common-error-inner:var(--cnvs-base-palette-cinnamon-500);--cnvs-brand-common-focus-outline:var(--cnvs-base-palette-blueberry-400);--cnvs-brand-neutral-accent:var(--cnvs-base-palette-french-vanilla-100);--cnvs-brand-neutral-darkest:var(--cnvs-base-palette-licorice-400);--cnvs-brand-neutral-dark:var(--cnvs-base-palette-licorice-300);--cnvs-brand-neutral-base:var(--cnvs-base-palette-soap-600);--cnvs-brand-neutral-light:var(--cnvs-base-palette-soap-300);--cnvs-brand-neutral-lightest:var(--cnvs-base-palette-soap-200);--cnvs-brand-success-accent:var(--cnvs-base-palette-french-vanilla-100);--cnvs-brand-success-darkest:var(--cnvs-base-palette-green-apple-600);--cnvs-brand-success-dark:var(--cnvs-base-palette-green-apple-500);--cnvs-brand-success-base:var(--cnvs-base-palette-green-apple-400);--cnvs-brand-success-light:var(--cnvs-base-palette-green-apple-300);--cnvs-brand-success-lightest:var(--cnvs-base-palette-green-apple-100);--cnvs-brand-error-accent:var(--cnvs-base-palette-french-vanilla-100);--cnvs-brand-error-dark:var(--cnvs-base-palette-cinnamon-600);--cnvs-brand-error-base:var(--cnvs-base-palette-cinnamon-500);--cnvs-brand-error-light:var(--cnvs-base-palette-cinnamon-200);--cnvs-brand-error-lightest:var(--cnvs-base-palette-cinnamon-100);--cnvs-brand-alert-accent:var(--cnvs-base-palette-french-vanilla-100);--cnvs-brand-alert-darkest:var(--cnvs-base-palette-cantaloupe-600);--cnvs-brand-alert-dark:var(--cnvs-base-palette-cantaloupe-500);--cnvs-brand-alert-base:var(--cnvs-base-palette-cantaloupe-400);--cnvs-brand-alert-light:var(--cnvs-base-palette-cantaloupe-200);--cnvs-brand-alert-lightest:var(--cnvs-base-palette-cantaloupe-100);--cnvs-brand-primary-accent:var(--cnvs-base-palette-french-vanilla-100);--cnvs-brand-primary-darkest:var(--cnvs-base-palette-blueberry-600);--cnvs-brand-primary-dark:var(--cnvs-base-palette-blueberry-500);--cnvs-brand-primary-base:var(--cnvs-base-palette-blueberry-400);--cnvs-brand-primary-light:var(--cnvs-base-palette-blueberry-200);--cnvs-brand-primary-lightest:var(--cnvs-base-palette-blueberry-100);--cnvs-brand-gradient-primary:linear-gradient(90deg, var(--cnvs-brand-primary-base) 0%, var(--cnvs-brand-primary-dark) 100%);" });
|
|
32
32
|
const mappedKeys = {
|
|
33
33
|
lightest: 'lightest',
|
|
34
34
|
light: 'light',
|
|
@@ -56,10 +56,10 @@ function errorRing(error, theme) {
|
|
|
56
56
|
borderColor: errorColors.outer,
|
|
57
57
|
transition: '100ms box-shadow',
|
|
58
58
|
boxShadow: errorBoxShadow,
|
|
59
|
-
'&:hover, &:disabled': {
|
|
59
|
+
'&:hover, &:disabled, &.hover, &.disabled': {
|
|
60
60
|
borderColor: errorColors.outer,
|
|
61
61
|
},
|
|
62
|
-
'&:focus:not([disabled])': {
|
|
62
|
+
'&:focus-visible:not([disabled]), &.focus:not([disabled])': {
|
|
63
63
|
borderColor: errorColors.outer,
|
|
64
64
|
boxShadow: `${errorBoxShadow},
|
|
65
65
|
0 0 0 2px ${tokens_1.colors.frenchVanilla100},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusRing.d.ts","sourceRoot":"","sources":["../../../../../common/lib/styles/focusRing.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"focusRing.d.ts","sourceRoot":"","sources":["../../../../../common/lib/styles/focusRing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAIhD,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA2CD;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,gBAAqB,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAoBlF"}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.focusRing = void 0;
|
|
4
|
-
const react_1 = require("@emotion/react");
|
|
5
|
-
const tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
6
4
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
7
|
-
const
|
|
8
|
-
function calculateFocusRing({ width, separation,
|
|
5
|
+
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
6
|
+
function calculateFocusRing({ width, separation, inset, innerColor, outerColor, }) {
|
|
9
7
|
let boxShadow, innerWidth, outerWidth;
|
|
10
8
|
if (innerColor && innerColor.startsWith('--')) {
|
|
11
9
|
// eslint-disable-next-line no-param-reassign
|
|
12
|
-
innerColor = innerColor;
|
|
10
|
+
innerColor = canvas_kit_styling_1.cssVar(innerColor);
|
|
13
11
|
}
|
|
14
12
|
if (outerColor && outerColor.startsWith('--')) {
|
|
15
13
|
// eslint-disable-next-line no-param-reassign
|
|
16
|
-
outerColor = outerColor;
|
|
14
|
+
outerColor = canvas_kit_styling_1.cssVar(outerColor);
|
|
17
15
|
}
|
|
18
16
|
switch (inset) {
|
|
19
17
|
case 'outer':
|
|
@@ -32,13 +30,6 @@ function calculateFocusRing({ width, separation, animate, inset, innerColor, out
|
|
|
32
30
|
boxShadow = `0 0 0 ${innerWidth}px ${innerColor}, 0 0 0 ${outerWidth}px ${outerColor}`;
|
|
33
31
|
break;
|
|
34
32
|
}
|
|
35
|
-
if (animate) {
|
|
36
|
-
const fadeIn = react_1.keyframes({
|
|
37
|
-
'0%': { boxShadow },
|
|
38
|
-
'100%': { boxShadow },
|
|
39
|
-
});
|
|
40
|
-
return { animation: `${fadeIn} 100ms`, boxShadow };
|
|
41
|
-
}
|
|
42
33
|
return { boxShadow };
|
|
43
34
|
}
|
|
44
35
|
/**
|
|
@@ -64,9 +55,7 @@ function calculateFocusRing({ width, separation, animate, inset, innerColor, out
|
|
|
64
55
|
* @returns {CSSObject} the css object for the focus ring style
|
|
65
56
|
*/
|
|
66
57
|
function focusRing(options = {}, theme) {
|
|
67
|
-
const { width = 2, separation = 0, animate = true, innerColor =
|
|
68
|
-
? theme.canvas.palette.common.focusOutline
|
|
69
|
-
: index_1.defaultCanvasTheme.palette.common.focusOutline, inset, } = options;
|
|
58
|
+
const { width = 2, separation = 0, animate = true, innerColor = canvas_tokens_web_1.base.frenchVanilla100, outerColor = canvas_tokens_web_1.brand.common.focusOutline, inset, } = options;
|
|
70
59
|
const args = {
|
|
71
60
|
width: width,
|
|
72
61
|
separation: separation,
|
|
@@ -107,17 +107,31 @@ const RadioInput = common_1.styled('input')({
|
|
|
107
107
|
borderWidth: '2px',
|
|
108
108
|
borderColor: variant === 'inverse' ? tokens_1.colors.blackPepper400 : themeFocusOutline,
|
|
109
109
|
boxShadow: 'none',
|
|
110
|
-
...
|
|
110
|
+
...common_1.focusRing({
|
|
111
|
+
width: variant === 'inverse' ? 2 : 0,
|
|
112
|
+
separation: 0,
|
|
113
|
+
animate: false,
|
|
114
|
+
innerColor: variant === 'inverse' ? tokens_1.colors.blackPepper400 : undefined,
|
|
115
|
+
outerColor: variant === 'inverse' ? tokens_1.colors.frenchVanilla100 : undefined,
|
|
116
|
+
}),
|
|
111
117
|
},
|
|
112
118
|
},
|
|
113
119
|
'&:checked:focus ~ div:first-of-type': {
|
|
114
|
-
...
|
|
120
|
+
...common_1.focusRing({
|
|
121
|
+
separation: 2,
|
|
122
|
+
width: 2,
|
|
123
|
+
innerColor: variant === 'inverse' ? tokens_1.colors.blackPepper400 : undefined,
|
|
124
|
+
outerColor: variant === 'inverse' ? tokens_1.colors.frenchVanilla100 : themeFocusOutline,
|
|
125
|
+
}),
|
|
115
126
|
borderColor: variant === 'inverse' ? tokens_1.colors.frenchVanilla100 : themePrimary.main,
|
|
116
127
|
borderWidth: '2px',
|
|
117
128
|
},
|
|
118
129
|
...common_1.mouseFocusBehavior({
|
|
119
130
|
'&:focus ~ div:first-of-type': {
|
|
120
|
-
...
|
|
131
|
+
...common_1.focusRing({
|
|
132
|
+
width: 0,
|
|
133
|
+
outerColor: variant === 'inverse' ? tokens_1.colors.frenchVanilla100 : themeFocusOutline,
|
|
134
|
+
}),
|
|
121
135
|
borderWidth: '1px',
|
|
122
136
|
borderColor: checked
|
|
123
137
|
? variant === 'inverse'
|
|
@@ -3,7 +3,8 @@ import { ExtractProps, Themeable } from '@workday/canvas-kit-react/common';
|
|
|
3
3
|
import { Combobox } from '@workday/canvas-kit-react/combobox';
|
|
4
4
|
import { TextInput } from '@workday/canvas-kit-react/text-input';
|
|
5
5
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
6
|
-
|
|
6
|
+
import { CSProps } from '@workday/canvas-kit-styling';
|
|
7
|
+
export interface SelectInputProps extends ExtractProps<typeof TextInput>, CSProps {
|
|
7
8
|
/**
|
|
8
9
|
* The Icon to render at the start of the `input`. Use this prop if your options
|
|
9
10
|
* include icons that you would like to render in the `input` when selected.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../select/lib/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,YAAY,EAEZ,SAAS,EACV,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAC,MAAM,oCAAoC,CAAC;AAE5D,OAAO,EAAa,SAAS,EAAC,MAAM,sCAAsC,CAAC;AAO3E,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../select/lib/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,YAAY,EAEZ,SAAS,EAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASL,CAAC"}
|
|
@@ -15,15 +15,17 @@ const useSelectModel_1 = require("./hooks/useSelectModel");
|
|
|
15
15
|
const useSelectCard_1 = require("./hooks/useSelectCard");
|
|
16
16
|
const useSelectInput_1 = require("./hooks/useSelectInput");
|
|
17
17
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
18
|
-
const selectInputStyles = canvas_kit_styling_1.createStyles({ name: "
|
|
18
|
+
const selectInputStyles = canvas_kit_styling_1.createStyles({ name: "1gpclr4", styles: "caret-color:transparent;cursor:default;&::selection{background-color:transparent;}" });
|
|
19
|
+
const hiddenSelectStyles = canvas_kit_styling_1.createStyles({ name: "1uxiz6e", styles: "position:absolute;top:0px;bottom:0px;left:0px;right:0px;opacity:0px;cursor:default;pointer-events:none;" });
|
|
19
20
|
exports.SelectInput = common_1.createSubcomponent(text_input_1.TextInput)({
|
|
20
21
|
modelHook: useSelectModel_1.useSelectModel,
|
|
21
22
|
elemPropsHook: useSelectInput_1.useSelectInput,
|
|
22
|
-
})(({ placeholder = 'Choose an option', inputStartIcon, ...elemProps }, Element, model) => {
|
|
23
|
+
})(({ placeholder = 'Choose an option', inputStartIcon, error, textInputProps, disabled, ref, onChange, onInput, onFocus, value, name, ...elemProps }, Element, model) => {
|
|
23
24
|
return (react_1.default.createElement(text_input_1.InputGroup, null,
|
|
24
25
|
inputStartIcon && model.state.selectedIds.length > 0 && (react_1.default.createElement(text_input_1.InputGroup.InnerStart, { pointerEvents: "none" },
|
|
25
26
|
react_1.default.createElement(icon_1.SystemIcon, { icon: inputStartIcon }))),
|
|
26
|
-
react_1.default.createElement(text_input_1.InputGroup.Input,
|
|
27
|
+
react_1.default.createElement(text_input_1.InputGroup.Input, { error: error, disabled: disabled, className: hiddenSelectStyles, tabIndex: -1, "aria-hidden": true, onChange: onChange, onInput: onInput, value: value, onFocus: onFocus, name: name, ref: ref }),
|
|
28
|
+
react_1.default.createElement(text_input_1.InputGroup.Input, Object.assign({ as: Element, disabled: disabled, placeholder: placeholder, error: error }, textInputProps, layout_1.mergeStyles(elemProps, [selectInputStyles]))),
|
|
27
29
|
react_1.default.createElement(text_input_1.InputGroup.InnerEnd, { position: "absolute", pointerEvents: "none" },
|
|
28
30
|
react_1.default.createElement(icon_1.SystemIcon, { icon: canvas_system_icons_web_1.caretDownSmallIcon }))));
|
|
29
31
|
});
|
|
@@ -80,8 +80,13 @@ export declare const useSelectInput: import("@workday/canvas-kit-react/common").
|
|
|
80
80
|
getId: (item: any) => string;
|
|
81
81
|
}, {
|
|
82
82
|
readonly onKeyDown: (event: React.KeyboardEvent) => void;
|
|
83
|
-
readonly
|
|
83
|
+
readonly onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
84
84
|
readonly autoComplete: "off";
|
|
85
|
+
readonly onFocus: () => void;
|
|
86
|
+
readonly textInputProps: {
|
|
87
|
+
readonly ref: React.RefObject<HTMLInputElement>;
|
|
88
|
+
};
|
|
89
|
+
readonly ref: (instance: HTMLInputElement | null) => void;
|
|
85
90
|
readonly defaultValue: string | undefined;
|
|
86
91
|
} & {
|
|
87
92
|
onKeyDown(event: React.KeyboardEvent<Element>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectInput.d.ts","sourceRoot":"","sources":["../../../../../select/lib/hooks/useSelectInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useSelectInput.d.ts","sourceRoot":"","sources":["../../../../../select/lib/hooks/useSelectInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA8CF,mBAAmB;+BAvCP,MAAM,WAAW,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0FvE,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.useSelectInput = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
4
8
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
5
9
|
const combobox_1 = require("@workday/canvas-kit-react/combobox");
|
|
6
10
|
const useSelectModel_1 = require("./useSelectModel");
|
|
@@ -8,9 +12,19 @@ const useSelectModel_1 = require("./useSelectModel");
|
|
|
8
12
|
* `useSelectInput` extends {@link useComboboxInput useComboboxInput} and {@link useComboboxKeyboardTypeAhead useComboboxKeyboardTypeAhead} and adds type ahead functionality and Select-specific [keyboard support](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/).
|
|
9
13
|
*/
|
|
10
14
|
exports.useSelectInput = common_1.composeHooks(common_1.createElemPropsHook(useSelectModel_1.useSelectModel)((model, ref, elemProps = {}) => {
|
|
11
|
-
const {
|
|
15
|
+
const { elementRef } = common_1.useLocalRef(ref);
|
|
16
|
+
const textInputRef = react_1.default.useRef(null);
|
|
17
|
+
// Update the text value of the input
|
|
18
|
+
const handleOnChange = (event) => {
|
|
19
|
+
var _a;
|
|
20
|
+
const value = (_a = model.navigation.getItem(event.target.value, model)) === null || _a === void 0 ? void 0 : _a.textValue;
|
|
21
|
+
const nativeInputValue = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(textInputRef.current), 'value');
|
|
22
|
+
if (nativeInputValue && nativeInputValue.set) {
|
|
23
|
+
nativeInputValue.set.call(textInputRef.current, value);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
12
26
|
common_1.useResizeObserver({
|
|
13
|
-
ref:
|
|
27
|
+
ref: textInputRef,
|
|
14
28
|
onResize: data => {
|
|
15
29
|
if (model.state.visibility === 'visible') {
|
|
16
30
|
// Width of the Input + 2px border + 8px padding
|
|
@@ -19,6 +33,20 @@ exports.useSelectInput = common_1.composeHooks(common_1.createElemPropsHook(useS
|
|
|
19
33
|
}
|
|
20
34
|
},
|
|
21
35
|
});
|
|
36
|
+
// The intent is if items are loaded after the component is rendered, it will update the input with the value.
|
|
37
|
+
// **Note: We might need to watch for other things or how often we should do this**
|
|
38
|
+
react_1.default.useEffect(() => {
|
|
39
|
+
if (model.state.inputRef.current &&
|
|
40
|
+
model.state.items.length > 0 &&
|
|
41
|
+
model.state.selectedIds[0]) {
|
|
42
|
+
const value = model.navigation.getItem(model.state.selectedIds[0], model).id;
|
|
43
|
+
if (model.state.inputRef.current.value !== value) {
|
|
44
|
+
// Programmatically dispatch an onChange once items are loaded. This account for when a consumer wants an initial selected item and they're loading them from a server.
|
|
45
|
+
common_1.dispatchInputEvent(model.state.inputRef.current, value);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
|
+
}, [model.state.inputRef, model.state.items.length]);
|
|
22
50
|
return {
|
|
23
51
|
onKeyDown(event) {
|
|
24
52
|
// Prevent the keys from being enter in the input
|
|
@@ -42,8 +70,21 @@ exports.useSelectInput = common_1.composeHooks(common_1.createElemPropsHook(useS
|
|
|
42
70
|
}
|
|
43
71
|
}
|
|
44
72
|
},
|
|
45
|
-
|
|
73
|
+
onChange: handleOnChange,
|
|
46
74
|
autoComplete: 'off',
|
|
47
|
-
|
|
75
|
+
// When the hidden input is focused, we want to show the focus/hover states of the input that sits below it.
|
|
76
|
+
onFocus() {
|
|
77
|
+
var _a;
|
|
78
|
+
(_a = textInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
79
|
+
},
|
|
80
|
+
textInputProps: {
|
|
81
|
+
ref: textInputRef,
|
|
82
|
+
},
|
|
83
|
+
ref: elementRef,
|
|
84
|
+
// Account for the case where an initial item is selected when the Select first renders
|
|
85
|
+
defaultValue: model.state.selectedIds.length > 0 && model.state.items.length > 0
|
|
86
|
+
? model.navigation.getItem(model.state.selectedIds[0], model).textValue ||
|
|
87
|
+
model.state.value
|
|
88
|
+
: undefined,
|
|
48
89
|
};
|
|
49
90
|
}), combobox_1.useComboboxKeyboardTypeAhead, combobox_1.useComboboxResetCursorToSelected, combobox_1.useComboboxMoveCursorToSelected, combobox_1.useComboboxInput);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectModel.d.ts","sourceRoot":"","sources":["../../../../../select/lib/hooks/useSelectModel.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWzB,CAAC"}
|
|
@@ -53,7 +53,7 @@ const SwitchInput = common_1.styled('input')({
|
|
|
53
53
|
'&:focus': {
|
|
54
54
|
outline: 'none',
|
|
55
55
|
'& ~ div:first-of-type': {
|
|
56
|
-
...{
|
|
56
|
+
...common_1.focusRing({ separation: 2, animate: false }, theme),
|
|
57
57
|
},
|
|
58
58
|
},
|
|
59
59
|
'& ~ div:first-of-type': {
|
|
@@ -63,7 +63,7 @@ const SwitchInput = common_1.styled('input')({
|
|
|
63
63
|
0 0 0 5px ${errorColors.outer}`,
|
|
64
64
|
},
|
|
65
65
|
'&:focus ~ div:first-of-type': {
|
|
66
|
-
...{
|
|
66
|
+
...common_1.focusRing({ separation: 2, animate: false }, theme),
|
|
67
67
|
},
|
|
68
68
|
};
|
|
69
69
|
return {
|
|
@@ -53,7 +53,7 @@ exports.StyledTabItem = common_1.styled(layout_1.Box.as('button'))(({ theme }) =
|
|
|
53
53
|
},
|
|
54
54
|
'&:focus': {
|
|
55
55
|
outline: `none`,
|
|
56
|
-
...{
|
|
56
|
+
...common_1.focusRing({ inset: 'outer', width: 0, separation: 2 }, theme),
|
|
57
57
|
},
|
|
58
58
|
'&:disabled, &[aria-disabled]': {
|
|
59
59
|
color: tokens_1.colors.licorice100,
|