@helpwave/hightide 0.0.15 → 0.0.16
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/index.d.mts +86 -2
- package/dist/index.d.ts +86 -2
- package/dist/index.js +5714 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5541 -0
- package/dist/index.mjs.map +1 -1
- package/dist/util/news.d.mts +9 -9
- package/dist/util/news.d.ts +9 -9
- package/package.json +11 -7
- package/dist/components/Span.d.mts +0 -2
- package/dist/components/Span.d.ts +0 -2
- package/dist/components/Span.js +0 -2
- package/dist/components/Span.js.map +0 -1
- package/dist/components/Span.mjs +0 -1
- package/dist/components/Span.mjs.map +0 -1
- package/dist/components/examples/InputGroupExample.d.mts +0 -11
- package/dist/components/examples/InputGroupExample.d.ts +0 -11
- package/dist/components/examples/InputGroupExample.js +0 -466
- package/dist/components/examples/InputGroupExample.js.map +0 -1
- package/dist/components/examples/InputGroupExample.mjs +0 -436
- package/dist/components/examples/InputGroupExample.mjs.map +0 -1
- package/dist/components/examples/MultiSelectExample.d.mts +0 -14
- package/dist/components/examples/MultiSelectExample.d.ts +0 -14
- package/dist/components/examples/MultiSelectExample.js +0 -661
- package/dist/components/examples/MultiSelectExample.js.map +0 -1
- package/dist/components/examples/MultiSelectExample.mjs +0 -631
- package/dist/components/examples/MultiSelectExample.mjs.map +0 -1
- package/dist/components/examples/SearchableSelectExample.d.mts +0 -13
- package/dist/components/examples/SearchableSelectExample.d.ts +0 -13
- package/dist/components/examples/SearchableSelectExample.js +0 -365
- package/dist/components/examples/SearchableSelectExample.js.map +0 -1
- package/dist/components/examples/SearchableSelectExample.mjs +0 -335
- package/dist/components/examples/SearchableSelectExample.mjs.map +0 -1
- package/dist/components/examples/SelectExample.d.mts +0 -9
- package/dist/components/examples/SelectExample.d.ts +0 -9
- package/dist/components/examples/SelectExample.js +0 -180
- package/dist/components/examples/SelectExample.js.map +0 -1
- package/dist/components/examples/SelectExample.mjs +0 -145
- package/dist/components/examples/SelectExample.mjs.map +0 -1
- package/dist/components/examples/StackingModals.d.mts +0 -8
- package/dist/components/examples/StackingModals.d.ts +0 -8
- package/dist/components/examples/StackingModals.js +0 -498
- package/dist/components/examples/StackingModals.js.map +0 -1
- package/dist/components/examples/StackingModals.mjs +0 -463
- package/dist/components/examples/StackingModals.mjs.map +0 -1
- package/dist/components/examples/TableExample.d.mts +0 -13
- package/dist/components/examples/TableExample.d.ts +0 -13
- package/dist/components/examples/TableExample.js +0 -853
- package/dist/components/examples/TableExample.js.map +0 -1
- package/dist/components/examples/TableExample.mjs +0 -823
- package/dist/components/examples/TableExample.mjs.map +0 -1
- package/dist/components/examples/TextareaExample.d.mts +0 -12
- package/dist/components/examples/TextareaExample.d.ts +0 -12
- package/dist/components/examples/TextareaExample.js +0 -176
- package/dist/components/examples/TextareaExample.js.map +0 -1
- package/dist/components/examples/TextareaExample.mjs +0 -141
- package/dist/components/examples/TextareaExample.mjs.map +0 -1
- package/dist/components/examples/TileExample.d.mts +0 -14
- package/dist/components/examples/TileExample.d.ts +0 -14
- package/dist/components/examples/TileExample.js +0 -79
- package/dist/components/examples/TileExample.js.map +0 -1
- package/dist/components/examples/TileExample.mjs +0 -44
- package/dist/components/examples/TileExample.mjs.map +0 -1
- package/dist/components/examples/Title.d.mts +0 -2
- package/dist/components/examples/Title.d.ts +0 -2
- package/dist/components/examples/Title.js +0 -2
- package/dist/components/examples/Title.js.map +0 -1
- package/dist/components/examples/Title.mjs +0 -1
- package/dist/components/examples/Title.mjs.map +0 -1
- package/dist/components/examples/date/DateTimePickerExample.d.mts +0 -18
- package/dist/components/examples/date/DateTimePickerExample.d.ts +0 -18
- package/dist/components/examples/date/DateTimePickerExample.js +0 -879
- package/dist/components/examples/date/DateTimePickerExample.js.map +0 -1
- package/dist/components/examples/date/DateTimePickerExample.mjs +0 -844
- package/dist/components/examples/date/DateTimePickerExample.mjs.map +0 -1
- package/dist/components/examples/properties/CheckboxPropertyExample.d.mts +0 -16
- package/dist/components/examples/properties/CheckboxPropertyExample.d.ts +0 -16
- package/dist/components/examples/properties/CheckboxPropertyExample.js +0 -349
- package/dist/components/examples/properties/CheckboxPropertyExample.js.map +0 -1
- package/dist/components/examples/properties/CheckboxPropertyExample.mjs +0 -314
- package/dist/components/examples/properties/CheckboxPropertyExample.mjs.map +0 -1
- package/dist/components/examples/properties/DatePropertyExample.d.mts +0 -16
- package/dist/components/examples/properties/DatePropertyExample.d.ts +0 -16
- package/dist/components/examples/properties/DatePropertyExample.js +0 -460
- package/dist/components/examples/properties/DatePropertyExample.js.map +0 -1
- package/dist/components/examples/properties/DatePropertyExample.mjs +0 -430
- package/dist/components/examples/properties/DatePropertyExample.mjs.map +0 -1
- package/dist/components/examples/properties/MultiSelectPropertyExample.d.mts +0 -18
- package/dist/components/examples/properties/MultiSelectPropertyExample.d.ts +0 -18
- package/dist/components/examples/properties/MultiSelectPropertyExample.js +0 -848
- package/dist/components/examples/properties/MultiSelectPropertyExample.js.map +0 -1
- package/dist/components/examples/properties/MultiSelectPropertyExample.mjs +0 -818
- package/dist/components/examples/properties/MultiSelectPropertyExample.mjs.map +0 -1
- package/dist/components/examples/properties/NumberPropertyExample.d.mts +0 -14
- package/dist/components/examples/properties/NumberPropertyExample.d.ts +0 -14
- package/dist/components/examples/properties/NumberPropertyExample.js +0 -456
- package/dist/components/examples/properties/NumberPropertyExample.js.map +0 -1
- package/dist/components/examples/properties/NumberPropertyExample.mjs +0 -426
- package/dist/components/examples/properties/NumberPropertyExample.mjs.map +0 -1
- package/dist/components/examples/properties/SelectPropertyExample.d.mts +0 -17
- package/dist/components/examples/properties/SelectPropertyExample.d.ts +0 -17
- package/dist/components/examples/properties/SelectPropertyExample.js +0 -584
- package/dist/components/examples/properties/SelectPropertyExample.js.map +0 -1
- package/dist/components/examples/properties/SelectPropertyExample.mjs +0 -554
- package/dist/components/examples/properties/SelectPropertyExample.mjs.map +0 -1
- package/dist/components/examples/properties/TextPropertyExample.d.mts +0 -16
- package/dist/components/examples/properties/TextPropertyExample.d.ts +0 -16
- package/dist/components/examples/properties/TextPropertyExample.js +0 -405
- package/dist/components/examples/properties/TextPropertyExample.js.map +0 -1
- package/dist/components/examples/properties/TextPropertyExample.mjs +0 -370
- package/dist/components/examples/properties/TextPropertyExample.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/examples/properties/NumberPropertyExample.tsx","../../../../src/components/properties/NumberProperty.tsx","../../../../src/util/noop.ts","../../../../src/components/user-input/Input.tsx","../../../../src/hooks/useSaveDelay.ts","../../../../src/components/user-input/Label.tsx","../../../../src/hooks/useLanguage.tsx","../../../../src/hooks/useLocalStorage.tsx","../../../../src/hooks/useTranslation.ts","../../../../src/components/properties/PropertyBase.tsx","../../../../src/components/Button.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport type { NumberPropertyProps } from '../../properties/NumberProperty'\nimport { NumberProperty } from '../../properties/NumberProperty'\n\nexport type NumberPropertyExampleProps = Omit<NumberPropertyProps, 'onChange' | 'onRemove'>\n\n/**\n * Example for using the NumberProperty\n */\nexport const NumberPropertyExample = ({\n value,\n ...restProps\n}: NumberPropertyExampleProps) => {\n const [usedValue, setUsedValue] = useState<number | undefined>(value)\n\n useEffect(() => {\n setUsedValue(value)\n }, [value])\n\n return (\n <NumberProperty\n {...restProps}\n onChange={setUsedValue}\n onRemove={() => setUsedValue(undefined)}\n value={usedValue}\n />\n )\n}\n","import { Binary } from 'lucide-react'\nimport clsx from 'clsx'\nimport { noop } from '../../util/noop'\nimport { Input } from '../user-input/Input'\nimport type { Languages } from '../../hooks/useLanguage'\nimport type { PropsForTranslation } from '../../hooks/useTranslation'\nimport { useTranslation } from '../../hooks/useTranslation'\nimport type { PropertyBaseProps } from './PropertyBase'\nimport { PropertyBase } from './PropertyBase'\n\ntype NumberPropertyTranslation = {\n value: string,\n}\n\nconst defaultNumberPropertyTranslation: Record<Languages, 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 = noop,\n onRemove = noop,\n onEditComplete = noop,\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={16}/>}\n input={({ softRequired }) => (\n <div\n className={clsx('row grow py-2 px-4 cursor-pointer', { 'text-warning': softRequired && !hasValue })}\n >\n <Input\n expanded={false}\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 onChange={(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","export const noop = () => undefined\n","import React, {\n useEffect,\n useRef,\n useState,\n type ChangeEvent,\n type HTMLInputTypeAttribute,\n type InputHTMLAttributes, forwardRef\n} from 'react'\nimport clsx from 'clsx'\nimport useSaveDelay from '../../hooks/useSaveDelay'\nimport { noop } from '../../util/noop'\nimport type { LabelProps } from './Label'\nimport { Label } from './Label'\n\nexport type InputProps = {\n /**\n * used for the label's `for` attribute\n */\n id?: string,\n value: string,\n label?: Omit<LabelProps, 'id'>,\n /**\n * @default 'text'\n */\n type?: HTMLInputTypeAttribute,\n /**\n * Callback for when the input's value changes\n * This is pretty much required but made optional for the rare cases where it actually isn't need such as when used with disabled\n * That could be enforced through a union type but that seems a bit overkill\n * @default noop\n */\n onChange?: (text: string, event: ChangeEvent<HTMLInputElement>) => void,\n onChangeEvent?: (event: ChangeEvent<HTMLInputElement>) => void,\n className?: string,\n onEditCompleted?: (text: string, event: ChangeEvent<HTMLInputElement>) => void,\n expanded?: boolean,\n containerClassName?: string,\n} & Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'value' | 'label' | 'type' | 'onChange' | 'crossOrigin'>\n\n/**\n * A Component for inputting text or other information\n *\n * Its state is managed must be managed by the parent\n */\nconst ControlledInput = ({\n id,\n type = 'text',\n value,\n label,\n onChange = noop,\n onChangeEvent = noop,\n className = '',\n onEditCompleted,\n expanded = true,\n onBlur,\n containerClassName,\n ...restProps\n }: InputProps) => {\n const {\n restartTimer,\n clearUpdateTimer\n } = useSaveDelay(() => undefined, 3000)\n const ref = useRef<HTMLInputElement>(null)\n\n useEffect(() => {\n if (restProps.autoFocus) {\n ref.current?.focus()\n }\n }, [restProps.autoFocus])\n return (\n <div className={clsx({ 'w-full': expanded }, containerClassName)}>\n {label && <Label {...label} htmlFor={id} className={clsx('mb-1', label.className)}/>}\n <input\n ref={ref}\n value={value}\n id={id}\n type={type}\n className={clsx('block bg-surface text-on-surface px-3 py-2 rounded-md w-full border-2 border-gray-200 hover:border-primary focus:outline-none focus:border-primary focus:ring-primary', className)}\n onBlur={event => {\n if (onBlur) {\n onBlur(event)\n }\n if (onEditCompleted) {\n onEditCompleted(event.target.value, event)\n clearUpdateTimer()\n }\n }}\n onChange={e => {\n const value = e.target.value\n if (onEditCompleted) {\n restartTimer(() => {\n onEditCompleted(value, e)\n clearUpdateTimer()\n })\n }\n onChange(value, e)\n onChangeEvent(e)\n }}\n {...restProps}\n />\n </div>\n )\n}\n\ntype UncontrolledInputProps = Omit<InputProps, 'value'> & {\n /**\n * @default ''\n */\n defaultValue?: string,\n}\n\n/**\n * A Component for inputting text or other information\n *\n * Its state is managed by the component itself\n */\nconst UncontrolledInput = ({\n defaultValue = '',\n onChange = noop,\n ...props\n }: UncontrolledInputProps) => {\n const [value, setValue] = useState(defaultValue)\n\n const handleChange = (text: string, event: ChangeEvent<HTMLInputElement>) => {\n setValue(text)\n onChange(text, event)\n }\n\n return (\n <ControlledInput\n {...props}\n value={value}\n onChange={handleChange}\n />\n )\n}\n\nexport type FormInputProps = InputHTMLAttributes<HTMLInputElement> & {\n id: string,\n labelText?: string,\n errorText?: string,\n labelClassName?: string,\n errorClassName?: string,\n containerClassName?: string,\n}\n\nconst FormInput = forwardRef<HTMLInputElement, FormInputProps>(function FormInput({\n id,\n labelText,\n errorText,\n className,\n labelClassName,\n errorClassName,\n containerClassName,\n required,\n ...restProps\n }, ref) {\n const input = (\n <input\n ref={ref}\n id={id}\n {...restProps}\n className={clsx(\n 'block bg-surface text-on-surface px-3 py-2 rounded-md w-full border-2 border-gray-200 hover:border-primary focus:outline-none focus:border-primary focus:ring-primary',\n {\n 'focus:border-primary focus:ring-primary': !errorText,\n 'focus:border-negative focus:ring-negative text-negative': !!errorText,\n },\n className\n )}\n />\n )\n\n return (\n <div className={clsx('flex flex-col gap-y-1', containerClassName)}>\n {labelText && (\n <label htmlFor={id} className={clsx('textstyle-label-md', labelClassName)}>\n {labelText}\n {required && <span className=\"text-primary font-bold\">*</span>}\n </label>\n )}\n {input}\n {errorText && <label htmlFor={id} className={clsx('text-negative', errorClassName)}>{errorText}</label>}\n </div>\n )\n})\n\nexport {\n UncontrolledInput,\n ControlledInput as Input,\n FormInput\n}\n","import { useEffect, useState } from 'react'\n\nfunction useSaveDelay(setNotificationStatus: (isShowing: boolean) => void, delay: number) {\n const [updateTimer, setUpdateTimer] = useState<NodeJS.Timeout | undefined>(undefined)\n const [notificationTimer, setNotificationTimer] = useState<NodeJS.Timeout | undefined>(undefined)\n\n const restartTimer = (onSave: () => void) => {\n clearTimeout(updateTimer)\n setUpdateTimer(setTimeout(() => {\n onSave()\n setNotificationStatus(true)\n // Show Saved Notification for fade animation duration\n clearTimeout(notificationTimer)\n setNotificationTimer(setTimeout(() => {\n setNotificationStatus(false)\n clearTimeout(notificationTimer)\n }, delay))\n clearTimeout(updateTimer)\n }, delay))\n }\n\n const clearUpdateTimer = (hasSaved = true) => {\n clearTimeout(updateTimer)\n if (hasSaved) {\n setNotificationStatus(true)\n clearTimeout(notificationTimer)\n setNotificationTimer(setTimeout(() => {\n setNotificationStatus(false)\n clearTimeout(notificationTimer)\n }, delay))\n } else {\n setNotificationStatus(false)\n }\n }\n\n useEffect(() => {\n return () => {\n clearTimeout(updateTimer)\n clearTimeout(notificationTimer)\n }\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return { restartTimer, clearUpdateTimer }\n}\n\nexport default useSaveDelay\n","import type { LabelHTMLAttributes } from 'react'\n\nexport type LabelType = 'labelSmall' | 'labelMedium' | 'labelBig'\nconst styleMapping: Record<LabelType, string> = {\n labelSmall: 'textstyle-label-sm',\n labelMedium: 'textstyle-label-md',\n labelBig: 'textstyle-label-lg',\n}\n\n\nexport type LabelProps = {\n /** The text for the label */\n name?: string,\n /** The styling for the label */\n labelType?: LabelType,\n} & LabelHTMLAttributes<HTMLLabelElement>\n\n/**\n * A Label component\n */\nexport const Label = ({\n children,\n name,\n labelType = 'labelSmall',\n ...props\n}: LabelProps) => {\n return (\n <label {...props}>\n {children ? children : (<span className={styleMapping[labelType]}>{name}</span>)}\n </label>\n )\n}\n","import type { Dispatch, PropsWithChildren, SetStateAction } from 'react'\nimport { createContext, useContext, useEffect, useState } from 'react'\nimport useLocalStorage from './useLocalStorage'\n\nexport const languages = ['en', 'de'] as const\nexport type Languages = typeof languages[number]\nexport const languagesLocalNames: Record<Languages, string> = {\n en: 'English',\n de: 'Deutsch',\n}\n\nexport const DEFAULT_LANGUAGE = 'en'\n\nexport type LanguageContextValue = {\n language: Languages,\n setLanguage: Dispatch<SetStateAction<Languages>>,\n}\n\nexport const LanguageContext = createContext<LanguageContextValue>({ language: DEFAULT_LANGUAGE, setLanguage: (v) => v })\n\nexport const useLanguage = () => useContext(LanguageContext)\n\nexport const useLocale = (overWriteLanguage?: Languages) => {\n const { language } = useLanguage()\n const mapping: Record<Languages, string> = {\n en: 'en-US',\n de: 'de-DE'\n }\n return mapping[overWriteLanguage ?? language]\n}\n\ntype ProvideLanguageProps = {\n initialLanguage?: Languages,\n}\n\nexport const ProvideLanguage = ({ initialLanguage, children }: PropsWithChildren<ProvideLanguageProps>) => {\n const [language, setLanguage] = useState<Languages>(initialLanguage ?? DEFAULT_LANGUAGE)\n const [storedLanguage, setStoredLanguage] = useLocalStorage<Languages>('language', initialLanguage ?? DEFAULT_LANGUAGE)\n\n useEffect(() => {\n if(language !== initialLanguage && initialLanguage){\n console.warn('LanguageProvider initial state changed: Prefer using useLanguages\\'s setLanguage instead')\n setLanguage(initialLanguage)\n }\n }, [initialLanguage]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n // TODO set locale of html tag here as well\n setStoredLanguage(language)\n }, [language, setStoredLanguage])\n\n useEffect(() => {\n if (storedLanguage !== null) {\n setLanguage(storedLanguage)\n return\n }\n\n const languagesToTestAgainst = Object.values(languages)\n\n const matchingBrowserLanguages = window.navigator.languages\n .map(language => languagesToTestAgainst.find((test) => language === test || language.split('-')[0] === test))\n .filter(entry => entry !== undefined)\n\n if (matchingBrowserLanguages.length === 0) return\n\n const firstMatch = matchingBrowserLanguages[0] as Languages\n setLanguage(firstMatch)\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n <LanguageContext.Provider value={{\n language,\n setLanguage\n }}>\n {children}\n </LanguageContext.Provider>\n )\n}\n","import type { Dispatch, SetStateAction } from 'react'\nimport { useCallback, useEffect, useState } from 'react'\nimport { LocalStorageService } from '../util/storage'\n\ntype SetValue<T> = Dispatch<SetStateAction<T>>\nconst useLocalStorage = <T, >(key: string, initValue: T): [T, SetValue<T>] => {\n const get = useCallback((): T => {\n if (typeof window === 'undefined') {\n return initValue\n }\n const storageService = new LocalStorageService()\n const value = storageService.get<T>(key)\n return value || initValue\n }, [initValue, key])\n\n const [storedValue, setStoredValue] = useState<T>(get)\n\n const setValue: SetValue<T> = useCallback(value => {\n const newValue = value instanceof Function ? value(storedValue) : value\n const storageService = new LocalStorageService()\n storageService.set(key, value)\n\n setStoredValue(newValue)\n }, [storedValue, setStoredValue, key])\n\n useEffect(() => {\n setStoredValue(get())\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return [storedValue, setValue]\n}\n\nexport default useLocalStorage\n","import type { Languages } from './useLanguage'\nimport { useLanguage } from './useLanguage'\n\nexport type Translation<T> = Record<Languages, T>\n\ntype OverwriteTranslationType<Translation extends Record<string, unknown>> = {\n language?: Languages,\n translation?: Partial<Record<Languages, Partial<Translation>>>,\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 Record<string, unknown>,\n Props = Record<string, never>\n> = Props & {\n overwriteTranslation?: OverwriteTranslationType<Translation>,\n};\n\nexport const useTranslation = <Translation extends Record<string, unknown>>(\n defaults: Record<Languages, Translation>,\n translationOverwrite: OverwriteTranslationType<Translation> = {}\n) : Translation => {\n const { language: languageProp, translation: overwrite } = translationOverwrite\n const { language: inferredLanguage } = useLanguage()\n const usedLanguage = languageProp ?? inferredLanguage\n let defaultValues: Translation = defaults[usedLanguage]\n if (overwrite && overwrite[usedLanguage]) {\n defaultValues = { ...defaultValues, ...overwrite[usedLanguage] }\n }\n return defaultValues\n}\n","import type { ReactNode } from 'react'\nimport { AlertTriangle } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { Languages } from '../../hooks/useLanguage'\nimport { TextButton } from '../Button'\nimport type { PropsForTranslation } from '../../hooks/useTranslation'\nimport { useTranslation } from '../../hooks/useTranslation'\n\ntype PropertyBaseTranslation = {\n remove: string,\n}\n\nconst defaultPropertyBaseTranslation: Record<Languages, PropertyBaseTranslation> = {\n en: {\n remove: 'Remove'\n },\n de: {\n remove: 'Entfernen'\n }\n}\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(defaultPropertyBaseTranslation, overwriteTranslation)\n const requiredAndNoValue = softRequired && !hasValue\n return (\n <div className={clsx('row gap-x-0 group', className)}>\n <div\n className={\n clsx('row gap-x-2 !w-[200px] px-4 py-2 items-center rounded-l-xl border-2 border-r-0', {\n 'bg-gray-100 text-black group-hover:border-primary border-gray-400': !requiredAndNoValue,\n 'bg-warning text-surface-warning group-hover:border-warning border-warning/90': requiredAndNoValue,\n }, className)}\n >\n {icon}\n {name}\n </div>\n <div className={\n clsx('row grow justify-between items-center rounded-r-xl border-2 border-l-0', {\n 'bg-white group-hover:border-primary border-gray-400': !requiredAndNoValue,\n 'bg-surface-warning group-hover:border-warning border-warning/90': requiredAndNoValue,\n }, className)}\n >\n {input({ softRequired, hasValue })}\n {requiredAndNoValue && (\n <div className=\"text-warning pr-4\"><AlertTriangle size={24}/></div>\n )}\n {onRemove && (\n <TextButton\n onClick={onRemove}\n color=\"negative\"\n className={clsx('pr-4 items-center', { '!text-transparent': !hasValue || readOnly })}\n disabled={!hasValue || readOnly}\n >\n {translation.remove}\n </TextButton>\n )}\n </div>\n </div>\n )\n}\n","import type { PropsWithChildren, ButtonHTMLAttributes, ReactNode } from 'react'\nimport clsx from 'clsx'\n\nexport type SolidButtonColor = 'primary' | 'secondary' | 'tertiary' | 'positive' | 'warning'| 'negative'\nexport type OutlineButtonColor = 'primary'\nexport type TextButtonColor = 'negative' | 'neutral'\n\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nexport const ButtonSizePaddings: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\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}\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: SolidButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-solid-primary-icon',\n secondary: 'text-button-solid-secondary-icon',\n tertiary: 'text-button-solid-tertiary-icon',\n positive: 'text-button-solid-positive-icon',\n warning: 'text-button-solid-warning-icon',\n negative: 'text-button-solid-negative-icon',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n className,\n {\n 'text-disabled-text bg-disabled-background': disabled,\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled\n },\n ButtonSizePaddings[size]\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent border-2 border-button-outline-primary-text text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n className, {\n 'text-disabled-text border-disabled-outline)': disabled,\n [clsx(colorClasses, 'hover:brightness-80')]: !disabled,\n },\n ButtonSizePaddings[size]\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\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 */\nconst TextButton = ({\n children,\n disabled = false,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n negative: 'bg-transparent text-button-text-negative-text',\n neutral: 'bg-transparent text-button-text-neutral-text',\n }[color]\n\n const iconColorClasses = {\n negative: 'text-button-text-negative-icon',\n neutral: 'text-button-text-neutral-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n className, {\n 'text-disabled-text': disabled,\n [clsx(colorClasses, 'hover:bg-button-text-hover-background rounded-full')]: !disabled,\n },\n ButtonSizePaddings[size]\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n// TODO Icon button\n\nexport { SolidButton, OutlineButton, TextButton }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAAoC;;;ACApC,IAAAC,uBAAuB;AACvB,IAAAC,eAAiB;;;ACDV,IAAM,OAAO,MAAM;;;ACA1B,IAAAC,gBAOO;AACP,kBAAiB;;;ACRjB,mBAAoC;AAEpC,SAAS,aAAa,uBAAqD,OAAe;AACxF,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAqC,MAAS;AACpF,QAAM,CAAC,mBAAmB,oBAAoB,QAAI,uBAAqC,MAAS;AAEhG,QAAM,eAAe,CAAC,WAAuB;AAC3C,iBAAa,WAAW;AACxB,mBAAe,WAAW,MAAM;AAC9B,aAAO;AACP,4BAAsB,IAAI;AAE1B,mBAAa,iBAAiB;AAC9B,2BAAqB,WAAW,MAAM;AACpC,8BAAsB,KAAK;AAC3B,qBAAa,iBAAiB;AAAA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","import_clsx","import_react","import_jsx_runtime","clsx","value","FormInput","clsx","import_react","import_react","import_jsx_runtime","import_clsx","import_clsx","import_jsx_runtime","clsx","import_jsx_runtime","clsx","import_jsx_runtime","clsx","value","import_jsx_runtime"]}
|
|
@@ -1,426 +0,0 @@
|
|
|
1
|
-
// src/components/examples/properties/NumberPropertyExample.tsx
|
|
2
|
-
import { useEffect as useEffect5, useState as useState5 } from "react";
|
|
3
|
-
|
|
4
|
-
// src/components/properties/NumberProperty.tsx
|
|
5
|
-
import { Binary } from "lucide-react";
|
|
6
|
-
import clsx4 from "clsx";
|
|
7
|
-
|
|
8
|
-
// src/util/noop.ts
|
|
9
|
-
var noop = () => void 0;
|
|
10
|
-
|
|
11
|
-
// src/components/user-input/Input.tsx
|
|
12
|
-
import {
|
|
13
|
-
useEffect as useEffect2,
|
|
14
|
-
useRef,
|
|
15
|
-
useState as useState2,
|
|
16
|
-
forwardRef
|
|
17
|
-
} from "react";
|
|
18
|
-
import clsx from "clsx";
|
|
19
|
-
|
|
20
|
-
// src/hooks/useSaveDelay.ts
|
|
21
|
-
import { useEffect, useState } from "react";
|
|
22
|
-
function useSaveDelay(setNotificationStatus, delay) {
|
|
23
|
-
const [updateTimer, setUpdateTimer] = useState(void 0);
|
|
24
|
-
const [notificationTimer, setNotificationTimer] = useState(void 0);
|
|
25
|
-
const restartTimer = (onSave) => {
|
|
26
|
-
clearTimeout(updateTimer);
|
|
27
|
-
setUpdateTimer(setTimeout(() => {
|
|
28
|
-
onSave();
|
|
29
|
-
setNotificationStatus(true);
|
|
30
|
-
clearTimeout(notificationTimer);
|
|
31
|
-
setNotificationTimer(setTimeout(() => {
|
|
32
|
-
setNotificationStatus(false);
|
|
33
|
-
clearTimeout(notificationTimer);
|
|
34
|
-
}, delay));
|
|
35
|
-
clearTimeout(updateTimer);
|
|
36
|
-
}, delay));
|
|
37
|
-
};
|
|
38
|
-
const clearUpdateTimer = (hasSaved = true) => {
|
|
39
|
-
clearTimeout(updateTimer);
|
|
40
|
-
if (hasSaved) {
|
|
41
|
-
setNotificationStatus(true);
|
|
42
|
-
clearTimeout(notificationTimer);
|
|
43
|
-
setNotificationTimer(setTimeout(() => {
|
|
44
|
-
setNotificationStatus(false);
|
|
45
|
-
clearTimeout(notificationTimer);
|
|
46
|
-
}, delay));
|
|
47
|
-
} else {
|
|
48
|
-
setNotificationStatus(false);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
return () => {
|
|
53
|
-
clearTimeout(updateTimer);
|
|
54
|
-
clearTimeout(notificationTimer);
|
|
55
|
-
};
|
|
56
|
-
}, []);
|
|
57
|
-
return { restartTimer, clearUpdateTimer };
|
|
58
|
-
}
|
|
59
|
-
var useSaveDelay_default = useSaveDelay;
|
|
60
|
-
|
|
61
|
-
// src/components/user-input/Label.tsx
|
|
62
|
-
import { jsx } from "react/jsx-runtime";
|
|
63
|
-
var styleMapping = {
|
|
64
|
-
labelSmall: "textstyle-label-sm",
|
|
65
|
-
labelMedium: "textstyle-label-md",
|
|
66
|
-
labelBig: "textstyle-label-lg"
|
|
67
|
-
};
|
|
68
|
-
var Label = ({
|
|
69
|
-
children,
|
|
70
|
-
name,
|
|
71
|
-
labelType = "labelSmall",
|
|
72
|
-
...props
|
|
73
|
-
}) => {
|
|
74
|
-
return /* @__PURE__ */ jsx("label", { ...props, children: children ? children : /* @__PURE__ */ jsx("span", { className: styleMapping[labelType], children: name }) });
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// src/components/user-input/Input.tsx
|
|
78
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
79
|
-
var ControlledInput = ({
|
|
80
|
-
id,
|
|
81
|
-
type = "text",
|
|
82
|
-
value,
|
|
83
|
-
label,
|
|
84
|
-
onChange = noop,
|
|
85
|
-
onChangeEvent = noop,
|
|
86
|
-
className = "",
|
|
87
|
-
onEditCompleted,
|
|
88
|
-
expanded = true,
|
|
89
|
-
onBlur,
|
|
90
|
-
containerClassName,
|
|
91
|
-
...restProps
|
|
92
|
-
}) => {
|
|
93
|
-
const {
|
|
94
|
-
restartTimer,
|
|
95
|
-
clearUpdateTimer
|
|
96
|
-
} = useSaveDelay_default(() => void 0, 3e3);
|
|
97
|
-
const ref = useRef(null);
|
|
98
|
-
useEffect2(() => {
|
|
99
|
-
if (restProps.autoFocus) {
|
|
100
|
-
ref.current?.focus();
|
|
101
|
-
}
|
|
102
|
-
}, [restProps.autoFocus]);
|
|
103
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx({ "w-full": expanded }, containerClassName), children: [
|
|
104
|
-
label && /* @__PURE__ */ jsx2(Label, { ...label, htmlFor: id, className: clsx("mb-1", label.className) }),
|
|
105
|
-
/* @__PURE__ */ jsx2(
|
|
106
|
-
"input",
|
|
107
|
-
{
|
|
108
|
-
ref,
|
|
109
|
-
value,
|
|
110
|
-
id,
|
|
111
|
-
type,
|
|
112
|
-
className: clsx("block bg-surface text-on-surface px-3 py-2 rounded-md w-full border-2 border-gray-200 hover:border-primary focus:outline-none focus:border-primary focus:ring-primary", className),
|
|
113
|
-
onBlur: (event) => {
|
|
114
|
-
if (onBlur) {
|
|
115
|
-
onBlur(event);
|
|
116
|
-
}
|
|
117
|
-
if (onEditCompleted) {
|
|
118
|
-
onEditCompleted(event.target.value, event);
|
|
119
|
-
clearUpdateTimer();
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
onChange: (e) => {
|
|
123
|
-
const value2 = e.target.value;
|
|
124
|
-
if (onEditCompleted) {
|
|
125
|
-
restartTimer(() => {
|
|
126
|
-
onEditCompleted(value2, e);
|
|
127
|
-
clearUpdateTimer();
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
onChange(value2, e);
|
|
131
|
-
onChangeEvent(e);
|
|
132
|
-
},
|
|
133
|
-
...restProps
|
|
134
|
-
}
|
|
135
|
-
)
|
|
136
|
-
] });
|
|
137
|
-
};
|
|
138
|
-
var FormInput = forwardRef(function FormInput2({
|
|
139
|
-
id,
|
|
140
|
-
labelText,
|
|
141
|
-
errorText,
|
|
142
|
-
className,
|
|
143
|
-
labelClassName,
|
|
144
|
-
errorClassName,
|
|
145
|
-
containerClassName,
|
|
146
|
-
required,
|
|
147
|
-
...restProps
|
|
148
|
-
}, ref) {
|
|
149
|
-
const input = /* @__PURE__ */ jsx2(
|
|
150
|
-
"input",
|
|
151
|
-
{
|
|
152
|
-
ref,
|
|
153
|
-
id,
|
|
154
|
-
...restProps,
|
|
155
|
-
className: clsx(
|
|
156
|
-
"block bg-surface text-on-surface px-3 py-2 rounded-md w-full border-2 border-gray-200 hover:border-primary focus:outline-none focus:border-primary focus:ring-primary",
|
|
157
|
-
{
|
|
158
|
-
"focus:border-primary focus:ring-primary": !errorText,
|
|
159
|
-
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
160
|
-
},
|
|
161
|
-
className
|
|
162
|
-
)
|
|
163
|
-
}
|
|
164
|
-
);
|
|
165
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx("flex flex-col gap-y-1", containerClassName), children: [
|
|
166
|
-
labelText && /* @__PURE__ */ jsxs("label", { htmlFor: id, className: clsx("textstyle-label-md", labelClassName), children: [
|
|
167
|
-
labelText,
|
|
168
|
-
required && /* @__PURE__ */ jsx2("span", { className: "text-primary font-bold", children: "*" })
|
|
169
|
-
] }),
|
|
170
|
-
input,
|
|
171
|
-
errorText && /* @__PURE__ */ jsx2("label", { htmlFor: id, className: clsx("text-negative", errorClassName), children: errorText })
|
|
172
|
-
] });
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
// src/hooks/useLanguage.tsx
|
|
176
|
-
import { createContext, useContext, useEffect as useEffect4, useState as useState4 } from "react";
|
|
177
|
-
|
|
178
|
-
// src/hooks/useLocalStorage.tsx
|
|
179
|
-
import { useCallback, useEffect as useEffect3, useState as useState3 } from "react";
|
|
180
|
-
|
|
181
|
-
// src/hooks/useLanguage.tsx
|
|
182
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
183
|
-
var DEFAULT_LANGUAGE = "en";
|
|
184
|
-
var LanguageContext = createContext({ language: DEFAULT_LANGUAGE, setLanguage: (v) => v });
|
|
185
|
-
var useLanguage = () => useContext(LanguageContext);
|
|
186
|
-
|
|
187
|
-
// src/hooks/useTranslation.ts
|
|
188
|
-
var useTranslation = (defaults, translationOverwrite = {}) => {
|
|
189
|
-
const { language: languageProp, translation: overwrite } = translationOverwrite;
|
|
190
|
-
const { language: inferredLanguage } = useLanguage();
|
|
191
|
-
const usedLanguage = languageProp ?? inferredLanguage;
|
|
192
|
-
let defaultValues = defaults[usedLanguage];
|
|
193
|
-
if (overwrite && overwrite[usedLanguage]) {
|
|
194
|
-
defaultValues = { ...defaultValues, ...overwrite[usedLanguage] };
|
|
195
|
-
}
|
|
196
|
-
return defaultValues;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
// src/components/properties/PropertyBase.tsx
|
|
200
|
-
import { AlertTriangle } from "lucide-react";
|
|
201
|
-
import clsx3 from "clsx";
|
|
202
|
-
|
|
203
|
-
// src/components/Button.tsx
|
|
204
|
-
import clsx2 from "clsx";
|
|
205
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
206
|
-
var ButtonSizePaddings = {
|
|
207
|
-
small: "btn-sm",
|
|
208
|
-
medium: "btn-md",
|
|
209
|
-
large: "btn-lg"
|
|
210
|
-
};
|
|
211
|
-
var TextButton = ({
|
|
212
|
-
children,
|
|
213
|
-
disabled = false,
|
|
214
|
-
color = "neutral",
|
|
215
|
-
size = "medium",
|
|
216
|
-
startIcon,
|
|
217
|
-
endIcon,
|
|
218
|
-
onClick,
|
|
219
|
-
className,
|
|
220
|
-
...restProps
|
|
221
|
-
}) => {
|
|
222
|
-
const colorClasses = {
|
|
223
|
-
negative: "bg-transparent text-button-text-negative-text",
|
|
224
|
-
neutral: "bg-transparent text-button-text-neutral-text"
|
|
225
|
-
}[color];
|
|
226
|
-
const iconColorClasses = {
|
|
227
|
-
negative: "text-button-text-negative-icon",
|
|
228
|
-
neutral: "text-button-text-neutral-icon"
|
|
229
|
-
}[color];
|
|
230
|
-
return /* @__PURE__ */ jsxs2(
|
|
231
|
-
"button",
|
|
232
|
-
{
|
|
233
|
-
onClick: disabled ? void 0 : onClick,
|
|
234
|
-
disabled: disabled || onClick === void 0,
|
|
235
|
-
className: clsx2(
|
|
236
|
-
className,
|
|
237
|
-
{
|
|
238
|
-
"text-disabled-text": disabled,
|
|
239
|
-
[clsx2(colorClasses, "hover:bg-button-text-hover-background rounded-full")]: !disabled
|
|
240
|
-
},
|
|
241
|
-
ButtonSizePaddings[size]
|
|
242
|
-
),
|
|
243
|
-
...restProps,
|
|
244
|
-
children: [
|
|
245
|
-
startIcon && /* @__PURE__ */ jsx4(
|
|
246
|
-
"span",
|
|
247
|
-
{
|
|
248
|
-
className: clsx2({
|
|
249
|
-
[iconColorClasses]: !disabled,
|
|
250
|
-
[`text-disabled-icon`]: disabled
|
|
251
|
-
}),
|
|
252
|
-
children: startIcon
|
|
253
|
-
}
|
|
254
|
-
),
|
|
255
|
-
children,
|
|
256
|
-
endIcon && /* @__PURE__ */ jsx4(
|
|
257
|
-
"span",
|
|
258
|
-
{
|
|
259
|
-
className: clsx2({
|
|
260
|
-
[iconColorClasses]: !disabled,
|
|
261
|
-
[`text-disabled-icon`]: disabled
|
|
262
|
-
}),
|
|
263
|
-
children: endIcon
|
|
264
|
-
}
|
|
265
|
-
)
|
|
266
|
-
]
|
|
267
|
-
}
|
|
268
|
-
);
|
|
269
|
-
};
|
|
270
|
-
|
|
271
|
-
// src/components/properties/PropertyBase.tsx
|
|
272
|
-
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
273
|
-
var defaultPropertyBaseTranslation = {
|
|
274
|
-
en: {
|
|
275
|
-
remove: "Remove"
|
|
276
|
-
},
|
|
277
|
-
de: {
|
|
278
|
-
remove: "Entfernen"
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
var PropertyBase = ({
|
|
282
|
-
overwriteTranslation,
|
|
283
|
-
name,
|
|
284
|
-
input,
|
|
285
|
-
softRequired = false,
|
|
286
|
-
hasValue,
|
|
287
|
-
icon,
|
|
288
|
-
readOnly,
|
|
289
|
-
onRemove,
|
|
290
|
-
className = ""
|
|
291
|
-
}) => {
|
|
292
|
-
const translation = useTranslation(defaultPropertyBaseTranslation, overwriteTranslation);
|
|
293
|
-
const requiredAndNoValue = softRequired && !hasValue;
|
|
294
|
-
return /* @__PURE__ */ jsxs3("div", { className: clsx3("row gap-x-0 group", className), children: [
|
|
295
|
-
/* @__PURE__ */ jsxs3(
|
|
296
|
-
"div",
|
|
297
|
-
{
|
|
298
|
-
className: clsx3("row gap-x-2 !w-[200px] px-4 py-2 items-center rounded-l-xl border-2 border-r-0", {
|
|
299
|
-
"bg-gray-100 text-black group-hover:border-primary border-gray-400": !requiredAndNoValue,
|
|
300
|
-
"bg-warning text-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
301
|
-
}, className),
|
|
302
|
-
children: [
|
|
303
|
-
icon,
|
|
304
|
-
name
|
|
305
|
-
]
|
|
306
|
-
}
|
|
307
|
-
),
|
|
308
|
-
/* @__PURE__ */ jsxs3(
|
|
309
|
-
"div",
|
|
310
|
-
{
|
|
311
|
-
className: clsx3("row grow justify-between items-center rounded-r-xl border-2 border-l-0", {
|
|
312
|
-
"bg-white group-hover:border-primary border-gray-400": !requiredAndNoValue,
|
|
313
|
-
"bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
314
|
-
}, className),
|
|
315
|
-
children: [
|
|
316
|
-
input({ softRequired, hasValue }),
|
|
317
|
-
requiredAndNoValue && /* @__PURE__ */ jsx5("div", { className: "text-warning pr-4", children: /* @__PURE__ */ jsx5(AlertTriangle, { size: 24 }) }),
|
|
318
|
-
onRemove && /* @__PURE__ */ jsx5(
|
|
319
|
-
TextButton,
|
|
320
|
-
{
|
|
321
|
-
onClick: onRemove,
|
|
322
|
-
color: "negative",
|
|
323
|
-
className: clsx3("pr-4 items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
324
|
-
disabled: !hasValue || readOnly,
|
|
325
|
-
children: translation.remove
|
|
326
|
-
}
|
|
327
|
-
)
|
|
328
|
-
]
|
|
329
|
-
}
|
|
330
|
-
)
|
|
331
|
-
] });
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
// src/components/properties/NumberProperty.tsx
|
|
335
|
-
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
336
|
-
var defaultNumberPropertyTranslation = {
|
|
337
|
-
en: {
|
|
338
|
-
value: "Value"
|
|
339
|
-
},
|
|
340
|
-
de: {
|
|
341
|
-
value: "Wert"
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
var NumberProperty = ({
|
|
345
|
-
overwriteTranslation,
|
|
346
|
-
value,
|
|
347
|
-
onChange = noop,
|
|
348
|
-
onRemove = noop,
|
|
349
|
-
onEditComplete = noop,
|
|
350
|
-
readOnly,
|
|
351
|
-
suffix,
|
|
352
|
-
...baseProps
|
|
353
|
-
}) => {
|
|
354
|
-
const translation = useTranslation(defaultNumberPropertyTranslation, overwriteTranslation);
|
|
355
|
-
const hasValue = value !== void 0;
|
|
356
|
-
return /* @__PURE__ */ jsx6(
|
|
357
|
-
PropertyBase,
|
|
358
|
-
{
|
|
359
|
-
...baseProps,
|
|
360
|
-
onRemove,
|
|
361
|
-
hasValue,
|
|
362
|
-
icon: /* @__PURE__ */ jsx6(Binary, { size: 16 }),
|
|
363
|
-
input: ({ softRequired }) => /* @__PURE__ */ jsxs4(
|
|
364
|
-
"div",
|
|
365
|
-
{
|
|
366
|
-
className: clsx4("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
|
|
367
|
-
children: [
|
|
368
|
-
/* @__PURE__ */ jsx6(
|
|
369
|
-
ControlledInput,
|
|
370
|
-
{
|
|
371
|
-
expanded: false,
|
|
372
|
-
className: clsx4("!ring-0 !border-0 !outline-0 !p-0 !m-0 !w-fit !shadow-none !rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
|
|
373
|
-
value: value?.toString() ?? "",
|
|
374
|
-
type: "number",
|
|
375
|
-
readOnly,
|
|
376
|
-
placeholder: `${translation.value}...`,
|
|
377
|
-
onChange: (value2) => {
|
|
378
|
-
const numberValue = parseFloat(value2);
|
|
379
|
-
if (isNaN(numberValue)) {
|
|
380
|
-
onRemove();
|
|
381
|
-
} else {
|
|
382
|
-
onChange(numberValue);
|
|
383
|
-
}
|
|
384
|
-
},
|
|
385
|
-
onEditCompleted: (value2) => {
|
|
386
|
-
const numberValue = parseFloat(value2);
|
|
387
|
-
if (isNaN(numberValue)) {
|
|
388
|
-
onRemove();
|
|
389
|
-
} else {
|
|
390
|
-
onEditComplete(numberValue);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
),
|
|
395
|
-
suffix && /* @__PURE__ */ jsx6("span", { className: clsx4("ml-1", { "bg-surface-warning": softRequired && !hasValue }), children: suffix })
|
|
396
|
-
]
|
|
397
|
-
}
|
|
398
|
-
)
|
|
399
|
-
}
|
|
400
|
-
);
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
// src/components/examples/properties/NumberPropertyExample.tsx
|
|
404
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
405
|
-
var NumberPropertyExample = ({
|
|
406
|
-
value,
|
|
407
|
-
...restProps
|
|
408
|
-
}) => {
|
|
409
|
-
const [usedValue, setUsedValue] = useState5(value);
|
|
410
|
-
useEffect5(() => {
|
|
411
|
-
setUsedValue(value);
|
|
412
|
-
}, [value]);
|
|
413
|
-
return /* @__PURE__ */ jsx7(
|
|
414
|
-
NumberProperty,
|
|
415
|
-
{
|
|
416
|
-
...restProps,
|
|
417
|
-
onChange: setUsedValue,
|
|
418
|
-
onRemove: () => setUsedValue(void 0),
|
|
419
|
-
value: usedValue
|
|
420
|
-
}
|
|
421
|
-
);
|
|
422
|
-
};
|
|
423
|
-
export {
|
|
424
|
-
NumberPropertyExample
|
|
425
|
-
};
|
|
426
|
-
//# sourceMappingURL=NumberPropertyExample.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/examples/properties/NumberPropertyExample.tsx","../../../../src/components/properties/NumberProperty.tsx","../../../../src/util/noop.ts","../../../../src/components/user-input/Input.tsx","../../../../src/hooks/useSaveDelay.ts","../../../../src/components/user-input/Label.tsx","../../../../src/hooks/useLanguage.tsx","../../../../src/hooks/useLocalStorage.tsx","../../../../src/hooks/useTranslation.ts","../../../../src/components/properties/PropertyBase.tsx","../../../../src/components/Button.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport type { NumberPropertyProps } from '../../properties/NumberProperty'\nimport { NumberProperty } from '../../properties/NumberProperty'\n\nexport type NumberPropertyExampleProps = Omit<NumberPropertyProps, 'onChange' | 'onRemove'>\n\n/**\n * Example for using the NumberProperty\n */\nexport const NumberPropertyExample = ({\n value,\n ...restProps\n}: NumberPropertyExampleProps) => {\n const [usedValue, setUsedValue] = useState<number | undefined>(value)\n\n useEffect(() => {\n setUsedValue(value)\n }, [value])\n\n return (\n <NumberProperty\n {...restProps}\n onChange={setUsedValue}\n onRemove={() => setUsedValue(undefined)}\n value={usedValue}\n />\n )\n}\n","import { Binary } from 'lucide-react'\nimport clsx from 'clsx'\nimport { noop } from '../../util/noop'\nimport { Input } from '../user-input/Input'\nimport type { Languages } from '../../hooks/useLanguage'\nimport type { PropsForTranslation } from '../../hooks/useTranslation'\nimport { useTranslation } from '../../hooks/useTranslation'\nimport type { PropertyBaseProps } from './PropertyBase'\nimport { PropertyBase } from './PropertyBase'\n\ntype NumberPropertyTranslation = {\n value: string,\n}\n\nconst defaultNumberPropertyTranslation: Record<Languages, 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 = noop,\n onRemove = noop,\n onEditComplete = noop,\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={16}/>}\n input={({ softRequired }) => (\n <div\n className={clsx('row grow py-2 px-4 cursor-pointer', { 'text-warning': softRequired && !hasValue })}\n >\n <Input\n expanded={false}\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 onChange={(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","export const noop = () => undefined\n","import React, {\n useEffect,\n useRef,\n useState,\n type ChangeEvent,\n type HTMLInputTypeAttribute,\n type InputHTMLAttributes, forwardRef\n} from 'react'\nimport clsx from 'clsx'\nimport useSaveDelay from '../../hooks/useSaveDelay'\nimport { noop } from '../../util/noop'\nimport type { LabelProps } from './Label'\nimport { Label } from './Label'\n\nexport type InputProps = {\n /**\n * used for the label's `for` attribute\n */\n id?: string,\n value: string,\n label?: Omit<LabelProps, 'id'>,\n /**\n * @default 'text'\n */\n type?: HTMLInputTypeAttribute,\n /**\n * Callback for when the input's value changes\n * This is pretty much required but made optional for the rare cases where it actually isn't need such as when used with disabled\n * That could be enforced through a union type but that seems a bit overkill\n * @default noop\n */\n onChange?: (text: string, event: ChangeEvent<HTMLInputElement>) => void,\n onChangeEvent?: (event: ChangeEvent<HTMLInputElement>) => void,\n className?: string,\n onEditCompleted?: (text: string, event: ChangeEvent<HTMLInputElement>) => void,\n expanded?: boolean,\n containerClassName?: string,\n} & Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'value' | 'label' | 'type' | 'onChange' | 'crossOrigin'>\n\n/**\n * A Component for inputting text or other information\n *\n * Its state is managed must be managed by the parent\n */\nconst ControlledInput = ({\n id,\n type = 'text',\n value,\n label,\n onChange = noop,\n onChangeEvent = noop,\n className = '',\n onEditCompleted,\n expanded = true,\n onBlur,\n containerClassName,\n ...restProps\n }: InputProps) => {\n const {\n restartTimer,\n clearUpdateTimer\n } = useSaveDelay(() => undefined, 3000)\n const ref = useRef<HTMLInputElement>(null)\n\n useEffect(() => {\n if (restProps.autoFocus) {\n ref.current?.focus()\n }\n }, [restProps.autoFocus])\n return (\n <div className={clsx({ 'w-full': expanded }, containerClassName)}>\n {label && <Label {...label} htmlFor={id} className={clsx('mb-1', label.className)}/>}\n <input\n ref={ref}\n value={value}\n id={id}\n type={type}\n className={clsx('block bg-surface text-on-surface px-3 py-2 rounded-md w-full border-2 border-gray-200 hover:border-primary focus:outline-none focus:border-primary focus:ring-primary', className)}\n onBlur={event => {\n if (onBlur) {\n onBlur(event)\n }\n if (onEditCompleted) {\n onEditCompleted(event.target.value, event)\n clearUpdateTimer()\n }\n }}\n onChange={e => {\n const value = e.target.value\n if (onEditCompleted) {\n restartTimer(() => {\n onEditCompleted(value, e)\n clearUpdateTimer()\n })\n }\n onChange(value, e)\n onChangeEvent(e)\n }}\n {...restProps}\n />\n </div>\n )\n}\n\ntype UncontrolledInputProps = Omit<InputProps, 'value'> & {\n /**\n * @default ''\n */\n defaultValue?: string,\n}\n\n/**\n * A Component for inputting text or other information\n *\n * Its state is managed by the component itself\n */\nconst UncontrolledInput = ({\n defaultValue = '',\n onChange = noop,\n ...props\n }: UncontrolledInputProps) => {\n const [value, setValue] = useState(defaultValue)\n\n const handleChange = (text: string, event: ChangeEvent<HTMLInputElement>) => {\n setValue(text)\n onChange(text, event)\n }\n\n return (\n <ControlledInput\n {...props}\n value={value}\n onChange={handleChange}\n />\n )\n}\n\nexport type FormInputProps = InputHTMLAttributes<HTMLInputElement> & {\n id: string,\n labelText?: string,\n errorText?: string,\n labelClassName?: string,\n errorClassName?: string,\n containerClassName?: string,\n}\n\nconst FormInput = forwardRef<HTMLInputElement, FormInputProps>(function FormInput({\n id,\n labelText,\n errorText,\n className,\n labelClassName,\n errorClassName,\n containerClassName,\n required,\n ...restProps\n }, ref) {\n const input = (\n <input\n ref={ref}\n id={id}\n {...restProps}\n className={clsx(\n 'block bg-surface text-on-surface px-3 py-2 rounded-md w-full border-2 border-gray-200 hover:border-primary focus:outline-none focus:border-primary focus:ring-primary',\n {\n 'focus:border-primary focus:ring-primary': !errorText,\n 'focus:border-negative focus:ring-negative text-negative': !!errorText,\n },\n className\n )}\n />\n )\n\n return (\n <div className={clsx('flex flex-col gap-y-1', containerClassName)}>\n {labelText && (\n <label htmlFor={id} className={clsx('textstyle-label-md', labelClassName)}>\n {labelText}\n {required && <span className=\"text-primary font-bold\">*</span>}\n </label>\n )}\n {input}\n {errorText && <label htmlFor={id} className={clsx('text-negative', errorClassName)}>{errorText}</label>}\n </div>\n )\n})\n\nexport {\n UncontrolledInput,\n ControlledInput as Input,\n FormInput\n}\n","import { useEffect, useState } from 'react'\n\nfunction useSaveDelay(setNotificationStatus: (isShowing: boolean) => void, delay: number) {\n const [updateTimer, setUpdateTimer] = useState<NodeJS.Timeout | undefined>(undefined)\n const [notificationTimer, setNotificationTimer] = useState<NodeJS.Timeout | undefined>(undefined)\n\n const restartTimer = (onSave: () => void) => {\n clearTimeout(updateTimer)\n setUpdateTimer(setTimeout(() => {\n onSave()\n setNotificationStatus(true)\n // Show Saved Notification for fade animation duration\n clearTimeout(notificationTimer)\n setNotificationTimer(setTimeout(() => {\n setNotificationStatus(false)\n clearTimeout(notificationTimer)\n }, delay))\n clearTimeout(updateTimer)\n }, delay))\n }\n\n const clearUpdateTimer = (hasSaved = true) => {\n clearTimeout(updateTimer)\n if (hasSaved) {\n setNotificationStatus(true)\n clearTimeout(notificationTimer)\n setNotificationTimer(setTimeout(() => {\n setNotificationStatus(false)\n clearTimeout(notificationTimer)\n }, delay))\n } else {\n setNotificationStatus(false)\n }\n }\n\n useEffect(() => {\n return () => {\n clearTimeout(updateTimer)\n clearTimeout(notificationTimer)\n }\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return { restartTimer, clearUpdateTimer }\n}\n\nexport default useSaveDelay\n","import type { LabelHTMLAttributes } from 'react'\n\nexport type LabelType = 'labelSmall' | 'labelMedium' | 'labelBig'\nconst styleMapping: Record<LabelType, string> = {\n labelSmall: 'textstyle-label-sm',\n labelMedium: 'textstyle-label-md',\n labelBig: 'textstyle-label-lg',\n}\n\n\nexport type LabelProps = {\n /** The text for the label */\n name?: string,\n /** The styling for the label */\n labelType?: LabelType,\n} & LabelHTMLAttributes<HTMLLabelElement>\n\n/**\n * A Label component\n */\nexport const Label = ({\n children,\n name,\n labelType = 'labelSmall',\n ...props\n}: LabelProps) => {\n return (\n <label {...props}>\n {children ? children : (<span className={styleMapping[labelType]}>{name}</span>)}\n </label>\n )\n}\n","import type { Dispatch, PropsWithChildren, SetStateAction } from 'react'\nimport { createContext, useContext, useEffect, useState } from 'react'\nimport useLocalStorage from './useLocalStorage'\n\nexport const languages = ['en', 'de'] as const\nexport type Languages = typeof languages[number]\nexport const languagesLocalNames: Record<Languages, string> = {\n en: 'English',\n de: 'Deutsch',\n}\n\nexport const DEFAULT_LANGUAGE = 'en'\n\nexport type LanguageContextValue = {\n language: Languages,\n setLanguage: Dispatch<SetStateAction<Languages>>,\n}\n\nexport const LanguageContext = createContext<LanguageContextValue>({ language: DEFAULT_LANGUAGE, setLanguage: (v) => v })\n\nexport const useLanguage = () => useContext(LanguageContext)\n\nexport const useLocale = (overWriteLanguage?: Languages) => {\n const { language } = useLanguage()\n const mapping: Record<Languages, string> = {\n en: 'en-US',\n de: 'de-DE'\n }\n return mapping[overWriteLanguage ?? language]\n}\n\ntype ProvideLanguageProps = {\n initialLanguage?: Languages,\n}\n\nexport const ProvideLanguage = ({ initialLanguage, children }: PropsWithChildren<ProvideLanguageProps>) => {\n const [language, setLanguage] = useState<Languages>(initialLanguage ?? DEFAULT_LANGUAGE)\n const [storedLanguage, setStoredLanguage] = useLocalStorage<Languages>('language', initialLanguage ?? DEFAULT_LANGUAGE)\n\n useEffect(() => {\n if(language !== initialLanguage && initialLanguage){\n console.warn('LanguageProvider initial state changed: Prefer using useLanguages\\'s setLanguage instead')\n setLanguage(initialLanguage)\n }\n }, [initialLanguage]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n // TODO set locale of html tag here as well\n setStoredLanguage(language)\n }, [language, setStoredLanguage])\n\n useEffect(() => {\n if (storedLanguage !== null) {\n setLanguage(storedLanguage)\n return\n }\n\n const languagesToTestAgainst = Object.values(languages)\n\n const matchingBrowserLanguages = window.navigator.languages\n .map(language => languagesToTestAgainst.find((test) => language === test || language.split('-')[0] === test))\n .filter(entry => entry !== undefined)\n\n if (matchingBrowserLanguages.length === 0) return\n\n const firstMatch = matchingBrowserLanguages[0] as Languages\n setLanguage(firstMatch)\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n <LanguageContext.Provider value={{\n language,\n setLanguage\n }}>\n {children}\n </LanguageContext.Provider>\n )\n}\n","import type { Dispatch, SetStateAction } from 'react'\nimport { useCallback, useEffect, useState } from 'react'\nimport { LocalStorageService } from '../util/storage'\n\ntype SetValue<T> = Dispatch<SetStateAction<T>>\nconst useLocalStorage = <T, >(key: string, initValue: T): [T, SetValue<T>] => {\n const get = useCallback((): T => {\n if (typeof window === 'undefined') {\n return initValue\n }\n const storageService = new LocalStorageService()\n const value = storageService.get<T>(key)\n return value || initValue\n }, [initValue, key])\n\n const [storedValue, setStoredValue] = useState<T>(get)\n\n const setValue: SetValue<T> = useCallback(value => {\n const newValue = value instanceof Function ? value(storedValue) : value\n const storageService = new LocalStorageService()\n storageService.set(key, value)\n\n setStoredValue(newValue)\n }, [storedValue, setStoredValue, key])\n\n useEffect(() => {\n setStoredValue(get())\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return [storedValue, setValue]\n}\n\nexport default useLocalStorage\n","import type { Languages } from './useLanguage'\nimport { useLanguage } from './useLanguage'\n\nexport type Translation<T> = Record<Languages, T>\n\ntype OverwriteTranslationType<Translation extends Record<string, unknown>> = {\n language?: Languages,\n translation?: Partial<Record<Languages, Partial<Translation>>>,\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 Record<string, unknown>,\n Props = Record<string, never>\n> = Props & {\n overwriteTranslation?: OverwriteTranslationType<Translation>,\n};\n\nexport const useTranslation = <Translation extends Record<string, unknown>>(\n defaults: Record<Languages, Translation>,\n translationOverwrite: OverwriteTranslationType<Translation> = {}\n) : Translation => {\n const { language: languageProp, translation: overwrite } = translationOverwrite\n const { language: inferredLanguage } = useLanguage()\n const usedLanguage = languageProp ?? inferredLanguage\n let defaultValues: Translation = defaults[usedLanguage]\n if (overwrite && overwrite[usedLanguage]) {\n defaultValues = { ...defaultValues, ...overwrite[usedLanguage] }\n }\n return defaultValues\n}\n","import type { ReactNode } from 'react'\nimport { AlertTriangle } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { Languages } from '../../hooks/useLanguage'\nimport { TextButton } from '../Button'\nimport type { PropsForTranslation } from '../../hooks/useTranslation'\nimport { useTranslation } from '../../hooks/useTranslation'\n\ntype PropertyBaseTranslation = {\n remove: string,\n}\n\nconst defaultPropertyBaseTranslation: Record<Languages, PropertyBaseTranslation> = {\n en: {\n remove: 'Remove'\n },\n de: {\n remove: 'Entfernen'\n }\n}\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(defaultPropertyBaseTranslation, overwriteTranslation)\n const requiredAndNoValue = softRequired && !hasValue\n return (\n <div className={clsx('row gap-x-0 group', className)}>\n <div\n className={\n clsx('row gap-x-2 !w-[200px] px-4 py-2 items-center rounded-l-xl border-2 border-r-0', {\n 'bg-gray-100 text-black group-hover:border-primary border-gray-400': !requiredAndNoValue,\n 'bg-warning text-surface-warning group-hover:border-warning border-warning/90': requiredAndNoValue,\n }, className)}\n >\n {icon}\n {name}\n </div>\n <div className={\n clsx('row grow justify-between items-center rounded-r-xl border-2 border-l-0', {\n 'bg-white group-hover:border-primary border-gray-400': !requiredAndNoValue,\n 'bg-surface-warning group-hover:border-warning border-warning/90': requiredAndNoValue,\n }, className)}\n >\n {input({ softRequired, hasValue })}\n {requiredAndNoValue && (\n <div className=\"text-warning pr-4\"><AlertTriangle size={24}/></div>\n )}\n {onRemove && (\n <TextButton\n onClick={onRemove}\n color=\"negative\"\n className={clsx('pr-4 items-center', { '!text-transparent': !hasValue || readOnly })}\n disabled={!hasValue || readOnly}\n >\n {translation.remove}\n </TextButton>\n )}\n </div>\n </div>\n )\n}\n","import type { PropsWithChildren, ButtonHTMLAttributes, ReactNode } from 'react'\nimport clsx from 'clsx'\n\nexport type SolidButtonColor = 'primary' | 'secondary' | 'tertiary' | 'positive' | 'warning'| 'negative'\nexport type OutlineButtonColor = 'primary'\nexport type TextButtonColor = 'negative' | 'neutral'\n\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nexport const ButtonSizePaddings: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\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}\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: SolidButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-solid-primary-icon',\n secondary: 'text-button-solid-secondary-icon',\n tertiary: 'text-button-solid-tertiary-icon',\n positive: 'text-button-solid-positive-icon',\n warning: 'text-button-solid-warning-icon',\n negative: 'text-button-solid-negative-icon',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n className,\n {\n 'text-disabled-text bg-disabled-background': disabled,\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled\n },\n ButtonSizePaddings[size]\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent border-2 border-button-outline-primary-text text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n className, {\n 'text-disabled-text border-disabled-outline)': disabled,\n [clsx(colorClasses, 'hover:brightness-80')]: !disabled,\n },\n ButtonSizePaddings[size]\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\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 */\nconst TextButton = ({\n children,\n disabled = false,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n negative: 'bg-transparent text-button-text-negative-text',\n neutral: 'bg-transparent text-button-text-neutral-text',\n }[color]\n\n const iconColorClasses = {\n negative: 'text-button-text-negative-icon',\n neutral: 'text-button-text-neutral-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n className, {\n 'text-disabled-text': disabled,\n [clsx(colorClasses, 'hover:bg-button-text-hover-background rounded-full')]: !disabled,\n },\n ButtonSizePaddings[size]\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n// TODO Icon button\n\nexport { SolidButton, OutlineButton, TextButton }\n"],"mappings":";AAAA,SAAS,aAAAA,YAAW,YAAAC,iBAAgB;;;ACApC,SAAS,cAAc;AACvB,OAAOC,WAAU;;;ACDV,IAAM,OAAO,MAAM;;;ACA1B;AAAA,EACE,aAAAC;AAAA,EACA;AAAA,EACA,YAAAC;AAAA,EAG0B;AAAA,OACrB;AACP,OAAO,UAAU;;;ACRjB,SAAS,WAAW,gBAAgB;AAEpC,SAAS,aAAa,uBAAqD,OAAe;AACxF,QAAM,CAAC,aAAa,cAAc,IAAI,SAAqC,MAAS;AACpF,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,SAAqC,MAAS;AAEhG,QAAM,eAAe,CAAC,WAAuB;AAC3C,iBAAa,WAAW;AACxB,mBAAe,WAAW,MAAM;AAC9B,aAAO;AACP,4BAAsB,IAAI;AAE1B,mBAAa,iBAAiB;AAC9B,2BAAqB,WAAW,MAAM;AACpC,8BAAsB,KAAK;AAC3B,qBAAa,iBAAiB;AAAA,MAChC,GAAG,KAAK,CAAC;AACT,mBAAa,WAAW;AAAA,IAC1B,GAA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,UAAU;AAAA,MACV,UAAU,MAAM,aAAa,MAAS;AAAA,MACtC,OAAO;AAAA;AAAA,EACT;AAEJ;","names":["useEffect","useState","clsx","useEffect","useState","jsx","useEffect","value","FormInput","jsx","useEffect","useState","useEffect","useState","jsx","clsx","clsx","jsx","jsxs","jsxs","clsx","jsx","jsx","jsxs","clsx","jsx","jsxs","clsx","value","jsx","useState","useEffect"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { SingleSelectPropertyProps } from '../../properties/SelectProperty.mjs';
|
|
3
|
-
import '../../../hooks/useTranslation.mjs';
|
|
4
|
-
import '../../../hooks/useLanguage.mjs';
|
|
5
|
-
import 'react';
|
|
6
|
-
import '../../user-input/SearchableSelect.mjs';
|
|
7
|
-
import '../../user-input/Select.mjs';
|
|
8
|
-
import '../../user-input/Label.mjs';
|
|
9
|
-
import '../../properties/PropertyBase.mjs';
|
|
10
|
-
|
|
11
|
-
type SingleSelectPropertyExample = Omit<SingleSelectPropertyProps<string>, 'onChange' | 'onRemove' | 'searchMapping'>;
|
|
12
|
-
/**
|
|
13
|
-
* Example for using the SingleSelectProperty
|
|
14
|
-
*/
|
|
15
|
-
declare const SingleSelectPropertyExample: ({ value, options, hintText, ...restProps }: SingleSelectPropertyExample) => react_jsx_runtime.JSX.Element;
|
|
16
|
-
|
|
17
|
-
export { SingleSelectPropertyExample };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { SingleSelectPropertyProps } from '../../properties/SelectProperty.js';
|
|
3
|
-
import '../../../hooks/useTranslation.js';
|
|
4
|
-
import '../../../hooks/useLanguage.js';
|
|
5
|
-
import 'react';
|
|
6
|
-
import '../../user-input/SearchableSelect.js';
|
|
7
|
-
import '../../user-input/Select.js';
|
|
8
|
-
import '../../user-input/Label.js';
|
|
9
|
-
import '../../properties/PropertyBase.js';
|
|
10
|
-
|
|
11
|
-
type SingleSelectPropertyExample = Omit<SingleSelectPropertyProps<string>, 'onChange' | 'onRemove' | 'searchMapping'>;
|
|
12
|
-
/**
|
|
13
|
-
* Example for using the SingleSelectProperty
|
|
14
|
-
*/
|
|
15
|
-
declare const SingleSelectPropertyExample: ({ value, options, hintText, ...restProps }: SingleSelectPropertyExample) => react_jsx_runtime.JSX.Element;
|
|
16
|
-
|
|
17
|
-
export { SingleSelectPropertyExample };
|