@jerry-fd/ui 0.6.2 → 0.6.4

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/index.d.ts CHANGED
@@ -5,10 +5,11 @@ import * as tailwind_variants from 'tailwind-variants';
5
5
  import { VariantProps } from 'tailwind-variants';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
  import { Command as Command$1 } from 'cmdk';
8
- import { Tabs as Tabs$1, Popover as Popover$1, Switch as Switch$1, DropdownMenu as DropdownMenu$2, Collapsible as Collapsible$1, Tooltip as Tooltip$1, ScrollArea as ScrollArea$1, HoverCard as HoverCard$1 } from 'radix-ui';
8
+ import { Tabs as Tabs$1, Popover as Popover$1, Switch as Switch$1, AlertDialog as AlertDialog$1, DropdownMenu as DropdownMenu$2, Collapsible as Collapsible$1, Tooltip as Tooltip$1, ScrollArea as ScrollArea$1, HoverCard as HoverCard$1 } from 'radix-ui';
9
+ import { OTPInputProps } from 'input-otp';
9
10
  import { DialogProps } from 'vaul';
10
- import { B as ButtonSharedProps } from './button-DMIeJ1gB.js';
11
- export { a as Button, b as baseButtonStyle, c as buttonVariants } from './button-DMIeJ1gB.js';
11
+ import { B as ButtonProps, a as Button, b as ButtonSharedProps } from './button-DxZ9iyob.js';
12
+ export { c as baseButtonStyle, d as buttonVariants } from './button-DxZ9iyob.js';
12
13
  import { I as IconType } from './icon-BmaneZ4I.js';
13
14
  import * as tailwind_merge from 'tailwind-merge';
14
15
  import { Variants, Transition } from 'motion/react';
@@ -923,28 +924,114 @@ declare function Switch({ className, size, disabled, loading, onChange, ...props
923
924
  onChange?: RootProps['onCheckedChange'];
924
925
  }): react_jsx_runtime.JSX.Element;
925
926
 
