@cerberus-design/react
Version:
The Cerberus Design React component library.
1,445 lines (1,396 loc) • 151 kB
JavaScript
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
// src/index.ts
var index_exports = {};
__export(index_exports, {
Accordion: () => Accordion2,
AccordionItem: () => AccordionItem,
AccordionItemContent: () => AccordionItemContent,
AccordionItemGroup: () => AccordionItemGroup,
AccordionItemIndicator: () => AccordionItemIndicator,
AccordionItemTrigger: () => AccordionItemTrigger,
AccordionParts: () => AccordionParts,
AccordionRoot: () => AccordionRoot,
Admonition: () => Admonition,
AdmonitionContent: () => AdmonitionContent,
AdmonitionDescription: () => AdmonitionDescription,
AdmonitionHeading: () => AdmonitionHeading,
AdmonitionIndicator: () => AdmonitionIndicator,
AdmonitionParts: () => AdmonitionParts,
AdmonitionRoot: () => AdmonitionRoot,
Avatar: () => Avatar2,
AvatarFallback: () => AvatarFallback,
AvatarImage: () => AvatarImage,
AvatarParts: () => AvatarParts,
AvatarRoot: () => AvatarRoot,
Button: () => Button,
ButtonIcon: () => ButtonIcon,
ButtonParts: () => ButtonParts,
CTAModal: () => CTAModal,
CalendarDate: () => import_date.CalendarDate,
Caption: () => Caption,
Carousel: () => Carousel2,
CarouselControl: () => CarouselControl,
CarouselIndicator: () => CarouselIndicator,
CarouselIndicatorGroup: () => CarouselIndicatorGroup,
CarouselItem: () => CarouselItem,
CarouselItemGroup: () => CarouselItemGroup,
CarouselNextTrigger: () => CarouselNextTrigger,
CarouselParts: () => CarouselParts,
CarouselPrevTrigger: () => CarouselPrevTrigger,
CarouselRoot: () => CarouselRoot,
CerberusProvider: () => CerberusProvider,
Checkbox: () => Checkbox2,
CheckboxControl: () => CheckboxControl,
CheckboxGroup: () => CheckboxGroup,
CheckboxHiddenInput: () => CheckboxHiddenInput,
CheckboxIndicator: () => CheckboxIndicator,
CheckboxLabel: () => CheckboxLabel,
CheckboxParts: () => CheckboxParts,
CheckboxRoot: () => CheckboxRoot,
CircularProgress: () => CircularProgress,
CircularProgressCircle: () => CircularProgressCircle,
CircularProgressCircleRange: () => CircularProgressCircleRange,
CircularProgressCircleTrack: () => CircularProgressCircleTrack,
CircularProgressInfoGroup: () => CircularProgressInfoGroup,
CircularProgressLabel: () => CircularProgressLabel,
CircularProgressRoot: () => CircularProgressRoot,
CircularProgressValueText: () => CircularProgressValueText,
ComboItemGroup: () => ComboItemGroup,
ComboItemText: () => ComboItemText,
ComboItemWithIndicator: () => ComboItemWithIndicator,
Combobox: () => Combobox2,
ComboboxClearTrigger: () => ComboboxClearTrigger,
ComboboxContent: () => ComboboxContent,
ComboboxControl: () => ComboboxControl,
ComboboxInput: () => ComboboxInput,
ComboboxItem: () => ComboboxItem,
ComboboxItemGroup: () => ComboboxItemGroup,
ComboboxItemGroupLabel: () => ComboboxItemGroupLabel,
ComboboxItemIndicator: () => ComboboxItemIndicator,
ComboboxItemText: () => ComboboxItemText,
ComboboxLabel: () => ComboboxLabel,
ComboboxParts: () => ComboboxParts,
ComboboxPositioner: () => ComboboxPositioner,
ComboboxRoot: () => ComboboxRoot,
ComboboxStartIcon: () => ComboboxStartIcon,
ComboboxTrigger: () => ComboboxTrigger,
ConfirmModal: () => ConfirmModal,
DateFormats: () => DateFormats,
DateFormatter: () => import_date.DateFormatter,
DatePicker: () => DatePicker2,
DatePickerCalendar: () => DatePickerCalendar,
DatePickerClearTrigger: () => DatePickerClearTrigger,
DatePickerContent: () => DatePickerContent,
DatePickerContext: () => DatePickerContext,
DatePickerControl: () => DatePickerControl,
DatePickerInput: () => DatePickerInput,
DatePickerInputEl: () => DatePickerInputEl,
DatePickerLabel: () => DatePickerLabel,
DatePickerMonthSelect: () => DatePickerMonthSelect,
DatePickerNextTrigger: () => DatePickerNextTrigger,
DatePickerParts: () => DatePickerParts,
DatePickerPositioner: () => DatePickerPositioner,
DatePickerPrevTrigger: () => DatePickerPrevTrigger,
DatePickerRangeText: () => DatePickerRangeText,
DatePickerRoot: () => DatePickerRoot,
DatePickerTable: () => DatePickerTable,
DatePickerTableBody: () => DatePickerTableBody,
DatePickerTableCell: () => DatePickerTableCell,
DatePickerTableCellTrigger: () => DatePickerTableCellTrigger,
DatePickerTableHead: () => DatePickerTableHead,
DatePickerTableHeader: () => DatePickerTableHeader,
DatePickerTableRow: () => DatePickerTableRow,
DatePickerTrigger: () => DatePickerTrigger,
DatePickerView: () => DatePickerView,
DatePickerViewControl: () => DatePickerViewControl,
DatePickerViewTrigger: () => DatePickerViewTrigger,
DatePickerYearSelect: () => DatePickerYearSelect,
Dialog: () => Dialog2,
DialogBackdrop: () => DialogBackdrop,
DialogCloseIconTrigger: () => DialogCloseIconTrigger,
DialogCloseTrigger: () => DialogCloseTrigger,
DialogContent: () => DialogContent,
DialogDescription: () => DialogDescription,
DialogHeading: () => DialogHeading,
DialogParts: () => DialogParts,
DialogPositioner: () => DialogPositioner,
DialogProvider: () => DialogProvider,
DialogRoot: () => DialogRoot,
DialogTrigger: () => DialogTrigger,
Droppable: () => Droppable,
FeatureFlag: () => FeatureFlag,
FeatureFlags: () => FeatureFlags,
Field: () => Field3,
FieldErrorText: () => FieldErrorText,
FieldHelperText: () => FieldHelperText,
FieldInput: () => FieldInput,
FieldInputRoot: () => FieldInputRoot,
FieldLabel: () => FieldLabel,
FieldMessage: () => FieldMessage,
FieldParts: () => FieldParts,
FieldRequiredIndicator: () => FieldRequiredIndicator,
FieldRoot: () => FieldRoot,
FieldStartIndicator: () => FieldStartIndicator,
FieldStatusIndicator: () => FieldStatusIndicator,
FieldTextarea: () => FieldTextarea,
Fieldset: () => Fieldset2,
FieldsetErrorText: () => FieldsetErrorText,
FieldsetHelperText: () => FieldsetHelperText,
FieldsetLabel: () => FieldsetLabel,
FieldsetLegend: () => FieldsetLegend,
FieldsetParts: () => FieldsetParts,
FieldsetRoot: () => FieldsetRoot,
FileStatus: () => FileStatus,
FileUploader: () => FileUploader,
For: () => For,
IconButton: () => IconButton,
IconButtonRoot: () => IconButtonRoot,
Input: () => Input,
Label: () => Label,
Legend: () => Legend,
MODE_KEY: () => MODE_KEY,
Menu: () => Menu,
MenuContent: () => MenuContent,
MenuContentEl: () => MenuContentEl,
MenuGroupLabel: () => MenuGroupLabel,
MenuIndicator: () => MenuIndicator,
MenuItem: () => MenuItem,
MenuItemEl: () => MenuItemEl,
MenuItemGroup: () => MenuItemGroup,
MenuItemGroupEl: () => MenuItemGroupEl,
MenuItemGroupLabelEl: () => MenuItemGroupLabelEl,
MenuPositioner: () => MenuPositioner,
MenuRoot: () => MenuRoot,
MenuSeparator: () => MenuSeparator,
MenuSeparatorEl: () => MenuSeparatorEl,
MenuTrigger: () => MenuTrigger,
MenuTriggerEl: () => MenuTriggerEl,
MenuTriggerItem: () => MenuTriggerItem,
NavMenu: () => NavMenu,
NavMenuLink: () => NavMenuLink,
NavMenuList: () => NavMenuList,
NavMenuTrigger: () => NavMenuTrigger,
NotificationActionTrigger: () => NotificationActionTrigger,
NotificationCenter: () => NotificationCenter,
NotificationCloseTrigger: () => NotificationCloseTrigger,
NotificationDescription: () => NotificationDescription,
NotificationHeading: () => NotificationHeading,
NotificationParts: () => NotificationParts,
NotificationProvider: () => NotificationProvider,
NotificationRoot: () => NotificationRoot,
Option: () => Option,
OptionGroup: () => OptionGroup,
OptionGroupLabel: () => OptionGroupLabel,
Portal: () => Portal,
ProgressBar: () => ProgressBar,
ProgressBarBar: () => ProgressBarBar,
ProgressBarRoot: () => ProgressBarRoot,
PromptModal: () => PromptModal,
Radio: () => Radio,
RadioGroup: () => RadioGroup,
RadioGroupIndicator: () => RadioGroupIndicator,
RadioGroupItem: () => RadioGroupItem,
RadioGroupItemControl: () => RadioGroupItemControl,
RadioGroupItemHiddenInput: () => RadioGroupItemHiddenInput,
RadioGroupItemText: () => RadioGroupItemText,
RadioGroupLabel: () => RadioGroupLabel,
RadioGroupRoot: () => RadioGroupRoot,
RadioParts: () => RadioParts,
RangePickerInput: () => RangePickerInput,
Rating: () => Rating,
RatingContext: () => RatingContext,
RatingControl: () => RatingControl,
RatingHiddenInput: () => RatingHiddenInput,
RatingItem: () => RatingItem,
RatingItemContext: () => RatingItemContext,
RatingLabel: () => RatingLabel,
RatingParts: () => RatingParts,
RatingRoot: () => RatingRoot,
Select: () => Select2,
SelectClearTrigger: () => SelectClearTrigger,
SelectContent: () => SelectContent,
SelectControl: () => SelectControl,
SelectHiddenSelect: () => SelectHiddenSelect,
SelectIndicator: () => SelectIndicator,
SelectItem: () => SelectItem,
SelectItemGroup: () => SelectItemGroup,
SelectItemGroupLabel: () => SelectItemGroupLabel,
SelectItemIndicator: () => SelectItemIndicator,
SelectItemText: () => SelectItemText,
SelectLabel: () => SelectLabel,
SelectParts: () => SelectParts,
SelectPositioner: () => SelectPositioner,
SelectRoot: () => SelectRoot,
SelectTrigger: () => SelectTrigger,
SelectValueText: () => SelectValueText,
Show: () => Show,
Spinner: () => Spinner,
Switch: () => Switch2,
SwitchControl: () => SwitchControl,
SwitchHiddenInput: () => SwitchHiddenInput,
SwitchLabel: () => SwitchLabel,
SwitchParts: () => SwitchParts,
SwitchRoot: () => SwitchRoot,
SwitchThumb: () => SwitchThumb,
THEME_KEY: () => THEME_KEY,
Table: () => Table,
TableEl: () => TableEl,
TableParts: () => TableParts,
TableRoot: () => TableRoot,
TableTrigger: () => TableTrigger,
Tabs: () => Tabs2,
TabsContent: () => TabsContent,
TabsIndicator: () => TabsIndicator,
TabsList: () => TabsList,
TabsParts: () => TabsParts,
TabsRoot: () => TabsRoot,
TabsTrigger: () => TabsTrigger,
Tag: () => Tag,
Tbody: () => Tbody,
Td: () => Td,
Text: () => Text,
Textarea: () => Textarea,
Tfoot: () => Tfoot,
Th: () => Th,
Thead: () => Thead,
Theme: () => Theme,
ThemeProvider: () => ThemeProvider,
ToggleIndicator: () => ToggleIndicator,
ToggleParts: () => ToggleParts,
ToggleRoot: () => ToggleRoot,
Tooltip: () => Tooltip2,
TooltipArrow: () => TooltipArrow,
TooltipArrowTip: () => TooltipArrowTip,
TooltipContent: () => TooltipContent,
TooltipParts: () => TooltipParts,
TooltipPositioner: () => TooltipPositioner,
TooltipRoot: () => TooltipRoot,
TooltipTrigger: () => TooltipTrigger,
Tr: () => Tr,
cerberus: () => cerberus,
createCTAModalActions: () => createCTAModalActions,
createCerberusPrimitive: () => createCerberusPrimitive,
createSelectCollection: () => createSelectCollection,
defineIcons: () => defineIcons,
formatISOToMilitary: () => formatISOToMilitary,
formatMilitaryDate: () => formatMilitaryDate,
formatMilitaryToISO: () => formatMilitaryToISO,
formatNotifyCount: () => formatNotifyCount,
getLocalStorage: () => getLocalStorage,
getLocalTimeZone: () => import_date.getLocalTimeZone,
getPosition: () => getPosition,
makeSystemConfig: () => makeSystemConfig,
parseDate: () => import_date_picker2.parseDate,
processStatus: () => processStatus,
setLocalStorage: () => setLocalStorage,
splitProps: () => splitProps,
toaster: () => toaster,
today: () => import_date.today,
useAvatarContext: () => import_avatar3.useAvatarContext,
useCTAModal: () => useCTAModal,
useCerberusContext: () => useCerberusContext,
useConfirmModal: () => useConfirmModal,
useDate: () => useDate,
useFeatureFlags: () => useFeatureFlags,
useNavMenuContext: () => useNavMenuContext,
useNotificationCenter: () => useNotificationCenter,
usePromptModal: () => usePromptModal,
useRootColors: () => useRootColors,
useStatefulCollection: () => useStatefulCollection,
useTheme: () => useTheme,
useThemeContext: () => useThemeContext,
useToggle: () => useToggle
});
module.exports = __toCommonJS(index_exports);
// src/components/deprecated/FieldMessage.tsx
var import_css = require("styled-system/css");
var import_recipes = require("styled-system/recipes");
var import_field = require("@ark-ui/react/field");
var import_jsx_runtime = require("react/jsx-runtime");
function FieldMessage(props) {
const { invalid } = (0, import_field.useFieldContext)();
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"small",
{
...props,
...invalid && { "aria-invalid": true },
className: (0, import_css.cx)(props.className, (0, import_recipes.fieldMessage)())
}
);
}
// src/components/deprecated/FieldsetLabel.tsx
var import_css2 = require("styled-system/css");
var import_recipes2 = require("styled-system/recipes");
var import_jsx_runtime2 = require("react/jsx-runtime");
function FieldsetLabel(props) {
const { size, usage, ...nativeProps } = props;
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
"label",
{
...nativeProps,
className: (0, import_css2.cx)(
nativeProps.className,
(0, import_recipes2.label)({
size,
usage
})
)
}
);
}
// src/components/deprecated/Label.tsx
var import_recipes6 = require("styled-system/recipes");
var import_css6 = require("styled-system/css");
// src/components/field/field.tsx
var import_jsx = require("styled-system/jsx");
// src/utils/localStorage.ts
function getLocalStorage(key, defaultValue) {
const value = window.localStorage.getItem(key);
if (value) {
return value;
}
return defaultValue;
}
function setLocalStorage(key, value) {
const stringValue = typeof value === "string" ? value : JSON.stringify(value);
window.localStorage.setItem(key, stringValue);
}
// src/utils/index.ts
function formatNotifyCount(count) {
if (count > 99) return "99+";
return count.toString();
}
function splitProps(props, ...keyGroups) {
const result = keyGroups.map(() => ({}));
const rest = {};
for (const key in props) {
let assigned = false;
for (let i = 0; i < keyGroups.length; i++) {
if (keyGroups[i].includes(key)) {
result[i][key] = props[key];
assigned = true;
break;
}
}
if (!assigned) {
rest[key] = props[key];
}
}
return [...result, rest];
}
// src/components/show/show.tsx
var import_jsx_runtime3 = require("react/jsx-runtime");
function Show(props) {
const { when, children, fallback } = props;
if (when) {
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children });
}
if (fallback) {
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: fallback });
}
return null;
}
// src/components/field/primitives.tsx
var import_field3 = require("@ark-ui/react/field");
var import_react3 = require("@ark-ui/react");
var import_recipes5 = require("styled-system/recipes");
// src/system/primitive-factory.tsx
var import_css3 = require("styled-system/css");
var import_jsx_runtime4 = require("react/jsx-runtime");
var CerberusPrimitive = class {
constructor(recipe) {
__publicField(this, "recipe");
/**
* Creates a Cerberus component with bare features and no recipe.
* @param Component - The React component to enhance with Cerberus features.
* Can be a string or a component reference.
* @returns A new React component that applies Cerberus features to the
* original component.
*
* @example
* ```ts
* const { withNoRecipe } = createCerberusPrimitive(buttonRecipe)
* const Button = withNoRecipe('button')
* ```
*/
__publicField(this, "withNoRecipe", (Component, options) => {
const { defaultProps } = options || {};
const El = Component;
const CerbComponent = (props) => {
const { css: customCss, className, ...nativeProps } = props;
const styles = this.hasStyles((0, import_css3.cx)(className, (0, import_css3.css)(customCss)));
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(El, { ...defaultProps, ...styles, ...nativeProps });
};
if (this.validateComponent(El)) {
const ElName = typeof El === "string" ? El : El.displayName || El.name;
CerbComponent.displayName = ElName;
}
return CerbComponent;
});
/**
* Creates a Cerberus component with the given recipe.
* @param Component - The React component to enhance with the recipe.
* @param options - Options for the recipe.
* @returns A new React component that applies the recipe to the original
* component.
*/
__publicField(this, "withRecipe", (Component, options) => {
const { defaultProps } = options || {};
const El = Component;
const recipe = this.recipe;
const CerbComponent = (internalProps) => {
const {
css: customCss,
className,
...restOfInternalProps
} = internalProps;
const [variantOptions, nativeProps] = recipe.splitVariantProps(restOfInternalProps);
const recipeStyles = recipe(variantOptions);
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
Component,
{
...defaultProps,
...nativeProps,
className: (0, import_css3.cx)(className, recipeStyles, (0, import_css3.css)(customCss))
}
);
};
if (this.validateComponent(El)) {
const ElName = typeof El === "string" ? El : El.displayName || El.name;
CerbComponent.displayName = ElName;
}
return CerbComponent;
});
/**
* Creates a Cerberus component with a slot recipe applied.
* @param Component - The React component to enhance with Cerberus features.
* @param recipe - The slot recipe to apply to the component.
* @returns A new React component that applies Cerberus features and the
* specified slot recipe to the original component.
* @example
* ```typescript
* const { withSlotRecipe } = createCerberusPrimitive(field)
* const Field = withSlotRecipe(RawField, field)
* ```
*/
__publicField(this, "withSlotRecipe", (Component, slot, options) => {
const { defaultProps } = options || {};
const El = Component;
const recipe = this.recipe;
const CerbComponent = (internalProps) => {
const {
css: customCss,
className,
...restOfInternalProps
} = internalProps;
const [variantOptions, nativeProps] = recipe.splitVariantProps(restOfInternalProps);
const styles = recipe(variantOptions);
const slotStyles = styles[slot];
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
Component,
{
...defaultProps,
...nativeProps,
className: (0, import_css3.cx)(className, slotStyles, (0, import_css3.css)(customCss))
}
);
};
if (this.validateComponent(El)) {
const ElName = typeof El === "string" ? El : El.displayName || El.name;
CerbComponent.displayName = ElName;
}
return CerbComponent;
});
this.recipe = recipe ?? null;
}
hasStyles(styles) {
if (styles) {
return {
className: styles
};
}
return {};
}
validateComponent(Component) {
if (typeof Component !== "function" && typeof Component !== "object") {
return false;
}
return true;
}
};
// src/system/factory.ts
var import_factory = require("@ark-ui/react/factory");
function cerberusFactory(component, defaultProps) {
const { withNoRecipe: withNoRecipe10 } = new CerberusPrimitive();
const arkComponent = import_factory.ark[component];
if (arkComponent) {
return withNoRecipe10(arkComponent, { defaultProps: defaultProps ?? {} });
}
throw new Error(
`Component "${String(component)}" is not a valid Cerberus component. Please check the component name.`
);
}
var cache = /* @__PURE__ */ new Map();
var cerberusFactoryProxy = new Proxy(cerberusFactory, {
apply(target, thisArg, argArray) {
return target.apply(thisArg, argArray);
},
get(_target, el) {
if (!cache.has(el)) {
cache.set(el, cerberusFactory(el));
}
return cache.get(el);
}
});
// src/system/index.ts
function createCerberusPrimitive(recipe) {
return new CerberusPrimitive(recipe);
}
var cerberus = cerberusFactoryProxy;
// src/components/field/start-indicator.tsx
var import_css4 = require("styled-system/css");
var import_recipes3 = require("styled-system/recipes");
var import_jsx_runtime5 = require("react/jsx-runtime");
function FieldStartIndicator(props) {
const styles = (0, import_recipes3.field)();
if (!props.children) return null;
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
"span",
{
...props,
"data-part": "start-indicator",
className: (0, import_css4.cx)(props.className, styles.startIndicator)
}
);
}
// src/components/field/status-indicator.tsx
var import_react2 = require("@ark-ui/react");
var import_css5 = require("styled-system/css");
var import_recipes4 = require("styled-system/recipes");
// src/context/cerberus.tsx
var import_react = require("react");
var import_jsx_runtime6 = require("react/jsx-runtime");
var CerberusContext = (0, import_react.createContext)(null);
function CerberusProvider(props) {
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CerberusContext.Provider, { value: props.config, children: props.children });
}
function useCerberusContext() {
const context = (0, import_react.useContext)(CerberusContext);
if (!context) {
throw new Error("useCerberus must be used within a CerberusProvider");
}
return context;
}
// src/components/field/status-indicator.tsx
var import_jsx_runtime7 = require("react/jsx-runtime");
function FieldStatusIndicator(props) {
const { fallback, ...nativeProps } = props;
const fieldContext = (0, import_react2.useFieldContext)();
const styles = (0, import_recipes4.field)();
const { icons } = useCerberusContext();
const { invalid: InvalidIcon } = icons;
if (!fieldContext) return null;
if (fieldContext.invalid) {
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
"span",
{
...nativeProps,
"aria-hidden": "true",
"data-invalid": true,
className: (0, import_css5.cx)(nativeProps.className, styles.statusIndicator),
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(InvalidIcon, {})
}
);
}
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
"span",
{
...nativeProps,
"aria-hidden": "true",
"data-part": "end-indicator",
className: (0, import_css5.cx)(nativeProps.className, styles.endIndicator),
children: fallback
}
);
}
// src/components/field/input.tsx
var import_jsx_runtime8 = require("react/jsx-runtime");
function CerberusFieldInput(props) {
const [{ startIcon, endIcon }, fieldProps] = splitProps(props, [
"startIcon",
"endIcon"
]);
const hasStartIcon = Boolean(startIcon);
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(FieldInputRoot, { children: [
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FieldStartIndicator, { children: startIcon }),
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
FieldInput,
{
...fieldProps,
...hasStartIcon && { "data-has": "start-indicator" }
}
),
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FieldStatusIndicator, { fallback: endIcon })
] });
}
// src/components/field/error-text.tsx
var import_field2 = require("@ark-ui/react/field");
var import_jsx_runtime9 = require("react/jsx-runtime");
function CerberusFieldErrorText(props) {
if (!props.children) return null;
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_field2.Field.ErrorText, { ...props });
}
// src/components/field/primitives.tsx
var import_jsx_runtime10 = require("react/jsx-runtime");
var { withSlotRecipe, withNoRecipe } = createCerberusPrimitive(import_recipes5.field);
var FieldRoot = withSlotRecipe(import_field3.Field.Root, "root");
function FieldLabelEl(props) {
const { children, ...nativeProps } = props;
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_field3.Field.Label, { ...nativeProps, children: [
children,
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_field3.Field.RequiredIndicator, { children: "(required)" })
] });
}
var FieldLabel = withSlotRecipe(FieldLabelEl, "label");
function FieldRequiredIndicatorEl(props) {
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_field3.Field.RequiredIndicator, { ...props, children: "(required)" });
}
var FieldRequiredIndicator = withNoRecipe(
FieldRequiredIndicatorEl
);
var FieldInputRoot = withSlotRecipe(
import_react3.ark.div,
"inputRoot"
);
var FieldInput = withSlotRecipe(import_field3.Field.Input, "input");
var FieldHelperText = withSlotRecipe(
import_field3.Field.HelperText,
"helperText"
);
var FieldErrorText = withSlotRecipe(
CerberusFieldErrorText,
"errorText"
);
var FieldTextarea = withSlotRecipe(
import_field3.Field.Textarea,
"textarea"
);
var Input = CerberusFieldInput;
var Textarea = FieldTextarea;
// src/components/field/helper-text.tsx
var import_jsx_runtime11 = require("react/jsx-runtime");
function HelperText(props) {
if (props.invalid) return null;
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FieldHelperText, { "data-has-content": Boolean(props.children), children: props.children });
}
// src/components/field/field.tsx
var import_jsx_runtime12 = require("react/jsx-runtime");
function Field3(props) {
const [statusProps, fieldProps, rootProps] = splitProps(
props,
["disabled", "required", "readOnly", "invalid"],
["label", "helperText", "secondaryHelperText", "errorText", "children"]
);
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(FieldRoot, { ...statusProps, ...rootProps, children: [
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Show, { when: fieldProps.label, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FieldLabel, { children: fieldProps.label }) }),
fieldProps.children,
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx.HStack, { justifyContent: "space-between", w: "full", children: [
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(HelperText, { invalid: statusProps.invalid, children: fieldProps.helperText }),
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FieldErrorText, { children: fieldProps.errorText }),
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Show, { when: fieldProps.secondaryHelperText, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FieldHelperText, { children: fieldProps.secondaryHelperText }) })
] })
] });
}
// src/components/field/parts.ts
var FieldParts = {
Root: FieldRoot,
Label: FieldLabel,
Input: FieldInput,
Textarea: FieldTextarea,
HelperText: FieldHelperText,
ErrorText: FieldErrorText,
StartIndicator: FieldStartIndicator,
StatusIndicator: FieldStatusIndicator,
RequiredIndicator: FieldRequiredIndicator
};
// src/components/deprecated/Label.tsx
var import_jsx_runtime13 = require("react/jsx-runtime");
function Label(props) {
const { size, ...nativeProps } = props;
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
FieldLabel,
{
...nativeProps,
className: (0, import_css6.cx)((0, import_recipes6.label)({ size }), props.className)
}
);
}
// src/components/deprecated/NavMenuTrigger.tsx
var import_react5 = require("react");
var import_css8 = require("styled-system/css");
var import_recipes7 = require("styled-system/recipes");
// src/context/navMenu.tsx
var import_css7 = require("styled-system/css");
var import_react4 = require("react");
var import_jsx_runtime14 = require("react/jsx-runtime");
var NavMenuContext = (0, import_react4.createContext)(null);
function NavMenu(props) {
const triggerRef = (0, import_react4.useRef)(null);
const menuRef = (0, import_react4.useRef)(null);
const [expanded, setExpanded] = (0, import_react4.useState)(false);
const handleToggle = (0, import_react4.useCallback)(() => {
setExpanded((prev) => !prev);
}, []);
const value = (0, import_react4.useMemo)(
() => ({
triggerRef,
menuRef,
expanded,
onToggle: handleToggle
}),
[expanded, handleToggle]
);
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(NavMenuContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
"nav",
{
className: (0, import_css7.css)({
position: "relative"
}),
children: props.children
}
) });
}
function useNavMenuContext() {
const context = (0, import_react4.useContext)(NavMenuContext);
if (!context) {
throw new Error("useNavMenuContext must be used within a NavMenu.");
}
return context;
}
// src/components/deprecated/aria-helpers/nav-menu.aria.ts
function createNavTriggerProps(values) {
return {
["aria-controls"]: values.controls,
["aria-expanded"]: values.expanded ?? false
};
}
// src/components/deprecated/NavMenuTrigger.tsx
var import_jsx_runtime15 = require("react/jsx-runtime");
function NavMenuTrigger(props) {
const {
as,
palette,
usage,
shape,
controls,
expanded: propsExpanded,
onClick,
...nativeProps
} = props;
const { triggerRef, onToggle, expanded } = useNavMenuContext();
const ariaProps = createNavTriggerProps({
controls,
expanded: propsExpanded ?? expanded
});
const hasAs = Boolean(as);
const AsSub = as;
const handleClick = (0, import_react5.useCallback)(
(e) => {
if (onClick) return onClick(e);
onToggle();
},
[onClick, onToggle]
);
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
Show,
{
when: hasAs,
fallback: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
"button",
{
...nativeProps,
...ariaProps,
className: (0, import_css8.cx)(
nativeProps.className,
(0, import_recipes7.button)({
palette,
usage,
shape
})
),
onClick: handleClick,
ref: triggerRef,
children: props.children
}
),
children: hasAs && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
AsSub,
{
...nativeProps,
...ariaProps,
onClick: handleClick,
ref: triggerRef
}
)
}
);
}
// src/components/deprecated/NavMenuList.tsx
var import_react6 = require("react");
var import_css9 = require("styled-system/css");
var import_patterns = require("styled-system/patterns");
var import_jsx_runtime16 = require("react/jsx-runtime");
function getPosition(position) {
const defaultPositions = {
left: "auto",
right: "auto",
top: "auto",
bottom: "auto"
};
switch (position) {
case "right":
return { ...defaultPositions, top: "0%", left: "105%" };
case "left":
return { ...defaultPositions, top: "0%", right: "105%" };
case "bottom":
return { ...defaultPositions, top: "110%" };
case "top":
return { ...defaultPositions, bottom: "110%" };
default:
return defaultPositions;
}
}
var navListStyles = (0, import_patterns.vstack)({
alignItems: "flex-start",
bgColor: "page.surface.100",
boxShadow: "lg",
gap: "2",
opacity: "0",
p: "4",
position: "absolute",
rounded: "md",
zIndex: "dropdown",
_motionSafe: {
animationName: "zoomIn",
animationDelay: "100ms",
animationDuration: "150ms",
animationFillMode: "both",
animationTimingFunction: "ease-in-out"
},
_positionBottom: {
transformOrigin: "top left"
},
_positionTop: {
transformOrigin: "bottom left"
},
_positionLeft: {
transformOrigin: "top right"
},
_positionRight: {
transformOrigin: "top left"
}
});
function NavMenuList(props) {
const { position, ...nativeProps } = props;
const { menuRef, expanded } = useNavMenuContext();
const locationStyles = (0, import_react6.useMemo)(
() => getPosition(position ?? "bottom"),
[position]
);
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Show, { when: expanded, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
"ul",
{
...nativeProps,
"data-position": position ?? "bottom",
className: (0, import_css9.cx)(nativeProps.className, navListStyles),
ref: menuRef,
style: locationStyles
}
) });
}
// src/components/deprecated/NavMenuLink.tsx
var import_css10 = require("styled-system/css");
var import_jsx_runtime17 = require("react/jsx-runtime");
function NavMenuLink(props) {
const { as, ...nativeProps } = props;
const hasAs = Boolean(as);
const AsSub = as;
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
"li",
{
className: (0, import_css10.css)({
w: "full"
}),
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
Show,
{
when: hasAs,
fallback: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
"a",
{
...nativeProps,
className: (0, import_css10.cx)(
nativeProps.className,
(0, import_css10.css)({
color: "action.navigation.initial",
textStyle: "link",
_hover: {
color: "action.navigation.hover"
}
})
)
}
),
children: hasAs && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AsSub, { ...nativeProps })
}
)
}
);
}
// src/components/deprecated/Legend.tsx
var import_field5 = require("@ark-ui/react/field");
var import_css11 = require("styled-system/css");
var import_recipes8 = require("styled-system/recipes");
var import_patterns2 = require("styled-system/patterns");
var import_jsx_runtime18 = require("react/jsx-runtime");
function Legend(props) {
const { size, ...nativeProps } = props;
const { invalid, required } = (0, import_field5.useFieldContext)();
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
"legend",
{
...nativeProps,
...invalid && { "aria-invalid": true },
className: (0, import_css11.cx)(
nativeProps.className,
(0, import_patterns2.hstack)({
justify: "space-between",
w: "full"
}),
(0, import_recipes8.label)({
size
})
),
children: [
nativeProps.children,
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Show, { when: required, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
"span",
{
className: (0, import_css11.css)({
color: "page.text.100",
fontSize: "inherit"
}),
children: "(required)"
}
) })
]
}
);
}
// src/hooks/useDate.ts
var import_react7 = require("react");
function useDate(options) {
const initialValue = (options == null ? void 0 : options.initialValue) ?? "";
const format = (options == null ? void 0 : options.format) ?? DateFormats.USMilitary;
const onChange = options == null ? void 0 : options.onChange;
const [value, setValue] = (0, import_react7.useState)(initialValue);
const handleChange = (0, import_react7.useCallback)(
(e) => {
const newValue = formatMilitaryDate(e.currentTarget.value);
if (onChange) onChange(e);
setValue(newValue);
},
[onChange]
);
return (0, import_react7.useMemo)(
() => ({
format,
value,
ISO: formatMilitaryToISO(value),
onChange: handleChange
}),
[format, value, handleChange]
);
}
function formatMilitaryToISO(input) {
const [day, month, year] = input.split(" ");
const monthIndex = MONTHS.findIndex((m) => m.startsWith(month));
const monthNum = monthIndex + 1;
return `${year ?? "0000"}-${monthNum.toString().padStart(2, "0")}-${day.padStart(
2,
"0"
)}`;
}
function formatMilitaryDate(input) {
let formatted = input.toUpperCase().replace(/[^0-9A-Z]/g, "");
let day = "";
let month = "";
let year = "";
if (formatted.length >= 2) {
day = formatted.replace(/[^0-9]/g, "").slice(0, 2);
const dayNum = parseInt(day, 10);
if (dayNum > 31) day = "31";
else if (dayNum === 0) day = "01";
formatted = formatted.slice(2);
}
if (formatted.length >= 3) {
month = formatted.slice(0, 3);
const monthIndex = MONTHS.findIndex((m) => m.startsWith(month));
if (monthIndex !== -1) {
month = MONTHS[monthIndex];
} else {
month = month.replace(/[^A-Z]/g, "");
}
formatted = formatted.slice(3);
}
if (formatted.length > 0) {
year = formatted.slice(0, 4);
}
return [day, month, year].filter(Boolean).join(" ");
}
function formatISOToMilitary(date) {
const [year, month, day] = date.split("-");
const monthIndex = parseInt(month, 10) - 1;
const monthStr = MONTHS[monthIndex];
return `${day} ${monthStr} ${year}`;
}
var DateFormats = {
get ISO() {
return "YYYY-MM-DD";
},
get USMilitary() {
return "DD MMM YYYY";
},
get Months() {
return MONTHS;
}
};
var MONTHS = [
"JAN",
"FEB",
"MAR",
"APR",
"MAY",
"JUN",
"JUL",
"AUG",
"SEP",
"OCT",
"NOV",
"DEC"
];
// src/hooks/useToggle.ts
var import_react8 = require("react");
function useToggle(options) {
const [checked, setChecked] = (0, import_react8.useState)((options == null ? void 0 : options.checked) ?? "");
const onChange = options == null ? void 0 : options.onChange;
const handleChange = (0, import_react8.useCallback)(
(e) => {
const target = e.currentTarget;
setChecked((prev) => {
return prev === target.value ? "" : target.value;
});
onChange == null ? void 0 : onChange(e);
},
[onChange]
);
return (0, import_react8.useMemo)(() => ({ checked, handleChange }), [checked, handleChange]);
}
// src/components/Droppable.tsx
var import_core = require("@dnd-kit/core");
var import_react9 = require("react");
var import_jsx_runtime19 = require("react/jsx-runtime");
function Droppable(props) {
const { dropped, id, disabled, data, resizeObserverConfig, ...nativeProps } = props;
const uuid = (0, import_react9.useId)();
const { isOver, setNodeRef } = (0, import_core.useDroppable)({
data,
disabled,
id: id || uuid,
resizeObserverConfig
});
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
"div",
{
...nativeProps,
"data-over": isOver,
"data-dropped": dropped,
ref: setNodeRef,
children: props.children
}
);
}
// src/components/admonition/primitives.tsx
var import_factory3 = require("@ark-ui/react/factory");
var import_recipes9 = require("styled-system/recipes");
var { withSlotRecipe: withSlotRecipe2, withNoRecipe: withNoRecipe2 } = createCerberusPrimitive(import_recipes9.admonition);
var AdmonitionRoot = withSlotRecipe2(
import_factory3.ark.aside,
"root",
{
defaultProps: {
"data-scope": "admonition",
"data-part": "root"
}
}
);
var AdmonitionIndicator = withNoRecipe2(
import_factory3.ark.span,
{
defaultProps: {
"data-scope": "admonition",
"data-part": "indicator"
}
}
);
var AdmonitionContent = withNoRecipe2(import_factory3.ark.div, {
defaultProps: {
"data-scope": "admonition",
"data-part": "content"
}
});
var AdmonitionHeading = withSlotRecipe2(
import_factory3.ark.p,
"heading",
{
defaultProps: {
"data-scope": "admonition",
"data-part": "heading"
}
}
);
var AdmonitionDescription = withSlotRecipe2(
import_factory3.ark.p,
"description",
{
defaultProps: {
"data-scope": "admonition",
"data-part": "description"
}
}
);
// src/components/admonition/parts.ts
var AdmonitionParts = {
Root: AdmonitionRoot,
Indicator: AdmonitionIndicator,
Content: AdmonitionContent,
Heading: AdmonitionHeading,
Description: AdmonitionDescription
};
// src/components/admonition/match-avatar.tsx
var import_react10 = require("react");
// src/components/avatar/primitives.tsx
var import_avatar = require("@ark-ui/react/avatar");
var import_recipes10 = require("styled-system/recipes");
var { withSlotRecipe: withSlotRecipe3 } = createCerberusPrimitive(import_recipes10.avatar);
var AvatarRoot = withSlotRecipe3(import_avatar.Avatar.Root, "root");
var AvatarImage = withSlotRecipe3(
import_avatar.Avatar.Image,
"image"
);
var AvatarFallback = withSlotRecipe3(
import_avatar.Avatar.Fallback,
"fallback"
);
// src/components/avatar/parts.ts
var AvatarParts = {
Root: AvatarRoot,
Image: AvatarImage,
Fallback: AvatarFallback
};
// src/components/avatar/avatar.tsx
var import_jsx_runtime20 = require("react/jsx-runtime");
function Avatar2(props) {
const [imgProps, { fallback, children }, rootProps] = splitProps(
props,
["alt", "src"],
["fallback", "children"]
);
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AvatarParts.Root, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
Show,
{
when: children,
fallback: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AvatarParts.Fallback, { children: fallback }),
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AvatarParts.Image, { ...imgProps })
] }),
children
}
) });
}
// src/components/admonition/match-avatar.tsx
var import_jsx_runtime21 = require("react/jsx-runtime");
function MatchAvatar(props) {
const { palette = "page" } = props;
const { icons } = useCerberusContext();
const {
infoNotification: InfoIcon,
successNotification: SuccessIcon,
warningNotification: WarningIcon,
dangerNotification: DangerIcon
} = icons;
const elRef = (0, import_react10.useRef)({
page: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Avatar2, { gradient: "charon-light", fallback: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InfoIcon, {}), size: "sm" }),
info: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Avatar2, { gradient: "amphiaraus-dark", fallback: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InfoIcon, {}), size: "sm" }),
success: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Avatar2, { gradient: "thanatos-dark", fallback: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SuccessIcon, {}), size: "sm" }),
warning: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Avatar2, { gradient: "asphodel-light", fallback: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(WarningIcon, {}), size: "sm" }),
danger: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Avatar2, { gradient: "hades-light", fallback: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DangerIcon, {}), size: "sm" })
});
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: elRef.current[palette] });
}
// src/components/admonition/admonition.tsx
var import_jsx_runtime22 = require("react/jsx-runtime");
function Admonition(props) {
const [elProps, styleProps, rootProps] = splitProps(
props,
["heading", "icon", "children"],
["palette", "usage"]
);
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(AdmonitionParts.Root, { ...styleProps, ...rootProps, children: [
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
Show,
{
when: elProps.icon,
fallback: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MatchAvatar, { palette: styleProps.palette }),
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AdmonitionParts.Indicator, { children: elProps.icon })
}
),
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(AdmonitionParts.Content, { children: [
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Show, { when: elProps.heading, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AdmonitionParts.Heading, { children: elProps.heading }) }),
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AdmonitionParts.Description, { children: elProps.children })
] })
] });
}
// src/components/accordion/primitives.tsx
var import_accordion = require("@ark-ui/react/accordion");
var import_recipes11 = require("styled-system/recipes");
var import_jsx_runtime23 = require("react/jsx-runtime");
var { withSlotRecipe: withSlotRecipe4 } = createCerberusPrimitive(import_recipes11.accordion);
function AccordionRootEl(props) {
const { size, ...rootProps } = props;
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_accordion.Accordion.Root, { ...rootProps, "data-size": size });
}
var AccordionRoot = withSlotRecipe4(AccordionRootEl, "root");
var AccordionItem = withSlotRecipe4(
import_accordion.Accordion.Item,
"item"
);
var AccordionItemTrigger = withSlotRecipe4(
import_accordion.Accordion.ItemTrigger,
"itemTrigger"
);
var AccordionItemIndicator = withSlotRecipe4(
import_accordion.Accordion.ItemIndicator,
"itemIndicator"
);
var AccordionItemContent = withSlotRecipe4(
import_accordion.Accordion.ItemContent,
"itemContent"
);
// src/components/accordion/parts.ts
var AccordionParts = {
Root: AccordionRoot,
Item: AccordionItem,
ItemTrigger: AccordionItemTrigger,
ItemContent: AccordionItemContent,
ItemIndicator: AccordionItemIndicator
};
// src/components/accordion/item-indicator.tsx
var import_jsx_runtime24 = require("react/jsx-runtime");
function AccordionChevronItemIndicator(props) {
const { size, ...indicatorProps } = props;
const iconSize = size === "sm" ? 16 : "24";
const { icons } = useCerberusContext();
const { accordionIndicator: ChevronDown } = icons;
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AccordionParts.ItemIndicator, { ...indicatorProps, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ChevronDown, { size: iconSize }) });
}
// src/components/accordion/item-group.tsx
var import_jsx_runtime25 = require("react/jsx-runtime");
function Accordion2(props) {
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionParts.Root, { ...props });
}
function AccordionItemGroup(props) {
const [groupProps, itemProps] = splitProps(props, [
"heading",
"children",
"indicatorPosition"
]);
const indicatorPosition = groupProps.indicatorPosition ?? "end";
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionParts.Item, { ...itemProps, children: [
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AccordionParts.ItemTrigger, { "data-indicator-position": indicatorPosition, children: [
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Show, { when: indicatorPosition === "start", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionChevronItemIndicator, {}) }),
groupProps.heading,
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Show, { when: indicatorPosition === "end", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionChevronItemIndicator, {}) })
] }),
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionParts.ItemContent, { children: groupProps.children })
] });
}
// src/components/avatar/index.ts
var import_avatar3 = require("@ark-ui/react/avatar");
// src/components/button/button.tsx
var import_react11 = require("react");
var import_jsx2 = require("styled-system/jsx");
// src/components/spinner/spinner.tsx
var import_jsx_runtime26 = require("react/jsx-runtime");
function Spinner(props) {
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
"svg",
{
"aria-busy": "true",
"data-scope": "spinner",
"data-part": "root",
role: "status",
xmlns: "http://www.w3.org/2000/svg",
height: props.size,
width: props.size,
viewBox: "0 0 24 24",
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
"g",
{
fill: "none",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 2,
children: [
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
"path",
{
strokeDasharray: 16,
strokeDashoffset: 16,
d: "M12 3c4.97 0 9 4.03 9 9",
children: [
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
"animate",
{
fill: "freeze",
attributeName: "stroke-dashoffset",
dur: "0.15s",
values: "16;0"
}
),
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
"animateTransform",
{
attributeName: "transform",
dur: "0.75s",