v1.0 with SW PWA enabled
This commit is contained in:
56
frontend/node_modules/@radix-ui/react-tabs/dist/index.d.mts
generated
vendored
Normal file
56
frontend/node_modules/@radix-ui/react-tabs/dist/index.d.mts
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
||||
import * as React from 'react';
|
||||
import { Primitive } from '@radix-ui/react-primitive';
|
||||
import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
|
||||
|
||||
declare const createTabsScope: _radix_ui_react_context.CreateScope;
|
||||
type RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
|
||||
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
||||
interface TabsProps extends PrimitiveDivProps {
|
||||
/** The value for the selected tab, if controlled */
|
||||
value?: string;
|
||||
/** The value of the tab to select by default, if uncontrolled */
|
||||
defaultValue?: string;
|
||||
/** A function called when a new tab is selected */
|
||||
onValueChange?: (value: string) => void;
|
||||
/**
|
||||
* The orientation the tabs are layed out.
|
||||
* Mainly so arrow navigation is done accordingly (left & right vs. up & down)
|
||||
* @defaultValue horizontal
|
||||
*/
|
||||
orientation?: RovingFocusGroupProps['orientation'];
|
||||
/**
|
||||
* The direction of navigation between toolbar items.
|
||||
*/
|
||||
dir?: RovingFocusGroupProps['dir'];
|
||||
/**
|
||||
* Whether a tab is activated automatically or manually.
|
||||
* @defaultValue automatic
|
||||
* */
|
||||
activationMode?: 'automatic' | 'manual';
|
||||
}
|
||||
declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
||||
interface TabsListProps extends PrimitiveDivProps {
|
||||
loop?: RovingFocusGroupProps['loop'];
|
||||
}
|
||||
declare const TabsList: React.ForwardRefExoticComponent<TabsListProps & React.RefAttributes<HTMLDivElement>>;
|
||||
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
|
||||
interface TabsTriggerProps extends PrimitiveButtonProps {
|
||||
value: string;
|
||||
}
|
||||
declare const TabsTrigger: React.ForwardRefExoticComponent<TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
interface TabsContentProps extends PrimitiveDivProps {
|
||||
value: string;
|
||||
/**
|
||||
* Used to force mounting when more control is needed. Useful when
|
||||
* controlling animation with React animation libraries.
|
||||
*/
|
||||
forceMount?: true;
|
||||
}
|
||||
declare const TabsContent: React.ForwardRefExoticComponent<TabsContentProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Root: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const List: React.ForwardRefExoticComponent<TabsListProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Trigger: React.ForwardRefExoticComponent<TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const Content: React.ForwardRefExoticComponent<TabsContentProps & React.RefAttributes<HTMLDivElement>>;
|
||||
|
||||
export { Content, List, Root, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Trigger, createTabsScope };
|
||||
56
frontend/node_modules/@radix-ui/react-tabs/dist/index.d.ts
generated
vendored
Normal file
56
frontend/node_modules/@radix-ui/react-tabs/dist/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
||||
import * as React from 'react';
|
||||
import { Primitive } from '@radix-ui/react-primitive';
|
||||
import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
|
||||
|
||||
declare const createTabsScope: _radix_ui_react_context.CreateScope;
|
||||
type RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
|
||||
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
||||
interface TabsProps extends PrimitiveDivProps {
|
||||
/** The value for the selected tab, if controlled */
|
||||
value?: string;
|
||||
/** The value of the tab to select by default, if uncontrolled */
|
||||
defaultValue?: string;
|
||||
/** A function called when a new tab is selected */
|
||||
onValueChange?: (value: string) => void;
|
||||
/**
|
||||
* The orientation the tabs are layed out.
|
||||
* Mainly so arrow navigation is done accordingly (left & right vs. up & down)
|
||||
* @defaultValue horizontal
|
||||
*/
|
||||
orientation?: RovingFocusGroupProps['orientation'];
|
||||
/**
|
||||
* The direction of navigation between toolbar items.
|
||||
*/
|
||||
dir?: RovingFocusGroupProps['dir'];
|
||||
/**
|
||||
* Whether a tab is activated automatically or manually.
|
||||
* @defaultValue automatic
|
||||
* */
|
||||
activationMode?: 'automatic' | 'manual';
|
||||
}
|
||||
declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
||||
interface TabsListProps extends PrimitiveDivProps {
|
||||
loop?: RovingFocusGroupProps['loop'];
|
||||
}
|
||||
declare const TabsList: React.ForwardRefExoticComponent<TabsListProps & React.RefAttributes<HTMLDivElement>>;
|
||||
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
|
||||
interface TabsTriggerProps extends PrimitiveButtonProps {
|
||||
value: string;
|
||||
}
|
||||
declare const TabsTrigger: React.ForwardRefExoticComponent<TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
interface TabsContentProps extends PrimitiveDivProps {
|
||||
value: string;
|
||||
/**
|
||||
* Used to force mounting when more control is needed. Useful when
|
||||
* controlling animation with React animation libraries.
|
||||
*/
|
||||
forceMount?: true;
|
||||
}
|
||||
declare const TabsContent: React.ForwardRefExoticComponent<TabsContentProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Root: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const List: React.ForwardRefExoticComponent<TabsListProps & React.RefAttributes<HTMLDivElement>>;
|
||||
declare const Trigger: React.ForwardRefExoticComponent<TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
declare const Content: React.ForwardRefExoticComponent<TabsContentProps & React.RefAttributes<HTMLDivElement>>;
|
||||
|
||||
export { Content, List, Root, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Trigger, createTabsScope };
|
||||
232
frontend/node_modules/@radix-ui/react-tabs/dist/index.js
generated
vendored
Normal file
232
frontend/node_modules/@radix-ui/react-tabs/dist/index.js
generated
vendored
Normal file
@ -0,0 +1,232 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/index.ts
|
||||
var index_exports = {};
|
||||
__export(index_exports, {
|
||||
Content: () => Content,
|
||||
List: () => List,
|
||||
Root: () => Root2,
|
||||
Tabs: () => Tabs,
|
||||
TabsContent: () => TabsContent,
|
||||
TabsList: () => TabsList,
|
||||
TabsTrigger: () => TabsTrigger,
|
||||
Trigger: () => Trigger,
|
||||
createTabsScope: () => createTabsScope
|
||||
});
|
||||
module.exports = __toCommonJS(index_exports);
|
||||
|
||||
// src/tabs.tsx
|
||||
var React = __toESM(require("react"));
|
||||
var import_primitive = require("@radix-ui/primitive");
|
||||
var import_react_context = require("@radix-ui/react-context");
|
||||
var import_react_roving_focus = require("@radix-ui/react-roving-focus");
|
||||
var import_react_presence = require("@radix-ui/react-presence");
|
||||
var import_react_primitive = require("@radix-ui/react-primitive");
|
||||
var RovingFocusGroup = __toESM(require("@radix-ui/react-roving-focus"));
|
||||
var import_react_direction = require("@radix-ui/react-direction");
|
||||
var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state");
|
||||
var import_react_id = require("@radix-ui/react-id");
|
||||
var import_jsx_runtime = require("react/jsx-runtime");
|
||||
var TABS_NAME = "Tabs";
|
||||
var [createTabsContext, createTabsScope] = (0, import_react_context.createContextScope)(TABS_NAME, [
|
||||
import_react_roving_focus.createRovingFocusGroupScope
|
||||
]);
|
||||
var useRovingFocusGroupScope = (0, import_react_roving_focus.createRovingFocusGroupScope)();
|
||||
var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
|
||||
var Tabs = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const {
|
||||
__scopeTabs,
|
||||
value: valueProp,
|
||||
onValueChange,
|
||||
defaultValue,
|
||||
orientation = "horizontal",
|
||||
dir,
|
||||
activationMode = "automatic",
|
||||
...tabsProps
|
||||
} = props;
|
||||
const direction = (0, import_react_direction.useDirection)(dir);
|
||||
const [value, setValue] = (0, import_react_use_controllable_state.useControllableState)({
|
||||
prop: valueProp,
|
||||
onChange: onValueChange,
|
||||
defaultProp: defaultValue ?? "",
|
||||
caller: TABS_NAME
|
||||
});
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
TabsProvider,
|
||||
{
|
||||
scope: __scopeTabs,
|
||||
baseId: (0, import_react_id.useId)(),
|
||||
value,
|
||||
onValueChange: setValue,
|
||||
orientation,
|
||||
dir: direction,
|
||||
activationMode,
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_react_primitive.Primitive.div,
|
||||
{
|
||||
dir: direction,
|
||||
"data-orientation": orientation,
|
||||
...tabsProps,
|
||||
ref: forwardedRef
|
||||
}
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
Tabs.displayName = TABS_NAME;
|
||||
var TAB_LIST_NAME = "TabsList";
|
||||
var TabsList = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeTabs, loop = true, ...listProps } = props;
|
||||
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
||||
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
RovingFocusGroup.Root,
|
||||
{
|
||||
asChild: true,
|
||||
...rovingFocusGroupScope,
|
||||
orientation: context.orientation,
|
||||
dir: context.dir,
|
||||
loop,
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_react_primitive.Primitive.div,
|
||||
{
|
||||
role: "tablist",
|
||||
"aria-orientation": context.orientation,
|
||||
...listProps,
|
||||
ref: forwardedRef
|
||||
}
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
TabsList.displayName = TAB_LIST_NAME;
|
||||
var TRIGGER_NAME = "TabsTrigger";
|
||||
var TabsTrigger = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
|
||||
const context = useTabsContext(TRIGGER_NAME, __scopeTabs);
|
||||
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
||||
const triggerId = makeTriggerId(context.baseId, value);
|
||||
const contentId = makeContentId(context.baseId, value);
|
||||
const isSelected = value === context.value;
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
RovingFocusGroup.Item,
|
||||
{
|
||||
asChild: true,
|
||||
...rovingFocusGroupScope,
|
||||
focusable: !disabled,
|
||||
active: isSelected,
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_react_primitive.Primitive.button,
|
||||
{
|
||||
type: "button",
|
||||
role: "tab",
|
||||
"aria-selected": isSelected,
|
||||
"aria-controls": contentId,
|
||||
"data-state": isSelected ? "active" : "inactive",
|
||||
"data-disabled": disabled ? "" : void 0,
|
||||
disabled,
|
||||
id: triggerId,
|
||||
...triggerProps,
|
||||
ref: forwardedRef,
|
||||
onMouseDown: (0, import_primitive.composeEventHandlers)(props.onMouseDown, (event) => {
|
||||
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
||||
context.onValueChange(value);
|
||||
} else {
|
||||
event.preventDefault();
|
||||
}
|
||||
}),
|
||||
onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => {
|
||||
if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
|
||||
}),
|
||||
onFocus: (0, import_primitive.composeEventHandlers)(props.onFocus, () => {
|
||||
const isAutomaticActivation = context.activationMode !== "manual";
|
||||
if (!isSelected && !disabled && isAutomaticActivation) {
|
||||
context.onValueChange(value);
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
TabsTrigger.displayName = TRIGGER_NAME;
|
||||
var CONTENT_NAME = "TabsContent";
|
||||
var TabsContent = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeTabs, value, forceMount, children, ...contentProps } = props;
|
||||
const context = useTabsContext(CONTENT_NAME, __scopeTabs);
|
||||
const triggerId = makeTriggerId(context.baseId, value);
|
||||
const contentId = makeContentId(context.baseId, value);
|
||||
const isSelected = value === context.value;
|
||||
const isMountAnimationPreventedRef = React.useRef(isSelected);
|
||||
React.useEffect(() => {
|
||||
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
||||
return () => cancelAnimationFrame(rAF);
|
||||
}, []);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_react_primitive.Primitive.div,
|
||||
{
|
||||
"data-state": isSelected ? "active" : "inactive",
|
||||
"data-orientation": context.orientation,
|
||||
role: "tabpanel",
|
||||
"aria-labelledby": triggerId,
|
||||
hidden: !present,
|
||||
id: contentId,
|
||||
tabIndex: 0,
|
||||
...contentProps,
|
||||
ref: forwardedRef,
|
||||
style: {
|
||||
...props.style,
|
||||
animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
|
||||
},
|
||||
children: present && children
|
||||
}
|
||||
) });
|
||||
}
|
||||
);
|
||||
TabsContent.displayName = CONTENT_NAME;
|
||||
function makeTriggerId(baseId, value) {
|
||||
return `${baseId}-trigger-${value}`;
|
||||
}
|
||||
function makeContentId(baseId, value) {
|
||||
return `${baseId}-content-${value}`;
|
||||
}
|
||||
var Root2 = Tabs;
|
||||
var List = TabsList;
|
||||
var Trigger = TabsTrigger;
|
||||
var Content = TabsContent;
|
||||
//# sourceMappingURL=index.js.map
|
||||
7
frontend/node_modules/@radix-ui/react-tabs/dist/index.js.map
generated
vendored
Normal file
7
frontend/node_modules/@radix-ui/react-tabs/dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
200
frontend/node_modules/@radix-ui/react-tabs/dist/index.mjs
generated
vendored
Normal file
200
frontend/node_modules/@radix-ui/react-tabs/dist/index.mjs
generated
vendored
Normal file
@ -0,0 +1,200 @@
|
||||
"use client";
|
||||
|
||||
// src/tabs.tsx
|
||||
import * as React from "react";
|
||||
import { composeEventHandlers } from "@radix-ui/primitive";
|
||||
import { createContextScope } from "@radix-ui/react-context";
|
||||
import { createRovingFocusGroupScope } from "@radix-ui/react-roving-focus";
|
||||
import { Presence } from "@radix-ui/react-presence";
|
||||
import { Primitive } from "@radix-ui/react-primitive";
|
||||
import * as RovingFocusGroup from "@radix-ui/react-roving-focus";
|
||||
import { useDirection } from "@radix-ui/react-direction";
|
||||
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
||||
import { useId } from "@radix-ui/react-id";
|
||||
import { jsx } from "react/jsx-runtime";
|
||||
var TABS_NAME = "Tabs";
|
||||
var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [
|
||||
createRovingFocusGroupScope
|
||||
]);
|
||||
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
||||
var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
|
||||
var Tabs = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const {
|
||||
__scopeTabs,
|
||||
value: valueProp,
|
||||
onValueChange,
|
||||
defaultValue,
|
||||
orientation = "horizontal",
|
||||
dir,
|
||||
activationMode = "automatic",
|
||||
...tabsProps
|
||||
} = props;
|
||||
const direction = useDirection(dir);
|
||||
const [value, setValue] = useControllableState({
|
||||
prop: valueProp,
|
||||
onChange: onValueChange,
|
||||
defaultProp: defaultValue ?? "",
|
||||
caller: TABS_NAME
|
||||
});
|
||||
return /* @__PURE__ */ jsx(
|
||||
TabsProvider,
|
||||
{
|
||||
scope: __scopeTabs,
|
||||
baseId: useId(),
|
||||
value,
|
||||
onValueChange: setValue,
|
||||
orientation,
|
||||
dir: direction,
|
||||
activationMode,
|
||||
children: /* @__PURE__ */ jsx(
|
||||
Primitive.div,
|
||||
{
|
||||
dir: direction,
|
||||
"data-orientation": orientation,
|
||||
...tabsProps,
|
||||
ref: forwardedRef
|
||||
}
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
Tabs.displayName = TABS_NAME;
|
||||
var TAB_LIST_NAME = "TabsList";
|
||||
var TabsList = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeTabs, loop = true, ...listProps } = props;
|
||||
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
||||
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
||||
return /* @__PURE__ */ jsx(
|
||||
RovingFocusGroup.Root,
|
||||
{
|
||||
asChild: true,
|
||||
...rovingFocusGroupScope,
|
||||
orientation: context.orientation,
|
||||
dir: context.dir,
|
||||
loop,
|
||||
children: /* @__PURE__ */ jsx(
|
||||
Primitive.div,
|
||||
{
|
||||
role: "tablist",
|
||||
"aria-orientation": context.orientation,
|
||||
...listProps,
|
||||
ref: forwardedRef
|
||||
}
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
TabsList.displayName = TAB_LIST_NAME;
|
||||
var TRIGGER_NAME = "TabsTrigger";
|
||||
var TabsTrigger = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
|
||||
const context = useTabsContext(TRIGGER_NAME, __scopeTabs);
|
||||
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
||||
const triggerId = makeTriggerId(context.baseId, value);
|
||||
const contentId = makeContentId(context.baseId, value);
|
||||
const isSelected = value === context.value;
|
||||
return /* @__PURE__ */ jsx(
|
||||
RovingFocusGroup.Item,
|
||||
{
|
||||
asChild: true,
|
||||
...rovingFocusGroupScope,
|
||||
focusable: !disabled,
|
||||
active: isSelected,
|
||||
children: /* @__PURE__ */ jsx(
|
||||
Primitive.button,
|
||||
{
|
||||
type: "button",
|
||||
role: "tab",
|
||||
"aria-selected": isSelected,
|
||||
"aria-controls": contentId,
|
||||
"data-state": isSelected ? "active" : "inactive",
|
||||
"data-disabled": disabled ? "" : void 0,
|
||||
disabled,
|
||||
id: triggerId,
|
||||
...triggerProps,
|
||||
ref: forwardedRef,
|
||||
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
||||
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
||||
context.onValueChange(value);
|
||||
} else {
|
||||
event.preventDefault();
|
||||
}
|
||||
}),
|
||||
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
||||
if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
|
||||
}),
|
||||
onFocus: composeEventHandlers(props.onFocus, () => {
|
||||
const isAutomaticActivation = context.activationMode !== "manual";
|
||||
if (!isSelected && !disabled && isAutomaticActivation) {
|
||||
context.onValueChange(value);
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
TabsTrigger.displayName = TRIGGER_NAME;
|
||||
var CONTENT_NAME = "TabsContent";
|
||||
var TabsContent = React.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeTabs, value, forceMount, children, ...contentProps } = props;
|
||||
const context = useTabsContext(CONTENT_NAME, __scopeTabs);
|
||||
const triggerId = makeTriggerId(context.baseId, value);
|
||||
const contentId = makeContentId(context.baseId, value);
|
||||
const isSelected = value === context.value;
|
||||
const isMountAnimationPreventedRef = React.useRef(isSelected);
|
||||
React.useEffect(() => {
|
||||
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
||||
return () => cancelAnimationFrame(rAF);
|
||||
}, []);
|
||||
return /* @__PURE__ */ jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsx(
|
||||
Primitive.div,
|
||||
{
|
||||
"data-state": isSelected ? "active" : "inactive",
|
||||
"data-orientation": context.orientation,
|
||||
role: "tabpanel",
|
||||
"aria-labelledby": triggerId,
|
||||
hidden: !present,
|
||||
id: contentId,
|
||||
tabIndex: 0,
|
||||
...contentProps,
|
||||
ref: forwardedRef,
|
||||
style: {
|
||||
...props.style,
|
||||
animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
|
||||
},
|
||||
children: present && children
|
||||
}
|
||||
) });
|
||||
}
|
||||
);
|
||||
TabsContent.displayName = CONTENT_NAME;
|
||||
function makeTriggerId(baseId, value) {
|
||||
return `${baseId}-trigger-${value}`;
|
||||
}
|
||||
function makeContentId(baseId, value) {
|
||||
return `${baseId}-content-${value}`;
|
||||
}
|
||||
var Root2 = Tabs;
|
||||
var List = TabsList;
|
||||
var Trigger = TabsTrigger;
|
||||
var Content = TabsContent;
|
||||
export {
|
||||
Content,
|
||||
List,
|
||||
Root2 as Root,
|
||||
Tabs,
|
||||
TabsContent,
|
||||
TabsList,
|
||||
TabsTrigger,
|
||||
Trigger,
|
||||
createTabsScope
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
7
frontend/node_modules/@radix-ui/react-tabs/dist/index.mjs.map
generated
vendored
Normal file
7
frontend/node_modules/@radix-ui/react-tabs/dist/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user