@workday/canvas-kit-react 12.0.0-alpha.899-next.0 → 12.0.0-alpha.903-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/avatar/lib/Avatar.js +21 -21
- package/dist/commonjs/badge/lib/CountBadge.js +3 -3
- package/dist/commonjs/button/lib/BaseButton.js +21 -21
- 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 +18 -18
- package/dist/commonjs/card/lib/Card.js +1 -1
- package/dist/commonjs/card/lib/CardBody.js +1 -1
- package/dist/commonjs/card/lib/CardHeading.js +1 -1
- package/dist/commonjs/checkbox/lib/CheckBackground.js +3 -3
- package/dist/commonjs/checkbox/lib/CheckboxCheck.js +5 -5
- package/dist/commonjs/checkbox/lib/CheckboxContainer.js +1 -1
- package/dist/commonjs/checkbox/lib/CheckboxInput.js +5 -5
- package/dist/commonjs/checkbox/lib/CheckboxRipple.js +1 -1
- package/dist/commonjs/collection/lib/ListBox.js +4 -4
- package/dist/commonjs/combobox/lib/ComboboxMenuItem.js +2 -2
- package/dist/commonjs/combobox/lib/ComboboxMenuList.js +1 -1
- package/dist/commonjs/common/lib/AccessibleHide.js +1 -1
- package/dist/commonjs/common/lib/CanvasProvider.js +1 -1
- package/dist/commonjs/form-field/lib/FormFieldContainer.js +1 -1
- package/dist/commonjs/form-field/lib/FormFieldField.js +1 -1
- package/dist/commonjs/form-field/lib/FormFieldGroupLabel.js +5 -5
- package/dist/commonjs/form-field/lib/FormFieldGroupList.js +3 -3
- package/dist/commonjs/form-field/lib/FormFieldHint.js +3 -3
- package/dist/commonjs/form-field/lib/FormFieldLabel.js +5 -5
- package/dist/commonjs/form-field/lib/formFieldStencil.js +8 -8
- package/dist/commonjs/icon/lib/AccentIcon.js +2 -2
- package/dist/commonjs/icon/lib/AppletIcon.js +1 -1
- package/dist/commonjs/icon/lib/Graphic.js +2 -2
- package/dist/commonjs/icon/lib/Svg.js +2 -2
- package/dist/commonjs/icon/lib/SystemIcon.js +1 -1
- package/dist/commonjs/icon/lib/SystemIconCircle.js +1 -1
- package/dist/commonjs/loading-dots/lib/LoadingDots.js +3 -3
- package/dist/commonjs/menu/lib/MenuCard.js +1 -1
- package/dist/commonjs/menu/lib/MenuList.js +3 -3
- package/dist/commonjs/modal/lib/ModalBody.js +1 -1
- package/dist/commonjs/modal/lib/ModalCard.js +1 -1
- package/dist/commonjs/modal/lib/ModalHeading.js +1 -1
- package/dist/commonjs/modal/lib/ModalOverflowOverlay.js +1 -1
- package/dist/commonjs/modal/lib/ModalOverlay.js +2 -2
- package/dist/commonjs/popup/lib/PopupBody.js +1 -1
- package/dist/commonjs/popup/lib/PopupCard.js +2 -2
- package/dist/commonjs/popup/lib/PopupCloseIcon.js +1 -1
- package/dist/commonjs/popup/lib/PopupHeading.js +1 -1
- package/dist/commonjs/select/lib/Select.js +4 -4
- package/dist/commonjs/switch/lib/Switch.js +7 -7
- package/dist/commonjs/table/lib/Table.js +1 -1
- package/dist/commonjs/table/lib/TableBody.js +1 -1
- package/dist/commonjs/table/lib/TableCaption.js +1 -1
- package/dist/commonjs/table/lib/TableCell.js +1 -1
- package/dist/commonjs/table/lib/TableFooter.js +1 -1
- package/dist/commonjs/table/lib/TableHead.js +1 -1
- package/dist/commonjs/table/lib/TableHeader.js +1 -1
- package/dist/commonjs/table/lib/TableRow.js +1 -1
- package/dist/commonjs/text/lib/LabelText.js +6 -6
- package/dist/commonjs/text/lib/Text.js +16 -16
- package/dist/commonjs/text/lib/TypeLevelComponents.js +4 -4
- package/dist/commonjs/text-area/lib/TextArea.d.ts +4 -4
- package/dist/commonjs/text-area/lib/TextArea.js +5 -5
- package/dist/commonjs/text-input/lib/InputGroup.d.ts +58 -31
- package/dist/commonjs/text-input/lib/InputGroup.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/InputGroup.js +92 -49
- package/dist/commonjs/text-input/lib/TextInput.d.ts +4 -4
- package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInput.js +8 -6
- package/dist/commonjs/toast/lib/Toast.js +1 -1
- package/dist/commonjs/toast/lib/ToastBody.js +1 -1
- package/dist/commonjs/toast/lib/ToastCloseIcon.js +1 -1
- package/dist/commonjs/toast/lib/ToastIcon.js +1 -1
- package/dist/commonjs/toast/lib/ToastMessage.js +1 -1
- package/dist/es6/avatar/lib/Avatar.js +21 -21
- package/dist/es6/badge/lib/CountBadge.js +3 -3
- package/dist/es6/button/lib/BaseButton.js +21 -21
- 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 +18 -18
- package/dist/es6/card/lib/Card.js +1 -1
- package/dist/es6/card/lib/CardBody.js +1 -1
- package/dist/es6/card/lib/CardHeading.js +1 -1
- package/dist/es6/checkbox/lib/CheckBackground.js +3 -3
- package/dist/es6/checkbox/lib/CheckboxCheck.js +5 -5
- package/dist/es6/checkbox/lib/CheckboxContainer.js +1 -1
- package/dist/es6/checkbox/lib/CheckboxInput.js +5 -5
- package/dist/es6/checkbox/lib/CheckboxRipple.js +1 -1
- package/dist/es6/collection/lib/ListBox.js +4 -4
- package/dist/es6/combobox/lib/ComboboxMenuItem.js +2 -2
- package/dist/es6/combobox/lib/ComboboxMenuList.js +1 -1
- package/dist/es6/common/lib/AccessibleHide.js +1 -1
- package/dist/es6/common/lib/CanvasProvider.js +1 -1
- package/dist/es6/form-field/lib/FormFieldContainer.js +1 -1
- package/dist/es6/form-field/lib/FormFieldField.js +1 -1
- package/dist/es6/form-field/lib/FormFieldGroupLabel.js +5 -5
- package/dist/es6/form-field/lib/FormFieldGroupList.js +3 -3
- package/dist/es6/form-field/lib/FormFieldHint.js +3 -3
- package/dist/es6/form-field/lib/FormFieldLabel.js +5 -5
- package/dist/es6/form-field/lib/formFieldStencil.js +8 -8
- package/dist/es6/icon/lib/AccentIcon.js +2 -2
- package/dist/es6/icon/lib/AppletIcon.js +1 -1
- package/dist/es6/icon/lib/Graphic.js +2 -2
- package/dist/es6/icon/lib/Svg.js +2 -2
- package/dist/es6/icon/lib/SystemIcon.js +1 -1
- package/dist/es6/icon/lib/SystemIconCircle.js +1 -1
- package/dist/es6/loading-dots/lib/LoadingDots.js +3 -3
- package/dist/es6/menu/lib/MenuCard.js +1 -1
- package/dist/es6/menu/lib/MenuList.js +3 -3
- package/dist/es6/modal/lib/ModalBody.js +1 -1
- package/dist/es6/modal/lib/ModalCard.js +1 -1
- package/dist/es6/modal/lib/ModalHeading.js +1 -1
- package/dist/es6/modal/lib/ModalOverflowOverlay.js +1 -1
- package/dist/es6/modal/lib/ModalOverlay.js +2 -2
- package/dist/es6/popup/lib/PopupBody.js +1 -1
- package/dist/es6/popup/lib/PopupCard.js +2 -2
- package/dist/es6/popup/lib/PopupCloseIcon.js +1 -1
- package/dist/es6/popup/lib/PopupHeading.js +1 -1
- package/dist/es6/select/lib/Select.js +4 -4
- package/dist/es6/switch/lib/Switch.js +7 -7
- package/dist/es6/table/lib/Table.js +1 -1
- package/dist/es6/table/lib/TableBody.js +1 -1
- package/dist/es6/table/lib/TableCaption.js +1 -1
- package/dist/es6/table/lib/TableCell.js +1 -1
- package/dist/es6/table/lib/TableFooter.js +1 -1
- package/dist/es6/table/lib/TableHead.js +1 -1
- package/dist/es6/table/lib/TableHeader.js +1 -1
- package/dist/es6/table/lib/TableRow.js +1 -1
- package/dist/es6/text/lib/LabelText.js +6 -6
- package/dist/es6/text/lib/Text.js +16 -16
- package/dist/es6/text/lib/TypeLevelComponents.js +4 -4
- package/dist/es6/text-area/lib/TextArea.d.ts +4 -4
- package/dist/es6/text-area/lib/TextArea.js +5 -5
- package/dist/es6/text-input/lib/InputGroup.d.ts +58 -31
- package/dist/es6/text-input/lib/InputGroup.d.ts.map +1 -1
- package/dist/es6/text-input/lib/InputGroup.js +84 -41
- package/dist/es6/text-input/lib/TextInput.d.ts +4 -4
- package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInput.js +8 -6
- package/dist/es6/toast/lib/Toast.js +1 -1
- package/dist/es6/toast/lib/ToastBody.js +1 -1
- package/dist/es6/toast/lib/ToastCloseIcon.js +1 -1
- package/dist/es6/toast/lib/ToastIcon.js +1 -1
- package/dist/es6/toast/lib/ToastMessage.js +1 -1
- package/package.json +4 -4
- package/text-input/lib/InputGroup.tsx +147 -72
- package/text-input/lib/TextInput.tsx +20 -17
|
@@ -32,21 +32,21 @@ const layout_1 = require("@workday/canvas-kit-react/layout");
|
|
|
32
32
|
const Text_1 = require("./Text");
|
|
33
33
|
const labelTextStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
34
34
|
extends: Text_1.textStencil,
|
|
35
|
-
base: { name: "
|
|
35
|
+
base: { name: "nuqno", styles: "box-sizing:border-box;font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-400);line-height:var(--cnvs-base-line-height-100);font-size:var(--cnvs-base-font-size-75);letter-spacing:var(--cnvs-base-letter-spacing-150);color:var(--cnvs-sys-color-text-default);" },
|
|
36
36
|
modifiers: {
|
|
37
37
|
disabled: {
|
|
38
|
-
true: { name: "
|
|
38
|
+
true: { name: "nuqnp", styles: "cursor:default;color:var(--cnvs-sys-color-text-disabled);" }
|
|
39
39
|
},
|
|
40
40
|
variant: {
|
|
41
|
-
inverse: { name: "
|
|
42
|
-
error: { name: "
|
|
43
|
-
hint: { name: "
|
|
41
|
+
inverse: { name: "nuqnq", styles: "color:var(--cnvs-sys-color-text-inverse);" },
|
|
42
|
+
error: { name: "nuqnr", styles: "color:var(--cnvs-sys-color-text-critical-default);" },
|
|
43
|
+
hint: { name: "nuqns", styles: "color:var(--cnvs-sys-color-text-hint);" }
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
compound: [
|
|
47
47
|
{
|
|
48
48
|
modifiers: { variant: 'inverse', disabled: true },
|
|
49
|
-
styles: { name: "
|
|
49
|
+
styles: { name: "nuqnt", styles: "opacity:var(--cnvs-sys-opacity-disabled);color:var(--cnvs-sys-color-text-inverse);" }
|
|
50
50
|
}
|
|
51
51
|
]
|
|
52
52
|
}, "label-text-047ddd");
|
|
@@ -30,30 +30,30 @@ const common_1 = require("@workday/canvas-kit-react/common");
|
|
|
30
30
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
31
31
|
const layout_1 = require("@workday/canvas-kit-react/layout");
|
|
32
32
|
exports.textStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
33
|
-
base: { name: "
|
|
33
|
+
base: { name: "nuqn4", styles: "box-sizing:border-box;" },
|
|
34
34
|
modifiers: {
|
|
35
35
|
typeLevel: {
|
|
36
36
|
// Title level styles
|
|
37
|
-
'title.large': { name: "
|
|
38
|
-
'title.medium': { name: "
|
|
39
|
-
'title.small': { name: "
|
|
37
|
+
'title.large': { name: "nuqn5", styles: "font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-700);line-height:var(--cnvs-base-line-height-600);font-size:var(--cnvs-base-font-size-600);color:var(--cnvs-sys-color-text-strong);" },
|
|
38
|
+
'title.medium': { name: "nuqn6", styles: "font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-700);line-height:var(--cnvs-base-line-height-500);font-size:var(--cnvs-base-font-size-500);color:var(--cnvs-sys-color-text-strong);" },
|
|
39
|
+
'title.small': { name: "nuqn7", styles: "font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-700);line-height:var(--cnvs-base-line-height-400);font-size:var(--cnvs-base-font-size-400);color:var(--cnvs-sys-color-text-strong);" },
|
|
40
40
|
// Heading level styles
|
|
41
|
-
'heading.large': { name: "
|
|
42
|
-
'heading.medium': { name: "
|
|
43
|
-
'heading.small': { name: "
|
|
41
|
+
'heading.large': { name: "nuqn8", styles: "font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-700);line-height:var(--cnvs-base-line-height-350);font-size:var(--cnvs-base-font-size-300);color:var(--cnvs-sys-color-text-strong);" },
|
|
42
|
+
'heading.medium': { name: "nuqn9", styles: "font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-700);line-height:var(--cnvs-base-line-height-300);font-size:var(--cnvs-base-font-size-250);color:var(--cnvs-sys-color-text-strong);" },
|
|
43
|
+
'heading.small': { name: "nuqna", styles: "font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-700);line-height:var(--cnvs-base-line-height-250);font-size:var(--cnvs-base-font-size-200);color:var(--cnvs-sys-color-text-strong);" },
|
|
44
44
|
// Body level styles
|
|
45
|
-
'body.large': { name: "
|
|
46
|
-
'body.medium': { name: "
|
|
47
|
-
'body.small': { name: "
|
|
45
|
+
'body.large': { name: "nuqnb", styles: "font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-400);line-height:var(--cnvs-base-line-height-200);font-size:var(--cnvs-base-font-size-150);color:var(--cnvs-sys-color-text-default);" },
|
|
46
|
+
'body.medium': { name: "nuqnc", styles: "font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-400);line-height:var(--cnvs-base-line-height-200);font-size:var(--cnvs-base-font-size-125);color:var(--cnvs-sys-color-text-default);" },
|
|
47
|
+
'body.small': { name: "nuqnd", styles: "font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-400);line-height:var(--cnvs-base-line-height-150);font-size:var(--cnvs-base-font-size-100);letter-spacing:var(--cnvs-base-letter-spacing-200);color:var(--cnvs-sys-color-text-default);" },
|
|
48
48
|
// Subtext level styles
|
|
49
|
-
'subtext.large': { name: "
|
|
50
|
-
'subtext.medium': { name: "
|
|
51
|
-
'subtext.small': { name: "
|
|
49
|
+
'subtext.large': { name: "nuqne", styles: "font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-400);line-height:var(--cnvs-base-line-height-100);font-size:var(--cnvs-base-font-size-75);letter-spacing:var(--cnvs-base-letter-spacing-150);color:var(--cnvs-sys-color-text-default);" },
|
|
50
|
+
'subtext.medium': { name: "nuqnf", styles: "font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-400);line-height:var(--cnvs-base-line-height-50);font-size:var(--cnvs-base-font-size-50);letter-spacing:var(--cnvs-base-letter-spacing-100);color:var(--cnvs-sys-color-text-default);" },
|
|
51
|
+
'subtext.small': { name: "nuqng", styles: "font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-400);line-height:var(--cnvs-base-line-height-50);font-size:var(--cnvs-base-font-size-25);letter-spacing:var(--cnvs-base-letter-spacing-50);color:var(--cnvs-sys-color-text-default);" }
|
|
52
52
|
},
|
|
53
53
|
variant: {
|
|
54
|
-
error: { name: "
|
|
55
|
-
hint: { name: "
|
|
56
|
-
inverse: { name: "
|
|
54
|
+
error: { name: "nuqnh", styles: "color:var(--cnvs-sys-color-text-critical-default);" },
|
|
55
|
+
hint: { name: "nuqni", styles: "color:var(--cnvs-sys-color-text-hint);" },
|
|
56
|
+
inverse: { name: "nuqnj", styles: "color:var(--cnvs-sys-color-text-inverse);" }
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}, "text-e3da06");
|
|
@@ -31,7 +31,7 @@ const layout_1 = require("@workday/canvas-kit-react/layout");
|
|
|
31
31
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
32
32
|
const subtextStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
33
33
|
extends: Text_1.textStencil,
|
|
34
|
-
base: { name: "
|
|
34
|
+
base: { name: "nuqnk", styles: "box-sizing:border-box;" }
|
|
35
35
|
}, "subtext-4e8604");
|
|
36
36
|
/**
|
|
37
37
|
* This component is intended to be used for small subtext content or in tight spaces.
|
|
@@ -66,7 +66,7 @@ exports.Subtext = (0, common_1.createComponent)('p')({
|
|
|
66
66
|
});
|
|
67
67
|
const bodyTextStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
68
68
|
extends: Text_1.textStencil,
|
|
69
|
-
base: { name: "
|
|
69
|
+
base: { name: "nuqnl", styles: "box-sizing:border-box;" }
|
|
70
70
|
}, "body-text-44de3e");
|
|
71
71
|
/**
|
|
72
72
|
* This component is intended to be used for standard body text.
|
|
@@ -101,7 +101,7 @@ exports.BodyText = (0, common_1.createComponent)('p')({
|
|
|
101
101
|
});
|
|
102
102
|
const headingStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
103
103
|
extends: Text_1.textStencil,
|
|
104
|
-
base: { name: "
|
|
104
|
+
base: { name: "nuqnm", styles: "box-sizing:border-box;" }
|
|
105
105
|
}, "heading-5a3efc");
|
|
106
106
|
/**
|
|
107
107
|
* This component is intended to be used for headings and large text.
|
|
@@ -136,7 +136,7 @@ exports.Heading = (0, common_1.createComponent)('h2')({
|
|
|
136
136
|
});
|
|
137
137
|
const titleStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
138
138
|
extends: Text_1.textStencil,
|
|
139
|
-
base: { name: "
|
|
139
|
+
base: { name: "nuqnn", styles: "box-sizing:border-box;" }
|
|
140
140
|
}, "title-2c12c2");
|
|
141
141
|
/**
|
|
142
142
|
* This component is intended to be used large page titles.
|
|
@@ -46,20 +46,20 @@ export declare const textAreaStencil: import("@workday/canvas-kit-styling").Sten
|
|
|
46
46
|
error: {
|
|
47
47
|
borderColor: "--cnvs-brand-error-base";
|
|
48
48
|
boxShadow: `inset 0 0 0 ${string} --cnvs-brand-error-base`;
|
|
49
|
-
'&:hover,
|
|
49
|
+
'&:is(:hover, .hover, :disabled, .disabled, :focus-visible:not([disabled]), .focus:not([disabled]))': {
|
|
50
50
|
borderColor: "--cnvs-brand-error-base";
|
|
51
51
|
};
|
|
52
|
-
'&:focus-visible
|
|
52
|
+
'&:is(:focus-visible, .focus):not([disabled])': {
|
|
53
53
|
boxShadow: `inset 0 0 0 ${string} --cnvs-brand-error-base, 0 0 0 2px --cnvs-sys-color-border-inverse, 0 0 0 4px --cnvs-brand-common-focus-outline`;
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
alert: {
|
|
57
57
|
borderColor: "--cnvs-brand-alert-darkest";
|
|
58
58
|
boxShadow: `inset 0 0 0 ${string} --cnvs-brand-alert-base`;
|
|
59
|
-
'&:hover,
|
|
59
|
+
'&:is(:hover, .hover, :disabled, .disabled, :focus-visible:not([disabled]), .focus:not([disabled]))': {
|
|
60
60
|
borderColor: "--cnvs-brand-alert-darkest";
|
|
61
61
|
};
|
|
62
|
-
'&:focus-visible
|
|
62
|
+
'&:is(:focus-visible, .focus):not([disabled])': {
|
|
63
63
|
boxShadow: `inset 0 0 0 ${string} --cnvs-brand-alert-base,\n 0 0 0 2px --cnvs-sys-color-border-inverse,\n 0 0 0 4px --cnvs-brand-common-focus-outline`;
|
|
64
64
|
};
|
|
65
65
|
};
|
|
@@ -37,13 +37,13 @@ exports.TextAreaResizeDirection = {
|
|
|
37
37
|
};
|
|
38
38
|
exports.textAreaStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
39
39
|
extends: text_input_1.textInputStencil,
|
|
40
|
-
base: { name: "
|
|
40
|
+
base: { name: "nuqn5q", styles: "box-sizing:border-box;min-height:var(--cnvs-sys-space-x16);min-width:calc(calc(var(--cnvs-sys-space-x20) * 3) + var(--cnvs-sys-space-x10));&::webkit-resizer{display:none;}" },
|
|
41
41
|
modifiers: {
|
|
42
42
|
resize: {
|
|
43
|
-
both: { name: "
|
|
44
|
-
horizontal: { name: "
|
|
45
|
-
vertical: { name: "
|
|
46
|
-
none: { name: "
|
|
43
|
+
both: { name: "nuqn5r", styles: "resize:both;" },
|
|
44
|
+
horizontal: { name: "nuqn5s", styles: "resize:horizontal;" },
|
|
45
|
+
vertical: { name: "nuqn5t", styles: "resize:vertical;" },
|
|
46
|
+
none: { name: "nuqn5u", styles: "resize:none;" }
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
defaultModifiers: {
|
|
@@ -12,26 +12,65 @@ export declare const useInputGroupModel: (<TT_Special_Generic>(config?: (Partial
|
|
|
12
12
|
};
|
|
13
13
|
events: {};
|
|
14
14
|
}>;
|
|
15
|
-
export declare const
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
export declare const inputGroupInnerStencil: import("@workday/canvas-kit-styling").Stencil<{
|
|
16
|
+
pointerEvents: {
|
|
17
|
+
_: ({ pointerEvents }: {
|
|
18
|
+
insetInlineStart: string;
|
|
19
|
+
insetInlineEnd: string;
|
|
20
|
+
width: string;
|
|
21
|
+
height: string;
|
|
22
|
+
pointerEvents: string;
|
|
23
|
+
}) => {
|
|
24
|
+
pointerEvents: string;
|
|
25
|
+
};
|
|
18
26
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
}, {
|
|
28
|
+
/**
|
|
29
|
+
* Offset of the inner item. Set by the `InputGroup` and depends on siblings. Do not change this
|
|
30
|
+
* on your own.
|
|
31
|
+
*/
|
|
32
|
+
insetInlineStart: string;
|
|
33
|
+
/**
|
|
34
|
+
* Offset of the inner item. Set by the `InputGroup` and depends on siblings. Do not change this
|
|
35
|
+
* on your own.
|
|
36
|
+
*/
|
|
37
|
+
insetInlineEnd: string;
|
|
38
|
+
width: "--cnvs-sys-space-x10";
|
|
39
|
+
height: "--cnvs-sys-space-x10";
|
|
40
|
+
/**
|
|
41
|
+
* Some inner input group elements are decoration only and should not have pointer events
|
|
42
|
+
*/
|
|
43
|
+
pointerEvents: string;
|
|
44
|
+
}, never, never>;
|
|
45
|
+
export declare const useInputGroupInput: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
22
46
|
state: {
|
|
23
47
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
24
48
|
};
|
|
25
49
|
events: {};
|
|
50
|
+
}, {
|
|
51
|
+
ref: (instance: unknown) => void;
|
|
26
52
|
}>;
|
|
27
|
-
export declare const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
53
|
+
export declare const inputGroupInputStencil: import("@workday/canvas-kit-styling").Stencil<{
|
|
54
|
+
paddingInlineStart: {
|
|
55
|
+
_: ({ paddingInlineStart }: {
|
|
56
|
+
paddingInlineStart: string;
|
|
57
|
+
paddingInlineEnd: string;
|
|
58
|
+
}) => {
|
|
59
|
+
paddingInlineStart: string;
|
|
60
|
+
};
|
|
32
61
|
};
|
|
33
|
-
|
|
34
|
-
}
|
|
62
|
+
paddingInlineEnd: {
|
|
63
|
+
_: ({ paddingInlineEnd }: {
|
|
64
|
+
paddingInlineStart: string;
|
|
65
|
+
paddingInlineEnd: string;
|
|
66
|
+
}) => {
|
|
67
|
+
paddingInlineEnd: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}, {
|
|
71
|
+
paddingInlineStart: string;
|
|
72
|
+
paddingInlineEnd: string;
|
|
73
|
+
}, never, never>;
|
|
35
74
|
export declare const useClearButton: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
36
75
|
state: {
|
|
37
76
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
@@ -42,23 +81,11 @@ export declare const useClearButton: import("@workday/canvas-kit-react/common").
|
|
|
42
81
|
readonly tabIndex: -1;
|
|
43
82
|
readonly icon: import("@workday/design-assets-types").CanvasSystemIcon;
|
|
44
83
|
readonly size: "small";
|
|
45
|
-
readonly transition: "opacity 300ms ease";
|
|
46
84
|
readonly onMouseDown: (event: React.MouseEvent) => void;
|
|
47
85
|
readonly onClick: () => void;
|
|
48
|
-
readonly
|
|
49
|
-
readonly opacity: 0 | 1;
|
|
50
|
-
readonly pointerEvents: "none" | "auto";
|
|
51
|
-
};
|
|
52
|
-
}>;
|
|
53
|
-
/**
|
|
54
|
-
* A clear input button. This can be a component later.
|
|
55
|
-
*/
|
|
56
|
-
export declare const ClearButton: import("@workday/canvas-kit-react/common").ElementComponentM<import("@workday/canvas-kit-react/common").ElementComponent<"button", import("@workday/canvas-kit-react/button").TertiaryButtonProps>, import("@workday/canvas-kit-react/button").TertiaryButtonProps, {
|
|
57
|
-
state: {
|
|
58
|
-
inputRef: React.RefObject<HTMLInputElement>;
|
|
59
|
-
};
|
|
60
|
-
events: {};
|
|
86
|
+
readonly placeholder: "";
|
|
61
87
|
}>;
|
|
88
|
+
export declare const inputGroupStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, never>, {}, never, never>;
|
|
62
89
|
/**
|
|
63
90
|
* An `InputGroup` is a container around a {@link TextInput} with optional inner start and end
|
|
64
91
|
* elements. The inner start and end elements are usually icons or icon buttons visually represented
|
|
@@ -87,7 +114,7 @@ export declare const InputGroup: import("@workday/canvas-kit-react/common").Elem
|
|
|
87
114
|
}> & {
|
|
88
115
|
/**
|
|
89
116
|
* A component to show inside and at the start of the input. The input's padding will be
|
|
90
|
-
* adjusted to not overlap with this element. Use `width`
|
|
117
|
+
* adjusted by the `InputGroup` to not overlap with this element. Use `width` to adjust the
|
|
91
118
|
* width offset. The width defaults to 40px which is the correct width for icons or icon
|
|
92
119
|
* buttons.
|
|
93
120
|
*/
|
|
@@ -111,9 +138,9 @@ export declare const InputGroup: import("@workday/canvas-kit-react/common").Elem
|
|
|
111
138
|
}>;
|
|
112
139
|
/**
|
|
113
140
|
* A component to show inside and at the end of the input. The input's padding will be adjusted
|
|
114
|
-
* to not overlap with this element. Use `width`
|
|
115
|
-
*
|
|
116
|
-
*
|
|
141
|
+
* by the `InputGroup` to not overlap with this element. Use `width` to adjust the width offset.
|
|
142
|
+
* The width defaults to 40px which is the correct width for icons or icon buttons within the
|
|
143
|
+
* input.
|
|
117
144
|
*/
|
|
118
145
|
InnerEnd: import("@workday/canvas-kit-react/common").ElementComponentM<"div", Omit<import("@workday/canvas-kit-react/layout").BoxProps, "display"> & import("@workday/canvas-kit-react/layout").FlexStyleProps, {
|
|
119
146
|
state: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup.d.ts","sourceRoot":"","sources":["../../../../text-input/lib/InputGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAS7B,CAAC;AAEH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"InputGroup.d.ts","sourceRoot":"","sources":["../../../../text-input/lib/InputGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAS7B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;IAE/B;;;OAGG;;IAEH;;;OAGG;;;;IAIH;;OAEG;;gBAkBL,CAAC;AA4CH,eAAO,MAAM,kBAAkB;;;;;;;EAM7B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;gBAiBjC,CAAC;AAsBH,eAAO,MAAM,cAAc;;;;;;;;;;kCAWJ,gBAAgB;;;EASrC,CAAC;AA6BH,eAAO,MAAM,iBAAiB,yIAkB5B,CAAC;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,UAAU;;;;;;IAInB;;;;;OAKG;;;;;;;IAEH;;;OAGG;;;;;;;;;IAEH;;;;;OAKG;;;;;;;IAEH;;;OAGG;;;;;;;CAsDL,CAAC"}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.InputGroup = exports.
|
|
6
|
+
exports.InputGroup = exports.inputGroupStencil = exports.useClearButton = exports.inputGroupInputStencil = exports.useInputGroupInput = exports.inputGroupInnerStencil = exports.useInputGroupModel = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
9
9
|
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
@@ -21,38 +21,85 @@ exports.useInputGroupModel = (0, common_1.createModelHook)({})(() => {
|
|
|
21
21
|
events: {},
|
|
22
22
|
};
|
|
23
23
|
});
|
|
24
|
-
exports.
|
|
24
|
+
exports.inputGroupInnerStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
25
|
+
vars: {
|
|
26
|
+
/**
|
|
27
|
+
* Offset of the inner item. Set by the `InputGroup` and depends on siblings. Do not change this
|
|
28
|
+
* on your own.
|
|
29
|
+
*/
|
|
30
|
+
insetInlineStart: 'initial',
|
|
31
|
+
/**
|
|
32
|
+
* Offset of the inner item. Set by the `InputGroup` and depends on siblings. Do not change this
|
|
33
|
+
* on your own.
|
|
34
|
+
*/
|
|
35
|
+
insetInlineEnd: 'initial',
|
|
36
|
+
width: canvas_tokens_web_1.system.space.x10,
|
|
37
|
+
height: canvas_tokens_web_1.system.space.x10,
|
|
38
|
+
/**
|
|
39
|
+
* Some inner input group elements are decoration only and should not have pointer events
|
|
40
|
+
*/
|
|
41
|
+
pointerEvents: '',
|
|
42
|
+
},
|
|
43
|
+
base: { name: "nuqn3z", styles: "--insetInlineStart-input-group-inner-74be52:initial;--insetInlineEnd-input-group-inner-74be52:initial;--width-input-group-inner-74be52:var(--cnvs-sys-space-x10);--height-input-group-inner-74be52:var(--cnvs-sys-space-x10);box-sizing:border-box;display:flex;position:absolute;align-items:center;justify-content:center;width:var(--width-input-group-inner-74be52);height:var(--height-input-group-inner-74be52);inset-inline-start:var(--insetInlineStart-input-group-inner-74be52);inset-inline-end:var(--insetInlineEnd-input-group-inner-74be52);" },
|
|
44
|
+
modifiers: {
|
|
45
|
+
pointerEvents: {
|
|
46
|
+
_: { name: "nuqn40", styles: "pointer-events:var(--pointerEvents-input-group-inner-74be52);" }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, "input-group-inner-74be52");
|
|
50
|
+
const InputGroupInnerStart = (0, common_1.createSubcomponent)('div')({
|
|
25
51
|
modelHook: exports.useInputGroupModel,
|
|
26
|
-
})((elemProps, Element) => {
|
|
27
|
-
return (react_1.default.createElement(
|
|
52
|
+
})(({ pointerEvents, insetInlineStart, insetInlineEnd, width, height, ...elemProps }, Element) => {
|
|
53
|
+
return (react_1.default.createElement(Element, { ...(0, layout_1.mergeStyles)(elemProps, (0, exports.inputGroupInnerStencil)({
|
|
54
|
+
pointerEvents,
|
|
55
|
+
insetInlineStart: toPx(insetInlineStart),
|
|
56
|
+
insetInlineEnd: toPx(insetInlineEnd),
|
|
57
|
+
width: toPx(width),
|
|
58
|
+
height: toPx(height),
|
|
59
|
+
})) }));
|
|
28
60
|
});
|
|
29
|
-
|
|
61
|
+
const InputGroupInnerEnd = (0, common_1.createSubcomponent)('div')({
|
|
30
62
|
modelHook: exports.useInputGroupModel,
|
|
31
|
-
})((elemProps, Element) => {
|
|
32
|
-
return (react_1.default.createElement(
|
|
63
|
+
})(({ pointerEvents, insetInlineStart, insetInlineEnd, width, height, ...elemProps }, Element) => {
|
|
64
|
+
return (react_1.default.createElement(Element, { ...(0, layout_1.mergeStyles)(elemProps, (0, exports.inputGroupInnerStencil)({
|
|
65
|
+
pointerEvents,
|
|
66
|
+
insetInlineStart: insetInlineStart,
|
|
67
|
+
insetInlineEnd: insetInlineEnd,
|
|
68
|
+
width: toPx(width),
|
|
69
|
+
height: toPx(height),
|
|
70
|
+
})) }));
|
|
33
71
|
});
|
|
34
|
-
|
|
72
|
+
exports.useInputGroupInput = (0, common_1.createElemPropsHook)(exports.useInputGroupModel)((model, ref) => {
|
|
35
73
|
const elementRef = (0, common_1.useForkRef)(ref, model.state.inputRef);
|
|
36
74
|
return {
|
|
37
75
|
ref: elementRef,
|
|
38
76
|
};
|
|
39
77
|
});
|
|
40
|
-
exports.
|
|
78
|
+
exports.inputGroupInputStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
79
|
+
vars: {
|
|
80
|
+
paddingInlineStart: '',
|
|
81
|
+
paddingInlineEnd: '',
|
|
82
|
+
},
|
|
83
|
+
base: { name: "nuqn41", styles: "box-sizing:border-box;display:flex;width:100%;" },
|
|
84
|
+
modifiers: {
|
|
85
|
+
paddingInlineStart: {
|
|
86
|
+
_: { name: "nuqn42", styles: "padding-inline-start:var(--paddingInlineStart-input-group-input-0042c7);" }
|
|
87
|
+
},
|
|
88
|
+
paddingInlineEnd: {
|
|
89
|
+
_: { name: "nuqn43", styles: "padding-inline-end:var(--paddingInlineEnd-input-group-input-0042c7);" }
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, "input-group-input-0042c7");
|
|
93
|
+
const InputGroupInput = (0, common_1.createSubcomponent)(TextInput_1.TextInput)({
|
|
41
94
|
modelHook: exports.useInputGroupModel,
|
|
42
|
-
elemPropsHook: useInputGroupInput,
|
|
43
|
-
})((elemProps, Element) => {
|
|
44
|
-
return react_1.default.createElement(
|
|
95
|
+
elemPropsHook: exports.useInputGroupInput,
|
|
96
|
+
})(({ paddingInlineStart, paddingInlineEnd, ...elemProps }, Element) => {
|
|
97
|
+
return (react_1.default.createElement(Element, { as: Element, ...(0, layout_1.mergeStyles)(elemProps, (0, exports.inputGroupInputStencil)({
|
|
98
|
+
paddingInlineStart: toPx(paddingInlineStart),
|
|
99
|
+
paddingInlineEnd: toPx(paddingInlineEnd),
|
|
100
|
+
})) }));
|
|
45
101
|
});
|
|
46
102
|
exports.useClearButton = (0, common_1.createElemPropsHook)(exports.useInputGroupModel)(model => {
|
|
47
|
-
const [inputHasValue, setInputHasValue] = react_1.default.useState(false);
|
|
48
|
-
react_1.default.useLayoutEffect(() => {
|
|
49
|
-
const input = model.state.inputRef.current;
|
|
50
|
-
if (input) {
|
|
51
|
-
input.addEventListener('input', () => {
|
|
52
|
-
setInputHasValue(!!input.value);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}, [model.state.inputRef]);
|
|
56
103
|
return {
|
|
57
104
|
// This element does not need to be accessible via screen reader. The user can already clear
|
|
58
105
|
// an input
|
|
@@ -62,7 +109,6 @@ exports.useClearButton = (0, common_1.createElemPropsHook)(exports.useInputGroup
|
|
|
62
109
|
icon: canvas_system_icons_web_1.xSmallIcon,
|
|
63
110
|
// "small" is needed to render correctly within a `TextInput`
|
|
64
111
|
size: 'small',
|
|
65
|
-
transition: 'opacity 300ms ease',
|
|
66
112
|
// prevent a focus change to the button. Focus should stay in the input.
|
|
67
113
|
onMouseDown(event) {
|
|
68
114
|
event.preventDefault();
|
|
@@ -71,20 +117,17 @@ exports.useClearButton = (0, common_1.createElemPropsHook)(exports.useInputGroup
|
|
|
71
117
|
// This will clear the input's value
|
|
72
118
|
(0, common_1.dispatchInputEvent)(model.state.inputRef.current, '');
|
|
73
119
|
},
|
|
74
|
-
|
|
75
|
-
opacity: inputHasValue ? 1 : 0,
|
|
76
|
-
pointerEvents: inputHasValue ? 'auto' : 'none',
|
|
77
|
-
},
|
|
120
|
+
placeholder: '', // Make sure a placeholder attribute always exists for `:placeholder-shown`
|
|
78
121
|
};
|
|
79
122
|
});
|
|
80
123
|
/**
|
|
81
124
|
* A clear input button. This can be a component later.
|
|
82
125
|
*/
|
|
83
|
-
|
|
126
|
+
const ClearButton = (0, common_1.createSubcomponent)(button_1.TertiaryButton)({
|
|
84
127
|
modelHook: exports.useInputGroupModel,
|
|
85
128
|
elemPropsHook: exports.useClearButton,
|
|
86
129
|
})((elemProps, Element) => {
|
|
87
|
-
return react_1.default.createElement(Element, { ...elemProps });
|
|
130
|
+
return react_1.default.createElement(Element, { "data-part": "input-group-clear-button", ...(0, canvas_kit_styling_1.handleCsProp)(elemProps) });
|
|
88
131
|
});
|
|
89
132
|
// make sure we always use pixels if the input is a number - this is required for `calc`
|
|
90
133
|
const toPx = (input) => {
|
|
@@ -101,6 +144,9 @@ const wrapInCalc = (values) => {
|
|
|
101
144
|
}
|
|
102
145
|
return `calc(${values.map(toPx).join(' + ')})`;
|
|
103
146
|
};
|
|
147
|
+
exports.inputGroupStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
148
|
+
base: { name: "nuqn44", styles: "box-sizing:border-box;display:flex;position:relative;& :has([data-part=\"input-group-clear-button\"]){transition:opacity 300ms ease;opacity:1;pointer-events:auto;}&:where(:has(input:placeholder-shown)) :has([data-part=\"input-group-clear-button\"]){opacity:0;pointer-events:none;}" }
|
|
149
|
+
}, "input-group-e70946");
|
|
104
150
|
/**
|
|
105
151
|
* An `InputGroup` is a container around a {@link TextInput} with optional inner start and end
|
|
106
152
|
* elements. The inner start and end elements are usually icons or icon buttons visually represented
|
|
@@ -127,41 +173,40 @@ exports.InputGroup = (0, common_1.createContainer)('div')({
|
|
|
127
173
|
subComponents: {
|
|
128
174
|
/**
|
|
129
175
|
* A component to show inside and at the start of the input. The input's padding will be
|
|
130
|
-
* adjusted to not overlap with this element. Use `width`
|
|
176
|
+
* adjusted by the `InputGroup` to not overlap with this element. Use `width` to adjust the
|
|
131
177
|
* width offset. The width defaults to 40px which is the correct width for icons or icon
|
|
132
178
|
* buttons.
|
|
133
179
|
*/
|
|
134
|
-
InnerStart:
|
|
180
|
+
InnerStart: InputGroupInnerStart,
|
|
135
181
|
/**
|
|
136
182
|
* The input to render. By default, this is a {@link TextInput}. Use the `as` prop to change the
|
|
137
183
|
* component to be rendered.
|
|
138
184
|
*/
|
|
139
|
-
Input:
|
|
185
|
+
Input: InputGroupInput,
|
|
140
186
|
/**
|
|
141
187
|
* A component to show inside and at the end of the input. The input's padding will be adjusted
|
|
142
|
-
* to not overlap with this element. Use `width`
|
|
143
|
-
*
|
|
144
|
-
*
|
|
188
|
+
* by the `InputGroup` to not overlap with this element. Use `width` to adjust the width offset.
|
|
189
|
+
* The width defaults to 40px which is the correct width for icons or icon buttons within the
|
|
190
|
+
* input.
|
|
145
191
|
*/
|
|
146
|
-
InnerEnd:
|
|
192
|
+
InnerEnd: InputGroupInnerEnd,
|
|
147
193
|
/**
|
|
148
194
|
* A component that can be added to an input group that will clear the input. It will only render
|
|
149
195
|
* when the input has a value and will fade when a value is entered.
|
|
150
196
|
*/
|
|
151
|
-
ClearButton:
|
|
197
|
+
ClearButton: ClearButton,
|
|
152
198
|
},
|
|
153
199
|
})(({ children, ...elemProps }, Element) => {
|
|
154
|
-
const isRTL = (0, common_1.useIsRTL)();
|
|
155
200
|
const offsetsStart = [];
|
|
156
201
|
const offsetsEnd = [];
|
|
157
202
|
// Collect the widths of the `InnerStart` and `InnerEnd` components into `offsetStart` and
|
|
158
203
|
// `offsetEnd` arrays
|
|
159
204
|
react_1.default.Children.forEach(children, child => {
|
|
160
|
-
if (react_1.default.isValidElement(child) && child.type ===
|
|
205
|
+
if (react_1.default.isValidElement(child) && child.type === InputGroupInnerStart) {
|
|
161
206
|
const width = (0, canvas_kit_styling_1.maybeWrapCSSVariables)(child.props.width || canvas_tokens_web_1.system.space.x10);
|
|
162
207
|
offsetsStart.push(width);
|
|
163
208
|
}
|
|
164
|
-
if (react_1.default.isValidElement(child) && child.type ===
|
|
209
|
+
if (react_1.default.isValidElement(child) && child.type === InputGroupInnerEnd) {
|
|
165
210
|
const width = (0, canvas_kit_styling_1.maybeWrapCSSVariables)(child.props.width || canvas_tokens_web_1.system.space.x10);
|
|
166
211
|
offsetsEnd.push(width);
|
|
167
212
|
}
|
|
@@ -172,30 +217,28 @@ exports.InputGroup = (0, common_1.createContainer)('div')({
|
|
|
172
217
|
// Loop over all the children and set the correct padding and positions
|
|
173
218
|
const mappedChildren = react_1.default.Children.map(children, child => {
|
|
174
219
|
if (react_1.default.isValidElement(child)) {
|
|
175
|
-
if (child.type ===
|
|
220
|
+
if (child.type === InputGroupInput) {
|
|
176
221
|
return react_1.default.cloneElement(child, {
|
|
177
222
|
paddingInlineStart: wrapInCalc(offsetsStart),
|
|
178
223
|
paddingInlineEnd: wrapInCalc(offsetsEnd),
|
|
179
224
|
});
|
|
180
225
|
}
|
|
181
|
-
if (child.type ===
|
|
182
|
-
const offset = wrapInCalc(offsetsStart.slice(0, indexStart)) ||
|
|
226
|
+
if (child.type === InputGroupInnerStart) {
|
|
227
|
+
const offset = wrapInCalc(offsetsStart.slice(0, indexStart)) || '0px';
|
|
183
228
|
indexStart++;
|
|
184
229
|
return react_1.default.cloneElement(child, {
|
|
185
|
-
|
|
186
|
-
right: isRTL ? offset : undefined,
|
|
230
|
+
insetInlineStart: offset,
|
|
187
231
|
});
|
|
188
232
|
}
|
|
189
|
-
if (child.type ===
|
|
190
|
-
const offset = wrapInCalc(offsetsEnd.slice(indexEnd, -1)) ||
|
|
233
|
+
if (child.type === InputGroupInnerEnd) {
|
|
234
|
+
const offset = wrapInCalc(offsetsEnd.slice(indexEnd, -1)) || '0px';
|
|
191
235
|
indexEnd++;
|
|
192
236
|
return react_1.default.cloneElement(child, {
|
|
193
|
-
|
|
194
|
-
right: isRTL ? undefined : offset,
|
|
237
|
+
insetInlineEnd: offset,
|
|
195
238
|
});
|
|
196
239
|
}
|
|
197
240
|
}
|
|
198
241
|
return child;
|
|
199
242
|
});
|
|
200
|
-
return
|
|
243
|
+
return react_1.default.createElement(Element, { ...(0, layout_1.mergeStyles)(elemProps, (0, exports.inputGroupStencil)()) }, mappedChildren);
|
|
201
244
|
});
|
|
@@ -24,20 +24,20 @@ export declare const textInputStencil: import("@workday/canvas-kit-styling").Ste
|
|
|
24
24
|
error: {
|
|
25
25
|
borderColor: "--cnvs-brand-error-base";
|
|
26
26
|
boxShadow: `inset 0 0 0 ${string} --cnvs-brand-error-base`;
|
|
27
|
-
'&:hover,
|
|
27
|
+
'&:is(:hover, .hover, :disabled, .disabled, :focus-visible:not([disabled]), .focus:not([disabled]))': {
|
|
28
28
|
borderColor: "--cnvs-brand-error-base";
|
|
29
29
|
};
|
|
30
|
-
'&:focus-visible
|
|
30
|
+
'&:is(:focus-visible, .focus):not([disabled])': {
|
|
31
31
|
boxShadow: `inset 0 0 0 ${string} --cnvs-brand-error-base, 0 0 0 2px --cnvs-sys-color-border-inverse, 0 0 0 4px --cnvs-brand-common-focus-outline`;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
alert: {
|
|
35
35
|
borderColor: "--cnvs-brand-alert-darkest";
|
|
36
36
|
boxShadow: `inset 0 0 0 ${string} --cnvs-brand-alert-base`;
|
|
37
|
-
'&:hover,
|
|
37
|
+
'&:is(:hover, .hover, :disabled, .disabled, :focus-visible:not([disabled]), .focus:not([disabled]))': {
|
|
38
38
|
borderColor: "--cnvs-brand-alert-darkest";
|
|
39
39
|
};
|
|
40
|
-
'&:focus-visible
|
|
40
|
+
'&:is(:focus-visible, .focus):not([disabled])': {
|
|
41
41
|
boxShadow: `inset 0 0 0 ${string} --cnvs-brand-alert-base,\n 0 0 0 2px --cnvs-sys-color-border-inverse,\n 0 0 0 4px --cnvs-brand-common-focus-outline`;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../text-input/lib/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,cAAc,EAAE,SAAS,EAAC,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAsC,OAAO,EAAC,MAAM,6BAA6B,CAAC;AAIzF,MAAM,WAAW,cAAe,SAAQ,cAAc,EAAE,OAAO;IAC7D;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../text-input/lib/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,cAAc,EAAE,SAAS,EAAC,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAsC,OAAO,EAAC,MAAM,6BAA6B,CAAC;AAIzF,MAAM,WAAW,cAAe,SAAQ,cAAc,EAAE,OAAO;IAC7D;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAsF3B,CAAC;AAEH,eAAO,MAAM,SAAS;;CAiBpB,CAAC"}
|
|
@@ -33,15 +33,15 @@ exports.textInputStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
|
33
33
|
vars: {
|
|
34
34
|
width: '',
|
|
35
35
|
},
|
|
36
|
-
base: { name: "
|
|
36
|
+
base: { name: "nuqn3u", styles: "box-sizing:border-box;font-family:var(--cnvs-base-font-family-50);font-weight:var(--cnvs-base-font-weight-400);line-height:var(--cnvs-base-line-height-100);font-size:var(--cnvs-base-font-size-75);letter-spacing:var(--cnvs-base-letter-spacing-150);display:block;border:0.0625rem solid var(--cnvs-sys-color-border-input-default);background-color:var(--cnvs-sys-color-bg-default);border-radius:var(--cnvs-sys-shape-x1);height:var(--cnvs-sys-space-x10);transition:0.2s box-shadow, 0.2s border-color;padding:var(--cnvs-sys-space-x2);margin:0rem;width:var(--width-text-input-d81f49);min-width:var(--width-text-input-d81f49, calc(calc(var(--cnvs-sys-space-x20) * 3) + var(--cnvs-sys-space-x10)));color:var(--cnvs-sys-color-text-default);text-overflow:ellipsis;::-ms-clear{display:none;}&::placeholder{color:var(--cnvs-sys-color-text-hint);}&:is(:hover, .hover){border-color:var(--cnvs-sys-color-border-input-strong);}&:is(:focus-visible, .focus):where(:not([disabled])){border-color:var(--cnvs-brand-common-focus-outline);box-shadow:inset 0 0 0 1px var(--cnvs-brand-common-focus-outline);outline:none;}&:is(:disabled, .disabled){background-color:var(--cnvs-sys-color-bg-alt-softer);border-color:var(--cnvs-sys-color-border-input-disabled);color:var(--cnvs-sys-color-text-disabled);&::placeholder{color:var(--cnvs-sys-color-text-disabled);}}" },
|
|
37
37
|
modifiers: {
|
|
38
38
|
grow: {
|
|
39
|
-
true: { name: "
|
|
40
|
-
false: { name: "
|
|
39
|
+
true: { name: "nuqn3v", styles: "width:100%;resize:vertical;" },
|
|
40
|
+
false: { name: "nuqn3w", styles: "width:initial;" }
|
|
41
41
|
},
|
|
42
42
|
error: {
|
|
43
|
-
error: { name: "
|
|
44
|
-
alert: { name: "
|
|
43
|
+
error: { name: "nuqn3x", styles: "border-color:var(--cnvs-brand-error-base);box-shadow:inset 0 0 0 0.0625rem var(--cnvs-brand-error-base);&:is(:hover, .hover, :disabled, .disabled, :focus-visible:not([disabled]), .focus:not([disabled])){border-color:var(--cnvs-brand-error-base);}&:is(:focus-visible, .focus):not([disabled]){box-shadow:inset 0 0 0 0.0625rem var(--cnvs-brand-error-base), 0 0 0 2px var(--cnvs-sys-color-border-inverse), 0 0 0 4px var(--cnvs-brand-common-focus-outline);}" },
|
|
44
|
+
alert: { name: "nuqn3y", styles: "border-color:var(--cnvs-brand-alert-darkest);box-shadow:inset 0 0 0 0.125rem var(--cnvs-brand-alert-base);&:is(:hover, .hover, :disabled, .disabled, :focus-visible:not([disabled]), .focus:not([disabled])){border-color:var(--cnvs-brand-alert-darkest);}&:is(:focus-visible, .focus):not([disabled]){box-shadow:inset 0 0 0 0.125rem var(--cnvs-brand-alert-base),\n 0 0 0 2px var(--cnvs-sys-color-border-inverse),\n 0 0 0 4px var(--cnvs-brand-common-focus-outline);}" }
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
defaultModifiers: {
|
|
@@ -50,7 +50,9 @@ exports.textInputStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
|
50
50
|
}, "text-input-d81f49");
|
|
51
51
|
exports.TextInput = (0, common_1.createComponent)('input')({
|
|
52
52
|
displayName: 'TextInput',
|
|
53
|
-
Component: ({ grow, error, width, ...elemProps }, ref, Element) =>
|
|
53
|
+
Component: ({ grow, error, width, ...elemProps }, ref, Element) => {
|
|
54
|
+
return (React.createElement(Element, { type: "text", ref: ref, ...(0, layout_1.mergeStyles)(elemProps, (0, exports.textInputStencil)({ width: typeof width === 'number' ? (0, canvas_kit_styling_1.px2rem)(width) : width, grow, error })) }));
|
|
55
|
+
},
|
|
54
56
|
subComponents: {
|
|
55
57
|
ErrorType: common_1.ErrorType,
|
|
56
58
|
},
|