@dxos/react-ui 0.8.2-main.f11618f → 0.8.2-main.fbd8ed0
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/lib/browser/index.mjs +838 -305
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +956 -421
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +838 -305
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +2 -2
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +0 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts +10 -44
- package/dist/types/src/components/Buttons/Button.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts +4 -5
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts +7 -6
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +1 -4
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +2 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +2 -2
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +2 -2
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts +2 -2
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +2 -2
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts +1 -1
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +33 -159
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Lists/TreeDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts +1 -1
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/useSwipeToDismiss.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +2 -2
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +13 -5
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts +5 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.stories.d.ts +2 -2
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +94 -20
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +41 -17
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useElevationContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useIconHref.d.ts.map +1 -1
- package/dist/types/src/hooks/useSafeCollisionPadding.d.ts.map +1 -1
- package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts +8 -0
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/withVariants.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -13
- package/src/components/Avatars/Avatar.stories.tsx +27 -27
- package/src/components/Avatars/AvatarGroup.stories.tsx +4 -5
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +2 -2
- package/src/components/Buttons/Button.stories.tsx +19 -14
- package/src/components/Buttons/IconButton.stories.tsx +9 -10
- package/src/components/Buttons/IconButton.tsx +8 -33
- package/src/components/Buttons/Toggle.stories.tsx +2 -2
- package/src/components/Buttons/ToggleGroup.stories.tsx +3 -7
- package/src/components/Clipboard/CopyButton.tsx +22 -24
- package/src/components/Dialogs/AlertDialog.stories.tsx +4 -11
- package/src/components/Dialogs/Dialog.stories.tsx +3 -3
- package/src/components/Dialogs/Dialog.tsx +7 -4
- package/src/components/Input/Input.stories.tsx +67 -56
- package/src/components/Input/Input.tsx +1 -0
- package/src/components/Lists/Tree.stories.tsx +2 -2
- package/src/components/Lists/Treegrid.stories.tsx +12 -12
- package/src/components/Main/Main.stories.tsx +2 -2
- package/src/components/Menus/ContextMenu.stories.tsx +2 -2
- package/src/components/Menus/DropdownMenu.stories.tsx +2 -2
- package/src/components/Message/Message.stories.tsx +3 -3
- package/src/components/Popover/Popover.stories.tsx +2 -2
- package/src/components/Popover/Popover.tsx +5 -4
- package/src/components/ScrollArea/ScrollArea.stories.tsx +2 -2
- package/src/components/ScrollArea/ScrollArea.tsx +3 -0
- package/src/components/Toast/Toast.stories.tsx +15 -10
- package/src/components/Toolbar/Toolbar.stories.tsx +2 -2
- package/src/components/Tooltip/Tooltip.stories.tsx +43 -18
- package/src/components/Tooltip/Tooltip.tsx +748 -58
- package/src/playground/Controls.stories.tsx +2 -2
- package/src/playground/Custom.stories.tsx +137 -0
- package/src/playground/Typography.stories.tsx +2 -2
|
@@ -5,10 +5,10 @@ type ActionTriggerProps = {
|
|
|
5
5
|
trigger: ReactNode;
|
|
6
6
|
};
|
|
7
7
|
type StorybookToastProps = Partial<{
|
|
8
|
-
openTrigger: string;
|
|
9
8
|
title: string;
|
|
10
9
|
description: string;
|
|
11
10
|
actionTriggers: ActionTriggerProps[];
|
|
11
|
+
openTrigger: string;
|
|
12
12
|
closeTrigger: ReactNode;
|
|
13
13
|
}>;
|
|
14
14
|
declare const _default: {
|
|
@@ -32,7 +32,7 @@ declare const _default: {
|
|
|
32
32
|
Action: React.FunctionComponent<import("@radix-ui/react-toast").ToastActionProps>;
|
|
33
33
|
Close: React.FunctionComponent<import("@radix-ui/react-toast").ToastCloseProps>;
|
|
34
34
|
};
|
|
35
|
-
render: (
|
|
35
|
+
render: ({ title, description, actionTriggers, openTrigger, closeTrigger }: StorybookToastProps) => React.JSX.Element;
|
|
36
36
|
decorators: import("@storybook/react").Decorator[];
|
|
37
37
|
parameters: {
|
|
38
38
|
chromatic: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toast/Toast.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAMxD,KAAK,kBAAkB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,CAAC;AAElE,KAAK,mBAAmB,GAAG,OAAO,CAAC;IACjC,
|
|
1
|
+
{"version":3,"file":"Toast.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toast/Toast.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAMxD,KAAK,kBAAkB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,CAAC;AAElE,KAAK,mBAAmB,GAAG,OAAO,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,kBAAkB,EAAE,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,SAAS,CAAC;CACzB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;gFAEsF,mBAAmB;;;;;;;;AAwB5G,wBAME;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;CAgBnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Toolbar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,KAAK,qBAAqB,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Toolbar.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Toolbar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,KAAK,qBAAqB,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAEH,qBAAqB;;;;;;;;AAuDlD,wBAME;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC"}
|
|
@@ -1,23 +1,97 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
type
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import type { Scope } from '@radix-ui/react-context';
|
|
2
|
+
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
|
3
|
+
import * as PopperPrimitive from '@radix-ui/react-popper';
|
|
4
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
5
|
+
import { type TooltipProps } from '@radix-ui/react-tooltip';
|
|
6
|
+
import React, { type ComponentPropsWithoutRef, type ElementRef, type SyntheticEvent, type MutableRefObject, type ReactNode } from 'react';
|
|
7
|
+
type TooltipScopedProps<P = {}> = P & {
|
|
8
|
+
__scopeTooltip?: Scope;
|
|
9
|
+
};
|
|
10
|
+
declare const createTooltipScope: import("@radix-ui/react-context").CreateScope;
|
|
11
|
+
type TooltipContextValue = {
|
|
12
|
+
contentId: string;
|
|
13
|
+
open: boolean;
|
|
14
|
+
stateAttribute: 'closed' | 'delayed-open' | 'instant-open';
|
|
15
|
+
trigger: TooltipTriggerElement | null;
|
|
16
|
+
onTriggerChange(trigger: TooltipTriggerElement | null): void;
|
|
17
|
+
onTriggerEnter(): void;
|
|
18
|
+
onTriggerLeave(): void;
|
|
19
|
+
onOpen(): void;
|
|
20
|
+
onClose(): void;
|
|
21
|
+
onPointerInTransitChange(inTransit: boolean): void;
|
|
22
|
+
isPointerInTransitRef: MutableRefObject<boolean>;
|
|
23
|
+
disableHoverableContent: boolean;
|
|
24
|
+
};
|
|
25
|
+
declare const useTooltipContext: (consumerName: string, scope: Scope<TooltipContextValue | undefined>) => TooltipContextValue;
|
|
26
|
+
interface TooltipProviderProps {
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
open?: boolean;
|
|
29
|
+
defaultOpen?: boolean;
|
|
30
|
+
onOpenChange?: (open: boolean) => void;
|
|
31
|
+
/**
|
|
32
|
+
* The duration from when the pointer enters the trigger until the tooltip gets opened. This will
|
|
33
|
+
* override the prop with the same name passed to Provider.
|
|
34
|
+
* @defaultValue 700
|
|
35
|
+
*/
|
|
36
|
+
delayDuration?: number;
|
|
37
|
+
/**
|
|
38
|
+
* When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
|
|
39
|
+
* @defaultValue false
|
|
40
|
+
*/
|
|
41
|
+
disableHoverableContent?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* How much time a user has to enter another trigger without incurring a delay again.
|
|
44
|
+
* @defaultValue 300
|
|
45
|
+
*/
|
|
46
|
+
skipDelayDuration?: number;
|
|
47
|
+
}
|
|
48
|
+
type TooltipTriggerElement = ElementRef<typeof Primitive.button>;
|
|
49
|
+
type PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
50
|
+
type TooltipTriggerProps = PrimitiveButtonProps & Pick<TooltipProps, 'delayDuration'> & {
|
|
51
|
+
content?: string;
|
|
52
|
+
side?: TooltipSide;
|
|
53
|
+
suppressNextTooltip?: MutableRefObject<boolean>;
|
|
54
|
+
onInteract?: (event: SyntheticEvent) => void;
|
|
55
|
+
};
|
|
56
|
+
interface TooltipContentProps extends TooltipContentImplProps {
|
|
57
|
+
/**
|
|
58
|
+
* Used to force mounting when more control is needed. Useful when
|
|
59
|
+
* controlling animation with React animation libraries.
|
|
60
|
+
*/
|
|
61
|
+
forceMount?: true;
|
|
62
|
+
}
|
|
63
|
+
type DismissableLayerProps = ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
64
|
+
type PopperContentProps = ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
65
|
+
interface TooltipContentImplProps extends Omit<PopperContentProps, 'onPlaced'> {
|
|
66
|
+
/**
|
|
67
|
+
* A more descriptive label for accessibility purpose
|
|
68
|
+
*/
|
|
69
|
+
'aria-label'?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Event handler called when the escape key is down.
|
|
72
|
+
* Can be prevented.
|
|
73
|
+
*/
|
|
74
|
+
onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];
|
|
75
|
+
/**
|
|
76
|
+
* Event handler called when the a `pointerdown` event happens outside of the `Tooltip`.
|
|
77
|
+
* Can be prevented.
|
|
78
|
+
*/
|
|
79
|
+
onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];
|
|
80
|
+
}
|
|
81
|
+
type TooltipSide = NonNullable<TooltipContentProps['side']>;
|
|
10
82
|
export declare const Tooltip: {
|
|
11
|
-
Provider: React.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
83
|
+
Provider: React.FC<TooltipProviderProps>;
|
|
84
|
+
Trigger: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
85
|
+
ref?: ((instance: HTMLButtonElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
86
|
+
} & {
|
|
87
|
+
asChild?: boolean;
|
|
88
|
+
}, "ref"> & Pick<TooltipProps, "delayDuration"> & {
|
|
89
|
+
content?: string;
|
|
90
|
+
side?: TooltipSide;
|
|
91
|
+
suppressNextTooltip?: MutableRefObject<boolean>;
|
|
92
|
+
onInteract?: (event: SyntheticEvent) => void;
|
|
93
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
21
94
|
};
|
|
22
|
-
export
|
|
95
|
+
export { createTooltipScope, useTooltipContext };
|
|
96
|
+
export type { TooltipProviderProps, TooltipTriggerProps, TooltipScopedProps, TooltipSide };
|
|
23
97
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
type
|
|
4
|
-
|
|
3
|
+
type StoryProps = {
|
|
4
|
+
tooltips: {
|
|
5
|
+
label: string;
|
|
6
|
+
content: string;
|
|
7
|
+
}[];
|
|
5
8
|
defaultOpen?: boolean;
|
|
6
9
|
};
|
|
7
10
|
declare const _default: {
|
|
8
11
|
title: string;
|
|
9
12
|
component: {
|
|
10
|
-
Provider: React.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
Provider: React.FC<import("./Tooltip").TooltipProviderProps>;
|
|
14
|
+
Trigger: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
15
|
+
ref?: ((instance: HTMLButtonElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
asChild?: boolean;
|
|
18
|
+
}, "ref"> & Pick<import("@radix-ui/react-tooltip").TooltipProps, "delayDuration"> & {
|
|
19
|
+
content?: string;
|
|
20
|
+
side?: import("./Tooltip").TooltipSide;
|
|
21
|
+
suppressNextTooltip?: React.MutableRefObject<boolean>;
|
|
22
|
+
onInteract?: (event: React.SyntheticEvent) => void;
|
|
23
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
};
|
|
25
|
+
render: ({ tooltips, defaultOpen }: StoryProps) => React.JSX.Element;
|
|
22
26
|
decorators: import("@storybook/react").Decorator[];
|
|
23
27
|
parameters: {
|
|
24
28
|
chromatic: {
|
|
@@ -29,7 +33,10 @@ declare const _default: {
|
|
|
29
33
|
export default _default;
|
|
30
34
|
export declare const Default: {
|
|
31
35
|
args: {
|
|
32
|
-
|
|
36
|
+
tooltips: {
|
|
37
|
+
label: string;
|
|
38
|
+
content: string;
|
|
39
|
+
}[];
|
|
33
40
|
};
|
|
34
41
|
parameters: {
|
|
35
42
|
chromatic: {
|
|
@@ -37,10 +44,13 @@ export declare const Default: {
|
|
|
37
44
|
};
|
|
38
45
|
};
|
|
39
46
|
};
|
|
40
|
-
export declare const
|
|
47
|
+
export declare const DefaultOpen: {
|
|
41
48
|
args: {
|
|
42
49
|
defaultOption: boolean;
|
|
43
|
-
|
|
50
|
+
tooltips: {
|
|
51
|
+
label: string;
|
|
52
|
+
content: string;
|
|
53
|
+
}[];
|
|
44
54
|
};
|
|
45
55
|
parameters: {
|
|
46
56
|
chromatic: {
|
|
@@ -48,4 +58,18 @@ export declare const Testing: {
|
|
|
48
58
|
};
|
|
49
59
|
};
|
|
50
60
|
};
|
|
61
|
+
export declare const StressTest: {
|
|
62
|
+
args: {
|
|
63
|
+
defaultOption: boolean;
|
|
64
|
+
tooltips: {
|
|
65
|
+
label: string;
|
|
66
|
+
content: string;
|
|
67
|
+
}[];
|
|
68
|
+
};
|
|
69
|
+
parameters: {
|
|
70
|
+
chromatic: {
|
|
71
|
+
disableSnapshot: boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
51
75
|
//# sourceMappingURL=Tooltip.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AACrB,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,KAAK,UAAU,GAAG;IAChB,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;;;;;;;;;;;;;;;;wCAE+C,UAAU;;;;;;;;AAY3D,wBAME;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;CAYnB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;CAavB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;CActB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDensityContext.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDensityContext.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAIpD,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"useDensityContext.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDensityContext.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAIpD,eAAO,MAAM,iBAAiB,GAAI,eAAe,OAAO,wBAGvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useElevationContext.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useElevationContext.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"useElevationContext.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useElevationContext.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,eAAO,MAAM,mBAAmB,GAAI,iBAAiB,SAAS,0BAG7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIconHref.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useIconHref.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"useIconHref.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useIconHref.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,uBAIxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSafeCollisionPadding.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSafeCollisionPadding.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAMnE,KAAK,WAAW,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;AAiB3D,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"useSafeCollisionPadding.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSafeCollisionPadding.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAMnE,KAAK,WAAW,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;AAiB3D,eAAO,MAAM,uBAAuB,GAAI,mBAAmB,WAAW;;;;;CAWrE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVisualViewport.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useVisualViewport.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAI9D,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"useVisualViewport.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useVisualViewport.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAI9D,eAAO,MAAM,iBAAiB,GAAI,OAAO,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;;;CAcvE,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare const Default: {};
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
6
5
|
render: () => React.JSX.Element;
|
|
@@ -12,4 +11,5 @@ declare const _default: {
|
|
|
12
11
|
};
|
|
13
12
|
};
|
|
14
13
|
export default _default;
|
|
14
|
+
export declare const Default: {};
|
|
15
15
|
//# sourceMappingURL=Controls.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Controls.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Controls.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAmB,MAAM,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"Controls.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Controls.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAmB,MAAM,OAAO,CAAC;;;;;;;;;;;AA4ExC,wBAKE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import '@dxos-theme';
|
|
2
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
3
|
+
import { Button } from '../components';
|
|
4
|
+
declare const meta: Meta<typeof Button>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof meta>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
//# sourceMappingURL=Custom.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Custom.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Custom.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG5D,OAAO,EAAE,MAAM,EAAyC,MAAM,eAAe,CAAC;AAiH9E,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAM7B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withVariants.d.ts","sourceRoot":"","sources":["../../../../../src/testing/decorators/withVariants.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAIpE,KAAK,MAAM,GAAG;IACZ,UAAU,CAAC,EAAE;QAAE,SAAS,EAAE,SAAS,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1D,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"withVariants.d.ts","sourceRoot":"","sources":["../../../../../src/testing/decorators/withVariants.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAIpE,KAAK,MAAM,GAAG;IACZ,UAAU,CAAC,EAAE;QAAE,SAAS,EAAE,SAAS,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1D,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,6BAO1B,MAAW,KAAG,SAkBhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui",
|
|
3
|
-
"version": "0.8.2-main.
|
|
3
|
+
"version": "0.8.2-main.fbd8ed0",
|
|
4
4
|
"description": "Low-level React components for DXOS, applying a theme to a core group of primitives",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -56,20 +56,21 @@
|
|
|
56
56
|
"@radix-ui/react-toolbar": "1.1.2",
|
|
57
57
|
"@radix-ui/react-tooltip": "1.1.8",
|
|
58
58
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
59
|
+
"@radix-ui/react-visually-hidden": "1.1.2",
|
|
59
60
|
"aria-hidden": "^1.2.4",
|
|
60
61
|
"date-fns": "^3.3.1",
|
|
61
62
|
"i18next": "^21.10.0",
|
|
62
63
|
"keyborg": "^2.5.0",
|
|
63
64
|
"react-i18next": "^11.18.6",
|
|
64
65
|
"react-remove-scroll": "^2.6.0",
|
|
65
|
-
"@dxos/debug": "0.8.2-main.
|
|
66
|
-
"@dxos/lit-ui": "0.8.2-main.
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/react-
|
|
70
|
-
"@dxos/react-
|
|
71
|
-
"@dxos/react-ui-types": "0.8.2-main.
|
|
72
|
-
"@dxos/util": "0.8.2-main.
|
|
66
|
+
"@dxos/debug": "0.8.2-main.fbd8ed0",
|
|
67
|
+
"@dxos/lit-ui": "0.8.2-main.fbd8ed0",
|
|
68
|
+
"@dxos/react-hooks": "0.8.2-main.fbd8ed0",
|
|
69
|
+
"@dxos/log": "0.8.2-main.fbd8ed0",
|
|
70
|
+
"@dxos/react-list": "0.8.2-main.fbd8ed0",
|
|
71
|
+
"@dxos/react-input": "0.8.2-main.fbd8ed0",
|
|
72
|
+
"@dxos/react-ui-types": "0.8.2-main.fbd8ed0",
|
|
73
|
+
"@dxos/util": "0.8.2-main.fbd8ed0"
|
|
73
74
|
},
|
|
74
75
|
"devDependencies": {
|
|
75
76
|
"@dnd-kit/core": "^6.0.5",
|
|
@@ -81,15 +82,15 @@
|
|
|
81
82
|
"react": "~18.2.0",
|
|
82
83
|
"react-dom": "~18.2.0",
|
|
83
84
|
"vite": "5.4.7",
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/util": "0.8.2-main.
|
|
85
|
+
"@dxos/react-ui-theme": "0.8.2-main.fbd8ed0",
|
|
86
|
+
"@dxos/random": "0.8.2-main.fbd8ed0",
|
|
87
|
+
"@dxos/util": "0.8.2-main.fbd8ed0"
|
|
87
88
|
},
|
|
88
89
|
"peerDependencies": {
|
|
89
90
|
"@phosphor-icons/react": "^2.1.5",
|
|
90
91
|
"react": "~18.2.0",
|
|
91
92
|
"react-dom": "~18.2.0",
|
|
92
|
-
"@dxos/react-ui-theme": "0.8.2-main.
|
|
93
|
+
"@dxos/react-ui-theme": "0.8.2-main.fbd8ed0"
|
|
93
94
|
},
|
|
94
95
|
"publishConfig": {
|
|
95
96
|
"access": "public"
|
|
@@ -12,7 +12,7 @@ import { hexToFallback } from '@dxos/util';
|
|
|
12
12
|
import { Avatar, type AvatarVariant, type AvatarStatus, type AvatarAnimation } from './Avatar';
|
|
13
13
|
import { withTheme } from '../../testing';
|
|
14
14
|
|
|
15
|
-
type
|
|
15
|
+
type StoryProps = {
|
|
16
16
|
id?: string;
|
|
17
17
|
imgSrc?: string;
|
|
18
18
|
fallbackText?: string;
|
|
@@ -25,7 +25,7 @@ type StorybookAvatarProps = {
|
|
|
25
25
|
hue?: HuePalette;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const DefaultStory = (props: PropsWithChildren<StoryProps>) => {
|
|
29
29
|
const {
|
|
30
30
|
id = '20970b563fc49b5bb194a6ffdff376031a3a11f9481360c071c3fed87874106b',
|
|
31
31
|
status,
|
|
@@ -58,7 +58,7 @@ const StorybookAvatar = (props: PropsWithChildren<StorybookAvatarProps>) => {
|
|
|
58
58
|
export default {
|
|
59
59
|
title: 'ui/react-ui-core/Avatar',
|
|
60
60
|
component: Avatar,
|
|
61
|
-
render:
|
|
61
|
+
render: DefaultStory,
|
|
62
62
|
decorators: [withTheme],
|
|
63
63
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
64
64
|
};
|
|
@@ -68,9 +68,9 @@ const sampleImage =
|
|
|
68
68
|
|
|
69
69
|
const row = (size: Size) => (
|
|
70
70
|
<>
|
|
71
|
-
<
|
|
72
|
-
<
|
|
73
|
-
<
|
|
71
|
+
<DefaultStory size={size} status='inactive' description='Offline' />
|
|
72
|
+
<DefaultStory size={size} status='active' />
|
|
73
|
+
<DefaultStory size={size} status='active' imgSrc={sampleImage} />
|
|
74
74
|
</>
|
|
75
75
|
);
|
|
76
76
|
|
|
@@ -93,48 +93,48 @@ export const Default = () => (
|
|
|
93
93
|
|
|
94
94
|
export const Image = () => (
|
|
95
95
|
<div>
|
|
96
|
-
<
|
|
96
|
+
<DefaultStory variant='circle' imgSrc={sampleImage} />
|
|
97
97
|
</div>
|
|
98
98
|
);
|
|
99
99
|
|
|
100
100
|
export const Square = () => (
|
|
101
101
|
<div className='flex flex-row gap-4'>
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
<
|
|
102
|
+
<DefaultStory variant='square' status='inactive' description='Offline' />
|
|
103
|
+
<DefaultStory variant='square' status='active' />
|
|
104
|
+
<DefaultStory variant='square' status='error' />
|
|
105
|
+
<DefaultStory variant='square' status='warning' />
|
|
106
106
|
</div>
|
|
107
107
|
);
|
|
108
108
|
|
|
109
109
|
export const DefaultEmoji = () => (
|
|
110
110
|
<div className='flex flex-row gap-4'>
|
|
111
|
-
<
|
|
112
|
-
<
|
|
113
|
-
<
|
|
114
|
-
<
|
|
111
|
+
<DefaultStory fallbackText='🦄' status='active' animation='pulse' />
|
|
112
|
+
<DefaultStory fallbackText='🐒' status='warning' animation='pulse' />
|
|
113
|
+
<DefaultStory fallbackText='🪲' status='inactive' />
|
|
114
|
+
<DefaultStory fallbackText='🦁' />
|
|
115
115
|
</div>
|
|
116
116
|
);
|
|
117
117
|
|
|
118
|
-
export const SquareEmoji = () => <
|
|
118
|
+
export const SquareEmoji = () => <DefaultStory variant='square' fallbackText='🦄' />;
|
|
119
119
|
|
|
120
120
|
export const DefaultText = () => (
|
|
121
121
|
<div className='flex flex-row gap-4'>
|
|
122
|
-
<
|
|
123
|
-
<
|
|
124
|
-
<
|
|
125
|
-
<
|
|
126
|
-
<
|
|
127
|
-
<
|
|
122
|
+
<DefaultStory fallbackText='PT' />
|
|
123
|
+
<DefaultStory fallbackText='AP' />
|
|
124
|
+
<DefaultStory fallbackText='Z' />
|
|
125
|
+
<DefaultStory fallbackText='pt' />
|
|
126
|
+
<DefaultStory fallbackText='ap' />
|
|
127
|
+
<DefaultStory fallbackText='z' />
|
|
128
128
|
</div>
|
|
129
129
|
);
|
|
130
130
|
|
|
131
|
-
export const Error = () => <
|
|
131
|
+
export const Error = () => <DefaultStory status='error' description='Errored' />;
|
|
132
132
|
|
|
133
133
|
export const Pulse = () => (
|
|
134
134
|
<div className='flex flex-row gap-4'>
|
|
135
|
-
<
|
|
136
|
-
<
|
|
137
|
-
<
|
|
138
|
-
<
|
|
135
|
+
<DefaultStory description='Online' status='active' animation='pulse' />
|
|
136
|
+
<DefaultStory description='Offline' status='inactive' animation='pulse' />
|
|
137
|
+
<DefaultStory description='Error' status='error' animation='pulse' />
|
|
138
|
+
<DefaultStory description='Warning' status='warning' animation='pulse' />
|
|
139
139
|
</div>
|
|
140
140
|
);
|
|
@@ -13,7 +13,7 @@ import { withTheme } from '../../testing';
|
|
|
13
13
|
|
|
14
14
|
const hues = ['lime', 'teal', 'purple', 'pink'];
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const AvatarItem = ({ n }: { n: number }) => {
|
|
17
17
|
const emoji = toEmoji(n);
|
|
18
18
|
return (
|
|
19
19
|
<Avatar.Root>
|
|
@@ -22,12 +22,12 @@ const StorybookAvatarGroupItem = ({ n }: { n: number }) => {
|
|
|
22
22
|
);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const DefaultStory = () => {
|
|
26
26
|
const labelId = useId('sb-avatar-group');
|
|
27
27
|
return (
|
|
28
28
|
<div className='dx-avatar-group' aria-labelledby={labelId}>
|
|
29
29
|
{[0, 1, 2, 3].map((n) => (
|
|
30
|
-
<
|
|
30
|
+
<AvatarItem key={n} n={n} />
|
|
31
31
|
))}
|
|
32
32
|
<span className='sr-only' id={labelId}>
|
|
33
33
|
23
|
|
@@ -38,8 +38,7 @@ const StorybookAvatarGroup = () => {
|
|
|
38
38
|
|
|
39
39
|
export default {
|
|
40
40
|
title: 'ui/react-ui-core/AvatarGroup',
|
|
41
|
-
|
|
42
|
-
render: StorybookAvatarGroup,
|
|
41
|
+
render: DefaultStory,
|
|
43
42
|
decorators: [withTheme],
|
|
44
43
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
45
44
|
};
|
|
@@ -10,7 +10,7 @@ import { Breadcrumb } from './Breadcrumb';
|
|
|
10
10
|
import { withTheme } from '../../testing';
|
|
11
11
|
import { Button } from '../Buttons';
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const DefaultStory = () => {
|
|
14
14
|
return (
|
|
15
15
|
<Breadcrumb.Root aria-label='Breadcrumb'>
|
|
16
16
|
<Breadcrumb.List>
|
|
@@ -41,7 +41,7 @@ const StorybookBreadcrumb = () => {
|
|
|
41
41
|
export default {
|
|
42
42
|
title: 'ui/react-ui-core/Breadcrumb',
|
|
43
43
|
component: Breadcrumb,
|
|
44
|
-
render:
|
|
44
|
+
render: DefaultStory,
|
|
45
45
|
decorators: [withTheme],
|
|
46
46
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
47
47
|
};
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
7
|
import { CaretLeft, CaretRight } from '@phosphor-icons/react';
|
|
8
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
9
|
import React from 'react';
|
|
9
10
|
|
|
10
11
|
import { Button, ButtonGroup, type ButtonProps } from './Button';
|
|
@@ -31,32 +32,36 @@ const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
|
31
32
|
);
|
|
32
33
|
};
|
|
33
34
|
|
|
34
|
-
const
|
|
35
|
+
const meta: Meta<typeof Button> = {
|
|
36
|
+
title: 'ui/react-ui-core/Button',
|
|
37
|
+
component: Button,
|
|
38
|
+
render: DefaultStory,
|
|
39
|
+
decorators: [withVariants(), withTheme],
|
|
40
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default meta;
|
|
44
|
+
|
|
45
|
+
type Story = StoryObj<typeof meta>;
|
|
35
46
|
|
|
36
|
-
|
|
47
|
+
const defaults: Story['args'] = { children: 'Test' };
|
|
48
|
+
|
|
49
|
+
export const Default: Story = {
|
|
37
50
|
args: { ...defaults, variant: 'default' },
|
|
38
51
|
};
|
|
39
52
|
|
|
40
|
-
export const Primary = {
|
|
53
|
+
export const Primary: Story = {
|
|
41
54
|
args: { ...defaults, variant: 'primary' },
|
|
42
55
|
};
|
|
43
56
|
|
|
44
|
-
export const Destructive = {
|
|
57
|
+
export const Destructive: Story = {
|
|
45
58
|
args: { ...defaults, variant: 'destructive' },
|
|
46
59
|
};
|
|
47
60
|
|
|
48
|
-
export const Outline = {
|
|
61
|
+
export const Outline: Story = {
|
|
49
62
|
args: { ...defaults, variant: 'outline' },
|
|
50
63
|
};
|
|
51
64
|
|
|
52
|
-
export const Ghost = {
|
|
65
|
+
export const Ghost: Story = {
|
|
53
66
|
args: { ...defaults, variant: 'ghost' },
|
|
54
67
|
};
|
|
55
|
-
|
|
56
|
-
export default {
|
|
57
|
-
title: 'ui/react-ui-core/Button',
|
|
58
|
-
component: Button,
|
|
59
|
-
decorators: [withVariants(), withTheme],
|
|
60
|
-
render: DefaultStory,
|
|
61
|
-
parameters: { chromatic: { disableSnapshot: false } },
|
|
62
|
-
};
|