@vritti/quantum-ui 0.3.6 → 0.3.8
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/Avatar.js +5 -5
- package/dist/Checkbox2.js +2 -2
- package/dist/ConfirmHost.js +109 -0
- package/dist/ConfirmHost.js.map +1 -0
- package/dist/Dialog.js +82 -64
- package/dist/Dialog.js.map +1 -1
- package/dist/DropdownMenu.js +2 -2
- package/dist/DropdownMenu.js.map +1 -1
- package/dist/Form.js +50 -26
- package/dist/Form.js.map +1 -1
- package/dist/Progress.js +2 -2
- package/dist/RadioGroup.js +2 -2
- package/dist/Sidebar.js +1 -1
- package/dist/Switch.js +2 -2
- package/dist/TabsSkeleton.js +1 -1
- package/dist/Toggle.js +1 -1
- package/dist/ViewTabs.js +1 -2
- package/dist/ViewTabs.js.map +1 -1
- package/dist/assets/quantum-ui.css +43 -5
- package/dist/cells.js +96 -64
- package/dist/cells.js.map +1 -1
- package/dist/components/ConfirmHost.js +2 -0
- package/dist/components/ConfirmHost.js.map +1 -0
- package/dist/components/Dialog.js +1 -1
- package/dist/components/RichTextEditor.js +1 -1
- package/dist/context/index.js +0 -1
- package/dist/context/index.js.map +1 -1
- package/dist/dropdown-menu.js +4 -3
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/image-component.js +1 -1
- package/dist/index.js +3 -3
- package/dist/index12.js +3 -2
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +3 -2
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +7 -6
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +1 -1
- package/dist/index16.js +1 -1
- package/dist/index18.js +1 -1
- package/dist/index20.js +1 -1
- package/dist/index21.js +1 -1
- package/dist/index23.js +1 -1
- package/dist/index25.js +3 -2534
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +2526 -22
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +32 -4
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +4 -37
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +1101 -287
- package/dist/index29.js.map +1 -1
- package/dist/index30.js +36 -8
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +305 -25
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +8 -60
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +30 -11
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +59 -35
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +10 -36818
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +36 -79
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +36808 -184
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +84 -0
- package/dist/index38.js.map +1 -0
- package/dist/index39.js +199 -0
- package/dist/index39.js.map +1 -0
- package/dist/index4.js +1 -1
- package/dist/lib/components/ConfirmHost/ConfirmHost.d.ts +39 -0
- package/dist/lib/components/ConfirmHost/ConfirmHost.d.ts.map +1 -0
- package/dist/lib/components/ConfirmHost/index.d.ts +2 -0
- package/dist/lib/components/ConfirmHost/index.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableImportDialog.d.ts.map +1 -1
- package/dist/lib/components/DataTable/components/DataTableViewTabs.d.ts.map +1 -1
- package/dist/lib/components/DataTable/components/DataTableViewsMenu.d.ts.map +1 -1
- package/dist/lib/components/DataTable/components/RowActions.d.ts.map +1 -1
- package/dist/lib/components/Dialog/Dialog.d.ts +15 -17
- package/dist/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/lib/components/Dialog/index.d.ts +2 -2
- package/dist/lib/components/Dialog/index.d.ts.map +1 -1
- package/dist/lib/components/DropdownMenu/types.d.ts +2 -2
- package/dist/lib/components/DropdownMenu/types.d.ts.map +1 -1
- package/dist/lib/components/Form/Form.d.ts.map +1 -1
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/index.d.ts.map +1 -1
- package/dist/lib/context/index.d.ts +0 -1
- package/dist/lib/context/index.d.ts.map +1 -1
- package/dist/lib/hooks/useConfirm.d.ts +3 -3
- package/dist/lib/hooks/useConfirm.d.ts.map +1 -1
- package/dist/trash-2.js +17 -3
- package/dist/trash-2.js.map +1 -1
- package/dist/useConfirm.js +3 -7
- package/dist/useConfirm.js.map +1 -1
- package/dist/utils/motion.js +2 -2
- package/dist/value.js +1 -1
- package/package.json +5 -1
- package/dist/Combination.js +0 -1129
- package/dist/Combination.js.map +0 -1
- package/dist/ConfirmContext.js +0 -77
- package/dist/ConfirmContext.js.map +0 -1
- package/dist/lib/context/ConfirmContext.d.ts +0 -26
- package/dist/lib/context/ConfirmContext.d.ts.map +0 -1
- package/dist/plus.js +0 -18
- package/dist/plus.js.map +0 -1
package/dist/Form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../lib/utils/formHelpers.ts","../lib/components/Form/Form.tsx"],"sourcesContent":["import type { FieldPath, FieldValues, UseFormReturn } from 'react-hook-form';\n\n/**\n * Field mapping configuration for API error to form field mapping\n */\nexport interface FieldMapping {\n [apiField: string]: string; // Maps API field names to form field names\n}\n\n/**\n * Axios error structure (or similar HTTP client error structure)\n */\ninterface AxiosLikeError {\n response?: {\n data?: unknown;\n };\n}\n\n/**\n * RFC 9457 field error structure\n */\nexport interface FieldError {\n field: string;\n message: string;\n}\n\n/**\n * API error structure with field-specific errors\n * Supports RFC 9457 Problem Details format\n */\nexport interface ApiErrorResponse {\n type?: string; // RFC 9457: URI reference identifying the problem type\n title?: string; // RFC 9457: Short human-readable summary\n status?: number; // RFC 9457: HTTP status code\n label?: string; // Root error heading displayed to the user\n detail?: string; // RFC 9457: Human-readable explanation\n instance?: string; // RFC 9457: URI reference for the specific occurrence\n errors?: FieldError[];\n}\n\n/**\n * Options for mapping API errors to form\n */\nexport interface MapApiErrorsOptions {\n /**\n * Field name mapping from API to form fields\n */\n fieldMapping?: FieldMapping;\n\n /**\n * Whether to set root error for general messages\n */\n setRootError?: boolean;\n}\n\n/**\n * Maps an RFC 9457 Problem Details API error response to react-hook-form errors.\n *\n * Root errors (`label`/`title` + `detail`) and field errors (`errors[]`) are\n * handled independently -- a single response can populate both the root error\n * alert and inline field errors at the same time.\n *\n * @param error - The error object from API response\n * @param form - The react-hook-form instance\n * @param options - Mapping options\n *\n * @example\n * ```tsx\n * try {\n * await api.post('/login', data);\n * } catch (error) {\n * mapApiErrorsToForm(error.response?.data, form, {\n * fieldMapping: {\n * 'email_address': 'email',\n * 'password_hash': 'password'\n * }\n * });\n * }\n * ```\n */\nexport function mapApiErrorsToForm<TFieldValues extends FieldValues = FieldValues>(\n error: unknown,\n form: UseFormReturn<TFieldValues>,\n options: MapApiErrorsOptions = {},\n): void {\n const { fieldMapping = {}, setRootError = true } = options;\n\n if (!error || typeof error !== 'object') {\n if (setRootError) {\n form.setError('root', {\n type: 'Error',\n message: 'An error occurred',\n });\n }\n return;\n }\n\n // Extract error data from axios response structure\n const axiosError = error as AxiosLikeError;\n const errorData = axiosError.response?.data || error;\n const apiError = errorData as ApiErrorResponse;\n\n // Extract title/label for error heading (RFC 9457)\n const errorTitle = apiError.label || apiError.title || 'Error';\n const generalMessage = apiError.detail;\n\n // Map field-specific errors (field is always present in RFC 9457)\n let mappedFieldErrorsCount = 0;\n if (apiError.errors && Array.isArray(apiError.errors)) {\n for (const errorItem of apiError.errors) {\n const formField = fieldMapping[errorItem.field] || errorItem.field;\n\n form.setError(formField as FieldPath<TFieldValues>, {\n type: 'manual',\n message: errorItem.message,\n });\n mappedFieldErrorsCount += 1;\n }\n }\n\n // Root error is shown only when no field errors are present\n if (generalMessage && setRootError && mappedFieldErrorsCount === 0) {\n form.setError('root', {\n type: errorTitle,\n message: generalMessage,\n });\n }\n}\n","import type { UseMutationResult } from '@tanstack/react-query';\nimport type React from 'react';\nimport { Children, cloneElement, Fragment, isValidElement, useCallback } from 'react';\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n type UseFormReturn,\n} from 'react-hook-form';\nimport type { Country } from 'react-phone-number-input';\nimport { cn } from '../../../shadcn/utils';\nimport { axios } from '../../utils/axios';\nimport { type FieldMapping, mapApiErrorsToForm } from '../../utils/formHelpers';\nimport { Alert } from '../Alert';\nimport { Button } from '../Button';\nimport { Checkbox } from '../Checkbox';\nimport { CheckboxGroup } from '../CheckboxGroup';\nimport { DatePicker } from '../DatePicker';\nimport { DateTimePicker } from '../DateTimePicker';\nimport { PhoneField } from '../PhoneField';\nimport { RadioGroup } from '../RadioGroup';\nimport { Switch } from '../Switch';\nimport { UploadFile } from '../UploadFile';\n\n// Re-export Controller for explicit usage\nexport { Controller } from 'react-hook-form';\n\n/**\n * Recursively process children to wrap form fields with Controller\n * and inject loading state into submit buttons\n */\nfunction processChildren<\n TFieldValues extends FieldValues = FieldValues,\n _TContext = any,\n TTransformedValues extends FieldValues | undefined = TFieldValues,\n>(\n children: React.ReactNode,\n control: ControllerProps<TFieldValues, FieldPath<TFieldValues>, TTransformedValues>['control'],\n isSubmitting: boolean,\n setValue: UseFormReturn<TFieldValues, _TContext, TTransformedValues>['setValue'],\n onCancel?: () => void,\n reset?: UseFormReturn<TFieldValues, _TContext, TTransformedValues>['reset'],\n): React.ReactNode {\n return Children.map(children, (child) => {\n // Handle non-element children (strings, numbers, null, etc.)\n if (!isValidElement(child)) {\n return child;\n }\n\n const childProps = child.props as any;\n const isFragment = child.type === Fragment;\n\n // Handle form fields with name prop (but not Fragments)\n if (!isFragment && childProps.name && typeof childProps.name === 'string') {\n const name = childProps.name as FieldPath<TFieldValues>;\n\n return (\n <Controller\n key={name}\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n // Check if this is a Checkbox, Switch, RadioGroup, or CheckboxGroup component\n const isCheckbox = child.type === Checkbox;\n const isSwitch = child.type === Switch;\n const isRadioGroup = child.type === RadioGroup;\n const isCheckboxGroup = child.type === CheckboxGroup;\n const isPhone = child.type === PhoneField;\n const isDatePicker = child.type === DatePicker;\n const isDateTimePicker = child.type === DateTimePicker;\n\n const fieldProps =\n isCheckbox || isSwitch\n ? {\n checked: field.value,\n onCheckedChange: field.onChange,\n onBlur: field.onBlur,\n ref: field.ref,\n }\n : isRadioGroup || isCheckboxGroup\n ? {\n value: field.value,\n onValueChange: field.onChange,\n onBlur: field.onBlur,\n }\n : isDatePicker\n ? {\n value: field.value,\n onValueChange: field.onChange,\n onBlur: field.onBlur,\n ref: field.ref,\n }\n : isDateTimePicker\n ? {\n value: field.value,\n onValueChange: field.onChange,\n onBlur: field.onBlur,\n ref: field.ref,\n }\n : isPhone\n ? {\n ...field,\n onCountryChange: (country: Country | undefined) => {\n setValue(`${name}Country` as FieldPath<TFieldValues>, country as any);\n },\n }\n : field;\n\n const isUploadFile = child.type === UploadFile;\n\n return cloneElement(child, {\n ...childProps,\n ...fieldProps,\n error: fieldState.error?.message || (fieldState.error ? 'Invalid' : undefined),\n name: undefined, // Remove name to avoid passing it to the underlying input\n ...(isUploadFile ? { isLoading: isSubmitting } : {}),\n });\n }}\n />\n );\n }\n\n // Handle cancel buttons - wire up form.reset() + onCancel callback\n if (childProps['data-cancel'] && onCancel && reset) {\n return cloneElement(child, {\n ...childProps,\n onClick: () => {\n reset();\n onCancel();\n },\n });\n }\n\n // Handle submit buttons - inject loading state via isLoading prop\n if (childProps.type === 'submit') {\n const isButtonElement =\n child.type === Button || (typeof child.type === 'function' && (child.type as any).displayName === 'Button');\n\n if (isButtonElement) {\n return cloneElement(child, {\n ...childProps,\n isLoading: isSubmitting,\n });\n }\n }\n\n // Handle React Fragments - process their children directly\n if (isFragment) {\n return processChildren(childProps.children, control, isSubmitting, setValue, onCancel, reset);\n }\n\n // Recurse into children for container elements (divs, FieldGroups, etc.)\n if (childProps.children != null) {\n return cloneElement(child, {\n ...childProps,\n children: processChildren(childProps.children, control, isSubmitting, setValue, onCancel, reset),\n });\n }\n\n // Return unchanged if no name prop and no children\n return child;\n });\n}\n\nexport interface FormProps<\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues extends FieldValues | undefined = TFieldValues,\n TMutationData = unknown,\n TMutationError = Error,\n TMutationVariables = any,\n> extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {\n /**\n * The react-hook-form form instance\n */\n form: UseFormReturn<TFieldValues, TContext, TTransformedValues>;\n\n /**\n * Form submit handler - receives the transformed values if transformation is applied.\n * Optional when using `mutation` prop.\n */\n onSubmit?: Parameters<UseFormReturn<TFieldValues, TContext, TTransformedValues>['handleSubmit']>[0];\n\n /**\n * Children elements - automatically wrapped with Controller if they have a name prop\n */\n children: React.ReactNode;\n\n /**\n * Position of the root error display\n * @default 'bottom'\n */\n rootErrorPosition?: 'top' | 'bottom';\n\n /**\n * Additional classes for the root error display\n */\n rootErrorClassName?: string;\n\n /**\n * Action element rendered in the root error Alert (e.g. button or link)\n * Positioned in the top-right corner using AlertAction\n */\n rootErrorAction?: React.ReactNode;\n\n /**\n * Field mapping for automatic API error mapping\n * Maps API field names to form field names\n */\n fieldMapping?: FieldMapping;\n\n /**\n * TanStack Query mutation for automatic handling.\n * When provided, the form will use `mutateAsync` to submit data and handle errors automatically.\n * The mutation's own callbacks (onSuccess, onError, etc.) will fire automatically.\n * Form only adds `mapApiErrorsToForm` as an extra error handling layer.\n * Optional - you can use `onSubmit` instead for forms that don't use mutations.\n */\n mutation?: UseMutationResult<TMutationData, TMutationError, TMutationVariables, unknown>;\n\n /**\n * Transform form data to mutation variables before submission.\n * Only used when `mutation` prop is provided.\n */\n transformSubmit?: (\n data: TTransformedValues extends undefined ? TFieldValues : TTransformedValues,\n ) => TMutationVariables;\n\n /**\n * Automatically calls form.reset() after a successful mutation.\n * Set to false for \"edit\" forms where resetting clears pre-populated values.\n * @default true\n */\n resetOnSuccess?: boolean;\n\n /**\n * Called when a cancel button (marked with data-cancel) is clicked.\n * Form.reset() is called automatically before invoking this callback.\n */\n onCancel?: () => void;\n}\n\n/**\n * Smart Form component that automatically wraps children with Controller\n *\n * Usage with onSubmit:\n * ```tsx\n * <Form form={form} onSubmit={handleSubmit}>\n * <TextField name=\"email\" label=\"Email\" description=\"Your email address\" />\n * <PasswordField name=\"password\" label=\"Password\" />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n *\n * Usage with TanStack Query mutation:\n * ```tsx\n * const mutation = useMutation({\n * mutationFn: (data) => api.post('/login', data),\n * onSuccess: (data) => console.log('Success!', data),\n * onError: (error) => console.error('Error!', error),\n * });\n *\n * <Form\n * form={form}\n * mutation={mutation}\n * transformSubmit={(data) => ({ ...data, timestamp: Date.now() })}\n * >\n * <TextField name=\"email\" label=\"Email\" />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n */\nexport function Form<\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues extends FieldValues | undefined = TFieldValues,\n TMutationData = unknown,\n TMutationError = Error,\n TMutationVariables = any,\n>({\n form,\n onSubmit,\n children,\n rootErrorPosition = 'bottom',\n rootErrorClassName,\n rootErrorAction,\n fieldMapping,\n mutation,\n transformSubmit,\n resetOnSuccess,\n onCancel,\n className,\n ...props\n}: FormProps<TFieldValues, TContext, TTransformedValues, TMutationData, TMutationError, TMutationVariables>) {\n // Compute isSubmitting from both form state and mutation state\n const isSubmitting = form.formState.isSubmitting || (mutation?.isPending ?? false);\n\n // Wrap the submit handler with automatic error mapping (always enabled)\n // Form only adds mapApiErrorsToForm - the mutation's own callbacks fire automatically\n const wrappedOnSubmit = useCallback(\n async (data: TTransformedValues extends undefined ? TFieldValues : TTransformedValues) => {\n // Suppress error toasts during form submission — Form handles errors inline\n const interceptorId = axios.interceptors.request.use((config) => ({\n ...config,\n showErrorToast: false,\n }));\n\n try {\n if (mutation) {\n const variables = transformSubmit ? transformSubmit(data) : data;\n // mutateAsync will trigger the mutation's onSuccess/onError callbacks\n await mutation.mutateAsync(variables as TMutationVariables);\n } else if (onSubmit) {\n await onSubmit(data as any);\n }\n\n // Reset form after successful submission (default: true)\n if (resetOnSuccess !== false) form.reset();\n } catch (error) {\n // Form's only job: map API errors to form fields\n // mapApiErrorsToForm handles axios error structure extraction internally\n mapApiErrorsToForm(error, form as any, {\n fieldMapping,\n });\n // Log error for debugging\n console.error('[Form Submission Error]', error);\n // Error is swallowed, not re-thrown (mutation's onError already fired)\n } finally {\n axios.interceptors.request.eject(interceptorId);\n }\n },\n [onSubmit, mutation, transformSubmit, fieldMapping, form, resetOnSuccess],\n );\n\n const handleSubmit = form.handleSubmit(wrappedOnSubmit as any);\n\n // Process children recursively to automatically wrap with Controller\n const processedChildren = processChildren(children, form.control, isSubmitting, form.setValue, onCancel, form.reset);\n\n return (\n <FormProvider {...form}>\n <form onSubmit={handleSubmit} className={cn('space-y-4', className)} {...props}>\n {/* Top position error */}\n {rootErrorPosition === 'top' && form.formState.errors.root && (\n <Alert\n variant=\"destructive\"\n title={form.formState.errors.root.type || 'Error'}\n description={form.formState.errors.root.message}\n action={rootErrorAction}\n className={cn('mb-4', rootErrorClassName)}\n />\n )}\n\n {processedChildren}\n\n {/* Bottom position error */}\n {rootErrorPosition === 'bottom' && form.formState.errors.root && (\n <Alert\n variant=\"destructive\"\n title={form.formState.errors.root.type || 'Error'}\n description={form.formState.errors.root.message}\n action={rootErrorAction}\n className={cn('mt-4', rootErrorClassName)}\n />\n )}\n </form>\n </FormProvider>\n );\n}\n\nForm.displayName = 'Form';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgFO,SAAS,kBAAA,CACd,KAAA,EACA,IAAA,EACA,OAAA,GAA+B,EAAC,EAC1B;AACN,EAAA,MAAM,EAAE,YAAA,GAAe,EAAC,EAAG,YAAA,GAAe,MAAK,GAAI,OAAA;AAEnD,EAAA,IAAI,CAAC,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,EAAU;AACvC,IAAA,IAAI,YAAA,EAAc;AAChB,MAAA,IAAA,CAAK,SAAS,MAAA,EAAQ;AAAA,QACpB,IAAA,EAAM,OAAA;AAAA,QACN,OAAA,EAAS;AAAA,OACV,CAAA;AAAA,IACH;AACA,IAAA;AA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AAA,CAAO,KAAK,IAAA,IAAQ,OAAA;AAAA,QAC1C,WAAA,EAAa,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,IAAA,CAAK,OAAA;AAAA,QACxC,MAAA,EAAQ,eAAA;AAAA,QACR,SAAA,EAAW,EAAA,CAAG,MAAA,EAAQ,kBAAkB;AAAA;AAAA,KAC1C;AAAA,IAGD,iBAAA;AAAA,IAGA,iBAAA,KAAsB,QAAA,IAAY,IAAA,CAAK,SAAA,CAAU,OAAO,IAAA,oBACvD,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,aAAA;AAAA,QACR,KAAA,EAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,KAAK,IAAA,IAAQ,OAAA;AAAA,QAC1C,WAAA,EAAa,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,IAAA,CAAK,OAAA;AAAA,QACxC,MAAA,EAAQ,eAAA;AAAA,QACR,SAAA,EAAW,EAAA,CAAG,MAAA,EAAQ,kBAAkB;AAAA;AAAA;AAC1C,GAAA,EAEJ,CAAA,EACF,CAAA;AAEJ;AAEA,IAAA,CAAK,WAAA,GAAc,MAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../lib/utils/formHelpers.ts","../lib/components/Form/Form.tsx"],"sourcesContent":["import type { FieldPath, FieldValues, UseFormReturn } from 'react-hook-form';\n\n/**\n * Field mapping configuration for API error to form field mapping\n */\nexport interface FieldMapping {\n [apiField: string]: string; // Maps API field names to form field names\n}\n\n/**\n * Axios error structure (or similar HTTP client error structure)\n */\ninterface AxiosLikeError {\n response?: {\n data?: unknown;\n };\n}\n\n/**\n * RFC 9457 field error structure\n */\nexport interface FieldError {\n field: string;\n message: string;\n}\n\n/**\n * API error structure with field-specific errors\n * Supports RFC 9457 Problem Details format\n */\nexport interface ApiErrorResponse {\n type?: string; // RFC 9457: URI reference identifying the problem type\n title?: string; // RFC 9457: Short human-readable summary\n status?: number; // RFC 9457: HTTP status code\n label?: string; // Root error heading displayed to the user\n detail?: string; // RFC 9457: Human-readable explanation\n instance?: string; // RFC 9457: URI reference for the specific occurrence\n errors?: FieldError[];\n}\n\n/**\n * Options for mapping API errors to form\n */\nexport interface MapApiErrorsOptions {\n /**\n * Field name mapping from API to form fields\n */\n fieldMapping?: FieldMapping;\n\n /**\n * Whether to set root error for general messages\n */\n setRootError?: boolean;\n}\n\n/**\n * Maps an RFC 9457 Problem Details API error response to react-hook-form errors.\n *\n * Root errors (`label`/`title` + `detail`) and field errors (`errors[]`) are\n * handled independently -- a single response can populate both the root error\n * alert and inline field errors at the same time.\n *\n * @param error - The error object from API response\n * @param form - The react-hook-form instance\n * @param options - Mapping options\n *\n * @example\n * ```tsx\n * try {\n * await api.post('/login', data);\n * } catch (error) {\n * mapApiErrorsToForm(error.response?.data, form, {\n * fieldMapping: {\n * 'email_address': 'email',\n * 'password_hash': 'password'\n * }\n * });\n * }\n * ```\n */\nexport function mapApiErrorsToForm<TFieldValues extends FieldValues = FieldValues>(\n error: unknown,\n form: UseFormReturn<TFieldValues>,\n options: MapApiErrorsOptions = {},\n): void {\n const { fieldMapping = {}, setRootError = true } = options;\n\n if (!error || typeof error !== 'object') {\n if (setRootError) {\n form.setError('root', {\n type: 'Error',\n message: 'An error occurred',\n });\n }\n return;\n }\n\n // Extract error data from axios response structure\n const axiosError = error as AxiosLikeError;\n const errorData = axiosError.response?.data || error;\n const apiError = errorData as ApiErrorResponse;\n\n // Extract title/label for error heading (RFC 9457)\n const errorTitle = apiError.label || apiError.title || 'Error';\n const generalMessage = apiError.detail;\n\n // Map field-specific errors (field is always present in RFC 9457)\n let mappedFieldErrorsCount = 0;\n if (apiError.errors && Array.isArray(apiError.errors)) {\n for (const errorItem of apiError.errors) {\n const formField = fieldMapping[errorItem.field] || errorItem.field;\n\n form.setError(formField as FieldPath<TFieldValues>, {\n type: 'manual',\n message: errorItem.message,\n });\n mappedFieldErrorsCount += 1;\n }\n }\n\n // Root error is shown only when no field errors are present\n if (generalMessage && setRootError && mappedFieldErrorsCount === 0) {\n form.setError('root', {\n type: errorTitle,\n message: generalMessage,\n });\n }\n}\n","import type { UseMutationResult } from '@tanstack/react-query';\nimport type React from 'react';\nimport { Children, cloneElement, Fragment, isValidElement, useCallback } from 'react';\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n type UseFormReturn,\n} from 'react-hook-form';\nimport type { Country } from 'react-phone-number-input';\nimport { cn } from '../../../shadcn/utils';\nimport { axios } from '../../utils/axios';\nimport { type FieldMapping, mapApiErrorsToForm } from '../../utils/formHelpers';\nimport { Alert } from '../Alert';\nimport { Button } from '../Button';\nimport { Checkbox } from '../Checkbox';\nimport { CheckboxGroup } from '../CheckboxGroup';\nimport { DatePicker } from '../DatePicker';\nimport { DateTimePicker } from '../DateTimePicker';\nimport { PhoneField } from '../PhoneField';\nimport { RadioGroup } from '../RadioGroup';\nimport { Switch } from '../Switch';\nimport { UploadFile } from '../UploadFile';\n\n// Re-export Controller for explicit usage\nexport { Controller } from 'react-hook-form';\n\n/**\n * Recursively process children to wrap form fields with Controller\n * and inject loading state into submit buttons\n */\nfunction processChildren<\n TFieldValues extends FieldValues = FieldValues,\n _TContext = any,\n TTransformedValues extends FieldValues | undefined = TFieldValues,\n>(\n children: React.ReactNode,\n control: ControllerProps<TFieldValues, FieldPath<TFieldValues>, TTransformedValues>['control'],\n isSubmitting: boolean,\n setValue: UseFormReturn<TFieldValues, _TContext, TTransformedValues>['setValue'],\n onCancel?: () => void,\n reset?: UseFormReturn<TFieldValues, _TContext, TTransformedValues>['reset'],\n): React.ReactNode {\n return Children.map(children, (child) => {\n // Handle non-element children (strings, numbers, null, etc.)\n if (!isValidElement(child)) {\n return child;\n }\n\n const childProps = child.props as any;\n const isFragment = child.type === Fragment;\n\n // Handle form fields with name prop (but not Fragments)\n if (!isFragment && childProps.name && typeof childProps.name === 'string') {\n const name = childProps.name as FieldPath<TFieldValues>;\n\n return (\n <Controller\n key={name}\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n // Check if this is a Checkbox, Switch, RadioGroup, or CheckboxGroup component\n const isCheckbox = child.type === Checkbox;\n const isSwitch = child.type === Switch;\n const isRadioGroup = child.type === RadioGroup;\n const isCheckboxGroup = child.type === CheckboxGroup;\n const isPhone = child.type === PhoneField;\n const isDatePicker = child.type === DatePicker;\n const isDateTimePicker = child.type === DateTimePicker;\n\n const fieldProps =\n isCheckbox || isSwitch\n ? {\n checked: field.value,\n onCheckedChange: field.onChange,\n onBlur: field.onBlur,\n ref: field.ref,\n }\n : isRadioGroup || isCheckboxGroup\n ? {\n value: field.value,\n onValueChange: field.onChange,\n onBlur: field.onBlur,\n }\n : isDatePicker\n ? {\n value: field.value,\n onValueChange: field.onChange,\n onBlur: field.onBlur,\n ref: field.ref,\n }\n : isDateTimePicker\n ? {\n value: field.value,\n onValueChange: field.onChange,\n onBlur: field.onBlur,\n ref: field.ref,\n }\n : isPhone\n ? {\n ...field,\n onCountryChange: (country: Country | undefined) => {\n setValue(`${name}Country` as FieldPath<TFieldValues>, country as any);\n },\n }\n : field;\n\n const isUploadFile = child.type === UploadFile;\n\n return cloneElement(child, {\n ...childProps,\n ...fieldProps,\n error: fieldState.error?.message || (fieldState.error ? 'Invalid' : undefined),\n name: undefined, // Remove name to avoid passing it to the underlying input\n ...(isUploadFile ? { isLoading: isSubmitting } : {}),\n });\n }}\n />\n );\n }\n\n // Handle cancel buttons - wire up form.reset() + onCancel callback\n if (childProps['data-cancel'] && onCancel && reset) {\n return cloneElement(child, {\n ...childProps,\n onClick: () => {\n reset();\n onCancel();\n },\n });\n }\n\n // Handle submit buttons - inject loading state via isLoading prop\n if (childProps.type === 'submit') {\n const isButtonElement =\n child.type === Button || (typeof child.type === 'function' && (child.type as any).displayName === 'Button');\n\n if (isButtonElement) {\n return cloneElement(child, {\n ...childProps,\n isLoading: isSubmitting,\n });\n }\n }\n\n // Handle React Fragments - process their children directly\n if (isFragment) {\n return processChildren(childProps.children, control, isSubmitting, setValue, onCancel, reset);\n }\n\n // Recurse into children for container elements (divs, FieldGroups, etc.)\n if (childProps.children != null) {\n return cloneElement(child, {\n ...childProps,\n children: processChildren(childProps.children, control, isSubmitting, setValue, onCancel, reset),\n });\n }\n\n // Return unchanged if no name prop and no children\n return child;\n });\n}\n\nexport interface FormProps<\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues extends FieldValues | undefined = TFieldValues,\n TMutationData = unknown,\n TMutationError = Error,\n TMutationVariables = any,\n> extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {\n /**\n * The react-hook-form form instance\n */\n form: UseFormReturn<TFieldValues, TContext, TTransformedValues>;\n\n /**\n * Form submit handler - receives the transformed values if transformation is applied.\n * Optional when using `mutation` prop.\n */\n onSubmit?: Parameters<UseFormReturn<TFieldValues, TContext, TTransformedValues>['handleSubmit']>[0];\n\n /**\n * Children elements - automatically wrapped with Controller if they have a name prop\n */\n children: React.ReactNode;\n\n /**\n * Position of the root error display\n * @default 'bottom'\n */\n rootErrorPosition?: 'top' | 'bottom';\n\n /**\n * Additional classes for the root error display\n */\n rootErrorClassName?: string;\n\n /**\n * Action element rendered in the root error Alert (e.g. button or link)\n * Positioned in the top-right corner using AlertAction\n */\n rootErrorAction?: React.ReactNode;\n\n /**\n * Field mapping for automatic API error mapping\n * Maps API field names to form field names\n */\n fieldMapping?: FieldMapping;\n\n /**\n * TanStack Query mutation for automatic handling.\n * When provided, the form will use `mutateAsync` to submit data and handle errors automatically.\n * The mutation's own callbacks (onSuccess, onError, etc.) will fire automatically.\n * Form only adds `mapApiErrorsToForm` as an extra error handling layer.\n * Optional - you can use `onSubmit` instead for forms that don't use mutations.\n */\n mutation?: UseMutationResult<TMutationData, TMutationError, TMutationVariables, unknown>;\n\n /**\n * Transform form data to mutation variables before submission.\n * Only used when `mutation` prop is provided.\n */\n transformSubmit?: (\n data: TTransformedValues extends undefined ? TFieldValues : TTransformedValues,\n ) => TMutationVariables;\n\n /**\n * Automatically calls form.reset() after a successful mutation.\n * Set to false for \"edit\" forms where resetting clears pre-populated values.\n * @default true\n */\n resetOnSuccess?: boolean;\n\n /**\n * Called when a cancel button (marked with data-cancel) is clicked.\n * Form.reset() is called automatically before invoking this callback.\n */\n onCancel?: () => void;\n}\n\n/**\n * Smart Form component that automatically wraps children with Controller\n *\n * Usage with onSubmit:\n * ```tsx\n * <Form form={form} onSubmit={handleSubmit}>\n * <TextField name=\"email\" label=\"Email\" description=\"Your email address\" />\n * <PasswordField name=\"password\" label=\"Password\" />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n *\n * Usage with TanStack Query mutation:\n * ```tsx\n * const mutation = useMutation({\n * mutationFn: (data) => api.post('/login', data),\n * onSuccess: (data) => console.log('Success!', data),\n * onError: (error) => console.error('Error!', error),\n * });\n *\n * <Form\n * form={form}\n * mutation={mutation}\n * transformSubmit={(data) => ({ ...data, timestamp: Date.now() })}\n * >\n * <TextField name=\"email\" label=\"Email\" />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n */\nexport function Form<\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues extends FieldValues | undefined = TFieldValues,\n TMutationData = unknown,\n TMutationError = Error,\n TMutationVariables = any,\n>({\n form,\n onSubmit,\n children,\n rootErrorPosition = 'bottom',\n rootErrorClassName,\n rootErrorAction,\n fieldMapping,\n mutation,\n transformSubmit,\n resetOnSuccess,\n onCancel,\n className,\n ...props\n}: FormProps<TFieldValues, TContext, TTransformedValues, TMutationData, TMutationError, TMutationVariables>) {\n // Compute isSubmitting from both form state and mutation state\n const isSubmitting = form.formState.isSubmitting || (mutation?.isPending ?? false);\n\n // Wrap the submit handler with automatic error mapping (always enabled)\n // Form only adds mapApiErrorsToForm - the mutation's own callbacks fire automatically\n const wrappedOnSubmit = useCallback(\n async (data: TTransformedValues extends undefined ? TFieldValues : TTransformedValues) => {\n // Suppress error toasts during form submission — Form handles errors inline\n const interceptorId = axios.interceptors.request.use((config) => ({\n ...config,\n showErrorToast: false,\n }));\n\n try {\n if (mutation) {\n const variables = transformSubmit ? transformSubmit(data) : data;\n // mutateAsync will trigger the mutation's onSuccess/onError callbacks\n await mutation.mutateAsync(variables as TMutationVariables);\n } else if (onSubmit) {\n await onSubmit(data as any);\n }\n\n // Reset form after successful submission (default: true)\n if (resetOnSuccess !== false) form.reset();\n } catch (error) {\n // Form's only job: map API errors to form fields\n // mapApiErrorsToForm handles axios error structure extraction internally\n mapApiErrorsToForm(error, form as any, {\n fieldMapping,\n });\n // Log error for debugging\n console.error('[Form Submission Error]', error);\n // Error is swallowed, not re-thrown (mutation's onError already fired)\n } finally {\n axios.interceptors.request.eject(interceptorId);\n }\n },\n [onSubmit, mutation, transformSubmit, fieldMapping, form, resetOnSuccess],\n );\n\n const handleSubmit = form.handleSubmit(wrappedOnSubmit as any);\n\n // Process children recursively to automatically wrap with Controller\n const processedChildren = processChildren(children, form.control, isSubmitting, form.setValue, onCancel, form.reset);\n\n const childArray = Children.toArray(processedChildren);\n const actionsIndex = childArray.findIndex(\n (child) => isValidElement(child) && (child.type as { displayName?: string })?.displayName === 'DialogActions',\n );\n const hasActions = actionsIndex !== -1;\n const bodyChildren = hasActions ? childArray.filter((_, index) => index !== actionsIndex) : processedChildren;\n const actions = hasActions ? childArray[actionsIndex] : null;\n\n const topError =\n rootErrorPosition === 'top' && form.formState.errors.root ? (\n <Alert\n variant=\"destructive\"\n title={form.formState.errors.root.type || 'Error'}\n description={form.formState.errors.root.message}\n action={rootErrorAction}\n className={cn('mb-4', rootErrorClassName)}\n />\n ) : null;\n const bottomError =\n rootErrorPosition === 'bottom' && form.formState.errors.root ? (\n <Alert\n variant=\"destructive\"\n title={form.formState.errors.root.type || 'Error'}\n description={form.formState.errors.root.message}\n action={rootErrorAction}\n className={cn('mt-4', rootErrorClassName)}\n />\n ) : null;\n\n return (\n <FormProvider {...form}>\n <form\n onSubmit={handleSubmit}\n className={cn(hasActions ? 'flex min-h-0 flex-1 flex-col' : 'space-y-4', className)}\n {...props}\n >\n {hasActions ? (\n <>\n <div className=\"min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-6 py-4 [scrollbar-gutter:stable]\">\n {topError}\n {bodyChildren}\n {bottomError}\n </div>\n {actions}\n </>\n ) : (\n <>\n {topError}\n {processedChildren}\n {bottomError}\n </>\n )}\n </form>\n </FormProvider>\n );\n}\n\nForm.displayName = 'Form';\n"],"names":["Fragment"],"mappings":";;;;;;;;;;;;;;;;AAgFO,SAAS,kBAAA,CACd,KAAA,EACA,IAAA,EACA,OAAA,GAA+B,EAAC,EAC1B;AACN,EAAA,MAAM,EAAE,YAAA,GAAe,EAAC,EAAG,YAAA,GAAe,MAAK,GAAI,OAAA;AAEnD,EAAA,IAAI,CAAC,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,EAAU;AACvC,IAAA,IAAI,YAAA,EAAc;AAChB,MAAA,IAAA,CAAK,SAAS,MAAA,EAAQ;AAAA,QACpB,IAAA,EAAM,OAAA;AAAA,QACN,OAAA,EAAS;AAAA,OACV,CAAA;AAAA,IACH;AACA,IAAA;AAAA,EACF;AAGA,EAAA,MAAM,UAAA,GAAa,KAAA;AACnB,EAAA,MAAM,SAAA,GAAY,UAAA,CAAW,QAAA,EAAU,IAAA,IAAQ,KAAA;AAC/C,EAAA,MAAM,QAAA,GAAW,SAAA;AAGjB,EAAA,MAAM,UAAA,GAAa,QAAA,CAAS,KAAA,IAAS,QAAA,CAAS,KAAA,IAAS,OAAA;AACvD,EAAA,MAAM,iBAAiB,QAAA,CAAS,MAAA;AAGhC,EAAA,IAAI,sBAAA,GAAyB,CAAA;AAC7B,EAAA,IAAI,SAAS,MAAA,IAAU,KAAA,CAAM,OAAA,CAAQ,QAAA,CAAS,MAAM,CAAA,EAAG;AACrD,IAAA,KAAA,MAAW,SAAA,IAAa,SAAS,MAAA,EAAQ;AACvC,MAAA,MAAM,SAAA,GAAY,YAAA,CAAa,SAAA,CAA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
4
|
-
import { c as createContextScope } from './
|
|
5
|
-
import { P as Primitive } from './
|
|
4
|
+
import { c as createContextScope } from './index34.js';
|
|
5
|
+
import { P as Primitive } from './index30.js';
|
|
6
6
|
import { c as cn } from './utils.js';
|
|
7
7
|
|
|
8
8
|
var PROGRESS_NAME = "Progress";
|
package/dist/RadioGroup.js
CHANGED
|
@@ -8,8 +8,8 @@ import { u as useComposedRefs } from './index11.js';
|
|
|
8
8
|
import { c as createContextScope } from './index19.js';
|
|
9
9
|
import { R as Root, c as createRovingFocusGroupScope, I as Item } from './index20.js';
|
|
10
10
|
import { u as useDirection } from './index22.js';
|
|
11
|
-
import { u as useSize } from './
|
|
12
|
-
import { u as usePrevious } from './
|
|
11
|
+
import { u as useSize } from './index36.js';
|
|
12
|
+
import { u as usePrevious } from './index35.js';
|
|
13
13
|
import { P as Presence } from './index21.js';
|
|
14
14
|
|
|
15
15
|
var RADIO_NAME = "Radio";
|
package/dist/Sidebar.js
CHANGED
|
@@ -6,7 +6,7 @@ import { forwardRef, useState, useCallback, useEffect, useMemo, useRef, createCo
|
|
|
6
6
|
import { u as useIsMobile } from './useIsMobile.js';
|
|
7
7
|
import { c as cn } from './utils.js';
|
|
8
8
|
import { T as TooltipProvider, a as Tooltip, b as TooltipTrigger, c as TooltipContent } from './tooltip.js';
|
|
9
|
-
import { R as Root, P as Portal, C as Content, a as Close, b as Title, D as Description, O as Overlay } from './
|
|
9
|
+
import { R as Root, P as Portal, C as Content, a as Close, b as Title, D as Description, O as Overlay } from './index31.js';
|
|
10
10
|
import { X } from './x.js';
|
|
11
11
|
import { D as DropdownMenu, a as DropdownMenuTrigger, b as DropdownMenuContent, e as DropdownMenuLabel, c as DropdownMenuItem } from './dropdown-menu.js';
|
|
12
12
|
import { c as createLucideIcon } from './createLucideIcon.js';
|
package/dist/Switch.js
CHANGED
|
@@ -5,8 +5,8 @@ import { F as Field, e as FieldLabel, c as FieldError } from './field.js';
|
|
|
5
5
|
import { u as useControllableState, P as Primitive, c as composeEventHandlers } from './index18.js';
|
|
6
6
|
import { u as useComposedRefs } from './index11.js';
|
|
7
7
|
import { c as createContextScope } from './index19.js';
|
|
8
|
-
import { u as usePrevious } from './
|
|
9
|
-
import { u as useSize } from './
|
|
8
|
+
import { u as usePrevious } from './index35.js';
|
|
9
|
+
import { u as useSize } from './index36.js';
|
|
10
10
|
import { c as cn } from './utils.js';
|
|
11
11
|
|
|
12
12
|
var SWITCH_NAME = "Switch";
|
package/dist/TabsSkeleton.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { C as Content, L as List, T as Trigger, R as Root2 } from './index17.js';
|
|
3
3
|
import { useId, useState } from 'react';
|
|
4
4
|
import { c as cn } from './utils.js';
|
|
5
|
-
import { L as LayoutGroup } from './
|
|
5
|
+
import { L as LayoutGroup } from './index38.js';
|
|
6
6
|
import { m as motion, A as AnimatePresence } from './proxy.js';
|
|
7
7
|
import { S as Skeleton } from './Skeleton.js';
|
|
8
8
|
|
package/dist/Toggle.js
CHANGED
package/dist/ViewTabs.js
CHANGED
|
@@ -8,10 +8,9 @@ import { C as Check } from './check.js';
|
|
|
8
8
|
import { X } from './x.js';
|
|
9
9
|
import { c as createLucideIcon } from './createLucideIcon.js';
|
|
10
10
|
import { L as Lock } from './lock.js';
|
|
11
|
-
import { P as Pencil, T as Trash2 } from './trash-2.js';
|
|
11
|
+
import { P as Pencil, T as Trash2, a as Plus } from './trash-2.js';
|
|
12
12
|
import { S as Save, a as Share2 } from './share-2.js';
|
|
13
13
|
import { E as Ellipsis } from './ellipsis.js';
|
|
14
|
-
import { P as Plus } from './plus.js';
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* @license lucide-react v0.562.0 - ISC
|
package/dist/ViewTabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewTabs.js","sources":["../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/globe.js","../lib/components/ViewTabs/ViewTabs.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\", key: \"13o1zl\" }],\n [\"path\", { d: \"M2 12h20\", key: \"9i4pu4\" }]\n];\nconst Globe = createLucideIcon(\"globe\", __iconNode);\n\nexport { __iconNode, Globe as default };\n//# sourceMappingURL=globe.js.map\n","import { Check, Ellipsis, Globe, Lock, Pencil, Plus, Save, Share2, Trash2, X } from 'lucide-react';\nimport { useCallback, useRef, useState } from 'react';\nimport { cn } from '../../../shadcn/utils';\nimport type { TableViewState } from '../../types/table-filter';\nimport { Button } from '../Button';\nimport { DropdownMenu, type MenuItem } from '../DropdownMenu';\nimport { Spinner } from '../Spinner';\n\nexport interface TableView {\n id: string;\n name: string;\n state: TableViewState;\n isShared: boolean;\n isOwn: boolean;\n}\n\nexport interface ViewTabsProps {\n defaultLabel?: string;\n views: TableView[];\n activeViewId: string | null;\n currentState: TableViewState;\n onActivate: (viewId: string | null) => void;\n onSave: (name: string) => void;\n onUpdate: (viewId: string) => void;\n onRename: (viewId: string, name: string) => void;\n onDelete: (viewId: string) => void;\n onToggleShare: (viewId: string, isShared: boolean) => void;\n isLoading?: boolean;\n}\n\n// Horizontal tab strip for switching between saved table views\nexport const ViewTabs: React.FC<ViewTabsProps> = ({\n defaultLabel = 'All',\n views,\n activeViewId,\n currentState: _currentState,\n onActivate,\n onSave,\n onUpdate,\n onRename,\n onDelete,\n onToggleShare,\n isLoading = false,\n}) => {\n const [isCreating, setIsCreating] = useState(false);\n const [newName, setNewName] = useState('');\n const [editingId, setEditingId] = useState<string | null>(null);\n const [editingName, setEditingName] = useState('');\n const newInputRef = useRef<HTMLInputElement>(null);\n const editInputRef = useRef<HTMLInputElement>(null);\n\n // Starts the inline create flow\n const handleStartCreate = useCallback(() => {\n setIsCreating(true);\n setNewName('');\n requestAnimationFrame(() => newInputRef.current?.focus());\n }, []);\n\n // Saves a new view from the inline input\n const handleConfirmCreate = useCallback(() => {\n const trimmed = newName.trim();\n if (trimmed) {\n onSave(trimmed);\n }\n setIsCreating(false);\n setNewName('');\n }, [newName, onSave]);\n\n // Cancels the inline create flow\n const handleCancelCreate = useCallback(() => {\n setIsCreating(false);\n setNewName('');\n }, []);\n\n // Starts inline rename for a view\n const handleStartRename = useCallback((view: TableView) => {\n setEditingId(view.id);\n setEditingName(view.name);\n requestAnimationFrame(() => editInputRef.current?.focus());\n }, []);\n\n // Confirms the rename\n const handleConfirmRename = useCallback(() => {\n if (editingId && editingName.trim()) {\n onRename(editingId, editingName.trim());\n }\n setEditingId(null);\n setEditingName('');\n }, [editingId, editingName, onRename]);\n\n // Cancels the rename\n const handleCancelRename = useCallback(() => {\n setEditingId(null);\n setEditingName('');\n }, []);\n\n if (isLoading) {\n return (\n <div className=\"flex items-center gap-2 border-b px-1 py-2\">\n <Spinner className=\"size-4 text-muted-foreground\" />\n </div>\n );\n }\n\n return (\n <div className=\"flex items-center gap-1 border-b overflow-x-auto\" role=\"tablist\" aria-label=\"Table views\">\n {/* Default \"All\" tab */}\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={activeViewId === null}\n className={cn(\n 'shrink-0 px-4 py-2 text-sm font-medium transition-colors border-b-2 whitespace-nowrap',\n activeViewId === null\n ? 'border-primary text-primary'\n : 'border-transparent text-muted-foreground hover:text-foreground hover:border-border',\n )}\n onClick={() => onActivate(null)}\n >\n {defaultLabel}\n </button>\n\n {/* Named view tabs */}\n {views.map((view) => (\n <div key={view.id} className=\"flex items-center shrink-0\">\n {editingId === view.id ? (\n <div className=\"flex items-center gap-1 px-2 py-1.5\">\n <input\n ref={editInputRef}\n type=\"text\"\n value={editingName}\n onChange={(e) => setEditingName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleConfirmRename();\n if (e.key === 'Escape') handleCancelRename();\n }}\n className=\"h-6 w-24 rounded border border-input bg-transparent px-2 text-sm outline-none focus-visible:border-ring\"\n />\n <Button variant=\"ghost\" size=\"icon\" className=\"h-6 w-6\" onClick={handleConfirmRename}>\n <Check className=\"size-3.5\" />\n </Button>\n <Button variant=\"ghost\" size=\"icon\" className=\"h-6 w-6\" onClick={handleCancelRename}>\n <X className=\"size-3.5\" />\n </Button>\n </div>\n ) : (\n <>\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={activeViewId === view.id}\n className={cn(\n 'px-4 py-2 text-sm font-medium transition-colors border-b-2 whitespace-nowrap',\n activeViewId === view.id\n ? 'border-primary text-primary'\n : 'border-transparent text-muted-foreground hover:text-foreground hover:border-border',\n )}\n onClick={() => onActivate(view.id)}\n >\n <span className=\"flex items-center gap-1.5\">\n {view.name}\n {view.isShared && <Globe className=\"size-3 text-muted-foreground\" />}\n {!view.isOwn && <Lock className=\"size-3 text-muted-foreground\" />}\n </span>\n </button>\n {(() => {\n const items: MenuItem[] = view.isOwn\n ? [\n {\n type: 'item',\n id: `${view.id}-rename`,\n label: 'Edit name',\n icon: Pencil,\n onClick: () => handleStartRename(view),\n },\n {\n type: 'item',\n id: `${view.id}-save`,\n label: 'Save changes',\n icon: Save,\n onClick: () => onUpdate(view.id),\n },\n {\n type: 'item',\n id: `${view.id}-share`,\n label: view.isShared ? 'Unshare' : 'Share',\n icon: Share2,\n onClick: () => onToggleShare(view.id, !view.isShared),\n },\n { type: 'separator' },\n {\n type: 'item',\n id: `${view.id}-delete`,\n label: 'Delete',\n icon: Trash2,\n variant: 'destructive',\n onClick: () => onDelete(view.id),\n },\n ]\n : [\n {\n type: 'item',\n id: `${view.id}-shared-by-others`,\n label: 'Shared by others',\n icon: Lock,\n disabled: true,\n },\n ];\n\n return (\n <DropdownMenu\n trigger={{\n children: (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-6 w-6 shrink-0 text-muted-foreground hover:text-foreground\"\n >\n <Ellipsis className=\"size-3.5\" />\n <span className=\"sr-only\">View options for {view.name}</span>\n </Button>\n ),\n }}\n items={items}\n align=\"start\"\n contentClassName=\"w-[180px]\"\n />\n );\n })()}\n </>\n )}\n </div>\n ))}\n\n {/* Create new view */}\n {isCreating ? (\n <div className=\"flex items-center gap-1 px-2 py-1.5 shrink-0\">\n <input\n ref={newInputRef}\n type=\"text\"\n value={newName}\n onChange={(e) => setNewName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleConfirmCreate();\n if (e.key === 'Escape') handleCancelCreate();\n }}\n placeholder=\"View name...\"\n className=\"h-6 w-28 rounded border border-input bg-transparent px-2 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-ring\"\n />\n <Button variant=\"ghost\" size=\"icon\" className=\"h-6 w-6\" onClick={handleConfirmCreate}>\n <Check className=\"size-3.5\" />\n </Button>\n <Button variant=\"ghost\" size=\"icon\" className=\"h-6 w-6\" onClick={handleCancelCreate}>\n <X className=\"size-3.5\" />\n </Button>\n </div>\n ) : (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-8 w-8 shrink-0 text-muted-foreground hover:text-foreground\"\n onClick={handleStartCreate}\n aria-label=\"Create new view\"\n >\n <Plus className=\"size-4\" />\n </Button>\n )}\n </div>\n );\n};\n\nViewTabs.displayName = 'ViewTabs';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC5D,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,iDAAiD,EAAE,GAAG,EAA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Q,OAAA,EAAQ,MAAK,MAAA,EAAO,SAAA,EAAU,SAAA,EAAU,OAAA,EAAS,mBAAA,EAC/D,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAM,SAAA,EAAU,YAAW,CAAA,EAC9B,CAAA;AAAA,sBACA,GAAA,CAAC,MAAA,EAAA,EAAO,OAAA,EAAQ,OAAA,EAAQ,MAAK,MAAA,EAAO,SAAA,EAAU,SAAA,EAAU,OAAA,EAAS,kBAAA,EAC/D,QAAA,kBAAA,GAAA,CAAC,CAAA,EAAA,EAAE,SAAA,EAAU,YAAW,CAAA,EAC1B;AAAA,KAAA,EACF,CAAA,mBAEA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,OAAA;AAAA,QACR,IAAA,EAAK,MAAA;AAAA,QACL,SAAA,EAAU,8DAAA;AAAA,QACV,OAAA,EAAS,iBAAA;AAAA,QACT,YAAA,EAAW,iBAAA;AAAA,QAEX,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,QAAA,EAAS;AAAA;AAAA;AAC3B,GAAA,EAEJ,CAAA;AAEJ;AAEA,QAAA,CAAS,WAAA,GAAc,UAAA;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"ViewTabs.js","sources":["../node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/globe.js","../lib/components/ViewTabs/ViewTabs.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.562.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\", key: \"13o1zl\" }],\n [\"path\", { d: \"M2 12h20\", key: \"9i4pu4\" }]\n];\nconst Globe = createLucideIcon(\"globe\", __iconNode);\n\nexport { __iconNode, Globe as default };\n//# sourceMappingURL=globe.js.map\n","import { Check, Ellipsis, Globe, Lock, Pencil, Plus, Save, Share2, Trash2, X } from 'lucide-react';\nimport { useCallback, useRef, useState } from 'react';\nimport { cn } from '../../../shadcn/utils';\nimport type { TableViewState } from '../../types/table-filter';\nimport { Button } from '../Button';\nimport { DropdownMenu, type MenuItem } from '../DropdownMenu';\nimport { Spinner } from '../Spinner';\n\nexport interface TableView {\n id: string;\n name: string;\n state: TableViewState;\n isShared: boolean;\n isOwn: boolean;\n}\n\nexport interface ViewTabsProps {\n defaultLabel?: string;\n views: TableView[];\n activeViewId: string | null;\n currentState: TableViewState;\n onActivate: (viewId: string | null) => void;\n onSave: (name: string) => void;\n onUpdate: (viewId: string) => void;\n onRename: (viewId: string, name: string) => void;\n onDelete: (viewId: string) => void;\n onToggleShare: (viewId: string, isShared: boolean) => void;\n isLoading?: boolean;\n}\n\n// Horizontal tab strip for switching between saved table views\nexport const ViewTabs: React.FC<ViewTabsProps> = ({\n defaultLabel = 'All',\n views,\n activeViewId,\n currentState: _currentState,\n onActivate,\n onSave,\n onUpdate,\n onRename,\n onDelete,\n onToggleShare,\n isLoading = false,\n}) => {\n const [isCreating, setIsCreating] = useState(false);\n const [newName, setNewName] = useState('');\n const [editingId, setEditingId] = useState<string | null>(null);\n const [editingName, setEditingName] = useState('');\n const newInputRef = useRef<HTMLInputElement>(null);\n const editInputRef = useRef<HTMLInputElement>(null);\n\n // Starts the inline create flow\n const handleStartCreate = useCallback(() => {\n setIsCreating(true);\n setNewName('');\n requestAnimationFrame(() => newInputRef.current?.focus());\n }, []);\n\n // Saves a new view from the inline input\n const handleConfirmCreate = useCallback(() => {\n const trimmed = newName.trim();\n if (trimmed) {\n onSave(trimmed);\n }\n setIsCreating(false);\n setNewName('');\n }, [newName, onSave]);\n\n // Cancels the inline create flow\n const handleCancelCreate = useCallback(() => {\n setIsCreating(false);\n setNewName('');\n }, []);\n\n // Starts inline rename for a view\n const handleStartRename = useCallback((view: TableView) => {\n setEditingId(view.id);\n setEditingName(view.name);\n requestAnimationFrame(() => editInputRef.current?.focus());\n }, []);\n\n // Confirms the rename\n const handleConfirmRename = useCallback(() => {\n if (editingId && editingName.trim()) {\n onRename(editingId, editingName.trim());\n }\n setEditingId(null);\n setEditingName('');\n }, [editingId, editingName, onRename]);\n\n // Cancels the rename\n const handleCancelRename = useCallback(() => {\n setEditingId(null);\n setEditingName('');\n }, []);\n\n if (isLoading) {\n return (\n <div className=\"flex items-center gap-2 border-b px-1 py-2\">\n <Spinner className=\"size-4 text-muted-foreground\" />\n </div>\n );\n }\n\n return (\n <div className=\"flex items-center gap-1 border-b overflow-x-auto\" role=\"tablist\" aria-label=\"Table views\">\n {/* Default \"All\" tab */}\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={activeViewId === null}\n className={cn(\n 'shrink-0 px-4 py-2 text-sm font-medium transition-colors border-b-2 whitespace-nowrap',\n activeViewId === null\n ? 'border-primary text-primary'\n : 'border-transparent text-muted-foreground hover:text-foreground hover:border-border',\n )}\n onClick={() => onActivate(null)}\n >\n {defaultLabel}\n </button>\n\n {/* Named view tabs */}\n {views.map((view) => (\n <div key={view.id} className=\"flex items-center shrink-0\">\n {editingId === view.id ? (\n <div className=\"flex items-center gap-1 px-2 py-1.5\">\n <input\n ref={editInputRef}\n type=\"text\"\n value={editingName}\n onChange={(e) => setEditingName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleConfirmRename();\n if (e.key === 'Escape') handleCancelRename();\n }}\n className=\"h-6 w-24 rounded border border-input bg-transparent px-2 text-sm outline-none focus-visible:border-ring\"\n />\n <Button variant=\"ghost\" size=\"icon\" className=\"h-6 w-6\" onClick={handleConfirmRename}>\n <Check className=\"size-3.5\" />\n </Button>\n <Button variant=\"ghost\" size=\"icon\" className=\"h-6 w-6\" onClick={handleCancelRename}>\n <X className=\"size-3.5\" />\n </Button>\n </div>\n ) : (\n <>\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={activeViewId === view.id}\n className={cn(\n 'px-4 py-2 text-sm font-medium transition-colors border-b-2 whitespace-nowrap',\n activeViewId === view.id\n ? 'border-primary text-primary'\n : 'border-transparent text-muted-foreground hover:text-foreground hover:border-border',\n )}\n onClick={() => onActivate(view.id)}\n >\n <span className=\"flex items-center gap-1.5\">\n {view.name}\n {view.isShared && <Globe className=\"size-3 text-muted-foreground\" />}\n {!view.isOwn && <Lock className=\"size-3 text-muted-foreground\" />}\n </span>\n </button>\n {(() => {\n const items: MenuItem[] = view.isOwn\n ? [\n {\n type: 'item',\n id: `${view.id}-rename`,\n label: 'Edit name',\n icon: Pencil,\n onClick: () => handleStartRename(view),\n },\n {\n type: 'item',\n id: `${view.id}-save`,\n label: 'Save changes',\n icon: Save,\n onClick: () => onUpdate(view.id),\n },\n {\n type: 'item',\n id: `${view.id}-share`,\n label: view.isShared ? 'Unshare' : 'Share',\n icon: Share2,\n onClick: () => onToggleShare(view.id, !view.isShared),\n },\n { type: 'separator' },\n {\n type: 'item',\n id: `${view.id}-delete`,\n label: 'Delete',\n icon: Trash2,\n variant: 'destructive',\n onClick: () => onDelete(view.id),\n },\n ]\n : [\n {\n type: 'item',\n id: `${view.id}-shared-by-others`,\n label: 'Shared by others',\n icon: Lock,\n disabled: true,\n },\n ];\n\n return (\n <DropdownMenu\n trigger={{\n children: (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-6 w-6 shrink-0 text-muted-foreground hover:text-foreground\"\n >\n <Ellipsis className=\"size-3.5\" />\n <span className=\"sr-only\">View options for {view.name}</span>\n </Button>\n ),\n }}\n items={items}\n align=\"start\"\n contentClassName=\"w-[180px]\"\n />\n );\n })()}\n </>\n )}\n </div>\n ))}\n\n {/* Create new view */}\n {isCreating ? (\n <div className=\"flex items-center gap-1 px-2 py-1.5 shrink-0\">\n <input\n ref={newInputRef}\n type=\"text\"\n value={newName}\n onChange={(e) => setNewName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleConfirmCreate();\n if (e.key === 'Escape') handleCancelCreate();\n }}\n placeholder=\"View name...\"\n className=\"h-6 w-28 rounded border border-input bg-transparent px-2 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-ring\"\n />\n <Button variant=\"ghost\" size=\"icon\" className=\"h-6 w-6\" onClick={handleConfirmCreate}>\n <Check className=\"size-3.5\" />\n </Button>\n <Button variant=\"ghost\" size=\"icon\" className=\"h-6 w-6\" onClick={handleCancelCreate}>\n <X className=\"size-3.5\" />\n </Button>\n </div>\n ) : (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-8 w-8 shrink-0 text-muted-foreground hover:text-foreground\"\n onClick={handleStartCreate}\n aria-label=\"Create new view\"\n >\n <Plus className=\"size-4\" />\n </Button>\n )}\n </div>\n );\n};\n\nViewTabs.displayName = 'ViewTabs';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC5D,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,iDAAiD,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AACnF,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE;AAC3C,CAAC;AACD,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC;;ACiB5C,MAAM,WAAoC,CAAC;AAAA,EAChD,YAAA,GAAe,KAAA;AAAA,EACf,KAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA,EAAc,aAAA;AAAA,EACd,UAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,Q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AAA,EAC1B;AAAA,KAAA,EACF,CAAA,mBAEA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,OAAA;AAAA,QACR,IAAA,EAAK,MAAA;AAAA,QACL,SAAA,EAAU,8DAAA;AAAA,QACV,OAAA,EAAS,iBAAA;AAAA,QACT,YAAA,EAAW,iBAAA;AAAA,QAEX,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,QAAA,EAAS;AAAA;AAAA;AAC3B,GAAA,EAEJ,CAAA;AAEJ;AAEA,QAAA,CAAS,WAAA,GAAc,UAAA;;;;","x_google_ignoreList":[0]}
|
|
@@ -1552,6 +1552,10 @@ select:-webkit-autofill:active {
|
|
|
1552
1552
|
margin-inline: calc(var(--spacing) * -1);
|
|
1553
1553
|
}
|
|
1554
1554
|
|
|
1555
|
+
.-mx-6 {
|
|
1556
|
+
margin-inline: calc(var(--spacing) * -6);
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1555
1559
|
.mx-0 {
|
|
1556
1560
|
margin-inline: calc(var(--spacing) * 0);
|
|
1557
1561
|
}
|
|
@@ -1972,14 +1976,14 @@ select:-webkit-autofill:active {
|
|
|
1972
1976
|
max-height: calc(var(--spacing) * 60);
|
|
1973
1977
|
}
|
|
1974
1978
|
|
|
1975
|
-
.max-h-64 {
|
|
1976
|
-
max-height: calc(var(--spacing) * 64);
|
|
1977
|
-
}
|
|
1978
|
-
|
|
1979
1979
|
.max-h-80 {
|
|
1980
1980
|
max-height: calc(var(--spacing) * 80);
|
|
1981
1981
|
}
|
|
1982
1982
|
|
|
1983
|
+
.max-h-\[95vh\] {
|
|
1984
|
+
max-height: 95vh;
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1983
1987
|
.max-h-\[300px\] {
|
|
1984
1988
|
max-height: 300px;
|
|
1985
1989
|
}
|
|
@@ -2004,6 +2008,10 @@ select:-webkit-autofill:active {
|
|
|
2004
2008
|
min-height: calc(var(--spacing) * 16);
|
|
2005
2009
|
}
|
|
2006
2010
|
|
|
2011
|
+
.min-h-32 {
|
|
2012
|
+
min-height: calc(var(--spacing) * 32);
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2007
2015
|
.min-h-72 {
|
|
2008
2016
|
min-height: calc(var(--spacing) * 72);
|
|
2009
2017
|
}
|
|
@@ -2666,6 +2674,10 @@ select:-webkit-autofill:active {
|
|
|
2666
2674
|
justify-content: flex-start;
|
|
2667
2675
|
}
|
|
2668
2676
|
|
|
2677
|
+
.gap-0 {
|
|
2678
|
+
gap: calc(var(--spacing) * 0);
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2669
2681
|
.gap-0\.5 {
|
|
2670
2682
|
gap: calc(var(--spacing) * .5);
|
|
2671
2683
|
}
|
|
@@ -2855,6 +2867,10 @@ select:-webkit-autofill:active {
|
|
|
2855
2867
|
overscroll-behavior: auto;
|
|
2856
2868
|
}
|
|
2857
2869
|
|
|
2870
|
+
.overscroll-contain {
|
|
2871
|
+
overscroll-behavior: contain;
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2858
2874
|
.rounded {
|
|
2859
2875
|
border-radius: .25rem;
|
|
2860
2876
|
}
|
|
@@ -3446,7 +3462,17 @@ select:-webkit-autofill:active {
|
|
|
3446
3462
|
background-color: #0000;
|
|
3447
3463
|
}
|
|
3448
3464
|
|
|
3449
|
-
.bg-warning, .bg-warning\/
|
|
3465
|
+
.bg-warning, .bg-warning\/10 {
|
|
3466
|
+
background-color: var(--warning);
|
|
3467
|
+
}
|
|
3468
|
+
|
|
3469
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3470
|
+
.bg-warning\/10 {
|
|
3471
|
+
background-color: color-mix(in oklab, var(--warning) 10%, transparent);
|
|
3472
|
+
}
|
|
3473
|
+
}
|
|
3474
|
+
|
|
3475
|
+
.bg-warning\/15 {
|
|
3450
3476
|
background-color: var(--warning);
|
|
3451
3477
|
}
|
|
3452
3478
|
|
|
@@ -3662,6 +3688,10 @@ select:-webkit-autofill:active {
|
|
|
3662
3688
|
padding-top: calc(var(--spacing) * 4);
|
|
3663
3689
|
}
|
|
3664
3690
|
|
|
3691
|
+
.pt-6 {
|
|
3692
|
+
padding-top: calc(var(--spacing) * 6);
|
|
3693
|
+
}
|
|
3694
|
+
|
|
3665
3695
|
.pt-16 {
|
|
3666
3696
|
padding-top: calc(var(--spacing) * 16);
|
|
3667
3697
|
}
|
|
@@ -3706,6 +3736,10 @@ select:-webkit-autofill:active {
|
|
|
3706
3736
|
padding-bottom: calc(var(--spacing) * 4);
|
|
3707
3737
|
}
|
|
3708
3738
|
|
|
3739
|
+
.pb-6 {
|
|
3740
|
+
padding-bottom: calc(var(--spacing) * 6);
|
|
3741
|
+
}
|
|
3742
|
+
|
|
3709
3743
|
.pl-2 {
|
|
3710
3744
|
padding-left: calc(var(--spacing) * 2);
|
|
3711
3745
|
}
|
|
@@ -4366,6 +4400,10 @@ select:-webkit-autofill:active {
|
|
|
4366
4400
|
-moz-appearance: textfield;
|
|
4367
4401
|
}
|
|
4368
4402
|
|
|
4403
|
+
.\[scrollbar-gutter\:stable\] {
|
|
4404
|
+
scrollbar-gutter: stable;
|
|
4405
|
+
}
|
|
4406
|
+
|
|
4369
4407
|
.\[text-decoration\:underline_line-through\] {
|
|
4370
4408
|
text-decoration: underline line-through;
|
|
4371
4409
|
}
|