UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

27 lines (26 loc) 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Combobox = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const common_1 = require("@workday/canvas-kit-react/common"); const useComboboxModel_1 = require("./hooks/useComboboxModel"); const ComboboxInput_1 = require("./ComboboxInput"); const ComboboxMenu_1 = require("./ComboboxMenu"); exports.Combobox = (0, common_1.createContainer)()({ displayName: 'Combobox', modelHook: useComboboxModel_1.useComboboxModel, subComponents: { /** * The input of the `Combobox`. This element will have `role="combobox"` applied, along with * `aria-haspopup="true"` */ Input: ComboboxInput_1.ComboboxInput, /** * A custom {@link Menu} component that uses `aria-activedescendant` instead of roving tab index * to keep the focus on the {@link ComboboxInput Combobox.Input}. */ Menu: ComboboxMenu_1.ComboboxMenu, }, })(({ children }, _, model) => { return (0, jsx_runtime_1.jsx)(ComboboxMenu_1.ComboboxMenu, { model: model, children: children }); });