@yca-software/yca-react-core 0.0.22 → 0.0.24

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.
@@ -1,4 +1,4 @@
1
- import { FormField, FormItem, FormLabel, FormControl, Textarea, FormMessage, Select, Tooltip, Checkbox, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from './chunk-QHNZTXPJ.js';
1
+ import { FormField, FormItem, FormLabel, FormControl, Textarea, FormMessage, Select, Tooltip, Checkbox, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from './chunk-GDYI2I74.js';
2
2
  import { Input } from './chunk-3AYG73DK.js';
3
3
  import { cn } from './chunk-GXWVFQCK.js';
4
4
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -335,5 +335,5 @@ function RoleSelectField({
335
335
  }
336
336
 
337
337
  export { DescriptionField, EmailField, ExpiresAtField, FirstNameField, LastNameField, NameField, PasswordField, PermissionsField, RoleSelectField };
338
- //# sourceMappingURL=chunk-HJZNKZHZ.js.map
339
- //# sourceMappingURL=chunk-HJZNKZHZ.js.map
338
+ //# sourceMappingURL=chunk-L4KNKLFW.js.map
339
+ //# sourceMappingURL=chunk-L4KNKLFW.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/forms/description-field/index.tsx","../src/components/forms/email-field/index.tsx","../src/components/forms/expires-at-field/index.tsx","../src/components/forms/first-name-field/index.tsx","../src/components/forms/last-name-field/index.tsx","../src/components/forms/name-field/index.tsx","../src/components/forms/password-field/index.tsx","../src/components/forms/permissions-field/index.tsx","../src/components/forms/role-select-field/index.tsx"],"names":["jsx","jsxs"],"mappings":";;;;;;AAYO,SAAS,gBAAA,CAAwC;AAAA,EACtD,OAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA,EAA6B;AAC3B,EAAA,uBACE,GAAA;AAAA,IAAC,S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AI,CAAC,wBACZA,GAAAA,CAAC,oBAAiC,OAAA,EAAS,MAAM,KAAA,CAAM,QAAA,CAAS,IAAI,KAAK,CAAA,EACtE,cAAI,KAAA,EAAA,EADgB,GAAA,CAAI,KAE3B,CACD;AAAA;AAAA;AACH,WAAA,EACF,CAAA,EACF,CAAA;AAAA,0BACAA,IAAC,WAAA,EAAA,EAAY;AAAA,SAAA,EACf,CAAA;AAAA,MAEJ;AAAA;AAAA,GACF;AAEJ","file":"chunk-HJZNKZHZ.js","sourcesContent":["import type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage, Textarea } from '../../ui';\n\ntype DescriptionFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n};\n\nexport function DescriptionField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n className,\n disabled,\n}: DescriptionFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem className={className}>\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <Textarea placeholder={placeholder} disabled={disabled} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage, Input } from '../../ui';\n\ntype EmailFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n description?: string;\n autoComplete?: 'email' | 'username';\n className?: string;\n};\n\nexport function EmailField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n description,\n autoComplete = 'email',\n className,\n}: EmailFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem className={className}>\n <FormLabel>{label}</FormLabel>\n {description && <p className=\"text-sm text-muted-foreground mt-0.5\">{description}</p>}\n <FormControl>\n <Input type=\"email\" placeholder={placeholder} autoComplete={autoComplete} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormField, FormItem, FormLabel, FormMessage, Select } from '../../ui';\n\ntype ExpiresAtOption = {\n value: string;\n label: string;\n};\n\ntype ExpiresAtFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n ariaLabel?: string;\n options: ExpiresAtOption[];\n};\n\nexport function ExpiresAtField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n ariaLabel,\n options,\n}: ExpiresAtFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem>\n <FormLabel>{label}</FormLabel>\n <Select\n value={(field.value as string) ?? ''}\n onValueChange={(next) => {\n field.onChange(next);\n }}\n options={options}\n placeholder={placeholder}\n aria-label={ariaLabel ?? label}\n />\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage, Input } from '../../ui';\n\ntype FirstNameFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n className?: string;\n};\n\nexport function FirstNameField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n className,\n}: FirstNameFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem className={className}>\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <Input placeholder={placeholder} autoComplete=\"given-name\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage, Input } from '../../ui';\n\ntype LastNameFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n className?: string;\n};\n\nexport function LastNameField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n className,\n}: LastNameFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem className={className}>\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <Input placeholder={placeholder} autoComplete=\"family-name\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage, Input } from '../../ui';\n\ntype NameFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n};\n\nexport function NameField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n className,\n disabled,\n}: NameFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem className={className}>\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <Input placeholder={placeholder} disabled={disabled} autoComplete=\"off\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import type { ReactNode } from 'react';\nimport type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage, Input } from '../../ui';\n\ntype PasswordFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n autoComplete?: 'current-password' | 'new-password';\n /** Optional node to show on the right of the label (e.g. \"Forgot password?\" link) */\n rightLabel?: ReactNode;\n className?: string;\n};\n\nexport function PasswordField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n autoComplete = 'current-password',\n rightLabel,\n className,\n}: PasswordFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem className={className}>\n <div className=\"flex items-center justify-between\">\n <FormLabel>{label}</FormLabel>\n {rightLabel}\n </div>\n <FormControl>\n <Input\n type=\"password\"\n placeholder={placeholder}\n autoComplete={autoComplete}\n {...field}\n />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import { Info } from 'lucide-react';\nimport type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport type { PermissionGroup, PermissionOption } from '../../../types';\nimport { Checkbox, FormField, FormItem, FormLabel, FormMessage, Tooltip } from '../../ui';\n\nexport type {\n PermissionAction,\n PermissionGroup,\n PermissionOption,\n} from '../../../types';\n\ntype PermissionsFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n groups: PermissionGroup[];\n t: (key: string) => string;\n disabled?: boolean;\n};\n\nexport function PermissionsField<T extends FieldValues>({\n control,\n name,\n label,\n groups,\n t,\n disabled = false,\n}: PermissionsFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => {\n const selected = (field.value as string[]) ?? [];\n\n const togglePermission = (key: string, group: PermissionOption[]) => {\n const readKey = getReadKeyForGroup(group);\n const opt = group.find((p) => p.key === key);\n if (!opt) return;\n\n const next = selected.includes(key)\n ? selected.filter((k) => k !== key)\n : [...selected, key];\n\n if (opt.action === 'write' || opt.action === 'delete') {\n if (next.includes(key) && readKey && !next.includes(readKey)) {\n next.push(readKey);\n }\n }\n if (opt.action === 'delete') {\n const writeKey = getWriteKeyForGroup(group);\n if (next.includes(key) && writeKey && !next.includes(writeKey)) {\n next.push(writeKey);\n }\n }\n\n field.onChange(next);\n };\n\n return (\n <FormItem>\n <FormLabel>{label}</FormLabel>\n <div className=\"space-y-4\">\n {groups.map((group) => {\n const readKey = getReadKeyForGroup(group.permissions);\n const writeKey = getWriteKeyForGroup(group.permissions);\n const readDisabled = readKey\n ? hasWriteOrDelete(group.permissions, selected)\n : false;\n const writeDisabled = writeKey ? hasDelete(group.permissions, selected) : false;\n const readChecked =\n readKey !== null && (selected.includes(readKey) || readDisabled);\n const writeChecked =\n writeKey !== null && (selected.includes(writeKey) || writeDisabled);\n\n return (\n <div key={group.contextKey} className=\"space-y-2\">\n <div className=\"flex items-center gap-1.5\">\n <p className=\"text-sm font-medium\">{t(group.labelKey)}</p>\n <Tooltip content={t(group.descriptionKey)} side=\"top\" align=\"start\">\n <button\n type=\"button\"\n className=\"text-muted-foreground hover:text-foreground cursor-help inline-flex rounded p-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n aria-label={t(group.descriptionKey)}\n >\n <Info className=\"size-3.5\" aria-hidden />\n </button>\n </Tooltip>\n </div>\n <div className=\"flex flex-wrap gap-4 pl-2\">\n {group.permissions.map((perm) => {\n const isRead = perm.action === 'read';\n const isWrite = perm.action === 'write';\n const checked = isRead\n ? readChecked\n : isWrite\n ? writeChecked\n : selected.includes(perm.key);\n const permissionDisabled =\n (isRead && readDisabled) || (isWrite && writeDisabled);\n const globallyDisabled = disabled || permissionDisabled;\n\n return (\n <div key={perm.key} className=\"flex items-center space-x-2\">\n <Checkbox\n id={perm.key}\n checked={isRead ? readChecked : checked}\n disabled={globallyDisabled}\n onCheckedChange={() =>\n !globallyDisabled && togglePermission(perm.key, group.permissions)\n }\n />\n <label\n htmlFor={perm.key}\n className=\"text-sm font-normal leading-none cursor-pointer peer-disabled:opacity-70\"\n >\n {t(perm.labelKey)}\n </label>\n </div>\n );\n })}\n </div>\n </div>\n );\n })}\n </div>\n <FormMessage />\n </FormItem>\n );\n }}\n />\n );\n}\n\nfunction getReadKeyForGroup(permissions: PermissionOption[]): string | null {\n const readOpt = permissions.find((p) => p.action === 'read');\n return readOpt?.key ?? null;\n}\n\nfunction getWriteKeyForGroup(permissions: PermissionOption[]): string | null {\n const writeOpt = permissions.find((p) => p.action === 'write');\n return writeOpt?.key ?? null;\n}\n\nfunction hasWriteOrDelete(permissions: PermissionOption[], selected: string[]): boolean {\n return permissions.some(\n (p) => (p.action === 'write' || p.action === 'delete') && selected.includes(p.key),\n );\n}\n\nfunction hasDelete(permissions: PermissionOption[], selected: string[]): boolean {\n return permissions.some((p) => p.action === 'delete' && selected.includes(p.key));\n}\n","import { ChevronDown } from 'lucide-react';\nimport type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { cn } from '../../../lib/utils';\nimport type { RoleOption } from '../../../types';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '../../ui';\n\nexport type { RoleOption } from '../../../types';\n\ntype RoleSelectFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n options: RoleOption[];\n className?: string;\n};\n\nexport function RoleSelectField<T extends FieldValues>({\n control,\n name,\n label,\n options,\n className,\n}: RoleSelectFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => {\n const selectedOption = options.find((opt) => opt.value === field.value);\n const displayValue = selectedOption?.label ?? label;\n\n return (\n <FormItem className={className}>\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n role=\"combobox\"\n aria-label={label}\n onBlur={field.onBlur}\n className={cn(\n 'flex h-9 w-full cursor-pointer items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-colors',\n 'hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'aria-invalid:ring-destructive/20 aria-invalid:border-destructive',\n !field.value && 'text-muted-foreground',\n )}\n >\n <span className=\"min-w-0 truncate text-left\">{displayValue}</span>\n <ChevronDown className=\"ml-2 h-4 w-4 shrink-0 text-muted-foreground\" />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align=\"start\"\n sideOffset={0}\n className={cn('min-w-(--radix-dropdown-menu-trigger-width) z-101')}\n >\n {options.map((opt) => (\n <DropdownMenuItem key={opt.value} onClick={() => field.onChange(opt.value)}>\n {opt.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n </FormControl>\n <FormMessage />\n </FormItem>\n );\n }}\n />\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/components/forms/description-field/index.tsx","../src/components/forms/email-field/index.tsx","../src/components/forms/expires-at-field/index.tsx","../src/components/forms/first-name-field/index.tsx","../src/components/forms/last-name-field/index.tsx","../src/components/forms/name-field/index.tsx","../src/components/forms/password-field/index.tsx","../src/components/forms/permissions-field/index.tsx","../src/components/forms/role-select-field/index.tsx"],"names":["jsx","jsxs"],"mappings":";;;;;;AAYO,SAAS,gBAAA,CAAwC;AAAA,EACtD,OAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA,EAA6B;AAC3B,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,IAAA;AAAA,MACA,QAAQ,CAAC,EAAE,OAAM,qBACf,IAAA,CAAC,YAAS,SAAA,EACR,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,aAAW,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,wBAClB,GAAA,CAAC,eACC,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,aAA0B,QAAA,EAAqB,GAAG,OAAO,CAAA,EACrE,CAAA;AAAA,4BACC,WAAA,EAAA,EAAY;AAAA,OAAA,EACf;AAAA;AAAA,GAEJ;AAEJ;ACtBO,SAAS,UAAA,CAAkC;AAAA,EAChD,OAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA,GAAe,OAAA;AAAA,EACf;AACF,CAAA,EAAuB;AACrB,EAAA,uBACEA,GAAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,IAAA;AAAA,MACA,MAAA,EAAQ,CAAC,EAAE,KAAA,uBACTC,IAAAA,CAAC,YAAS,SAAA,E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ACA,kDAAA;AAAA,kBACA,kEAAA;AAAA,kBACA,CAAC,MAAM,KAAA,IAAS;AAAA,iBAClB;AAAA,gBAEA,QAAA,EAAA;AAAA,kCAAAD,GAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,4BAAA,EAA8B,QAAA,EAAA,YAAA,EAAa,CAAA;AAAA,kCAC3DA,GAAAA,CAAC,WAAA,EAAA,EAAY,SAAA,EAAU,6CAAA,EAA8C;AAAA;AAAA;AAAA,aACvE,EACF,CAAA;AAAA,4BACAA,GAAAA;AAAA,cAAC,mBAAA;AAAA,cAAA;AAAA,gBACC,KAAA,EAAM,OAAA;AAAA,gBACN,UAAA,EAAY,CAAA;AAAA,gBACZ,SAAA,EAAW,GAAG,mDAAmD,CAAA;AAAA,gBAEhE,kBAAQ,GAAA,CAAI,CAAC,wBACZA,GAAAA,CAAC,oBAAiC,OAAA,EAAS,MAAM,KAAA,CAAM,QAAA,CAAS,IAAI,KAAK,CAAA,EACtE,cAAI,KAAA,EAAA,EADgB,GAAA,CAAI,KAE3B,CACD;AAAA;AAAA;AACH,WAAA,EACF,CAAA,EACF,CAAA;AAAA,0BACAA,IAAC,WAAA,EAAA,EAAY;AAAA,SAAA,EACf,CAAA;AAAA,MAEJ;AAAA;AAAA,GACF;AAEJ","file":"chunk-L4KNKLFW.js","sourcesContent":["import type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage, Textarea } from '../../ui';\n\ntype DescriptionFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n};\n\nexport function DescriptionField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n className,\n disabled,\n}: DescriptionFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem className={className}>\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <Textarea placeholder={placeholder} disabled={disabled} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage, Input } from '../../ui';\n\ntype EmailFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n description?: string;\n autoComplete?: 'email' | 'username';\n className?: string;\n};\n\nexport function EmailField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n description,\n autoComplete = 'email',\n className,\n}: EmailFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem className={className}>\n <FormLabel>{label}</FormLabel>\n {description && <p className=\"text-sm text-muted-foreground mt-0.5\">{description}</p>}\n <FormControl>\n <Input type=\"email\" placeholder={placeholder} autoComplete={autoComplete} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormField, FormItem, FormLabel, FormMessage, Select } from '../../ui';\n\ntype ExpiresAtOption = {\n value: string;\n label: string;\n};\n\ntype ExpiresAtFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n ariaLabel?: string;\n options: ExpiresAtOption[];\n};\n\nexport function ExpiresAtField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n ariaLabel,\n options,\n}: ExpiresAtFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem>\n <FormLabel>{label}</FormLabel>\n <Select\n value={(field.value as string) ?? ''}\n onValueChange={(next) => {\n field.onChange(next);\n }}\n options={options}\n placeholder={placeholder}\n aria-label={ariaLabel ?? label}\n />\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage, Input } from '../../ui';\n\ntype FirstNameFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n className?: string;\n};\n\nexport function FirstNameField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n className,\n}: FirstNameFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem className={className}>\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <Input placeholder={placeholder} autoComplete=\"given-name\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage, Input } from '../../ui';\n\ntype LastNameFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n className?: string;\n};\n\nexport function LastNameField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n className,\n}: LastNameFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem className={className}>\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <Input placeholder={placeholder} autoComplete=\"family-name\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage, Input } from '../../ui';\n\ntype NameFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n};\n\nexport function NameField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n className,\n disabled,\n}: NameFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem className={className}>\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <Input placeholder={placeholder} disabled={disabled} autoComplete=\"off\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import type { ReactNode } from 'react';\nimport type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage, Input } from '../../ui';\n\ntype PasswordFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n placeholder?: string;\n autoComplete?: 'current-password' | 'new-password';\n /** Optional node to show on the right of the label (e.g. \"Forgot password?\" link) */\n rightLabel?: ReactNode;\n className?: string;\n};\n\nexport function PasswordField<T extends FieldValues>({\n control,\n name,\n label,\n placeholder,\n autoComplete = 'current-password',\n rightLabel,\n className,\n}: PasswordFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\n <FormItem className={className}>\n <div className=\"flex items-center justify-between\">\n <FormLabel>{label}</FormLabel>\n {rightLabel}\n </div>\n <FormControl>\n <Input\n type=\"password\"\n placeholder={placeholder}\n autoComplete={autoComplete}\n {...field}\n />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n","import { Info } from 'lucide-react';\nimport type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport type { PermissionGroup, PermissionOption } from '../../../types';\nimport { Checkbox, FormField, FormItem, FormLabel, FormMessage, Tooltip } from '../../ui';\n\nexport type {\n PermissionAction,\n PermissionGroup,\n PermissionOption,\n} from '../../../types';\n\ntype PermissionsFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n groups: PermissionGroup[];\n t: (key: string) => string;\n disabled?: boolean;\n};\n\nexport function PermissionsField<T extends FieldValues>({\n control,\n name,\n label,\n groups,\n t,\n disabled = false,\n}: PermissionsFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => {\n const selected = (field.value as string[]) ?? [];\n\n const togglePermission = (key: string, group: PermissionOption[]) => {\n const readKey = getReadKeyForGroup(group);\n const opt = group.find((p) => p.key === key);\n if (!opt) return;\n\n const next = selected.includes(key)\n ? selected.filter((k) => k !== key)\n : [...selected, key];\n\n if (opt.action === 'write' || opt.action === 'delete') {\n if (next.includes(key) && readKey && !next.includes(readKey)) {\n next.push(readKey);\n }\n }\n if (opt.action === 'delete') {\n const writeKey = getWriteKeyForGroup(group);\n if (next.includes(key) && writeKey && !next.includes(writeKey)) {\n next.push(writeKey);\n }\n }\n\n field.onChange(next);\n };\n\n return (\n <FormItem>\n <FormLabel>{label}</FormLabel>\n <div className=\"space-y-4\">\n {groups.map((group) => {\n const readKey = getReadKeyForGroup(group.permissions);\n const writeKey = getWriteKeyForGroup(group.permissions);\n const readDisabled = readKey\n ? hasWriteOrDelete(group.permissions, selected)\n : false;\n const writeDisabled = writeKey ? hasDelete(group.permissions, selected) : false;\n const readChecked =\n readKey !== null && (selected.includes(readKey) || readDisabled);\n const writeChecked =\n writeKey !== null && (selected.includes(writeKey) || writeDisabled);\n\n return (\n <div key={group.contextKey} className=\"space-y-2\">\n <div className=\"flex items-center gap-1.5\">\n <p className=\"text-sm font-medium\">{t(group.labelKey)}</p>\n <Tooltip content={t(group.descriptionKey)} side=\"top\" align=\"start\">\n <button\n type=\"button\"\n className=\"text-muted-foreground hover:text-foreground cursor-help inline-flex rounded p-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n aria-label={t(group.descriptionKey)}\n >\n <Info className=\"size-3.5\" aria-hidden />\n </button>\n </Tooltip>\n </div>\n <div className=\"flex flex-wrap gap-4 pl-2\">\n {group.permissions.map((perm) => {\n const isRead = perm.action === 'read';\n const isWrite = perm.action === 'write';\n const checked = isRead\n ? readChecked\n : isWrite\n ? writeChecked\n : selected.includes(perm.key);\n const permissionDisabled =\n (isRead && readDisabled) || (isWrite && writeDisabled);\n const globallyDisabled = disabled || permissionDisabled;\n\n return (\n <div key={perm.key} className=\"flex items-center space-x-2\">\n <Checkbox\n id={perm.key}\n checked={isRead ? readChecked : checked}\n disabled={globallyDisabled}\n onCheckedChange={() =>\n !globallyDisabled && togglePermission(perm.key, group.permissions)\n }\n />\n <label\n htmlFor={perm.key}\n className=\"text-sm font-normal leading-none cursor-pointer peer-disabled:opacity-70\"\n >\n {t(perm.labelKey)}\n </label>\n </div>\n );\n })}\n </div>\n </div>\n );\n })}\n </div>\n <FormMessage />\n </FormItem>\n );\n }}\n />\n );\n}\n\nfunction getReadKeyForGroup(permissions: PermissionOption[]): string | null {\n const readOpt = permissions.find((p) => p.action === 'read');\n return readOpt?.key ?? null;\n}\n\nfunction getWriteKeyForGroup(permissions: PermissionOption[]): string | null {\n const writeOpt = permissions.find((p) => p.action === 'write');\n return writeOpt?.key ?? null;\n}\n\nfunction hasWriteOrDelete(permissions: PermissionOption[], selected: string[]): boolean {\n return permissions.some(\n (p) => (p.action === 'write' || p.action === 'delete') && selected.includes(p.key),\n );\n}\n\nfunction hasDelete(permissions: PermissionOption[], selected: string[]): boolean {\n return permissions.some((p) => p.action === 'delete' && selected.includes(p.key));\n}\n","import { ChevronDown } from 'lucide-react';\nimport type { Control, FieldPath, FieldValues } from 'react-hook-form';\nimport { cn } from '../../../lib/utils';\nimport type { RoleOption } from '../../../types';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '../../ui';\n\nexport type { RoleOption } from '../../../types';\n\ntype RoleSelectFieldProps<T extends FieldValues> = {\n control: Control<T>;\n name: FieldPath<T>;\n label: string;\n options: RoleOption[];\n className?: string;\n};\n\nexport function RoleSelectField<T extends FieldValues>({\n control,\n name,\n label,\n options,\n className,\n}: RoleSelectFieldProps<T>) {\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => {\n const selectedOption = options.find((opt) => opt.value === field.value);\n const displayValue = selectedOption?.label ?? label;\n\n return (\n <FormItem className={className}>\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n role=\"combobox\"\n aria-label={label}\n onBlur={field.onBlur}\n className={cn(\n 'flex h-9 w-full cursor-pointer items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-colors',\n 'hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'aria-invalid:ring-destructive/20 aria-invalid:border-destructive',\n !field.value && 'text-muted-foreground',\n )}\n >\n <span className=\"min-w-0 truncate text-left\">{displayValue}</span>\n <ChevronDown className=\"ml-2 h-4 w-4 shrink-0 text-muted-foreground\" />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align=\"start\"\n sideOffset={0}\n className={cn('min-w-(--radix-dropdown-menu-trigger-width) z-101')}\n >\n {options.map((opt) => (\n <DropdownMenuItem key={opt.value} onClick={() => field.onChange(opt.value)}>\n {opt.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n </FormControl>\n <FormMessage />\n </FormItem>\n );\n }}\n />\n );\n}\n"]}
@@ -154,7 +154,18 @@ async function executeConfiguredRefresh(config) {
154
154
  throw { error: new Error("refresh cooling down"), status: 429 };
155
155
  }
156
156
  refresh.onStart?.();
157
- refreshInFlight = performAccessTokenRefresh({
157
+ const refreshAttempt = refresh.executor ? Promise.resolve().then(() => refresh.executor()).then(({ accessToken, expiresAt }) => {
158
+ if (!accessToken || !expiresAt || !Number.isFinite(Date.parse(expiresAt)) || Date.parse(expiresAt) <= Date.now()) {
159
+ throw { error: new Error("invalid native refresh response"), status: 0 };
160
+ }
161
+ refresh.setAccessToken(accessToken);
162
+ return accessToken;
163
+ }).catch((err) => {
164
+ if (typeof err?.status === "number" && isFatalRefreshFailureStatus(err.status) && shouldClearSessionOnRefreshFailure()) {
165
+ refresh.onFailure();
166
+ }
167
+ throw err;
168
+ }) : performAccessTokenRefresh({
158
169
  baseURL: config.baseURL,
159
170
  getRefreshToken: config.getRefreshToken,
160
171
  request: refresh.request,
@@ -162,7 +173,8 @@ async function executeConfiguredRefresh(config) {
162
173
  setAccessToken: refresh.setAccessToken,
163
174
  onFailure: refresh.onFailure,
164
175
  acceptLanguage: config.getAcceptLanguage?.()
165
- }).then((token) => {
176
+ });
177
+ refreshInFlight = refreshAttempt.then((token) => {
166
178
  refreshCooldownUntilMs = 0;
167
179
  return token;
168
180
  }).catch((err) => {
@@ -183,7 +195,7 @@ function shouldRetryWithRefresh(status, endpoint, isRetry, refreshToken, refresh
183
195
  if (status !== 401 || !refresh || !endpoint || isRetry) {
184
196
  return false;
185
197
  }
186
- const canRefresh = !!refreshToken || refresh.cookieCredentialsEnabled();
198
+ const canRefresh = !!refresh.executor || !!refreshToken || refresh.cookieCredentialsEnabled();
187
199
  if (!canRefresh) {
188
200
  return false;
189
201
  }
@@ -273,6 +285,7 @@ function createApiProvider(useOptions) {
273
285
  endpoint: options.refreshEndpoint,
274
286
  excludedRetryPrefixes: options.refreshExcludedPrefixes
275
287
  }),
288
+ executor: options.refreshExecutor,
276
289
  cookieCredentialsEnabled: options.cookieCredentialsEnabled,
277
290
  setAccessToken: options.setAccessToken,
278
291
  onFailure: options.onRefreshFailure,
@@ -345,5 +358,5 @@ function useAccessTokenKeepAlive(options) {
345
358
  }
346
359
 
347
360
  export { ApiClientProvider, DEFAULT_REFRESH_ENDPOINT, DEFAULT_REFRESH_EXCLUDED_PREFIXES, accessTokenNeedsRefresh, buildRequestUrl, createApiProvider, createDefaultRefreshRequest, createResponseHandler, executeConfiguredRefresh, getRequestHeaders, getRequestOptions, isFatalRefreshFailureStatus, msUntilAccessRefresh, performAccessTokenRefresh, shouldClearSessionOnRefreshFailure, useAPI, useAccessTokenKeepAlive, useApiClientConfig };
348
- //# sourceMappingURL=chunk-2HTQDFQJ.js.map
349
- //# sourceMappingURL=chunk-2HTQDFQJ.js.map
361
+ //# sourceMappingURL=chunk-V6EYEN2F.js.map
362
+ //# sourceMappingURL=chunk-V6EYEN2F.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/api/request.ts","../src/api/responseHandler.ts","../src/api/ApiClientContext.tsx","../src/api/createApiProvider.tsx","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EACF,CAAA,EAAG,CAAC,SAAA,EAAW,OAAA,EAAS,cAAc,CAAC,CAAA;AACzC","file":"chunk-V6EYEN2F.js","sourcesContent":["import type {\n ApiClientConfig,\n RefreshBodyContext,\n RefreshRequestConfig,\n RequestConfig,\n} from './types';\n\nexport const DEFAULT_REFRESH_ENDPOINT = 'auth/refresh';\nexport const DEFAULT_REFRESH_EXCLUDED_PREFIXES = ['auth/'];\n\nexport interface DefaultRefreshRequestOptions {\n endpoint?: string;\n excludedRetryPrefixes?: string[];\n}\n\nexport function createDefaultRefreshRequest({\n endpoint = DEFAULT_REFRESH_ENDPOINT,\n excludedRetryPrefixes = DEFAULT_REFRESH_EXCLUDED_PREFIXES,\n}: DefaultRefreshRequestOptions = {}): RefreshRequestConfig {\n return {\n endpoint,\n method: 'POST',\n buildBody: ({ refreshToken }: RefreshBodyContext) => (refreshToken ? { refreshToken } : {}),\n parseAccessToken: (data: unknown) => {\n if (data && typeof data === 'object' && 'accessToken' in data) {\n const token = (data as { accessToken: unknown }).accessToken;\n return typeof token === 'string' ? token : null;\n }\n return null;\n },\n excludedRetryPrefixes,\n };\n}\n\nexport function buildRequestUrl(baseURL: string, endpoint: string): string {\n const base = baseURL.replace(/\\/$/, '');\n const path = endpoint.replace(/^\\//, '');\n return `${base}/${path}`;\n}\n\nexport function getRequestHeaders(\n accessToken: string | null,\n options?: { multipart?: boolean; acceptLanguage?: string },\n): HeadersInit {\n const headers: HeadersInit = {};\n if (!options?.multipart) {\n headers['Content-Type'] = 'application/json';\n }\n if (accessToken) {\n headers.Authorization = `Bearer ${accessToken}`;\n }\n if (options?.acceptLanguage) {\n headers['Accept-Language'] = options.acceptLanguage;\n }\n return headers;\n}\n\nexport function getRequestOptions(\n config: RequestConfig,\n token: string | null,\n acceptLanguage?: string,\n): RequestInit {\n const init: RequestInit = {\n method: config.method,\n headers: getRequestHeaders(token, {\n multipart: config.multipart,\n acceptLanguage,\n }),\n body: config.multipart\n ? (config.body as BodyInit)\n : config.body != null\n ? JSON.stringify(config.body)\n : undefined,\n };\n if (config.credentials) {\n init.credentials = config.credentials;\n }\n return init;\n}\n\n/** Auth errors where the refresh cookie/token is actually unusable. */\nexport function isFatalRefreshFailureStatus(status: number): boolean {\n return status === 400 || status === 401 || status === 403 || status === 404;\n}\n\n/** Background/frozen tabs must not clear the session — cookies may be omitted from the fetch. */\nexport function shouldClearSessionOnRefreshFailure(): boolean {\n return typeof document === 'undefined' || document.visibilityState !== 'hidden';\n}\n\nfunction isTransientRefreshStatus(status: number): boolean {\n return status === 0 || status === 429 || status === 502 || status === 503 || status === 504;\n}\n\nconst REFRESH_TRANSIENT_ATTEMPTS = 3;\nconst REFRESH_TRANSIENT_DELAY_MS = 50;\n\nfunction wait(ms: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n\nexport async function performAccessTokenRefresh(params: {\n baseURL: string;\n getRefreshToken: () => string | null;\n request: RefreshRequestConfig;\n useCookieCredentials: boolean;\n setAccessToken: (token: string) => void;\n onFailure: () => void;\n acceptLanguage?: string;\n}): Promise<string> {\n const refreshToken = params.useCookieCredentials ? null : params.getRefreshToken();\n if (!params.useCookieCredentials && !refreshToken) {\n // Missing JS token is not proof the session is dead (hydration may still\n // install an HttpOnly marker). Do not log the user out.\n throw { error: new Error('missing refresh token'), status: 401 };\n }\n\n const bodyContext: RefreshBodyContext = {\n refreshToken,\n useCookieCredentials: params.useCookieCredentials,\n };\n\n const requestConfig: RequestConfig = {\n endpoint: params.request.endpoint,\n method: params.request.method,\n body: params.request.buildBody(bodyContext),\n credentials: params.useCookieCredentials ? 'include' : params.request.credentials,\n };\n\n let lastStatus = 0;\n for (let attempt = 1; attempt <= REFRESH_TRANSIENT_ATTEMPTS; attempt += 1) {\n let response: Response;\n try {\n response = await fetch(\n buildRequestUrl(params.baseURL, requestConfig.endpoint),\n getRequestOptions(requestConfig, null, params.acceptLanguage),\n );\n } catch {\n lastStatus = 0;\n if (attempt < REFRESH_TRANSIENT_ATTEMPTS) {\n await wait(REFRESH_TRANSIENT_DELAY_MS * attempt);\n continue;\n }\n throw { error: new Error('refresh network error'), status: 0 };\n }\n\n const responseText = await response.text();\n\n let data: unknown = null;\n if (responseText) {\n try {\n data = JSON.parse(responseText);\n } catch {\n lastStatus = 0;\n if (attempt < REFRESH_TRANSIENT_ATTEMPTS) {\n await wait(REFRESH_TRANSIENT_DELAY_MS * attempt);\n continue;\n }\n throw { error: new Error('invalid refresh response'), status: 0 };\n }\n }\n\n const accessToken = params.request.parseAccessToken(data);\n if (response.ok && accessToken) {\n params.setAccessToken(accessToken);\n return accessToken;\n }\n\n lastStatus = response.status || 0;\n if (isTransientRefreshStatus(lastStatus) && attempt < REFRESH_TRANSIENT_ATTEMPTS) {\n await wait(REFRESH_TRANSIENT_DELAY_MS * attempt);\n continue;\n }\n\n if (isFatalRefreshFailureStatus(lastStatus) && shouldClearSessionOnRefreshFailure()) {\n params.onFailure();\n }\n throw {\n error: new Error('failed to refresh access token'),\n status: lastStatus,\n };\n }\n\n throw { error: new Error('failed to refresh access token'), status: lastStatus };\n}\n\n/** One in-flight refresh per page — parallel 401 retries share the same promise. */\nlet refreshInFlight: Promise<string> | null = null;\n/** After 429/5xx, pause new refresh attempts so the SPA cannot hammer the API. */\nlet refreshCooldownUntilMs = 0;\nconst REFRESH_COOLDOWN_MS = 30_000;\n\nexport async function executeConfiguredRefresh(config: ApiClientConfig): Promise<string> {\n const refresh = config.refresh;\n if (!refresh) {\n throw new Error('refresh is not configured');\n }\n\n if (refreshInFlight) {\n return refreshInFlight;\n }\n\n const now = Date.now();\n if (refreshCooldownUntilMs > now) {\n throw { error: new Error('refresh cooling down'), status: 429 };\n }\n\n refresh.onStart?.();\n const refreshAttempt = refresh.executor\n ? Promise.resolve()\n .then(() => refresh.executor!())\n .then(({ accessToken, expiresAt }) => {\n if (\n !accessToken ||\n !expiresAt ||\n !Number.isFinite(Date.parse(expiresAt)) ||\n Date.parse(expiresAt) <= Date.now()\n ) {\n throw { error: new Error('invalid native refresh response'), status: 0 };\n }\n refresh.setAccessToken(accessToken);\n return accessToken;\n })\n .catch((err: { status?: number }) => {\n if (\n typeof err?.status === 'number' &&\n isFatalRefreshFailureStatus(err.status) &&\n shouldClearSessionOnRefreshFailure()\n ) {\n refresh.onFailure();\n }\n throw err;\n })\n : performAccessTokenRefresh({\n baseURL: config.baseURL,\n getRefreshToken: config.getRefreshToken,\n request: refresh.request,\n useCookieCredentials: refresh.cookieCredentialsEnabled(),\n setAccessToken: refresh.setAccessToken,\n onFailure: refresh.onFailure,\n acceptLanguage: config.getAcceptLanguage?.(),\n });\n refreshInFlight = refreshAttempt\n .then((token) => {\n refreshCooldownUntilMs = 0;\n return token;\n })\n .catch((err: { status?: number }) => {\n const status = typeof err?.status === 'number' ? err.status : 0;\n if (isTransientRefreshStatus(status)) {\n refreshCooldownUntilMs = Date.now() + REFRESH_COOLDOWN_MS;\n }\n throw err;\n })\n .finally(() => {\n refreshInFlight = null;\n refresh.onEnd?.();\n });\n\n return refreshInFlight;\n}\n","import { buildRequestUrl, executeConfiguredRefresh, getRequestOptions } from './request';\nimport type { ApiClientConfig, ApiErrorBody, RequestConfig, RequestError } from './types';\n\nfunction shouldRetryWithRefresh(\n status: number,\n endpoint: string | undefined,\n isRetry: boolean | undefined,\n refreshToken: string | null | undefined,\n refresh: ApiClientConfig['refresh'],\n): boolean {\n if (status !== 401 || !refresh || !endpoint || isRetry) {\n return false;\n }\n const canRefresh = !!refresh.executor || !!refreshToken || refresh.cookieCredentialsEnabled();\n if (!canRefresh) {\n return false;\n }\n const normalized = endpoint.replace(/^\\//, '');\n return !refresh.request.excludedRetryPrefixes.some((prefix) =>\n normalized.startsWith(prefix.replace(/^\\//, '')),\n );\n}\n\nexport function createResponseHandler(config: ApiClientConfig) {\n const { baseURL, getRefreshToken, refresh } = config;\n\n async function handleResponse(\n response: Response,\n options?: { config?: RequestConfig; isRetry?: boolean },\n ): Promise<unknown> {\n const responseText = await response.text();\n let data: unknown;\n if (responseText) {\n try {\n data = JSON.parse(responseText);\n } catch {\n data = responseText;\n }\n }\n\n if (!response.ok) {\n const refreshToken = getRefreshToken();\n if (\n shouldRetryWithRefresh(\n response.status,\n options?.config?.endpoint,\n options?.isRetry,\n refreshToken,\n refresh,\n ) &&\n options?.config\n ) {\n const newToken = await executeConfiguredRefresh(config);\n const retryResponse = await fetch(\n buildRequestUrl(baseURL, options.config.endpoint),\n getRequestOptions(options.config, newToken, config.getAcceptLanguage?.()),\n );\n return handleResponse(retryResponse, { ...options, isRetry: true });\n }\n\n throw {\n error: data as ApiErrorBody,\n status: response.status,\n retry: response.status >= 500,\n } satisfies RequestError;\n }\n\n return data;\n }\n\n return handleResponse;\n}\n","import { createContext, type ReactNode, useCallback, useContext, useMemo } from 'react';\nimport { buildRequestUrl, getRequestOptions } from './request';\nimport { createResponseHandler } from './responseHandler';\nimport type { ApiClientConfig, ApiClientProviderConfig, FetchFn, RequestConfig } from './types';\n\nconst ApiClientContext = createContext<ApiClientConfig | null>(null);\n\nexport function ApiClientProvider({\n baseURL,\n config,\n children,\n}: {\n baseURL: string;\n config: ApiClientProviderConfig;\n children: ReactNode;\n}) {\n const value = useMemo<ApiClientConfig>(() => ({ ...config, baseURL }), [baseURL, config]);\n\n return <ApiClientContext.Provider value={value}>{children}</ApiClientContext.Provider>;\n}\n\nexport function useApiClientConfig(): ApiClientConfig {\n const ctx = useContext(ApiClientContext);\n if (!ctx) {\n throw new Error('useApiClientConfig must be used within ApiClientProvider');\n }\n return ctx;\n}\n\nexport function useAPI(): FetchFn {\n const config = useApiClientConfig();\n const responseHandler = useMemo(() => createResponseHandler(config), [config]);\n\n return useCallback(\n (requestConfig: RequestConfig) => {\n const accessToken = config.getAccessToken();\n return fetch(\n buildRequestUrl(config.baseURL, requestConfig.endpoint),\n getRequestOptions(requestConfig, accessToken, config.getAcceptLanguage?.()),\n ).then((response) => responseHandler(response, { config: requestConfig }));\n },\n [config, responseHandler],\n );\n}\n","import { type ReactNode, useMemo } from 'react';\n\nimport { ApiClientProvider } from './ApiClientContext';\nimport { createDefaultRefreshRequest } from './request';\nimport type { ApiClientProviderConfig } from './types';\n\nexport interface CreateApiProviderOptions {\n baseURL: string;\n getAccessToken: () => string | null;\n getRefreshToken: () => string | null;\n /** When true, refresh uses HttpOnly cookie credentials instead of body token. */\n cookieCredentialsEnabled: () => boolean;\n setAccessToken: (token: string) => void;\n onRefreshFailure: () => void;\n getAcceptLanguage?: () => string;\n onRefreshStart?: () => void;\n onRefreshEnd?: () => void;\n /** Optional native refresh boundary; browser apps retain the default HTTP cookie flow. */\n refreshExecutor?: () => Promise<{ accessToken: string; expiresAt: string }>;\n /** Refresh endpoint path relative to baseURL. Defaults to `auth/refresh`. */\n refreshEndpoint?: string;\n /** Paths that must not trigger automatic refresh retry on 401. Defaults to `['auth/']`. */\n refreshExcludedPrefixes?: string[];\n}\n\n/**\n * Factory for app `ApiProvider` components. Pass a hook that returns wiring options\n * (cookies, i18n, zustand). Memoize that return value with `useMemo` so the API\n * client context is not rebuilt on every parent render.\n */\nexport function createApiProvider(useOptions: () => CreateApiProviderOptions) {\n return function ApiProvider({ children }: { children: ReactNode }) {\n const options = useOptions();\n\n const apiConfig = useMemo<ApiClientProviderConfig>(\n () => ({\n getAccessToken: options.getAccessToken,\n getRefreshToken: options.getRefreshToken,\n getAcceptLanguage: options.getAcceptLanguage,\n refresh: {\n request: createDefaultRefreshRequest({\n endpoint: options.refreshEndpoint,\n excludedRetryPrefixes: options.refreshExcludedPrefixes,\n }),\n executor: options.refreshExecutor,\n cookieCredentialsEnabled: options.cookieCredentialsEnabled,\n setAccessToken: options.setAccessToken,\n onFailure: options.onRefreshFailure,\n onStart: options.onRefreshStart,\n onEnd: options.onRefreshEnd,\n },\n }),\n [options],\n );\n\n return (\n <ApiClientProvider baseURL={options.baseURL} config={apiConfig}>\n {children}\n </ApiClientProvider>\n );\n };\n}\n","import { jwtDecode } from 'jwt-decode';\nimport { useEffect } from 'react';\nimport { useApiClientConfig } from './ApiClientContext';\nimport { executeConfiguredRefresh } from './request';\n\n/** Typical access JWT TTL is 15m — refresh ahead of expiry. */\nconst REFRESH_SKEW_MS = 2 * 60 * 1000;\n/** Cap so we re-check often enough if the JWT has no exp. */\nconst KEEP_ALIVE_MAX_DELAY_MS = 4 * 60 * 1000;\n\nexport function accessTokenNeedsRefresh(\n token: string | null,\n nowMs: number = Date.now(),\n skewMs: number = REFRESH_SKEW_MS,\n): boolean {\n return msUntilAccessRefresh(token, nowMs, skewMs) === 0;\n}\n\n/** Milliseconds until the access JWT should be refreshed (0 = now). */\nexport function msUntilAccessRefresh(\n token: string | null,\n nowMs: number = Date.now(),\n skewMs: number = REFRESH_SKEW_MS,\n): number {\n if (!token) return 0;\n try {\n const { exp } = jwtDecode<{ exp?: number }>(token);\n if (typeof exp !== 'number') return 0;\n return Math.max(0, exp * 1000 - skewMs - nowMs);\n } catch {\n return 0;\n }\n}\n\nexport type UseAccessTokenKeepAliveOptions = {\n /** When false, no timers or listeners are registered. */\n enabled: boolean;\n /** Same accessor the API client uses (cookie and/or in-memory). */\n getAccessToken: () => string | null;\n};\n\n/**\n * Keeps the access token fresh while a session exists.\n * - Timeout scheduled from JWT exp (capped at 4 minutes)\n * - Also refreshes on visibility / focus / pageshow after expiry\n */\nexport function useAccessTokenKeepAlive(options: UseAccessTokenKeepAliveOptions): void {\n const apiConfig = useApiClientConfig();\n const { enabled, getAccessToken } = options;\n\n useEffect(() => {\n if (!enabled || !apiConfig.refresh) {\n return;\n }\n\n const refreshIfNeeded = () => {\n if (!accessTokenNeedsRefresh(getAccessToken())) {\n return;\n }\n void executeConfiguredRefresh(apiConfig).catch(() => {\n // Hard auth failures clear via onRefreshFailure only while the tab is visible.\n });\n };\n\n let timeoutId = 0;\n const schedule = () => {\n window.clearTimeout(timeoutId);\n const until = msUntilAccessRefresh(getAccessToken());\n const delay =\n until === 0 ? KEEP_ALIVE_MAX_DELAY_MS : Math.min(until, KEEP_ALIVE_MAX_DELAY_MS);\n timeoutId = window.setTimeout(() => {\n refreshIfNeeded();\n schedule();\n }, delay);\n };\n\n const onVisibility = () => {\n if (document.visibilityState === 'visible') {\n refreshIfNeeded();\n schedule();\n }\n };\n\n refreshIfNeeded();\n schedule();\n document.addEventListener('visibilitychange', onVisibility);\n window.addEventListener('focus', refreshIfNeeded);\n window.addEventListener('pageshow', refreshIfNeeded);\n\n return () => {\n document.removeEventListener('visibilitychange', onVisibility);\n window.removeEventListener('focus', refreshIfNeeded);\n window.removeEventListener('pageshow', refreshIfNeeded);\n window.clearTimeout(timeoutId);\n };\n }, [apiConfig, enabled, getAccessToken]);\n}\n"]}
@@ -1,5 +1,5 @@
1
- export { DescriptionField, EmailField, ExpiresAtField, FirstNameField, LastNameField, NameField, PasswordField, PermissionsField, RoleSelectField } from '../../chunk-HJZNKZHZ.js';
2
- import '../../chunk-QHNZTXPJ.js';
1
+ export { DescriptionField, EmailField, ExpiresAtField, FirstNameField, LastNameField, NameField, PasswordField, PermissionsField, RoleSelectField } from '../../chunk-L4KNKLFW.js';
2
+ import '../../chunk-GDYI2I74.js';
3
3
  import '../../chunk-3AYG73DK.js';
4
4
  import '../../chunk-TSXUUD64.js';
5
5
  import '../../chunk-GXWVFQCK.js';
@@ -200,9 +200,14 @@ type LabeledSelectProps = {
200
200
  triggerClassName?: string;
201
201
  searchable?: boolean;
202
202
  translations?: SelectTranslations;
203
+ /**
204
+ * `stacked` (default) — label above the field (forms / filters).
205
+ * `inline` — label beside the field (dense toolbars only).
206
+ */
207
+ layout?: 'stacked' | 'inline';
203
208
  };
204
- /** Toolbar filter select with a visible label + shared Select dropdown. */
205
- declare function LabeledSelect({ label, value, onValueChange, options, placeholder, disabled, className, triggerClassName, searchable, translations, }: LabeledSelectProps): React$1.JSX.Element;
209
+ /** Labeled Select — labels sit above the control by default. */
210
+ declare function LabeledSelect({ label, value, onValueChange, options, placeholder, disabled, className, triggerClassName, searchable, translations, layout, }: LabeledSelectProps): React$1.JSX.Element;
206
211
 
207
212
  interface PageLoaderProps {
208
213
  className?: string;
@@ -1,5 +1,5 @@
1
- export { AdminDetailPage, AdminListPage, AuditLogListFilters, DateRangeFilter, DetailFieldList, EntityRow, LabeledSelect, PageLoader, QueryState, RouteSuspense, ThemeProvider, ThemeToggle, createBoundQueryState, useDefaultThemeStore, useThemeStoreContext } from '../../chunk-WZ64FPVI.js';
2
- import '../../chunk-QHNZTXPJ.js';
1
+ export { AdminDetailPage, AdminListPage, AuditLogListFilters, DateRangeFilter, DetailFieldList, EntityRow, LabeledSelect, PageLoader, QueryState, RouteSuspense, ThemeProvider, ThemeToggle, createBoundQueryState, useDefaultThemeStore, useThemeStoreContext } from '../../chunk-BL4GPQGY.js';
2
+ import '../../chunk-GDYI2I74.js';
3
3
  import '../../chunk-3AYG73DK.js';
4
4
  export { dateRangePickerTranslations } from '../../chunk-UCJ76BEC.js';
5
5
  import '../../chunk-TSXUUD64.js';
@@ -255,12 +255,21 @@ declare function FormMessage({ className, ...props }: React.ComponentProps<'p'>)
255
255
  interface FormDrawerProps {
256
256
  open: boolean;
257
257
  onOpenChange: (open: boolean) => void;
258
- title: string;
259
- description?: string;
258
+ title: React.ReactNode;
259
+ /**
260
+ * @deprecated Prefer `info` (tooltip). Do not use for obvious UI chrome
261
+ * (“search/sort/open…”) — only real documentation belongs in `info`.
262
+ */
263
+ description?: React.ReactNode;
264
+ /**
265
+ * Proper docs / instructions for the title. Opens on **click** only —
266
+ * hover tooltips race with drawer slide-under-cursor and cannot be made safe.
267
+ */
268
+ info?: React.ReactNode;
260
269
  children: React.ReactNode;
261
- /** Max width class - default sm:max-w-lg for form drawers */
270
+ /** Max width class - applied to SheetContent via contentClassName preferred */
262
271
  className?: string;
263
- /** Sheet content class for overflow/scrolling */
272
+ /** Sheet content class for overflow/scrolling / width */
264
273
  contentClassName?: string;
265
274
  }
266
275
  /**
@@ -268,7 +277,7 @@ interface FormDrawerProps {
268
277
  * The form content (including SheetFooter) is provided by children.
269
278
  * Mobile-friendly: full width on small screens, max-width on larger.
270
279
  */
271
- declare function FormDrawer({ open, onOpenChange, title, description, children, className, contentClassName, }: FormDrawerProps): React.JSX.Element;
280
+ declare function FormDrawer({ open, onOpenChange, title, description, info, children, className, contentClassName, }: FormDrawerProps): React.JSX.Element;
272
281
 
273
282
  /** Text field styled with theme tokens. See Storybook **UI/Input**. */
274
283
  declare function Input({ className, type, onFocus, ...props }: React.ComponentProps<'input'>): React.JSX.Element;
@@ -408,15 +417,20 @@ interface TooltipProps {
408
417
  delayDuration?: number;
409
418
  /**
410
419
  * Delay (in ms) before the tooltip closes after hover ends.
420
+ * Keep long enough to move the pointer onto the bubble.
411
421
  */
412
422
  closeDelay?: number;
413
423
  }
414
424
  /**
415
- * Tooltip that opens only on hover (not on focus), so it does not open when
416
- * the trigger receives focus from keyboard or from opening a dialog/sheet.
425
+ * Hover-driven tooltip. Never opens from focus. Never opens when UI mounts
426
+ * under an existing cursor — hover is armed only after the pointer leaves the
427
+ * trigger, or moves while clearly outside it (checked via elementFromPoint
428
+ * after the trigger is laid out).
429
+ *
430
+ * Touch / coarse pointers tap to toggle.
417
431
  *
418
- * Includes a small hover delay to avoid "tooltip spam" when simply moving
419
- * the mouse across the screen.
432
+ * For chrome that appears with drawers/dialogs (title info), prefer click
433
+ * (FormDrawer `info` uses a Popover) — hover races with slide-under-cursor.
420
434
  */
421
435
  declare function Tooltip({ content, children, side, align, delayDuration, closeDelay, }: TooltipProps): React.JSX.Element;
422
436
 
@@ -447,29 +461,44 @@ interface UploadDropzoneTranslations {
447
461
  chooseFileText?: string;
448
462
  removeText?: string;
449
463
  removeExistingImageText?: string;
464
+ /** Accessible label for removing one file in multi-file mode */
465
+ removeFileAriaLabel?: string;
450
466
  }
451
- interface UploadDropzoneBaseProps {
452
- value: File | null;
453
- onChange: (file: File | null) => void;
467
+ interface UploadDropzoneSharedProps {
454
468
  translations?: UploadDropzoneTranslations;
455
469
  /** Reject files larger than this size (bytes). Invokes `onFileTooLarge` when set. */
456
470
  maxSizeBytes?: number;
457
471
  onFileTooLarge?: () => void;
472
+ /** Rejected because the file does not match `accept`. */
473
+ onInvalidFile?: () => void;
458
474
  }
459
- interface UploadDropzoneImageProps extends UploadDropzoneBaseProps {
475
+ interface UploadDropzoneImageProps extends UploadDropzoneSharedProps {
460
476
  variant?: 'image';
477
+ value: File | null;
478
+ onChange: (file: File | null) => void;
461
479
  existingImageUrl?: string;
462
480
  removeExistingImage?: boolean;
463
481
  onRemoveExistingImageChange?: (value: boolean) => void;
464
482
  }
465
- interface UploadDropzoneFileProps extends UploadDropzoneBaseProps {
483
+ interface UploadDropzoneFileBaseProps extends UploadDropzoneSharedProps {
466
484
  variant: 'file';
467
- /** Passed to the native file input, e.g. `.pdf,.docx` */
485
+ /** Passed to the native file input, e.g. `.pdf,.docx` or `application/pdf` */
468
486
  accept?: string;
469
487
  disabled?: boolean;
470
488
  className?: string;
471
489
  }
472
- type UploadDropzoneProps = UploadDropzoneImageProps | UploadDropzoneFileProps;
490
+ interface UploadDropzoneFileProps extends UploadDropzoneFileBaseProps {
491
+ multiple?: false;
492
+ value: File | null;
493
+ onChange: (file: File | null) => void;
494
+ }
495
+ interface UploadDropzoneMultiFileProps extends UploadDropzoneFileBaseProps {
496
+ multiple: true;
497
+ value: File[];
498
+ onChange: (files: File[]) => void;
499
+ }
500
+ type UploadDropzoneProps = UploadDropzoneImageProps | UploadDropzoneFileProps | UploadDropzoneMultiFileProps;
501
+ declare function fileMatchesAccept(file: File, accept?: string): boolean;
473
502
  declare function UploadDropzone(props: UploadDropzoneProps): React.JSX.Element;
474
503
 
475
- export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Button, Calendar, type CalendarProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ConfirmDialog, type ConfirmDialogProps, DatePicker, type DatePickerProps, DateRangePicker, DateRangePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, DropdownScrollableList, type DropdownScrollableListProps, DropdownSelectSearchInput, type DropdownSelectSearchInputProps, EventCalendar, type EventCalendarEvent, type EventCalendarProps, type EventCalendarView, Form, FormControl, FormDescription, FormDrawer, type FormDrawerProps, FormField, FormItem, FormLabel, FormMessage, H3, Heading, Input, Label, Link, type LinkProps, MultiSelect, type MultiSelectOption, type MultiSelectTranslations, Paragraph, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SEARCHABLE_SELECT_MIN_OPTIONS, ScrollArea, ScrollBar, SearchField, type SearchFieldProps, type SelectSearchableOption, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, type TooltipProps, TooltipProvider, UploadDropzone, type UploadDropzoneFileProps, type UploadDropzoneImageProps, type UploadDropzoneProps, type UploadDropzoneTranslations, badgeVariants, buttonVariants, dropdownMenuSelectOptionsMaxHeightClassName, filterSelectOptions, foldSearchText, headingVariants, isSelectSearchable, linkStyles, paragraphVariants, useFormField };
504
+ export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Button, Calendar, type CalendarProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ConfirmDialog, type ConfirmDialogProps, DatePicker, type DatePickerProps, DateRangePicker, DateRangePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, DropdownScrollableList, type DropdownScrollableListProps, DropdownSelectSearchInput, type DropdownSelectSearchInputProps, EventCalendar, type EventCalendarEvent, type EventCalendarProps, type EventCalendarView, Form, FormControl, FormDescription, FormDrawer, type FormDrawerProps, FormField, FormItem, FormLabel, FormMessage, H3, Heading, Input, Label, Link, type LinkProps, MultiSelect, type MultiSelectOption, type MultiSelectTranslations, Paragraph, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SEARCHABLE_SELECT_MIN_OPTIONS, ScrollArea, ScrollBar, SearchField, type SearchFieldProps, type SelectSearchableOption, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, type TooltipProps, TooltipProvider, UploadDropzone, type UploadDropzoneFileProps, type UploadDropzoneImageProps, type UploadDropzoneMultiFileProps, type UploadDropzoneProps, type UploadDropzoneTranslations, badgeVariants, buttonVariants, dropdownMenuSelectOptionsMaxHeightClassName, fileMatchesAccept, filterSelectOptions, foldSearchText, headingVariants, isSelectSearchable, linkStyles, paragraphVariants, useFormField };
@@ -1,4 +1,4 @@
1
- export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Calendar, Checkbox, ConfirmDialog, DatePicker, DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, DropdownScrollableList, DropdownSelectSearchInput, EventCalendar, Form, FormControl, FormDescription, FormDrawer, FormField, FormItem, FormLabel, FormMessage, H3, Heading, Label, Link, MultiSelect, Paragraph, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SEARCHABLE_SELECT_MIN_OPTIONS, ScrollArea, ScrollBar, SearchField, Select, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipProvider, UploadDropzone, badgeVariants, dropdownMenuSelectOptionsMaxHeightClassName, filterSelectOptions, foldSearchText, headingVariants, isSelectSearchable, linkStyles, paragraphVariants, useFormField } from '../../chunk-QHNZTXPJ.js';
1
+ export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Calendar, Checkbox, ConfirmDialog, DatePicker, DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, DropdownScrollableList, DropdownSelectSearchInput, EventCalendar, Form, FormControl, FormDescription, FormDrawer, FormField, FormItem, FormLabel, FormMessage, H3, Heading, Label, Link, MultiSelect, Paragraph, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SEARCHABLE_SELECT_MIN_OPTIONS, ScrollArea, ScrollBar, SearchField, Select, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipProvider, UploadDropzone, badgeVariants, dropdownMenuSelectOptionsMaxHeightClassName, fileMatchesAccept, filterSelectOptions, foldSearchText, headingVariants, isSelectSearchable, linkStyles, paragraphVariants, useFormField } from '../../chunk-GDYI2I74.js';
2
2
  export { Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, buttonVariants } from '../../chunk-3AYG73DK.js';
3
3
  export { isRadixPortaledOverlay } from '../../chunk-TSXUUD64.js';
4
4
  import '../../chunk-GXWVFQCK.js';
@@ -1,4 +1,4 @@
1
- import { b as ApiErrorBody } from '../types-CN73TWSY.js';
1
+ import { b as ApiErrorBody } from '../types-BYLBukHJ.js';
2
2
 
3
3
  /** Maps a Postgres constraint name (snake_case) to a PascalCase i18n key under `errors`. */
4
4
  declare function constraintNameToErrorKey(constraintName: string): string;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  export { A as AdminDetailErrorKind } from './admin-BVYdWtEy.js';
2
2
  export { getAdminDetailErrorKind } from './admin/index.js';
3
3
  export { ApiClientProvider, CreateApiProviderOptions, DEFAULT_REFRESH_ENDPOINT, DEFAULT_REFRESH_EXCLUDED_PREFIXES, DefaultRefreshRequestOptions, UseAccessTokenKeepAliveOptions, accessTokenNeedsRefresh, buildRequestUrl, createApiProvider, createDefaultRefreshRequest, createResponseHandler, executeConfiguredRefresh, getRequestHeaders, getRequestOptions, isFatalRefreshFailureStatus, msUntilAccessRefresh, performAccessTokenRefresh, shouldClearSessionOnRefreshFailure, useAPI, useAccessTokenKeepAlive, useApiClientConfig } from './api/index.js';
4
- export { A as ApiClientConfig, a as ApiClientProviderConfig, b as ApiErrorBody, F as FetchFn, R as RefreshBodyContext, c as RefreshConfig, d as RefreshRequestConfig, e as RequestConfig, f as RequestError } from './types-CN73TWSY.js';
4
+ export { A as ApiClientConfig, a as ApiClientProviderConfig, b as ApiErrorBody, F as FetchFn, R as RefreshBodyContext, c as RefreshConfig, d as RefreshRequestConfig, e as RequestConfig, f as RequestError } from './types-BYLBukHJ.js';
5
5
  export { AccessInfo, CookieConsent, DecodedAccessToken, HTTP_ONLY_REFRESH_MARKER, JWTAccessTokenPermissionData, TokenCookieOptions, getAccessInfoFromToken, getAccessTokenFromCookies, getCookieConsentFromCookies, getInitials, getRefreshTokenFromCookies, isInvalidSessionStatus, removeAccessTokenCookie, removeCookieConsentCookie, removeRefreshTokenCookie, resolveApiRefreshToken, setAccessTokenCookie, setCookieConsentCookie, setRefreshTokenCookie, setTokens } from './auth/index.js';
6
6
  export { BentoCell, BentoFeatures, BentoFeaturesProps, BlogPostTeaser, BlogTeaser, BlogTeaserProps, ContactSection, ContactSectionProps, CtaBanner, CtaBannerProps, ErrorSpotlight, ErrorSpotlightProps, FaqItem, FaqSection, FaqSectionProps, FeatureMedia, FeatureMediaProps, Footer, FooterContact, FooterLink, FooterProps, Hero, HeroAction, HeroProps, HeroSplit, HeroSplitProps, LaunchProject, LogoCloud, LogoCloudItem, LogoCloudProps, Navigation, NavigationCTA, NavigationLanguageOption, NavigationLanguageSwitcher, NavigationLink, NavigationProps, Newsletter, NewsletterProps, PricingComparisonRow, PricingSection, PricingSectionProps, PricingTier, ProjectLaunches, ProjectLaunchesProps, PromoBanner, PromoBannerProps, Section, SectionProps, SectionVariant, ServiceCard, ServiceCardProps, StatItem, StatsStrip, StatsStripProps, TeamGrid, TeamGridProps, TeamMember, Testimonial, TestimonialProps, TrustBadgeItem, TrustBadges, TrustBadgesProps, VideoShowcase, VideoShowcaseProps } from './components/marketing/index.js';
7
7
  export { AdminDetailPage, AdminDetailPageProps, AdminListPage, AdminListPageColumn, AdminListPageProps, AdminListSelectionMode, AuditLogFilterOption, AuditLogListFilters, AuditLogListFiltersProps, BoundQueryStateProps, DateRangeFilter, DateRangeFilterProps, DetailField, DetailFieldList, DetailFieldListProps, DetailFieldVariant, EntityRow, EntityRowAction, EntityRowProps, LabeledSelect, LabeledSelectProps, PageLoader, PageLoaderProps, QueryState, QueryStateBindings, QueryStateProps, RouteSuspense, RouteSuspenseProps, ThemeProvider, ThemeProviderProps, ThemeStore, ThemeToggle, ThemeToggleProps, createBoundQueryState, useDefaultThemeStore, useThemeStoreContext } from './components/spa/index.js';
8
- export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Button, Calendar, CalendarProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ConfirmDialog, ConfirmDialogProps, DatePicker, DatePickerProps, DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, DropdownScrollableList, DropdownScrollableListProps, DropdownSelectSearchInput, DropdownSelectSearchInputProps, EventCalendar, EventCalendarEvent, EventCalendarProps, EventCalendarView, Form, FormControl, FormDescription, FormDrawer, FormDrawerProps, FormField, FormItem, FormLabel, FormMessage, H3, Heading, Input, Label, Link, LinkProps, MultiSelect, MultiSelectOption, MultiSelectTranslations, Paragraph, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SEARCHABLE_SELECT_MIN_OPTIONS, ScrollArea, ScrollBar, SearchField, SearchFieldProps, SelectSearchableOption, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipProps, TooltipProvider, UploadDropzone, UploadDropzoneFileProps, UploadDropzoneImageProps, UploadDropzoneProps, UploadDropzoneTranslations, badgeVariants, buttonVariants, dropdownMenuSelectOptionsMaxHeightClassName, filterSelectOptions, foldSearchText, headingVariants, isSelectSearchable, linkStyles, paragraphVariants, useFormField } from './components/ui/index.js';
8
+ export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Button, Calendar, CalendarProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ConfirmDialog, ConfirmDialogProps, DatePicker, DatePickerProps, DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, DropdownScrollableList, DropdownScrollableListProps, DropdownSelectSearchInput, DropdownSelectSearchInputProps, EventCalendar, EventCalendarEvent, EventCalendarProps, EventCalendarView, Form, FormControl, FormDescription, FormDrawer, FormDrawerProps, FormField, FormItem, FormLabel, FormMessage, H3, Heading, Input, Label, Link, LinkProps, MultiSelect, MultiSelectOption, MultiSelectTranslations, Paragraph, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SEARCHABLE_SELECT_MIN_OPTIONS, ScrollArea, ScrollBar, SearchField, SearchFieldProps, SelectSearchableOption, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipProps, TooltipProvider, UploadDropzone, UploadDropzoneFileProps, UploadDropzoneImageProps, UploadDropzoneMultiFileProps, UploadDropzoneProps, UploadDropzoneTranslations, badgeVariants, buttonVariants, dropdownMenuSelectOptionsMaxHeightClassName, fileMatchesAccept, filterSelectOptions, foldSearchText, headingVariants, isSelectSearchable, linkStyles, paragraphVariants, useFormField } from './components/ui/index.js';
9
9
  export { DateRange } from 'react-day-picker';
10
10
  export { D as DateRangePickerPreset, a as DateRangePickerProps, b as DateRangePickerTranslations, c as DefaultPresetId } from './types-BuNHOJ1h.js';
11
11
  export { S as Select, a as SelectOption, b as SelectTranslations } from './index-Ckfrh1rP.js';
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import './chunk-NL4NAHXG.js';
2
- export { DescriptionField, EmailField, ExpiresAtField, FirstNameField, LastNameField, NameField, PasswordField, PermissionsField, RoleSelectField } from './chunk-HJZNKZHZ.js';
2
+ export { DescriptionField, EmailField, ExpiresAtField, FirstNameField, LastNameField, NameField, PasswordField, PermissionsField, RoleSelectField } from './chunk-L4KNKLFW.js';
3
3
  export { BentoFeatures, BlogTeaser, ContactSection, CtaBanner, ErrorSpotlight, FaqSection, FeatureMedia, Footer, Hero, HeroSplit, LogoCloud, Navigation, Newsletter, PricingSection, ProjectLaunches, PromoBanner, Section, ServiceCard, StatsStrip, TeamGrid, Testimonial, TrustBadges, VideoShowcase } from './chunk-QFKVPVFC.js';
4
- export { AdminDetailPage, AdminListPage, AuditLogListFilters, DateRangeFilter, DetailFieldList, EntityRow, LabeledSelect, PageLoader, QueryState, RouteSuspense, ThemeProvider, ThemeToggle, createBoundQueryState, useDefaultThemeStore, useThemeStoreContext } from './chunk-WZ64FPVI.js';
5
- export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Calendar, Checkbox, ConfirmDialog, DatePicker, DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, DropdownScrollableList, DropdownSelectSearchInput, EventCalendar, Form, FormControl, FormDescription, FormDrawer, FormField, FormItem, FormLabel, FormMessage, H3, Heading, Label, Link, MultiSelect, Paragraph, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SEARCHABLE_SELECT_MIN_OPTIONS, ScrollArea, ScrollBar, SearchField, Select, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipProvider, UploadDropzone, badgeVariants, dropdownMenuSelectOptionsMaxHeightClassName, filterSelectOptions, foldSearchText, headingVariants, isSelectSearchable, linkStyles, paragraphVariants, useFormField } from './chunk-QHNZTXPJ.js';
4
+ export { AdminDetailPage, AdminListPage, AuditLogListFilters, DateRangeFilter, DetailFieldList, EntityRow, LabeledSelect, PageLoader, QueryState, RouteSuspense, ThemeProvider, ThemeToggle, createBoundQueryState, useDefaultThemeStore, useThemeStoreContext } from './chunk-BL4GPQGY.js';
5
+ export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Calendar, Checkbox, ConfirmDialog, DatePicker, DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, DropdownScrollableList, DropdownSelectSearchInput, EventCalendar, Form, FormControl, FormDescription, FormDrawer, FormField, FormItem, FormLabel, FormMessage, H3, Heading, Label, Link, MultiSelect, Paragraph, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SEARCHABLE_SELECT_MIN_OPTIONS, ScrollArea, ScrollBar, SearchField, Select, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipProvider, UploadDropzone, badgeVariants, dropdownMenuSelectOptionsMaxHeightClassName, fileMatchesAccept, filterSelectOptions, foldSearchText, headingVariants, isSelectSearchable, linkStyles, paragraphVariants, useFormField } from './chunk-GDYI2I74.js';
6
6
  export { Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, buttonVariants } from './chunk-3AYG73DK.js';
7
7
  export { getAdminDetailErrorKind } from './chunk-3ZLODBRJ.js';
8
- export { ApiClientProvider, DEFAULT_REFRESH_ENDPOINT, DEFAULT_REFRESH_EXCLUDED_PREFIXES, accessTokenNeedsRefresh, buildRequestUrl, createApiProvider, createDefaultRefreshRequest, createResponseHandler, executeConfiguredRefresh, getRequestHeaders, getRequestOptions, isFatalRefreshFailureStatus, msUntilAccessRefresh, performAccessTokenRefresh, shouldClearSessionOnRefreshFailure, useAPI, useAccessTokenKeepAlive, useApiClientConfig } from './chunk-2HTQDFQJ.js';
8
+ export { ApiClientProvider, DEFAULT_REFRESH_ENDPOINT, DEFAULT_REFRESH_EXCLUDED_PREFIXES, accessTokenNeedsRefresh, buildRequestUrl, createApiProvider, createDefaultRefreshRequest, createResponseHandler, executeConfiguredRefresh, getRequestHeaders, getRequestOptions, isFatalRefreshFailureStatus, msUntilAccessRefresh, performAccessTokenRefresh, shouldClearSessionOnRefreshFailure, useAPI, useAccessTokenKeepAlive, useApiClientConfig } from './chunk-V6EYEN2F.js';
9
9
  export { HTTP_ONLY_REFRESH_MARKER, getAccessInfoFromToken, getAccessTokenFromCookies, getCookieConsentFromCookies, getInitials, getRefreshTokenFromCookies, isInvalidSessionStatus, removeAccessTokenCookie, removeCookieConsentCookie, removeRefreshTokenCookie, resolveApiRefreshToken, setAccessTokenCookie, setCookieConsentCookie, setRefreshTokenCookie, setTokens } from './chunk-LJXHUEXF.js';
10
- export { createCookieNames } from './chunk-KG4JVAKS.js';
11
10
  export { constraintNameToErrorKey, errorCodeFromHttpStatus, formatApiError, getApiErrorFromRequestError, getConflictFieldFromError, getConflictFieldFromExtra, getConstraintNameFromError, getConstraintNameFromExtra, handleApiMutationError, isApiErrorBody, resolveApiError, useQueryApiErrorToast } from './chunk-KZH56VPP.js';
11
+ export { createCookieNames } from './chunk-KG4JVAKS.js';
12
12
  export { useAdminListPage, useTranslationNamespace } from './chunk-LP7Q75C6.js';
13
13
  import './chunk-WFTIYYII.js';
14
14
  export { dateRangePickerTranslations } from './chunk-UCJ76BEC.js';
@@ -33,6 +33,11 @@ interface RefreshRequestConfig {
33
33
  }
34
34
  interface RefreshConfig {
35
35
  request: RefreshRequestConfig;
36
+ /** Native hosts rotate their own vaulted refresh credential and return access only. */
37
+ executor?: () => Promise<{
38
+ accessToken: string;
39
+ expiresAt: string;
40
+ }>;
36
41
  cookieCredentialsEnabled: () => boolean;
37
42
  setAccessToken: (token: string) => void;
38
43
  onFailure: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yca-software/yca-react-core",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "description": "Shared React components and helpers for YCA apps.",
5
5
  "license": "MIT",
6
6
  "packageManager": "pnpm@11.12.0",