@workday/canvas-kit-react 12.0.0-alpha.906-next.0 → 12.0.0-alpha.908-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/collection/index.ts +1 -0
- package/collection/lib/useListItemActiveDescendant.ts +26 -0
- package/combobox/lib/ComboboxMenu.tsx +1 -2
- package/combobox/lib/ComboboxMenuItem.tsx +3 -91
- package/dist/commonjs/action-bar/lib/ActionBar.d.ts +82 -10
- package/dist/commonjs/action-bar/lib/ActionBar.d.ts.map +1 -1
- package/dist/commonjs/avatar/lib/Avatar.js +21 -21
- package/dist/commonjs/badge/lib/CountBadge.js +3 -3
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs.d.ts +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsMenu.d.ts +2 -2
- 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/index.d.ts +1 -0
- package/dist/commonjs/collection/index.d.ts.map +1 -1
- package/dist/commonjs/collection/index.js +1 -0
- package/dist/commonjs/collection/lib/ListBox.js +4 -4
- package/dist/commonjs/collection/lib/useListItemActiveDescendant.d.ts +69 -0
- package/dist/commonjs/collection/lib/useListItemActiveDescendant.d.ts.map +1 -0
- package/dist/commonjs/collection/lib/useListItemActiveDescendant.js +25 -0
- package/dist/commonjs/combobox/lib/Combobox.d.ts +5 -83
- package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/ComboboxMenu.d.ts +5 -83
- package/dist/commonjs/combobox/lib/ComboboxMenu.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/ComboboxMenu.js +1 -2
- package/dist/commonjs/combobox/lib/ComboboxMenuItem.d.ts +18 -260
- package/dist/commonjs/combobox/lib/ComboboxMenuItem.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/ComboboxMenuItem.js +3 -59
- 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/index.d.ts +2 -1
- package/dist/commonjs/menu/index.d.ts.map +1 -1
- package/dist/commonjs/menu/index.js +5 -1
- package/dist/commonjs/menu/lib/Menu.d.ts +89 -9
- package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/Menu.js +10 -0
- package/dist/commonjs/menu/lib/MenuCard.js +1 -1
- package/dist/commonjs/menu/lib/MenuItem.d.ts +12 -19
- package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +20 -91
- package/dist/commonjs/menu/lib/MenuList.js +3 -3
- package/dist/commonjs/menu/lib/MenuOption.d.ts +192 -0
- package/dist/commonjs/menu/lib/MenuOption.d.ts.map +1 -0
- package/dist/commonjs/menu/lib/MenuOption.js +89 -0
- 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.d.ts +59 -962
- package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
- package/dist/commonjs/select/lib/Select.js +5 -5
- 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/tabs/lib/Tabs.d.ts +82 -10
- package/dist/commonjs/tabs/lib/Tabs.d.ts.map +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.js +5 -5
- package/dist/commonjs/text-input/lib/InputGroup.js +6 -6
- package/dist/commonjs/text-input/lib/TextInput.js +5 -5
- 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/action-bar/lib/ActionBar.d.ts +82 -10
- package/dist/es6/action-bar/lib/ActionBar.d.ts.map +1 -1
- package/dist/es6/avatar/lib/Avatar.js +21 -21
- package/dist/es6/badge/lib/CountBadge.js +3 -3
- package/dist/es6/breadcrumbs/lib/Breadcrumbs.d.ts +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsMenu.d.ts +2 -2
- 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/index.d.ts +1 -0
- package/dist/es6/collection/index.d.ts.map +1 -1
- package/dist/es6/collection/index.js +1 -0
- package/dist/es6/collection/lib/ListBox.js +4 -4
- package/dist/es6/collection/lib/useListItemActiveDescendant.d.ts +69 -0
- package/dist/es6/collection/lib/useListItemActiveDescendant.d.ts.map +1 -0
- package/dist/es6/collection/lib/useListItemActiveDescendant.js +22 -0
- package/dist/es6/combobox/lib/Combobox.d.ts +5 -83
- package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/es6/combobox/lib/ComboboxMenu.d.ts +5 -83
- package/dist/es6/combobox/lib/ComboboxMenu.d.ts.map +1 -1
- package/dist/es6/combobox/lib/ComboboxMenu.js +1 -2
- package/dist/es6/combobox/lib/ComboboxMenuItem.d.ts +18 -260
- package/dist/es6/combobox/lib/ComboboxMenuItem.d.ts.map +1 -1
- package/dist/es6/combobox/lib/ComboboxMenuItem.js +3 -56
- 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/index.d.ts +2 -1
- package/dist/es6/menu/index.d.ts.map +1 -1
- package/dist/es6/menu/index.js +2 -1
- package/dist/es6/menu/lib/Menu.d.ts +89 -9
- package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
- package/dist/es6/menu/lib/Menu.js +10 -0
- package/dist/es6/menu/lib/MenuCard.js +1 -1
- package/dist/es6/menu/lib/MenuItem.d.ts +12 -19
- package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuItem.js +22 -93
- package/dist/es6/menu/lib/MenuList.js +3 -3
- package/dist/es6/menu/lib/MenuOption.d.ts +192 -0
- package/dist/es6/menu/lib/MenuOption.d.ts.map +1 -0
- package/dist/es6/menu/lib/MenuOption.js +63 -0
- 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.d.ts +59 -962
- package/dist/es6/select/lib/Select.d.ts.map +1 -1
- package/dist/es6/select/lib/Select.js +5 -5
- 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/tabs/lib/Tabs.d.ts +82 -10
- package/dist/es6/tabs/lib/Tabs.d.ts.map +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.js +5 -5
- package/dist/es6/text-input/lib/InputGroup.js +6 -6
- package/dist/es6/text-input/lib/TextInput.js +5 -5
- 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/menu/index.ts +2 -1
- package/menu/lib/Menu.tsx +10 -0
- package/menu/lib/MenuItem.tsx +107 -99
- package/menu/lib/MenuOption.tsx +138 -0
- package/package.json +4 -4
- package/select/lib/Select.tsx +1 -1
|
@@ -20,7 +20,7 @@ const systemIconCircleStencil = createStencil({
|
|
|
20
20
|
backgroundColor: '',
|
|
21
21
|
iconColor: '',
|
|
22
22
|
},
|
|
23
|
-
base: { name: "
|
|
23
|
+
base: { name: "xgsx15", styles: "box-sizing:border-box;background:var(--backgroundColor-system-icon-circle-554859, 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);overflow:hidden;width:var(--containerSize-system-icon-circle-554859, var(--cnvs-sys-space-x10));height:var(--containerSize-system-icon-circle-554859, var(--cnvs-sys-space-x10));--size-svg-a30d66:calc(var(--containerSize-system-icon-circle-554859, var(--cnvs-sys-space-x10)) * 0.625);--color-system-icon-583fae:var(--iconColor-system-icon-circle-554859);& img{width:100%;height:100%;}" }
|
|
24
24
|
}, "system-icon-circle-554859");
|
|
25
25
|
export const SystemIconCircle = createComponent('span')({
|
|
26
26
|
displayName: 'SystemIconCircle',
|
|
@@ -5,12 +5,12 @@ import { handleCsProp, keyframes, createStencil, calc } from '@workday/canvas-ki
|
|
|
5
5
|
/**
|
|
6
6
|
* Keyframe for the dots loading animation.
|
|
7
7
|
*/
|
|
8
|
-
const keyframesLoading = keyframes({ name: "
|
|
8
|
+
const keyframesLoading = keyframes({ name: "xgsx4y", styles: "0%, 80%, 100%{transform:scale(0);}40%{transform:scale(1);}" });
|
|
9
9
|
const singleLoadingDotStencil = createStencil({
|
|
10
10
|
vars: {
|
|
11
11
|
animationDurationMs: '40ms',
|
|
12
12
|
},
|
|
13
|
-
base: { name: "
|
|
13
|
+
base: { name: "xgsx4z", styles: "--animationDurationMs-single-loading-dot-dec117:40ms;box-sizing:border-box;background-color:var(--cnvs-sys-color-bg-alt-strong);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-xgsx4y;animation-duration:calc(var(--animationDurationMs-single-loading-dot-dec117) * 35);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(var(--animationDurationMs-single-loading-dot-dec117) * 4);}&:nth-child(3){animation-delay:calc(var(--animationDurationMs-single-loading-dot-dec117) * 8);}" }
|
|
14
14
|
}, "single-loading-dot-dec117");
|
|
15
15
|
/**
|
|
16
16
|
* The actual loading dot div.
|
|
@@ -20,7 +20,7 @@ const LoadingAnimationDot = () => React.createElement("div", { ...singleLoadingD
|
|
|
20
20
|
* A simple container for the loading dots.
|
|
21
21
|
*/
|
|
22
22
|
const loadingDotsStencil = createStencil({
|
|
23
|
-
base: { name: "
|
|
23
|
+
base: { name: "xgsx50", styles: "box-sizing:border-box;display:inline-flex;gap:var(--cnvs-sys-space-x2);" }
|
|
24
24
|
}, "loading-dots-268f58");
|
|
25
25
|
/**
|
|
26
26
|
* A simple component that displays three horizontal dots, to be used when some data is loading.
|
package/dist/es6/menu/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { useMenuModel } from './lib/useMenuModel';
|
|
2
2
|
export { Menu } from './lib/Menu';
|
|
3
3
|
export { useMenuCard } from './lib/MenuCard';
|
|
4
|
-
export { useMenuItem,
|
|
4
|
+
export { useMenuItem, menuItemStencil, StyledMenuItem } from './lib/MenuItem';
|
|
5
|
+
export { useMenuOption, menuOptionStencil } from './lib/MenuOption';
|
|
5
6
|
export { useMenuList, menuListStencil } from './lib/MenuList';
|
|
6
7
|
export { useMenuPopper } from './lib/MenuPopper';
|
|
7
8
|
export { useMenuTarget, useMenuTargetContext } from './lib/MenuTarget';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,IAAI,EAAC,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,IAAI,EAAC,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,WAAW,EAAE,eAAe,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAC,aAAa,EAAE,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,aAAa,EAAE,oBAAoB,EAAC,MAAM,kBAAkB,CAAC"}
|
package/dist/es6/menu/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { useMenuModel } from './lib/useMenuModel';
|
|
2
2
|
export { Menu } from './lib/Menu';
|
|
3
3
|
export { useMenuCard } from './lib/MenuCard';
|
|
4
|
-
export { useMenuItem, StyledMenuItem } from './lib/MenuItem';
|
|
4
|
+
export { useMenuItem, menuItemStencil, StyledMenuItem } from './lib/MenuItem';
|
|
5
|
+
export { useMenuOption, menuOptionStencil } from './lib/MenuOption';
|
|
5
6
|
export { useMenuList, menuListStencil } from './lib/MenuList';
|
|
6
7
|
export { useMenuPopper } from './lib/MenuPopper';
|
|
7
8
|
export { useMenuTarget, useMenuTargetContext } from './lib/MenuTarget';
|
|
@@ -1767,15 +1767,95 @@ export declare const Menu: import("@workday/canvas-kit-react/common").ComponentM
|
|
|
1767
1767
|
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
1768
1768
|
getId: (item: any) => string;
|
|
1769
1769
|
}> & {
|
|
1770
|
-
Icon:
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1770
|
+
Icon: (elemProps: import("../..").SystemIconProps) => React.JSX.Element;
|
|
1771
|
+
Text: ({ children }: {
|
|
1772
|
+
children?: React.ReactNode;
|
|
1773
|
+
}) => React.JSX.Element;
|
|
1774
|
+
};
|
|
1775
|
+
/**
|
|
1776
|
+
* A `Menu.Option` is similar to the `Menu.Item`, but has a `role=option` and works with
|
|
1777
|
+
* `aria-activedescendant` and is selectable with a selected checkmark. It adds the
|
|
1778
|
+
* `aria-selected="true/false"` attribute. `Menu.Option` requires much more accessibility
|
|
1779
|
+
* behavior composed into the `Menu.Target` and `Menu.List` component. The `Combobox` and
|
|
1780
|
+
* `Select` components make use of the `Menu.Option`. See those components for a better idea of
|
|
1781
|
+
* how behavior is composed.
|
|
1782
|
+
*/
|
|
1783
|
+
Option: import("@workday/canvas-kit-react/common").ElementComponentM<"li", import("./MenuOption").MenuOptionProps, {
|
|
1784
|
+
state: {
|
|
1785
|
+
stackRef: React.RefObject<HTMLDivElement>;
|
|
1786
|
+
targetRef: React.RefObject<HTMLButtonElement>;
|
|
1787
|
+
initialFocusRef: React.RefObject<any> | undefined;
|
|
1788
|
+
returnFocusRef: React.RefObject<any> | undefined;
|
|
1789
|
+
placement: import("@popperjs/core").Placement;
|
|
1790
|
+
id: string;
|
|
1791
|
+
visibility: "hidden" | "visible";
|
|
1792
|
+
selectedIds: string[] | "all";
|
|
1793
|
+
unselectedIds: string[];
|
|
1794
|
+
cursorId: string;
|
|
1795
|
+
columnCount: number;
|
|
1796
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
1797
|
+
cursorIndexRef: {
|
|
1798
|
+
readonly current: number;
|
|
1799
|
+
};
|
|
1800
|
+
UNSTABLE_virtual: {
|
|
1801
|
+
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
1802
|
+
totalSize: number;
|
|
1803
|
+
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
1804
|
+
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
1805
|
+
measure: () => void;
|
|
1806
|
+
};
|
|
1807
|
+
UNSTABLE_defaultItemHeight: number;
|
|
1808
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
1809
|
+
orientation: "horizontal" | "vertical";
|
|
1810
|
+
indexRef: React.MutableRefObject<number>;
|
|
1811
|
+
nonInteractiveIds: string[];
|
|
1812
|
+
isVirtualized: boolean;
|
|
1813
|
+
items: import("../..").Item<any>[];
|
|
1814
|
+
mode: "multiple" | "single";
|
|
1815
|
+
};
|
|
1816
|
+
events: {
|
|
1817
|
+
updatePlacement(data: {
|
|
1818
|
+
placement: import("@popperjs/core").Placement;
|
|
1819
|
+
}): void;
|
|
1820
|
+
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
1821
|
+
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
1822
|
+
select(data: {
|
|
1823
|
+
id: string;
|
|
1824
|
+
}): void;
|
|
1825
|
+
selectAll(): void;
|
|
1826
|
+
unselectAll(): void;
|
|
1827
|
+
goTo(data: {
|
|
1828
|
+
id: string;
|
|
1829
|
+
}): void;
|
|
1830
|
+
goToNext(): void;
|
|
1831
|
+
goToPrevious(): void;
|
|
1832
|
+
goToPreviousRow(): void;
|
|
1833
|
+
goToNextRow(): void;
|
|
1834
|
+
goToFirst(): void;
|
|
1835
|
+
goToLast(): void;
|
|
1836
|
+
goToFirstOfRow(): void;
|
|
1837
|
+
goToLastOfRow(): void;
|
|
1838
|
+
goToNextPage(): void;
|
|
1839
|
+
goToPreviousPage(): void;
|
|
1840
|
+
registerItem(data: {
|
|
1841
|
+
item: any;
|
|
1842
|
+
textValue: string;
|
|
1843
|
+
}): void;
|
|
1844
|
+
unregisterItem(data: {
|
|
1845
|
+
id: string;
|
|
1846
|
+
}): void;
|
|
1847
|
+
updateItemHeight(data: {
|
|
1848
|
+
value: number;
|
|
1849
|
+
}): void;
|
|
1850
|
+
};
|
|
1851
|
+
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
1852
|
+
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
1853
|
+
getId: (item: any) => string;
|
|
1854
|
+
}> & {
|
|
1855
|
+
Icon: (elemProps: import("../..").SystemIconProps) => React.JSX.Element;
|
|
1856
|
+
Text: ({ children }: {
|
|
1857
|
+
children?: React.ReactNode;
|
|
1858
|
+
}) => React.JSX.Element;
|
|
1779
1859
|
};
|
|
1780
1860
|
Divider: import("@workday/canvas-kit-react/common").ElementComponent<"hr", unknown>;
|
|
1781
1861
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../menu/lib/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../menu/lib/Menu.tsx"],"names":[],"mappings":"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"}
|
|
@@ -7,6 +7,7 @@ import { MenuItem } from './MenuItem';
|
|
|
7
7
|
import { MenuCard } from './MenuCard';
|
|
8
8
|
import { MenuList } from './MenuList';
|
|
9
9
|
import { MenuDivider } from './MenuDivider';
|
|
10
|
+
import { MenuOption } from './MenuOption';
|
|
10
11
|
/**
|
|
11
12
|
* `Menu` is a combination of a popup and a list. It usually has some type of target element that
|
|
12
13
|
* expands/collapses the menu and a `menu` role and and several `menuitem` roles. Focus is managed
|
|
@@ -89,6 +90,15 @@ export const Menu = createContainer()({
|
|
|
89
90
|
* the model.
|
|
90
91
|
*/
|
|
91
92
|
Item: MenuItem,
|
|
93
|
+
/**
|
|
94
|
+
* A `Menu.Option` is similar to the `Menu.Item`, but has a `role=option` and works with
|
|
95
|
+
* `aria-activedescendant` and is selectable with a selected checkmark. It adds the
|
|
96
|
+
* `aria-selected="true/false"` attribute. `Menu.Option` requires much more accessibility
|
|
97
|
+
* behavior composed into the `Menu.Target` and `Menu.List` component. The `Combobox` and
|
|
98
|
+
* `Select` components make use of the `Menu.Option`. See those components for a better idea of
|
|
99
|
+
* how behavior is composed.
|
|
100
|
+
*/
|
|
101
|
+
Option: MenuOption,
|
|
92
102
|
Divider: MenuDivider,
|
|
93
103
|
/**
|
|
94
104
|
* A `Menu.TargetContext` is the same as a {@link MenuTarget Menu.Target}, except it adds a
|
|
@@ -12,7 +12,7 @@ export const menuCardStencil = createStencil({
|
|
|
12
12
|
transformOriginVertical: 'top',
|
|
13
13
|
transformOriginHorizontal: 'left',
|
|
14
14
|
},
|
|
15
|
-
base: { name: "
|
|
15
|
+
base: { name: "xgsx2o", styles: "--minWidth-menu-card-07ca6c:0.0625rem;--transformOriginVertical-menu-card-07ca6c:top;--transformOriginHorizontal-menu-card-07ca6c:left;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-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(--minWidth-menu-card-07ca6c);transform-origin:var(--transformOriginVertical-menu-card-07ca6c) var(--transformOriginHorizontal-menu-card-07ca6c);.wd-no-animation &{animation:none;}" }
|
|
16
16
|
}, "menu-card-07ca6c");
|
|
17
17
|
export const useMenuCard = createElemPropsHook(useMenuModel)(() => {
|
|
18
18
|
return {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
3
3
|
export interface MenuItemProps {
|
|
4
4
|
/**
|
|
5
5
|
* Optionally pass index to menu item. This should be done if `Menu.Item` components were created
|
|
@@ -10,27 +10,28 @@ export interface MenuItemProps {
|
|
|
10
10
|
/**
|
|
11
11
|
* The label text of the MenuItem.
|
|
12
12
|
*/
|
|
13
|
-
children
|
|
13
|
+
children?: React.ReactNode;
|
|
14
14
|
/**
|
|
15
15
|
* The name of the menu item. This name will be used in the `onSelect` callback in the model. If
|
|
16
16
|
* this property is not provided, it will default to a string representation of the the zero-based
|
|
17
17
|
* index of the Tab when it was initialized.
|
|
18
18
|
*/
|
|
19
19
|
'data-id'?: string;
|
|
20
|
+
/**
|
|
21
|
+
* `aria-disabled` is used for keyboard and screen reader users to discover disabled content with
|
|
22
|
+
* the keyboard or screen reader caret tool. For more information, see
|
|
23
|
+
* https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls
|
|
24
|
+
*/
|
|
20
25
|
'aria-disabled'?: boolean;
|
|
21
|
-
}
|
|
22
|
-
interface StyledMenuProps {
|
|
23
26
|
/**
|
|
24
27
|
* If true, set the StyledMenuItem to the disabled state so it is not clickable.
|
|
25
28
|
* @default false
|
|
29
|
+
* @deprecated Use `aria-disabled` instead
|
|
26
30
|
*/
|
|
27
31
|
isDisabled?: boolean;
|
|
28
32
|
}
|
|
29
|
-
export declare const
|
|
30
|
-
|
|
31
|
-
} & {
|
|
32
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
33
|
-
} & StyledType & StyledMenuProps, {}, {}>;
|
|
33
|
+
export declare const menuItemStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, never>, {}, never, never>;
|
|
34
|
+
export declare const StyledMenuItem: import("@workday/canvas-kit-react/common").ElementComponent<"button", MenuItemProps>;
|
|
34
35
|
export declare const useMenuItem: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
35
36
|
state: {
|
|
36
37
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
@@ -196,15 +197,7 @@ export declare const MenuItem: import("@workday/canvas-kit-react/common").Elemen
|
|
|
196
197
|
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
197
198
|
getId: (item: any) => string;
|
|
198
199
|
}> & {
|
|
199
|
-
Icon:
|
|
200
|
-
|
|
201
|
-
} & {
|
|
202
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
203
|
-
}, {}, {}>;
|
|
204
|
-
Text: import("@emotion/styled").StyledComponent<{
|
|
205
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
206
|
-
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
207
|
-
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
200
|
+
Icon: (elemProps: SystemIconProps) => React.JSX.Element;
|
|
201
|
+
Text: ({ children }: React.PropsWithChildren) => React.JSX.Element;
|
|
208
202
|
};
|
|
209
|
-
export {};
|
|
210
203
|
//# sourceMappingURL=MenuItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../menu/lib/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../menu/lib/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,EAAa,eAAe,EAAoB,MAAM,gCAAgC,CAAC;AAW9F,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,yIAqE1B,CAAC;AAUH,eAAO,MAAM,cAAc,sFAazB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAuBF,MAAM,cAAc;;;;;;;;;;;;;;;;;;EAazC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA7DY,eAAe;yBAId,MAAM,iBAAiB;CAyEvD,CAAC"}
|
|
@@ -1,97 +1,26 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { createStencil } from '@workday/canvas-kit-styling';
|
|
3
|
+
import { brand, system } from '@workday/canvas-tokens-web';
|
|
4
|
+
import { createSubcomponent, composeHooks, createElemPropsHook, useLocalRef, createComponent, } from '@workday/canvas-kit-react/common';
|
|
5
|
+
import { SystemIcon, systemIconStencil } from '@workday/canvas-kit-react/icon';
|
|
5
6
|
import { OverflowTooltip } from '@workday/canvas-kit-react/tooltip';
|
|
6
|
-
import {
|
|
7
|
+
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
7
8
|
import { useListItemRegister, useListItemRovingFocus, useListItemSelect, } from '@workday/canvas-kit-react/collection';
|
|
8
9
|
import { useMenuModel } from './useMenuModel';
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'&:hover, &[aria-selected=true]': {
|
|
24
|
-
backgroundColor: theme.canvas.palette.primary.lightest,
|
|
25
|
-
color: colors.blackPepper300,
|
|
26
|
-
'.wd-icon-fill, .wd-icon-accent, .wd-icon-accent2': {
|
|
27
|
-
fill: iconColors.hover,
|
|
28
|
-
},
|
|
29
|
-
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
30
|
-
fill: iconColors.hover,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
'&:focus, &.focus': {
|
|
34
|
-
outline: 'none',
|
|
35
|
-
backgroundColor: theme.canvas.palette.primary.main,
|
|
36
|
-
color: typeColors.inverse,
|
|
37
|
-
'.wd-icon-fill, .wd-icon-accent, .wd-icon-accent2': {
|
|
38
|
-
fill: iconColors.inverse,
|
|
39
|
-
},
|
|
40
|
-
'*:hover .wd-icon-fill': {
|
|
41
|
-
fill: iconColors.inverse,
|
|
42
|
-
},
|
|
43
|
-
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
44
|
-
fill: iconColors.inverse,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
// We want the focus styles no matter what
|
|
48
|
-
[`[data-whatinput]`]: {
|
|
49
|
-
backgroundColor: 'inherit',
|
|
50
|
-
color: colors.blackPepper300,
|
|
51
|
-
'&:hover, &[aria-selected=true]': {
|
|
52
|
-
backgroundColor: theme.canvas.palette.primary.lightest,
|
|
53
|
-
'.wd-icon-fill, .wd-icon-accent, .wd-icon-accent2': {
|
|
54
|
-
fill: iconColors.hover,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
'&:focus, &.focus': {
|
|
58
|
-
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
59
|
-
fill: iconColors.hover,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
backgroundColor: 'inherit',
|
|
64
|
-
'&:disabled, &[aria-disabled=true]': {
|
|
65
|
-
color: colors.licorice100,
|
|
66
|
-
cursor: 'default',
|
|
67
|
-
'.wd-icon-fill, .wd-icon-accent, .wd-icon-accent2': {
|
|
68
|
-
fill: iconColors.disabled,
|
|
69
|
-
},
|
|
70
|
-
'&:focus, &.focus': {
|
|
71
|
-
backgroundColor: colors.blueberry200,
|
|
72
|
-
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
73
|
-
fill: iconColors.disabled,
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
'&:hover, &[aria-selected=true]': {
|
|
77
|
-
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
78
|
-
fill: iconColors.disabled,
|
|
79
|
-
},
|
|
80
|
-
'*:hover .wd-icon-fill': {
|
|
81
|
-
fill: iconColors.disabled,
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
}, ({ children }) => {
|
|
87
|
-
if (typeof children === 'string') {
|
|
88
|
-
return {};
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
return {
|
|
92
|
-
display: 'flex',
|
|
93
|
-
};
|
|
94
|
-
}
|
|
10
|
+
export const menuItemStencil = createStencil({
|
|
11
|
+
base: { name: "xgsx2n", 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:flex;align-items:center;width:100%;gap:var(--cnvs-sys-space-x4);padding:var(--cnvs-sys-space-x2) var(--cnvs-sys-space-x4);cursor:pointer;color:var(--cnvs-sys-color-fg-default);border-width:0;text-align:start;transition:background-color 80ms, color 80ms;background-color:inherit;min-height:var(--cnvs-sys-space-x10);--color-system-icon-583fae:currentcolor;& :where([data-part=\"menu-item-selected\"]){transition:opacity 80ms linear;opacity:var(--cnvs-sys-opacity-zero);}&:where(:has(span)){display:flex;}&:is([aria-selected=true]){color:var(--cnvs-brand-primary-dark);background-color:var(--cnvs-brand-primary-lightest);}&:is(.hover, :hover){color:var(--cnvs-sys-color-fg-strong);background-color:var(--cnvs-brand-neutral-lightest);}&:is(.focus, :focus){color:var(--cnvs-brand-primary-accent);outline:none;background-color:var(--cnvs-brand-primary-base);}&:is(:disabled, [aria-disabled=true]){color:var(--cnvs-sys-color-text-disabled);cursor:default;&:where(.focus, :focus){background-color:var(--cnvs-brand-primary-light);}}& :where([data-part=\"menu-item-text\"]){flex-grow:1;align-self:center;}& :where([data-part=\"menu-icon-icon\"]){align-self:start;}" }
|
|
12
|
+
}, "menu-item-7213c6");
|
|
13
|
+
const MenuItemIcon = (elemProps) => {
|
|
14
|
+
return React.createElement(SystemIcon, { "data-part": "menu-item-icon", ...elemProps });
|
|
15
|
+
};
|
|
16
|
+
const MenuItemText = ({ children }) => {
|
|
17
|
+
return React.createElement("span", { "data-part": "menu-item-text" }, children);
|
|
18
|
+
};
|
|
19
|
+
export const StyledMenuItem = createComponent('button')({
|
|
20
|
+
displayName: 'MenuItem',
|
|
21
|
+
Component: ({ children, isDisabled, ...elemProps }, ref, Element) => {
|
|
22
|
+
return (React.createElement(Element, { ref: ref, "aria-disabled": isDisabled, ...mergeStyles(elemProps, menuItemStencil({})) }, typeof children === 'string' ? React.createElement(MenuItemText, null, children) : children));
|
|
23
|
+
},
|
|
95
24
|
});
|
|
96
25
|
export const useMenuItem = composeHooks(createElemPropsHook(useMenuModel)((model, ref, elemProps = { 'data-id': '' }) => {
|
|
97
26
|
const { localRef, elementRef } = useLocalRef(ref);
|
|
@@ -126,10 +55,10 @@ export const MenuItem = createSubcomponent('button')({
|
|
|
126
55
|
modelHook: useMenuModel,
|
|
127
56
|
elemPropsHook: useMenuItem,
|
|
128
57
|
subComponents: {
|
|
129
|
-
Icon:
|
|
130
|
-
Text:
|
|
58
|
+
Icon: MenuItemIcon,
|
|
59
|
+
Text: MenuItemText,
|
|
131
60
|
},
|
|
132
61
|
})(({ children, ...elemProps }, Element) => {
|
|
133
62
|
return (React.createElement(OverflowTooltip, { placement: "left" },
|
|
134
|
-
React.createElement(StyledMenuItem, {
|
|
63
|
+
React.createElement(StyledMenuItem, { as: Element, ...elemProps }, children)));
|
|
135
64
|
});
|
|
@@ -12,11 +12,11 @@ export const useMenuList = composeHooks(createElemPropsHook(useMenuModel)(model
|
|
|
12
12
|
};
|
|
13
13
|
}), useReturnFocus, useFocusRedirect);
|
|
14
14
|
export const menuListStencil = createStencil({
|
|
15
|
-
base: { name: "
|
|
15
|
+
base: { name: "xgsx2p", styles: "box-sizing:border-box;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);" },
|
|
16
16
|
modifiers: {
|
|
17
17
|
orientation: {
|
|
18
|
-
vertical: { name: "
|
|
19
|
-
horizontal: { name: "
|
|
18
|
+
vertical: { name: "xgsx2q", styles: "flex-direction:column;" },
|
|
19
|
+
horizontal: { name: "xgsx2r", styles: "flex-direction:row;" }
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}, "menu-list-b9b420");
|