@workday/canvas-kit-react 12.0.0-alpha.902-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
|
@@ -3,7 +3,7 @@ import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
|
3
3
|
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
4
4
|
import { createStencil } from '@workday/canvas-kit-styling';
|
|
5
5
|
const tableFooterStencil = createStencil({
|
|
6
|
-
base: { name: "
|
|
6
|
+
base: { name: "p7t95n", styles: "box-sizing:border-box;display:grid;" }
|
|
7
7
|
}, "table-footer-9bbb07");
|
|
8
8
|
export const TableFooter = createComponent('tfoot')({
|
|
9
9
|
displayName: 'Table.Footer',
|
|
@@ -4,7 +4,7 @@ import { createComponent } from '@workday/canvas-kit-react/common';
|
|
|
4
4
|
import { calc, createStencil } from '@workday/canvas-kit-styling';
|
|
5
5
|
import { system } from '@workday/canvas-tokens-web';
|
|
6
6
|
const tableHeadStencil = createStencil({
|
|
7
|
-
base: { name: "
|
|
7
|
+
base: { name: "p7t95i", styles: "box-sizing:border-box;display:grid;background-color:var(--cnvs-sys-color-bg-alt-softer);min-height:calc(var(--cnvs-sys-space-x16) - var(--cnvs-sys-space-x4));th {&:first-of-type{border-inline-start:none;}&:last-of-type{border-inline-end:none;}}" }
|
|
8
8
|
}, "table-head-c91e37");
|
|
9
9
|
export const TableHead = createComponent('thead')({
|
|
10
10
|
displayName: 'Table.Head',
|
|
@@ -4,7 +4,7 @@ import { createComponent } from '@workday/canvas-kit-react/common';
|
|
|
4
4
|
import { calc, createStencil, px2rem } from '@workday/canvas-kit-styling';
|
|
5
5
|
import { system } from '@workday/canvas-tokens-web';
|
|
6
6
|
const tableHeaderStencil = createStencil({
|
|
7
|
-
base: { name: "
|
|
7
|
+
base: { name: "p7t95l", styles: "box-sizing:border-box;display:grid;align-items:center;background-color:var(--cnvs-sys-color-bg-default);border-bottom:0.0625rem solid var(--cnvs-sys-color-border-divider);justify-content:start;min-height:calc(var(--cnvs-sys-space-x16) - var(--cnvs-sys-space-x2));padding:var(--cnvs-sys-space-x2) var(--cnvs-sys-space-x4);word-break:break-word;font-weight:var(--cnvs-sys-font-weight-medium);" }
|
|
8
8
|
}, "table-header-8f0b37");
|
|
9
9
|
export const TableHeader = createComponent('th')({
|
|
10
10
|
displayName: 'Table.Header',
|
|
@@ -5,7 +5,7 @@ import { createStencil, createVars } from '@workday/canvas-kit-styling';
|
|
|
5
5
|
const childrenVars = createVars({ id: "4d9bf5", args: ["cellNumber"] });
|
|
6
6
|
// Styles for rows including dynamic sizing for amount of cells within a row
|
|
7
7
|
const tableRowStencil = createStencil({
|
|
8
|
-
base: { name: "
|
|
8
|
+
base: { name: "p7t95k", styles: "box-sizing:border-box;display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--cellNumber-4d9bf5), minmax(10rem, 1fr));" }
|
|
9
9
|
}, "table-row-a6e914");
|
|
10
10
|
export const TableRow = createComponent('tr')({
|
|
11
11
|
displayName: 'Table.Row',
|
|
@@ -6,21 +6,21 @@ import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
|
6
6
|
import { textStencil } from './Text';
|
|
7
7
|
const labelTextStencil = createStencil({
|
|
8
8
|
extends: textStencil,
|
|
9
|
-
base: { name: "
|
|
9
|
+
base: { name: "p7t9o", 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);" },
|
|
10
10
|
modifiers: {
|
|
11
11
|
disabled: {
|
|
12
|
-
true: { name: "
|
|
12
|
+
true: { name: "p7t9p", styles: "cursor:default;color:var(--cnvs-sys-color-text-disabled);" }
|
|
13
13
|
},
|
|
14
14
|
variant: {
|
|
15
|
-
inverse: { name: "
|
|
16
|
-
error: { name: "
|
|
17
|
-
hint: { name: "
|
|
15
|
+
inverse: { name: "p7t9q", styles: "color:var(--cnvs-sys-color-text-inverse);" },
|
|
16
|
+
error: { name: "p7t9r", styles: "color:var(--cnvs-sys-color-text-critical-default);" },
|
|
17
|
+
hint: { name: "p7t9s", styles: "color:var(--cnvs-sys-color-text-hint);" }
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
compound: [
|
|
21
21
|
{
|
|
22
22
|
modifiers: { variant: 'inverse', disabled: true },
|
|
23
|
-
styles: { name: "
|
|
23
|
+
styles: { name: "p7t9t", styles: "opacity:var(--cnvs-sys-opacity-disabled);color:var(--cnvs-sys-color-text-inverse);" }
|
|
24
24
|
}
|
|
25
25
|
]
|
|
26
26
|
}, "label-text-047ddd");
|
|
@@ -4,30 +4,30 @@ import { createComponent } from '@workday/canvas-kit-react/common';
|
|
|
4
4
|
import { createStencil } from '@workday/canvas-kit-styling';
|
|
5
5
|
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
6
6
|
export const textStencil = createStencil({
|
|
7
|
-
base: { name: "
|
|
7
|
+
base: { name: "p7t94", styles: "box-sizing:border-box;" },
|
|
8
8
|
modifiers: {
|
|
9
9
|
typeLevel: {
|
|
10
10
|
// Title level styles
|
|
11
|
-
'title.large': { name: "
|
|
12
|
-
'title.medium': { name: "
|
|
13
|
-
'title.small': { name: "
|
|
11
|
+
'title.large': { name: "p7t95", 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);" },
|
|
12
|
+
'title.medium': { name: "p7t96", 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);" },
|
|
13
|
+
'title.small': { name: "p7t97", 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);" },
|
|
14
14
|
// Heading level styles
|
|
15
|
-
'heading.large': { name: "
|
|
16
|
-
'heading.medium': { name: "
|
|
17
|
-
'heading.small': { name: "
|
|
15
|
+
'heading.large': { name: "p7t98", 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);" },
|
|
16
|
+
'heading.medium': { name: "p7t99", 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);" },
|
|
17
|
+
'heading.small': { name: "p7t9a", 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);" },
|
|
18
18
|
// Body level styles
|
|
19
|
-
'body.large': { name: "
|
|
20
|
-
'body.medium': { name: "
|
|
21
|
-
'body.small': { name: "
|
|
19
|
+
'body.large': { name: "p7t9b", 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);" },
|
|
20
|
+
'body.medium': { name: "p7t9c", 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);" },
|
|
21
|
+
'body.small': { name: "p7t9d", 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);" },
|
|
22
22
|
// Subtext level styles
|
|
23
|
-
'subtext.large': { name: "
|
|
24
|
-
'subtext.medium': { name: "
|
|
25
|
-
'subtext.small': { name: "
|
|
23
|
+
'subtext.large': { name: "p7t9e", 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);" },
|
|
24
|
+
'subtext.medium': { name: "p7t9f", 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);" },
|
|
25
|
+
'subtext.small': { name: "p7t9g", 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);" }
|
|
26
26
|
},
|
|
27
27
|
variant: {
|
|
28
|
-
error: { name: "
|
|
29
|
-
hint: { name: "
|
|
30
|
-
inverse: { name: "
|
|
28
|
+
error: { name: "p7t9h", styles: "color:var(--cnvs-sys-color-text-critical-default);" },
|
|
29
|
+
hint: { name: "p7t9i", styles: "color:var(--cnvs-sys-color-text-hint);" },
|
|
30
|
+
inverse: { name: "p7t9j", styles: "color:var(--cnvs-sys-color-text-inverse);" }
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}, "text-e3da06");
|
|
@@ -5,7 +5,7 @@ import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
|
5
5
|
import { createStencil } from '@workday/canvas-kit-styling';
|
|
6
6
|
const subtextStencil = createStencil({
|
|
7
7
|
extends: textStencil,
|
|
8
|
-
base: { name: "
|
|
8
|
+
base: { name: "p7t9k", styles: "box-sizing:border-box;" }
|
|
9
9
|
}, "subtext-4e8604");
|
|
10
10
|
/**
|
|
11
11
|
* This component is intended to be used for small subtext content or in tight spaces.
|
|
@@ -40,7 +40,7 @@ export const Subtext = createComponent('p')({
|
|
|
40
40
|
});
|
|
41
41
|
const bodyTextStencil = createStencil({
|
|
42
42
|
extends: textStencil,
|
|
43
|
-
base: { name: "
|
|
43
|
+
base: { name: "p7t9l", styles: "box-sizing:border-box;" }
|
|
44
44
|
}, "body-text-44de3e");
|
|
45
45
|
/**
|
|
46
46
|
* This component is intended to be used for standard body text.
|
|
@@ -75,7 +75,7 @@ export const BodyText = createComponent('p')({
|
|
|
75
75
|
});
|
|
76
76
|
const headingStencil = createStencil({
|
|
77
77
|
extends: textStencil,
|
|
78
|
-
base: { name: "
|
|
78
|
+
base: { name: "p7t9m", styles: "box-sizing:border-box;" }
|
|
79
79
|
}, "heading-5a3efc");
|
|
80
80
|
/**
|
|
81
81
|
* This component is intended to be used for headings and large text.
|
|
@@ -110,7 +110,7 @@ export const Heading = createComponent('h2')({
|
|
|
110
110
|
});
|
|
111
111
|
const titleStencil = createStencil({
|
|
112
112
|
extends: textStencil,
|
|
113
|
-
base: { name: "
|
|
113
|
+
base: { name: "p7t9n", styles: "box-sizing:border-box;" }
|
|
114
114
|
}, "title-2c12c2");
|
|
115
115
|
/**
|
|
116
116
|
* 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
|
};
|
|
@@ -11,13 +11,13 @@ export const TextAreaResizeDirection = {
|
|
|
11
11
|
};
|
|
12
12
|
export const textAreaStencil = createStencil({
|
|
13
13
|
extends: textInputStencil,
|
|
14
|
-
base: { name: "
|
|
14
|
+
base: { name: "p7t95q", 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;}" },
|
|
15
15
|
modifiers: {
|
|
16
16
|
resize: {
|
|
17
|
-
both: { name: "
|
|
18
|
-
horizontal: { name: "
|
|
19
|
-
vertical: { name: "
|
|
20
|
-
none: { name: "
|
|
17
|
+
both: { name: "p7t95r", styles: "resize:both;" },
|
|
18
|
+
horizontal: { name: "p7t95s", styles: "resize:horizontal;" },
|
|
19
|
+
vertical: { name: "p7t95t", styles: "resize:vertical;" },
|
|
20
|
+
none: { name: "p7t95u", styles: "resize:none;" }
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { maybeWrapCSSVariables } from '@workday/canvas-kit-styling';
|
|
2
|
+
import { createStencil, handleCsProp, maybeWrapCSSVariables } from '@workday/canvas-kit-styling';
|
|
3
3
|
import { system } from '@workday/canvas-tokens-web';
|
|
4
|
-
import { createContainer, createElemPropsHook, createModelHook, createSubcomponent, dispatchInputEvent, useForkRef,
|
|
5
|
-
import {
|
|
4
|
+
import { createContainer, createElemPropsHook, createModelHook, createSubcomponent, dispatchInputEvent, useForkRef, } from '@workday/canvas-kit-react/common';
|
|
5
|
+
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
6
6
|
import { TertiaryButton } from '@workday/canvas-kit-react/button';
|
|
7
7
|
import { xSmallIcon } from '@workday/canvas-system-icons-web';
|
|
8
8
|
import { TextInput } from './TextInput';
|
|
@@ -15,38 +15,85 @@ export const useInputGroupModel = createModelHook({})(() => {
|
|
|
15
15
|
events: {},
|
|
16
16
|
};
|
|
17
17
|
});
|
|
18
|
-
export const
|
|
18
|
+
export const inputGroupInnerStencil = createStencil({
|
|
19
|
+
vars: {
|
|
20
|
+
/**
|
|
21
|
+
* Offset of the inner item. Set by the `InputGroup` and depends on siblings. Do not change this
|
|
22
|
+
* on your own.
|
|
23
|
+
*/
|
|
24
|
+
insetInlineStart: 'initial',
|
|
25
|
+
/**
|
|
26
|
+
* Offset of the inner item. Set by the `InputGroup` and depends on siblings. Do not change this
|
|
27
|
+
* on your own.
|
|
28
|
+
*/
|
|
29
|
+
insetInlineEnd: 'initial',
|
|
30
|
+
width: system.space.x10,
|
|
31
|
+
height: system.space.x10,
|
|
32
|
+
/**
|
|
33
|
+
* Some inner input group elements are decoration only and should not have pointer events
|
|
34
|
+
*/
|
|
35
|
+
pointerEvents: '',
|
|
36
|
+
},
|
|
37
|
+
base: { name: "p7t93z", 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);" },
|
|
38
|
+
modifiers: {
|
|
39
|
+
pointerEvents: {
|
|
40
|
+
_: { name: "p7t940", styles: "pointer-events:var(--pointerEvents-input-group-inner-74be52);" }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, "input-group-inner-74be52");
|
|
44
|
+
const InputGroupInnerStart = createSubcomponent('div')({
|
|
19
45
|
modelHook: useInputGroupModel,
|
|
20
|
-
})((elemProps, Element) => {
|
|
21
|
-
return (React.createElement(
|
|
46
|
+
})(({ pointerEvents, insetInlineStart, insetInlineEnd, width, height, ...elemProps }, Element) => {
|
|
47
|
+
return (React.createElement(Element, { ...mergeStyles(elemProps, inputGroupInnerStencil({
|
|
48
|
+
pointerEvents,
|
|
49
|
+
insetInlineStart: toPx(insetInlineStart),
|
|
50
|
+
insetInlineEnd: toPx(insetInlineEnd),
|
|
51
|
+
width: toPx(width),
|
|
52
|
+
height: toPx(height),
|
|
53
|
+
})) }));
|
|
22
54
|
});
|
|
23
|
-
|
|
55
|
+
const InputGroupInnerEnd = createSubcomponent('div')({
|
|
24
56
|
modelHook: useInputGroupModel,
|
|
25
|
-
})((elemProps, Element) => {
|
|
26
|
-
return (React.createElement(
|
|
57
|
+
})(({ pointerEvents, insetInlineStart, insetInlineEnd, width, height, ...elemProps }, Element) => {
|
|
58
|
+
return (React.createElement(Element, { ...mergeStyles(elemProps, inputGroupInnerStencil({
|
|
59
|
+
pointerEvents,
|
|
60
|
+
insetInlineStart: insetInlineStart,
|
|
61
|
+
insetInlineEnd: insetInlineEnd,
|
|
62
|
+
width: toPx(width),
|
|
63
|
+
height: toPx(height),
|
|
64
|
+
})) }));
|
|
27
65
|
});
|
|
28
|
-
const useInputGroupInput = createElemPropsHook(useInputGroupModel)((model, ref) => {
|
|
66
|
+
export const useInputGroupInput = createElemPropsHook(useInputGroupModel)((model, ref) => {
|
|
29
67
|
const elementRef = useForkRef(ref, model.state.inputRef);
|
|
30
68
|
return {
|
|
31
69
|
ref: elementRef,
|
|
32
70
|
};
|
|
33
71
|
});
|
|
34
|
-
export const
|
|
72
|
+
export const inputGroupInputStencil = createStencil({
|
|
73
|
+
vars: {
|
|
74
|
+
paddingInlineStart: '',
|
|
75
|
+
paddingInlineEnd: '',
|
|
76
|
+
},
|
|
77
|
+
base: { name: "p7t941", styles: "box-sizing:border-box;display:flex;width:100%;" },
|
|
78
|
+
modifiers: {
|
|
79
|
+
paddingInlineStart: {
|
|
80
|
+
_: { name: "p7t942", styles: "padding-inline-start:var(--paddingInlineStart-input-group-input-0042c7);" }
|
|
81
|
+
},
|
|
82
|
+
paddingInlineEnd: {
|
|
83
|
+
_: { name: "p7t943", styles: "padding-inline-end:var(--paddingInlineEnd-input-group-input-0042c7);" }
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}, "input-group-input-0042c7");
|
|
87
|
+
const InputGroupInput = createSubcomponent(TextInput)({
|
|
35
88
|
modelHook: useInputGroupModel,
|
|
36
89
|
elemPropsHook: useInputGroupInput,
|
|
37
|
-
})((elemProps, Element) => {
|
|
38
|
-
return React.createElement(
|
|
90
|
+
})(({ paddingInlineStart, paddingInlineEnd, ...elemProps }, Element) => {
|
|
91
|
+
return (React.createElement(Element, { as: Element, ...mergeStyles(elemProps, inputGroupInputStencil({
|
|
92
|
+
paddingInlineStart: toPx(paddingInlineStart),
|
|
93
|
+
paddingInlineEnd: toPx(paddingInlineEnd),
|
|
94
|
+
})) }));
|
|
39
95
|
});
|
|
40
96
|
export const useClearButton = createElemPropsHook(useInputGroupModel)(model => {
|
|
41
|
-
const [inputHasValue, setInputHasValue] = React.useState(false);
|
|
42
|
-
React.useLayoutEffect(() => {
|
|
43
|
-
const input = model.state.inputRef.current;
|
|
44
|
-
if (input) {
|
|
45
|
-
input.addEventListener('input', () => {
|
|
46
|
-
setInputHasValue(!!input.value);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}, [model.state.inputRef]);
|
|
50
97
|
return {
|
|
51
98
|
// This element does not need to be accessible via screen reader. The user can already clear
|
|
52
99
|
// an input
|
|
@@ -56,7 +103,6 @@ export const useClearButton = createElemPropsHook(useInputGroupModel)(model => {
|
|
|
56
103
|
icon: xSmallIcon,
|
|
57
104
|
// "small" is needed to render correctly within a `TextInput`
|
|
58
105
|
size: 'small',
|
|
59
|
-
transition: 'opacity 300ms ease',
|
|
60
106
|
// prevent a focus change to the button. Focus should stay in the input.
|
|
61
107
|
onMouseDown(event) {
|
|
62
108
|
event.preventDefault();
|
|
@@ -65,20 +111,17 @@ export const useClearButton = createElemPropsHook(useInputGroupModel)(model => {
|
|
|
65
111
|
// This will clear the input's value
|
|
66
112
|
dispatchInputEvent(model.state.inputRef.current, '');
|
|
67
113
|
},
|
|
68
|
-
|
|
69
|
-
opacity: inputHasValue ? 1 : 0,
|
|
70
|
-
pointerEvents: inputHasValue ? 'auto' : 'none',
|
|
71
|
-
},
|
|
114
|
+
placeholder: '', // Make sure a placeholder attribute always exists for `:placeholder-shown`
|
|
72
115
|
};
|
|
73
116
|
});
|
|
74
117
|
/**
|
|
75
118
|
* A clear input button. This can be a component later.
|
|
76
119
|
*/
|
|
77
|
-
|
|
120
|
+
const ClearButton = createSubcomponent(TertiaryButton)({
|
|
78
121
|
modelHook: useInputGroupModel,
|
|
79
122
|
elemPropsHook: useClearButton,
|
|
80
123
|
})((elemProps, Element) => {
|
|
81
|
-
return React.createElement(Element, { ...elemProps });
|
|
124
|
+
return React.createElement(Element, { "data-part": "input-group-clear-button", ...handleCsProp(elemProps) });
|
|
82
125
|
});
|
|
83
126
|
// make sure we always use pixels if the input is a number - this is required for `calc`
|
|
84
127
|
const toPx = (input) => {
|
|
@@ -95,6 +138,9 @@ const wrapInCalc = (values) => {
|
|
|
95
138
|
}
|
|
96
139
|
return `calc(${values.map(toPx).join(' + ')})`;
|
|
97
140
|
};
|
|
141
|
+
export const inputGroupStencil = createStencil({
|
|
142
|
+
base: { name: "p7t944", 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;}" }
|
|
143
|
+
}, "input-group-e70946");
|
|
98
144
|
/**
|
|
99
145
|
* An `InputGroup` is a container around a {@link TextInput} with optional inner start and end
|
|
100
146
|
* elements. The inner start and end elements are usually icons or icon buttons visually represented
|
|
@@ -121,7 +167,7 @@ export const InputGroup = createContainer('div')({
|
|
|
121
167
|
subComponents: {
|
|
122
168
|
/**
|
|
123
169
|
* A component to show inside and at the start of the input. The input's padding will be
|
|
124
|
-
* adjusted to not overlap with this element. Use `width`
|
|
170
|
+
* adjusted by the `InputGroup` to not overlap with this element. Use `width` to adjust the
|
|
125
171
|
* width offset. The width defaults to 40px which is the correct width for icons or icon
|
|
126
172
|
* buttons.
|
|
127
173
|
*/
|
|
@@ -133,9 +179,9 @@ export const InputGroup = createContainer('div')({
|
|
|
133
179
|
Input: InputGroupInput,
|
|
134
180
|
/**
|
|
135
181
|
* A component to show inside and at the end of the input. The input's padding will be adjusted
|
|
136
|
-
* to not overlap with this element. Use `width`
|
|
137
|
-
*
|
|
138
|
-
*
|
|
182
|
+
* by the `InputGroup` to not overlap with this element. Use `width` to adjust the width offset.
|
|
183
|
+
* The width defaults to 40px which is the correct width for icons or icon buttons within the
|
|
184
|
+
* input.
|
|
139
185
|
*/
|
|
140
186
|
InnerEnd: InputGroupInnerEnd,
|
|
141
187
|
/**
|
|
@@ -145,7 +191,6 @@ export const InputGroup = createContainer('div')({
|
|
|
145
191
|
ClearButton: ClearButton,
|
|
146
192
|
},
|
|
147
193
|
})(({ children, ...elemProps }, Element) => {
|
|
148
|
-
const isRTL = useIsRTL();
|
|
149
194
|
const offsetsStart = [];
|
|
150
195
|
const offsetsEnd = [];
|
|
151
196
|
// Collect the widths of the `InnerStart` and `InnerEnd` components into `offsetStart` and
|
|
@@ -173,23 +218,21 @@ export const InputGroup = createContainer('div')({
|
|
|
173
218
|
});
|
|
174
219
|
}
|
|
175
220
|
if (child.type === InputGroupInnerStart) {
|
|
176
|
-
const offset = wrapInCalc(offsetsStart.slice(0, indexStart)) ||
|
|
221
|
+
const offset = wrapInCalc(offsetsStart.slice(0, indexStart)) || '0px';
|
|
177
222
|
indexStart++;
|
|
178
223
|
return React.cloneElement(child, {
|
|
179
|
-
|
|
180
|
-
right: isRTL ? offset : undefined,
|
|
224
|
+
insetInlineStart: offset,
|
|
181
225
|
});
|
|
182
226
|
}
|
|
183
227
|
if (child.type === InputGroupInnerEnd) {
|
|
184
|
-
const offset = wrapInCalc(offsetsEnd.slice(indexEnd, -1)) ||
|
|
228
|
+
const offset = wrapInCalc(offsetsEnd.slice(indexEnd, -1)) || '0px';
|
|
185
229
|
indexEnd++;
|
|
186
230
|
return React.cloneElement(child, {
|
|
187
|
-
|
|
188
|
-
right: isRTL ? undefined : offset,
|
|
231
|
+
insetInlineEnd: offset,
|
|
189
232
|
});
|
|
190
233
|
}
|
|
191
234
|
}
|
|
192
235
|
return child;
|
|
193
236
|
});
|
|
194
|
-
return
|
|
237
|
+
return React.createElement(Element, { ...mergeStyles(elemProps, inputGroupStencil()) }, mappedChildren);
|
|
195
238
|
});
|
|
@@ -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"}
|