@workday/canvas-kit-react 11.0.0-alpha.726-next.0 → 11.0.0-alpha.760-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/breadcrumbs/lib/BreadcrumbsItem.tsx +1 -1
- package/breadcrumbs/lib/BreadcrumbsOverflowButton.tsx +1 -1
- package/button/lib/BaseButton.tsx +16 -1
- package/button/lib/DeleteButton.tsx +12 -11
- package/button/lib/ExternalHyperlink.tsx +1 -1
- package/button/lib/PrimaryButton.tsx +52 -45
- package/button/lib/SecondaryButton.tsx +58 -75
- package/button/lib/TertiaryButton.tsx +63 -54
- package/card/index.ts +3 -1
- package/card/lib/Card.tsx +12 -9
- package/card/lib/CardBody.tsx +12 -4
- package/card/lib/CardHeading.tsx +14 -17
- package/collection/lib/ListBox.tsx +9 -3
- package/combobox/lib/ComboboxMenuList.tsx +3 -4
- package/dist/commonjs/badge/lib/CountBadge.js +6 -6
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsItem.js +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsOverflowButton.js +1 -1
- package/dist/commonjs/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/BaseButton.js +18 -17
- package/dist/commonjs/button/lib/DeleteButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/DeleteButton.js +2 -1
- package/dist/commonjs/button/lib/ExternalHyperlink.js +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.js +3 -2
- package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/SecondaryButton.js +3 -2
- package/dist/commonjs/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/TertiaryButton.js +16 -15
- package/dist/commonjs/card/index.d.ts +3 -1
- package/dist/commonjs/card/index.d.ts.map +1 -1
- package/dist/commonjs/card/index.js +6 -1
- package/dist/commonjs/card/lib/Card.d.ts +1 -0
- package/dist/commonjs/card/lib/Card.d.ts.map +1 -1
- package/dist/commonjs/card/lib/Card.js +6 -3
- package/dist/commonjs/card/lib/CardBody.d.ts +103 -0
- package/dist/commonjs/card/lib/CardBody.d.ts.map +1 -1
- package/dist/commonjs/card/lib/CardBody.js +10 -2
- package/dist/commonjs/card/lib/CardHeading.d.ts +103 -0
- package/dist/commonjs/card/lib/CardHeading.d.ts.map +1 -1
- package/dist/commonjs/card/lib/CardHeading.js +8 -3
- package/dist/commonjs/checkbox/lib/CheckBackground.js +5 -5
- package/dist/commonjs/checkbox/lib/CheckboxCheck.js +9 -9
- package/dist/commonjs/checkbox/lib/CheckboxContainer.js +1 -1
- package/dist/commonjs/checkbox/lib/CheckboxInput.js +11 -11
- package/dist/commonjs/checkbox/lib/CheckboxRipple.js +1 -1
- package/dist/commonjs/collection/lib/ListBox.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/ListBox.js +14 -8
- package/dist/commonjs/combobox/lib/ComboboxMenuItem.js +4 -4
- package/dist/commonjs/combobox/lib/ComboboxMenuList.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/ComboboxMenuList.js +4 -5
- package/dist/commonjs/common/lib/AccessibleHide.js +1 -1
- package/dist/commonjs/common/lib/CanvasProvider.js +1 -1
- package/dist/commonjs/icon/index.d.ts +1 -1
- package/dist/commonjs/icon/index.d.ts.map +1 -1
- package/dist/commonjs/icon/index.js +4 -1
- package/dist/commonjs/icon/lib/AccentIcon.d.ts +30 -4
- package/dist/commonjs/icon/lib/AccentIcon.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/AccentIcon.js +28 -4
- package/dist/commonjs/icon/lib/AppletIcon.d.ts +31 -2
- package/dist/commonjs/icon/lib/AppletIcon.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/AppletIcon.js +27 -4
- package/dist/commonjs/icon/lib/Graphic.d.ts +20 -1
- package/dist/commonjs/icon/lib/Graphic.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/Graphic.js +25 -3
- package/dist/commonjs/icon/lib/Svg.d.ts +12 -2
- package/dist/commonjs/icon/lib/Svg.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/Svg.js +25 -10
- package/dist/commonjs/icon/lib/SystemIcon.d.ts +79 -16
- package/dist/commonjs/icon/lib/SystemIcon.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/SystemIcon.js +51 -14
- package/dist/commonjs/icon/lib/SystemIconCircle.d.ts +2 -3
- package/dist/commonjs/icon/lib/SystemIconCircle.d.ts.map +1 -1
- package/dist/commonjs/icon/lib/SystemIconCircle.js +20 -30
- package/dist/commonjs/loading-dots/lib/LoadingDots.js +3 -3
- package/dist/commonjs/menu/lib/MenuCard.js +2 -2
- package/dist/commonjs/menu/lib/MenuList.js +5 -5
- package/dist/commonjs/select/lib/Select.js +7 -7
- package/dist/commonjs/select/lib/hooks/useSelectInput.d.ts +4 -1
- package/dist/commonjs/select/lib/hooks/useSelectInput.d.ts.map +1 -1
- package/dist/commonjs/select/lib/hooks/useSelectInput.js +14 -5
- package/dist/commonjs/switch/lib/Switch.js +13 -13
- package/dist/commonjs/table/lib/Table.js +2 -2
- package/dist/commonjs/table/lib/TableBody.js +2 -2
- package/dist/commonjs/table/lib/TableCaption.js +2 -2
- package/dist/commonjs/table/lib/TableCell.js +2 -2
- package/dist/commonjs/table/lib/TableFooter.js +2 -2
- package/dist/commonjs/table/lib/TableHead.js +2 -2
- package/dist/commonjs/table/lib/TableHeader.js +2 -2
- package/dist/commonjs/table/lib/TableRow.js +2 -2
- package/dist/commonjs/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsItem.js +4 -12
- package/dist/commonjs/tabs/lib/useTabsModel.d.ts.map +1 -1
- package/dist/commonjs/text/lib/LabelText.d.ts.map +1 -1
- package/dist/commonjs/text/lib/LabelText.js +11 -27
- package/dist/commonjs/text/lib/Text.d.ts +103 -0
- package/dist/commonjs/text/lib/Text.d.ts.map +1 -1
- package/dist/commonjs/text/lib/Text.js +30 -27
- package/dist/commonjs/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
- package/dist/commonjs/tooltip/lib/OverflowTooltip.js +2 -3
- package/dist/es6/badge/lib/CountBadge.js +6 -6
- package/dist/es6/breadcrumbs/lib/BreadcrumbsItem.js +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsOverflowButton.js +1 -1
- package/dist/es6/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/es6/button/lib/BaseButton.js +18 -17
- package/dist/es6/button/lib/DeleteButton.d.ts.map +1 -1
- package/dist/es6/button/lib/DeleteButton.js +2 -1
- package/dist/es6/button/lib/ExternalHyperlink.js +1 -1
- package/dist/es6/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/PrimaryButton.js +3 -2
- package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/SecondaryButton.js +3 -2
- package/dist/es6/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/TertiaryButton.js +16 -15
- package/dist/es6/card/index.d.ts +3 -1
- package/dist/es6/card/index.d.ts.map +1 -1
- package/dist/es6/card/index.js +3 -1
- package/dist/es6/card/lib/Card.d.ts +1 -0
- package/dist/es6/card/lib/Card.d.ts.map +1 -1
- package/dist/es6/card/lib/Card.js +7 -4
- package/dist/es6/card/lib/CardBody.d.ts +103 -0
- package/dist/es6/card/lib/CardBody.d.ts.map +1 -1
- package/dist/es6/card/lib/CardBody.js +10 -2
- package/dist/es6/card/lib/CardHeading.d.ts +103 -0
- package/dist/es6/card/lib/CardHeading.d.ts.map +1 -1
- package/dist/es6/card/lib/CardHeading.js +9 -4
- package/dist/es6/checkbox/lib/CheckBackground.js +5 -5
- package/dist/es6/checkbox/lib/CheckboxCheck.js +9 -9
- package/dist/es6/checkbox/lib/CheckboxContainer.js +1 -1
- package/dist/es6/checkbox/lib/CheckboxInput.js +11 -11
- package/dist/es6/checkbox/lib/CheckboxRipple.js +1 -1
- package/dist/es6/collection/lib/ListBox.d.ts.map +1 -1
- package/dist/es6/collection/lib/ListBox.js +15 -9
- package/dist/es6/combobox/lib/ComboboxMenuItem.js +4 -4
- package/dist/es6/combobox/lib/ComboboxMenuList.d.ts.map +1 -1
- package/dist/es6/combobox/lib/ComboboxMenuList.js +5 -6
- package/dist/es6/common/lib/AccessibleHide.js +1 -1
- package/dist/es6/common/lib/CanvasProvider.js +1 -1
- package/dist/es6/icon/index.d.ts +1 -1
- package/dist/es6/icon/index.d.ts.map +1 -1
- package/dist/es6/icon/index.js +1 -1
- package/dist/es6/icon/lib/AccentIcon.d.ts +30 -4
- package/dist/es6/icon/lib/AccentIcon.d.ts.map +1 -1
- package/dist/es6/icon/lib/AccentIcon.js +27 -3
- package/dist/es6/icon/lib/AppletIcon.d.ts +31 -2
- package/dist/es6/icon/lib/AppletIcon.d.ts.map +1 -1
- package/dist/es6/icon/lib/AppletIcon.js +26 -3
- package/dist/es6/icon/lib/Graphic.d.ts +20 -1
- package/dist/es6/icon/lib/Graphic.d.ts.map +1 -1
- package/dist/es6/icon/lib/Graphic.js +24 -2
- package/dist/es6/icon/lib/Svg.d.ts +12 -2
- package/dist/es6/icon/lib/Svg.d.ts.map +1 -1
- package/dist/es6/icon/lib/Svg.js +25 -11
- package/dist/es6/icon/lib/SystemIcon.d.ts +79 -16
- package/dist/es6/icon/lib/SystemIcon.d.ts.map +1 -1
- package/dist/es6/icon/lib/SystemIcon.js +50 -13
- package/dist/es6/icon/lib/SystemIconCircle.d.ts +2 -3
- package/dist/es6/icon/lib/SystemIconCircle.d.ts.map +1 -1
- package/dist/es6/icon/lib/SystemIconCircle.js +23 -30
- package/dist/es6/loading-dots/lib/LoadingDots.js +3 -3
- package/dist/es6/menu/lib/MenuCard.js +2 -2
- package/dist/es6/menu/lib/MenuList.js +5 -5
- package/dist/es6/select/lib/Select.js +7 -7
- package/dist/es6/select/lib/hooks/useSelectInput.d.ts +4 -1
- package/dist/es6/select/lib/hooks/useSelectInput.d.ts.map +1 -1
- package/dist/es6/select/lib/hooks/useSelectInput.js +14 -5
- package/dist/es6/switch/lib/Switch.js +13 -13
- package/dist/es6/table/lib/Table.js +2 -2
- package/dist/es6/table/lib/TableBody.js +2 -2
- package/dist/es6/table/lib/TableCaption.js +2 -2
- package/dist/es6/table/lib/TableCell.js +2 -2
- package/dist/es6/table/lib/TableFooter.js +2 -2
- package/dist/es6/table/lib/TableHead.js +2 -2
- package/dist/es6/table/lib/TableHeader.js +2 -2
- package/dist/es6/table/lib/TableRow.js +2 -2
- package/dist/es6/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsItem.js +5 -13
- package/dist/es6/tabs/lib/useTabsModel.d.ts.map +1 -1
- package/dist/es6/text/lib/LabelText.d.ts.map +1 -1
- package/dist/es6/text/lib/LabelText.js +12 -28
- package/dist/es6/text/lib/Text.d.ts +103 -0
- package/dist/es6/text/lib/Text.d.ts.map +1 -1
- package/dist/es6/text/lib/Text.js +31 -28
- package/dist/es6/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
- package/dist/es6/tooltip/lib/OverflowTooltip.js +2 -3
- package/icon/index.ts +1 -1
- package/icon/lib/AccentIcon.tsx +48 -10
- package/icon/lib/AppletIcon.tsx +53 -12
- package/icon/lib/Graphic.tsx +43 -10
- package/icon/lib/Svg.tsx +36 -19
- package/icon/lib/SystemIcon.tsx +134 -39
- package/icon/lib/SystemIconCircle.tsx +42 -47
- package/package.json +5 -5
- package/select/lib/hooks/useSelectInput.ts +24 -8
- package/tabs/lib/TabsItem.tsx +6 -13
- package/tabs/lib/useTabsModel.tsx +0 -1
- package/text/lib/LabelText.tsx +11 -63
- package/text/lib/Text.tsx +65 -62
- package/tooltip/lib/OverflowTooltip.tsx +2 -3
- package/dist/commonjs/icon/lib/Icon.d.ts +0 -9
- package/dist/commonjs/icon/lib/Icon.d.ts.map +0 -1
- package/dist/commonjs/icon/lib/Icon.js +0 -40
- package/dist/es6/icon/lib/Icon.d.ts +0 -9
- package/dist/es6/icon/lib/Icon.d.ts.map +0 -1
- package/dist/es6/icon/lib/Icon.js +0 -18
- package/icon/lib/Icon.tsx +0 -38
|
@@ -1,46 +1,73 @@
|
|
|
1
1
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
2
2
|
import { CSSObject } from '@emotion/styled';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { SvgProps } from './Svg';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Interface `SystemIconStyles` will be removed in a future version. `accent`, `color`, background props will be moved inside `GraphicProps`.
|
|
6
|
+
*/
|
|
5
7
|
export interface SystemIconStyles {
|
|
6
8
|
/**
|
|
7
9
|
* The accent color of the SystemIcon. This overrides `color`.
|
|
8
10
|
*/
|
|
9
|
-
accent?:
|
|
11
|
+
accent?: string;
|
|
10
12
|
/**
|
|
11
13
|
* The accent color of the SystemIcon on hover. This overrides `colorHover`.
|
|
14
|
+
* @deprecated `accentHover` is deprecated and will be removed in a future version. Please use the following instead in your style overrides:
|
|
15
|
+
* ```tsx
|
|
16
|
+
* '&:hover': {
|
|
17
|
+
* [systemIconStencil.vars.accent]: desiredAccentHoverColor
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
12
20
|
*/
|
|
13
|
-
accentHover?:
|
|
21
|
+
accentHover?: string;
|
|
14
22
|
/**
|
|
15
23
|
* The background color of the SystemIcon.
|
|
16
24
|
* @default transparent
|
|
17
25
|
*/
|
|
18
|
-
background?:
|
|
26
|
+
background?: string;
|
|
19
27
|
/**
|
|
20
28
|
* The background color of the SystemIcon on hover.
|
|
21
29
|
* @default transparent
|
|
30
|
+
* @deprecated `backgroundHover` is deprecated and will be removed in a future version. Please use the following instead in your style overrides:
|
|
31
|
+
* ```tsx
|
|
32
|
+
* '&:hover': {
|
|
33
|
+
* [systemIconStencil.vars.background]: desiredBackgroundHoverColor
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
22
36
|
*/
|
|
23
|
-
backgroundHover?:
|
|
37
|
+
backgroundHover?: string;
|
|
24
38
|
/**
|
|
25
|
-
* The color of the SystemIcon. This defines `accent` and `fill`. `color` may be
|
|
26
|
-
* @default
|
|
39
|
+
* The color of the SystemIcon. This defines `accent` and `fill`. `color` may be overwritten by `accent` and `fill`.
|
|
40
|
+
* @default base.licorice200
|
|
27
41
|
*/
|
|
28
|
-
color?:
|
|
42
|
+
color?: string;
|
|
29
43
|
/**
|
|
30
|
-
* The hover color of the SystemIcon. This defines `accentHover` and `fillHover`. `colorHover` may be
|
|
31
|
-
* @default
|
|
44
|
+
* The hover color of the SystemIcon. This defines `accentHover` and `fillHover`. `colorHover` may be overwritten by `accentHover` and `fillHover`.
|
|
45
|
+
* @default base.licorice200
|
|
46
|
+
* @deprecated `colorHover` is deprecated and will be removed in a future version. Please use the following instead in your style overrides:
|
|
47
|
+
* ```tsx
|
|
48
|
+
* '&:hover': {
|
|
49
|
+
* [systemIconStencil.vars.color]: desiredColorHoverColor
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
32
52
|
*/
|
|
33
|
-
colorHover?:
|
|
53
|
+
colorHover?: string;
|
|
34
54
|
/**
|
|
35
55
|
* The fill color of the SystemIcon. This overrides `color`.
|
|
56
|
+
* @deprecated `fill` is deprecated and will be removed in a future version. Please use `color` and specify `accent` color if you want `accent` to be different from `color`.
|
|
36
57
|
*/
|
|
37
|
-
fill?:
|
|
58
|
+
fill?: string;
|
|
38
59
|
/**
|
|
39
60
|
* The fill color of the SystemIcon on hover. This overrides `colorHover`.
|
|
61
|
+
* @deprecated `fillHover` is deprecated and will be removed in a future version. Please use the following instead in your style overrides:
|
|
62
|
+
* ```tsx
|
|
63
|
+
* '&:hover': {
|
|
64
|
+
* [systemIconStencil.vars.fill]: desiredFillHoverColor
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
40
67
|
*/
|
|
41
|
-
fillHover?:
|
|
68
|
+
fillHover?: string;
|
|
42
69
|
}
|
|
43
|
-
export interface SystemIconProps extends SystemIconStyles, Omit<
|
|
70
|
+
export interface SystemIconProps extends SystemIconStyles, Omit<SvgProps, 'src' | 'type' | 'fill' | 'background' | 'color'> {
|
|
44
71
|
/**
|
|
45
72
|
* The icon to display from `@workday/canvas-system-icons-web`.
|
|
46
73
|
*/
|
|
@@ -48,8 +75,44 @@ export interface SystemIconProps extends SystemIconStyles, Omit<IconProps, 'src'
|
|
|
48
75
|
/**
|
|
49
76
|
* The size of the SystemIcon in `px`.
|
|
50
77
|
*/
|
|
51
|
-
size?: number | string
|
|
78
|
+
size?: number | string;
|
|
52
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated This style utility function is deprecated and will be removed in a future version. We'll track usage over time to prevent unnecessary burden on upgrading. Most of the time, this function is used in conjunction with styling `SystemIcon`. There are a few ways to override the colors used in `SystemIcon`.
|
|
82
|
+
* - Pass props directly to the `SystemIcon` component: `<SystemIcon color={color} {...etc} />
|
|
83
|
+
* - Style overrides using the `systemIconStencil`:
|
|
84
|
+
* ```tsx
|
|
85
|
+
* // styling container
|
|
86
|
+
*
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
53
89
|
export declare const systemIconStyles: ({ accent, accentHover, background, backgroundHover, color, colorHover, fill, fillHover, }: SystemIconStyles) => CSSObject;
|
|
90
|
+
export declare const systemIconStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{
|
|
91
|
+
/**
|
|
92
|
+
* This will set the icon's color (both `.wd-icon-fill` and `.wd-icon-accent` SVG layers). Most
|
|
93
|
+
* of the time, this is the only color you need to change. Icons also have an accent layer. If you
|
|
94
|
+
* wish to change the accent layer independently, also set the `accentColor` variable
|
|
95
|
+
*/
|
|
96
|
+
color: string;
|
|
97
|
+
accentColor: string;
|
|
98
|
+
backgroundColor: string;
|
|
99
|
+
}, never>, {
|
|
100
|
+
/**
|
|
101
|
+
* This will set the icon's color (both `.wd-icon-fill` and `.wd-icon-accent` SVG layers). Most
|
|
102
|
+
* of the time, this is the only color you need to change. Icons also have an accent layer. If you
|
|
103
|
+
* wish to change the accent layer independently, also set the `accentColor` variable
|
|
104
|
+
*/
|
|
105
|
+
color: string;
|
|
106
|
+
accentColor: string;
|
|
107
|
+
backgroundColor: string;
|
|
108
|
+
}, import("@workday/canvas-kit-styling").Stencil<{
|
|
109
|
+
shouldMirror: {
|
|
110
|
+
true: {
|
|
111
|
+
transform: "scaleX(-1)";
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
}, {
|
|
115
|
+
size: string;
|
|
116
|
+
}, never, never>, never>;
|
|
54
117
|
export declare const SystemIcon: import("@workday/canvas-kit-react/common").ElementComponent<"span", SystemIconProps>;
|
|
55
118
|
//# sourceMappingURL=SystemIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/SystemIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"SystemIcon.d.ts","sourceRoot":"","sources":["../../../../icon/lib/SystemIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAkB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAI1C,OAAO,EAAM,QAAQ,EAAwC,MAAM,OAAO,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC;IAClE;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,8FAS1B,gBAAgB,KAAG,SAmBpB,CAAC;AAiBH,eAAO,MAAM,iBAAiB;IAG1B;;;;OAIG;;;;;IAJH;;;;OAIG;;;;;;;;;;;;wBAmCL,CAAC;AAEH,eAAO,MAAM,UAAU,sFA0CrB,CAAC"}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { iconColors } from '@workday/canvas-kit-react/tokens';
|
|
3
3
|
import { CanvasIconTypes } from '@workday/design-assets-types';
|
|
4
|
-
import { Icon } from './Icon';
|
|
5
4
|
import { createComponent, getColor } from '@workday/canvas-kit-react/common';
|
|
5
|
+
import { cssVar, createStencil, handleCsProp, px2rem, createVars } from '@workday/canvas-kit-styling';
|
|
6
|
+
import { base } from '@workday/canvas-tokens-web';
|
|
7
|
+
import { Svg, svgStencil, transformColorNameToToken } from './Svg';
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated This style utility function is deprecated and will be removed in a future version. We'll track usage over time to prevent unnecessary burden on upgrading. Most of the time, this function is used in conjunction with styling `SystemIcon`. There are a few ways to override the colors used in `SystemIcon`.
|
|
10
|
+
* - Pass props directly to the `SystemIcon` component: `<SystemIcon color={color} {...etc} />
|
|
11
|
+
* - Style overrides using the `systemIconStencil`:
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // styling container
|
|
14
|
+
*
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
6
17
|
export const systemIconStyles = ({ accent, accentHover, background = 'transparent', backgroundHover = 'transparent', color = iconColors.standard, colorHover = iconColors.hover, fill, fillHover, }) => ({
|
|
7
18
|
'& .wd-icon-fill': {
|
|
8
19
|
fill: getColor(fill) || getColor(color),
|
|
@@ -23,19 +34,45 @@ export const systemIconStyles = ({ accent, accentHover, background = 'transparen
|
|
|
23
34
|
fill: getColor(backgroundHover),
|
|
24
35
|
},
|
|
25
36
|
});
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated These variables are being used for backward compatibility with existing hover props. Please use the following instead:
|
|
39
|
+
* ```tsx
|
|
40
|
+
* '&:hover': {
|
|
41
|
+
* [systemIconStencil.vars.color]: desiredHoverColor
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
const deprecatedSystemIconVars = createVars({ id: "cnvs-deprecated-system-icon", args: ["colorHover", "fillHover", "accentHover", "backgroundHover"] });
|
|
46
|
+
export const systemIconStencil = createStencil({
|
|
47
|
+
extends: svgStencil,
|
|
48
|
+
vars: {
|
|
49
|
+
/**
|
|
50
|
+
* This will set the icon's color (both `.wd-icon-fill` and `.wd-icon-accent` SVG layers). Most
|
|
51
|
+
* of the time, this is the only color you need to change. Icons also have an accent layer. If you
|
|
52
|
+
* wish to change the accent layer independently, also set the `accentColor` variable
|
|
53
|
+
*/
|
|
54
|
+
color: '',
|
|
55
|
+
accentColor: '',
|
|
56
|
+
backgroundColor: 'transparent',
|
|
57
|
+
},
|
|
58
|
+
base: { name: "67a1c3", styles: "--cnvs-system-icon-backgroundColor:transparent;& .wd-icon-fill{fill:var(--cnvs-system-icon-color, var(--cnvs-base-palette-licorice-200));}& .wd-icon-accent, & .wd-icon-accent2{fill:var(--cnvs-system-icon-accentColor, var(--cnvs-system-icon-color, var(--cnvs-base-palette-licorice-200)));}& .wd-icon-background{fill:var(--cnvs-system-icon-backgroundColor);}&:where(:hover, .hover) .wd-icon-fill{fill:var(--cnvs-deprecated-system-icon-fillHover, var(--cnvs-deprecated-system-icon-colorHover, var(--cnvs-system-icon-color, var(--cnvs-base-palette-licorice-200))));}&:where(:hover, .hover) .wd-icon-accent, & .wd-icon-accent2{fill:var(--cnvs-deprecated-system-icon-accentHover, var(--cnvs-deprecated-system-icon-colorHover, var(--cnvs-system-icon-accentColor, var(--cnvs-system-icon-color, var(--cnvs-base-palette-licorice-200)))));}&:where(:hover, .hover) .wd-icon-background{fill:var(--cnvs-deprecated-system-icon-backgroundHover, var(--cnvs-system-icon-backgroundColor));}" }
|
|
59
|
+
}, "cnvs-system-icon");
|
|
26
60
|
export const SystemIcon = createComponent('span')({
|
|
27
61
|
displayName: 'SystemIcon',
|
|
28
|
-
Component: ({ background
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
62
|
+
Component: ({ size, background, backgroundHover, color, colorHover, icon, accent, accentHover, fill, fillHover, ...elemProps }, ref, Element) => {
|
|
63
|
+
return (React.createElement(Svg, Object.assign({ as: Element, src: icon, type: CanvasIconTypes.System, ref: ref }, handleCsProp(elemProps, [
|
|
64
|
+
systemIconStencil({
|
|
65
|
+
size: typeof size === 'number' ? px2rem(size) : size,
|
|
66
|
+
color: transformColorNameToToken(fill || color),
|
|
67
|
+
accentColor: transformColorNameToToken(accent || color),
|
|
68
|
+
backgroundColor: transformColorNameToToken(background),
|
|
69
|
+
}),
|
|
70
|
+
{
|
|
71
|
+
[deprecatedSystemIconVars.colorHover]: colorHover && cssVar(colorHover),
|
|
72
|
+
[deprecatedSystemIconVars.fillHover]: fillHover && cssVar(fillHover),
|
|
73
|
+
[deprecatedSystemIconVars.accentHover]: accentHover && cssVar(accentHover),
|
|
74
|
+
[deprecatedSystemIconVars.backgroundHover]: backgroundHover && cssVar(backgroundHover),
|
|
75
|
+
},
|
|
76
|
+
]))));
|
|
40
77
|
},
|
|
41
78
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SystemIconProps } from './SystemIcon';
|
|
2
2
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
3
|
-
import { SystemPropValues } from '@workday/canvas-kit-react/layout';
|
|
4
3
|
export declare enum SystemIconCircleSize {
|
|
5
4
|
xs = 16,
|
|
6
5
|
s = 24,
|
|
@@ -12,9 +11,9 @@ export declare enum SystemIconCircleSize {
|
|
|
12
11
|
export interface SystemIconCircleProps extends Pick<SystemIconProps, 'shouldMirror'> {
|
|
13
12
|
/**
|
|
14
13
|
* The background color of the SystemIconCircle from `@workday/canvas-colors-web`.
|
|
15
|
-
* @default
|
|
14
|
+
* @default base.soap300
|
|
16
15
|
*/
|
|
17
|
-
background?:
|
|
16
|
+
background?: string;
|
|
18
17
|
/**
|
|
19
18
|
* The icon to display from `@workday/canvas-accent-icons-web`.
|
|
20
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemIconCircle.d.ts","sourceRoot":"","sources":["../../../../icon/lib/SystemIconCircle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SystemIconCircle.d.ts","sourceRoot":"","sources":["../../../../icon/lib/SystemIconCircle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAa,eAAe,EAAoB,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAM9D,oBAAY,oBAAoB;IAC9B,EAAE,KAAK;IACP,CAAC,KAAK;IACN,CAAC,KAAK;IACN,CAAC,KAAK;IACN,EAAE,KAAK;IACP,GAAG,MAAM;CACV;AAED,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC;IAClF;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,oBAAoB,GAAG,MAAM,CAAC;CACtC;AA6BD,eAAO,MAAM,gBAAgB,4FAwB3B,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { colors } from '@workday/canvas-kit-react/tokens';
|
|
3
|
+
import { SystemIcon, systemIconStencil } from './SystemIcon';
|
|
4
|
+
import { createComponent, pickForegroundColor } from '@workday/canvas-kit-react/common';
|
|
5
|
+
import { calc, createStencil, cssVar, px2rem } from '@workday/canvas-kit-styling';
|
|
6
|
+
import { base, system } from '@workday/canvas-tokens-web';
|
|
7
|
+
import { transformColorNameToToken } from './Svg';
|
|
7
8
|
export var SystemIconCircleSize;
|
|
8
9
|
(function (SystemIconCircleSize) {
|
|
9
10
|
SystemIconCircleSize[SystemIconCircleSize["xs"] = 16] = "xs";
|
|
@@ -13,33 +14,25 @@ export var SystemIconCircleSize;
|
|
|
13
14
|
SystemIconCircleSize[SystemIconCircleSize["xl"] = 64] = "xl";
|
|
14
15
|
SystemIconCircleSize[SystemIconCircleSize["xxl"] = 120] = "xxl";
|
|
15
16
|
})(SystemIconCircleSize || (SystemIconCircleSize = {}));
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
justifyContent: 'center',
|
|
22
|
-
padding: 0,
|
|
23
|
-
border: 0,
|
|
24
|
-
borderRadius: borderRadius.circle,
|
|
25
|
-
boxSizing: 'border-box',
|
|
26
|
-
overflow: 'hidden',
|
|
27
|
-
'& img': {
|
|
28
|
-
width: '100%',
|
|
29
|
-
height: '100%',
|
|
17
|
+
const systemIconCircleStencil = createStencil({
|
|
18
|
+
vars: {
|
|
19
|
+
containerSize: '',
|
|
20
|
+
backgroundColor: '',
|
|
21
|
+
iconColor: '',
|
|
30
22
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}), ({ size }) => ({
|
|
34
|
-
width: size,
|
|
35
|
-
height: size,
|
|
36
|
-
}));
|
|
23
|
+
base: { name: "8a694b", styles: "background:var(--cnvs-system-icon-circle-backgroundColor, var(--cnvs-base-palette-soap-200));display:flex;align-items:center;justify-content:center;padding:var(--cnvs-sys-space-zero);border:none;border-radius:var(--cnvs-sys-shape-round);box-sizing:border-box;overflow:hidden;width:var(--cnvs-system-icon-circle-containerSize, var(--cnvs-sys-space-x10));height:var(--cnvs-system-icon-circle-containerSize, var(--cnvs-sys-space-x10));--cnvs-svg-size:calc(var(--cnvs-system-icon-circle-containerSize, var(--cnvs-sys-space-x10)) * 0.625);--cnvs-system-icon-color:var(--cnvs-system-icon-circle-iconColor);& img{width:100%;height:100%;}" }
|
|
24
|
+
}, "cnvs-system-icon-circle");
|
|
37
25
|
export const SystemIconCircle = createComponent('span')({
|
|
38
26
|
displayName: 'SystemIconCircle',
|
|
39
|
-
Component: ({ background
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
Component: ({ background, size, icon, shouldMirror }, ref, Element) => {
|
|
28
|
+
// `pickForegroundColor` hasn't support to use css variables to generate foregroundColor
|
|
29
|
+
const backgroundFallback = background && !background.startsWith('--') ? background : colors.soap200;
|
|
30
|
+
const iconColor = pickForegroundColor(backgroundFallback, 'rgba(0,0,0,0.65)', colors.frenchVanilla100);
|
|
31
|
+
return (React.createElement("div", Object.assign({}, systemIconCircleStencil({
|
|
32
|
+
containerSize: typeof size === 'number' ? px2rem(size) : size,
|
|
33
|
+
backgroundColor: transformColorNameToToken(background),
|
|
34
|
+
iconColor,
|
|
35
|
+
})),
|
|
36
|
+
React.createElement(SystemIcon, { as: Element, ref: ref, icon: icon, shouldMirror: shouldMirror })));
|
|
44
37
|
},
|
|
45
38
|
});
|
|
@@ -9,8 +9,8 @@ const ANIMATION_DURATION_MS = '1400';
|
|
|
9
9
|
/**
|
|
10
10
|
* Keyframe for the dots loading animation.
|
|
11
11
|
*/
|
|
12
|
-
const keyframesLoading = keyframes({ name: "
|
|
13
|
-
const loadingDotStyles = createStyles({ name: "
|
|
12
|
+
const keyframesLoading = keyframes({ name: "454a47", styles: "0%, 80%, 100%{transform:scale(0);}40%{transform:scale(1);}" });
|
|
13
|
+
const loadingDotStyles = createStyles({ name: "d1522e", styles: "background-color:var(--cnvs-base-palette-soap-400);width:var(--cnvs-sys-space-x4);height:var(--cnvs-sys-space-x4);font-size:var(--cnvs-sys-space-zero);border-radius:var(--cnvs-sys-shape-round);transform:scale(0);display:inline-block;animation-name:animation-454a47;animation-duration:1400ms;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-fill-mode:both;&:nth-child(1){animation-delay:0ms;}&:nth-child(2){animation-delay:calc(1400ms * (4/35));}&:nth-child(3){animation-delay:calc(1400ms * (8/35));}" });
|
|
14
14
|
/**
|
|
15
15
|
* The actual loading dot div.
|
|
16
16
|
*/
|
|
@@ -18,7 +18,7 @@ const LoadingAnimationDot = () => React.createElement("div", { className: `${loa
|
|
|
18
18
|
/**
|
|
19
19
|
* A simple container for the loading dots.
|
|
20
20
|
*/
|
|
21
|
-
const containerStyles = createStyles({ name: "
|
|
21
|
+
const containerStyles = createStyles({ name: "0e8878", styles: "display:inline-flex;gap:var(--cnvs-sys-space-x2);" });
|
|
22
22
|
/**
|
|
23
23
|
* A simple component that displays three horizontal dots, to be used when some data is loading.
|
|
24
24
|
*/
|
|
@@ -12,8 +12,8 @@ export const menuCardStencil = createStencil({
|
|
|
12
12
|
transformOriginVertical: 'top',
|
|
13
13
|
transformOriginHorizontal: 'left',
|
|
14
14
|
},
|
|
15
|
-
base: { name: "
|
|
16
|
-
}, "menu-card");
|
|
15
|
+
base: { name: "a0bf52", styles: "--cnvs-menu-card-minWidth:0.0625rem;--cnvs-menu-card-transformOriginVertical:top;--cnvs-menu-card-transformOriginHorizontal:left;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-base-palette-black-pepper-300);position:relative;display:flex;flex-direction:column;transition:transform ease-out 150ms;padding:var(--cnvs-sys-space-zero);max-width:calc(100vw - var(--cnvs-sys-space-x8));box-shadow:var(--cnvs-sys-depth-3);min-width:var(--cnvs-menu-card-minWidth);box-sizing:border-box;transform-origin:var(--cnvs-menu-card-transformOriginVertical) var(--cnvs-menu-card-transformOriginHorizontal);.wd-no-animation &{animation:none;}" }
|
|
16
|
+
}, "cnvs-menu-card");
|
|
17
17
|
export const useMenuCard = createElemPropsHook(useMenuModel)(() => {
|
|
18
18
|
return {};
|
|
19
19
|
});
|
|
@@ -13,14 +13,14 @@ export const useMenuList = composeHooks(createElemPropsHook(useMenuModel)(model
|
|
|
13
13
|
};
|
|
14
14
|
}), useReturnFocus, useFocusRedirect);
|
|
15
15
|
export const menuListStencil = createStencil({
|
|
16
|
-
base: { name: "
|
|
16
|
+
base: { name: "4a3778", styles: "background:var(--cnvs-base-palette-french-vanilla-100);border-radius:var(--cnvs-sys-shape-zero);padding:var(--cnvs-sys-space-zero);gap:var(--cnvs-sys-space-zero);" },
|
|
17
17
|
modifiers: {
|
|
18
|
-
|
|
19
|
-
vertical: { name: "
|
|
20
|
-
horizontal: { name: "
|
|
18
|
+
orientation: {
|
|
19
|
+
vertical: { name: "db5d98", styles: "flex-direction:column;" },
|
|
20
|
+
horizontal: { name: "3f3c28", styles: "flex-direction:row;" }
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
}, "menu-list");
|
|
23
|
+
}, "cnvs-menu-list");
|
|
24
24
|
export const MenuList = createSubcomponent('div')({
|
|
25
25
|
displayName: 'Menu.List',
|
|
26
26
|
modelHook: useMenuModel,
|
|
@@ -11,14 +11,14 @@ import { useSelectModel } from './hooks/useSelectModel';
|
|
|
11
11
|
import { createSubcomponent, createContainer, } from '@workday/canvas-kit-react/common';
|
|
12
12
|
import { system } from '@workday/canvas-tokens-web';
|
|
13
13
|
const selectInputStencil = createStencil({
|
|
14
|
-
base: { name: "
|
|
15
|
-
}, "select-input");
|
|
14
|
+
base: { name: "a28279", styles: "caret-color:transparent;cursor:default;&::selection{background-color:transparent;}" }
|
|
15
|
+
}, "cnvs-select-input");
|
|
16
16
|
const selectIconsStencil = createStencil({
|
|
17
|
-
base: { name: "
|
|
18
|
-
}, "select-icons");
|
|
17
|
+
base: { name: "482a82", styles: "position:absolute;pointer-events:none;" }
|
|
18
|
+
}, "cnvs-select-icons");
|
|
19
19
|
const hiddenSelectInputStencil = createStencil({
|
|
20
|
-
base: { name: "
|
|
21
|
-
}, "hidden-select-input");
|
|
20
|
+
base: { name: "926b2b", styles: "position:absolute;top:var(--cnvs-sys-space-zero);bottom:var(--cnvs-sys-space-zero);left:var(--cnvs-sys-space-zero);right:var(--cnvs-sys-space-zero);opacity:0;cursor:default;pointer-events:none;" }
|
|
21
|
+
}, "cnvs-hidden-select-input");
|
|
22
22
|
export const SelectInput = createSubcomponent(TextInput)({
|
|
23
23
|
modelHook: useSelectModel,
|
|
24
24
|
elemPropsHook: useSelectInput,
|
|
@@ -39,7 +39,7 @@ export const SelectItem = createSubcomponent('li')({
|
|
|
39
39
|
})(({ children, ...elemProps }, Element, _model) => {
|
|
40
40
|
return (React.createElement(Combobox.Menu.Item, Object.assign({ role: "option", as: Element }, elemProps), children));
|
|
41
41
|
});
|
|
42
|
-
const selectCardStyles = createStyles({ name: "
|
|
42
|
+
const selectCardStyles = createStyles({ name: "a8270c", styles: "max-height:18.75rem;" });
|
|
43
43
|
export const SelectCard = createSubcomponent('div')({
|
|
44
44
|
modelHook: useSelectModel,
|
|
45
45
|
elemPropsHook: useSelectCard,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
declare function noop(): void;
|
|
2
3
|
/**
|
|
3
4
|
* `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/).
|
|
4
5
|
*/
|
|
@@ -85,9 +86,10 @@ export declare const useSelectInput: import("@workday/canvas-kit-react/common").
|
|
|
85
86
|
readonly onFocus: () => void;
|
|
86
87
|
readonly textInputProps: {
|
|
87
88
|
readonly ref: React.RefObject<HTMLInputElement>;
|
|
89
|
+
readonly onChange: typeof noop;
|
|
90
|
+
readonly value: string;
|
|
88
91
|
};
|
|
89
92
|
readonly ref: (instance: HTMLInputElement | null) => void;
|
|
90
|
-
readonly defaultValue: string | undefined;
|
|
91
93
|
} & {
|
|
92
94
|
onKeyDown(event: React.KeyboardEvent<Element>): void;
|
|
93
95
|
keySofar: string;
|
|
@@ -115,4 +117,5 @@ export declare const useSelectInput: import("@workday/canvas-kit-react/common").
|
|
|
115
117
|
ref: (instance: unknown) => void;
|
|
116
118
|
onClick: (event: React.MouseEvent<Element, MouseEvent>) => void;
|
|
117
119
|
}>;
|
|
120
|
+
export {};
|
|
118
121
|
//# sourceMappingURL=useSelectInput.d.ts.map
|
|
@@ -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,iBAAS,IAAI,SAEZ;AAED;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA4FF,mBAAmB;+BArFP,MAAM,WAAW,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsIvE,CAAC"}
|
|
@@ -2,6 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { composeHooks, createElemPropsHook, useLocalRef, useResizeObserver, dispatchInputEvent, } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { useComboboxInput, useComboboxKeyboardTypeAhead, useComboboxMoveCursorToSelected, useComboboxResetCursorToSelected, } from '@workday/canvas-kit-react/combobox';
|
|
4
4
|
import { useSelectModel } from './useSelectModel';
|
|
5
|
+
function noop() {
|
|
6
|
+
// Do nothing
|
|
7
|
+
}
|
|
5
8
|
/**
|
|
6
9
|
* `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/).
|
|
7
10
|
*/
|
|
@@ -35,6 +38,13 @@ export const useSelectInput = composeHooks(createElemPropsHook(useSelectModel)((
|
|
|
35
38
|
model.state.items.length > 0 &&
|
|
36
39
|
model.state.selectedIds[0]) {
|
|
37
40
|
const value = model.navigation.getItem(model.state.selectedIds[0], model).id;
|
|
41
|
+
// force the hidden input to have the correct value
|
|
42
|
+
if (model.state.inputRef.current.value !== value) {
|
|
43
|
+
const nativeInputValue = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(model.state.inputRef.current), 'value');
|
|
44
|
+
if (nativeInputValue && nativeInputValue.set) {
|
|
45
|
+
nativeInputValue.set.call(model.state.inputRef.current, value);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
38
48
|
if (model.state.selectedIds[0] !== value &&
|
|
39
49
|
model.state.inputRef.current.value !== value) {
|
|
40
50
|
// 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.
|
|
@@ -102,12 +112,11 @@ export const useSelectInput = composeHooks(createElemPropsHook(useSelectModel)((
|
|
|
102
112
|
},
|
|
103
113
|
textInputProps: {
|
|
104
114
|
ref: textInputRef,
|
|
115
|
+
onChange: noop,
|
|
116
|
+
value: model.state.selectedIds.length > 0 && model.state.items.length > 0
|
|
117
|
+
? model.navigation.getItem(model.state.selectedIds[0], model).textValue
|
|
118
|
+
: '',
|
|
105
119
|
},
|
|
106
120
|
ref: elementRef,
|
|
107
|
-
// Account for the case where an initial item is selected when the Select first renders
|
|
108
|
-
defaultValue: model.state.selectedIds.length > 0 && model.state.items.length > 0
|
|
109
|
-
? model.navigation.getItem(model.state.selectedIds[0], model).textValue ||
|
|
110
|
-
model.state.value
|
|
111
|
-
: undefined,
|
|
112
121
|
};
|
|
113
122
|
}), useComboboxKeyboardTypeAhead, useComboboxResetCursorToSelected, useComboboxMoveCursorToSelected, useComboboxInput);
|
|
@@ -4,8 +4,8 @@ import { createStencil, px2rem } from '@workday/canvas-kit-styling';
|
|
|
4
4
|
import { base, brand, system } from '@workday/canvas-tokens-web';
|
|
5
5
|
import { mergeStyles } from '../../layout';
|
|
6
6
|
const switchContainerStencil = createStencil({
|
|
7
|
-
base: { name: "
|
|
8
|
-
}, "switch-container");
|
|
7
|
+
base: { name: "3c93da", styles: "position:relative;height:var(--cnvs-sys-space-x6);width:var(--cnvs-sys-space-x8);" }
|
|
8
|
+
}, "cnvs-switch-container");
|
|
9
9
|
const SwitchContainer = createComponent('div')({
|
|
10
10
|
displayName: 'SwitchContainer',
|
|
11
11
|
Component: ({ children, ...elemProps }, ref, Element) => {
|
|
@@ -13,14 +13,14 @@ const SwitchContainer = createComponent('div')({
|
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
15
|
const switchInputStencil = createStencil({
|
|
16
|
-
base: { name: "
|
|
16
|
+
base: { name: "509a50", styles: "display:flex;position:absolute;height:var(--cnvs-sys-space-x6);width:var(--cnvs-sys-space-x8);margin:var(--cnvs-sys-space-zero);margin-left:var(--cnvs-sys-space-x1);border-radius:var(--cnvs-sys-shape-round);opacity:0;cursor:pointer;&:checked, &.checked{& ~ div:first-of-type{background-color:var(--cnvs-brand-primary-base);}&:disabled, &.disabled{& ~ div:first-of-type{background-color:var(--cnvs-brand-primary-light);}}}&:disabled, &.disabled{cursor:not-allowed;& ~ div:first-of-type{background-color:var(--cnvs-base-palette-soap-400);}}&:focus-visible, &:focus, &.focus{outline:none;& ~ div:first-of-type{box-shadow:0 0 0 2px var(--cnvs-base-palette-french-vanilla-100, rgba(255,255,255,1)), 0 0 0 4px var(--cnvs-brand-common-focus-outline, rgba(8,117,225,1));}}" },
|
|
17
17
|
modifiers: {
|
|
18
|
-
|
|
19
|
-
error: { name: "
|
|
20
|
-
alert: { name: "
|
|
18
|
+
error: {
|
|
19
|
+
error: { name: "518003", styles: "& ~ div:first-of-type{box-shadow:\n 0 0 0 0.125rem var(--cnvs-base-palette-french-vanilla-100),\n 0 0 0 var(--cnvs-sys-space-x1) var(--cnvs-brand-error-base),\n 0 0 0 0.3125rem transparent;}" },
|
|
20
|
+
alert: { name: "6a2682", styles: "& ~ div:first-of-type{box-shadow:\n 0 0 0 0.125rem var(--cnvs-base-palette-french-vanilla-100),\n 0 0 0 var(--cnvs-sys-space-x1) var(--cnvs-brand-alert-base),\n 0 0 0 0.3125rem var(--cnvs-brand-alert-darkest);}" }
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
}, "switch-input");
|
|
23
|
+
}, "cnvs-switch-input");
|
|
24
24
|
const SwitchInput = createComponent('input')({
|
|
25
25
|
displayName: 'SwitchInput',
|
|
26
26
|
Component: ({ error, ...elemProps }, ref, Element) => {
|
|
@@ -28,8 +28,8 @@ const SwitchInput = createComponent('input')({
|
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
30
|
const switchBackgroundStencil = createStencil({
|
|
31
|
-
base: { name: "
|
|
32
|
-
}, "switch-background");
|
|
31
|
+
base: { name: "5d72ee", styles: "box-sizing:border-box;position:absolute;display:flex;align-items:center;pointer-events:none;margin-top:var(--cnvs-sys-space-x1);width:var(--cnvs-sys-space-x8);height:var(--cnvs-sys-space-x4);border-radius:var(--cnvs-sys-shape-round);padding:var(--cnvs-sys-space-zero) 0.125rem;transition:background-color 200ms ease;background-color:var(--cnvs-base-palette-licorice-200);" }
|
|
32
|
+
}, "cnvs-switch-background");
|
|
33
33
|
const SwitchBackground = createComponent('div')({
|
|
34
34
|
displayName: 'SwitchBackground',
|
|
35
35
|
Component: ({ children, ...elemProps }, ref, Element) => {
|
|
@@ -37,13 +37,13 @@ const SwitchBackground = createComponent('div')({
|
|
|
37
37
|
},
|
|
38
38
|
});
|
|
39
39
|
const switchCircleStencil = createStencil({
|
|
40
|
-
base: { name: "
|
|
40
|
+
base: { name: "09e7dc", styles: "width:var(--cnvs-sys-space-x3);height:var(--cnvs-sys-space-x3);border-radius:var(--cnvs-sys-shape-round);box-shadow:var(--cnvs-sys-depth-1);transition:transform 150ms ease;pointer-events:none;background-color:var(--cnvs-brand-primary-accent);transform:translateX(var(--cnvs-sys-space-zero));" },
|
|
41
41
|
modifiers: {
|
|
42
|
-
|
|
43
|
-
true: { name: "
|
|
42
|
+
checked: {
|
|
43
|
+
true: { name: "202c6e", styles: "transform:translateX(var(--cnvs-sys-space-x4));" }
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
}, "switch-circle");
|
|
46
|
+
}, "cnvs-switch-circle");
|
|
47
47
|
const SwitchCircle = createComponent('div')({
|
|
48
48
|
displayName: 'SwitchCircle',
|
|
49
49
|
Component: ({ checked, ...elemProps }, ref, Element) => {
|
|
@@ -11,8 +11,8 @@ import { TableCaption } from './TableCaption';
|
|
|
11
11
|
import { createStencil, px2rem } from '@workday/canvas-kit-styling';
|
|
12
12
|
import { base, system } from '@workday/canvas-tokens-web';
|
|
13
13
|
const tableStencil = createStencil({
|
|
14
|
-
base: { name: "
|
|
15
|
-
}, "table");
|
|
14
|
+
base: { name: "c93ea3", 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);display:grid;border:0.0625rem solid var(--cnvs-base-palette-soap-500);border-radius:var(--cnvs-sys-shape-x2);overflow:auto;color:var(--cnvs-base-palette-black-pepper-300);box-sizing:border-box;" }
|
|
15
|
+
}, "cnvs-table");
|
|
16
16
|
/**
|
|
17
17
|
* `Table` is a simple styled compound component that renders a [table](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table) element. It is used to present information in a two-dimensional table comprised of rows and columns of cells containing data.
|
|
18
18
|
*
|
|
@@ -3,8 +3,8 @@ 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 tableBodyStencil = createStencil({
|
|
6
|
-
base: { name: "
|
|
7
|
-
}, "table-body");
|
|
6
|
+
base: { name: "afe05d", styles: "display:grid;box-sizing:border-box;tr {&:last-of-type{td, th{border-bottom:none;}}&:first-of-type{td, th{border-top:none;}}}td {&:last-of-type{border-inline-end:none;}&:first-of-type{border-inline-start:none;}}" }
|
|
7
|
+
}, "cnvs-table-body");
|
|
8
8
|
export const TableBody = createComponent('tbody')({
|
|
9
9
|
displayName: 'Table.Body',
|
|
10
10
|
Component: ({ children, ...elemProps }, ref, Element) => {
|
|
@@ -4,8 +4,8 @@ import { createComponent } from '@workday/canvas-kit-react/common';
|
|
|
4
4
|
import { createStencil, px2rem } from '@workday/canvas-kit-styling';
|
|
5
5
|
import { base, system } from '@workday/canvas-tokens-web';
|
|
6
6
|
const tableCaptionStencil = createStencil({
|
|
7
|
-
base: { name: "
|
|
8
|
-
}, "table-caption");
|
|
7
|
+
base: { name: "4d712b", styles: "display:flex;border-bottom:0.0625rem solid var(--cnvs-base-palette-soap-500);padding:var(--cnvs-sys-space-x2) var(--cnvs-sys-space-x4);box-sizing:border-box;" }
|
|
8
|
+
}, "cnvs-table-caption");
|
|
9
9
|
export const TableCaption = createComponent('caption')({
|
|
10
10
|
displayName: 'Table.Caption',
|
|
11
11
|
Component: ({ children, ...elemProps }, ref, Element) => {
|
|
@@ -4,8 +4,8 @@ import { createComponent } from '@workday/canvas-kit-react/common';
|
|
|
4
4
|
import { createStencil, px2rem } from '@workday/canvas-kit-styling';
|
|
5
5
|
import { base, system } from '@workday/canvas-tokens-web';
|
|
6
6
|
const tableCellStencil = createStencil({
|
|
7
|
-
base: { name: "
|
|
8
|
-
}, "table-cell");
|
|
7
|
+
base: { name: "ad28fe", styles: "display:grid;align-items:center;background-color:var(--cnvs-base-palette-french-vanilla-100);border-bottom:0.0625rem solid var(--cnvs-base-palette-soap-400);grid-template-columns:1fr;justify-content:start;min-height:3.5rem;padding:var(--cnvs-sys-space-x2) var(--cnvs-sys-space-x4);word-break:break-word;box-sizing:border-box;" }
|
|
8
|
+
}, "cnvs-table-cell");
|
|
9
9
|
export const TableCell = createComponent('td')({
|
|
10
10
|
displayName: 'Table.Cell',
|
|
11
11
|
Component: ({ children, ...elemProps }, ref, Element) => {
|
|
@@ -3,8 +3,8 @@ 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: "
|
|
7
|
-
}, "table-footer");
|
|
6
|
+
base: { name: "1b51ed", styles: "display:grid;box-sizing:border-box;" }
|
|
7
|
+
}, "cnvs-table-footer");
|
|
8
8
|
export const TableFooter = createComponent('tfoot')({
|
|
9
9
|
displayName: 'Table.Footer',
|
|
10
10
|
Component: ({ children, ...elemProps }, ref, Element) => {
|