926
- type DrawerProps = Omit<DialogProps, 'onOpenChange'> & {
927
- className?: string;
928
- footerClassName?: string;
929
- headerClassName?: string;
930
- bodyClassName?: string;
931
- title?: React__default.ReactNode;
932
- description?: React__default.ReactNode;
933
- footer?: React__default.ReactNode;
934
- trigger?: React__default.ReactNode;
935
- loading?: boolean;
936
- skeletonItemCount?: number;
937
- width?: string | number;
938
- style?: React__default.CSSProperties;
939
- onOpenChange?: (open: boolean) => void;
940
- onClose?: () => void;
941
- onOk?: () => void | Promise<void>;
927
+ declare const inputOTPVariants: tailwind_variants.TVReturnType<{
928
+ variant: {
929
+ filled: {
930
+ slot: string;
931
+ };
932
+ stroke: {
933
+ slot: string;
934
+ };
935
+ };
936
+ size: {
937
+ xsmall: {
938
+ group: string;
939
+ slot: string;
940
+ };
941
+ small: {
942
+ group: string;
943
+ slot: string;
944
+ };
945
+ medium: {
946
+ group: string;
947
+ slot: string;
948
+ };
949
+ large: {
950
+ group: string;
951
+ slot: string;
952
+ };
953
+ };
954
+ }, {
955
+ group: string;
956
+ slot: string[];
957
+ }, undefined, {
958
+ variant: {
959
+ filled: {
960
+ slot: string;
961
+ };
962
+ stroke: {
963
+ slot: string;
964
+ };
965
+ };
966
+ size: {
967
+ xsmall: {
968
+ group: string;
969
+ slot: string;
970
+ };
971
+ small: {
972
+ group: string;
973
+ slot: string;
974
+ };
975
+ medium: {
976
+ group: string;
977
+ slot: string;
978
+ };
979
+ large: {
980
+ group: string;
981
+ slot: string;
982
+ };
983
+ };
984
+ }, {
985
+ group: string;
986
+ slot: string[];
987
+ }, tailwind_variants.TVReturnType<{
988
+ variant: {
989
+ filled: {
990
+ slot: string;
991
+ };
992
+ stroke: {
993
+ slot: string;
994
+ };
995
+ };
996
+ size: {
997
+ xsmall: {
998
+ group: string;
999
+ slot: string;
1000
+ };
1001
+ small: {
1002
+ group: string;
1003
+ slot: string;
1004
+ };
1005
+ medium: {
1006
+ group: string;
1007
+ slot: string;
1008
+ };
1009
+ large: {
1010
+ group: string;
1011
+ slot: string;
1012
+ };
1013
+ };
1014
+ }, {
1015
+ group: string;
1016
+ slot: string[];
1017
+ }, undefined, unknown, unknown, undefined>>;
1018
+ type InputOTPContextValue = VariantProps<typeof inputOTPVariants> & {
1019
+ 'aria-invalid'?: React$1.AriaAttributes['aria-invalid'];
942
1020
  };
943
- declare function Drawer({ direction, dismissible, skeletonItemCount, className, footerClassName, bodyClassName, headerClassName, title, description, footer, trigger, container, children, open: openProp, onOpenChange: onOpenChangeProp, loading, handleOnly, style, width, onClose, onOk, ...rootProps }: DrawerProps): react_jsx_runtime.JSX.Element;
944
-
945
- type InternalDrawerProps = 'open' | 'onOpenChange' | 'trigger' | 'children';
946
- type UseDrawerOptions = Omit<DrawerProps, InternalDrawerProps>;
947
- declare function useDrawer<TData = unknown>(options?: UseDrawerOptions): readonly [DrawerProps, TData | null, (record: TData) => void, () => void];
1021
+ type OTPInputChildrenProps = Extract<OTPInputProps, {
1022
+ render?: never;
1023
+ }>;
1024
+ type InputOTPHandle = {
1025
+ readonly input: HTMLInputElement | null;
1026
+ focus: () => void;
1027
+ blur: () => void;
1028
+ shake: () => Promise<void>;
1029
+ };
1030
+ type InputOTPProps = Omit<OTPInputChildrenProps, 'size' | 'containerClassName' | 'children' | 'ref'> & InputOTPContextValue & {
1031
+ classNames?: Partial<Record<'input' | 'group' | 'container', string>>;
1032
+ ref?: React$1.Ref<InputOTPHandle>;
1033
+ };
1034
+ declare function InputOTP({ maxLength, size, variant, className, classNames, ref, pattern, 'aria-invalid': ariaInvalid, ...props }: InputOTPProps): react_jsx_runtime.JSX.Element;
948
1035
 
949
1036
  declare const fancyButtonVariants: tailwind_variants.TVReturnType<{
950
1037
  variant: {
@@ -1205,6 +1292,122 @@ declare const FancyButtonRoot: React$1.ForwardRefExoticComponent<VariantProps<ta
1205
1292
  endContent?: React$1.ReactNode;
1206
1293
  } & React$1.RefAttributes<HTMLButtonElement>>;
1207
1294
 
1295
+ type DrawerClassNames = {
1296
+ header?: string;
1297
+ body?: string;
1298
+ footer?: string;
1299
+ };
1300
+ type DrawerProps = Omit<DialogProps, 'onOpenChange' | 'container'> & {
1301
+ className?: string;
1302
+ classNames?: DrawerClassNames;
1303
+ title?: React__default.ReactNode;
1304
+ description?: React__default.ReactNode;
1305
+ footer?: React__default.ReactNode;
1306
+ trigger?: React__default.ReactNode;
1307
+ loading?: boolean;
1308
+ /** 是否显示右上角关闭按钮 */
1309
+ closeable?: boolean;
1310
+ /** 启用内容动画 */
1311
+ animation?: boolean;
1312
+ /** loading 时显示的骨架屏 */
1313
+ skeleton?: React__default.ReactNode;
1314
+ width?: string | number;
1315
+ /** Drawer 与容器边缘的间距,默认 8px */
1316
+ gutter?: number | string;
1317
+ style?: React__default.CSSProperties;
1318
+ /** Drawer 锚点容器 */
1319
+ anchorContainer?: HTMLElement | null;
1320
+ okButtonProps?: ButtonProps;
1321
+ closeButtonProps?: ButtonProps;
1322
+ onOpenChange?: (open: boolean) => void;
1323
+ onClose?: () => void;
1324
+ onOk?: () => unknown | void | Promise<unknown | void>;
1325
+ };
1326
+ declare function Drawer({ direction, dismissible, closeable, skeleton, className, classNames, title, description, footer, trigger, anchorContainer, children, open: openProp, onOpenChange: onOpenChangeProp, loading, handleOnly, style, width, gutter, okButtonProps, closeButtonProps, animation, onClose, onOk, ...rootProps }: DrawerProps): react_jsx_runtime.JSX.Element;
1327
+
1328
+ type InternalDrawerProps = 'open' | 'defaultOpen' | 'loading' | 'onOpenChange' | 'trigger' | 'children';
1329
+ type DrawerOptionsWithOpenHandle<TData = unknown, TResult = unknown> = DrawerSharedOptions<TData, TResult> & {
1330
+ loading?: never;
1331
+ /** Drawer 打开时的回调,signal 可用于取消异步操作 */
1332
+ onOpen: (data?: TData, signal?: AbortSignal) => TResult | Promise<TResult>;
1333
+ };
1334
+ type DrawerOptionsWithoutOpenHandle<TData = unknown, TResult = unknown> = DrawerSharedOptions<TData, TResult> & {
1335
+ loading?: boolean;
1336
+ onOpen?: never;
1337
+ };
1338
+ type DrawerSharedOptions<TData = unknown, TResult = unknown> = Omit<DrawerProps, InternalDrawerProps> & {
1339
+ onOpenChange?: (open: boolean) => void;
1340
+ /** 关闭时是否销毁 payload,默认 true */
1341
+ destroyPayloadOnClose?: boolean;
1342
+ /** 动态计算 Drawer 标题,优先级高于 title */
1343
+ getTitle?: (loading: boolean, data: {
1344
+ payload?: TData;
1345
+ result?: TResult;
1346
+ }) => DrawerProps['title'];
1347
+ };
1348
+ type UseDrawerOptions<TData = unknown, TResult = unknown> = DrawerOptionsWithOpenHandle<TData, TResult> | DrawerOptionsWithoutOpenHandle<TData, TResult>;
1349
+ declare function useDrawer<TData = unknown, TResult = unknown>(options?: UseDrawerOptions<TData, TResult>): readonly [DrawerProps, {
1350
+ payload: TData | undefined;
1351
+ result: TResult | undefined;
1352
+ }, (record?: TData) => Promise<void>, () => void];
1353
+
1354
+ declare const DIALOG_MEDIA_PRESET: {
1355
+ info: react_jsx_runtime.JSX.Element;
1356
+ form: react_jsx_runtime.JSX.Element;
1357
+ otp: react_jsx_runtime.JSX.Element;
1358
+ warning: react_jsx_runtime.JSX.Element;
1359
+ destructive: react_jsx_runtime.JSX.Element;
1360
+ };
1361
+ type AlertDialogIntent = keyof typeof DIALOG_MEDIA_PRESET;
1362
+ type AlertDialogIcon = React$1.ReactElement | false;
1363
+
1364
+ type AlertDialogContentMotion = 'scale-fade' | 'slide-fade';
1365
+ type AlertDialogRootProps = React$1.ComponentProps<typeof AlertDialog$1.Root> & {
1366
+ overlayBlur?: boolean;
1367
+ contentMotion?: AlertDialogContentMotion;
1368
+ dismissible?: boolean;
1369
+ disableClose?: boolean;
1370
+ };
1371
+ type AlertDialogContentProps = React$1.ComponentProps<typeof AlertDialog$1.Content> & {
1372
+ wrapperClassName?: string;
1373
+ };
1374
+
1375
+ type AlertDialogActionErrorFeedback = {
1376
+ status: 'error';
1377
+ message?: React$1.ReactNode;
1378
+ };
1379
+ type AlertDialogActionSuccessFeedback = {
1380
+ status: 'success';
1381
+ message?: React$1.ReactNode;
1382
+ closeDelay?: number;
1383
+ };
1384
+ type AlertDialogActionFeedback = AlertDialogActionSuccessFeedback | AlertDialogActionErrorFeedback;
1385
+
1386
+ type AlertDialogActionResponse = AlertDialogActionFeedback;
1387
+ type AlertDialogActionResult = void | AlertDialogActionResponse;
1388
+ type AlertDialogActionConfig = {
1389
+ text?: React$1.ReactNode;
1390
+ buttonProps?: Omit<React$1.ComponentProps<typeof Button>, 'children' | 'loading'>;
1391
+ onClick?: () => AlertDialogActionResult | Promise<AlertDialogActionResult>;
1392
+ };
1393
+ type AlertDialogProps = AlertDialogRootProps & {
1394
+ onOpenAutoFocus?: AlertDialogContentProps['onOpenAutoFocus'];
1395
+ title?: React$1.ReactNode;
1396
+ description?: React$1.ReactNode;
1397
+ /** dialog 场景意图,决定默认视觉和 footer 行为 */
1398
+ intent?: AlertDialogIntent;
1399
+ /** 自定义顶部图标;传 false 可关闭 intent 对应的默认图标 */
1400
+ icon?: AlertDialogIcon;
1401
+ trigger?: React$1.ReactNode;
1402
+ children?: React$1.ReactNode;
1403
+ footer?: React$1.ReactNode | null;
1404
+ action?: AlertDialogActionConfig;
1405
+ cancel?: false | AlertDialogActionConfig;
1406
+ className?: string;
1407
+ classNames?: Partial<Record<'wrapper' | 'header' | 'body' | 'footer' | 'title' | 'description', string>>;
1408
+ };
1409
+ declare function AlertDialog({ open, defaultOpen, onOpenChange, overlayBlur, contentMotion, dismissible, disableClose: disableCloseProp, intent, icon, title, description, footer, action, cancel, className, classNames, onOpenAutoFocus, trigger: dialogTrigger, children, ...rootProps }: AlertDialogProps): react_jsx_runtime.JSX.Element;
1410
+
1208
1411
  type CopyableTextProps = Omit<ButtonSharedProps, 'loading'> & {
1209
1412
  className?: string;
1210
1413
  content: string;
@@ -1459,14 +1662,14 @@ declare const dropdownMenuStyles: {
1459
1662
  } & {};
1460
1663
  type DropdownMenuVariants = VariantProps<typeof menu>;
1461
1664
 
1462
- declare function Skeleton({ className, ...props }: React__default.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
1463
-
1464
1665
  type OwnProps = {
1465
1666
  stroke?: number | string;
1466
1667
  className?: string;
1467
1668
  };
1468
1669
  declare function Spinner({ stroke, className }: OwnProps): react_jsx_runtime.JSX.Element;
1469
1670
 
1671
+ declare function Skeleton({ className, ...props }: React__default.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
1672
+
1470
1673
  declare const colorPanelVariants: tailwind_variants.TVReturnType<{
1471
1674
  variant: {
1472
1675
  filled: string;
@@ -1497,7 +1700,7 @@ declare const colorPanelVariants: tailwind_variants.TVReturnType<{
1497
1700
  pink: string;
1498
1701
  rose: string;
1499
1702
  };
1500
- }, undefined, "flex shrink-0 items-center justify-center rounded-2xl ring-1 ring-transparent ring-inset", {
1703
+ }, undefined, "flex shrink-0 items-center justify-center rounded-2xl ring-1 ring-transparent", {
1501
1704
  variant: {
1502
1705
  filled: string;
1503
1706
  lighter: string;
@@ -1557,12 +1760,13 @@ declare const colorPanelVariants: tailwind_variants.TVReturnType<{
1557
1760
  pink: string;
1558
1761
  rose: string;
1559
1762
  };
1560
- }, undefined, "flex shrink-0 items-center justify-center rounded-2xl ring-1 ring-transparent ring-inset", unknown, unknown, undefined>>;
1763
+ }, undefined, "flex shrink-0 items-center justify-center rounded-2xl ring-1 ring-transparent", unknown, unknown, undefined>>;
1561
1764
  type SharedProps = VariantProps<typeof colorPanelVariants>;
1562
- type ColorPanelProps = React__default.ComponentProps<'div'> & SharedProps & {
1765
+ type ColorPanelProps = React__default.ComponentProps<'div'> & Omit<SharedProps, 'ring'> & {
1563
1766
  asChild?: boolean;
1767
+ ring?: true | 'inset';
1564
1768
  };
1565
- declare function ColorPanel({ asChild, children, className, color, variant, ring, ...props }: ColorPanelProps): react_jsx_runtime.JSX.Element;
1769
+ declare function ColorPanel({ asChild, children, className, color, variant, ring: ringProp, ...props }: ColorPanelProps): react_jsx_runtime.JSX.Element;
1566
1770
 
1567
1771
  declare function Collapsible({ ...props }: React__default.ComponentProps<typeof Collapsible$1.Root>): react_jsx_runtime.JSX.Element;
1568
1772
  declare function CollapsibleTrigger({ ...props }: React__default.ComponentProps<typeof Collapsible$1.CollapsibleTrigger>): react_jsx_runtime.JSX.Element;
@@ -2005,4 +2209,4 @@ declare const useFlag: (initial?: boolean) => [boolean, NoneToVoidFunction, None
2005
2209
 
2006
2210
  declare const useToggle: (initial?: boolean) => [boolean, NoneToVoidFunction];
2007
2211
 
2008
- export { AnimationCard, type AnimationCardProps, type AnimationName$1 as AnimationName, index as Avatar, Badge, type BadgeProps, ButtonSharedProps, card as Card, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorPanel, command as Command, CopyableText, type CopyableTextProps, type DebouncedFunction, Drawer, type DrawerProps, DropdownMenu, type DropdownMenuItemProps, type DropdownMenuProps, type DropdownMenuVariants, FancyButtonRoot as FancyButton, HoverCard, type MenuPropBase, PopConfirm, type PopConfirmProps, popover as Popover, PopoverPreset, type PopoverPresetProps, type Scheduler, ScrollArea, Skeleton, Spinner, StateSwitcher, Swap, Switch, tabs as Tabs, type ThrottledFunction, Tooltip, TooltipArrow, TooltipProvider, TooltipRoot, TooltipTrigger, UIMorphingModal, type UIMorphingModalContentAnimationState, type UIMorphingModalProps, UIProvider, UIScreen, type UIScreenControls, type UIScreenNavigateFn, type UIScreenNavigateOptions, type UIScreenProps, type UIScreenValue, type UIScreenViewProps, UIViewTransition, type UIViewTransitionProps, type UseDrawerOptions, cn, compact, debounce, dropdownMenuStyles, fancyButtonVariants, findOption, formatCurrency, formatIntegerCompact, formatNumber, getFirstLetters, mergeRefs, omit, pick, throttle, tooltipVariants, tv, twMergeConfig, unique, useDisableContentMenu, useDrawer, useFlag, useForceUpdate, usePrevious, useToggle, useUIScreen };
2212
+ export { AlertDialog, type AlertDialogActionConfig, type AlertDialogActionErrorFeedback, type AlertDialogActionResponse, type AlertDialogActionResult, type AlertDialogActionSuccessFeedback, type AlertDialogContentMotion, type AlertDialogIcon, type AlertDialogIntent, type AlertDialogProps, type AlertDialogRootProps, AnimationCard, type AnimationCardProps, type AnimationName$1 as AnimationName, index as Avatar, Badge, type BadgeProps, Button, ButtonProps, ButtonSharedProps, card as Card, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorPanel, command as Command, CopyableText, type CopyableTextProps, type DebouncedFunction, Drawer, type DrawerProps, DropdownMenu, type DropdownMenuItemProps, type DropdownMenuProps, type DropdownMenuVariants, FancyButtonRoot as FancyButton, HoverCard, InputOTP, type InputOTPHandle, type InputOTPProps, type MenuPropBase, PopConfirm, type PopConfirmProps, popover as Popover, PopoverPreset, type PopoverPresetProps, type Scheduler, ScrollArea, Skeleton, Spinner, StateSwitcher, Swap, Switch, tabs as Tabs, type ThrottledFunction, Tooltip, TooltipArrow, TooltipProvider, TooltipRoot, TooltipTrigger, UIMorphingModal, type UIMorphingModalContentAnimationState, type UIMorphingModalProps, UIProvider, UIScreen, type UIScreenControls, type UIScreenNavigateFn, type UIScreenNavigateOptions, type UIScreenProps, type UIScreenValue, type UIScreenViewProps, UIViewTransition, type UIViewTransitionProps, type UseDrawerOptions, cn, compact, debounce, dropdownMenuStyles, fancyButtonVariants, findOption, formatCurrency, formatIntegerCompact, formatNumber, getFirstLetters, mergeRefs, omit, pick, throttle, tooltipVariants, tv, twMergeConfig, unique, useDisableContentMenu, useDrawer, useFlag, useForceUpdate, usePrevious, useToggle, useUIScreen };