UNPKG

@kubit-ui-web/react-components

Version:

Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience

21 lines 1.22 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PillSelectorV2 = exports.PillSelectorUnControlled = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = __importDefault(require("react")); const pillSelectorControlled_1 = require("./pillSelectorControlled"); const pillSelectorType_1 = require("./types/pillSelectorType"); const PillSelectorUnControlledComponent = ({ type = pillSelectorType_1.PillSelectorType.SELECTOR_MULTIPLE, defaultValue, onChange, ...props }, ref) => { const [value, setValue] = react_1.default.useState(defaultValue); const handleChange = (newValue) => { setValue(newValue); onChange?.(newValue); }; return ((0, jsx_runtime_1.jsx)(pillSelectorControlled_1.PillSelectorControlled, { ref: ref, type: type, value: value, onChange: handleChange, ...props })); }; exports.PillSelectorUnControlled = react_1.default.forwardRef(PillSelectorUnControlledComponent); exports.PillSelectorV2 = exports.PillSelectorUnControlled; //# sourceMappingURL=pillSelectorUnControlled.js.map