@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
25 lines (24 loc) • 671 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.usePillModel = void 0;
const common_1 = require("@workday/canvas-kit-react/common");
exports.usePillModel = (0, common_1.createModelHook)({
defaultConfig: {
/**
* Used to disable a pill and apply the correct styles.
*/
disabled: false,
/**
* ID used to add accessibility labels to pill elements.
* @default `useUniqueId()`
*/
id: '',
},
})(config => {
const id = (0, common_1.useUniqueId)(config.id);
const state = {
...config,
id,
};
return { state, events: {} };
});