Files
pole-book/server/node_modules/@radix-ui/react-toolbar/dist/index.js

178 lines
11 KiB
JavaScript

var $ds9gm$babelruntimehelpersextends = require("@babel/runtime/helpers/extends");
var $ds9gm$react = require("react");
var $ds9gm$radixuiprimitive = require("@radix-ui/primitive");
var $ds9gm$radixuireactcontext = require("@radix-ui/react-context");
var $ds9gm$radixuireactrovingfocus = require("@radix-ui/react-roving-focus");
var $ds9gm$radixuireactprimitive = require("@radix-ui/react-primitive");
var $ds9gm$radixuireactseparator = require("@radix-ui/react-separator");
var $ds9gm$radixuireacttogglegroup = require("@radix-ui/react-toggle-group");
var $ds9gm$radixuireactdirection = require("@radix-ui/react-direction");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
$parcel$export(module.exports, "createToolbarScope", () => $ac268fe8f3257fa7$export$233e637670877d91);
$parcel$export(module.exports, "Toolbar", () => $ac268fe8f3257fa7$export$4c260019440d418f);
$parcel$export(module.exports, "ToolbarSeparator", () => $ac268fe8f3257fa7$export$291e1a31e8ec7868);
$parcel$export(module.exports, "ToolbarButton", () => $ac268fe8f3257fa7$export$e5c1a33878e86e9e);
$parcel$export(module.exports, "ToolbarLink", () => $ac268fe8f3257fa7$export$ff5714eba66809fd);
$parcel$export(module.exports, "ToolbarToggleGroup", () => $ac268fe8f3257fa7$export$aeae28cb17562c0b);
$parcel$export(module.exports, "ToolbarToggleItem", () => $ac268fe8f3257fa7$export$546b879b639844a1);
$parcel$export(module.exports, "Root", () => $ac268fe8f3257fa7$export$be92b6f5f03c0fe9);
$parcel$export(module.exports, "Separator", () => $ac268fe8f3257fa7$export$1ff3c3f08ae963c0);
$parcel$export(module.exports, "Button", () => $ac268fe8f3257fa7$export$353f5b6fc5456de1);
$parcel$export(module.exports, "Link", () => $ac268fe8f3257fa7$export$a6c7ac8248d6e38a);
$parcel$export(module.exports, "ToggleGroup", () => $ac268fe8f3257fa7$export$af3ec21f6cfb5e30);
$parcel$export(module.exports, "ToggleItem", () => $ac268fe8f3257fa7$export$920ad4cf87b18fc7);
/* -------------------------------------------------------------------------------------------------
* Toolbar
* -----------------------------------------------------------------------------------------------*/ const $ac268fe8f3257fa7$var$TOOLBAR_NAME = 'Toolbar';
const [$ac268fe8f3257fa7$var$createToolbarContext, $ac268fe8f3257fa7$export$233e637670877d91] = $ds9gm$radixuireactcontext.createContextScope($ac268fe8f3257fa7$var$TOOLBAR_NAME, [
$ds9gm$radixuireactrovingfocus.createRovingFocusGroupScope,
$ds9gm$radixuireacttogglegroup.createToggleGroupScope
]);
const $ac268fe8f3257fa7$var$useRovingFocusGroupScope = $ds9gm$radixuireactrovingfocus.createRovingFocusGroupScope();
const $ac268fe8f3257fa7$var$useToggleGroupScope = $ds9gm$radixuireacttogglegroup.createToggleGroupScope();
const [$ac268fe8f3257fa7$var$ToolbarProvider, $ac268fe8f3257fa7$var$useToolbarContext] = $ac268fe8f3257fa7$var$createToolbarContext($ac268fe8f3257fa7$var$TOOLBAR_NAME);
const $ac268fe8f3257fa7$export$4c260019440d418f = /*#__PURE__*/ $ds9gm$react.forwardRef((props, forwardedRef)=>{
const { __scopeToolbar: __scopeToolbar , orientation: orientation = 'horizontal' , dir: dir , loop: loop = true , ...toolbarProps } = props;
const rovingFocusGroupScope = $ac268fe8f3257fa7$var$useRovingFocusGroupScope(__scopeToolbar);
const direction = $ds9gm$radixuireactdirection.useDirection(dir);
return /*#__PURE__*/ $ds9gm$react.createElement($ac268fe8f3257fa7$var$ToolbarProvider, {
scope: __scopeToolbar,
orientation: orientation,
dir: direction
}, /*#__PURE__*/ $ds9gm$react.createElement($ds9gm$radixuireactrovingfocus.Root, ($parcel$interopDefault($ds9gm$babelruntimehelpersextends))({
asChild: true
}, rovingFocusGroupScope, {
orientation: orientation,
dir: direction,
loop: loop
}), /*#__PURE__*/ $ds9gm$react.createElement($ds9gm$radixuireactprimitive.Primitive.div, ($parcel$interopDefault($ds9gm$babelruntimehelpersextends))({
role: "toolbar",
"aria-orientation": orientation,
dir: direction
}, toolbarProps, {
ref: forwardedRef
}))));
});
/*#__PURE__*/ Object.assign($ac268fe8f3257fa7$export$4c260019440d418f, {
displayName: $ac268fe8f3257fa7$var$TOOLBAR_NAME
});
/* -------------------------------------------------------------------------------------------------
* ToolbarSeparator
* -----------------------------------------------------------------------------------------------*/ const $ac268fe8f3257fa7$var$SEPARATOR_NAME = 'ToolbarSeparator';
const $ac268fe8f3257fa7$export$291e1a31e8ec7868 = /*#__PURE__*/ $ds9gm$react.forwardRef((props, forwardedRef)=>{
const { __scopeToolbar: __scopeToolbar , ...separatorProps } = props;
const context = $ac268fe8f3257fa7$var$useToolbarContext($ac268fe8f3257fa7$var$SEPARATOR_NAME, __scopeToolbar);
return /*#__PURE__*/ $ds9gm$react.createElement($ds9gm$radixuireactseparator.Root, ($parcel$interopDefault($ds9gm$babelruntimehelpersextends))({
orientation: context.orientation === 'horizontal' ? 'vertical' : 'horizontal'
}, separatorProps, {
ref: forwardedRef
}));
});
/*#__PURE__*/ Object.assign($ac268fe8f3257fa7$export$291e1a31e8ec7868, {
displayName: $ac268fe8f3257fa7$var$SEPARATOR_NAME
});
/* -------------------------------------------------------------------------------------------------
* ToolbarButton
* -----------------------------------------------------------------------------------------------*/ const $ac268fe8f3257fa7$var$BUTTON_NAME = 'ToolbarButton';
const $ac268fe8f3257fa7$export$e5c1a33878e86e9e = /*#__PURE__*/ $ds9gm$react.forwardRef((props, forwardedRef)=>{
const { __scopeToolbar: __scopeToolbar , ...buttonProps } = props;
const rovingFocusGroupScope = $ac268fe8f3257fa7$var$useRovingFocusGroupScope(__scopeToolbar);
return /*#__PURE__*/ $ds9gm$react.createElement($ds9gm$radixuireactrovingfocus.Item, ($parcel$interopDefault($ds9gm$babelruntimehelpersextends))({
asChild: true
}, rovingFocusGroupScope, {
focusable: !props.disabled
}), /*#__PURE__*/ $ds9gm$react.createElement($ds9gm$radixuireactprimitive.Primitive.button, ($parcel$interopDefault($ds9gm$babelruntimehelpersextends))({
type: "button"
}, buttonProps, {
ref: forwardedRef
})));
});
/*#__PURE__*/ Object.assign($ac268fe8f3257fa7$export$e5c1a33878e86e9e, {
displayName: $ac268fe8f3257fa7$var$BUTTON_NAME
});
/* -------------------------------------------------------------------------------------------------
* ToolbarLink
* -----------------------------------------------------------------------------------------------*/ const $ac268fe8f3257fa7$var$LINK_NAME = 'ToolbarLink';
const $ac268fe8f3257fa7$export$ff5714eba66809fd = /*#__PURE__*/ $ds9gm$react.forwardRef((props, forwardedRef)=>{
const { __scopeToolbar: __scopeToolbar , ...linkProps } = props;
const rovingFocusGroupScope = $ac268fe8f3257fa7$var$useRovingFocusGroupScope(__scopeToolbar);
return /*#__PURE__*/ $ds9gm$react.createElement($ds9gm$radixuireactrovingfocus.Item, ($parcel$interopDefault($ds9gm$babelruntimehelpersextends))({
asChild: true
}, rovingFocusGroupScope, {
focusable: true
}), /*#__PURE__*/ $ds9gm$react.createElement($ds9gm$radixuireactprimitive.Primitive.a, ($parcel$interopDefault($ds9gm$babelruntimehelpersextends))({}, linkProps, {
ref: forwardedRef,
onKeyDown: $ds9gm$radixuiprimitive.composeEventHandlers(props.onKeyDown, (event)=>{
if (event.key === ' ') event.currentTarget.click();
})
})));
});
/*#__PURE__*/ Object.assign($ac268fe8f3257fa7$export$ff5714eba66809fd, {
displayName: $ac268fe8f3257fa7$var$LINK_NAME
});
/* -------------------------------------------------------------------------------------------------
* ToolbarToggleGroup
* -----------------------------------------------------------------------------------------------*/ const $ac268fe8f3257fa7$var$TOGGLE_GROUP_NAME = 'ToolbarToggleGroup';
const $ac268fe8f3257fa7$export$aeae28cb17562c0b = /*#__PURE__*/ $ds9gm$react.forwardRef((props, forwardedRef)=>{
const { __scopeToolbar: __scopeToolbar , ...toggleGroupProps } = props;
const context = $ac268fe8f3257fa7$var$useToolbarContext($ac268fe8f3257fa7$var$TOGGLE_GROUP_NAME, __scopeToolbar);
const toggleGroupScope = $ac268fe8f3257fa7$var$useToggleGroupScope(__scopeToolbar);
return /*#__PURE__*/ $ds9gm$react.createElement($ds9gm$radixuireacttogglegroup.Root, ($parcel$interopDefault($ds9gm$babelruntimehelpersextends))({
"data-orientation": context.orientation,
dir: context.dir
}, toggleGroupScope, toggleGroupProps, {
ref: forwardedRef,
rovingFocus: false
}));
});
/*#__PURE__*/ Object.assign($ac268fe8f3257fa7$export$aeae28cb17562c0b, {
displayName: $ac268fe8f3257fa7$var$TOGGLE_GROUP_NAME
});
/* -------------------------------------------------------------------------------------------------
* ToolbarToggleItem
* -----------------------------------------------------------------------------------------------*/ const $ac268fe8f3257fa7$var$TOGGLE_ITEM_NAME = 'ToolbarToggleItem';
const $ac268fe8f3257fa7$export$546b879b639844a1 = /*#__PURE__*/ $ds9gm$react.forwardRef((props, forwardedRef)=>{
const { __scopeToolbar: __scopeToolbar , ...toggleItemProps } = props;
const toggleGroupScope = $ac268fe8f3257fa7$var$useToggleGroupScope(__scopeToolbar);
const scope = {
__scopeToolbar: props.__scopeToolbar
};
return /*#__PURE__*/ $ds9gm$react.createElement($ac268fe8f3257fa7$export$e5c1a33878e86e9e, ($parcel$interopDefault($ds9gm$babelruntimehelpersextends))({
asChild: true
}, scope), /*#__PURE__*/ $ds9gm$react.createElement($ds9gm$radixuireacttogglegroup.Item, ($parcel$interopDefault($ds9gm$babelruntimehelpersextends))({}, toggleGroupScope, toggleItemProps, {
ref: forwardedRef
})));
});
/*#__PURE__*/ Object.assign($ac268fe8f3257fa7$export$546b879b639844a1, {
displayName: $ac268fe8f3257fa7$var$TOGGLE_ITEM_NAME
});
/* ---------------------------------------------------------------------------------------------- */ const $ac268fe8f3257fa7$export$be92b6f5f03c0fe9 = $ac268fe8f3257fa7$export$4c260019440d418f;
const $ac268fe8f3257fa7$export$1ff3c3f08ae963c0 = $ac268fe8f3257fa7$export$291e1a31e8ec7868;
const $ac268fe8f3257fa7$export$353f5b6fc5456de1 = $ac268fe8f3257fa7$export$e5c1a33878e86e9e;
const $ac268fe8f3257fa7$export$a6c7ac8248d6e38a = $ac268fe8f3257fa7$export$ff5714eba66809fd;
const $ac268fe8f3257fa7$export$af3ec21f6cfb5e30 = $ac268fe8f3257fa7$export$aeae28cb17562c0b;
const $ac268fe8f3257fa7$export$920ad4cf87b18fc7 = $ac268fe8f3257fa7$export$546b879b639844a1;
//# sourceMappingURL=index.js.map