@wordpress/components
Version:
UI components for WordPress.
47 lines (46 loc) • 1.67 kB
JavaScript
;
Object.defineProperties(exports, {
__esModule: { value: true },
[Symbol.toStringTag]: { value: "Module" }
});
let _wordpress_icons = require("@wordpress/icons");
let _wordpress_i18n = require("@wordpress/i18n");
let ______context_index_ts = require("../../context/index.cjs");
let ______toggle_group_control_index_ts = require("../../toggle-group-control/index.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
// packages/components/src/border-control/border-control-style-picker/component.tsx
const BORDER_STYLES = [
{
label: (0, _wordpress_i18n.__)("Solid"),
icon: _wordpress_icons.lineSolid,
value: "solid"
},
{
label: (0, _wordpress_i18n.__)("Dashed"),
icon: _wordpress_icons.lineDashed,
value: "dashed"
},
{
label: (0, _wordpress_i18n.__)("Dotted"),
icon: _wordpress_icons.lineDotted,
value: "dotted"
}
];
function UnconnectedBorderControlStylePicker({ onChange, ...restProps }, forwardedRef) {
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(______toggle_group_control_index_ts.ToggleGroupControl, {
ref: forwardedRef,
isDeselectable: true,
onChange: (value) => {
onChange?.(value);
},
...restProps,
children: BORDER_STYLES.map((borderStyle) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(______toggle_group_control_index_ts.ToggleGroupControlOptionIcon, {
value: borderStyle.value,
icon: borderStyle.icon,
label: borderStyle.label
}, borderStyle.value))
});
}
const BorderControlStylePicker = (0, ______context_index_ts.contextConnect)(UnconnectedBorderControlStylePicker, "BorderControlStylePicker");
exports.default = BorderControlStylePicker;
//# sourceMappingURL=component.cjs.map