@helpwave/hightide 0.1.37 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/TimeDisplay.js.map +1 -1
- package/dist/components/date/TimeDisplay.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/date/index.js.map +1 -1
- package/dist/components/date/index.mjs.map +1 -1
- package/dist/components/dialog/ConfirmDialog.js +15 -9
- package/dist/components/dialog/ConfirmDialog.js.map +1 -1
- package/dist/components/dialog/ConfirmDialog.mjs +16 -10
- package/dist/components/dialog/ConfirmDialog.mjs.map +1 -1
- package/dist/components/dialog/Dialog.d.mts +4 -5
- package/dist/components/dialog/Dialog.d.ts +4 -5
- package/dist/components/dialog/Dialog.js +15 -9
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/dialog/Dialog.mjs +16 -10
- package/dist/components/dialog/Dialog.mjs.map +1 -1
- package/dist/components/dialog/DiscardChangesDialog.js +15 -9
- package/dist/components/dialog/DiscardChangesDialog.js.map +1 -1
- package/dist/components/dialog/DiscardChangesDialog.mjs +16 -10
- package/dist/components/dialog/DiscardChangesDialog.mjs.map +1 -1
- package/dist/components/dialog/InputDialog.js +15 -9
- package/dist/components/dialog/InputDialog.js.map +1 -1
- package/dist/components/dialog/InputDialog.mjs +16 -10
- package/dist/components/dialog/InputDialog.mjs.map +1 -1
- package/dist/components/dialog/LanguageDialog.js +188 -154
- package/dist/components/dialog/LanguageDialog.js.map +1 -1
- package/dist/components/dialog/LanguageDialog.mjs +151 -116
- package/dist/components/dialog/LanguageDialog.mjs.map +1 -1
- package/dist/components/dialog/ThemeDialog.js +191 -157
- package/dist/components/dialog/ThemeDialog.js.map +1 -1
- package/dist/components/dialog/ThemeDialog.mjs +151 -116
- package/dist/components/dialog/ThemeDialog.mjs.map +1 -1
- package/dist/components/dialog/index.js +205 -171
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/index.mjs +152 -117
- package/dist/components/dialog/index.mjs.map +1 -1
- package/dist/components/index.js +337 -299
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +198 -159
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/layout/Carousel.d.mts +2 -1
- package/dist/components/layout/Carousel.d.ts +2 -1
- package/dist/components/layout/Carousel.js +4 -0
- package/dist/components/layout/Carousel.js.map +1 -1
- package/dist/components/layout/Carousel.mjs +4 -0
- package/dist/components/layout/Carousel.mjs.map +1 -1
- package/dist/components/layout/TextImage.js.map +1 -1
- package/dist/components/layout/TextImage.mjs.map +1 -1
- package/dist/components/layout/index.js +4 -0
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/index.mjs +4 -0
- package/dist/components/layout/index.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/loading-states/index.js.map +1 -1
- package/dist/components/loading-states/index.mjs.map +1 -1
- package/dist/components/navigation/Pagination.js.map +1 -1
- package/dist/components/navigation/Pagination.mjs.map +1 -1
- package/dist/components/navigation/StepperBar.js.map +1 -1
- package/dist/components/navigation/StepperBar.mjs.map +1 -1
- package/dist/components/navigation/index.js.map +1 -1
- package/dist/components/navigation/index.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.js +129 -101
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +131 -102
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.js +129 -101
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +131 -102
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/properties/index.js +129 -101
- package/dist/components/properties/index.js.map +1 -1
- package/dist/components/properties/index.mjs +131 -102
- package/dist/components/properties/index.mjs.map +1 -1
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/TableFilterButton.js.map +1 -1
- package/dist/components/table/TableFilterButton.mjs.map +1 -1
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/table/index.mjs.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/SearchBar.js.map +1 -1
- package/dist/components/user-action/SearchBar.mjs.map +1 -1
- package/dist/components/user-action/index.js +129 -101
- package/dist/components/user-action/index.js.map +1 -1
- package/dist/components/user-action/index.mjs +131 -102
- package/dist/components/user-action/index.mjs.map +1 -1
- package/dist/components/user-action/select/Select.d.mts +2 -0
- package/dist/components/user-action/select/Select.d.ts +2 -0
- package/dist/components/user-action/select/Select.js +129 -101
- package/dist/components/user-action/select/Select.js.map +1 -1
- package/dist/components/user-action/select/Select.mjs +131 -102
- package/dist/components/user-action/select/Select.mjs.map +1 -1
- package/dist/components/user-action/select/index.js +129 -101
- package/dist/components/user-action/select/index.js.map +1 -1
- package/dist/components/user-action/select/index.mjs +131 -102
- package/dist/components/user-action/select/index.mjs.map +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/useValidators.js.map +1 -1
- package/dist/hooks/useValidators.mjs.map +1 -1
- package/dist/index.js +362 -324
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +206 -167
- package/dist/index.mjs.map +1 -1
- package/dist/localization/LanguageProvider.js +1 -1
- package/dist/localization/LanguageProvider.js.map +1 -1
- package/dist/localization/LanguageProvider.mjs +1 -1
- package/dist/localization/LanguageProvider.mjs.map +1 -1
- package/dist/localization/index.js +1 -1
- package/dist/localization/index.js.map +1 -1
- package/dist/localization/index.mjs +1 -1
- package/dist/localization/index.mjs.map +1 -1
- package/dist/localization/useTranslation.js.map +1 -1
- package/dist/localization/useTranslation.mjs.map +1 -1
- package/dist/style/globals.css +0 -3
- package/dist/theming/index.js +1 -1
- package/dist/theming/index.js.map +1 -1
- package/dist/theming/index.mjs +1 -1
- package/dist/theming/index.mjs.map +1 -1
- package/dist/theming/useTheme.js +1 -1
- package/dist/theming/useTheme.js.map +1 -1
- package/dist/theming/useTheme.mjs +1 -1
- package/dist/theming/useTheme.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/properties/CheckboxProperty.tsx","../../../src/components/user-action/Checkbox.tsx","../../../node_modules/@radix-ui/react-checkbox/src/checkbox.tsx","../../../node_modules/@radix-ui/react-compose-refs/src/compose-refs.tsx","../../../node_modules/@radix-ui/react-context/src/create-context.tsx","../../../node_modules/@radix-ui/primitive/src/primitive.tsx","../../../node_modules/@radix-ui/react-use-controllable-state/src/use-controllable-state.tsx","../../../node_modules/@radix-ui/react-use-controllable-state/src/use-controllable-state-reducer.tsx","../../../node_modules/@radix-ui/react-use-layout-effect/src/use-layout-effect.tsx","../../../node_modules/@radix-ui/react-use-previous/src/use-previous.tsx","../../../node_modules/@radix-ui/react-use-size/src/use-size.tsx","../../../node_modules/@radix-ui/react-presence/src/presence.tsx","../../../node_modules/@radix-ui/react-presence/src/use-state-machine.tsx","../../../node_modules/@radix-ui/react-primitive/src/primitive.tsx","../../../node_modules/@radix-ui/react-slot/src/slot.tsx","../../../src/hooks/useOverwritableState.ts","../../../src/utils/resolveSetState.ts","../../../src/localization/LanguageProvider.tsx","../../../src/hooks/useLocalStorage.ts","../../../src/localization/util.ts","../../../src/localization/useTranslation.ts","../../../src/components/properties/PropertyBase.tsx","../../../src/components/user-action/Button.tsx","../../../src/localization/defaults/form.ts","../../../src/components/user-action/Label.tsx","../../../src/components/properties/DateProperty.tsx","../../../src/utils/date.ts","../../../src/components/user-action/input/Input.tsx","../../../src/hooks/useDelay.ts","../../../src/hooks/focus/useFocusManagement.ts","../../../src/components/properties/MultiSelectProperty.tsx","../../../src/components/user-action/select/Select.tsx","../../../src/components/layout/Expandable.tsx","../../../src/hooks/focus/useFocusTrap.ts","../../../src/hooks/focus/useIsMounted.ts","../../../src/utils/match.ts","../../../src/components/layout/Chip.tsx","../../../src/hooks/useFloatingElement.ts","../../../src/utils/math.ts","../../../src/components/properties/NumberProperty.tsx","../../../src/components/properties/SelectProperty.tsx","../../../src/components/properties/TextProperty.tsx","../../../src/components/user-action/Textarea.tsx"],"sourcesContent":["import { Check } from 'lucide-react'\nimport { Checkbox } from '../user-action/Checkbox'\nimport type { PropsForTranslation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport type { PropertyBaseProps } from './PropertyBase'\nimport { PropertyBase } from './PropertyBase'\nimport type { FormTranslationType } from '../../localization/defaults/form'\nimport { formTranslation } from '../../localization/defaults/form'\nimport { useId } from 'react'\nimport { Label } from '@/src/components/user-action/Label'\n\ntype CheckboxPropertyTranslation = FormTranslationType\n\nexport type CheckboxPropertyProps = Omit<PropertyBaseProps, 'icon' | 'input' | 'hasValue' | 'onRemove'> & {\n value?: boolean,\n onChange?: (value: boolean) => void,\n}\n\n/**\n * An Input component for a boolean values\n */\nexport const CheckboxProperty = ({\n overwriteTranslation,\n value,\n onChange,\n readOnly,\n ...baseProps\n }: PropsForTranslation<CheckboxPropertyTranslation, CheckboxPropertyProps>) => {\n const translation = useTranslation([formTranslation], overwriteTranslation)\n const id= useId()\n\n return (\n <PropertyBase\n {...baseProps}\n hasValue={true}\n readOnly={readOnly}\n icon={<Check size={24}/>}\n input={() => (\n <div className=\"flex-row-2 items-center\">\n <Checkbox\n id={id}\n checked={value ?? true}\n disabled={readOnly}\n onChange={onChange}\n aria-labelledby={id+'label'}\n />\n <Label id={id+'label'}>\n {`${translation('yes')}/${translation('no')}`}\n </Label>\n </div>\n )}\n />\n )\n}\n","import { Check, Minus } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { CheckboxProps as RadixCheckboxProps } from '@radix-ui/react-checkbox'\nimport { CheckboxIndicator as RadixCheckboxIndicator, Root as RadixCheckbox } from '@radix-ui/react-checkbox'\nimport { useOverwritableState } from '@/src/hooks/useOverwritableState'\n\ntype CheckBoxSize = 'sm' | 'md' | 'lg'\n\nconst checkboxSizeMapping: Record<CheckBoxSize, string> = {\n sm: 'size-5 border-1',\n md: 'size-6 border-1',\n lg: 'size-8 border-2',\n}\n\nconst checkboxIconSizeMapping: Record<CheckBoxSize, string> = {\n sm: 'size-4 stroke-3',\n md: 'size-5 stroke-3',\n lg: 'size-7 stroke-3',\n}\n\nexport type CheckboxProps = Omit<RadixCheckboxProps, 'checked' | 'onCheckedChange' | 'onChange'> & {\n checked?: boolean,\n indeterminate?: boolean,\n onChange?: (checked: boolean) => void,\n size?: CheckBoxSize,\n}\n\n/**\n * A Tristate checkbox\n *\n * The state is managed by the parent\n */\nexport const Checkbox = ({\n disabled,\n checked = false,\n indeterminate = false,\n onChange,\n size = 'md',\n className = '',\n ...props\n }: CheckboxProps) => {\n const usedSizeClass = checkboxSizeMapping[size]\n const innerIconSize = checkboxIconSizeMapping[size]\n\n return (\n <RadixCheckbox\n {...props}\n disabled={disabled}\n checked={indeterminate ? 'indeterminate' : checked}\n onCheckedChange={onChange}\n className={clsx(\n usedSizeClass,\n `flex-col-0 items-center justify-center rounded`,\n {\n 'text-disabled border-disabled-outline bg-disabled-background cursor-not-allowed': disabled,\n 'hover:border-primary': !disabled,\n 'bg-input-background': !disabled && !checked,\n 'bg-primary/30 border-primary text-primary': !disabled && (checked || indeterminate),\n },\n className\n )}\n >\n <RadixCheckboxIndicator>\n {!checked && !indeterminate && <div className={clsx('bg-input-background', innerIconSize)}/>}\n {checked && !indeterminate && <Check className={innerIconSize}/>}\n {indeterminate && <Minus className={innerIconSize}/>}\n </RadixCheckboxIndicator>\n </RadixCheckbox>\n )\n}\n\nexport type CheckboxUncontrolledProps = CheckboxProps\n\n/**\n * A Tristate checkbox\n *\n * The state is managed by this component\n */\nexport const CheckboxUncontrolled = ({\n checked: initialChecked,\n onChange,\n ...props\n }: CheckboxUncontrolledProps) => {\n const [checked, setChecked] = useOverwritableState(initialChecked, onChange)\n\n return (\n <Checkbox\n {...props}\n checked={checked}\n onChange={setChecked}\n />\n )\n}","import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst CHECKBOX_NAME = 'Checkbox';\n\ntype ScopedProps<P> = P & { __scopeCheckbox?: Scope };\nconst [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);\n\ntype CheckedState = boolean | 'indeterminate';\n\ntype CheckboxContextValue<State extends CheckedState | boolean = CheckedState> = {\n checked: State | boolean;\n setChecked: React.Dispatch<React.SetStateAction<State | boolean>>;\n disabled: boolean | undefined;\n control: HTMLButtonElement | null;\n setControl: React.Dispatch<React.SetStateAction<HTMLButtonElement | null>>;\n name: string | undefined;\n form: string | undefined;\n value: string | number | readonly string[];\n hasConsumerStoppedPropagationRef: React.RefObject<boolean>;\n required: boolean | undefined;\n defaultChecked: boolean | undefined;\n isFormControl: boolean;\n bubbleInput: HTMLInputElement | null;\n setBubbleInput: React.Dispatch<React.SetStateAction<HTMLInputElement | null>>;\n};\n\nconst [CheckboxProviderImpl, useCheckboxContext] =\n createCheckboxContext<CheckboxContextValue>(CHECKBOX_NAME);\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface CheckboxProviderProps<State extends CheckedState = CheckedState> {\n checked?: State | boolean;\n defaultChecked?: State | boolean;\n required?: boolean;\n onCheckedChange?(checked: State | boolean): void;\n name?: string;\n form?: string;\n disabled?: boolean;\n value?: string | number | readonly string[];\n children?: React.ReactNode;\n}\n\nfunction CheckboxProvider<State extends CheckedState = CheckedState>(\n props: ScopedProps<CheckboxProviderProps<State>>\n) {\n const {\n __scopeCheckbox,\n checked: checkedProp,\n children,\n defaultChecked,\n disabled,\n form,\n name,\n onCheckedChange,\n required,\n value = 'on',\n // @ts-expect-error\n internal_do_not_use_render,\n } = props;\n\n const [checked, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked ?? false,\n onChange: onCheckedChange,\n caller: CHECKBOX_NAME,\n });\n const [control, setControl] = React.useState<HTMLButtonElement | null>(null);\n const [bubbleInput, setBubbleInput] = React.useState<HTMLInputElement | null>(null);\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n const isFormControl = control\n ? !!form || !!control.closest('form')\n : // We set this to true by default so that events bubble to forms without JS (SSR)\n true;\n\n const context: CheckboxContextValue<State> = {\n checked: checked,\n disabled: disabled,\n setChecked: setChecked,\n control: control,\n setControl: setControl,\n name: name,\n form: form,\n value: value,\n hasConsumerStoppedPropagationRef: hasConsumerStoppedPropagationRef,\n required: required,\n defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,\n isFormControl: isFormControl,\n bubbleInput,\n setBubbleInput,\n };\n\n return (\n <CheckboxProviderImpl\n scope={__scopeCheckbox}\n {...(context as unknown as CheckboxContextValue<CheckedState>)}\n >\n {isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children}\n </CheckboxProviderImpl>\n );\n}\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'CheckboxTrigger';\n\ninterface CheckboxTriggerProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof Primitive.button>,\n keyof CheckboxProviderProps\n > {\n children?: React.ReactNode;\n}\n\nconst CheckboxTrigger = React.forwardRef<HTMLButtonElement, CheckboxTriggerProps>(\n (\n { __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }: ScopedProps<CheckboxTriggerProps>,\n forwardedRef\n ) => {\n const {\n control,\n value,\n disabled,\n checked,\n required,\n setControl,\n setChecked,\n hasConsumerStoppedPropagationRef,\n isFormControl,\n bubbleInput,\n } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);\n const composedRefs = useComposedRefs(forwardedRef, setControl);\n\n const initialCheckedStateRef = React.useRef(checked);\n React.useEffect(() => {\n const form = control?.form;\n if (form) {\n const reset = () => setChecked(initialCheckedStateRef.current);\n form.addEventListener('reset', reset);\n return () => form.removeEventListener('reset', reset);\n }\n }, [control, setChecked]);\n\n return (\n <Primitive.button\n type=\"button\"\n role=\"checkbox\"\n aria-checked={isIndeterminate(checked) ? 'mixed' : checked}\n aria-required={required}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n value={value}\n {...checkboxProps}\n ref={composedRefs}\n onKeyDown={composeEventHandlers(onKeyDown, (event) => {\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n if (event.key === 'Enter') event.preventDefault();\n })}\n onClick={composeEventHandlers(onClick, (event) => {\n setChecked((prevChecked) => (isIndeterminate(prevChecked) ? true : !prevChecked));\n if (bubbleInput && isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if checkbox has a bubble input and is a form control, stop\n // propagation from the button so that we only propagate one click\n // event (from the input). We propagate changes from an input so\n // that native form validation works and form events reflect\n // checkbox updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n );\n }\n);\n\nCheckboxTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Checkbox\n * -----------------------------------------------------------------------------------------------*/\n\ntype CheckboxElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface CheckboxProps extends Omit<PrimitiveButtonProps, 'checked' | 'defaultChecked'> {\n checked?: CheckedState;\n defaultChecked?: CheckedState;\n required?: boolean;\n onCheckedChange?(checked: CheckedState): void;\n}\n\nconst Checkbox = React.forwardRef<CheckboxElement, CheckboxProps>(\n (props: ScopedProps<CheckboxProps>, forwardedRef) => {\n const {\n __scopeCheckbox,\n name,\n checked,\n defaultChecked,\n required,\n disabled,\n value,\n onCheckedChange,\n form,\n ...checkboxProps\n } = props;\n\n return (\n <CheckboxProvider\n __scopeCheckbox={__scopeCheckbox}\n checked={checked}\n defaultChecked={defaultChecked}\n disabled={disabled}\n required={required}\n onCheckedChange={onCheckedChange}\n name={name}\n form={form}\n value={value}\n // @ts-expect-error\n internal_do_not_use_render={({ isFormControl }: CheckboxContextValue) => (\n <>\n <CheckboxTrigger\n {...checkboxProps}\n ref={forwardedRef}\n // @ts-expect-error\n __scopeCheckbox={__scopeCheckbox}\n />\n {isFormControl && (\n <CheckboxBubbleInput\n // @ts-expect-error\n __scopeCheckbox={__scopeCheckbox}\n />\n )}\n </>\n )}\n />\n );\n }\n);\n\nCheckbox.displayName = CHECKBOX_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'CheckboxIndicator';\n\ntype CheckboxIndicatorElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface CheckboxIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst CheckboxIndicator = React.forwardRef<CheckboxIndicatorElement, CheckboxIndicatorProps>(\n (props: ScopedProps<CheckboxIndicatorProps>, forwardedRef) => {\n const { __scopeCheckbox, forceMount, ...indicatorProps } = props;\n const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);\n return (\n <Presence\n present={forceMount || isIndeterminate(context.checked) || context.checked === true}\n >\n <Primitive.span\n data-state={getState(context.checked)}\n data-disabled={context.disabled ? '' : undefined}\n {...indicatorProps}\n ref={forwardedRef}\n style={{ pointerEvents: 'none', ...props.style }}\n />\n </Presence>\n );\n }\n);\n\nCheckboxIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'CheckboxBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;\ninterface CheckboxBubbleInputProps extends Omit<InputProps, 'checked'> {}\n\nconst CheckboxBubbleInput = React.forwardRef<HTMLInputElement, CheckboxBubbleInputProps>(\n ({ __scopeCheckbox, ...props }: ScopedProps<CheckboxBubbleInputProps>, forwardedRef) => {\n const {\n control,\n hasConsumerStoppedPropagationRef,\n checked,\n defaultChecked,\n required,\n disabled,\n name,\n value,\n form,\n bubbleInput,\n setBubbleInput,\n } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);\n\n const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = bubbleInput;\n if (!input) return;\n\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n 'checked'\n ) as PropertyDescriptor;\n const setChecked = descriptor.set;\n\n const bubbles = !hasConsumerStoppedPropagationRef.current;\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles });\n input.indeterminate = isIndeterminate(checked);\n setChecked.call(input, isIndeterminate(checked) ? false : checked);\n input.dispatchEvent(event);\n }\n }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);\n\n const defaultCheckedRef = React.useRef(isIndeterminate(checked) ? false : checked);\n return (\n <Primitive.input\n type=\"checkbox\"\n aria-hidden\n defaultChecked={defaultChecked ?? defaultCheckedRef.current}\n required={required}\n disabled={disabled}\n name={name}\n value={value}\n form={form}\n {...props}\n tabIndex={-1}\n ref={composedRefs}\n style={{\n ...props.style,\n ...controlSize,\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n transform: 'translateX(-100%)',\n }}\n />\n );\n }\n);\n\nCheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n\nfunction isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n return checked === 'indeterminate';\n}\n\nfunction getState(checked: CheckedState) {\n return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n}\n\nexport {\n createCheckboxScope,\n //\n Checkbox,\n CheckboxProvider,\n CheckboxTrigger,\n CheckboxIndicator,\n CheckboxBubbleInput,\n //\n Checkbox as Root,\n CheckboxProvider as Provider,\n CheckboxTrigger as Trigger,\n CheckboxIndicator as Indicator,\n CheckboxBubbleInput as BubbleInput,\n};\nexport type {\n CheckboxProps,\n CheckboxProviderProps,\n CheckboxTriggerProps,\n CheckboxIndicatorProps,\n CheckboxBubbleInputProps,\n CheckedState,\n};\n","import * as React from 'react';\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == 'function') {\n hasCleanup = true;\n }\n return cleanup;\n });\n\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == 'function') {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n","import * as React from 'react';\n\nfunction createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n) {\n const Context = React.createContext<ContextValueType | undefined>(defaultContext);\n\n const Provider: React.FC<ContextValueType & { children: React.ReactNode }> = (props) => {\n const { children, ...context } = props;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return <Context.Provider value={value}>{children}</Context.Provider>;\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * createContextScope\n * -----------------------------------------------------------------------------------------------*/\n\ntype Scope<C = any> = { [scopeName: string]: React.Context<C>[] } | undefined;\ntype ScopeHook = (scope: Scope) => { [__scopeProp: string]: Scope };\ninterface CreateScope {\n scopeName: string;\n (): ScopeHook;\n}\n\nfunction createContextScope(scopeName: string, createContextScopeDeps: CreateScope[] = []) {\n let defaultContexts: any[] = [];\n\n /* -----------------------------------------------------------------------------------------------\n * createContext\n * ---------------------------------------------------------------------------------------------*/\n\n function createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n ) {\n const BaseContext = React.createContext<ContextValueType | undefined>(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n\n const Provider: React.FC<\n ContextValueType & { scope: Scope<ContextValueType>; children: React.ReactNode }\n > = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return <Context.Provider value={value}>{children}</Context.Provider>;\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string, scope: Scope<ContextValueType | undefined>) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n }\n\n /* -----------------------------------------------------------------------------------------------\n * createScope\n * ---------------------------------------------------------------------------------------------*/\n\n const createScope: CreateScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope: Scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n\n createScope.scopeName = scopeName;\n return [createContext, composeContextScopes(createScope, ...createContextScopeDeps)] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * composeContextScopes\n * -----------------------------------------------------------------------------------------------*/\n\nfunction composeContextScopes(...scopes: CreateScope[]) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n\n const createScope: CreateScope = () => {\n const scopeHooks = scopes.map((createScope) => ({\n useScope: createScope(),\n scopeName: createScope.scopeName,\n }));\n\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {\n // We are calling a hook inside a callback which React warns against to avoid inconsistent\n // renders, however, scoping doesn't have render side effects so we ignore the rule.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes, ...currentScope };\n }, {});\n\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { createContext, createContextScope };\nexport type { CreateScope, Scope };\n","function composeEventHandlers<E extends { defaultPrevented: boolean }>(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\n\nexport { composeEventHandlers };\n","import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// Prevent bundlers from trying to optimize the import\nconst useInsertionEffect: typeof useLayoutEffect =\n (React as any)[' useInsertionEffect '.trim().toString()] || useLayoutEffect;\n\ntype ChangeHandler<T> = (state: T) => void;\ntype SetStateFn<T> = React.Dispatch<React.SetStateAction<T>>;\n\ninterface UseControllableStateParams<T> {\n prop?: T | undefined;\n defaultProp: T;\n onChange?: ChangeHandler<T>;\n caller?: string;\n}\n\nexport function useControllableState<T>({\n prop,\n defaultProp,\n onChange = () => {},\n caller,\n}: UseControllableStateParams<T>): [T, SetStateFn<T>] {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange,\n });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (process.env.NODE_ENV !== 'production') {\n const isControlledRef = React.useRef(prop !== undefined);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? 'controlled' : 'uncontrolled';\n const to = isControlled ? 'controlled' : 'uncontrolled';\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n const setValue = React.useCallback<SetStateFn<T>>(\n (nextValue) => {\n if (isControlled) {\n const value = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value !== prop) {\n onChangeRef.current?.(value);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n\n return [value, setValue];\n}\n\nfunction useUncontrolledState<T>({\n defaultProp,\n onChange,\n}: Omit<UseControllableStateParams<T>, 'prop'>): [\n Value: T,\n setValue: React.Dispatch<React.SetStateAction<T>>,\n OnChangeRef: React.RefObject<ChangeHandler<T> | undefined>,\n] {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n\n return [value, setValue, onChangeRef];\n}\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n","import * as React from 'react';\nimport { useEffectEvent } from '@radix-ui/react-use-effect-event';\n\ntype ChangeHandler<T> = (state: T) => void;\n\ninterface UseControllableStateParams<T> {\n prop: T | undefined;\n defaultProp: T;\n onChange: ChangeHandler<T> | undefined;\n caller: string;\n}\n\ninterface AnyAction {\n type: string;\n}\n\nconst SYNC_STATE = Symbol('RADIX:SYNC_STATE');\n\ninterface SyncStateAction<T> {\n type: typeof SYNC_STATE;\n state: T;\n}\n\nexport function useControllableStateReducer<T, S extends {}, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialState: S\n): [S & { state: T }, React.Dispatch<A>];\n\nexport function useControllableStateReducer<T, S extends {}, I, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialArg: I,\n init: (i: I & { state: T }) => S\n): [S & { state: T }, React.Dispatch<A>];\n\nexport function useControllableStateReducer<T, S extends {}, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialArg: any,\n init?: (i: any) => Omit<S, 'state'>\n): [S & { state: T }, React.Dispatch<A>] {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== undefined;\n\n const onChange = useEffectEvent(onChangeProp);\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (process.env.NODE_ENV !== 'production') {\n const isControlledRef = React.useRef(controlledState !== undefined);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? 'controlled' : 'uncontrolled';\n const to = isControlled ? 'controlled' : 'uncontrolled';\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n type InternalState = S & { state: T };\n const args: [InternalState] = [{ ...initialArg, state: defaultProp }];\n if (init) {\n // @ts-expect-error\n args.push(init);\n }\n\n const [internalState, dispatch] = React.useReducer(\n (state: InternalState, action: A | SyncStateAction<T>): InternalState => {\n if (action.type === SYNC_STATE) {\n return { ...state, state: action.state };\n }\n\n const next = reducer(state, action);\n if (isControlled && !Object.is(next.state, state.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n\n const uncontrolledState = internalState.state;\n const prevValueRef = React.useRef(uncontrolledState);\n React.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n\n const state = React.useMemo(() => {\n const isControlled = controlledState !== undefined;\n if (isControlled) {\n return { ...internalState, state: controlledState };\n }\n\n return internalState;\n }, [internalState, controlledState]);\n\n React.useEffect(() => {\n // Sync internal state for controlled components so that reducer is called\n // with the correct state values\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n\n return [state, dispatch as React.Dispatch<A>];\n}\n","import * as React from 'react';\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nconst useLayoutEffect = globalThis?.document ? React.useLayoutEffect : () => {};\n\nexport { useLayoutEffect };\n","import * as React from 'react';\n\nfunction usePrevious<T>(value: T) {\n const ref = React.useRef({ value, previous: value });\n\n // We compare values before making an update to ensure that\n // a change has been made. This ensures the previous value is\n // persisted correctly between renders.\n return React.useMemo(() => {\n if (ref.current.value !== value) {\n ref.current.previous = ref.current.value;\n ref.current.value = value;\n }\n return ref.current.previous;\n }, [value]);\n}\n\nexport { usePrevious };\n","/// <reference types=\"resize-observer-browser\" />\n\nimport * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\nfunction useSize(element: HTMLElement | null) {\n const [size, setSize] = React.useState<{ width: number; height: number } | undefined>(undefined);\n\n useLayoutEffect(() => {\n if (element) {\n // provide size as early as possible\n setSize({ width: element.offsetWidth, height: element.offsetHeight });\n\n const resizeObserver = new ResizeObserver((entries) => {\n if (!Array.isArray(entries)) {\n return;\n }\n\n // Since we only observe the one element, we don't need to loop over the\n // array\n if (!entries.length) {\n return;\n }\n\n const entry = entries[0];\n let width: number;\n let height: number;\n\n if ('borderBoxSize' in entry) {\n const borderSizeEntry = entry['borderBoxSize'];\n // iron out differences between browsers\n const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n width = borderSize['inlineSize'];\n height = borderSize['blockSize'];\n } else {\n // for browsers that don't support `borderBoxSize`\n // we calculate it ourselves to get the correct border box.\n width = element.offsetWidth;\n height = element.offsetHeight;\n }\n\n setSize({ width, height });\n });\n\n resizeObserver.observe(element, { box: 'border-box' });\n\n return () => resizeObserver.unobserve(element);\n } else {\n // We only want to reset to `undefined` when the element becomes `null`,\n // not if it changes to another element.\n setSize(undefined);\n }\n }, [element]);\n\n return size;\n}\n\nexport { useSize };\n","import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useStateMachine } from './use-state-machine';\n\ninterface PresenceProps {\n children: React.ReactElement | ((props: { present: boolean }) => React.ReactElement);\n present: boolean;\n}\n\nconst Presence: React.FC<PresenceProps> = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n\n const child = (\n typeof children === 'function'\n ? children({ present: presence.isPresent })\n : React.Children.only(children)\n ) as React.ReactElement<{ ref?: React.Ref<HTMLElement> }>;\n\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;\n};\n\nPresence.displayName = 'Presence';\n\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/\n\nfunction usePresence(present: boolean) {\n const [node, setNode] = React.useState<HTMLElement>();\n const stylesRef = React.useRef<CSSStyleDeclaration | null>(null);\n const prevPresentRef = React.useRef(present);\n const prevAnimationNameRef = React.useRef<string>('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended',\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted',\n },\n unmounted: {\n MOUNT: 'mounted',\n },\n });\n\n React.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [state]);\n\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n\n if (present) {\n send('MOUNT');\n } else if (currentAnimationName === 'none' || styles?.display === 'none') {\n // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n } else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */\n const isAnimating = prevAnimationName !== currentAnimationName;\n\n if (wasPresent && isAnimating) {\n send('ANIMATION_OUT');\n } else {\n send('UNMOUNT');\n }\n }\n\n prevPresentRef.current = present;\n }\n }, [present, send]);\n\n useLayoutEffect(() => {\n if (node) {\n let timeoutId: number;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */\n const handleAnimationEnd = (event: AnimationEvent) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n // With React 18 concurrency this update is applied a frame after the\n // animation ends, creating a flash of visible content. By setting the\n // animation fill mode to \"forwards\", we force the node to keep the\n // styles of the last keyframe, removing the flash.\n //\n // Previously we flushed the update via ReactDom.flushSync, but with\n // exit animations this resulted in the node being removed from the\n // DOM before the synthetic animationEnd event was dispatched, meaning\n // user-provided event handlers would not be called.\n // https://github.com/radix-ui/primitives/pull/1849\n send('ANIMATION_END');\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = 'forwards';\n // Reset the style after the node had time to unmount (for cases\n // where the component chooses not to unmount). Doing this any\n // sooner than `setTimeout` (e.g. with `requestAnimationFrame`)\n // still causes a flash.\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === 'forwards') {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event: AnimationEvent) => {\n if (event.target === node) {\n // if animation occurred, store its name as the previous animation.\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener('animationstart', handleAnimationStart);\n node.addEventListener('animationcancel', handleAnimationEnd);\n node.addEventListener('animationend', handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener('animationstart', handleAnimationStart);\n node.removeEventListener('animationcancel', handleAnimationEnd);\n node.removeEventListener('animationend', handleAnimationEnd);\n };\n } else {\n // Transition to the unmounted state if the node is removed prematurely.\n // We avoid doing so during cleanup as the node may change but still exist.\n send('ANIMATION_END');\n }\n }, [node, send]);\n\n return {\n isPresent: ['mounted', 'unmountSuspended'].includes(state),\n ref: React.useCallback((node: HTMLElement) => {\n stylesRef.current = node ? getComputedStyle(node) : null;\n setNode(node);\n }, []),\n };\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getAnimationName(styles: CSSStyleDeclaration | null) {\n return styles?.animationName || 'none';\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement<{ ref?: React.Ref<unknown> }>) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n\n // Not DEV\n return element.props.ref || (element as any).ref;\n}\n\nconst Root = Presence;\n\nexport {\n Presence,\n //\n Root,\n};\nexport type { PresenceProps };\n","import * as React from 'react';\n\ntype Machine<S> = { [k: string]: { [k: string]: S } };\ntype MachineState<T> = keyof T;\ntype MachineEvent<T> = keyof UnionToIntersection<T[keyof T]>;\n\n// 🤯 https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine<M>(\n initialState: MachineState<M>,\n machine: M & Machine<MachineState<M>>\n) {\n return React.useReducer((state: MachineState<M>, event: MachineEvent<M>): MachineState<M> => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\n }, initialState);\n}\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createSlot } from '@radix-ui/react-slot';\n\nconst NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'select',\n 'span',\n 'svg',\n 'ul',\n] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E> };\ntype PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent<E extends React.ElementType>\n extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props: PrimitivePropsWithRef<typeof node>, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click 👎\n * target.dispatchEvent(new Event(‘click’))\n *\n * dispatching a custom type within a non-discrete event 👎\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}\n *\n * dispatching a custom type within a `discrete` event 👍\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n","import * as React from 'react';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement)\n ? (newElement.props as { children: React.ReactNode }).children\n : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nconst Slot = createSlot('Slot');\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ function createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLOTTABLE_IDENTIFIER = Symbol('radix.slottable');\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable('Slottable');\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(\n child: React.ReactNode\n): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) &&\n typeof child.type === 'function' &&\n '__radixId' in child.type &&\n child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n // all child props should override\n const overrideProps = { ...childProps };\n\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n }\n // but if it exists only on the slot, we use only this one\n else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n\n // Not DEV\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as any).ref;\n}\n\nexport {\n Slot,\n Slottable,\n //\n Slot as Root,\n};\nexport type { SlotProps };\n","import type React from 'react'\nimport { useEffect, useState } from 'react'\nimport { resolveSetState } from '@/src/utils/resolveSetState'\n\nexport const useOverwritableState = <T>(initialValue?: T, onChange?: (value: T) => void): [T, React.Dispatch<React.SetStateAction<T>>] => {\n const [state, setState] = useState<T>(initialValue)\n\n useEffect(() => {\n setState(initialValue)\n }, [initialValue])\n\n const onChangeWrapper: React.Dispatch<React.SetStateAction<T>> = (action) => {\n const resolved = resolveSetState(action, state)\n setState(resolved)\n onChange?.(state)\n }\n\n return [state, onChangeWrapper]\n}","import type { SetStateAction } from 'react'\n\nexport function resolveSetState<T>(action: SetStateAction<T>, prev: T): T {\n return typeof action === 'function' ? (action as (prev: T) => T)(prev) : action\n}","import type { Dispatch, PropsWithChildren, SetStateAction } from 'react'\nimport { createContext, useContext, useEffect, useMemo, useState } from 'react'\nimport { useLocalStorage } from '../hooks/useLocalStorage'\nimport type { Language } from './util'\nimport { LanguageUtil } from './util'\n\nexport type LanguageContextValue = {\n language: Language,\n setLanguage: Dispatch<SetStateAction<Language>>,\n}\n\nexport const LanguageContext = createContext<LanguageContextValue>({\n language: LanguageUtil.DEFAULT_LANGUAGE,\n setLanguage: (v) => v\n})\n\ntype LanguageWithSystem = Language | 'system'\n\ntype LanguageProviderProps = {\n language?: LanguageWithSystem,\n}\n\nexport const LanguageProvider = ({ children, language }: PropsWithChildren<LanguageProviderProps>) => {\n const {\n value: storedLanguage,\n setValue: setStoredLanguage,\n deleteValue: deleteStoredLanguage\n } = useLocalStorage<LanguageWithSystem>('language', 'system')\n const [languagePreference, setLanguagePreference] = useState<LanguageWithSystem>('system')\n\n const resolvedLanguage = useMemo(() => {\n if (language && language !== 'system') {\n return language\n }\n if (storedLanguage && storedLanguage !== 'system') {\n return storedLanguage\n }\n if (languagePreference !== 'system') {\n return languagePreference\n }\n return LanguageUtil.DEFAULT_LANGUAGE\n }, [language, languagePreference, storedLanguage])\n\n useEffect(() => {\n if(!language) return\n if (language === 'system') {\n deleteStoredLanguage()\n } else {\n setStoredLanguage(language)\n }\n }, [language]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n const LanguageToTestAgainst = Object.values(LanguageUtil.languages)\n\n const detectLanguage = () => {\n const matchingBrowserLanguage = window.navigator.languages\n .map(language =>\n LanguageToTestAgainst.find(\n (test) => language === test || language.split('-')[0] === test\n ))\n .filter((entry): entry is Language => entry !== undefined)\n\n if (matchingBrowserLanguage.length === 0) return\n\n const firstMatch = matchingBrowserLanguage[0]\n setLanguagePreference(firstMatch)\n }\n detectLanguage()\n\n window.addEventListener('languagechange', detectLanguage)\n return () => {\n window.removeEventListener('languagechange', detectLanguage)\n }\n }, [])\n\n return (\n <LanguageContext.Provider value={{\n language: resolvedLanguage,\n setLanguage: (newLanguage) => {\n if (language) {\n console.warn('LanguageProvider: Attempting to change the ' +\n \"language while setting a fixed language won't have any effect. \" +\n 'Change the language provided to the LanguageProvider instead.')\n }\n setStoredLanguage(newLanguage)\n }\n }}>\n {children}\n </LanguageContext.Provider>\n )\n}\n\nexport const useLanguage = () => {\n const context = useContext(LanguageContext)\n if (!context) {\n throw new Error('useLanguage must be used within LanguageContext. Try adding a LanguageProvider around your app.')\n }\n return context\n}\n\nexport const useLocale = (overWriteLanguage?: Language) => {\n const { language } = useLanguage()\n const mapping: Record<Language, string> = {\n en: 'en-US',\n de: 'de-DE'\n }\n return mapping[overWriteLanguage ?? language]\n}\n","'use client'\n\nimport type { Dispatch, SetStateAction } from 'react'\nimport { useCallback, useState } from 'react'\nimport { LocalStorageService } from '@/src/utils/storage'\nimport { resolveSetState } from '@/src/utils/resolveSetState'\n\ntype SetValue<T> = Dispatch<SetStateAction<T>>\n\ntype UseLocalStorageResult<T> = {\n value: T,\n setValue: SetValue<T>,\n deleteValue: () => void,\n}\n\n/**\n * @param key Key under which to save the data\n * @param backupValue Used if the storage is unavailable or no value is present\n *\n * The backup value will never be saved to the storage unless you explicitly\n */\nexport const useLocalStorage = <T>(key: string, backupValue: T): UseLocalStorageResult<T> => {\n const get = useCallback((): T => {\n if (typeof window === 'undefined') {\n return backupValue\n }\n const storageService = new LocalStorageService()\n try {\n const value = storageService.get<T>(key)\n return value || backupValue\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (_) {\n console.warn('useLocalStorage: Error while reading the stored value. Make sure your typing is correct.')\n storageService.delete(key)\n console.info(`useLocalStorage: deleted erroneous value for key: ${key}`)\n return backupValue\n }\n }, [backupValue, key])\n\n const [storedValue, setStoredValue] = useState<T>(get)\n\n const setValue: SetValue<T> = useCallback(action => {\n const newValue = resolveSetState(action, storedValue)\n const storageService = new LocalStorageService()\n storageService.set(key, newValue)\n\n setStoredValue(newValue)\n }, [storedValue, setStoredValue, key])\n\n const deleteValue = () => {\n const storageService = new LocalStorageService()\n storageService.delete(key)\n setStoredValue(backupValue)\n }\n\n return { value: storedValue, setValue, deleteValue }\n}","/**\n * The supported languages\n */\nconst languages = ['en', 'de'] as const\n\n/**\n * The supported languages\n */\nexport type Language = typeof languages[number]\n\n/**\n * The supported languages' names in their respective language\n */\nconst languagesLocalNames: Record<Language, string> = {\n en: 'English',\n de: 'Deutsch',\n}\n\n/**\n * The default language\n */\nconst DEFAULT_LANGUAGE: Language = 'en'\n\n/**\n * A constant definition for holding data regarding languages\n */\nexport const LanguageUtil = {\n languages,\n DEFAULT_LANGUAGE,\n languagesLocalNames,\n}","import { useLanguage } from './LanguageProvider'\nimport type { Language } from './util'\n\n/**\n * A type describing the pluralization of a word\n */\nexport type TranslationPlural = {\n zero?: string,\n one?: string,\n two?: string,\n few?: string,\n many?: string,\n other: string,\n}\n\n/**\n * The type describing all values of a translation\n */\nexport type TranslationType = Record<string, string | TranslationPlural>\n\n/**\n * The type of translations\n */\nexport type Translation<T extends TranslationType> = Record<Language, T>\n\ntype OverwriteTranslationType<T extends TranslationType> = {\n language?: Language,\n translation?: Translation<Partial<T>>,\n}\n\n/**\n * Adds the `language` prop to the component props.\n *\n * @param Translation the type of the translation object\n *\n * @param Props the type of the component props, defaults to `Record<string, never>`,\n * if you don't expect any other props other than `language` and get an\n * error when using your component (because it uses `forwardRef` etc.)\n * you can try out `Record<string, unknown>`, this might resolve your\n * problem as `SomeType & never` is still `never` but `SomeType & unknown`\n * is `SomeType` which means that adding back props (like `ref` etc.)\n * works properly\n */\nexport type PropsForTranslation<\n Translation extends TranslationType,\n Props = unknown\n> = Props & {\n overwriteTranslation?: OverwriteTranslationType<Translation>,\n}\n\ntype StringKeys<T> = Extract<keyof T, string>;\n\ntype TranslationFunctionOptions = {\n replacements?: Record<string, string>,\n count?: number,\n}\ntype TranslationFunction<T extends TranslationType> = (key: StringKeys<T>, options?: TranslationFunctionOptions) => string\n\nexport const TranslationPluralCount = {\n zero: 0,\n one: 1,\n two: 2,\n few: 3,\n many: 11,\n other: -1,\n}\n\n\nexport const useTranslation = <T extends TranslationType>(\n translations: Translation<Partial<TranslationType>>[],\n overwriteTranslation: OverwriteTranslationType<T> = {}\n): TranslationFunction<T> => {\n const { language: languageProp, translation: overwrite } = overwriteTranslation\n const { language: inferredLanguage } = useLanguage()\n const usedLanguage = languageProp ?? inferredLanguage\n const usedTranslations = [...translations]\n if (overwrite) {\n usedTranslations.push(overwrite)\n }\n\n return (key: StringKeys<T>, options?: TranslationFunctionOptions): string => {\n const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options }\n\n try {\n for (let i = translations.length - 1; i >= 0; i--) {\n const translation = translations[i]\n const localizedTranslation = translation[usedLanguage]\n if (!localizedTranslation) {\n continue\n }\n const value = localizedTranslation[key]\n if(!value) {\n continue\n }\n\n let forProcessing: string\n if (typeof value !== 'string') {\n if (count === TranslationPluralCount.zero && value?.zero) {\n forProcessing = value.zero\n } else if (count === TranslationPluralCount.one && value?.one) {\n forProcessing = value.one\n } else if (count === TranslationPluralCount.two && value?.two) {\n forProcessing = value.two\n } else if (TranslationPluralCount.few <= count && count < TranslationPluralCount.many && value?.few) {\n forProcessing = value.few\n } else if (count > TranslationPluralCount.many && value?.many) {\n forProcessing = value.many\n } else {\n forProcessing = value.other\n }\n } else {\n forProcessing = value\n }\n forProcessing = forProcessing.replace(/\\{\\{(\\w+)}}/g, (_, placeholder) => {\n return replacements[placeholder] ?? `{{key:${placeholder}}}` // fallback if key is missing\n })\n return forProcessing\n }\n } catch (e) {\n console.error(e)\n }\n return `{{${usedLanguage}:${key}}}`\n }\n}","import type { ReactNode } from 'react'\nimport { AlertTriangle } from 'lucide-react'\nimport clsx from 'clsx'\nimport { TextButton } from '../user-action/Button'\nimport type { PropsForTranslation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport type { FormTranslationType } from '../../localization/defaults/form'\nimport { formTranslation } from '../../localization/defaults/form'\n\ntype PropertyBaseTranslation = FormTranslationType\n\nexport type PropertyBaseProps = {\n name: string,\n input: (props: { softRequired: boolean, hasValue: boolean }) => ReactNode,\n onRemove?: () => void,\n hasValue: boolean,\n softRequired?: boolean,\n readOnly?: boolean,\n icon?: ReactNode,\n className?: string,\n}\n\n/**\n * A component for showing a properties with uniform styling\n */\nexport const PropertyBase = ({\n overwriteTranslation,\n name,\n input,\n softRequired = false,\n hasValue,\n icon,\n readOnly,\n onRemove,\n className = '',\n }: PropsForTranslation<PropertyBaseTranslation, PropertyBaseProps>) => {\n const translation = useTranslation([formTranslation], overwriteTranslation)\n const requiredAndNoValue = softRequired && !hasValue\n return (\n <div className={clsx('flex-row-0 group', className)}>\n <div\n className={clsx(\n 'flex-row-2 max-w-48 min-w-48 px-3 py-2 items-center rounded-l-xl border-2 border-r-0', {\n 'bg-property-title-background text-property-title-text group-hover:border-primary': !requiredAndNoValue,\n 'bg-warning text-surface-warning group-hover:border-warning border-warning/90': requiredAndNoValue,\n }, className\n )}\n >\n <div className=\"max-w-6 min-w-6 text-text-primary\">{icon}</div>\n <span className=\"font-semibold\">{name}</span>\n </div>\n <div\n className={clsx(\n 'flex-row-2 grow px-3 py-2 justify-between items-center rounded-r-xl border-2 border-l-0 min-h-15', {\n 'bg-input-background text-input-text group-hover:border-primary': !requiredAndNoValue,\n 'bg-surface-warning group-hover:border-warning border-warning/90': requiredAndNoValue,\n }, className\n )}\n >\n {input({ softRequired, hasValue })}\n {requiredAndNoValue && (\n <div className=\"text-warning\"><AlertTriangle size={24}/></div>\n )}\n {onRemove && !readOnly && (\n <TextButton\n onClick={onRemove}\n color=\"negative\"\n className={clsx('items-center')}\n disabled={!hasValue}\n >\n {translation('remove')}\n </TextButton>\n )}\n </div>\n </div>\n )\n}\n","import type { ButtonHTMLAttributes, ReactNode } from 'react'\nimport { forwardRef } from 'react'\nimport clsx from 'clsx'\n\n\nexport const ButtonColorUtil = {\n solid: ['primary', 'secondary', 'tertiary', 'positive', 'warning', 'negative', 'neutral'] as const,\n text: ['primary', 'negative', 'neutral'] as const,\n outline: ['primary'] as const,\n}\n\nexport const IconButtonUtil = {\n icon: [...ButtonColorUtil.solid, 'transparent'] as const,\n}\n\n\n/**\n * The allowed colors for the SolidButton and IconButton\n */\nexport type SolidButtonColor = typeof ButtonColorUtil.solid[number]\n/**\n * The allowed colors for the OutlineButton\n */\nexport type OutlineButtonColor = typeof ButtonColorUtil.outline[number]\n/**\n * The allowed colors for the TextButton\n */\nexport type TextButtonColor = typeof ButtonColorUtil.text[number]\n/**\n * The allowed colors for the IconButton\n */\nexport type IconButtonColor = typeof IconButtonUtil.icon[number]\n\n\n/**\n * The different sizes for a button\n */\ntype ButtonSizes = 'small' | 'medium' | 'large' | 'none'\n\ntype IconButtonSize = 'tiny' | 'small' | 'medium' | 'large' | 'none'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}\n\nconst paddingMapping: Record<ButtonSizes, string> = {\n none: '',\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\nconst iconPaddingMapping: Record<IconButtonSize, string> = {\n none: '',\n tiny: 'icon-btn-xs',\n small: 'icon-btn-sm',\n medium: 'icon-btn-md',\n large: 'icon-btn-lg'\n}\n\nexport const ButtonUtil = {\n paddingMapping,\n iconPaddingMapping\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n coloredHoverBackground?: boolean,\n}\n\n/**\n * The shard properties between all button types\n */\nexport type IconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n /**\n * @default 'medium'\n */\n size?: IconButtonSize,\n color?: IconButtonColor,\n}\n\n/**\n * A button with a solid background and different sizes\n */\nexport const SolidButton = forwardRef<HTMLButtonElement, SolidButtonProps>(function SolidButton({\n children,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }, ref) {\n const colorClasses = {\n primary: 'not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text',\n secondary: 'not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text',\n tertiary: 'not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text',\n positive: 'not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text',\n warning: 'not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text',\n negative: 'not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text',\n neutral: 'not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-solid-primary-icon',\n secondary: 'not-group-disabled:text-button-solid-secondary-icon',\n tertiary: 'not-group-disabled:text-button-solid-tertiary-icon',\n positive: 'not-group-disabled:text-button-solid-positive-icon',\n warning: 'not-group-disabled:text-button-solid-warning-icon',\n negative: 'not-group-disabled:text-button-solid-negative-icon',\n neutral: 'not-group-disabled:text-button-solid-neutral-icon',\n }[color]\n\n return (\n <button\n ref={ref}\n onClick={onClick}\n className={clsx(\n 'group font-semibold',\n colorClasses,\n 'not-disabled:hover:brightness-90',\n 'disabled:text-disabled disabled:bg-disabled-background',\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n})\n\n/**\n * A button with an outline border and different sizes\n */\nexport const OutlineButton = ({\n children,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:border-button-outline-primary-text not-disabled:text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={onClick}\n className={clsx(\n 'group font-semibold bg-transparent border-2 ',\n 'not-disabled:hover:brightness-80',\n colorClasses,\n 'disabled:text-disabled disabled:border-disabled-outline',\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nexport const TextButton = ({\n children,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n coloredHoverBackground = true,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:bg-transparent not-disabled:text-button-text-primary-text not-disabled:focus-visible:outline-button-text-primary-text',\n negative: 'not-disabled:bg-transparent not-disabled:text-button-text-negative-text not-disabled:focus-visible:outline-button-text-negative-text',\n neutral: 'not-disabled:bg-transparent not-disabled:text-button-text-neutral-text not-disabled:focus-visible:outline-button-text-neutral-text',\n }[color]\n\n const backgroundColor = {\n primary: 'not-disabled:hover:bg-button-text-primary-text/20 not-disabled:focus-visible:bg-button-text-primary-text/20',\n negative: 'not-disabled:hover:bg-button-text-negative-text/20 not-disabled:focus-visible:bg-button-text-negative-text/20',\n neutral: 'not-disabled:hover:bg-button-text-neutral-text/20 not-disabled:focus-visible:bg-button-text-neutral-text/20',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-text-primary-icon',\n negative: 'not-group-disabled:text-button-text-negative-icon',\n neutral: 'not-group-disabled:text-button-text-neutral-icon',\n }[color]\n\n return (\n <button\n onClick={onClick}\n className={clsx(\n 'group font-semibold',\n 'disabled:text-disabled',\n colorClasses,\n {\n [backgroundColor]: coloredHoverBackground,\n 'not-disabled:hover:bg-button-text-hover-background': !coloredHoverBackground,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n\n/**\n * A button for icons with a solid background and different sizes\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton({\n children,\n color = 'primary',\n size = 'medium',\n className,\n ...restProps\n }, ref)\n{\n const colorClasses = {\n primary: 'not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text',\n secondary: 'not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text',\n tertiary: 'not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text',\n positive: 'not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text',\n warning: 'not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text',\n negative: 'not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text',\n neutral: 'not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text',\n transparent: 'not-disabled:bg-transparent',\n }[color]\n\n return (\n <button\n ref={ref}\n className={clsx(\n colorClasses,\n 'not-disabled:hover:brightness-90',\n 'disabled:text-disabled',\n {\n 'disabled:bg-disabled-background': color !== 'transparent',\n 'disabled:opacity-70': color === 'transparent',\n 'not-disabled:hover:bg-button-text-hover-background': color === 'transparent',\n },\n ButtonUtil.iconPaddingMapping[size],\n className\n )}\n {...restProps}\n >\n {children}\n </button>\n )\n})","import type { Translation } from '../useTranslation'\n\nexport type FormTranslationType = {\n add: string,\n all: string,\n apply: string,\n back: string,\n cancel: string,\n change: string,\n clear: string,\n click: string,\n clickToCopy: string,\n close: string,\n confirm: string,\n copy: string,\n copied: string,\n create: string,\n decline: string,\n delete: string,\n discard: string,\n discardChanges: string,\n done: string,\n edit: string,\n enterText: string,\n error: string,\n exit: string,\n fieldRequiredError: string,\n invalidEmailError: string,\n less: string,\n loading: string,\n maxLengthError: string,\n minLengthError: string,\n more: string,\n next: string,\n no: string,\n none: string,\n nothingFound: string,\n of: string,\n optional: string,\n pleaseWait: string,\n previous: string,\n remove: string,\n required: string,\n reset: string,\n save: string,\n saved: string,\n search: string,\n select: string,\n selectOption: string,\n show: string,\n showMore: string,\n showLess: string,\n submit: string,\n success: string,\n unsavedChanges: string,\n unsavedChangesSaveQuestion: string,\n update: string,\n yes: string,\n}\n\nexport const formTranslation: Translation<FormTranslationType> = {\n en: {\n add: 'Add',\n all: 'All',\n apply: 'Apply',\n back: 'Back',\n cancel: 'Cancel',\n change: 'Change',\n clear: 'Clear',\n click: 'Click',\n clickToCopy: 'Click to Copy',\n close: 'Close',\n confirm: 'Confirm',\n copy: 'Copy',\n copied: 'Copied',\n create: 'Create',\n decline: 'Decline',\n delete: 'Delete',\n discard: 'Discard',\n discardChanges: 'Discard Changes',\n done: 'Done',\n edit: 'Edit',\n enterText: 'Enter text here',\n error: 'Error',\n exit: 'Exit',\n fieldRequiredError: 'This field is required.',\n invalidEmailError: 'Please enter a valid email address.',\n less: 'Less',\n loading: 'Loading',\n maxLengthError: 'Maximum length exceeded.',\n minLengthError: 'Minimum length not met.',\n more: 'More',\n next: 'Next',\n no: 'No',\n none: 'None',\n nothingFound: 'Nothing found',\n of: 'of',\n optional: 'Optional',\n pleaseWait: 'Please wait...',\n previous: 'Previous',\n remove: 'Remove',\n required: 'Required',\n reset: 'Reset',\n save: 'Save',\n saved: 'Saved',\n search: 'Search',\n select: 'Select',\n selectOption: 'Select an option',\n show: 'Show',\n showMore: 'Show more',\n showLess: 'Show less',\n submit: 'Submit',\n success: 'Success',\n update: 'Update',\n unsavedChanges: 'Unsaved Changes',\n unsavedChangesSaveQuestion: 'Do you want to save your changes?',\n yes: 'Yes',\n },\n de: {\n add: 'Hinzufügen',\n all: 'Alle',\n apply: 'Anwenden',\n back: 'Zurück',\n cancel: 'Abbrechen',\n change: 'Ändern',\n clear: 'Löschen',\n click: 'Klicken',\n clickToCopy: 'Zum kopieren klicken',\n close: 'Schließen',\n confirm: 'Bestätigen',\n copy: 'Kopieren',\n copied: 'Kopiert',\n create: 'Erstellen',\n decline: 'Ablehnen',\n delete: 'Löschen',\n discard: 'Verwerfen',\n discardChanges: 'Änderungen Verwerfen',\n done: 'Fertig',\n edit: 'Bearbeiten',\n enterText: 'Text hier eingeben',\n error: 'Fehler',\n exit: 'Beenden',\n fieldRequiredError: 'Dieses Feld ist erforderlich.',\n invalidEmailError: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',\n less: 'Weniger',\n loading: 'Lädt',\n maxLengthError: 'Maximale Länge überschritten.',\n minLengthError: 'Mindestlänge nicht erreicht.',\n more: 'Mehr',\n next: 'Weiter',\n no: 'Nein',\n none: 'Nichts',\n nothingFound: 'Nichts gefunden',\n of: 'von',\n optional: 'Optional',\n pleaseWait: 'Bitte warten...',\n previous: 'Vorherige',\n remove: 'Entfernen',\n required: 'Erforderlich',\n reset: 'Zurücksetzen',\n save: 'Speichern',\n saved: 'Gespeichert',\n search: 'Suche',\n select: 'Select',\n selectOption: 'Option auswählen',\n show: 'Anzeigen',\n showMore: 'Mehr anzeigen',\n showLess: 'Weniger anzeigen',\n submit: 'Abschicken',\n success: 'Erfolg',\n update: 'Update',\n unsavedChanges: 'Ungespeicherte Änderungen',\n unsavedChangesSaveQuestion: 'Möchtest du die Änderungen speichern?',\n yes: 'Ja',\n }\n}\n","import clsx from 'clsx'\nimport type { LabelHTMLAttributes } from 'react'\n\nexport type LabelType = 'md' | 'lg'\n\nconst styleMapping: Record<LabelType, string> = {\n md: 'typography-label-md color-label-text',\n lg: 'typography-label-lg color-label-text',\n}\n\nexport type LabelProps = LabelHTMLAttributes<HTMLLabelElement> & {\n /** The size of the label */\n size?: LabelType,\n}\n\n/**\n * A Label component\n */\nexport const Label = ({\n children,\n size = 'md',\n className,\n ...props\n }: LabelProps) => {\n return (\n <label {...props} className={clsx(styleMapping[size], className)}>\n {children}\n </label>\n )\n}\n","import { CalendarDays } from 'lucide-react'\nimport clsx from 'clsx'\nimport { formatDate, formatDateTime } from '@/src/utils/date'\nimport { Input } from '../user-action/input/Input'\nimport type { PropertyBaseProps } from './PropertyBase'\nimport { PropertyBase } from './PropertyBase'\n\nexport type DatePropertyProps = Omit<PropertyBaseProps, 'icon' | 'input' | 'hasValue'> & {\n value?: Date,\n onChange?: (date: Date) => void,\n onEditComplete?: (value: Date) => void,\n type?: 'dateTime' | 'date',\n}\n\n/**\n * An Input for date properties\n */\nexport const DateProperty = ({\n value,\n onChange,\n onEditComplete,\n readOnly,\n type = 'dateTime',\n ...baseProps\n }: DatePropertyProps) => {\n const hasValue = !!value\n\n const dateText = value ? (type === 'dateTime' ? formatDateTime(value) : formatDate(value)) : ''\n return (\n <PropertyBase\n {...baseProps}\n hasValue={hasValue}\n icon={<CalendarDays size={24}/>}\n input={({ softRequired }) => (\n <Input\n className={clsx('!ring-0 !border-0 !outline-0 !p-0 !m-0 !shadow-none !w-fit !rounded-none', { 'bg-surface-warning': softRequired && !hasValue })}\n value={dateText}\n type={type === 'dateTime' ? 'datetime-local' : 'date'}\n readOnly={readOnly}\n onChange={(event) => {\n const value = event.target.value\n if (!value) {\n event.preventDefault()\n return\n }\n const dueDate = new Date(value)\n onChange?.(dueDate)\n }}\n onEditCompleted={(value) => onEditComplete?.(new Date(value))}\n />\n )}\n />\n )\n}\n","import { equalSizeGroups } from './array'\n\nexport const monthsList = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'] as const\nexport type Month = typeof monthsList[number]\n\nexport const weekDayList = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] as const\nexport type WeekDay = typeof weekDayList[number]\n\nexport const formatDate = (date: Date) => {\n const year = date.getFullYear().toString().padStart(4, '0')\n const month = (date.getMonth() + 1).toString().padStart(2, '0')\n const day = (date.getDate()).toString().padStart(2, '0')\n return `${year}-${month}-${day}`\n}\n\nexport const formatDateTime = (date: Date) => {\n const dateString = formatDate(date)\n const hours = date.getHours().toString().padStart(2, '0')\n const minutes = date.getMinutes().toString().padStart(2, '0')\n return `${dateString}T${hours}:${minutes}`\n}\n\nexport const getDaysInMonth = (year: number, month: number): number => {\n const lastDayOfMonth = new Date(year, month + 1, 0)\n return lastDayOfMonth.getDate()\n}\n\nexport type Duration = {\n years?: number,\n months?: number,\n days?: number,\n hours?: number,\n minutes?: number,\n seconds?: number,\n milliseconds?: number,\n}\n\nexport const changeDuration = (date: Date, duration: Duration, isAdding?: boolean): Date => {\n const {\n years = 0,\n months = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n milliseconds = 0,\n } = duration\n\n // Check ranges\n if (years < 0) {\n console.error(`Range error years must be greater than 0: received ${years}`)\n return new Date(date)\n }\n if (months < 0 || months > 11) {\n console.error(`Range error month must be 0 <= month <= 11: received ${months}`)\n return new Date(date)\n }\n if (days < 0) {\n console.error(`Range error days must be greater than 0: received ${days}`)\n return new Date(date)\n }\n if (hours < 0 || hours > 23) {\n console.error(`Range error hours must be 0 <= hours <= 23: received ${hours}`)\n return new Date(date)\n }\n if (minutes < 0 || minutes > 59) {\n console.error(`Range error minutes must be 0 <= minutes <= 59: received ${minutes}`)\n return new Date(date)\n }\n if (seconds < 0 || seconds > 59) {\n console.error(`Range error seconds must be 0 <= seconds <= 59: received ${seconds}`)\n return new Date(date)\n }\n if (milliseconds < 0) {\n console.error(`Range error seconds must be greater than 0: received ${milliseconds}`)\n return new Date(date)\n }\n\n const multiplier = isAdding ? 1 : -1\n\n const newDate = new Date(date)\n\n newDate.setFullYear(newDate.getFullYear() + multiplier * years)\n\n newDate.setMonth(newDate.getMonth() + multiplier * months)\n\n newDate.setDate(newDate.getDate() + multiplier * days)\n\n newDate.setHours(newDate.getHours() + multiplier * hours)\n\n newDate.setMinutes(newDate.getMinutes() + multiplier * minutes)\n\n newDate.setSeconds(newDate.getSeconds() + multiplier * seconds)\n\n newDate.setMilliseconds(newDate.getMilliseconds() + multiplier * milliseconds)\n\n return newDate\n}\n\nexport const addDuration = (date: Date, duration: Duration): Date => {\n return changeDuration(date, duration, true)\n}\n\nexport const subtractDuration = (date: Date, duration: Duration): Date => {\n return changeDuration(date, duration, false)\n}\n\nexport const getBetweenDuration = (startDate: Date, endDate: Date): Duration => {\n const durationInMilliseconds = endDate.getTime() - startDate.getTime()\n\n const millisecondsInSecond = 1000\n const millisecondsInMinute = 60 * millisecondsInSecond\n const millisecondsInHour = 60 * millisecondsInMinute\n const millisecondsInDay = 24 * millisecondsInHour\n const millisecondsInMonth = 30 * millisecondsInDay // Rough estimation, can be adjusted\n\n const years = Math.floor(durationInMilliseconds / (365.25 * millisecondsInDay))\n const months = Math.floor(durationInMilliseconds / millisecondsInMonth)\n const days = Math.floor(durationInMilliseconds / millisecondsInDay)\n const hours = Math.floor((durationInMilliseconds % millisecondsInDay) / millisecondsInHour)\n const seconds = Math.floor((durationInMilliseconds % millisecondsInHour) / millisecondsInSecond)\n const milliseconds = durationInMilliseconds % millisecondsInSecond\n\n return {\n years,\n months,\n days,\n hours,\n seconds,\n milliseconds,\n }\n}\n\n/** Checks if a given date is in the range of two dates\n *\n * An undefined value for startDate or endDate means no bound for the start or end respectively\n */\nexport const isInTimeSpan = (value: Date, startDate?: Date, endDate?: Date): boolean => {\n if (startDate && endDate) {\n console.assert(startDate <= endDate)\n return startDate <= value && value <= endDate\n } else if (startDate) {\n return startDate <= value\n } else if (endDate) {\n return endDate >= value\n } else {\n return true\n }\n}\n\n/** Compare two dates on the year, month, day */\nexport const equalDate = (date1: Date, date2: Date) => {\n return date1.getFullYear() === date2.getFullYear()\n && date1.getMonth() === date2.getMonth()\n && date1.getDate() === date2.getDate()\n}\n\nexport const getWeeksForCalenderMonth = (date: Date, weekStart: WeekDay, weeks: number = 6) => {\n const month = date.getMonth()\n const year = date.getFullYear()\n\n const dayList: Date[] = []\n let currentDate = new Date(year, month, 1) // Start of month\n const weekStartIndex = weekDayList.indexOf(weekStart)\n\n // Move the current day to the week before\n while (currentDate.getDay() !== weekStartIndex) {\n currentDate = subtractDuration(currentDate, { days: 1 })\n }\n\n while (dayList.length < 7 * weeks) {\n const date = new Date(currentDate)\n date.setHours(date.getHours(), date.getMinutes()) // To make sure we are not overwriting the time\n dayList.push(date)\n currentDate = addDuration(currentDate, { days: 1 })\n }\n\n // weeks\n return equalSizeGroups(dayList, 7)\n}\n","import type { InputHTMLAttributes } from 'react'\nimport React, { forwardRef, useImperativeHandle, useRef } from 'react'\nimport clsx from 'clsx'\nimport type { UseDelayOptionsResolved } from '@/src/hooks/useDelay'\nimport { useDelay } from '@/src/hooks/useDelay'\nimport { useFocusManagement } from '@/src/hooks/focus/useFocusManagement'\nimport { useOverwritableState } from '@/src/hooks/useOverwritableState'\n\nexport type EditCompleteOptionsResolved = {\n onBlur: boolean,\n afterDelay: boolean,\n allowEnterComplete?: boolean,\n} & Omit<UseDelayOptionsResolved, 'disabled'>\n\nexport type EditCompleteOptions = Partial<EditCompleteOptionsResolved>\n\nconst defaultEditCompleteOptions: EditCompleteOptionsResolved = {\n allowEnterComplete: false,\n onBlur: true,\n afterDelay: true,\n delay: 2500\n}\n\nexport type InputProps = InputHTMLAttributes<HTMLInputElement> & {\n invalid?: boolean,\n onChangeText?: (text: string) => void,\n onEditCompleted?: (text: string) => void,\n editCompleteOptions?: EditCompleteOptions,\n defaultStyle?: boolean,\n}\n\n/**\n * A Component for inputting text or other information\n *\n * Its state is managed must be managed by the parent\n */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input({\n value,\n onChange,\n onChangeText,\n onEditCompleted,\n editCompleteOptions,\n disabled = false,\n invalid = false,\n defaultStyle = true,\n className,\n ...props\n }, forwardedRef) {\n const {\n onBlur: allowEditCompleteOnBlur,\n afterDelay,\n delay,\n allowEnterComplete\n } = { ...defaultEditCompleteOptions, ...editCompleteOptions }\n\n const {\n restartTimer,\n clearTimer\n } = useDelay({ delay, disabled: !afterDelay })\n\n const innerRef = useRef<HTMLInputElement>(null)\n useImperativeHandle(forwardedRef, () => innerRef.current)\n\n const { focusNext } = useFocusManagement()\n\n return (\n <input\n {...props}\n ref={innerRef}\n value={value}\n disabled={disabled}\n className={defaultStyle ? clsx(\n 'px-3 py-2 rounded-md text-sm h-10 border-2 border-transparent focus-style-none',\n {\n 'bg-input-background text-input-text hover:border-primary focus:border-primary': !disabled && !invalid,\n 'bg-negative/20 text-negative hover:border-negative focus-visible:border-negative': !disabled && invalid,\n 'bg-disabled-background text-disabled border-disabled-border': disabled,\n }, className\n ) : className}\n onKeyDown={event => {\n props.onKeyDown?.(event)\n if (!allowEnterComplete) {\n return\n }\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault()\n innerRef.current?.blur()\n onEditCompleted?.((event.target as HTMLInputElement).value)\n focusNext()\n }\n }}\n onBlur={event => {\n props.onBlur?.(event)\n if (allowEditCompleteOnBlur) {\n onEditCompleted?.(event.target.value)\n clearTimer()\n }\n }}\n onChange={event => {\n onChange?.(event)\n const value = event.target.value\n restartTimer(() => {\n innerRef.current?.blur()\n onEditCompleted?.(value)\n })\n onChangeText?.(value)\n }}\n\n aria-invalid={props['aria-invalid'] ?? invalid}\n aria-disabled={props['aria-disabled'] ?? disabled}\n />\n )\n})\n\n\n/**\n * A Component for inputting text or other information\n *\n * Its state is managed by the component itself\n */\nexport const InputUncontrolled = ({\n value = '',\n onChangeText,\n ...props\n }: InputProps) => {\n const [usedValue, setUsedValue] = useOverwritableState(value, onChangeText)\n\n return (\n <Input\n {...props}\n value={usedValue}\n onChangeText={setUsedValue}\n />\n )\n}\n","import { useEffect, useState } from 'react'\n\nexport type UseDelayOptionsResolved = {\n delay: number,\n disabled: boolean,\n}\n\nexport type UseDelayOptions = Partial<UseDelayOptionsResolved>\n\nconst defaultOptions: UseDelayOptionsResolved = {\n delay: 3000,\n disabled: false,\n}\n\nexport function useDelay(options?: UseDelayOptions) {\n const [timer, setTimer] = useState<NodeJS.Timeout | undefined>(undefined)\n const { delay, disabled }: UseDelayOptionsResolved = {\n ...defaultOptions,\n ...options\n }\n\n const clearTimer = () => {\n clearTimeout(timer)\n setTimer(undefined)\n }\n\n const restartTimer = (onDelayFinish: () => void) => {\n if(disabled) {\n return\n }\n clearTimeout(timer)\n setTimer(setTimeout(() => {\n onDelayFinish()\n setTimer(undefined)\n }, delay))\n }\n\n useEffect(() => {\n return () => {\n clearTimeout(timer)\n }\n }, [timer])\n\n useEffect(() => {\n if(disabled){\n clearTimeout(timer)\n setTimer(undefined)\n }\n }, [disabled, timer])\n\n return { restartTimer, clearTimer, hasActiveTimer: !!timer }\n}","import { useCallback } from 'react'\n\nexport function useFocusManagement() {\n const getFocusableElements = useCallback((): HTMLElement[] => {\n return Array.from(\n document.querySelectorAll(\n 'input, button, select, textarea, a[href], [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter(\n (el): el is HTMLElement =>\n el instanceof HTMLElement &&\n !el.hasAttribute('disabled') &&\n !el.hasAttribute('hidden') &&\n el.tabIndex !== -1\n )\n }, [])\n\n const getNextFocusElement = useCallback((): HTMLElement | undefined => {\n const elements = getFocusableElements()\n if(elements.length === 0) {\n return undefined\n }\n let nextElement = elements[0]\n if(document.activeElement instanceof HTMLElement) {\n const currentIndex = elements.indexOf(document.activeElement)\n nextElement = elements[(currentIndex + 1) % elements.length]\n }\n return nextElement\n }, [getFocusableElements])\n\n const focusNext = useCallback(() => {\n const nextElement = getNextFocusElement()\n nextElement?.focus()\n }, [getNextFocusElement])\n\n const getPreviousFocusElement = useCallback((): HTMLElement | undefined => {\n const elements = getFocusableElements()\n if(elements.length === 0) {\n return undefined\n }\n let previousElement = elements[0]\n if(document.activeElement instanceof HTMLElement) {\n const currentIndex = elements.indexOf(document.activeElement)\n if(currentIndex === 0) {\n previousElement = elements[elements.length - 1]\n } else {\n previousElement = elements[currentIndex - 1]\n }\n }\n return previousElement\n }, [getFocusableElements])\n\n const focusPrevious = useCallback(() => {\n const previousElement = getPreviousFocusElement()\n if (previousElement) previousElement.focus()\n }, [getPreviousFocusElement])\n\n return {\n getFocusableElements,\n getNextFocusElement,\n getPreviousFocusElement,\n focusNext,\n focusPrevious,\n }\n}","import { List } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { PropsWithChildren } from 'react'\nimport type { FormTranslationType } from '@/src/localization/defaults/form'\nimport type { PropertyBaseProps } from '@/src/components/properties/PropertyBase'\nimport { PropertyBase } from '@/src/components/properties/PropertyBase'\nimport type { PropsForTranslation } from '@/src/localization/useTranslation'\nimport { MultiSelectChipDisplay } from '@/src/components/user-action/select/Select'\n\ntype TranslationType = FormTranslationType\n\nexport type MultiSelectPropertyProps = Omit<PropertyBaseProps, 'icon' | 'input' | 'hasValue' | 'className'> & PropsWithChildren<{\n values: string[],\n onValuesChanged?: (value: string[]) => void,\n}>\n\n/**\n * An Input for MultiSelect properties\n */\nexport const MultiSelectProperty = ({\n children,\n values,\n onValuesChanged,\n ...props\n }: PropsForTranslation<TranslationType, MultiSelectPropertyProps>) => {\n const hasValue = values.length > 0\n\n return (\n <PropertyBase\n {...props}\n hasValue={hasValue}\n icon={<List size={24}/>}\n input={({ softRequired }) => (\n <MultiSelectChipDisplay\n values={values}\n onValuesChanged={onValuesChanged}\n disabled={props.readOnly}\n contentPanelProps={{\n className: clsx(\n '!border-none !min-h-10'\n )\n }}\n chipDisplayProps={{\n className: clsx({\n '!bg-warning !text-surface-warning': softRequired && !hasValue,\n })\n }}\n >\n {children}\n </MultiSelectChipDisplay>\n )}\n />\n )\n}\n","import type {\n ButtonHTMLAttributes,\n HTMLAttributes,\n PropsWithChildren,\n ReactNode } from 'react'\nimport React, {\n createContext,\n forwardRef,\n Fragment,\n useCallback,\n useContext,\n useEffect,\n useId,\n useImperativeHandle,\n useRef,\n useState\n} from 'react'\nimport clsx from 'clsx'\nimport type { Translation } from '@/src/localization/useTranslation'\nimport { useTranslation } from '@/src/localization/useTranslation'\nimport { ExpansionIcon } from '@/src/components/layout/Expandable'\nimport { useFocusTrap } from '@/src/hooks/focus/useFocusTrap'\nimport { match } from '@/src/utils/match'\nimport { CheckIcon, Plus, XIcon } from 'lucide-react'\nimport { Chip } from '@/src/components/layout/Chip'\nimport { IconButton, TextButton } from '@/src/components/user-action/Button'\nimport type { UseFloatingElementOptions } from '@/src/hooks/useFloatingElement'\nimport { useFloatingElement } from '@/src/hooks/useFloatingElement'\nimport { createPortal } from 'react-dom'\nimport { useOverwritableState } from '@/src/hooks/useOverwritableState'\n\n//\n// Context\n//\ntype RegisteredOption = {\n value: string,\n label: ReactNode,\n disabled: boolean,\n ref: React.RefObject<HTMLLIElement>,\n}\n\ntype HighlightPosition = 'first' | 'last'\ntype SelectIconAppearance = 'left' | 'right' | 'none'\n\ntype InternalSelectContextState = {\n isOpen: boolean,\n highlightedValue?: string,\n}\n\ntype SelectContextState = InternalSelectContextState & {\n id: string,\n value: string[],\n options: RegisteredOption[],\n selectedOptions: RegisteredOption[],\n disabled: boolean,\n invalid: boolean,\n}\n\ntype SelectConfiguration = {\n isMultiSelect: boolean,\n iconAppearance: SelectIconAppearance,\n}\n\ntype ToggleOpenOptions = {\n highlightStartPosition?: HighlightPosition,\n}\n\nconst defaultToggleOpenOptions: ToggleOpenOptions = {\n highlightStartPosition: 'first',\n}\n\ntype SelectContextType = {\n state: SelectContextState,\n config: SelectConfiguration,\n item: {\n register: (item: RegisteredOption) => void,\n unregister: (value: string) => void,\n toggleSelection: (value: string, isSelected?: boolean) => void,\n highlightItem: (value: string) => void,\n moveHighlightedIndex: (delta: number) => void,\n },\n trigger: {\n ref: React.RefObject<HTMLElement>,\n register: (element: React.RefObject<HTMLElement>) => void,\n unregister: () => void,\n toggleOpen: (isOpen?: boolean, options?: ToggleOpenOptions) => void,\n },\n}\n\nconst SelectContext = createContext<SelectContextType | null>(null)\n\nfunction useSelectContext() {\n const ctx = useContext(SelectContext)\n if (!ctx) {\n throw new Error('SelectContext must be used within a ListBoxPrimitive')\n }\n return ctx\n}\n\n\n//\n// SelectRoot\n//\nexport type SelectRootProps = PropsWithChildren<{\n id?: string,\n value?: string,\n onValueChanged?: (value: string) => void,\n values?: string[],\n onValuesChanged?: (value: string[]) => void,\n isOpen?: boolean,\n disabled?: boolean,\n invalid?: boolean,\n isMultiSelect?: boolean,\n iconAppearance?: SelectIconAppearance,\n}>\n\nexport const SelectRoot = ({\n children,\n id,\n value,\n onValueChanged,\n values,\n onValuesChanged,\n isOpen = false,\n disabled = false,\n invalid = false,\n isMultiSelect = false,\n iconAppearance = 'left',\n }: SelectRootProps) => {\n const [options, setOptions] = useState<RegisteredOption[]>([])\n const triggerRef = useRef<HTMLElement>(null)\n const generatedId = useId()\n const usedId = id ?? generatedId\n\n const [internalState, setInternalState] = useState<InternalSelectContextState>({\n isOpen,\n })\n\n const selectedValues = isMultiSelect ? (values ?? []) : [value].filter(Boolean)\n const state: SelectContextState = {\n ...internalState,\n id: usedId,\n disabled,\n invalid,\n value: selectedValues,\n options: options,\n selectedOptions: selectedValues.map(value => options.find(option => value === option.value)).filter(Boolean),\n }\n\n const config: SelectConfiguration = {\n isMultiSelect,\n iconAppearance,\n }\n\n const registerItem = useCallback((item: RegisteredOption) => {\n setOptions(prev => {\n const updated = [...prev, item]\n updated.sort((a, b) => {\n const aEl = a.ref.current\n const bEl = b.ref.current\n if (!aEl || !bEl) return 0\n return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n })\n return updated\n })\n }, [])\n\n const unregisterItem = useCallback((value: string) => {\n setOptions(prev => prev.filter(i => i.value !== value))\n }, [])\n\n // Setting isSelected to false only works for multiselects\n const toggleSelection = (value: string, isSelected?: boolean) => {\n if (disabled) {\n return\n }\n const option = options.find(i => i.value === value)\n if (!option) {\n console.error(`SelectOption with value: ${value} not found`)\n return\n }\n\n let newValue: string[]\n if (isMultiSelect) {\n const isSelectedBefore = state.value.includes(value)\n const isSelectedAfter = isSelected ?? !isSelectedBefore\n if (!isSelectedAfter) {\n newValue = state.value.filter(v => v !== value)\n } else {\n newValue = [...state.value, value]\n }\n } else {\n newValue = [value]\n }\n\n if (!isMultiSelect) {\n onValueChanged?.(newValue[0])\n } else {\n onValuesChanged?.(newValue)\n }\n\n setInternalState(prevState => ({\n ...prevState,\n highlightedValue: value,\n }))\n }\n\n const highlightItem = (value: string) => {\n if (disabled) {\n return\n }\n setInternalState(prevState => ({\n ...prevState,\n highlightedValue: value,\n }))\n }\n\n const registerTrigger = useCallback((ref: React.RefObject<HTMLElement>) => {\n triggerRef.current = ref.current\n }, [])\n\n const unregisterTrigger = useCallback(() => {\n triggerRef.current = null\n }, [])\n\n const toggleOpen = (isOpen?: boolean, toggleOpenOptions?: ToggleOpenOptions) => {\n const { highlightStartPosition } = { ...defaultToggleOpenOptions, ...toggleOpenOptions }\n let highlightedIndex: number\n if (highlightStartPosition === 'first') {\n highlightedIndex = options.findIndex(option => !option.disabled)\n } else {\n highlightedIndex = options.length - 1 - [...options].reverse().findIndex(option => !option.disabled)\n }\n if (highlightedIndex === -1 || highlightedIndex === options.length) {\n highlightedIndex = 0\n }\n setInternalState(prevState => ({\n ...prevState,\n isOpen: isOpen ?? !prevState.isOpen,\n highlightedValue: options[highlightedIndex].value,\n }))\n }\n\n const moveHighlightedIndex = (delta: number) => {\n let highlightedIndex = options.findIndex(value => value.value === internalState.highlightedValue)\n if (highlightedIndex === -1) {\n highlightedIndex = 0\n }\n const optionLength = options.length\n const startIndex = (highlightedIndex + (delta % optionLength) + optionLength) % optionLength\n const isForward = delta >= 0\n let highlightedValue = options[startIndex].value\n for (let i = 0; i < options.length; i++) {\n const index = (startIndex + (isForward ? i : -i) + optionLength) % optionLength\n if (!options[index].disabled) {\n highlightedValue = options[index].value\n break\n }\n }\n\n setInternalState(prevState => ({\n ...prevState,\n highlightedValue,\n }))\n }\n\n useEffect(() => {\n if (!internalState.highlightedValue) return\n const highlighted = options.find(value => value.value === internalState.highlightedValue)\n if (highlighted) {\n highlighted.ref.current.scrollIntoView({ behavior: 'instant', block: 'nearest' })\n } else {\n console.error(`SelectRoot: Could not find highlighted value (${internalState.highlightedValue})`)\n }\n }, [internalState.highlightedValue]) // eslint-disable-line react-hooks/exhaustive-deps\n\n const contextValue: SelectContextType = {\n state,\n config,\n item: {\n register: registerItem,\n unregister: unregisterItem,\n toggleSelection,\n highlightItem,\n moveHighlightedIndex,\n },\n trigger: {\n ref: triggerRef,\n register: registerTrigger,\n unregister: unregisterTrigger,\n toggleOpen,\n },\n }\n\n return (\n <SelectContext.Provider value={contextValue}>\n {children}\n </SelectContext.Provider>\n )\n}\n\n//\n// SelectOption\n//\nexport type SelectOptionProps = Omit<HTMLAttributes<HTMLLIElement>, 'children'> & {\n value: string,\n disabled?: boolean,\n iconAppearance?: SelectIconAppearance,\n children?: ReactNode,\n}\n\nexport const SelectOption = forwardRef<HTMLLIElement, SelectOptionProps>(\n function SelectOption({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {\n const { state, config, item, trigger } = useSelectContext()\n const { register, unregister, toggleSelection, highlightItem } = item\n const itemRef = useRef<HTMLLIElement>(null)\n\n iconAppearance ??= config.iconAppearance\n\n const label = children ?? value\n\n // Register with parent\n useEffect(() => {\n register({\n value,\n label,\n disabled,\n ref: itemRef,\n })\n return () => unregister(value)\n }, [value, disabled, register, unregister, children, label])\n\n const isHighlighted = state.highlightedValue === value\n const isSelected = state.value.includes(value)\n\n return (\n <li\n {...restProps}\n ref={(node) => {\n itemRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as React.MutableRefObject<HTMLLIElement | null>).current = node\n }}\n id={value}\n role=\"option\"\n aria-disabled={disabled}\n aria-selected={isSelected}\n data-highlighted={isHighlighted ? '' : undefined}\n data-selected={isSelected ? '' : undefined}\n data-disabled={disabled ? '' : undefined}\n className={clsx(\n 'flex-row-1 items-center px-2 py-1 rounded-md',\n 'data-highlighted:bg-primary/20',\n 'data-disabled:text-disabled data-disabled:cursor-not-allowed',\n 'not-data-disabled:cursor-pointer',\n className\n )}\n onClick={(event) => {\n if (!disabled) {\n toggleSelection(value)\n if (!config.isMultiSelect) {\n trigger.toggleOpen(false)\n }\n restProps.onClick?.(event)\n }\n }}\n onMouseEnter={(event) => {\n if (!disabled) {\n highlightItem(value)\n restProps.onMouseEnter?.(event)\n }\n }}\n >\n {iconAppearance === 'left' && (\n <CheckIcon\n className={clsx('w-4 h-4', { 'opacity-0': !isSelected || disabled })}\n aria-hidden={true}\n />\n )}\n {label}\n {iconAppearance === 'right' && (\n <CheckIcon\n className={clsx('w-4 h-4', { 'opacity-0': !isSelected || disabled })}\n aria-hidden={true}\n />\n )}\n </li>\n )\n }\n)\n\n///\n/// SelectButton\n///\ntype SelectButtonTranslationType = {\n clickToSelect: string,\n}\n\nconst defaultSelectButtonTranslation: Translation<SelectButtonTranslationType> = {\n en: {\n clickToSelect: 'Click to select',\n\n },\n de: {\n clickToSelect: 'Zum auswählen drücken'\n }\n}\n\ntype SelectButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n placeholder?: ReactNode,\n selectedDisplay?: (value: string[]) => ReactNode,\n}\n\nexport const SelectButton = forwardRef<HTMLButtonElement, SelectButtonProps>(function SelectButton(\n { placeholder, selectedDisplay, ...props }, ref\n) {\n const translation = useTranslation([defaultSelectButtonTranslation])\n const { state, trigger } = useSelectContext()\n const { register, unregister, toggleOpen } = trigger\n\n const innerRef = useRef<HTMLButtonElement>(null)\n useImperativeHandle(ref, () => innerRef.current)\n\n useEffect(() => {\n register(innerRef)\n return () => unregister()\n }, [register, unregister])\n\n const disabled = !!props?.disabled || !!state.disabled\n const invalid = state.invalid\n const hasValue = state.value.length > 0\n\n return (\n <button\n {...props}\n ref={innerRef}\n id={state.id} // TODO allow for a custom id here\n disabled={disabled}\n\n onClick={(event) => {\n props.onClick?.(event)\n toggleOpen(!state.isOpen)\n }}\n onKeyDown={event => {\n props.onKeyDown?.(event)\n switch (event.key) {\n case 'ArrowDown':\n toggleOpen(true, { highlightStartPosition: 'first' })\n event.preventDefault()\n event.stopPropagation()\n break\n case 'ArrowUp':\n toggleOpen(true, { highlightStartPosition: 'last' })\n event.preventDefault()\n event.stopPropagation()\n break\n }\n }}\n\n className={clsx(\n 'flex-row-2 items-center justify-between rounded-md px-3 py-2',\n {\n 'bg-input-background text-placeholder': !hasValue && !disabled && !invalid,\n 'bg-input-background text-input-text': hasValue && !disabled && !invalid,\n 'bg-negative/20': !disabled && invalid,\n 'text-placeholder': !hasValue && !disabled,\n 'text-negative': hasValue && !disabled && invalid,\n 'bg-disabled-background text-disabled': disabled,\n },\n props.className\n )}\n\n data-placeholder={!hasValue ? '' : undefined}\n data-disabled={disabled ? '' : undefined}\n data-invalid={invalid ? '' : undefined}\n\n aria-invalid={invalid}\n aria-disabled={disabled}\n aria-haspopup=\"listbox\"\n aria-expanded={state.isOpen}\n aria-controls={state.isOpen ? `${state.id}-listbox` : undefined}\n >\n {hasValue ?\n selectedDisplay?.(state.value) ?? (\n <div className={clsx('flex flex-wrap gap-x-1 gap-y-2')}>\n {state.selectedOptions.map(({ value, label }, index) => (\n <span key={value} className=\"flex-row-0\">\n {label}\n {index < state.value.length - 1 && (<span>{','}</span>)}\n </span>\n ))}\n </div>\n )\n : placeholder ?? translation('clickToSelect')\n }\n <ExpansionIcon\n isExpanded={state.isOpen}\n className={clsx({\n 'text-input-text': !disabled && !invalid,\n 'text-negative': !disabled && invalid,\n 'text-disabled': disabled,\n })}\n />\n </button>\n )\n})\n\n///\n/// SelectChipDisplay\n///\ntype SelectChipDisplayProps = HTMLAttributes<HTMLDivElement> & {\n disabled?: boolean,\n placeholder?: ReactNode,\n}\n\nexport const SelectChipDisplay = forwardRef<HTMLDivElement, SelectChipDisplayProps>(function SelectChipDisplay(\n { ...props }, ref\n) {\n const { state, trigger, item } = useSelectContext()\n const { register, unregister, toggleOpen } = trigger\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current)\n\n useEffect(() => {\n register(innerRef)\n return () => unregister()\n }, [register, unregister])\n\n const disabled = !!props?.disabled || !!state.disabled\n const invalid = state.invalid\n\n return (\n <div\n {...props}\n ref={innerRef}\n className={clsx(\n 'flex flex-wrap flex-row gap-2 items-center bg-input-background text-input-text rounded-md px-2.5 py-2.5',\n props.className\n )}\n data-disabled={disabled ? '' : undefined}\n data-invalid={invalid ? '' : undefined}\n\n aria-invalid={invalid}\n aria-disabled={disabled}\n >\n {state.selectedOptions.map(({ value, label }) => (\n <Chip key={value} className=\"gap-x-2\">\n {label}\n <TextButton\n // TODO add label to indicate purpose to screen reader\n onClick={() => {\n item.toggleSelection(value, false)\n }}\n size=\"none\"\n color=\"negative\"\n className=\"flex-row-0 items-center px-0.5 py-0.5 w-6 h-6 rounded\"\n >\n <XIcon className=\"w-5 h-5\"/>\n </TextButton>\n </Chip>\n ))}\n <IconButton\n id={state.id} // TODO allow for a custom id here\n onClick={() => toggleOpen()}\n onKeyDown={event => {\n switch (event.key) {\n case 'ArrowDown':\n toggleOpen(true, { highlightStartPosition: 'first' })\n break\n case 'ArrowUp':\n toggleOpen(true, { highlightStartPosition: 'last' })\n }\n }}\n size=\"small\"\n color=\"neutral\"\n\n aria-invalid={invalid}\n aria-disabled={disabled}\n aria-haspopup=\"listbox\"\n aria-expanded={state.isOpen}\n aria-controls={state.isOpen ? `${state.id}-listbox` : undefined}\n >\n <Plus/>\n </IconButton>\n </div>\n )\n})\n\n\n///\n/// SelectContent\n///\ntype Orientation = 'vertical' | 'horizontal'\n\nexport type SelectContentProps = HTMLAttributes<HTMLUListElement> & {\n alignment?: Pick<UseFloatingElementOptions, 'gap' | 'horizontalAlignment' | 'verticalAlignment'>,\n orientation?: Orientation,\n}\n\nexport const SelectContent = forwardRef<HTMLUListElement, SelectContentProps>(\n function SelectContent({\n alignment,\n orientation = 'vertical',\n ...props\n }, ref) {\n const innerRef = useRef<HTMLUListElement | null>(null)\n useImperativeHandle(ref, () => innerRef.current)\n\n const { trigger, state, config, item } = useSelectContext()\n\n const position = useFloatingElement({\n active: state.isOpen,\n anchorRef: trigger.ref,\n containerRef: innerRef,\n ...alignment,\n })\n\n useFocusTrap({\n container: innerRef,\n active: state.isOpen && !!position,\n })\n\n return createPortal(\n <>\n <div\n hidden={!state.isOpen}\n onClick={() => trigger.toggleOpen(false)}\n className={clsx('fixed w-screen h-screen inset-0')}\n />\n <ul\n {...props}\n id={`${state.id}-listbox`}\n ref={innerRef}\n hidden={!state.isOpen}\n onKeyDown={(event) => {\n switch (event.key) {\n case 'Escape':\n trigger.toggleOpen(false)\n event.preventDefault()\n event.stopPropagation()\n break\n case match(orientation, {\n vertical: 'ArrowDown',\n horizontal: 'ArrowUp'\n }):\n item.moveHighlightedIndex(1)\n event.preventDefault()\n break\n case match(orientation, {\n vertical: 'ArrowUp',\n horizontal: 'ArrowDown'\n }):\n item.moveHighlightedIndex(-1)\n event.preventDefault()\n break\n case 'Home':\n // TODO support later by selecting the first not disabled entry\n event.preventDefault()\n break\n case 'End':\n // TODO support later by selecting the last not disabled entry\n event.preventDefault()\n break\n case 'Enter': // Fall through\n case ' ':\n if (state.highlightedValue) {\n item.toggleSelection(state.highlightedValue)\n if (!config.isMultiSelect) {\n trigger.toggleOpen(false)\n }\n event.preventDefault()\n }\n break\n }\n }}\n\n className={clsx('flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-style-within overflow-auto', props.className)}\n style={{\n opacity: position ? undefined : 0,\n position: 'fixed',\n ...position\n }}\n\n role=\"listbox\"\n aria-multiselectable={config.isMultiSelect}\n aria-orientation={orientation}\n tabIndex={position ? 0 : undefined}\n >\n {props.children}\n </ul>\n </>, document.body\n )\n }\n)\n\n//\n// Select\n//\nexport type SelectProps = Omit<SelectRootProps, 'isMultiSelect' | 'values' | 'onValuesChanged'> & {\n contentPanelProps?: SelectContentProps,\n buttonProps?: Omit<SelectButtonProps, 'selectedDisplay'> & { selectedDisplay?: (value: string) => ReactNode },\n}\n\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select({\n children,\n contentPanelProps,\n buttonProps,\n ...props\n }, ref) {\n return (\n <SelectRoot {...props} isMultiSelect={false}>\n <SelectButton\n ref={ref}\n {...buttonProps}\n selectedDisplay={values => {\n const value = values[0]\n if (!buttonProps?.selectedDisplay) return undefined\n return buttonProps.selectedDisplay(value)\n }}\n />\n <SelectContent {...contentPanelProps}>{children}</SelectContent>\n </SelectRoot>\n )\n})\n\n\nexport type SelectUncontrolledProps = SelectProps\nexport const SelectUncontrolled = forwardRef<HTMLButtonElement, SelectUncontrolledProps>(function SelectUncontrolled({\n value: initialValue,\n onValueChanged,\n ...props\n }, ref) {\n const [value, setValue] = useOverwritableState(initialValue, onValueChanged)\n\n return (\n <Select\n {...props}\n ref={ref}\n value={value}\n onValueChanged={setValue}\n />\n )\n})\n\n\n//\n// MultiSelect\n//\nexport type MultiSelectProps = Omit<SelectRootProps, 'isMultiSelect' | 'value' | 'onValueChanged'> & {\n contentPanelProps?: SelectContentProps,\n buttonProps?: SelectButtonProps,\n}\n\nexport const MultiSelect = forwardRef<HTMLButtonElement, MultiSelectProps>(function MultiSelect({\n children,\n contentPanelProps,\n buttonProps,\n ...props\n }, ref) {\n return (\n <SelectRoot {...props} isMultiSelect={true}>\n <SelectButton ref={ref} {...buttonProps} />\n <SelectContent {...contentPanelProps}>{children}</SelectContent>\n </SelectRoot>\n )\n})\n\n\nexport type MultiSelectUncontrolledProps = MultiSelectProps\nexport const MultiSelectUncontrolled = forwardRef<HTMLButtonElement, MultiSelectUncontrolledProps>(function MultiSelectUncontrolled({\n values: initialValues,\n onValuesChanged,\n ...props\n }, ref) {\n const [values, setValues] = useOverwritableState(initialValues, onValuesChanged)\n\n return (\n <MultiSelect\n {...props}\n ref={ref}\n values={values}\n onValuesChanged={setValues}\n />\n )\n})\n\n\n//\n// MultiSelectChipDisplay\n//\nexport type MultiSelectChipDisplayProps = Omit<SelectRootProps, 'isMultiSelect' | 'value' | 'onValueChanged'> & {\n contentPanelProps?: SelectContentProps,\n chipDisplayProps?: SelectChipDisplayProps,\n}\n\nexport const MultiSelectChipDisplay = forwardRef<HTMLDivElement, MultiSelectChipDisplayProps>(function MultiSelectChipDisplay({\n children,\n contentPanelProps,\n chipDisplayProps,\n ...props\n }, ref) {\n return (\n <SelectRoot {...props} isMultiSelect={true}>\n <SelectChipDisplay ref={ref} {...chipDisplayProps} />\n <SelectContent {...contentPanelProps}>{children}</SelectContent>\n </SelectRoot>\n )\n})\n\n\nexport type MultiSelectChipDisplayUncontrolledProps = MultiSelectChipDisplayProps\nexport const MultiSelectChipDisplayUncontrolled = forwardRef<HTMLDivElement, MultiSelectChipDisplayUncontrolledProps>(function MultiSelectChipDisplayUncontrolled({\n values: initialValues,\n onValuesChanged,\n ...props\n }, ref) {\n const [values, setValues] = useOverwritableState(initialValues, onValuesChanged)\n\n return (\n <MultiSelectChipDisplay\n {...props}\n ref={ref}\n values={values}\n onValuesChanged={setValues}\n />\n )\n})","import type { PropsWithChildren, ReactNode } from 'react'\nimport { forwardRef, useCallback, useId } from 'react'\nimport { ChevronDown } from 'lucide-react'\nimport clsx from 'clsx'\nimport { useOverwritableState } from '@/src/hooks/useOverwritableState'\n\nexport type ExpansionIconProps = {\n isExpanded?: boolean,\n className?: string,\n}\n\nexport const ExpansionIcon = ({ isExpanded, className }: ExpansionIconProps) => {\n return (\n <ChevronDown\n aria-hidden={true}\n className={clsx(\n 'min-w-6 w-6 min-h-6 h-6 transition-transform motion-safe:duration-200 motion-reduce:duration-0 ease-in-out',\n { 'rotate-180': isExpanded },\n className\n )}\n />\n )\n}\n\ntype IconBuilder = (expanded: boolean) => ReactNode\n\nexport type ExpandableProps = PropsWithChildren<{\n id?: string,\n label: ReactNode,\n icon?: IconBuilder,\n isExpanded?: boolean,\n onChange?: (isExpanded: boolean) => void,\n /**\n * Whether the expansion should only happen when the header is clicked or on the entire component\n */\n clickOnlyOnHeader?: boolean,\n disabled?: boolean,\n className?: string,\n headerClassName?: string,\n contentClassName?: string,\n contentExpandedClassName?: string,\n}>\n\n/**\n * A Component for showing and hiding content\n */\nexport const Expandable = forwardRef<HTMLDivElement, ExpandableProps>(function Expandable({\n children,\n id: providedId,\n label,\n icon,\n isExpanded = false,\n onChange,\n clickOnlyOnHeader = true,\n disabled = false,\n className,\n headerClassName,\n contentClassName,\n contentExpandedClassName,\n }, ref) {\n\n const defaultIcon = useCallback((expanded: boolean) => <ExpansionIcon isExpanded={expanded}/>, [])\n icon ??= defaultIcon\n\n const generatedId = useId()\n const id = providedId ?? generatedId\n\n return (\n <div\n ref={ref}\n onClick={() => !clickOnlyOnHeader && !disabled && onChange?.(!isExpanded)}\n\n className={clsx(\n 'flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm',\n { 'cursor-pointer': !clickOnlyOnHeader && !disabled }, className\n )}\n >\n <button\n onClick={() => clickOnlyOnHeader && !disabled && onChange?.(!isExpanded)}\n\n className={clsx(\n 'flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none',\n {\n 'group-hover:brightness-97': !isExpanded,\n 'hover:brightness-97': isExpanded && !disabled,\n 'cursor-pointer': clickOnlyOnHeader && !disabled,\n },\n headerClassName\n )}\n\n aria-expanded={isExpanded}\n aria-controls={`${id}-content`}\n aria-disabled={disabled ?? undefined}\n >\n {label}\n {icon(isExpanded)}\n </button>\n <div\n id={`${id}-content`}\n className={clsx(\n 'flex-col-2 px-4 transition-all duration-300 ease-in-out',\n {\n [clsx('max-h-96 opacity-100 pb-2 overflow-y-auto', contentExpandedClassName)]: isExpanded,\n 'max-h-0 opacity-0 overflow-hidden': !isExpanded,\n },\n contentClassName\n )}\n\n role=\"region\"\n >\n {children}\n </div>\n </div>\n )\n})\n\nexport const ExpandableUncontrolled = forwardRef<HTMLDivElement, ExpandableProps>(function ExpandableUncontrolled({\n isExpanded,\n onChange,\n ...props\n },\n ref) {\n const [usedIsExpanded, setUsedIsExpanded] = useOverwritableState(isExpanded, onChange)\n\n return (\n <Expandable\n {...props}\n ref={ref}\n isExpanded={usedIsExpanded}\n onChange={setUsedIsExpanded}\n />\n )\n})\n","'use client'\n\nimport type { MutableRefObject } from 'react'\nimport { useCallback, useEffect, useId, useRef, useState } from 'react'\nimport { useIsMounted } from '@/src/hooks/focus/useIsMounted'\n\nconst createFocusGuard = () => {\n const div = document.createElement('div')\n Object.assign(div.style, {\n opacity: '0',\n outline: 'none',\n boxShadow: 'none',\n position: 'fixed',\n pointerEvents: 'none',\n touchAction: 'none',\n })\n div.tabIndex = 0\n div.setAttribute('data-hw-focus-guard', '')\n document.body.appendChild(div)\n return div\n}\n\nfunction getContainedFocusableElements(element: HTMLElement) {\n return element?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])')\n}\n\ntype ListenerType = {\n id: string,\n pause: () => void,\n unpause: () => void,\n focus: () => void,\n focusLast: () => void,\n container: MutableRefObject<HTMLElement>,\n initialFocusElement: MutableRefObject<HTMLElement>,\n}\n\nclass FocusTrapService {\n // The last entry is always the active one\n private listeners: ListenerType[] = []\n\n public getActive(): ListenerType | undefined {\n if (this.listeners.length === 0) return undefined\n return this.listeners[this.listeners.length - 1]\n }\n\n private focusElement() {\n const active = this.getActive()\n if(!active) return\n const { container, initialFocusElement } = active\n const containerElement = container.current\n // Try in the following order\n // 1. Focus the initial element\n // 2. Focus the first focusable element in the container\n // 3. Focus the container\n if (initialFocusElement?.current) {\n initialFocusElement.current.focus()\n } else {\n const elements = getContainedFocusableElements(containerElement)\n if (elements && elements.length > 0) {\n const first = elements.item(0) as HTMLElement\n first.focus()\n } else {\n containerElement.focus()\n }\n }\n }\n\n private onFocusIn = (event: FocusEvent) => {\n const active = this.getActive()\n if(!active || !active.container.current) return\n const { container } = active\n if (!container.current.contains(event.target as HTMLElement)) {\n this.focusElement()\n }\n }\n\n private removeGuards() {\n document.querySelectorAll('[data-hw-focus-guard]').forEach((node) => node.remove())\n }\n\n private addGuards() {\n document.body.insertAdjacentElement('afterbegin', createFocusGuard())\n document.body.insertAdjacentElement('beforeend', createFocusGuard())\n }\n\n private activate() {\n document.addEventListener('focusin', this.onFocusIn)\n this.addGuards()\n }\n\n private deactivate() {\n document.removeEventListener('focusin', this.onFocusIn)\n this.removeGuards()\n }\n\n register(listener: ListenerType) {\n this.listeners.push(listener)\n if (this.listeners.length === 1) {\n this.activate()\n }\n const active = listener\n this.listeners.forEach((listener) => {\n const { focus, pause } = listener\n if (listener === active) {\n focus()\n } else {\n pause()\n }\n })\n }\n\n unregister(id: string) {\n const index = this.listeners.findIndex(trap => trap.id === id)\n if (index !== -1) {\n const isActive = index === this.listeners.length - 1\n const listener = this.listeners[index]\n this.listeners = this.listeners.filter(listener => listener.id !== id)\n if (isActive) {\n // Deactivate all focus traps\n this.deactivate()\n // Focus last element in previous focus context\n listener.focusLast()\n // Activate and pause remaining focus traps\n const active = this.getActive()\n this.listeners.forEach((listener) => {\n const { pause, unpause } = listener\n if (listener === active) {\n unpause()\n } else {\n pause()\n }\n })\n // Reactivate\n if (this.listeners.length > 0) {\n this.activate()\n }\n }\n } else {\n console.warn(`Unable to unregister id ${id}: not found`)\n }\n }\n}\n\nconst service = new FocusTrapService()\n\nexport type UseFocusTrapProps = {\n container: MutableRefObject<HTMLElement>,\n active?: boolean,\n initialFocus?: MutableRefObject<HTMLElement>,\n /**\n * Whether to focus the first element when the initialFocus isn't provided\n *\n * Focuses the container instead\n */\n focusFirst?: boolean,\n}\n\nexport const useFocusTrap = ({\n container,\n active = true,\n initialFocus,\n focusFirst = true,\n }: UseFocusTrapProps) => {\n const lastFocusRef = useRef<HTMLElement | null>(null)\n const [paused, setPaused] = useState(false)\n const isMounted = useIsMounted()\n const id = useId()\n\n const focusElement = useCallback(() => {\n const containerElement = container.current\n // Try in the following order\n // 1. Focus the initial element\n // 2. Focus the first focusable element in the container\n // 3. Focus the container\n if (initialFocus?.current) {\n initialFocus.current.focus()\n } else {\n const elements = getContainedFocusableElements(containerElement)\n if (elements && elements.length > 0) {\n const first = elements.item(0) as HTMLElement\n first.focus()\n } else {\n containerElement.focus()\n }\n }\n }, [container, initialFocus])\n\n useEffect(() => {\n if (active && isMounted) {\n if (!lastFocusRef.current) {\n lastFocusRef.current = document.activeElement as HTMLElement\n }\n\n function pause() {\n setPaused(true)\n }\n\n function unpause() {\n setPaused(false)\n if (!container.current.contains(document.activeElement as HTMLElement)) {\n focusElement()\n }\n }\n\n function focus() {\n focusElement()\n setPaused(false)\n }\n\n function focusLast() {\n lastFocusRef.current?.focus()\n }\n\n service.register({ id, pause, focus, focusLast, unpause, container, initialFocusElement: initialFocus })\n return () => {\n service.unregister(id)\n lastFocusRef.current = undefined\n }\n }\n }, [active, container, focusElement, id, initialFocus, isMounted])\n\n useEffect(() => {\n if (active && !paused && isMounted) {\n const containerElement = container.current\n\n function onKeyDown(event: KeyboardEvent) {\n const key = event.key\n const elements = getContainedFocusableElements(containerElement)\n const active = document.activeElement as HTMLElement\n const index = [...elements].findIndex(value => value === active)\n if (index === -1 || event.altKey || event.ctrlKey || event.metaKey) {\n return\n }\n if (key === 'Tab') {\n const next = event.shiftKey ? -1 : 1\n const nextIndex = (index + next + elements.length) % elements.length\n const nextElement = elements[nextIndex] as HTMLElement\n nextElement.focus()\n event.preventDefault()\n }\n }\n\n // Register and unregister the listeners\n containerElement.addEventListener('keydown', onKeyDown)\n return () => {\n containerElement.removeEventListener('keydown', onKeyDown)\n }\n }\n }, [active, paused, isMounted, container, initialFocus, focusFirst, focusElement])\n}","'use client'\n\nimport { useEffect, useLayoutEffect, useState } from 'react'\n\nconst isClient = typeof window !== 'undefined' && typeof document !== 'undefined'\nconst useIsomorphicEffect = isClient ? useLayoutEffect : useEffect\n\nexport const useIsMounted = () => {\n const [isMounted, setIsMounted] = useState(false)\n\n useIsomorphicEffect(() => {\n setIsMounted(true)\n return () => {\n setIsMounted(false)\n }\n }, [])\n return isMounted\n}","export const match = <K extends string | number | symbol, V>(key: K, values: Record<K, V>) => {\n return values[key]\n}","import type { HTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport clsx from 'clsx'\n\nconst chipColors = ['default', 'dark', 'red', 'yellow', 'green', 'blue', 'pink', 'orange'] as const\nexport type ChipColor = typeof chipColors[number]\n\ntype ChipVariant = 'normal' | 'fullyRounded'\ntype ChipSize = 'sm' | 'md' | 'lg'\n\nexport const ChipUtil = {\n colors: chipColors,\n}\n\nexport type ChipProps = HTMLAttributes<HTMLDivElement> & PropsWithChildren<{\n color?: ChipColor,\n size?: ChipSize,\n icon?: boolean,\n variant?: ChipVariant,\n trailingIcon?: ReactNode,\n}>\n\n/**\n * A component for displaying a single chip\n */\nexport const Chip = ({\n children,\n trailingIcon,\n color = 'default',\n size = 'md',\n icon = false,\n variant = 'normal',\n className = '',\n ...restProps\n }: ChipProps) => {\n const colorMapping: string = {\n default: 'text-tag-default-text bg-tag-default-background',\n dark: 'text-tag-dark-text bg-tag-dark-background',\n red: 'text-tag-red-text bg-tag-red-background',\n yellow: 'text-tag-yellow-text bg-tag-yellow-background',\n green: 'text-tag-green-text bg-tag-green-background',\n blue: 'text-tag-blue-text bg-tag-blue-background',\n pink: 'text-tag-pink-text bg-tag-pink-background',\n orange: 'text-tag-orange-text bg-tag-orange-background',\n }[color]\n\n const colorMappingIcon: string = {\n default: 'text-tag-default-icon',\n dark: 'text-tag-dark-icon',\n red: 'text-tag-red-icon',\n yellow: 'text-tag-yellow-icon',\n green: 'text-tag-green-icon',\n blue: 'text-tag-blue-icon',\n pink: 'text-tag-pink-icon',\n orange: 'text-tag-orange-icon',\n }[color]\n\n return (\n <div\n {...restProps}\n className={clsx(\n `flex-row-0 w-fit font-semibold`,\n colorMapping,\n !icon ? {\n 'px-1 py-0.5': size === 'sm',\n 'px-2 py-1': size === 'md',\n 'px-4 py-2': size === 'lg',\n } : {\n 'p-0.5': size === 'sm',\n 'p-1': size === 'md',\n 'p-2': size === 'lg',\n },\n {\n 'rounded-md': variant === 'normal',\n 'rounded-full': variant === 'fullyRounded',\n },\n className\n )}\n >\n {children}\n {trailingIcon && (<span className={colorMappingIcon}>{trailingIcon}</span>)}\n </div>\n )\n}\n\nexport type ChipListProps = {\n list: ChipProps[],\n className?: string,\n}\n\n/**\n * A component for displaying a list of chips\n */\nexport const ChipList = ({\n list,\n className = ''\n }: ChipListProps) => {\n return (\n <div className={clsx('flex flex-wrap gap-x-2 gap-y-2', className)}>\n {list.map((value, index) => (\n <Chip\n key={index}\n {...value}\n color={value.color ?? 'default'}\n variant={value.variant ?? 'normal'}\n >\n {value.children}\n </Chip>\n ))}\n </div>\n )\n}\n","'use client'\n\nimport type { CSSProperties, MutableRefObject } from 'react'\nimport { useCallback, useEffect, useState } from 'react'\nimport { clamp } from '@/src/utils/math'\nimport { useIsMounted } from '@/src/hooks/focus/useIsMounted'\n\nexport type FloatingElementAlignment = 'beforeStart' | 'afterStart' | 'center' | 'beforeEnd' | 'afterEnd'\n\ntype RectangleBounds = {\n top: number,\n right: number,\n bottom: number,\n left: number,\n width: number,\n height: number,\n}\n\ntype CalculatePositionOptions = {\n verticalAlignment?: FloatingElementAlignment,\n horizontalAlignment?: FloatingElementAlignment,\n screenPadding?: number,\n gap?: number,\n}\n\ntype CalculatePositionProps = {\n windowRect: RectangleBounds,\n containerRect: RectangleBounds,\n anchorRect: RectangleBounds,\n options: CalculatePositionOptions,\n}\n\ntype UseFloatingElementStyle = {\n left: number,\n top: number,\n maxWidth: number,\n maxHeight: number,\n}\n\nfunction calculatePosition({\n windowRect,\n containerRect,\n anchorRect,\n options,\n }: CalculatePositionProps): UseFloatingElementStyle {\n const { verticalAlignment, horizontalAlignment, gap, screenPadding } = options\n const windowWidth = windowRect.width\n const windowHeight = windowRect.height\n\n const maxWidth = windowWidth - 2 * screenPadding\n const maxHeight = windowHeight - 2 * screenPadding\n\n const width = Math.min(containerRect.width, maxWidth)\n const height = Math.min(containerRect.height, maxHeight)\n\n const leftSuggestion = {\n beforeStart: anchorRect.left - width - gap,\n afterStart: anchorRect.left,\n center: anchorRect.left + anchorRect.width / 2 - width / 2,\n beforeEnd: anchorRect.right - width,\n afterEnd: anchorRect.right + gap,\n }[horizontalAlignment]\n\n const topSuggestion = {\n beforeStart: anchorRect.top - height - gap,\n afterStart: anchorRect.top,\n center: anchorRect.top + anchorRect.height / 2 - height / 2,\n beforeEnd: anchorRect.bottom - height,\n afterEnd: anchorRect.bottom + gap,\n }[verticalAlignment]\n\n const left = clamp(leftSuggestion, [\n screenPadding,\n windowWidth - screenPadding - width,\n ])\n\n const top = clamp(topSuggestion, [\n screenPadding,\n windowHeight - screenPadding - height,\n ])\n\n return {\n left,\n top,\n maxWidth,\n maxHeight,\n }\n}\n\nexport type UseFloatingElementOptions = CalculatePositionOptions & {\n isPolling?: boolean,\n pollingInterval?: number,\n}\n\nexport type UseFloatingElementProps = UseFloatingElementOptions & {\n containerRef: MutableRefObject<HTMLElement>,\n anchorRef: MutableRefObject<HTMLElement>,\n windowRef?: MutableRefObject<HTMLElement>,\n active?: boolean,\n}\n\nexport function useFloatingElement({\n active = true,\n windowRef,\n anchorRef,\n containerRef,\n isPolling = false,\n pollingInterval = 100,\n verticalAlignment = 'afterEnd',\n horizontalAlignment = 'afterStart',\n screenPadding = 16,\n gap = 4,\n }: UseFloatingElementProps) {\n const [style, setStyle] = useState<CSSProperties>()\n const isMounted = useIsMounted()\n\n const calculate = useCallback(() => {\n const containerRect = containerRef.current.getBoundingClientRect()\n const windowRect: RectangleBounds = windowRef?.current.getBoundingClientRect() ?? {\n top: 0,\n bottom: window.innerHeight,\n left: 0,\n right: window.innerWidth,\n width: window.innerWidth,\n height: window.innerHeight,\n }\n const anchorElement = anchorRef?.current\n if (anchorRef && !anchorElement) {\n console.warn('FloatingContainer anchor provided, but its value is undefined')\n }\n const anchorRect: RectangleBounds = anchorElement?.getBoundingClientRect() ?? windowRect\n\n const calculateProps: CalculatePositionProps = {\n windowRect,\n anchorRect,\n containerRect,\n options: {\n horizontalAlignment,\n verticalAlignment,\n screenPadding,\n gap,\n }\n }\n setStyle(calculatePosition(calculateProps))\n }, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef])\n\n\n const height = containerRef.current?.getBoundingClientRect().height\n const width = containerRef.current?.getBoundingClientRect().width\n useEffect(() => {\n if (active && isMounted) {\n calculate()\n } else {\n setStyle(undefined)\n }\n }, [calculate, active, isMounted, height, width])\n\n useEffect(() => {\n window.addEventListener('resize', calculate)\n let timeout: NodeJS.Timeout\n if (isPolling) {\n timeout = setInterval(calculate, pollingInterval)\n }\n return () => {\n window.removeEventListener('resize', calculate)\n if (timeout) {\n clearInterval(timeout)\n }\n }\n }, [calculate, isPolling, pollingInterval])\n\n return style\n}","export const clamp = (value: number, range: [number, number] = [0, 1]): number => {\n const [min, max] = range\n return Math.min(Math.max(value, min), max)\n}\n","import { Binary } from 'lucide-react'\nimport clsx from 'clsx'\nimport { Input } from '../user-action/input/Input'\nimport type { PropsForTranslation, Translation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport type { PropertyBaseProps } from './PropertyBase'\nimport { PropertyBase } from './PropertyBase'\n\ntype NumberPropertyTranslation = {\n value: string,\n}\n\nconst defaultNumberPropertyTranslation: Translation<NumberPropertyTranslation> = {\n en: {\n value: 'Value'\n },\n de: {\n value: 'Wert'\n }\n}\n\nexport type NumberPropertyProps = Omit<PropertyBaseProps, 'icon' | 'input' | 'hasValue'> & {\n value?: number,\n suffix?: string,\n onChange?: (value: number) => void,\n onEditComplete?: (value: number) => void,\n}\n\n/**\n * An Input for number properties\n */\nexport const NumberProperty = ({\n overwriteTranslation,\n value,\n onChange,\n onRemove,\n onEditComplete,\n readOnly,\n suffix,\n ...baseProps\n }: PropsForTranslation<NumberPropertyTranslation, NumberPropertyProps>) => {\n const translation = useTranslation([defaultNumberPropertyTranslation], overwriteTranslation)\n const hasValue = value !== undefined\n\n return (\n <PropertyBase\n {...baseProps}\n onRemove={onRemove}\n hasValue={hasValue}\n icon={<Binary size={24}/>}\n input={({ softRequired }) => (\n <div\n className={clsx('flex-row-2 grow', { 'text-warning': softRequired && !hasValue })}\n >\n <Input\n className={clsx('!ring-0 !border-0 !outline-0 !p-0 !m-0 !w-fit !shadow-none !rounded-none', { 'bg-surface-warning placeholder-warning': softRequired && !hasValue })}\n value={value?.toString() ?? ''}\n type=\"number\"\n readOnly={readOnly}\n placeholder={`${translation('value')}...`}\n onChangeText={(value) => {\n const numberValue = parseFloat(value)\n if (isNaN(numberValue)) {\n onRemove()\n } else {\n onChange?.(numberValue)\n }\n }}\n onEditCompleted={(value) => {\n const numberValue = parseFloat(value)\n if (isNaN(numberValue)) {\n onRemove()\n } else {\n onEditComplete(numberValue)\n }\n }}\n />\n {suffix && <span className={clsx('ml-1', { 'bg-surface-warning': softRequired && !hasValue })}>{suffix}</span>}\n </div>\n )}\n />\n )\n}\n","import { List } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { PropsWithChildren, ReactNode } from 'react'\nimport type { FormTranslationType } from '@/src/localization/defaults/form'\nimport type { PropertyBaseProps } from '@/src/components/properties/PropertyBase'\nimport { PropertyBase } from '@/src/components/properties/PropertyBase'\nimport type { PropsForTranslation } from '@/src/localization/useTranslation'\nimport { Select } from '@/src/components/user-action/select/Select'\n\ntype SingleSelectPropertyTranslation = FormTranslationType\n\nexport type SingleSelectPropertyProps =\n Omit<PropertyBaseProps, 'icon' | 'input' | 'hasValue' | 'className'>\n & PropsWithChildren<{\n value?: string,\n onValueChanged?: (value: string) => void,\n onAddNew?: (value: string) => void,\n selectedDisplay?: (value: string) => ReactNode,\n}>\n\n/**\n * An Input for SingleSelect properties\n */\nexport const SingleSelectProperty = ({\n children,\n value,\n onValueChanged,\n selectedDisplay,\n ...props\n }: PropsForTranslation<SingleSelectPropertyTranslation, SingleSelectPropertyProps>) => {\n const hasValue = value !== undefined\n\n return (\n <PropertyBase\n {...props}\n hasValue={hasValue}\n icon={<List size={24}/>}\n input={({ softRequired }) => (\n <Select\n value={value}\n onValueChanged={onValueChanged}\n disabled={props.readOnly}\n buttonProps={{\n className: clsx(\n 'border-none w-full',\n {\n '!bg-warning !text-surface-warning': softRequired && !hasValue,\n }\n ),\n selectedDisplay: selectedDisplay,\n }}\n >\n {children}\n </Select>\n )}\n />\n )\n}\n","import { Text } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { PropsForTranslation, Translation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport { Textarea } from '../user-action/Textarea'\nimport type { PropertyBaseProps } from './PropertyBase'\nimport { PropertyBase } from './PropertyBase'\n\ntype TextPropertyTranslation = {\n text: string,\n}\n\nconst defaultTextPropertyTranslation: Translation<TextPropertyTranslation> = {\n en: {\n text: 'Text'\n },\n de: {\n text: 'Text'\n }\n}\n\nexport type TextPropertyProps = Omit<PropertyBaseProps, 'icon' | 'input' | 'hasValue'> & {\n value?: string,\n onChange?: (value: string) => void,\n onEditComplete?: (value: string) => void,\n}\n\n/**\n * An Input for Text properties\n */\nexport const TextProperty = ({\n overwriteTranslation,\n value,\n readOnly,\n onChange,\n onRemove,\n onEditComplete,\n ...baseProps\n }: PropsForTranslation<TextPropertyTranslation, TextPropertyProps>) => {\n const translation = useTranslation([defaultTextPropertyTranslation], overwriteTranslation)\n const hasValue = value !== undefined\n\n return (\n <PropertyBase\n {...baseProps}\n onRemove={onRemove}\n hasValue={hasValue}\n icon={<Text size={24}/>}\n input={({ softRequired }) => (\n <Textarea\n className={clsx({\n 'bg-surface-warning placeholder-warning': softRequired && !hasValue\n })}\n rows={5}\n defaultStyle={false}\n value={value ?? ''}\n readOnly={readOnly}\n placeholder={`${translation('text')}...`}\n onChangeText={(value) => {\n if (!value) {\n onRemove?.()\n } else {\n onChange?.(value)\n }\n }}\n onEditCompleted={(value) => {\n if (!value) {\n onRemove?.()\n } else {\n onEditComplete?.(value)\n }\n }}\n />\n )}\n />\n )\n}\n","import type { ReactNode, TextareaHTMLAttributes } from 'react'\nimport { forwardRef, useId } from 'react'\nimport clsx from 'clsx'\nimport type { LabelProps } from '@/src/components/user-action/Label'\nimport { Label } from '@/src/components/user-action/Label'\nimport { useDelay, type UseDelayOptions } from '@/src/hooks/useDelay'\nimport { useOverwritableState } from '@/src/hooks/useOverwritableState'\n\nexport type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value'> & {\n /** Inside the area */\n value?: string,\n invalid?: boolean,\n onChangeText?: (text: string) => void,\n onEditCompleted?: (text: string) => void,\n saveDelayOptions?: UseDelayOptions,\n defaultStyle?: boolean,\n}\n\n/**\n * A Textarea component for inputting longer texts\n *\n * The State is managed by the parent\n */\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea({\n id,\n onChange,\n onChangeText,\n onBlur,\n onEditCompleted,\n saveDelayOptions,\n defaultStyle = true,\n invalid = false,\n disabled = false,\n className,\n ...props\n }, ref) {\n const { restartTimer, clearTimer } = useDelay(saveDelayOptions)\n\n const onEditCompletedWrapper = (text: string) => {\n onEditCompleted?.(text)\n clearTimer()\n }\n\n return (\n <textarea\n ref={ref}\n id={id}\n className={clsx(\n 'resize-none w-full h-32 overflow-y-scroll',\n 'py-2 px-3 rounded-md border-2 border-transparent focus-style-none',\n {\n 'bg-input-background text-input-text hover:border-primary focus:border-primary': !disabled && !invalid,\n 'bg-negative/20 text-negative hover:border-negative focus-visible:border-negative': invalid && !disabled && defaultStyle,\n 'text-disabled bg-disabled-background border-disabled-border': disabled && defaultStyle,\n },\n className\n )}\n onChange={(event) => {\n const value = event.target.value\n restartTimer(() => {\n onEditCompletedWrapper(value)\n })\n onChange?.(event)\n onChangeText?.(value)\n }}\n onBlur={(event) => {\n onBlur?.(event)\n onEditCompletedWrapper(event.target.value)\n }}\n disabled={disabled}\n {...props}\n />\n )\n})\n\n/**\n * A Textarea component that is not controlled by its parent\n */\nexport const TextareaUncontrolled = ({\n value,\n onChangeText,\n ...props\n }: TextareaProps) => {\n const [text, setText] = useOverwritableState<string>(value, onChangeText)\n\n return (\n <Textarea\n {...props}\n value={text}\n onChangeText={setText}\n />\n )\n}\n\nexport type TextareaWithHeadlineProps = Omit<TextareaProps, 'defaultStyle'> & {\n headline: ReactNode,\n headlineProps: Omit<LabelProps, 'children'>,\n containerClassName?: string,\n}\n\nexport const TextareaWithHeadline = ({\n id,\n headline,\n headlineProps,\n disabled,\n className,\n containerClassName,\n ...props\n }: TextareaWithHeadlineProps) => {\n const genId = useId()\n const usedId = id ?? genId\n\n return (\n <div\n className={clsx(\n 'group flex-col-3 border-2 rounded-lg',\n {\n 'bg-input-background text-input-text hover:border-primary focus-within:border-primary': !disabled,\n 'border-disabled-border bg-disabled-background cursor-not-allowed': disabled,\n },\n containerClassName\n )}\n >\n {headline && (\n <Label size=\"md\" {...headlineProps} htmlFor={usedId}>\n {headline}\n </Label>\n )}\n <Textarea\n {...props}\n id={usedId}\n className={clsx(\n 'border-transparent focus:ring-0 focus-visible:ring-0 resize-none h-32',\n className\n )}\n defaultStyle={false}\n />\n </div>\n )\n}"],"mappings":";AAAA,SAAS,SAAAA,cAAa;;;ACAtB,SAAS,OAAO,aAAa;AAC7B,OAAO,UAAU;;;ACDjB,YAAYC,aAAW;;;ACAvB,YAAY,WAAW;AAQvB,SAAS,OAAU,KAAqB,OAAU;AAChD,MAAI,OAAO,QAAQ,YAAY;AAC7B,WAAO,IAAI,KAAK;EAClB,WAAW,QAAQ,QAAQ,QAAQ,QAAW;AAC5C,QAAI,UAAU;EAChB;AACF;AAMA,SAAS,eAAkB,MAA8C;AACvE,SAAO,CAAC,SAAS;AACf,QAAI,aAAa;AACjB,UAAM,WAAW,KAAK,IAAI,CAAC,QAAQ;AACjC,YAAM,UAAU,OAAO,KAAK,IAAI;AAChC,UAAI,CAAC,cAAc,OAAO,WAAW,YAAY;AAC/C,qBAAa;MACf;AACA,aAAO;IACT,CAAC;AAMD,QAAI,YAAY;AACd,aAAO,MAAM;AACX,iBAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,gBAAM,UAAU,SAAS,CAAC;AAC1B,cAAI,OAAO,WAAW,YAAY;AAChC,oBAAQ;UACV,OAAO;AACL,mBAAO,KAAK,CAAC,GAAG,IAAI;UACtB;QACF;MACF;IACF;EACF;AACF;AAMA,SAAS,mBAAsB,MA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K;AAAA,MACtB;AAAA,MACA,QAAQ,CAAC,UAAU;AACjB,iBAAS,KAAK;AACd,+BAAuB,MAAM,OAAO,KAAK;AAAA,MAC3C;AAAA,MACA;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;;;AD1BW,gBAAAC,aAAA;AAnCZ,IAAM,iCAAuE;AAAA,EAC3E,IAAI;AAAA,IACF,MAAM;AAAA,EACR;AAAA,EACA,IAAI;AAAA,IACF,MAAM;AAAA,EACR;AACF;AAWO,IAAM,eAAe,CAAC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAuE;AAClG,QAAM,cAAc,eAAe,CAAC,8BAA8B,GAAG,oBAAoB;AACzF,QAAM,WAAW,UAAU;AAE3B,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,MAAM,gBAAAA,MAAC,QAAK,MAAM,IAAG;AAAA,MACrB,OAAO,CAAC,EAAE,aAAa,MACrB,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAWC,OAAK;AAAA,YACd,0CAA0C,gBAAgB,CAAC;AAAA,UAC7D,CAAC;AAAA,UACD,MAAM;AAAA,UACN,cAAc;AAAA,UACd,OAAO,SAAS;AAAA,UAChB;AAAA,UACA,aAAa,GAAG,YAAY,MAAM,CAAC;AAAA,UACnC,cAAc,CAACC,WAAU;AACvB,gBAAI,CAACA,QAAO;AACV,yBAAW;AAAA,YACb,OAAO;AACL,yBAAWA,MAAK;AAAA,YAClB;AAAA,UACF;AAAA,UACA,iBAAiB,CAACA,WAAU;AAC1B,gBAAI,CAACA,QAAO;AACV,yBAAW;AAAA,YACb,OAAO;AACL,+BAAiBA,MAAK;AAAA,YACxB;AAAA,UACF;AAAA;AAAA,MACF;AAAA;AAAA,EAEJ;AAEJ;","names":["Check","React","React","createContext","useContext","createScope","nextScopes","React","React","useLayoutEffect","React","React","value","React","React","React","React","node","React","React","Fragment","jsx","Slot","getElementRef","props","getElementRef","jsx","Node","Fragment","jsx","isFunction","useEffect","useState","useState","useEffect","jsx","jsxs","Checkbox","createContext","useContext","useEffect","useMemo","useState","useCallback","useState","jsx","createContext","useContext","clsx","forwardRef","clsx","jsx","jsxs","SolidButton","jsxs","clsx","jsx","forwardRef","IconButton","jsx","jsxs","clsx","clsx","jsx","jsx","jsxs","Check","Checkbox","clsx","forwardRef","useRef","clsx","useEffect","useState","useCallback","jsx","forwardRef","Input","useRef","clsx","value","jsx","clsx","value","clsx","createContext","forwardRef","useCallback","useContext","useEffect","useId","useImperativeHandle","useRef","useState","clsx","forwardRef","useCallback","useId","clsx","jsx","jsxs","clsx","forwardRef","Expandable","useCallback","useId","ExpandableUncontrolled","useCallback","useEffect","useId","useRef","useState","useEffect","useLayoutEffect","useState","listener","useRef","useState","useId","useCallback","useEffect","active","clsx","jsx","jsxs","jsxs","clsx","jsx","useCallback","useEffect","useState","useState","useCallback","useEffect","Fragment","jsx","jsxs","createContext","useContext","useState","useRef","useId","value","useCallback","isOpen","useEffect","forwardRef","SelectOption","clsx","SelectButton","useImperativeHandle","SelectChipDisplay","SelectContent","Select","SelectUncontrolled","MultiSelect","MultiSelectUncontrolled","MultiSelectChipDisplay","MultiSelectChipDisplayUncontrolled","jsx","clsx","clsx","jsx","jsxs","clsx","value","List","clsx","jsx","List","clsx","clsx","forwardRef","useId","clsx","jsx","jsxs","forwardRef","Textarea","clsx","jsx","clsx","value"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/properties/CheckboxProperty.tsx","../../../src/components/user-action/Checkbox.tsx","../../../node_modules/@radix-ui/react-checkbox/src/checkbox.tsx","../../../node_modules/@radix-ui/react-compose-refs/src/compose-refs.tsx","../../../node_modules/@radix-ui/react-context/src/create-context.tsx","../../../node_modules/@radix-ui/primitive/src/primitive.tsx","../../../node_modules/@radix-ui/react-use-controllable-state/src/use-controllable-state.tsx","../../../node_modules/@radix-ui/react-use-controllable-state/src/use-controllable-state-reducer.tsx","../../../node_modules/@radix-ui/react-use-layout-effect/src/use-layout-effect.tsx","../../../node_modules/@radix-ui/react-use-previous/src/use-previous.tsx","../../../node_modules/@radix-ui/react-use-size/src/use-size.tsx","../../../node_modules/@radix-ui/react-presence/src/presence.tsx","../../../node_modules/@radix-ui/react-presence/src/use-state-machine.tsx","../../../node_modules/@radix-ui/react-primitive/src/primitive.tsx","../../../node_modules/@radix-ui/react-slot/src/slot.tsx","../../../src/hooks/useOverwritableState.ts","../../../src/utils/resolveSetState.ts","../../../src/localization/LanguageProvider.tsx","../../../src/hooks/useLocalStorage.ts","../../../src/localization/util.ts","../../../src/localization/useTranslation.ts","../../../src/components/properties/PropertyBase.tsx","../../../src/components/user-action/Button.tsx","../../../src/localization/defaults/form.ts","../../../src/components/user-action/Label.tsx","../../../src/components/properties/DateProperty.tsx","../../../src/utils/date.ts","../../../src/components/user-action/input/Input.tsx","../../../src/hooks/useDelay.ts","../../../src/hooks/focus/useFocusManagement.ts","../../../src/components/properties/MultiSelectProperty.tsx","../../../src/components/user-action/select/Select.tsx","../../../src/components/layout/Expandable.tsx","../../../src/hooks/focus/useFocusTrap.ts","../../../src/hooks/focus/useIsMounted.ts","../../../src/utils/match.ts","../../../src/components/layout/Chip.tsx","../../../src/hooks/useFloatingElement.ts","../../../src/utils/math.ts","../../../src/components/properties/NumberProperty.tsx","../../../src/components/properties/SelectProperty.tsx","../../../src/components/properties/TextProperty.tsx","../../../src/components/user-action/Textarea.tsx"],"sourcesContent":["import { Check } from 'lucide-react'\nimport { Checkbox } from '../user-action/Checkbox'\nimport type { PropsForTranslation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport type { PropertyBaseProps } from './PropertyBase'\nimport { PropertyBase } from './PropertyBase'\nimport type { FormTranslationType } from '../../localization/defaults/form'\nimport { formTranslation } from '../../localization/defaults/form'\nimport { useId } from 'react'\nimport { Label } from '@/src/components/user-action/Label'\n\ntype CheckboxPropertyTranslation = FormTranslationType\n\nexport type CheckboxPropertyProps = Omit<PropertyBaseProps, 'icon' | 'input' | 'hasValue' | 'onRemove'> & {\n value?: boolean,\n onChange?: (value: boolean) => void,\n}\n\n/**\n * An Input component for a boolean values\n */\nexport const CheckboxProperty = ({\n overwriteTranslation,\n value,\n onChange,\n readOnly,\n ...baseProps\n }: PropsForTranslation<CheckboxPropertyTranslation, CheckboxPropertyProps>) => {\n const translation = useTranslation([formTranslation], overwriteTranslation)\n const id= useId()\n\n return (\n <PropertyBase\n {...baseProps}\n hasValue={true}\n readOnly={readOnly}\n icon={<Check size={24}/>}\n input={() => (\n <div className=\"flex-row-2 items-center\">\n <Checkbox\n id={id}\n checked={value ?? true}\n disabled={readOnly}\n onChange={onChange}\n aria-labelledby={id+'label'}\n />\n <Label id={id+'label'}>\n {`${translation('yes')}/${translation('no')}`}\n </Label>\n </div>\n )}\n />\n )\n}\n","import { Check, Minus } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { CheckboxProps as RadixCheckboxProps } from '@radix-ui/react-checkbox'\nimport { CheckboxIndicator as RadixCheckboxIndicator, Root as RadixCheckbox } from '@radix-ui/react-checkbox'\nimport { useOverwritableState } from '@/src/hooks/useOverwritableState'\n\ntype CheckBoxSize = 'sm' | 'md' | 'lg'\n\nconst checkboxSizeMapping: Record<CheckBoxSize, string> = {\n sm: 'size-5 border-1',\n md: 'size-6 border-1',\n lg: 'size-8 border-2',\n}\n\nconst checkboxIconSizeMapping: Record<CheckBoxSize, string> = {\n sm: 'size-4 stroke-3',\n md: 'size-5 stroke-3',\n lg: 'size-7 stroke-3',\n}\n\nexport type CheckboxProps = Omit<RadixCheckboxProps, 'checked' | 'onCheckedChange' | 'onChange'> & {\n checked?: boolean,\n indeterminate?: boolean,\n onChange?: (checked: boolean) => void,\n size?: CheckBoxSize,\n}\n\n/**\n * A Tristate checkbox\n *\n * The state is managed by the parent\n */\nexport const Checkbox = ({\n disabled,\n checked = false,\n indeterminate = false,\n onChange,\n size = 'md',\n className = '',\n ...props\n }: CheckboxProps) => {\n const usedSizeClass = checkboxSizeMapping[size]\n const innerIconSize = checkboxIconSizeMapping[size]\n\n return (\n <RadixCheckbox\n {...props}\n disabled={disabled}\n checked={indeterminate ? 'indeterminate' : checked}\n onCheckedChange={onChange}\n className={clsx(\n usedSizeClass,\n `flex-col-0 items-center justify-center rounded`,\n {\n 'text-disabled border-disabled-outline bg-disabled-background cursor-not-allowed': disabled,\n 'hover:border-primary': !disabled,\n 'bg-input-background': !disabled && !checked,\n 'bg-primary/30 border-primary text-primary': !disabled && (checked || indeterminate),\n },\n className\n )}\n >\n <RadixCheckboxIndicator>\n {!checked && !indeterminate && <div className={clsx('bg-input-background', innerIconSize)}/>}\n {checked && !indeterminate && <Check className={innerIconSize}/>}\n {indeterminate && <Minus className={innerIconSize}/>}\n </RadixCheckboxIndicator>\n </RadixCheckbox>\n )\n}\n\nexport type CheckboxUncontrolledProps = CheckboxProps\n\n/**\n * A Tristate checkbox\n *\n * The state is managed by this component\n */\nexport const CheckboxUncontrolled = ({\n checked: initialChecked,\n onChange,\n ...props\n }: CheckboxUncontrolledProps) => {\n const [checked, setChecked] = useOverwritableState(initialChecked, onChange)\n\n return (\n <Checkbox\n {...props}\n checked={checked}\n onChange={setChecked}\n />\n )\n}","import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst CHECKBOX_NAME = 'Checkbox';\n\ntype ScopedProps<P> = P & { __scopeCheckbox?: Scope };\nconst [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);\n\ntype CheckedState = boolean | 'indeterminate';\n\ntype CheckboxContextValue<State extends CheckedState | boolean = CheckedState> = {\n checked: State | boolean;\n setChecked: React.Dispatch<React.SetStateAction<State | boolean>>;\n disabled: boolean | undefined;\n control: HTMLButtonElement | null;\n setControl: React.Dispatch<React.SetStateAction<HTMLButtonElement | null>>;\n name: string | undefined;\n form: string | undefined;\n value: string | number | readonly string[];\n hasConsumerStoppedPropagationRef: React.RefObject<boolean>;\n required: boolean | undefined;\n defaultChecked: boolean | undefined;\n isFormControl: boolean;\n bubbleInput: HTMLInputElement | null;\n setBubbleInput: React.Dispatch<React.SetStateAction<HTMLInputElement | null>>;\n};\n\nconst [CheckboxProviderImpl, useCheckboxContext] =\n createCheckboxContext<CheckboxContextValue>(CHECKBOX_NAME);\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface CheckboxProviderProps<State extends CheckedState = CheckedState> {\n checked?: State | boolean;\n defaultChecked?: State | boolean;\n required?: boolean;\n onCheckedChange?(checked: State | boolean): void;\n name?: string;\n form?: string;\n disabled?: boolean;\n value?: string | number | readonly string[];\n children?: React.ReactNode;\n}\n\nfunction CheckboxProvider<State extends CheckedState = CheckedState>(\n props: ScopedProps<CheckboxProviderProps<State>>\n) {\n const {\n __scopeCheckbox,\n checked: checkedProp,\n children,\n defaultChecked,\n disabled,\n form,\n name,\n onCheckedChange,\n required,\n value = 'on',\n // @ts-expect-error\n internal_do_not_use_render,\n } = props;\n\n const [checked, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked ?? false,\n onChange: onCheckedChange,\n caller: CHECKBOX_NAME,\n });\n const [control, setControl] = React.useState<HTMLButtonElement | null>(null);\n const [bubbleInput, setBubbleInput] = React.useState<HTMLInputElement | null>(null);\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n const isFormControl = control\n ? !!form || !!control.closest('form')\n : // We set this to true by default so that events bubble to forms without JS (SSR)\n true;\n\n const context: CheckboxContextValue<State> = {\n checked: checked,\n disabled: disabled,\n setChecked: setChecked,\n control: control,\n setControl: setControl,\n name: name,\n form: form,\n value: value,\n hasConsumerStoppedPropagationRef: hasConsumerStoppedPropagationRef,\n required: required,\n defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,\n isFormControl: isFormControl,\n bubbleInput,\n setBubbleInput,\n };\n\n return (\n <CheckboxProviderImpl\n scope={__scopeCheckbox}\n {...(context as unknown as CheckboxContextValue<CheckedState>)}\n >\n {isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children}\n </CheckboxProviderImpl>\n );\n}\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'CheckboxTrigger';\n\ninterface CheckboxTriggerProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof Primitive.button>,\n keyof CheckboxProviderProps\n > {\n children?: React.ReactNode;\n}\n\nconst CheckboxTrigger = React.forwardRef<HTMLButtonElement, CheckboxTriggerProps>(\n (\n { __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }: ScopedProps<CheckboxTriggerProps>,\n forwardedRef\n ) => {\n const {\n control,\n value,\n disabled,\n checked,\n required,\n setControl,\n setChecked,\n hasConsumerStoppedPropagationRef,\n isFormControl,\n bubbleInput,\n } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);\n const composedRefs = useComposedRefs(forwardedRef, setControl);\n\n const initialCheckedStateRef = React.useRef(checked);\n React.useEffect(() => {\n const form = control?.form;\n if (form) {\n const reset = () => setChecked(initialCheckedStateRef.current);\n form.addEventListener('reset', reset);\n return () => form.removeEventListener('reset', reset);\n }\n }, [control, setChecked]);\n\n return (\n <Primitive.button\n type=\"button\"\n role=\"checkbox\"\n aria-checked={isIndeterminate(checked) ? 'mixed' : checked}\n aria-required={required}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n value={value}\n {...checkboxProps}\n ref={composedRefs}\n onKeyDown={composeEventHandlers(onKeyDown, (event) => {\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n if (event.key === 'Enter') event.preventDefault();\n })}\n onClick={composeEventHandlers(onClick, (event) => {\n setChecked((prevChecked) => (isIndeterminate(prevChecked) ? true : !prevChecked));\n if (bubbleInput && isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if checkbox has a bubble input and is a form control, stop\n // propagation from the button so that we only propagate one click\n // event (from the input). We propagate changes from an input so\n // that native form validation works and form events reflect\n // checkbox updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n );\n }\n);\n\nCheckboxTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Checkbox\n * -----------------------------------------------------------------------------------------------*/\n\ntype CheckboxElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface CheckboxProps extends Omit<PrimitiveButtonProps, 'checked' | 'defaultChecked'> {\n checked?: CheckedState;\n defaultChecked?: CheckedState;\n required?: boolean;\n onCheckedChange?(checked: CheckedState): void;\n}\n\nconst Checkbox = React.forwardRef<CheckboxElement, CheckboxProps>(\n (props: ScopedProps<CheckboxProps>, forwardedRef) => {\n const {\n __scopeCheckbox,\n name,\n checked,\n defaultChecked,\n required,\n disabled,\n value,\n onCheckedChange,\n form,\n ...checkboxProps\n } = props;\n\n return (\n <CheckboxProvider\n __scopeCheckbox={__scopeCheckbox}\n checked={checked}\n defaultChecked={defaultChecked}\n disabled={disabled}\n required={required}\n onCheckedChange={onCheckedChange}\n name={name}\n form={form}\n value={value}\n // @ts-expect-error\n internal_do_not_use_render={({ isFormControl }: CheckboxContextValue) => (\n <>\n <CheckboxTrigger\n {...checkboxProps}\n ref={forwardedRef}\n // @ts-expect-error\n __scopeCheckbox={__scopeCheckbox}\n />\n {isFormControl && (\n <CheckboxBubbleInput\n // @ts-expect-error\n __scopeCheckbox={__scopeCheckbox}\n />\n )}\n </>\n )}\n />\n );\n }\n);\n\nCheckbox.displayName = CHECKBOX_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'CheckboxIndicator';\n\ntype CheckboxIndicatorElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface CheckboxIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst CheckboxIndicator = React.forwardRef<CheckboxIndicatorElement, CheckboxIndicatorProps>(\n (props: ScopedProps<CheckboxIndicatorProps>, forwardedRef) => {\n const { __scopeCheckbox, forceMount, ...indicatorProps } = props;\n const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);\n return (\n <Presence\n present={forceMount || isIndeterminate(context.checked) || context.checked === true}\n >\n <Primitive.span\n data-state={getState(context.checked)}\n data-disabled={context.disabled ? '' : undefined}\n {...indicatorProps}\n ref={forwardedRef}\n style={{ pointerEvents: 'none', ...props.style }}\n />\n </Presence>\n );\n }\n);\n\nCheckboxIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'CheckboxBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;\ninterface CheckboxBubbleInputProps extends Omit<InputProps, 'checked'> {}\n\nconst CheckboxBubbleInput = React.forwardRef<HTMLInputElement, CheckboxBubbleInputProps>(\n ({ __scopeCheckbox, ...props }: ScopedProps<CheckboxBubbleInputProps>, forwardedRef) => {\n const {\n control,\n hasConsumerStoppedPropagationRef,\n checked,\n defaultChecked,\n required,\n disabled,\n name,\n value,\n form,\n bubbleInput,\n setBubbleInput,\n } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);\n\n const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = bubbleInput;\n if (!input) return;\n\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n 'checked'\n ) as PropertyDescriptor;\n const setChecked = descriptor.set;\n\n const bubbles = !hasConsumerStoppedPropagationRef.current;\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles });\n input.indeterminate = isIndeterminate(checked);\n setChecked.call(input, isIndeterminate(checked) ? false : checked);\n input.dispatchEvent(event);\n }\n }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);\n\n const defaultCheckedRef = React.useRef(isIndeterminate(checked) ? false : checked);\n return (\n <Primitive.input\n type=\"checkbox\"\n aria-hidden\n defaultChecked={defaultChecked ?? defaultCheckedRef.current}\n required={required}\n disabled={disabled}\n name={name}\n value={value}\n form={form}\n {...props}\n tabIndex={-1}\n ref={composedRefs}\n style={{\n ...props.style,\n ...controlSize,\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n transform: 'translateX(-100%)',\n }}\n />\n );\n }\n);\n\nCheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n\nfunction isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n return checked === 'indeterminate';\n}\n\nfunction getState(checked: CheckedState) {\n return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n}\n\nexport {\n createCheckboxScope,\n //\n Checkbox,\n CheckboxProvider,\n CheckboxTrigger,\n CheckboxIndicator,\n CheckboxBubbleInput,\n //\n Checkbox as Root,\n CheckboxProvider as Provider,\n CheckboxTrigger as Trigger,\n CheckboxIndicator as Indicator,\n CheckboxBubbleInput as BubbleInput,\n};\nexport type {\n CheckboxProps,\n CheckboxProviderProps,\n CheckboxTriggerProps,\n CheckboxIndicatorProps,\n CheckboxBubbleInputProps,\n CheckedState,\n};\n","import * as React from 'react';\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == 'function') {\n hasCleanup = true;\n }\n return cleanup;\n });\n\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == 'function') {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n","import * as React from 'react';\n\nfunction createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n) {\n const Context = React.createContext<ContextValueType | undefined>(defaultContext);\n\n const Provider: React.FC<ContextValueType & { children: React.ReactNode }> = (props) => {\n const { children, ...context } = props;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return <Context.Provider value={value}>{children}</Context.Provider>;\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * createContextScope\n * -----------------------------------------------------------------------------------------------*/\n\ntype Scope<C = any> = { [scopeName: string]: React.Context<C>[] } | undefined;\ntype ScopeHook = (scope: Scope) => { [__scopeProp: string]: Scope };\ninterface CreateScope {\n scopeName: string;\n (): ScopeHook;\n}\n\nfunction createContextScope(scopeName: string, createContextScopeDeps: CreateScope[] = []) {\n let defaultContexts: any[] = [];\n\n /* -----------------------------------------------------------------------------------------------\n * createContext\n * ---------------------------------------------------------------------------------------------*/\n\n function createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n ) {\n const BaseContext = React.createContext<ContextValueType | undefined>(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n\n const Provider: React.FC<\n ContextValueType & { scope: Scope<ContextValueType>; children: React.ReactNode }\n > = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return <Context.Provider value={value}>{children}</Context.Provider>;\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string, scope: Scope<ContextValueType | undefined>) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n }\n\n /* -----------------------------------------------------------------------------------------------\n * createScope\n * ---------------------------------------------------------------------------------------------*/\n\n const createScope: CreateScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope: Scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n\n createScope.scopeName = scopeName;\n return [createContext, composeContextScopes(createScope, ...createContextScopeDeps)] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * composeContextScopes\n * -----------------------------------------------------------------------------------------------*/\n\nfunction composeContextScopes(...scopes: CreateScope[]) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n\n const createScope: CreateScope = () => {\n const scopeHooks = scopes.map((createScope) => ({\n useScope: createScope(),\n scopeName: createScope.scopeName,\n }));\n\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {\n // We are calling a hook inside a callback which React warns against to avoid inconsistent\n // renders, however, scoping doesn't have render side effects so we ignore the rule.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes, ...currentScope };\n }, {});\n\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { createContext, createContextScope };\nexport type { CreateScope, Scope };\n","function composeEventHandlers<E extends { defaultPrevented: boolean }>(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\n\nexport { composeEventHandlers };\n","import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// Prevent bundlers from trying to optimize the import\nconst useInsertionEffect: typeof useLayoutEffect =\n (React as any)[' useInsertionEffect '.trim().toString()] || useLayoutEffect;\n\ntype ChangeHandler<T> = (state: T) => void;\ntype SetStateFn<T> = React.Dispatch<React.SetStateAction<T>>;\n\ninterface UseControllableStateParams<T> {\n prop?: T | undefined;\n defaultProp: T;\n onChange?: ChangeHandler<T>;\n caller?: string;\n}\n\nexport function useControllableState<T>({\n prop,\n defaultProp,\n onChange = () => {},\n caller,\n}: UseControllableStateParams<T>): [T, SetStateFn<T>] {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange,\n });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (process.env.NODE_ENV !== 'production') {\n const isControlledRef = React.useRef(prop !== undefined);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? 'controlled' : 'uncontrolled';\n const to = isControlled ? 'controlled' : 'uncontrolled';\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n const setValue = React.useCallback<SetStateFn<T>>(\n (nextValue) => {\n if (isControlled) {\n const value = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value !== prop) {\n onChangeRef.current?.(value);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n\n return [value, setValue];\n}\n\nfunction useUncontrolledState<T>({\n defaultProp,\n onChange,\n}: Omit<UseControllableStateParams<T>, 'prop'>): [\n Value: T,\n setValue: React.Dispatch<React.SetStateAction<T>>,\n OnChangeRef: React.RefObject<ChangeHandler<T> | undefined>,\n] {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n\n return [value, setValue, onChangeRef];\n}\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n","import * as React from 'react';\nimport { useEffectEvent } from '@radix-ui/react-use-effect-event';\n\ntype ChangeHandler<T> = (state: T) => void;\n\ninterface UseControllableStateParams<T> {\n prop: T | undefined;\n defaultProp: T;\n onChange: ChangeHandler<T> | undefined;\n caller: string;\n}\n\ninterface AnyAction {\n type: string;\n}\n\nconst SYNC_STATE = Symbol('RADIX:SYNC_STATE');\n\ninterface SyncStateAction<T> {\n type: typeof SYNC_STATE;\n state: T;\n}\n\nexport function useControllableStateReducer<T, S extends {}, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialState: S\n): [S & { state: T }, React.Dispatch<A>];\n\nexport function useControllableStateReducer<T, S extends {}, I, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialArg: I,\n init: (i: I & { state: T }) => S\n): [S & { state: T }, React.Dispatch<A>];\n\nexport function useControllableStateReducer<T, S extends {}, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialArg: any,\n init?: (i: any) => Omit<S, 'state'>\n): [S & { state: T }, React.Dispatch<A>] {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== undefined;\n\n const onChange = useEffectEvent(onChangeProp);\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (process.env.NODE_ENV !== 'production') {\n const isControlledRef = React.useRef(controlledState !== undefined);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? 'controlled' : 'uncontrolled';\n const to = isControlled ? 'controlled' : 'uncontrolled';\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n type InternalState = S & { state: T };\n const args: [InternalState] = [{ ...initialArg, state: defaultProp }];\n if (init) {\n // @ts-expect-error\n args.push(init);\n }\n\n const [internalState, dispatch] = React.useReducer(\n (state: InternalState, action: A | SyncStateAction<T>): InternalState => {\n if (action.type === SYNC_STATE) {\n return { ...state, state: action.state };\n }\n\n const next = reducer(state, action);\n if (isControlled && !Object.is(next.state, state.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n\n const uncontrolledState = internalState.state;\n const prevValueRef = React.useRef(uncontrolledState);\n React.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n\n const state = React.useMemo(() => {\n const isControlled = controlledState !== undefined;\n if (isControlled) {\n return { ...internalState, state: controlledState };\n }\n\n return internalState;\n }, [internalState, controlledState]);\n\n React.useEffect(() => {\n // Sync internal state for controlled components so that reducer is called\n // with the correct state values\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n\n return [state, dispatch as React.Dispatch<A>];\n}\n","import * as React from 'react';\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nconst useLayoutEffect = globalThis?.document ? React.useLayoutEffect : () => {};\n\nexport { useLayoutEffect };\n","import * as React from 'react';\n\nfunction usePrevious<T>(value: T) {\n const ref = React.useRef({ value, previous: value });\n\n // We compare values before making an update to ensure that\n // a change has been made. This ensures the previous value is\n // persisted correctly between renders.\n return React.useMemo(() => {\n if (ref.current.value !== value) {\n ref.current.previous = ref.current.value;\n ref.current.value = value;\n }\n return ref.current.previous;\n }, [value]);\n}\n\nexport { usePrevious };\n","/// <reference types=\"resize-observer-browser\" />\n\nimport * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\nfunction useSize(element: HTMLElement | null) {\n const [size, setSize] = React.useState<{ width: number; height: number } | undefined>(undefined);\n\n useLayoutEffect(() => {\n if (element) {\n // provide size as early as possible\n setSize({ width: element.offsetWidth, height: element.offsetHeight });\n\n const resizeObserver = new ResizeObserver((entries) => {\n if (!Array.isArray(entries)) {\n return;\n }\n\n // Since we only observe the one element, we don't need to loop over the\n // array\n if (!entries.length) {\n return;\n }\n\n const entry = entries[0];\n let width: number;\n let height: number;\n\n if ('borderBoxSize' in entry) {\n const borderSizeEntry = entry['borderBoxSize'];\n // iron out differences between browsers\n const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n width = borderSize['inlineSize'];\n height = borderSize['blockSize'];\n } else {\n // for browsers that don't support `borderBoxSize`\n // we calculate it ourselves to get the correct border box.\n width = element.offsetWidth;\n height = element.offsetHeight;\n }\n\n setSize({ width, height });\n });\n\n resizeObserver.observe(element, { box: 'border-box' });\n\n return () => resizeObserver.unobserve(element);\n } else {\n // We only want to reset to `undefined` when the element becomes `null`,\n // not if it changes to another element.\n setSize(undefined);\n }\n }, [element]);\n\n return size;\n}\n\nexport { useSize };\n","import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useStateMachine } from './use-state-machine';\n\ninterface PresenceProps {\n children: React.ReactElement | ((props: { present: boolean }) => React.ReactElement);\n present: boolean;\n}\n\nconst Presence: React.FC<PresenceProps> = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n\n const child = (\n typeof children === 'function'\n ? children({ present: presence.isPresent })\n : React.Children.only(children)\n ) as React.ReactElement<{ ref?: React.Ref<HTMLElement> }>;\n\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;\n};\n\nPresence.displayName = 'Presence';\n\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/\n\nfunction usePresence(present: boolean) {\n const [node, setNode] = React.useState<HTMLElement>();\n const stylesRef = React.useRef<CSSStyleDeclaration | null>(null);\n const prevPresentRef = React.useRef(present);\n const prevAnimationNameRef = React.useRef<string>('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended',\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted',\n },\n unmounted: {\n MOUNT: 'mounted',\n },\n });\n\n React.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [state]);\n\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n\n if (present) {\n send('MOUNT');\n } else if (currentAnimationName === 'none' || styles?.display === 'none') {\n // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n } else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */\n const isAnimating = prevAnimationName !== currentAnimationName;\n\n if (wasPresent && isAnimating) {\n send('ANIMATION_OUT');\n } else {\n send('UNMOUNT');\n }\n }\n\n prevPresentRef.current = present;\n }\n }, [present, send]);\n\n useLayoutEffect(() => {\n if (node) {\n let timeoutId: number;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */\n const handleAnimationEnd = (event: AnimationEvent) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n // With React 18 concurrency this update is applied a frame after the\n // animation ends, creating a flash of visible content. By setting the\n // animation fill mode to \"forwards\", we force the node to keep the\n // styles of the last keyframe, removing the flash.\n //\n // Previously we flushed the update via ReactDom.flushSync, but with\n // exit animations this resulted in the node being removed from the\n // DOM before the synthetic animationEnd event was dispatched, meaning\n // user-provided event handlers would not be called.\n // https://github.com/radix-ui/primitives/pull/1849\n send('ANIMATION_END');\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = 'forwards';\n // Reset the style after the node had time to unmount (for cases\n // where the component chooses not to unmount). Doing this any\n // sooner than `setTimeout` (e.g. with `requestAnimationFrame`)\n // still causes a flash.\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === 'forwards') {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event: AnimationEvent) => {\n if (event.target === node) {\n // if animation occurred, store its name as the previous animation.\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener('animationstart', handleAnimationStart);\n node.addEventListener('animationcancel', handleAnimationEnd);\n node.addEventListener('animationend', handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener('animationstart', handleAnimationStart);\n node.removeEventListener('animationcancel', handleAnimationEnd);\n node.removeEventListener('animationend', handleAnimationEnd);\n };\n } else {\n // Transition to the unmounted state if the node is removed prematurely.\n // We avoid doing so during cleanup as the node may change but still exist.\n send('ANIMATION_END');\n }\n }, [node, send]);\n\n return {\n isPresent: ['mounted', 'unmountSuspended'].includes(state),\n ref: React.useCallback((node: HTMLElement) => {\n stylesRef.current = node ? getComputedStyle(node) : null;\n setNode(node);\n }, []),\n };\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getAnimationName(styles: CSSStyleDeclaration | null) {\n return styles?.animationName || 'none';\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement<{ ref?: React.Ref<unknown> }>) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n\n // Not DEV\n return element.props.ref || (element as any).ref;\n}\n\nconst Root = Presence;\n\nexport {\n Presence,\n //\n Root,\n};\nexport type { PresenceProps };\n","import * as React from 'react';\n\ntype Machine<S> = { [k: string]: { [k: string]: S } };\ntype MachineState<T> = keyof T;\ntype MachineEvent<T> = keyof UnionToIntersection<T[keyof T]>;\n\n// 🤯 https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine<M>(\n initialState: MachineState<M>,\n machine: M & Machine<MachineState<M>>\n) {\n return React.useReducer((state: MachineState<M>, event: MachineEvent<M>): MachineState<M> => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\n }, initialState);\n}\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createSlot } from '@radix-ui/react-slot';\n\nconst NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'select',\n 'span',\n 'svg',\n 'ul',\n] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E> };\ntype PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent<E extends React.ElementType>\n extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props: PrimitivePropsWithRef<typeof node>, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click 👎\n * target.dispatchEvent(new Event(‘click’))\n *\n * dispatching a custom type within a non-discrete event 👎\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}\n *\n * dispatching a custom type within a `discrete` event 👍\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n","import * as React from 'react';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement)\n ? (newElement.props as { children: React.ReactNode }).children\n : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nconst Slot = createSlot('Slot');\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ function createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLOTTABLE_IDENTIFIER = Symbol('radix.slottable');\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable('Slottable');\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(\n child: React.ReactNode\n): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) &&\n typeof child.type === 'function' &&\n '__radixId' in child.type &&\n child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n // all child props should override\n const overrideProps = { ...childProps };\n\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n }\n // but if it exists only on the slot, we use only this one\n else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n\n // Not DEV\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as any).ref;\n}\n\nexport {\n Slot,\n Slottable,\n //\n Slot as Root,\n};\nexport type { SlotProps };\n","import type React from 'react'\nimport { useEffect, useState } from 'react'\nimport { resolveSetState } from '@/src/utils/resolveSetState'\n\nexport const useOverwritableState = <T>(initialValue?: T, onChange?: (value: T) => void): [T, React.Dispatch<React.SetStateAction<T>>] => {\n const [state, setState] = useState<T>(initialValue)\n\n useEffect(() => {\n setState(initialValue)\n }, [initialValue])\n\n const onChangeWrapper: React.Dispatch<React.SetStateAction<T>> = (action) => {\n const resolved = resolveSetState(action, state)\n setState(resolved)\n onChange?.(state)\n }\n\n return [state, onChangeWrapper]\n}","import type { SetStateAction } from 'react'\n\nexport function resolveSetState<T>(action: SetStateAction<T>, prev: T): T {\n return typeof action === 'function' ? (action as (prev: T) => T)(prev) : action\n}","import type { Dispatch, PropsWithChildren, SetStateAction } from 'react'\nimport { createContext, useContext, useEffect, useMemo, useState } from 'react'\nimport { useLocalStorage } from '../hooks/useLocalStorage'\nimport type { Language } from './util'\nimport { LanguageUtil } from './util'\n\nexport type LanguageContextValue = {\n language: Language,\n setLanguage: Dispatch<SetStateAction<Language>>,\n}\n\nexport const LanguageContext = createContext<LanguageContextValue>({\n language: LanguageUtil.DEFAULT_LANGUAGE,\n setLanguage: (v) => v\n})\n\ntype LanguageWithSystem = Language | 'system'\n\ntype LanguageProviderProps = {\n language?: LanguageWithSystem,\n}\n\nexport const LanguageProvider = ({ children, language }: PropsWithChildren<LanguageProviderProps>) => {\n const {\n value: storedLanguage,\n setValue: setStoredLanguage,\n deleteValue: deleteStoredLanguage\n } = useLocalStorage<LanguageWithSystem>('language', 'system')\n const [languagePreference, setLanguagePreference] = useState<LanguageWithSystem>('system')\n\n const resolvedLanguage = useMemo(() => {\n if (language && language !== 'system') {\n return language\n }\n if (storedLanguage && storedLanguage !== 'system') {\n return storedLanguage\n }\n if (languagePreference !== 'system') {\n return languagePreference\n }\n return LanguageUtil.DEFAULT_LANGUAGE\n }, [language, languagePreference, storedLanguage])\n\n useEffect(() => {\n if(!language) return\n if (language === 'system') {\n deleteStoredLanguage()\n } else {\n setStoredLanguage(language)\n }\n }, [language]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n const LanguageToTestAgainst = Object.values(LanguageUtil.languages)\n\n const detectLanguage = () => {\n const matchingBrowserLanguage = window.navigator.languages\n .map(language =>\n LanguageToTestAgainst.find(\n (test) => language === test || language.split('-')[0] === test\n ))\n .filter((entry): entry is Language => entry !== undefined)\n\n if (matchingBrowserLanguage.length === 0) return\n\n const firstMatch = matchingBrowserLanguage[0]\n setLanguagePreference(firstMatch)\n }\n detectLanguage()\n\n window.addEventListener('languagechange', detectLanguage)\n return () => {\n window.removeEventListener('languagechange', detectLanguage)\n }\n }, [])\n\n return (\n <LanguageContext.Provider value={{\n language: resolvedLanguage,\n setLanguage: (newLanguage) => {\n if (language !== 'system') {\n console.warn('LanguageProvider: Attempting to change the ' +\n \"language while setting a fixed language won't have any effect. \" +\n 'Change the language provided to the LanguageProvider instead.')\n }\n setStoredLanguage(newLanguage)\n }\n }}>\n {children}\n </LanguageContext.Provider>\n )\n}\n\nexport const useLanguage = () => {\n const context = useContext(LanguageContext)\n if (!context) {\n throw new Error('useLanguage must be used within LanguageContext. Try adding a LanguageProvider around your app.')\n }\n return context\n}\n\nexport const useLocale = (overWriteLanguage?: Language) => {\n const { language } = useLanguage()\n const mapping: Record<Language, string> = {\n en: 'en-US',\n de: 'de-DE'\n }\n return mapping[overWriteLanguage ?? language]\n}\n","'use client'\n\nimport type { Dispatch, SetStateAction } from 'react'\nimport { useCallback, useState } from 'react'\nimport { LocalStorageService } from '@/src/utils/storage'\nimport { resolveSetState } from '@/src/utils/resolveSetState'\n\ntype SetValue<T> = Dispatch<SetStateAction<T>>\n\ntype UseLocalStorageResult<T> = {\n value: T,\n setValue: SetValue<T>,\n deleteValue: () => void,\n}\n\n/**\n * @param key Key under which to save the data\n * @param backupValue Used if the storage is unavailable or no value is present\n *\n * The backup value will never be saved to the storage unless you explicitly\n */\nexport const useLocalStorage = <T>(key: string, backupValue: T): UseLocalStorageResult<T> => {\n const get = useCallback((): T => {\n if (typeof window === 'undefined') {\n return backupValue\n }\n const storageService = new LocalStorageService()\n try {\n const value = storageService.get<T>(key)\n return value || backupValue\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (_) {\n console.warn('useLocalStorage: Error while reading the stored value. Make sure your typing is correct.')\n storageService.delete(key)\n console.info(`useLocalStorage: deleted erroneous value for key: ${key}`)\n return backupValue\n }\n }, [backupValue, key])\n\n const [storedValue, setStoredValue] = useState<T>(get)\n\n const setValue: SetValue<T> = useCallback(action => {\n const newValue = resolveSetState(action, storedValue)\n const storageService = new LocalStorageService()\n storageService.set(key, newValue)\n\n setStoredValue(newValue)\n }, [storedValue, setStoredValue, key])\n\n const deleteValue = () => {\n const storageService = new LocalStorageService()\n storageService.delete(key)\n setStoredValue(backupValue)\n }\n\n return { value: storedValue, setValue, deleteValue }\n}","/**\n * The supported languages\n */\nconst languages = ['en', 'de'] as const\n\n/**\n * The supported languages\n */\nexport type Language = typeof languages[number]\n\n/**\n * The supported languages' names in their respective language\n */\nconst languagesLocalNames: Record<Language, string> = {\n en: 'English',\n de: 'Deutsch',\n}\n\n/**\n * The default language\n */\nconst DEFAULT_LANGUAGE: Language = 'en'\n\n/**\n * A constant definition for holding data regarding languages\n */\nexport const LanguageUtil = {\n languages,\n DEFAULT_LANGUAGE,\n languagesLocalNames,\n}","import { useLanguage } from './LanguageProvider'\nimport type { Language } from './util'\n\n/**\n * A type describing the pluralization of a word\n */\nexport type TranslationPlural = {\n zero?: string,\n one?: string,\n two?: string,\n few?: string,\n many?: string,\n other: string,\n}\n\n/**\n * The type describing all values of a translation\n */\nexport type TranslationType = Record<string, string | TranslationPlural>\n\n/**\n * The type of translations\n */\nexport type Translation<T extends TranslationType> = Record<Language, T>\n\ntype OverwriteTranslationType<T extends TranslationType> = {\n language?: Language,\n translation?: Translation<Partial<T>>,\n}\n\n/**\n * Adds the `language` prop to the component props.\n *\n * @param Translation the type of the translation object\n *\n * @param Props the type of the component props, defaults to `Record<string, never>`,\n * if you don't expect any other props other than `language` and get an\n * error when using your component (because it uses `forwardRef` etc.)\n * you can try out `Record<string, unknown>`, this might resolve your\n * problem as `SomeType & never` is still `never` but `SomeType & unknown`\n * is `SomeType` which means that adding back props (like `ref` etc.)\n * works properly\n */\nexport type PropsForTranslation<\n Translation extends TranslationType,\n Props = unknown\n> = Props & {\n overwriteTranslation?: OverwriteTranslationType<Translation>,\n}\n\ntype StringKeys<T> = Extract<keyof T, string>;\n\ntype TranslationFunctionOptions = {\n replacements?: Record<string, string>,\n count?: number,\n}\ntype TranslationFunction<T extends TranslationType> = (key: StringKeys<T>, options?: TranslationFunctionOptions) => string\n\nexport const TranslationPluralCount = {\n zero: 0,\n one: 1,\n two: 2,\n few: 3,\n many: 11,\n other: -1,\n}\n\n\nexport const useTranslation = <T extends TranslationType>(\n translations: Translation<Partial<TranslationType>>[],\n overwriteTranslation: OverwriteTranslationType<T> = {}\n): TranslationFunction<T> => {\n const { language: languageProp, translation: overwrite } = overwriteTranslation\n const { language: inferredLanguage } = useLanguage()\n const usedLanguage = languageProp ?? inferredLanguage\n const usedTranslations = [...translations]\n if (overwrite) {\n usedTranslations.push(overwrite)\n }\n\n return (key: StringKeys<T>, options?: TranslationFunctionOptions): string => {\n const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options }\n\n try {\n for (let i = translations.length - 1; i >= 0; i--) {\n const translation = translations[i]\n const localizedTranslation = translation[usedLanguage]\n if (!localizedTranslation) {\n continue\n }\n const value = localizedTranslation[key]\n if(!value) {\n continue\n }\n\n let forProcessing: string\n if (typeof value !== 'string') {\n if (count === TranslationPluralCount.zero && value?.zero) {\n forProcessing = value.zero\n } else if (count === TranslationPluralCount.one && value?.one) {\n forProcessing = value.one\n } else if (count === TranslationPluralCount.two && value?.two) {\n forProcessing = value.two\n } else if (TranslationPluralCount.few <= count && count < TranslationPluralCount.many && value?.few) {\n forProcessing = value.few\n } else if (count > TranslationPluralCount.many && value?.many) {\n forProcessing = value.many\n } else {\n forProcessing = value.other\n }\n } else {\n forProcessing = value\n }\n forProcessing = forProcessing.replace(/\\{\\{(\\w+)}}/g, (_, placeholder) => {\n return replacements[placeholder] ?? `{{key:${placeholder}}}` // fallback if key is missing\n })\n return forProcessing\n }\n } catch (e) {\n console.error(e)\n }\n return `{{${usedLanguage}:${key}}}`\n }\n}","import type { ReactNode } from 'react'\nimport { AlertTriangle } from 'lucide-react'\nimport clsx from 'clsx'\nimport { TextButton } from '../user-action/Button'\nimport type { PropsForTranslation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport type { FormTranslationType } from '../../localization/defaults/form'\nimport { formTranslation } from '../../localization/defaults/form'\n\ntype PropertyBaseTranslation = FormTranslationType\n\nexport type PropertyBaseProps = {\n name: string,\n input: (props: { softRequired: boolean, hasValue: boolean }) => ReactNode,\n onRemove?: () => void,\n hasValue: boolean,\n softRequired?: boolean,\n readOnly?: boolean,\n icon?: ReactNode,\n className?: string,\n}\n\n/**\n * A component for showing a properties with uniform styling\n */\nexport const PropertyBase = ({\n overwriteTranslation,\n name,\n input,\n softRequired = false,\n hasValue,\n icon,\n readOnly,\n onRemove,\n className = '',\n }: PropsForTranslation<PropertyBaseTranslation, PropertyBaseProps>) => {\n const translation = useTranslation([formTranslation], overwriteTranslation)\n const requiredAndNoValue = softRequired && !hasValue\n return (\n <div className={clsx('flex-row-0 group', className)}>\n <div\n className={clsx(\n 'flex-row-2 max-w-48 min-w-48 px-3 py-2 items-center rounded-l-xl border-2 border-r-0', {\n 'bg-property-title-background text-property-title-text group-hover:border-primary': !requiredAndNoValue,\n 'bg-warning text-surface-warning group-hover:border-warning border-warning/90': requiredAndNoValue,\n }, className\n )}\n >\n <div className=\"max-w-6 min-w-6 text-text-primary\">{icon}</div>\n <span className=\"font-semibold\">{name}</span>\n </div>\n <div\n className={clsx(\n 'flex-row-2 grow px-3 py-2 justify-between items-center rounded-r-xl border-2 border-l-0 min-h-15', {\n 'bg-input-background text-input-text group-hover:border-primary': !requiredAndNoValue,\n 'bg-surface-warning group-hover:border-warning border-warning/90': requiredAndNoValue,\n }, className\n )}\n >\n {input({ softRequired, hasValue })}\n {requiredAndNoValue && (\n <div className=\"text-warning\"><AlertTriangle size={24}/></div>\n )}\n {onRemove && !readOnly && (\n <TextButton\n onClick={onRemove}\n color=\"negative\"\n className={clsx('items-center')}\n disabled={!hasValue}\n >\n {translation('remove')}\n </TextButton>\n )}\n </div>\n </div>\n )\n}\n","import type { ButtonHTMLAttributes, ReactNode } from 'react'\nimport { forwardRef } from 'react'\nimport clsx from 'clsx'\n\n\nexport const ButtonColorUtil = {\n solid: ['primary', 'secondary', 'tertiary', 'positive', 'warning', 'negative', 'neutral'] as const,\n text: ['primary', 'negative', 'neutral'] as const,\n outline: ['primary'] as const,\n}\n\nexport const IconButtonUtil = {\n icon: [...ButtonColorUtil.solid, 'transparent'] as const,\n}\n\n\n/**\n * The allowed colors for the SolidButton and IconButton\n */\nexport type SolidButtonColor = typeof ButtonColorUtil.solid[number]\n/**\n * The allowed colors for the OutlineButton\n */\nexport type OutlineButtonColor = typeof ButtonColorUtil.outline[number]\n/**\n * The allowed colors for the TextButton\n */\nexport type TextButtonColor = typeof ButtonColorUtil.text[number]\n/**\n * The allowed colors for the IconButton\n */\nexport type IconButtonColor = typeof IconButtonUtil.icon[number]\n\n\n/**\n * The different sizes for a button\n */\ntype ButtonSizes = 'small' | 'medium' | 'large' | 'none'\n\ntype IconButtonSize = 'tiny' | 'small' | 'medium' | 'large' | 'none'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}\n\nconst paddingMapping: Record<ButtonSizes, string> = {\n none: '',\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\nconst iconPaddingMapping: Record<IconButtonSize, string> = {\n none: '',\n tiny: 'icon-btn-xs',\n small: 'icon-btn-sm',\n medium: 'icon-btn-md',\n large: 'icon-btn-lg'\n}\n\nexport const ButtonUtil = {\n paddingMapping,\n iconPaddingMapping\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n coloredHoverBackground?: boolean,\n}\n\n/**\n * The shard properties between all button types\n */\nexport type IconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n /**\n * @default 'medium'\n */\n size?: IconButtonSize,\n color?: IconButtonColor,\n}\n\n/**\n * A button with a solid background and different sizes\n */\nexport const SolidButton = forwardRef<HTMLButtonElement, SolidButtonProps>(function SolidButton({\n children,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }, ref) {\n const colorClasses = {\n primary: 'not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text',\n secondary: 'not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text',\n tertiary: 'not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text',\n positive: 'not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text',\n warning: 'not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text',\n negative: 'not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text',\n neutral: 'not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-solid-primary-icon',\n secondary: 'not-group-disabled:text-button-solid-secondary-icon',\n tertiary: 'not-group-disabled:text-button-solid-tertiary-icon',\n positive: 'not-group-disabled:text-button-solid-positive-icon',\n warning: 'not-group-disabled:text-button-solid-warning-icon',\n negative: 'not-group-disabled:text-button-solid-negative-icon',\n neutral: 'not-group-disabled:text-button-solid-neutral-icon',\n }[color]\n\n return (\n <button\n ref={ref}\n onClick={onClick}\n className={clsx(\n 'group font-semibold',\n colorClasses,\n 'not-disabled:hover:brightness-90',\n 'disabled:text-disabled disabled:bg-disabled-background',\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n})\n\n/**\n * A button with an outline border and different sizes\n */\nexport const OutlineButton = ({\n children,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:border-button-outline-primary-text not-disabled:text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={onClick}\n className={clsx(\n 'group font-semibold bg-transparent border-2 ',\n 'not-disabled:hover:brightness-80',\n colorClasses,\n 'disabled:text-disabled disabled:border-disabled-outline',\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nexport const TextButton = ({\n children,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n coloredHoverBackground = true,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:bg-transparent not-disabled:text-button-text-primary-text not-disabled:focus-visible:outline-button-text-primary-text',\n negative: 'not-disabled:bg-transparent not-disabled:text-button-text-negative-text not-disabled:focus-visible:outline-button-text-negative-text',\n neutral: 'not-disabled:bg-transparent not-disabled:text-button-text-neutral-text not-disabled:focus-visible:outline-button-text-neutral-text',\n }[color]\n\n const backgroundColor = {\n primary: 'not-disabled:hover:bg-button-text-primary-text/20 not-disabled:focus-visible:bg-button-text-primary-text/20',\n negative: 'not-disabled:hover:bg-button-text-negative-text/20 not-disabled:focus-visible:bg-button-text-negative-text/20',\n neutral: 'not-disabled:hover:bg-button-text-neutral-text/20 not-disabled:focus-visible:bg-button-text-neutral-text/20',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-text-primary-icon',\n negative: 'not-group-disabled:text-button-text-negative-icon',\n neutral: 'not-group-disabled:text-button-text-neutral-icon',\n }[color]\n\n return (\n <button\n onClick={onClick}\n className={clsx(\n 'group font-semibold',\n 'disabled:text-disabled',\n colorClasses,\n {\n [backgroundColor]: coloredHoverBackground,\n 'not-disabled:hover:bg-button-text-hover-background': !coloredHoverBackground,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n\n/**\n * A button for icons with a solid background and different sizes\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton({\n children,\n color = 'primary',\n size = 'medium',\n className,\n ...restProps\n }, ref)\n{\n const colorClasses = {\n primary: 'not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text',\n secondary: 'not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text',\n tertiary: 'not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text',\n positive: 'not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text',\n warning: 'not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text',\n negative: 'not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text',\n neutral: 'not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text',\n transparent: 'not-disabled:bg-transparent',\n }[color]\n\n return (\n <button\n ref={ref}\n className={clsx(\n colorClasses,\n 'not-disabled:hover:brightness-90',\n 'disabled:text-disabled',\n {\n 'disabled:bg-disabled-background': color !== 'transparent',\n 'disabled:opacity-70': color === 'transparent',\n 'not-disabled:hover:bg-button-text-hover-background': color === 'transparent',\n },\n ButtonUtil.iconPaddingMapping[size],\n className\n )}\n {...restProps}\n >\n {children}\n </button>\n )\n})","import type { Translation } from '../useTranslation'\n\nexport type FormTranslationType = {\n add: string,\n all: string,\n apply: string,\n back: string,\n cancel: string,\n change: string,\n clear: string,\n click: string,\n clickToCopy: string,\n close: string,\n confirm: string,\n copy: string,\n copied: string,\n create: string,\n decline: string,\n delete: string,\n discard: string,\n discardChanges: string,\n done: string,\n edit: string,\n enterText: string,\n error: string,\n exit: string,\n fieldRequiredError: string,\n invalidEmailError: string,\n less: string,\n loading: string,\n maxLengthError: string,\n minLengthError: string,\n more: string,\n next: string,\n no: string,\n none: string,\n nothingFound: string,\n of: string,\n optional: string,\n pleaseWait: string,\n previous: string,\n remove: string,\n required: string,\n reset: string,\n save: string,\n saved: string,\n search: string,\n select: string,\n selectOption: string,\n show: string,\n showMore: string,\n showLess: string,\n submit: string,\n success: string,\n unsavedChanges: string,\n unsavedChangesSaveQuestion: string,\n update: string,\n yes: string,\n}\n\nexport const formTranslation: Translation<FormTranslationType> = {\n en: {\n add: 'Add',\n all: 'All',\n apply: 'Apply',\n back: 'Back',\n cancel: 'Cancel',\n change: 'Change',\n clear: 'Clear',\n click: 'Click',\n clickToCopy: 'Click to Copy',\n close: 'Close',\n confirm: 'Confirm',\n copy: 'Copy',\n copied: 'Copied',\n create: 'Create',\n decline: 'Decline',\n delete: 'Delete',\n discard: 'Discard',\n discardChanges: 'Discard Changes',\n done: 'Done',\n edit: 'Edit',\n enterText: 'Enter text here',\n error: 'Error',\n exit: 'Exit',\n fieldRequiredError: 'This field is required.',\n invalidEmailError: 'Please enter a valid email address.',\n less: 'Less',\n loading: 'Loading',\n maxLengthError: 'Maximum length exceeded.',\n minLengthError: 'Minimum length not met.',\n more: 'More',\n next: 'Next',\n no: 'No',\n none: 'None',\n nothingFound: 'Nothing found',\n of: 'of',\n optional: 'Optional',\n pleaseWait: 'Please wait...',\n previous: 'Previous',\n remove: 'Remove',\n required: 'Required',\n reset: 'Reset',\n save: 'Save',\n saved: 'Saved',\n search: 'Search',\n select: 'Select',\n selectOption: 'Select an option',\n show: 'Show',\n showMore: 'Show more',\n showLess: 'Show less',\n submit: 'Submit',\n success: 'Success',\n update: 'Update',\n unsavedChanges: 'Unsaved Changes',\n unsavedChangesSaveQuestion: 'Do you want to save your changes?',\n yes: 'Yes',\n },\n de: {\n add: 'Hinzufügen',\n all: 'Alle',\n apply: 'Anwenden',\n back: 'Zurück',\n cancel: 'Abbrechen',\n change: 'Ändern',\n clear: 'Löschen',\n click: 'Klicken',\n clickToCopy: 'Zum kopieren klicken',\n close: 'Schließen',\n confirm: 'Bestätigen',\n copy: 'Kopieren',\n copied: 'Kopiert',\n create: 'Erstellen',\n decline: 'Ablehnen',\n delete: 'Löschen',\n discard: 'Verwerfen',\n discardChanges: 'Änderungen Verwerfen',\n done: 'Fertig',\n edit: 'Bearbeiten',\n enterText: 'Text hier eingeben',\n error: 'Fehler',\n exit: 'Beenden',\n fieldRequiredError: 'Dieses Feld ist erforderlich.',\n invalidEmailError: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',\n less: 'Weniger',\n loading: 'Lädt',\n maxLengthError: 'Maximale Länge überschritten.',\n minLengthError: 'Mindestlänge nicht erreicht.',\n more: 'Mehr',\n next: 'Weiter',\n no: 'Nein',\n none: 'Nichts',\n nothingFound: 'Nichts gefunden',\n of: 'von',\n optional: 'Optional',\n pleaseWait: 'Bitte warten...',\n previous: 'Vorherige',\n remove: 'Entfernen',\n required: 'Erforderlich',\n reset: 'Zurücksetzen',\n save: 'Speichern',\n saved: 'Gespeichert',\n search: 'Suche',\n select: 'Select',\n selectOption: 'Option auswählen',\n show: 'Anzeigen',\n showMore: 'Mehr anzeigen',\n showLess: 'Weniger anzeigen',\n submit: 'Abschicken',\n success: 'Erfolg',\n update: 'Update',\n unsavedChanges: 'Ungespeicherte Änderungen',\n unsavedChangesSaveQuestion: 'Möchtest du die Änderungen speichern?',\n yes: 'Ja',\n }\n}\n","import clsx from 'clsx'\nimport type { LabelHTMLAttributes } from 'react'\n\nexport type LabelType = 'md' | 'lg'\n\nconst styleMapping: Record<LabelType, string> = {\n md: 'typography-label-md color-label-text',\n lg: 'typography-label-lg color-label-text',\n}\n\nexport type LabelProps = LabelHTMLAttributes<HTMLLabelElement> & {\n /** The size of the label */\n size?: LabelType,\n}\n\n/**\n * A Label component\n */\nexport const Label = ({\n children,\n size = 'md',\n className,\n ...props\n }: LabelProps) => {\n return (\n <label {...props} className={clsx(styleMapping[size], className)}>\n {children}\n </label>\n )\n}\n","import { CalendarDays } from 'lucide-react'\nimport clsx from 'clsx'\nimport { formatDate, formatDateTime } from '@/src/utils/date'\nimport { Input } from '../user-action/input/Input'\nimport type { PropertyBaseProps } from './PropertyBase'\nimport { PropertyBase } from './PropertyBase'\n\nexport type DatePropertyProps = Omit<PropertyBaseProps, 'icon' | 'input' | 'hasValue'> & {\n value?: Date,\n onChange?: (date: Date) => void,\n onEditComplete?: (value: Date) => void,\n type?: 'dateTime' | 'date',\n}\n\n/**\n * An Input for date properties\n */\nexport const DateProperty = ({\n value,\n onChange,\n onEditComplete,\n readOnly,\n type = 'dateTime',\n ...baseProps\n }: DatePropertyProps) => {\n const hasValue = !!value\n\n const dateText = value ? (type === 'dateTime' ? formatDateTime(value) : formatDate(value)) : ''\n return (\n <PropertyBase\n {...baseProps}\n hasValue={hasValue}\n icon={<CalendarDays size={24}/>}\n input={({ softRequired }) => (\n <Input\n className={clsx('!ring-0 !border-0 !outline-0 !p-0 !m-0 !shadow-none !w-fit !rounded-none', { 'bg-surface-warning': softRequired && !hasValue })}\n value={dateText}\n type={type === 'dateTime' ? 'datetime-local' : 'date'}\n readOnly={readOnly}\n onChange={(event) => {\n const value = event.target.value\n if (!value) {\n event.preventDefault()\n return\n }\n const dueDate = new Date(value)\n onChange?.(dueDate)\n }}\n onEditCompleted={(value) => onEditComplete?.(new Date(value))}\n />\n )}\n />\n )\n}\n","import { equalSizeGroups } from './array'\n\nexport const monthsList = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'] as const\nexport type Month = typeof monthsList[number]\n\nexport const weekDayList = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] as const\nexport type WeekDay = typeof weekDayList[number]\n\nexport const formatDate = (date: Date) => {\n const year = date.getFullYear().toString().padStart(4, '0')\n const month = (date.getMonth() + 1).toString().padStart(2, '0')\n const day = (date.getDate()).toString().padStart(2, '0')\n return `${year}-${month}-${day}`\n}\n\nexport const formatDateTime = (date: Date) => {\n const dateString = formatDate(date)\n const hours = date.getHours().toString().padStart(2, '0')\n const minutes = date.getMinutes().toString().padStart(2, '0')\n return `${dateString}T${hours}:${minutes}`\n}\n\nexport const getDaysInMonth = (year: number, month: number): number => {\n const lastDayOfMonth = new Date(year, month + 1, 0)\n return lastDayOfMonth.getDate()\n}\n\nexport type Duration = {\n years?: number,\n months?: number,\n days?: number,\n hours?: number,\n minutes?: number,\n seconds?: number,\n milliseconds?: number,\n}\n\nexport const changeDuration = (date: Date, duration: Duration, isAdding?: boolean): Date => {\n const {\n years = 0,\n months = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n milliseconds = 0,\n } = duration\n\n // Check ranges\n if (years < 0) {\n console.error(`Range error years must be greater than 0: received ${years}`)\n return new Date(date)\n }\n if (months < 0 || months > 11) {\n console.error(`Range error month must be 0 <= month <= 11: received ${months}`)\n return new Date(date)\n }\n if (days < 0) {\n console.error(`Range error days must be greater than 0: received ${days}`)\n return new Date(date)\n }\n if (hours < 0 || hours > 23) {\n console.error(`Range error hours must be 0 <= hours <= 23: received ${hours}`)\n return new Date(date)\n }\n if (minutes < 0 || minutes > 59) {\n console.error(`Range error minutes must be 0 <= minutes <= 59: received ${minutes}`)\n return new Date(date)\n }\n if (seconds < 0 || seconds > 59) {\n console.error(`Range error seconds must be 0 <= seconds <= 59: received ${seconds}`)\n return new Date(date)\n }\n if (milliseconds < 0) {\n console.error(`Range error seconds must be greater than 0: received ${milliseconds}`)\n return new Date(date)\n }\n\n const multiplier = isAdding ? 1 : -1\n\n const newDate = new Date(date)\n\n newDate.setFullYear(newDate.getFullYear() + multiplier * years)\n\n newDate.setMonth(newDate.getMonth() + multiplier * months)\n\n newDate.setDate(newDate.getDate() + multiplier * days)\n\n newDate.setHours(newDate.getHours() + multiplier * hours)\n\n newDate.setMinutes(newDate.getMinutes() + multiplier * minutes)\n\n newDate.setSeconds(newDate.getSeconds() + multiplier * seconds)\n\n newDate.setMilliseconds(newDate.getMilliseconds() + multiplier * milliseconds)\n\n return newDate\n}\n\nexport const addDuration = (date: Date, duration: Duration): Date => {\n return changeDuration(date, duration, true)\n}\n\nexport const subtractDuration = (date: Date, duration: Duration): Date => {\n return changeDuration(date, duration, false)\n}\n\nexport const getBetweenDuration = (startDate: Date, endDate: Date): Duration => {\n const durationInMilliseconds = endDate.getTime() - startDate.getTime()\n\n const millisecondsInSecond = 1000\n const millisecondsInMinute = 60 * millisecondsInSecond\n const millisecondsInHour = 60 * millisecondsInMinute\n const millisecondsInDay = 24 * millisecondsInHour\n const millisecondsInMonth = 30 * millisecondsInDay // Rough estimation, can be adjusted\n\n const years = Math.floor(durationInMilliseconds / (365.25 * millisecondsInDay))\n const months = Math.floor(durationInMilliseconds / millisecondsInMonth)\n const days = Math.floor(durationInMilliseconds / millisecondsInDay)\n const hours = Math.floor((durationInMilliseconds % millisecondsInDay) / millisecondsInHour)\n const seconds = Math.floor((durationInMilliseconds % millisecondsInHour) / millisecondsInSecond)\n const milliseconds = durationInMilliseconds % millisecondsInSecond\n\n return {\n years,\n months,\n days,\n hours,\n seconds,\n milliseconds,\n }\n}\n\n/** Checks if a given date is in the range of two dates\n *\n * An undefined value for startDate or endDate means no bound for the start or end respectively\n */\nexport const isInTimeSpan = (value: Date, startDate?: Date, endDate?: Date): boolean => {\n if (startDate && endDate) {\n console.assert(startDate <= endDate)\n return startDate <= value && value <= endDate\n } else if (startDate) {\n return startDate <= value\n } else if (endDate) {\n return endDate >= value\n } else {\n return true\n }\n}\n\n/** Compare two dates on the year, month, day */\nexport const equalDate = (date1: Date, date2: Date) => {\n return date1.getFullYear() === date2.getFullYear()\n && date1.getMonth() === date2.getMonth()\n && date1.getDate() === date2.getDate()\n}\n\nexport const getWeeksForCalenderMonth = (date: Date, weekStart: WeekDay, weeks: number = 6) => {\n const month = date.getMonth()\n const year = date.getFullYear()\n\n const dayList: Date[] = []\n let currentDate = new Date(year, month, 1) // Start of month\n const weekStartIndex = weekDayList.indexOf(weekStart)\n\n // Move the current day to the week before\n while (currentDate.getDay() !== weekStartIndex) {\n currentDate = subtractDuration(currentDate, { days: 1 })\n }\n\n while (dayList.length < 7 * weeks) {\n const date = new Date(currentDate)\n date.setHours(date.getHours(), date.getMinutes()) // To make sure we are not overwriting the time\n dayList.push(date)\n currentDate = addDuration(currentDate, { days: 1 })\n }\n\n // weeks\n return equalSizeGroups(dayList, 7)\n}\n","import type { InputHTMLAttributes } from 'react'\nimport React, { forwardRef, useImperativeHandle, useRef } from 'react'\nimport clsx from 'clsx'\nimport type { UseDelayOptionsResolved } from '@/src/hooks/useDelay'\nimport { useDelay } from '@/src/hooks/useDelay'\nimport { useFocusManagement } from '@/src/hooks/focus/useFocusManagement'\nimport { useOverwritableState } from '@/src/hooks/useOverwritableState'\n\nexport type EditCompleteOptionsResolved = {\n onBlur: boolean,\n afterDelay: boolean,\n allowEnterComplete?: boolean,\n} & Omit<UseDelayOptionsResolved, 'disabled'>\n\nexport type EditCompleteOptions = Partial<EditCompleteOptionsResolved>\n\nconst defaultEditCompleteOptions: EditCompleteOptionsResolved = {\n allowEnterComplete: false,\n onBlur: true,\n afterDelay: true,\n delay: 2500\n}\n\nexport type InputProps = InputHTMLAttributes<HTMLInputElement> & {\n invalid?: boolean,\n onChangeText?: (text: string) => void,\n onEditCompleted?: (text: string) => void,\n editCompleteOptions?: EditCompleteOptions,\n defaultStyle?: boolean,\n}\n\n/**\n * A Component for inputting text or other information\n *\n * Its state is managed must be managed by the parent\n */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input({\n value,\n onChange,\n onChangeText,\n onEditCompleted,\n editCompleteOptions,\n disabled = false,\n invalid = false,\n defaultStyle = true,\n className,\n ...props\n }, forwardedRef) {\n const {\n onBlur: allowEditCompleteOnBlur,\n afterDelay,\n delay,\n allowEnterComplete\n } = { ...defaultEditCompleteOptions, ...editCompleteOptions }\n\n const {\n restartTimer,\n clearTimer\n } = useDelay({ delay, disabled: !afterDelay })\n\n const innerRef = useRef<HTMLInputElement>(null)\n useImperativeHandle(forwardedRef, () => innerRef.current)\n\n const { focusNext } = useFocusManagement()\n\n return (\n <input\n {...props}\n ref={innerRef}\n value={value}\n disabled={disabled}\n className={defaultStyle ? clsx(\n 'px-3 py-2 rounded-md text-sm h-10 border-2 border-transparent focus-style-none',\n {\n 'bg-input-background text-input-text hover:border-primary focus:border-primary': !disabled && !invalid,\n 'bg-negative/20 text-negative hover:border-negative focus-visible:border-negative': !disabled && invalid,\n 'bg-disabled-background text-disabled border-disabled-border': disabled,\n }, className\n ) : className}\n onKeyDown={event => {\n props.onKeyDown?.(event)\n if (!allowEnterComplete) {\n return\n }\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault()\n innerRef.current?.blur()\n onEditCompleted?.((event.target as HTMLInputElement).value)\n focusNext()\n }\n }}\n onBlur={event => {\n props.onBlur?.(event)\n if (allowEditCompleteOnBlur) {\n onEditCompleted?.(event.target.value)\n clearTimer()\n }\n }}\n onChange={event => {\n onChange?.(event)\n const value = event.target.value\n restartTimer(() => {\n innerRef.current?.blur()\n onEditCompleted?.(value)\n })\n onChangeText?.(value)\n }}\n\n aria-invalid={props['aria-invalid'] ?? invalid}\n aria-disabled={props['aria-disabled'] ?? disabled}\n />\n )\n})\n\n\n/**\n * A Component for inputting text or other information\n *\n * Its state is managed by the component itself\n */\nexport const InputUncontrolled = ({\n value = '',\n onChangeText,\n ...props\n }: InputProps) => {\n const [usedValue, setUsedValue] = useOverwritableState(value, onChangeText)\n\n return (\n <Input\n {...props}\n value={usedValue}\n onChangeText={setUsedValue}\n />\n )\n}\n","import { useEffect, useState } from 'react'\n\nexport type UseDelayOptionsResolved = {\n delay: number,\n disabled: boolean,\n}\n\nexport type UseDelayOptions = Partial<UseDelayOptionsResolved>\n\nconst defaultOptions: UseDelayOptionsResolved = {\n delay: 3000,\n disabled: false,\n}\n\nexport function useDelay(options?: UseDelayOptions) {\n const [timer, setTimer] = useState<NodeJS.Timeout | undefined>(undefined)\n const { delay, disabled }: UseDelayOptionsResolved = {\n ...defaultOptions,\n ...options\n }\n\n const clearTimer = () => {\n clearTimeout(timer)\n setTimer(undefined)\n }\n\n const restartTimer = (onDelayFinish: () => void) => {\n if(disabled) {\n return\n }\n clearTimeout(timer)\n setTimer(setTimeout(() => {\n onDelayFinish()\n setTimer(undefined)\n }, delay))\n }\n\n useEffect(() => {\n return () => {\n clearTimeout(timer)\n }\n }, [timer])\n\n useEffect(() => {\n if(disabled){\n clearTimeout(timer)\n setTimer(undefined)\n }\n }, [disabled, timer])\n\n return { restartTimer, clearTimer, hasActiveTimer: !!timer }\n}","import { useCallback } from 'react'\n\nexport function useFocusManagement() {\n const getFocusableElements = useCallback((): HTMLElement[] => {\n return Array.from(\n document.querySelectorAll(\n 'input, button, select, textarea, a[href], [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter(\n (el): el is HTMLElement =>\n el instanceof HTMLElement &&\n !el.hasAttribute('disabled') &&\n !el.hasAttribute('hidden') &&\n el.tabIndex !== -1\n )\n }, [])\n\n const getNextFocusElement = useCallback((): HTMLElement | undefined => {\n const elements = getFocusableElements()\n if(elements.length === 0) {\n return undefined\n }\n let nextElement = elements[0]\n if(document.activeElement instanceof HTMLElement) {\n const currentIndex = elements.indexOf(document.activeElement)\n nextElement = elements[(currentIndex + 1) % elements.length]\n }\n return nextElement\n }, [getFocusableElements])\n\n const focusNext = useCallback(() => {\n const nextElement = getNextFocusElement()\n nextElement?.focus()\n }, [getNextFocusElement])\n\n const getPreviousFocusElement = useCallback((): HTMLElement | undefined => {\n const elements = getFocusableElements()\n if(elements.length === 0) {\n return undefined\n }\n let previousElement = elements[0]\n if(document.activeElement instanceof HTMLElement) {\n const currentIndex = elements.indexOf(document.activeElement)\n if(currentIndex === 0) {\n previousElement = elements[elements.length - 1]\n } else {\n previousElement = elements[currentIndex - 1]\n }\n }\n return previousElement\n }, [getFocusableElements])\n\n const focusPrevious = useCallback(() => {\n const previousElement = getPreviousFocusElement()\n if (previousElement) previousElement.focus()\n }, [getPreviousFocusElement])\n\n return {\n getFocusableElements,\n getNextFocusElement,\n getPreviousFocusElement,\n focusNext,\n focusPrevious,\n }\n}","import { List } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { PropsWithChildren } from 'react'\nimport type { FormTranslationType } from '@/src/localization/defaults/form'\nimport type { PropertyBaseProps } from '@/src/components/properties/PropertyBase'\nimport { PropertyBase } from '@/src/components/properties/PropertyBase'\nimport type { PropsForTranslation } from '@/src/localization/useTranslation'\nimport { MultiSelectChipDisplay } from '@/src/components/user-action/select/Select'\n\ntype TranslationType = FormTranslationType\n\nexport type MultiSelectPropertyProps = Omit<PropertyBaseProps, 'icon' | 'input' | 'hasValue' | 'className'> & PropsWithChildren<{\n values: string[],\n onValuesChanged?: (value: string[]) => void,\n}>\n\n/**\n * An Input for MultiSelect properties\n */\nexport const MultiSelectProperty = ({\n children,\n values,\n onValuesChanged,\n ...props\n }: PropsForTranslation<TranslationType, MultiSelectPropertyProps>) => {\n const hasValue = values.length > 0\n\n return (\n <PropertyBase\n {...props}\n hasValue={hasValue}\n icon={<List size={24}/>}\n input={({ softRequired }) => (\n <MultiSelectChipDisplay\n values={values}\n onValuesChanged={onValuesChanged}\n disabled={props.readOnly}\n contentPanelProps={{\n className: clsx(\n '!border-none !min-h-10'\n )\n }}\n chipDisplayProps={{\n className: clsx({\n '!bg-warning !text-surface-warning': softRequired && !hasValue,\n })\n }}\n >\n {children}\n </MultiSelectChipDisplay>\n )}\n />\n )\n}\n","import type { ButtonHTMLAttributes, HTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport React, {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState\n} from 'react'\nimport clsx from 'clsx'\nimport type { Translation } from '@/src/localization/useTranslation'\nimport { useTranslation } from '@/src/localization/useTranslation'\nimport { ExpansionIcon } from '@/src/components/layout/Expandable'\nimport { useFocusTrap } from '@/src/hooks/focus/useFocusTrap'\nimport { match } from '@/src/utils/match'\nimport { CheckIcon, Plus, XIcon } from 'lucide-react'\nimport { Chip } from '@/src/components/layout/Chip'\nimport { IconButton, TextButton } from '@/src/components/user-action/Button'\nimport type { UseFloatingElementOptions } from '@/src/hooks/useFloatingElement'\nimport { useFloatingElement } from '@/src/hooks/useFloatingElement'\nimport { createPortal } from 'react-dom'\nimport { useOverwritableState } from '@/src/hooks/useOverwritableState'\n\n//\n// Context\n//\ntype RegisteredOption = {\n value: string,\n label: ReactNode,\n disabled: boolean,\n ref: React.RefObject<HTMLLIElement>,\n}\n\ntype HighlightStartPositionBehavior = 'first' | 'last'\ntype SelectIconAppearance = 'left' | 'right' | 'none'\n\ntype InternalSelectContextState = {\n isOpen: boolean,\n options: RegisteredOption[],\n highlightedValue?: string,\n}\n\ntype SelectContextState = InternalSelectContextState & {\n id: string,\n value: string[],\n disabled: boolean,\n invalid: boolean,\n selectedOptions: RegisteredOption[],\n}\n\ntype SelectConfiguration = {\n isMultiSelect: boolean,\n iconAppearance: SelectIconAppearance,\n}\n\ntype ToggleOpenOptions = {\n highlightStartPositionBehavior?: HighlightStartPositionBehavior,\n}\n\nconst defaultToggleOpenOptions: ToggleOpenOptions = {\n highlightStartPositionBehavior: 'first',\n}\n\ntype SelectContextType = {\n state: SelectContextState,\n config: SelectConfiguration,\n item: {\n register: (item: RegisteredOption) => void,\n unregister: (value: string) => void,\n toggleSelection: (value: string, isSelected?: boolean) => void,\n highlightItem: (value: string) => void,\n moveHighlightedIndex: (delta: number) => void,\n },\n trigger: {\n ref: React.RefObject<HTMLElement>,\n register: (element: React.RefObject<HTMLElement>) => void,\n unregister: () => void,\n toggleOpen: (isOpen?: boolean, options?: ToggleOpenOptions) => void,\n },\n}\n\nconst SelectContext = createContext<SelectContextType | null>(null)\n\nfunction useSelectContext() {\n const ctx = useContext(SelectContext)\n if (!ctx) {\n throw new Error('SelectContext must be used within a ListBoxPrimitive')\n }\n return ctx\n}\n\n\n//\n// SelectRoot\n//\nexport type SelectRootProps = PropsWithChildren<{\n id?: string,\n value?: string,\n onValueChanged?: (value: string) => void,\n values?: string[],\n onValuesChanged?: (value: string[]) => void,\n isOpen?: boolean,\n disabled?: boolean,\n invalid?: boolean,\n isMultiSelect?: boolean,\n iconAppearance?: SelectIconAppearance,\n}>\n\nexport const SelectRoot = ({\n children,\n id,\n value,\n onValueChanged,\n values,\n onValuesChanged,\n isOpen = false,\n disabled = false,\n invalid = false,\n isMultiSelect = false,\n iconAppearance = 'left',\n }: SelectRootProps) => {\n const triggerRef = useRef<HTMLElement>(null)\n const generatedId = useId()\n const usedId = id ?? generatedId\n\n const [internalState, setInternalState] = useState<InternalSelectContextState>({\n isOpen,\n options: [],\n })\n\n const selectedValues = useMemo(() => isMultiSelect ? (values ?? []) : [value].filter(Boolean),\n [isMultiSelect, value, values])\n const selectedOptions = useMemo(() =>\n selectedValues.map(value => internalState.options.find(option => value === option.value)).filter(Boolean),\n [selectedValues, internalState.options])\n const state: SelectContextState = {\n ...internalState,\n id: usedId,\n disabled,\n invalid,\n value: selectedValues,\n selectedOptions,\n }\n\n const config: SelectConfiguration = {\n isMultiSelect,\n iconAppearance,\n }\n\n const registerItem = useCallback((item: RegisteredOption) => {\n setInternalState(prev => {\n const updatedOptions = [...prev.options, item]\n updatedOptions.sort((a, b) => {\n const aEl = a.ref.current\n const bEl = b.ref.current\n if (!aEl || !bEl) return 0\n return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n })\n return {\n ...prev,\n options: updatedOptions,\n }\n })\n }, [])\n\n const unregisterItem = useCallback((value: string) => {\n setInternalState(prev => {\n const updatedOptions = prev.options.filter(i => i.value !== value)\n return {\n ...prev,\n options: updatedOptions,\n }\n })\n }, [])\n\n // Setting isSelected to false only works for multiselects\n const toggleSelection = (value: string, isSelected?: boolean) => {\n if (disabled) {\n return\n }\n const option = state.options.find(i => i.value === value)\n if (!option) {\n console.error(`SelectOption with value: ${value} not found`)\n return\n }\n\n let newValue: string[]\n if (isMultiSelect) {\n const isSelectedBefore = state.value.includes(value)\n const isSelectedAfter = isSelected ?? !isSelectedBefore\n if (!isSelectedAfter) {\n newValue = state.value.filter(v => v !== value)\n } else {\n newValue = [...state.value, value]\n }\n } else {\n newValue = [value]\n }\n\n if (!isMultiSelect) {\n onValueChanged?.(newValue[0])\n } else {\n onValuesChanged?.(newValue)\n }\n\n setInternalState(prevState => ({\n ...prevState,\n highlightedValue: value,\n }))\n }\n\n const highlightItem = (value: string) => {\n if (disabled) {\n return\n }\n setInternalState(prevState => ({\n ...prevState,\n highlightedValue: value,\n }))\n }\n\n const registerTrigger = useCallback((ref: React.RefObject<HTMLElement>) => {\n triggerRef.current = ref.current\n }, [])\n\n const unregisterTrigger = useCallback(() => {\n triggerRef.current = null\n }, [])\n\n const toggleOpen = (isOpen?: boolean, toggleOpenOptions?: ToggleOpenOptions) => {\n const { highlightStartPositionBehavior } = { ...defaultToggleOpenOptions, ...toggleOpenOptions }\n let firstSelectedValue: string | undefined\n let firstEnabledValue: string | undefined\n for (let i = 0; i < state.options.length; i++) {\n const currentOption = state.options[highlightStartPositionBehavior === 'first' ? i : state.options.length - i - 1]\n if (!currentOption.disabled) {\n if (!firstEnabledValue) {\n firstEnabledValue = currentOption.value\n }\n if (selectedValues.includes(currentOption.value)) {\n firstSelectedValue = currentOption.value\n break\n }\n }\n }\n setInternalState(prevState => ({\n ...prevState,\n isOpen: isOpen ?? !prevState.isOpen,\n highlightedValue: firstSelectedValue ?? firstEnabledValue\n }))\n }\n\n const moveHighlightedIndex = (delta: number) => {\n let highlightedIndex = state.options.findIndex(value => value.value === internalState.highlightedValue)\n if (highlightedIndex === -1) {\n highlightedIndex = 0\n }\n const optionLength = state.options.length\n const startIndex = (highlightedIndex + (delta % optionLength) + optionLength) % optionLength\n const isForward = delta >= 0\n let highlightedValue = state.options[startIndex].value\n for (let i = 0; i < state.options.length; i++) {\n const index = (startIndex + (isForward ? i : -i) + optionLength) % optionLength\n if (!state.options[index].disabled) {\n highlightedValue = state.options[index].value\n break\n }\n }\n\n setInternalState(prevState => ({\n ...prevState,\n highlightedValue,\n }))\n }\n\n useEffect(() => {\n if (!internalState.highlightedValue) return\n const highlighted = internalState.options.find(value => value.value === internalState.highlightedValue)\n if (highlighted) {\n highlighted.ref.current?.scrollIntoView({ behavior: 'instant', block: 'nearest' })\n } else {\n console.error(`SelectRoot: Could not find highlighted value (${internalState.highlightedValue})`)\n }\n }, [internalState.highlightedValue])\n\n const contextValue: SelectContextType = {\n state,\n config,\n item: {\n register: registerItem,\n unregister: unregisterItem,\n toggleSelection,\n highlightItem,\n moveHighlightedIndex,\n },\n trigger: {\n ref: triggerRef,\n register: registerTrigger,\n unregister: unregisterTrigger,\n toggleOpen,\n },\n }\n\n return (\n <SelectContext.Provider value={contextValue}>\n {children}\n </SelectContext.Provider>\n )\n}\n\n//\n// SelectOption\n//\nexport type SelectOptionProps = Omit<HTMLAttributes<HTMLLIElement>, 'children'> & {\n value: string,\n disabled?: boolean,\n iconAppearance?: SelectIconAppearance,\n children?: ReactNode,\n}\n\nexport const SelectOption = forwardRef<HTMLLIElement, SelectOptionProps>(\n function SelectOption({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {\n const { state, config, item, trigger } = useSelectContext()\n const { register, unregister, toggleSelection, highlightItem } = item\n const itemRef = useRef<HTMLLIElement>(null)\n\n iconAppearance ??= config.iconAppearance\n\n const label = children ?? value\n\n // Register with parent\n useEffect(() => {\n register({\n value,\n label,\n disabled,\n ref: itemRef,\n })\n return () => unregister(value)\n }, [value, disabled, register, unregister, children, label])\n\n const isHighlighted = state.highlightedValue === value\n const isSelected = state.value.includes(value)\n\n return (\n <li\n {...restProps}\n ref={(node) => {\n itemRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as React.MutableRefObject<HTMLLIElement | null>).current = node\n }}\n id={value}\n role=\"option\"\n aria-disabled={disabled}\n aria-selected={isSelected}\n data-highlighted={isHighlighted ? '' : undefined}\n data-selected={isSelected ? '' : undefined}\n data-disabled={disabled ? '' : undefined}\n className={clsx(\n 'flex-row-1 items-center px-2 py-1 rounded-md',\n 'data-highlighted:bg-primary/20',\n 'data-disabled:text-disabled data-disabled:cursor-not-allowed',\n 'not-data-disabled:cursor-pointer',\n className\n )}\n onClick={(event) => {\n if (!disabled) {\n toggleSelection(value)\n if (!config.isMultiSelect) {\n trigger.toggleOpen(false)\n }\n restProps.onClick?.(event)\n }\n }}\n onMouseEnter={(event) => {\n if (!disabled) {\n highlightItem(value)\n restProps.onMouseEnter?.(event)\n }\n }}\n >\n {iconAppearance === 'left' && (\n <CheckIcon\n className={clsx('w-4 h-4', { 'opacity-0': !isSelected || disabled })}\n aria-hidden={true}\n />\n )}\n {label}\n {iconAppearance === 'right' && (\n <CheckIcon\n className={clsx('w-4 h-4', { 'opacity-0': !isSelected || disabled })}\n aria-hidden={true}\n />\n )}\n </li>\n )\n }\n)\n\n///\n/// SelectButton\n///\ntype SelectButtonTranslationType = {\n clickToSelect: string,\n}\n\nconst defaultSelectButtonTranslation: Translation<SelectButtonTranslationType> = {\n en: {\n clickToSelect: 'Click to select',\n\n },\n de: {\n clickToSelect: 'Zum auswählen drücken'\n }\n}\n\ntype SelectButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n placeholder?: ReactNode,\n selectedDisplay?: (value: string[]) => ReactNode,\n}\n\nexport const SelectButton = forwardRef<HTMLButtonElement, SelectButtonProps>(function SelectButton(\n { placeholder, selectedDisplay, ...props }, ref\n) {\n const translation = useTranslation([defaultSelectButtonTranslation])\n const { state, trigger } = useSelectContext()\n const { register, unregister, toggleOpen } = trigger\n\n const innerRef = useRef<HTMLButtonElement>(null)\n useImperativeHandle(ref, () => innerRef.current)\n\n useEffect(() => {\n register(innerRef)\n return () => unregister()\n }, [register, unregister])\n\n const disabled = !!props?.disabled || !!state.disabled\n const invalid = state.invalid\n const hasValue = state.value.length > 0\n\n return (\n <button\n {...props}\n ref={innerRef}\n id={state.id} // TODO allow for a custom id here\n disabled={disabled}\n\n onClick={(event) => {\n props.onClick?.(event)\n toggleOpen(!state.isOpen)\n }}\n onKeyDown={event => {\n props.onKeyDown?.(event)\n switch (event.key) {\n case 'ArrowDown':\n toggleOpen(true, { highlightStartPositionBehavior: 'first' })\n event.preventDefault()\n event.stopPropagation()\n break\n case 'ArrowUp':\n toggleOpen(true, { highlightStartPositionBehavior: 'last' })\n event.preventDefault()\n event.stopPropagation()\n break\n }\n }}\n\n className={clsx(\n 'flex-row-2 items-center justify-between rounded-md px-3 py-2',\n {\n 'bg-input-background text-placeholder': !hasValue && !disabled && !invalid,\n 'bg-input-background text-input-text': hasValue && !disabled && !invalid,\n 'bg-negative/20': !disabled && invalid,\n 'text-placeholder': !hasValue && !disabled,\n 'text-negative': hasValue && !disabled && invalid,\n 'bg-disabled-background text-disabled': disabled,\n },\n props.className\n )}\n\n data-placeholder={!hasValue ? '' : undefined}\n data-disabled={disabled ? '' : undefined}\n data-invalid={invalid ? '' : undefined}\n\n aria-invalid={invalid}\n aria-disabled={disabled}\n aria-haspopup=\"listbox\"\n aria-expanded={state.isOpen}\n aria-controls={state.isOpen ? `${state.id}-listbox` : undefined}\n >\n {hasValue ?\n selectedDisplay?.(state.value) ?? (\n <div className={clsx('flex flex-wrap gap-x-1 gap-y-2')}>\n {state.selectedOptions.map(({ value, label }, index) => (\n <span key={value} className=\"flex-row-0\">\n {label}\n {index < state.value.length - 1 && (<span>{','}</span>)}\n </span>\n ))}\n </div>\n )\n : placeholder ?? translation('clickToSelect')\n }\n <ExpansionIcon\n isExpanded={state.isOpen}\n className={clsx({\n 'text-input-text': !disabled && !invalid,\n 'text-negative': !disabled && invalid,\n 'text-disabled': disabled,\n })}\n />\n </button>\n )\n})\n\n///\n/// SelectChipDisplay\n///\ntype SelectChipDisplayProps = HTMLAttributes<HTMLDivElement> & {\n disabled?: boolean,\n placeholder?: ReactNode,\n}\n\nexport const SelectChipDisplay = forwardRef<HTMLDivElement, SelectChipDisplayProps>(function SelectChipDisplay(\n { ...props }, ref\n) {\n const { state, trigger, item } = useSelectContext()\n const { register, unregister, toggleOpen } = trigger\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current)\n\n useEffect(() => {\n register(innerRef)\n return () => unregister()\n }, [register, unregister])\n\n const disabled = !!props?.disabled || !!state.disabled\n const invalid = state.invalid\n\n return (\n <div\n {...props}\n ref={innerRef}\n className={clsx(\n 'flex flex-wrap flex-row gap-2 items-center bg-input-background text-input-text rounded-md px-2.5 py-2.5',\n props.className\n )}\n data-disabled={disabled ? '' : undefined}\n data-invalid={invalid ? '' : undefined}\n\n aria-invalid={invalid}\n aria-disabled={disabled}\n >\n {state.selectedOptions.map(({ value, label }) => (\n <Chip key={value} className=\"gap-x-2\">\n {label}\n <TextButton\n // TODO add label to indicate purpose to screen reader\n onClick={() => {\n item.toggleSelection(value, false)\n }}\n size=\"none\"\n color=\"negative\"\n className=\"flex-row-0 items-center px-0.5 py-0.5 w-6 h-6 rounded\"\n >\n <XIcon className=\"w-5 h-5\"/>\n </TextButton>\n </Chip>\n ))}\n <IconButton\n id={state.id} // TODO allow for a custom id here\n onClick={() => toggleOpen()}\n onKeyDown={event => {\n switch (event.key) {\n case 'ArrowDown':\n toggleOpen(true, { highlightStartPositionBehavior: 'first' })\n break\n case 'ArrowUp':\n toggleOpen(true, { highlightStartPositionBehavior: 'last' })\n }\n }}\n size=\"small\"\n color=\"neutral\"\n\n aria-invalid={invalid}\n aria-disabled={disabled}\n aria-haspopup=\"listbox\"\n aria-expanded={state.isOpen}\n aria-controls={state.isOpen ? `${state.id}-listbox` : undefined}\n >\n <Plus/>\n </IconButton>\n </div>\n )\n})\n\n\n///\n/// SelectContent\n///\ntype Orientation = 'vertical' | 'horizontal'\n\nexport type SelectContentProps = HTMLAttributes<HTMLUListElement> & {\n alignment?: Pick<UseFloatingElementOptions, 'gap' | 'horizontalAlignment' | 'verticalAlignment'>,\n orientation?: Orientation,\n containerClassName?: string,\n}\n\nexport const SelectContent = forwardRef<HTMLUListElement, SelectContentProps>(\n function SelectContent({\n alignment,\n orientation = 'vertical',\n containerClassName,\n ...props\n }, ref) {\n const innerRef = useRef<HTMLUListElement | null>(null)\n useImperativeHandle(ref, () => innerRef.current)\n\n const { trigger, state, config, item } = useSelectContext()\n\n const position = useFloatingElement({\n active: state.isOpen,\n anchorRef: trigger.ref,\n containerRef: innerRef,\n ...alignment,\n })\n\n useFocusTrap({\n container: innerRef,\n active: state.isOpen && !!position,\n })\n\n return createPortal(\n <div\n id={`select-container-${state.id}`} className={clsx('fixed inset-0 w-screen h-screen', containerClassName)}\n hidden={!state.isOpen}\n >\n <div\n id={`select-background-${state.id}`}\n onClick={() => trigger.toggleOpen(false)}\n className={clsx('fixed inset-0 w-screen h-screen')}\n />\n <ul\n {...props}\n id={`${state.id}-listbox`}\n ref={innerRef}\n onKeyDown={(event) => {\n switch (event.key) {\n case 'Escape':\n trigger.toggleOpen(false)\n event.preventDefault()\n event.stopPropagation()\n break\n case match(orientation, {\n vertical: 'ArrowDown',\n horizontal: 'ArrowUp'\n }):\n item.moveHighlightedIndex(1)\n event.preventDefault()\n break\n case match(orientation, {\n vertical: 'ArrowUp',\n horizontal: 'ArrowDown'\n }):\n item.moveHighlightedIndex(-1)\n event.preventDefault()\n break\n case 'Home':\n // TODO support later by selecting the first not disabled entry\n event.preventDefault()\n break\n case 'End':\n // TODO support later by selecting the last not disabled entry\n event.preventDefault()\n break\n case 'Enter': // Fall through\n case ' ':\n if (state.highlightedValue) {\n item.toggleSelection(state.highlightedValue)\n if (!config.isMultiSelect) {\n trigger.toggleOpen(false)\n }\n event.preventDefault()\n }\n break\n }\n }}\n\n className={clsx('flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-style-within overflow-auto', props.className)}\n style={{\n opacity: position ? undefined : 0,\n position: 'fixed',\n ...position\n }}\n\n role=\"listbox\"\n aria-multiselectable={config.isMultiSelect}\n aria-orientation={orientation}\n tabIndex={position ? 0 : undefined}\n >\n {props.children}\n </ul>\n </div>, document.body\n )\n }\n)\n\n//\n// Select\n//\nexport type SelectProps = Omit<SelectRootProps, 'isMultiSelect' | 'values' | 'onValuesChanged'> & {\n contentPanelProps?: SelectContentProps,\n buttonProps?: Omit<SelectButtonProps, 'selectedDisplay'> & { selectedDisplay?: (value: string) => ReactNode },\n}\n\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select({\n children,\n contentPanelProps,\n buttonProps,\n ...props\n }, ref) {\n return (\n <SelectRoot {...props} isMultiSelect={false}>\n <SelectButton\n ref={ref}\n {...buttonProps}\n selectedDisplay={values => {\n const value = values[0]\n if (!buttonProps?.selectedDisplay) return undefined\n return buttonProps.selectedDisplay(value)\n }}\n />\n <SelectContent {...contentPanelProps}>{children}</SelectContent>\n </SelectRoot>\n )\n})\n\n\nexport type SelectUncontrolledProps = SelectProps\nexport const SelectUncontrolled = forwardRef<HTMLButtonElement, SelectUncontrolledProps>(function SelectUncontrolled({\n value: initialValue,\n onValueChanged,\n ...props\n }, ref) {\n const [value, setValue] = useOverwritableState(initialValue, onValueChanged)\n\n return (\n <Select\n {...props}\n ref={ref}\n value={value}\n onValueChanged={setValue}\n />\n )\n})\n\n\n//\n// MultiSelect\n//\nexport type MultiSelectProps = Omit<SelectRootProps, 'isMultiSelect' | 'value' | 'onValueChanged'> & {\n contentPanelProps?: SelectContentProps,\n buttonProps?: SelectButtonProps,\n}\n\nexport const MultiSelect = forwardRef<HTMLButtonElement, MultiSelectProps>(function MultiSelect({\n children,\n contentPanelProps,\n buttonProps,\n ...props\n }, ref) {\n return (\n <SelectRoot {...props} isMultiSelect={true}>\n <SelectButton ref={ref} {...buttonProps} />\n <SelectContent {...contentPanelProps}>{children}</SelectContent>\n </SelectRoot>\n )\n})\n\n\nexport type MultiSelectUncontrolledProps = MultiSelectProps\nexport const MultiSelectUncontrolled = forwardRef<HTMLButtonElement, MultiSelectUncontrolledProps>(function MultiSelectUncontrolled({\n values: initialValues,\n onValuesChanged,\n ...props\n }, ref) {\n const [values, setValues] = useOverwritableState(initialValues, onValuesChanged)\n\n return (\n <MultiSelect\n {...props}\n ref={ref}\n values={values}\n onValuesChanged={setValues}\n />\n )\n})\n\n\n//\n// MultiSelectChipDisplay\n//\nexport type MultiSelectChipDisplayProps = Omit<SelectRootProps, 'isMultiSelect' | 'value' | 'onValueChanged'> & {\n contentPanelProps?: SelectContentProps,\n chipDisplayProps?: SelectChipDisplayProps,\n}\n\nexport const MultiSelectChipDisplay = forwardRef<HTMLDivElement, MultiSelectChipDisplayProps>(function MultiSelectChipDisplay({\n children,\n contentPanelProps,\n chipDisplayProps,\n ...props\n }, ref) {\n return (\n <SelectRoot {...props} isMultiSelect={true}>\n <SelectChipDisplay ref={ref} {...chipDisplayProps} />\n <SelectContent {...contentPanelProps}>{children}</SelectContent>\n </SelectRoot>\n )\n})\n\n\nexport type MultiSelectChipDisplayUncontrolledProps = MultiSelectChipDisplayProps\nexport const MultiSelectChipDisplayUncontrolled = forwardRef<HTMLDivElement, MultiSelectChipDisplayUncontrolledProps>(function MultiSelectChipDisplayUncontrolled({\n values: initialValues,\n onValuesChanged,\n ...props\n }, ref) {\n const [values, setValues] = useOverwritableState(initialValues, onValuesChanged)\n\n return (\n <MultiSelectChipDisplay\n {...props}\n ref={ref}\n values={values}\n onValuesChanged={setValues}\n />\n )\n})","import type { PropsWithChildren, ReactNode } from 'react'\nimport { forwardRef, useCallback, useId } from 'react'\nimport { ChevronDown } from 'lucide-react'\nimport clsx from 'clsx'\nimport { useOverwritableState } from '@/src/hooks/useOverwritableState'\n\nexport type ExpansionIconProps = {\n isExpanded?: boolean,\n className?: string,\n}\n\nexport const ExpansionIcon = ({ isExpanded, className }: ExpansionIconProps) => {\n return (\n <ChevronDown\n aria-hidden={true}\n className={clsx(\n 'min-w-6 w-6 min-h-6 h-6 transition-transform motion-safe:duration-200 motion-reduce:duration-0 ease-in-out',\n { 'rotate-180': isExpanded },\n className\n )}\n />\n )\n}\n\ntype IconBuilder = (expanded: boolean) => ReactNode\n\nexport type ExpandableProps = PropsWithChildren<{\n id?: string,\n label: ReactNode,\n icon?: IconBuilder,\n isExpanded?: boolean,\n onChange?: (isExpanded: boolean) => void,\n /**\n * Whether the expansion should only happen when the header is clicked or on the entire component\n */\n clickOnlyOnHeader?: boolean,\n disabled?: boolean,\n className?: string,\n headerClassName?: string,\n contentClassName?: string,\n contentExpandedClassName?: string,\n}>\n\n/**\n * A Component for showing and hiding content\n */\nexport const Expandable = forwardRef<HTMLDivElement, ExpandableProps>(function Expandable({\n children,\n id: providedId,\n label,\n icon,\n isExpanded = false,\n onChange,\n clickOnlyOnHeader = true,\n disabled = false,\n className,\n headerClassName,\n contentClassName,\n contentExpandedClassName,\n }, ref) {\n\n const defaultIcon = useCallback((expanded: boolean) => <ExpansionIcon isExpanded={expanded}/>, [])\n icon ??= defaultIcon\n\n const generatedId = useId()\n const id = providedId ?? generatedId\n\n return (\n <div\n ref={ref}\n onClick={() => !clickOnlyOnHeader && !disabled && onChange?.(!isExpanded)}\n\n className={clsx(\n 'flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm',\n { 'cursor-pointer': !clickOnlyOnHeader && !disabled }, className\n )}\n >\n <button\n onClick={() => clickOnlyOnHeader && !disabled && onChange?.(!isExpanded)}\n\n className={clsx(\n 'flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none',\n {\n 'group-hover:brightness-97': !isExpanded,\n 'hover:brightness-97': isExpanded && !disabled,\n 'cursor-pointer': clickOnlyOnHeader && !disabled,\n },\n headerClassName\n )}\n\n aria-expanded={isExpanded}\n aria-controls={`${id}-content`}\n aria-disabled={disabled ?? undefined}\n >\n {label}\n {icon(isExpanded)}\n </button>\n <div\n id={`${id}-content`}\n className={clsx(\n 'flex-col-2 px-4 transition-all duration-300 ease-in-out',\n {\n [clsx('max-h-96 opacity-100 pb-2 overflow-y-auto', contentExpandedClassName)]: isExpanded,\n 'max-h-0 opacity-0 overflow-hidden': !isExpanded,\n },\n contentClassName\n )}\n\n role=\"region\"\n >\n {children}\n </div>\n </div>\n )\n})\n\nexport const ExpandableUncontrolled = forwardRef<HTMLDivElement, ExpandableProps>(function ExpandableUncontrolled({\n isExpanded,\n onChange,\n ...props\n },\n ref) {\n const [usedIsExpanded, setUsedIsExpanded] = useOverwritableState(isExpanded, onChange)\n\n return (\n <Expandable\n {...props}\n ref={ref}\n isExpanded={usedIsExpanded}\n onChange={setUsedIsExpanded}\n />\n )\n})\n","'use client'\n\nimport type { MutableRefObject } from 'react'\nimport { useCallback, useEffect, useId, useRef, useState } from 'react'\nimport { useIsMounted } from '@/src/hooks/focus/useIsMounted'\n\nconst createFocusGuard = () => {\n const div = document.createElement('div')\n Object.assign(div.style, {\n opacity: '0',\n outline: 'none',\n boxShadow: 'none',\n position: 'fixed',\n pointerEvents: 'none',\n touchAction: 'none',\n })\n div.tabIndex = 0\n div.setAttribute('data-hw-focus-guard', '')\n document.body.appendChild(div)\n return div\n}\n\nfunction getContainedFocusableElements(element: HTMLElement) {\n return element?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])')\n}\n\ntype ListenerType = {\n id: string,\n pause: () => void,\n unpause: () => void,\n focus: () => void,\n focusLast: () => void,\n container: MutableRefObject<HTMLElement>,\n initialFocusElement: MutableRefObject<HTMLElement>,\n}\n\nclass FocusTrapService {\n // The last entry is always the active one\n private listeners: ListenerType[] = []\n\n public getActive(): ListenerType | undefined {\n if (this.listeners.length === 0) return undefined\n return this.listeners[this.listeners.length - 1]\n }\n\n private focusElement() {\n const active = this.getActive()\n if(!active) return\n const { container, initialFocusElement } = active\n const containerElement = container.current\n // Try in the following order\n // 1. Focus the initial element\n // 2. Focus the first focusable element in the container\n // 3. Focus the container\n if (initialFocusElement?.current) {\n initialFocusElement.current.focus()\n } else {\n const elements = getContainedFocusableElements(containerElement)\n if (elements && elements.length > 0) {\n const first = elements.item(0) as HTMLElement\n first.focus()\n } else {\n containerElement.focus()\n }\n }\n }\n\n private onFocusIn = (event: FocusEvent) => {\n const active = this.getActive()\n if(!active || !active.container.current) return\n const { container } = active\n if (!container.current.contains(event.target as HTMLElement)) {\n this.focusElement()\n }\n }\n\n private removeGuards() {\n document.querySelectorAll('[data-hw-focus-guard]').forEach((node) => node.remove())\n }\n\n private addGuards() {\n document.body.insertAdjacentElement('afterbegin', createFocusGuard())\n document.body.insertAdjacentElement('beforeend', createFocusGuard())\n }\n\n private activate() {\n document.addEventListener('focusin', this.onFocusIn)\n this.addGuards()\n }\n\n private deactivate() {\n document.removeEventListener('focusin', this.onFocusIn)\n this.removeGuards()\n }\n\n register(listener: ListenerType) {\n this.listeners.push(listener)\n if (this.listeners.length === 1) {\n this.activate()\n }\n const active = listener\n this.listeners.forEach((listener) => {\n const { focus, pause } = listener\n if (listener === active) {\n focus()\n } else {\n pause()\n }\n })\n }\n\n unregister(id: string) {\n const index = this.listeners.findIndex(trap => trap.id === id)\n if (index !== -1) {\n const isActive = index === this.listeners.length - 1\n const listener = this.listeners[index]\n this.listeners = this.listeners.filter(listener => listener.id !== id)\n if (isActive) {\n // Deactivate all focus traps\n this.deactivate()\n // Focus last element in previous focus context\n listener.focusLast()\n // Activate and pause remaining focus traps\n const active = this.getActive()\n this.listeners.forEach((listener) => {\n const { pause, unpause } = listener\n if (listener === active) {\n unpause()\n } else {\n pause()\n }\n })\n // Reactivate\n if (this.listeners.length > 0) {\n this.activate()\n }\n }\n } else {\n console.warn(`Unable to unregister id ${id}: not found`)\n }\n }\n}\n\nconst service = new FocusTrapService()\n\nexport type UseFocusTrapProps = {\n container: MutableRefObject<HTMLElement>,\n active?: boolean,\n initialFocus?: MutableRefObject<HTMLElement>,\n /**\n * Whether to focus the first element when the initialFocus isn't provided\n *\n * Focuses the container instead\n */\n focusFirst?: boolean,\n}\n\nexport const useFocusTrap = ({\n container,\n active = true,\n initialFocus,\n focusFirst = true,\n }: UseFocusTrapProps) => {\n const lastFocusRef = useRef<HTMLElement | null>(null)\n const [paused, setPaused] = useState(false)\n const isMounted = useIsMounted()\n const id = useId()\n\n const focusElement = useCallback(() => {\n const containerElement = container.current\n // Try in the following order\n // 1. Focus the initial element\n // 2. Focus the first focusable element in the container\n // 3. Focus the container\n if (initialFocus?.current) {\n initialFocus.current.focus()\n } else {\n const elements = getContainedFocusableElements(containerElement)\n if (elements && elements.length > 0) {\n const first = elements.item(0) as HTMLElement\n first.focus()\n } else {\n containerElement.focus()\n }\n }\n }, [container, initialFocus])\n\n useEffect(() => {\n if (active && isMounted) {\n if (!lastFocusRef.current) {\n lastFocusRef.current = document.activeElement as HTMLElement\n }\n\n function pause() {\n setPaused(true)\n }\n\n function unpause() {\n setPaused(false)\n if (!container.current.contains(document.activeElement as HTMLElement)) {\n focusElement()\n }\n }\n\n function focus() {\n focusElement()\n setPaused(false)\n }\n\n function focusLast() {\n lastFocusRef.current?.focus()\n }\n\n service.register({ id, pause, focus, focusLast, unpause, container, initialFocusElement: initialFocus })\n return () => {\n service.unregister(id)\n lastFocusRef.current = undefined\n }\n }\n }, [active, container, focusElement, id, initialFocus, isMounted])\n\n useEffect(() => {\n if (active && !paused && isMounted) {\n const containerElement = container.current\n\n function onKeyDown(event: KeyboardEvent) {\n const key = event.key\n const elements = getContainedFocusableElements(containerElement)\n const active = document.activeElement as HTMLElement\n const index = [...elements].findIndex(value => value === active)\n if (index === -1 || event.altKey || event.ctrlKey || event.metaKey) {\n return\n }\n if (key === 'Tab') {\n const next = event.shiftKey ? -1 : 1\n const nextIndex = (index + next + elements.length) % elements.length\n const nextElement = elements[nextIndex] as HTMLElement\n nextElement.focus()\n event.preventDefault()\n }\n }\n\n // Register and unregister the listeners\n containerElement.addEventListener('keydown', onKeyDown)\n return () => {\n containerElement.removeEventListener('keydown', onKeyDown)\n }\n }\n }, [active, paused, isMounted, container, initialFocus, focusFirst, focusElement])\n}","'use client'\n\nimport { useEffect, useLayoutEffect, useState } from 'react'\n\nconst isClient = typeof window !== 'undefined' && typeof document !== 'undefined'\nconst useIsomorphicEffect = isClient ? useLayoutEffect : useEffect\n\nexport const useIsMounted = () => {\n const [isMounted, setIsMounted] = useState(false)\n\n useIsomorphicEffect(() => {\n setIsMounted(true)\n return () => {\n setIsMounted(false)\n }\n }, [])\n return isMounted\n}","export const match = <K extends string | number | symbol, V>(key: K, values: Record<K, V>) => {\n return values[key]\n}","import type { HTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport clsx from 'clsx'\n\nconst chipColors = ['default', 'dark', 'red', 'yellow', 'green', 'blue', 'pink', 'orange'] as const\nexport type ChipColor = typeof chipColors[number]\n\ntype ChipVariant = 'normal' | 'fullyRounded'\ntype ChipSize = 'sm' | 'md' | 'lg'\n\nexport const ChipUtil = {\n colors: chipColors,\n}\n\nexport type ChipProps = HTMLAttributes<HTMLDivElement> & PropsWithChildren<{\n color?: ChipColor,\n size?: ChipSize,\n icon?: boolean,\n variant?: ChipVariant,\n trailingIcon?: ReactNode,\n}>\n\n/**\n * A component for displaying a single chip\n */\nexport const Chip = ({\n children,\n trailingIcon,\n color = 'default',\n size = 'md',\n icon = false,\n variant = 'normal',\n className = '',\n ...restProps\n }: ChipProps) => {\n const colorMapping: string = {\n default: 'text-tag-default-text bg-tag-default-background',\n dark: 'text-tag-dark-text bg-tag-dark-background',\n red: 'text-tag-red-text bg-tag-red-background',\n yellow: 'text-tag-yellow-text bg-tag-yellow-background',\n green: 'text-tag-green-text bg-tag-green-background',\n blue: 'text-tag-blue-text bg-tag-blue-background',\n pink: 'text-tag-pink-text bg-tag-pink-background',\n orange: 'text-tag-orange-text bg-tag-orange-background',\n }[color]\n\n const colorMappingIcon: string = {\n default: 'text-tag-default-icon',\n dark: 'text-tag-dark-icon',\n red: 'text-tag-red-icon',\n yellow: 'text-tag-yellow-icon',\n green: 'text-tag-green-icon',\n blue: 'text-tag-blue-icon',\n pink: 'text-tag-pink-icon',\n orange: 'text-tag-orange-icon',\n }[color]\n\n return (\n <div\n {...restProps}\n className={clsx(\n `flex-row-0 w-fit font-semibold`,\n colorMapping,\n !icon ? {\n 'px-1 py-0.5': size === 'sm',\n 'px-2 py-1': size === 'md',\n 'px-4 py-2': size === 'lg',\n } : {\n 'p-0.5': size === 'sm',\n 'p-1': size === 'md',\n 'p-2': size === 'lg',\n },\n {\n 'rounded-md': variant === 'normal',\n 'rounded-full': variant === 'fullyRounded',\n },\n className\n )}\n >\n {children}\n {trailingIcon && (<span className={colorMappingIcon}>{trailingIcon}</span>)}\n </div>\n )\n}\n\nexport type ChipListProps = {\n list: ChipProps[],\n className?: string,\n}\n\n/**\n * A component for displaying a list of chips\n */\nexport const ChipList = ({\n list,\n className = ''\n }: ChipListProps) => {\n return (\n <div className={clsx('flex flex-wrap gap-x-2 gap-y-2', className)}>\n {list.map((value, index) => (\n <Chip\n key={index}\n {...value}\n color={value.color ?? 'default'}\n variant={value.variant ?? 'normal'}\n >\n {value.children}\n </Chip>\n ))}\n </div>\n )\n}\n","'use client'\n\nimport type { CSSProperties, MutableRefObject } from 'react'\nimport { useCallback, useEffect, useState } from 'react'\nimport { clamp } from '@/src/utils/math'\nimport { useIsMounted } from '@/src/hooks/focus/useIsMounted'\n\nexport type FloatingElementAlignment = 'beforeStart' | 'afterStart' | 'center' | 'beforeEnd' | 'afterEnd'\n\ntype RectangleBounds = {\n top: number,\n right: number,\n bottom: number,\n left: number,\n width: number,\n height: number,\n}\n\ntype CalculatePositionOptions = {\n verticalAlignment?: FloatingElementAlignment,\n horizontalAlignment?: FloatingElementAlignment,\n screenPadding?: number,\n gap?: number,\n}\n\ntype CalculatePositionProps = {\n windowRect: RectangleBounds,\n containerRect: RectangleBounds,\n anchorRect: RectangleBounds,\n options: CalculatePositionOptions,\n}\n\ntype UseFloatingElementStyle = {\n left: number,\n top: number,\n maxWidth: number,\n maxHeight: number,\n}\n\nfunction calculatePosition({\n windowRect,\n containerRect,\n anchorRect,\n options,\n }: CalculatePositionProps): UseFloatingElementStyle {\n const { verticalAlignment, horizontalAlignment, gap, screenPadding } = options\n const windowWidth = windowRect.width\n const windowHeight = windowRect.height\n\n const maxWidth = windowWidth - 2 * screenPadding\n const maxHeight = windowHeight - 2 * screenPadding\n\n const width = Math.min(containerRect.width, maxWidth)\n const height = Math.min(containerRect.height, maxHeight)\n\n const leftSuggestion = {\n beforeStart: anchorRect.left - width - gap,\n afterStart: anchorRect.left,\n center: anchorRect.left + anchorRect.width / 2 - width / 2,\n beforeEnd: anchorRect.right - width,\n afterEnd: anchorRect.right + gap,\n }[horizontalAlignment]\n\n const topSuggestion = {\n beforeStart: anchorRect.top - height - gap,\n afterStart: anchorRect.top,\n center: anchorRect.top + anchorRect.height / 2 - height / 2,\n beforeEnd: anchorRect.bottom - height,\n afterEnd: anchorRect.bottom + gap,\n }[verticalAlignment]\n\n const left = clamp(leftSuggestion, [\n screenPadding,\n windowWidth - screenPadding - width,\n ])\n\n const top = clamp(topSuggestion, [\n screenPadding,\n windowHeight - screenPadding - height,\n ])\n\n return {\n left,\n top,\n maxWidth,\n maxHeight,\n }\n}\n\nexport type UseFloatingElementOptions = CalculatePositionOptions & {\n isPolling?: boolean,\n pollingInterval?: number,\n}\n\nexport type UseFloatingElementProps = UseFloatingElementOptions & {\n containerRef: MutableRefObject<HTMLElement>,\n anchorRef: MutableRefObject<HTMLElement>,\n windowRef?: MutableRefObject<HTMLElement>,\n active?: boolean,\n}\n\nexport function useFloatingElement({\n active = true,\n windowRef,\n anchorRef,\n containerRef,\n isPolling = false,\n pollingInterval = 100,\n verticalAlignment = 'afterEnd',\n horizontalAlignment = 'afterStart',\n screenPadding = 16,\n gap = 4,\n }: UseFloatingElementProps) {\n const [style, setStyle] = useState<CSSProperties>()\n const isMounted = useIsMounted()\n\n const calculate = useCallback(() => {\n const containerRect = containerRef.current.getBoundingClientRect()\n const windowRect: RectangleBounds = windowRef?.current.getBoundingClientRect() ?? {\n top: 0,\n bottom: window.innerHeight,\n left: 0,\n right: window.innerWidth,\n width: window.innerWidth,\n height: window.innerHeight,\n }\n const anchorElement = anchorRef?.current\n if (anchorRef && !anchorElement) {\n console.warn('FloatingContainer anchor provided, but its value is undefined')\n }\n const anchorRect: RectangleBounds = anchorElement?.getBoundingClientRect() ?? windowRect\n\n const calculateProps: CalculatePositionProps = {\n windowRect,\n anchorRect,\n containerRect,\n options: {\n horizontalAlignment,\n verticalAlignment,\n screenPadding,\n gap,\n }\n }\n setStyle(calculatePosition(calculateProps))\n }, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef])\n\n\n const height = containerRef.current?.getBoundingClientRect().height\n const width = containerRef.current?.getBoundingClientRect().width\n useEffect(() => {\n if (active && isMounted) {\n calculate()\n } else {\n setStyle(undefined)\n }\n }, [calculate, active, isMounted, height, width])\n\n useEffect(() => {\n window.addEventListener('resize', calculate)\n let timeout: NodeJS.Timeout\n if (isPolling) {\n timeout = setInterval(calculate, pollingInterval)\n }\n return () => {\n window.removeEventListener('resize', calculate)\n if (timeout) {\n clearInterval(timeout)\n }\n }\n }, [calculate, isPolling, pollingInterval])\n\n return style\n}","export const clamp = (value: number, range: [number, number] = [0, 1]): number => {\n const [min, max] = range\n return Math.min(Math.max(value, min), max)\n}\n","import { Binary } from 'lucide-react'\nimport clsx from 'clsx'\nimport { Input } from '../user-action/input/Input'\nimport type { PropsForTranslation, Translation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport type { PropertyBaseProps } from './PropertyBase'\nimport { PropertyBase } from './PropertyBase'\n\ntype NumberPropertyTranslation = {\n value: string,\n}\n\nconst defaultNumberPropertyTranslation: Translation<NumberPropertyTranslation> = {\n en: {\n value: 'Value'\n },\n de: {\n value: 'Wert'\n }\n}\n\nexport type NumberPropertyProps = Omit<PropertyBaseProps, 'icon' | 'input' | 'hasValue'> & {\n value?: number,\n suffix?: string,\n onChange?: (value: number) => void,\n onEditComplete?: (value: number) => void,\n}\n\n/**\n * An Input for number properties\n */\nexport const NumberProperty = ({\n overwriteTranslation,\n value,\n onChange,\n onRemove,\n onEditComplete,\n readOnly,\n suffix,\n ...baseProps\n }: PropsForTranslation<NumberPropertyTranslation, NumberPropertyProps>) => {\n const translation = useTranslation([defaultNumberPropertyTranslation], overwriteTranslation)\n const hasValue = value !== undefined\n\n return (\n <PropertyBase\n {...baseProps}\n onRemove={onRemove}\n hasValue={hasValue}\n icon={<Binary size={24}/>}\n input={({ softRequired }) => (\n <div\n className={clsx('flex-row-2 grow', { 'text-warning': softRequired && !hasValue })}\n >\n <Input\n className={clsx('!ring-0 !border-0 !outline-0 !p-0 !m-0 !w-fit !shadow-none !rounded-none', { 'bg-surface-warning placeholder-warning': softRequired && !hasValue })}\n value={value?.toString() ?? ''}\n type=\"number\"\n readOnly={readOnly}\n placeholder={`${translation('value')}...`}\n onChangeText={(value) => {\n const numberValue = parseFloat(value)\n if (isNaN(numberValue)) {\n onRemove()\n } else {\n onChange?.(numberValue)\n }\n }}\n onEditCompleted={(value) => {\n const numberValue = parseFloat(value)\n if (isNaN(numberValue)) {\n onRemove()\n } else {\n onEditComplete(numberValue)\n }\n }}\n />\n {suffix && <span className={clsx('ml-1', { 'bg-surface-warning': softRequired && !hasValue })}>{suffix}</span>}\n </div>\n )}\n />\n )\n}\n","import { List } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { PropsWithChildren, ReactNode } from 'react'\nimport type { FormTranslationType } from '@/src/localization/defaults/form'\nimport type { PropertyBaseProps } from '@/src/components/properties/PropertyBase'\nimport { PropertyBase } from '@/src/components/properties/PropertyBase'\nimport type { PropsForTranslation } from '@/src/localization/useTranslation'\nimport { Select } from '@/src/components/user-action/select/Select'\n\ntype SingleSelectPropertyTranslation = FormTranslationType\n\nexport type SingleSelectPropertyProps =\n Omit<PropertyBaseProps, 'icon' | 'input' | 'hasValue' | 'className'>\n & PropsWithChildren<{\n value?: string,\n onValueChanged?: (value: string) => void,\n onAddNew?: (value: string) => void,\n selectedDisplay?: (value: string) => ReactNode,\n}>\n\n/**\n * An Input for SingleSelect properties\n */\nexport const SingleSelectProperty = ({\n children,\n value,\n onValueChanged,\n selectedDisplay,\n ...props\n }: PropsForTranslation<SingleSelectPropertyTranslation, SingleSelectPropertyProps>) => {\n const hasValue = value !== undefined\n\n return (\n <PropertyBase\n {...props}\n hasValue={hasValue}\n icon={<List size={24}/>}\n input={({ softRequired }) => (\n <Select\n value={value}\n onValueChanged={onValueChanged}\n disabled={props.readOnly}\n buttonProps={{\n className: clsx(\n 'border-none w-full',\n {\n '!bg-warning !text-surface-warning': softRequired && !hasValue,\n }\n ),\n selectedDisplay: selectedDisplay,\n }}\n >\n {children}\n </Select>\n )}\n />\n )\n}\n","import { Text } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { PropsForTranslation, Translation } from '../../localization/useTranslation'\nimport { useTranslation } from '../../localization/useTranslation'\nimport { Textarea } from '../user-action/Textarea'\nimport type { PropertyBaseProps } from './PropertyBase'\nimport { PropertyBase } from './PropertyBase'\n\ntype TextPropertyTranslation = {\n text: string,\n}\n\nconst defaultTextPropertyTranslation: Translation<TextPropertyTranslation> = {\n en: {\n text: 'Text'\n },\n de: {\n text: 'Text'\n }\n}\n\nexport type TextPropertyProps = Omit<PropertyBaseProps, 'icon' | 'input' | 'hasValue'> & {\n value?: string,\n onChange?: (value: string) => void,\n onEditComplete?: (value: string) => void,\n}\n\n/**\n * An Input for Text properties\n */\nexport const TextProperty = ({\n overwriteTranslation,\n value,\n readOnly,\n onChange,\n onRemove,\n onEditComplete,\n ...baseProps\n }: PropsForTranslation<TextPropertyTranslation, TextPropertyProps>) => {\n const translation = useTranslation([defaultTextPropertyTranslation], overwriteTranslation)\n const hasValue = value !== undefined\n\n return (\n <PropertyBase\n {...baseProps}\n onRemove={onRemove}\n hasValue={hasValue}\n icon={<Text size={24}/>}\n input={({ softRequired }) => (\n <Textarea\n className={clsx({\n 'bg-surface-warning placeholder-warning': softRequired && !hasValue\n })}\n rows={5}\n defaultStyle={false}\n value={value ?? ''}\n readOnly={readOnly}\n placeholder={`${translation('text')}...`}\n onChangeText={(value) => {\n if (!value) {\n onRemove?.()\n } else {\n onChange?.(value)\n }\n }}\n onEditCompleted={(value) => {\n if (!value) {\n onRemove?.()\n } else {\n onEditComplete?.(value)\n }\n }}\n />\n )}\n />\n )\n}\n","import type { ReactNode, TextareaHTMLAttributes } from 'react'\nimport { forwardRef, useId } from 'react'\nimport clsx from 'clsx'\nimport type { LabelProps } from '@/src/components/user-action/Label'\nimport { Label } from '@/src/components/user-action/Label'\nimport { useDelay, type UseDelayOptions } from '@/src/hooks/useDelay'\nimport { useOverwritableState } from '@/src/hooks/useOverwritableState'\n\nexport type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value'> & {\n /** Inside the area */\n value?: string,\n invalid?: boolean,\n onChangeText?: (text: string) => void,\n onEditCompleted?: (text: string) => void,\n saveDelayOptions?: UseDelayOptions,\n defaultStyle?: boolean,\n}\n\n/**\n * A Textarea component for inputting longer texts\n *\n * The State is managed by the parent\n */\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea({\n id,\n onChange,\n onChangeText,\n onBlur,\n onEditCompleted,\n saveDelayOptions,\n defaultStyle = true,\n invalid = false,\n disabled = false,\n className,\n ...props\n }, ref) {\n const { restartTimer, clearTimer } = useDelay(saveDelayOptions)\n\n const onEditCompletedWrapper = (text: string) => {\n onEditCompleted?.(text)\n clearTimer()\n }\n\n return (\n <textarea\n ref={ref}\n id={id}\n className={clsx(\n 'resize-none w-full h-32 overflow-y-scroll',\n 'py-2 px-3 rounded-md border-2 border-transparent focus-style-none',\n {\n 'bg-input-background text-input-text hover:border-primary focus:border-primary': !disabled && !invalid,\n 'bg-negative/20 text-negative hover:border-negative focus-visible:border-negative': invalid && !disabled && defaultStyle,\n 'text-disabled bg-disabled-background border-disabled-border': disabled && defaultStyle,\n },\n className\n )}\n onChange={(event) => {\n const value = event.target.value\n restartTimer(() => {\n onEditCompletedWrapper(value)\n })\n onChange?.(event)\n onChangeText?.(value)\n }}\n onBlur={(event) => {\n onBlur?.(event)\n onEditCompletedWrapper(event.target.value)\n }}\n disabled={disabled}\n {...props}\n />\n )\n})\n\n/**\n * A Textarea component that is not controlled by its parent\n */\nexport const TextareaUncontrolled = ({\n value,\n onChangeText,\n ...props\n }: TextareaProps) => {\n const [text, setText] = useOverwritableState<string>(value, onChangeText)\n\n return (\n <Textarea\n {...props}\n value={text}\n onChangeText={setText}\n />\n )\n}\n\nexport type TextareaWithHeadlineProps = Omit<TextareaProps, 'defaultStyle'> & {\n headline: ReactNode,\n headlineProps: Omit<LabelProps, 'children'>,\n containerClassName?: string,\n}\n\nexport const TextareaWithHeadline = ({\n id,\n headline,\n headlineProps,\n disabled,\n className,\n containerClassName,\n ...props\n }: TextareaWithHeadlineProps) => {\n const genId = useId()\n const usedId = id ?? genId\n\n return (\n <div\n className={clsx(\n 'group flex-col-3 border-2 rounded-lg',\n {\n 'bg-input-background text-input-text hover:border-primary focus-within:border-primary': !disabled,\n 'border-disabled-border bg-disabled-background cursor-not-allowed': disabled,\n },\n containerClassName\n )}\n >\n {headline && (\n <Label size=\"md\" {...headlineProps} htmlFor={usedId}>\n {headline}\n </Label>\n )}\n <Textarea\n {...props}\n id={usedId}\n className={clsx(\n 'border-transparent focus:ring-0 focus-visible:ring-0 resize-none h-32',\n className\n )}\n defaultStyle={false}\n />\n </div>\n )\n}"],"mappings":";AAAA,SAAS,SAAAA,cAAa;;;ACAtB,SAAS,OAAO,aAAa;AAC7B,OAAO,UAAU;;;ACDjB,YAAYC,aAAW;;;ACAvB,YAAY,WAAW;AAQvB,SAAS,OAAU,KAAqB,OAAU;AAChD,MAAI,OAAO,QAAQ,YAAY;AAC7B,WAAO,IAAI,KAAK;EAClB,WAAW,QAAQ,QAAQ,QAAQ,QAAW;AAC5C,QAAI,UAAU;EAChB;AACF;AAMA,SAAS,eAAkB,MAA8C;AACvE,SAAO,CAAC,SAAS;AACf,QAAI,aAAa;AACjB,UAAM,WAAW,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AAe,CAAC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAuE;AAClG,QAAM,cAAc,eAAe,CAAC,8BAA8B,GAAG,oBAAoB;AACzF,QAAM,WAAW,UAAU;AAE3B,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,MAAM,gBAAAA,MAAC,QAAK,MAAM,IAAG;AAAA,MACrB,OAAO,CAAC,EAAE,aAAa,MACrB,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAWC,OAAK;AAAA,YACd,0CAA0C,gBAAgB,CAAC;AAAA,UAC7D,CAAC;AAAA,UACD,MAAM;AAAA,UACN,cAAc;AAAA,UACd,OAAO,SAAS;AAAA,UAChB;AAAA,UACA,aAAa,GAAG,YAAY,MAAM,CAAC;AAAA,UACnC,cAAc,CAACC,WAAU;AACvB,gBAAI,CAACA,QAAO;AACV,yBAAW;AAAA,YACb,OAAO;AACL,yBAAWA,MAAK;AAAA,YAClB;AAAA,UACF;AAAA,UACA,iBAAiB,CAACA,WAAU;AAC1B,gBAAI,CAACA,QAAO;AACV,yBAAW;AAAA,YACb,OAAO;AACL,+BAAiBA,MAAK;AAAA,YACxB;AAAA,UACF;AAAA;AAAA,MACF;AAAA;AAAA,EAEJ;AAEJ;","names":["Check","React","React","createContext","useContext","createScope","nextScopes","React","React","useLayoutEffect","React","React","value","React","React","React","React","node","React","React","Fragment","jsx","Slot","getElementRef","props","getElementRef","jsx","Node","Fragment","jsx","isFunction","useEffect","useState","useState","useEffect","jsx","jsxs","Checkbox","createContext","useContext","useEffect","useMemo","useState","useCallback","useState","jsx","createContext","useContext","clsx","forwardRef","clsx","jsx","jsxs","SolidButton","jsxs","clsx","jsx","forwardRef","IconButton","jsx","jsxs","clsx","clsx","jsx","jsx","jsxs","Check","Checkbox","clsx","forwardRef","useRef","clsx","useEffect","useState","useCallback","jsx","forwardRef","Input","useRef","clsx","value","jsx","clsx","value","clsx","createContext","forwardRef","useCallback","useContext","useEffect","useId","useImperativeHandle","useMemo","useRef","useState","clsx","forwardRef","useCallback","useId","clsx","jsx","jsxs","clsx","forwardRef","Expandable","useCallback","useId","ExpandableUncontrolled","useCallback","useEffect","useId","useRef","useState","useEffect","useLayoutEffect","useState","listener","useRef","useState","useId","useCallback","useEffect","active","clsx","jsx","jsxs","jsxs","clsx","jsx","useCallback","useEffect","useState","useState","useCallback","useEffect","jsx","jsxs","createContext","useContext","useRef","useId","useState","useMemo","value","useCallback","isOpen","useEffect","forwardRef","SelectOption","clsx","SelectButton","useImperativeHandle","SelectChipDisplay","SelectContent","Select","SelectUncontrolled","MultiSelect","MultiSelectUncontrolled","MultiSelectChipDisplay","MultiSelectChipDisplayUncontrolled","jsx","clsx","clsx","jsx","jsxs","clsx","value","List","clsx","jsx","List","clsx","clsx","forwardRef","useId","clsx","jsx","jsxs","forwardRef","Textarea","clsx","jsx","clsx","value"]}
|