@dxos/react-ui 0.8.4-main.e8ec1fe → 0.8.4-main.ef1bc66f44
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/chunk-EJYV4HAH.mjs +774 -0
- package/dist/lib/browser/chunk-EJYV4HAH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3197 -66
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +34 -45
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/chunk-YTLZCZ2M.mjs +776 -0
- package/dist/lib/node-esm/chunk-YTLZCZ2M.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3197 -66
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +34 -45
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/components/AnchoredOverflow/AnchoredOverflow.d.ts +7 -0
- package/dist/types/src/components/AnchoredOverflow/AnchoredOverflow.d.ts.map +1 -1
- package/dist/types/src/components/Button/Button.d.ts +1 -1
- package/dist/types/src/components/Button/Button.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.d.ts +2 -1
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Button/ToggleGroup.d.ts +4 -4
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts +4 -4
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.d.ts +24 -9
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts +7 -5
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts +5 -2
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +2 -2
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/List.d.ts +1 -1
- package/dist/types/src/components/List/List.d.ts.map +1 -1
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts +8 -9
- 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/{Menus → Menu}/ContextMenu.d.ts +6 -6
- package/dist/types/src/components/Menu/ContextMenu.d.ts.map +1 -0
- package/dist/types/src/components/Menu/ContextMenu.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Menus → Menu}/DropdownMenu.d.ts +3 -4
- package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -0
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts.map +1 -0
- package/dist/types/src/components/Menu/index.d.ts.map +1 -0
- package/dist/types/src/components/Message/Message.d.ts +1 -1
- package/dist/types/src/components/Message/Message.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +25 -26
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +46 -8
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +4 -2
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +2 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.d.ts +9 -9
- package/dist/types/src/components/Separator/Separator.d.ts +1 -1
- package/dist/types/src/components/Skeleton/Skeleton.d.ts +12 -0
- package/dist/types/src/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/types/src/components/Skeleton/Skeleton.stories.d.ts +17 -0
- package/dist/types/src/components/Skeleton/Skeleton.stories.d.ts.map +1 -0
- package/dist/types/src/components/Skeleton/index.d.ts +2 -0
- package/dist/types/src/components/Skeleton/index.d.ts.map +1 -0
- package/dist/types/src/components/Splitter/Splitter.d.ts +26 -0
- package/dist/types/src/components/Splitter/Splitter.d.ts.map +1 -0
- package/dist/types/src/components/Splitter/Splitter.stories.d.ts +7 -0
- package/dist/types/src/components/Splitter/Splitter.stories.d.ts.map +1 -0
- package/dist/types/src/components/Splitter/index.d.ts +2 -0
- package/dist/types/src/components/Splitter/index.d.ts.map +1 -0
- package/dist/types/src/components/Tag/Tag.d.ts +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +2 -2
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +1 -8
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts +2 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +4 -4
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +13 -12
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/exemplars/generics.stories.d.ts +17 -0
- package/dist/types/src/exemplars/generics.stories.d.ts.map +1 -0
- package/dist/types/src/exemplars/slot.stories.d.ts +14 -0
- package/dist/types/src/exemplars/slot.stories.d.ts.map +1 -0
- package/dist/types/src/exemplars/tabster.stories.d.ts +8 -0
- package/dist/types/src/exemplars/tabster.stories.d.ts.map +1 -0
- package/dist/types/src/hooks/useDensityContext.d.ts +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useElevationContext.d.ts +1 -1
- package/dist/types/src/hooks/useElevationContext.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Container/Container.d.ts +23 -0
- package/dist/types/src/primitives/Container/Container.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/Container.stories.d.ts +11 -0
- package/dist/types/src/primitives/Container/Container.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/Layout.d.ts +18 -0
- package/dist/types/src/primitives/Container/Layout.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/Layout.stories.d.ts +10 -0
- package/dist/types/src/primitives/Container/Layout.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/index.d.ts +3 -0
- package/dist/types/src/primitives/Container/index.d.ts.map +1 -0
- package/dist/types/src/primitives/Flex/Flex.d.ts +8 -0
- package/dist/types/src/primitives/Flex/Flex.d.ts.map +1 -0
- package/dist/types/src/primitives/Flex/index.d.ts +2 -0
- package/dist/types/src/primitives/Flex/index.d.ts.map +1 -0
- package/dist/types/src/primitives/index.d.ts +3 -0
- package/dist/types/src/primitives/index.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/withLayout.d.ts +3 -3
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts +1 -1
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withTheme.d.ts +3 -2
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -2
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -32
- package/src/components/AnchoredOverflow/AnchoredOverflow.tsx +8 -0
- package/src/components/Avatars/Avatar.stories.tsx +4 -4
- package/src/components/Avatars/Avatar.tsx +1 -1
- package/src/components/Avatars/AvatarGroup.stories.tsx +2 -2
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +2 -2
- package/src/components/Button/Button.stories.tsx +2 -2
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Button/IconButton.stories.tsx +2 -2
- package/src/components/Button/IconButton.tsx +8 -3
- package/src/components/Button/Toggle.stories.tsx +2 -2
- package/src/components/Button/ToggleGroup.stories.tsx +2 -2
- package/src/components/Clipboard/CopyButton.tsx +3 -3
- package/src/components/DensityProvider/DensityProvider.tsx +1 -1
- package/src/components/Dialog/AlertDialog.stories.tsx +2 -2
- package/src/components/Dialog/Dialog.stories.tsx +57 -23
- package/src/components/Dialog/Dialog.tsx +181 -40
- package/src/components/ElevationProvider/ElevationProvider.tsx +1 -1
- package/src/components/Icon/Icon.stories.tsx +3 -3
- package/src/components/Icon/Icon.tsx +1 -1
- package/src/components/Input/Input.stories.tsx +12 -11
- package/src/components/Input/Input.tsx +13 -5
- package/src/components/Link/Link.stories.tsx +2 -2
- package/src/components/List/List.stories.tsx +18 -14
- package/src/components/List/List.tsx +1 -1
- package/src/components/List/Tree.stories.tsx +2 -2
- package/src/components/List/Treegrid.stories.tsx +2 -2
- package/src/components/List/Treegrid.tsx +1 -1
- package/src/components/Main/Main.stories.tsx +41 -20
- package/src/components/Main/Main.tsx +92 -45
- package/src/components/{Menus → Menu}/ContextMenu.stories.tsx +2 -2
- package/src/components/{Menus → Menu}/DropdownMenu.stories.tsx +2 -2
- package/src/components/{Menus → Menu}/DropdownMenu.tsx +61 -57
- package/src/components/Message/Message.stories.tsx +3 -3
- package/src/components/Message/Message.tsx +30 -5
- package/src/components/Popover/Popover.stories.tsx +2 -2
- package/src/components/Popover/Popover.tsx +35 -33
- package/src/components/ScrollArea/ScrollArea.stories.tsx +166 -40
- package/src/components/ScrollArea/ScrollArea.tsx +86 -80
- package/src/components/ScrollArea/index.ts +1 -1
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +3 -2
- package/src/components/ScrollContainer/ScrollContainer.tsx +99 -92
- package/src/components/Select/Select.stories.tsx +2 -2
- package/src/components/Skeleton/Skeleton.stories.tsx +52 -0
- package/src/components/Skeleton/Skeleton.tsx +26 -0
- package/src/components/Skeleton/index.ts +5 -0
- package/src/components/Splitter/Splitter.stories.tsx +73 -0
- package/src/components/Splitter/Splitter.tsx +123 -0
- package/src/components/Splitter/index.ts +5 -0
- package/src/components/Status/Status.stories.tsx +2 -2
- package/src/components/Tag/Tag.stories.tsx +4 -4
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/ThemeProvider/ThemeProvider.tsx +2 -3
- package/src/components/ThemeProvider/TranslationsProvider.tsx +1 -16
- package/src/components/ThemeProvider/index.ts +3 -3
- package/src/components/Toast/Toast.stories.tsx +2 -2
- package/src/components/Toolbar/Toolbar.stories.tsx +2 -2
- package/src/components/Toolbar/Toolbar.tsx +31 -12
- package/src/components/Tooltip/Tooltip.stories.tsx +2 -2
- package/src/components/Tooltip/Tooltip.tsx +22 -20
- package/src/components/index.ts +3 -1
- package/src/exemplars/generics.stories.tsx +44 -0
- package/src/exemplars/slot.stories.tsx +108 -0
- package/src/exemplars/tabster.stories.tsx +127 -0
- package/src/hooks/useDensityContext.ts +1 -1
- package/src/hooks/useElevationContext.ts +1 -1
- package/src/index.ts +2 -1
- package/src/playground/Controls.stories.tsx +3 -4
- package/src/playground/Custom.stories.tsx +2 -2
- package/src/playground/Typography.stories.tsx +2 -2
- package/src/primitives/Container/Container.stories.tsx +67 -0
- package/src/primitives/Container/Container.tsx +82 -0
- package/src/primitives/Container/Layout.stories.tsx +57 -0
- package/src/primitives/Container/Layout.tsx +61 -0
- package/src/primitives/Container/index.ts +6 -0
- package/src/primitives/Flex/Flex.tsx +26 -0
- package/src/primitives/Flex/index.ts +5 -0
- package/src/primitives/index.ts +6 -0
- package/src/testing/decorators/withLayout.tsx +22 -15
- package/src/testing/decorators/withLayoutVariants.tsx +3 -3
- package/src/testing/decorators/withTheme.tsx +21 -18
- package/src/util/index.ts +2 -2
- package/dist/lib/browser/chunk-53MI2QCM.mjs +0 -4707
- package/dist/lib/browser/chunk-53MI2QCM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ID67AFFF.mjs +0 -4709
- package/dist/lib/node-esm/chunk-ID67AFFF.mjs.map +0 -7
- package/dist/types/src/components/Menus/ContextMenu.d.ts.map +0 -1
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts.map +0 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +0 -1
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts.map +0 -1
- package/dist/types/src/components/Menus/index.d.ts.map +0 -1
- package/dist/types/src/util/ThemedClassName.d.ts +0 -5
- package/dist/types/src/util/ThemedClassName.d.ts.map +0 -1
- package/dist/types/src/util/domino.d.ts +0 -18
- package/dist/types/src/util/domino.d.ts.map +0 -1
- package/src/util/ThemedClassName.ts +0 -7
- package/src/util/domino.ts +0 -53
- /package/dist/types/src/components/{Menus → Menu}/ContextMenu.stories.d.ts +0 -0
- /package/dist/types/src/components/{Menus → Menu}/DropdownMenu.stories.d.ts +0 -0
- /package/dist/types/src/components/{Menus → Menu}/index.d.ts +0 -0
- /package/src/components/{Menus → Menu}/ContextMenu.tsx +0 -0
- /package/src/components/{Menus → Menu}/index.ts +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Locale, enUS as dtLocaleEnUs } from 'date-fns/locale';
|
|
6
|
-
import i18Next, { type Resource
|
|
6
|
+
import i18Next, { type Resource } from 'i18next';
|
|
7
7
|
import React, { type ReactNode, Suspense, createContext, useContext, useEffect, useState } from 'react';
|
|
8
8
|
import { initReactI18next, useTranslation as useI18NextTranslation } from 'react-i18next';
|
|
9
9
|
|
|
@@ -11,21 +11,6 @@ const initialLng = 'en-US';
|
|
|
11
11
|
const initialNs = 'dxos-common';
|
|
12
12
|
const initialDtLocale = dtLocaleEnUs;
|
|
13
13
|
|
|
14
|
-
// TODO(thure): `Parameters<TFunction>` causes typechecking issues because `TFunction` has so many signatures.
|
|
15
|
-
export type Label = string | [string, { ns: string; count?: number; defaultValue?: string }];
|
|
16
|
-
|
|
17
|
-
export const isLabel = (o: any): o is Label =>
|
|
18
|
-
typeof o === 'string' ||
|
|
19
|
-
(Array.isArray(o) &&
|
|
20
|
-
o.length === 2 &&
|
|
21
|
-
typeof o[0] === 'string' &&
|
|
22
|
-
!!o[1] &&
|
|
23
|
-
typeof o[1] === 'object' &&
|
|
24
|
-
'ns' in o[1] &&
|
|
25
|
-
typeof o[1].ns === 'string');
|
|
26
|
-
|
|
27
|
-
export const toLocalizedString = (label: Label, t: TFunction) => (Array.isArray(label) ? t(...label) : label);
|
|
28
|
-
|
|
29
14
|
export const resources = {
|
|
30
15
|
[initialLng]: {
|
|
31
16
|
[initialNs]: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
export { type Label, isLabel, toLocalizedString, useTranslation } from './TranslationsProvider';
|
|
5
|
+
export { type Label, isLabel, toLocalizedString } from '@dxos/ui-types';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
export * from './ThemeProvider';
|
|
8
|
+
export { useTranslation } from './TranslationsProvider';
|
|
@@ -45,10 +45,10 @@ const DefaultStory = ({ title, description, actionTriggers, openTrigger, closeTr
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
const meta = {
|
|
48
|
-
title: 'ui/react-ui-core/Toast',
|
|
48
|
+
title: 'ui/react-ui-core/components/Toast',
|
|
49
49
|
component: Toast as any,
|
|
50
50
|
render: DefaultStory,
|
|
51
|
-
decorators: [withTheme],
|
|
51
|
+
decorators: [withTheme()],
|
|
52
52
|
} satisfies Meta<typeof DefaultStory>;
|
|
53
53
|
|
|
54
54
|
export default meta;
|
|
@@ -69,10 +69,10 @@ const DefaultStory = (props: StorybookToolbarProps) => {
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
const meta = {
|
|
72
|
-
title: 'ui/react-ui-core/Toolbar',
|
|
72
|
+
title: 'ui/react-ui-core/components/Toolbar',
|
|
73
73
|
component: Toolbar as any,
|
|
74
74
|
render: DefaultStory,
|
|
75
|
-
decorators: [withTheme],
|
|
75
|
+
decorators: [withTheme()],
|
|
76
76
|
} satisfies Meta<typeof DefaultStory>;
|
|
77
77
|
|
|
78
78
|
export default meta;
|
|
@@ -6,6 +6,8 @@ import type { ToggleGroupItemProps as ToggleGroupItemPrimitiveProps } from '@rad
|
|
|
6
6
|
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
|
|
7
7
|
import React, { Fragment, forwardRef } from 'react';
|
|
8
8
|
|
|
9
|
+
import { type ToolbarStyleProps } from '@dxos/ui-theme';
|
|
10
|
+
|
|
9
11
|
import { useThemeContext } from '../../hooks';
|
|
10
12
|
import { type ThemedClassName } from '../../util';
|
|
11
13
|
import {
|
|
@@ -23,26 +25,32 @@ import { Link, type LinkProps } from '../Link';
|
|
|
23
25
|
import { Separator, type SeparatorProps } from '../Separator';
|
|
24
26
|
|
|
25
27
|
type ToolbarRootProps = ThemedClassName<
|
|
26
|
-
ToolbarPrimitive.ToolbarProps &
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
28
|
+
ToolbarPrimitive.ToolbarProps &
|
|
29
|
+
ToolbarStyleProps & {
|
|
30
|
+
textBlockWidth?: boolean;
|
|
31
|
+
}
|
|
31
32
|
>;
|
|
32
33
|
|
|
34
|
+
// TODO(burdon): Implement asChild property.
|
|
33
35
|
const ToolbarRoot = forwardRef<HTMLDivElement, ToolbarRootProps>(
|
|
34
|
-
(
|
|
36
|
+
(
|
|
37
|
+
{ classNames, children, density, disabled, layoutManaged, textBlockWidth: textBlockWidthProp, ...props },
|
|
38
|
+
forwardedRef,
|
|
39
|
+
) => {
|
|
35
40
|
const { tx } = useThemeContext();
|
|
36
|
-
const InnerRoot =
|
|
37
|
-
const innerRootProps =
|
|
38
|
-
? {
|
|
41
|
+
const InnerRoot = textBlockWidthProp ? 'div' : Fragment;
|
|
42
|
+
const innerRootProps = textBlockWidthProp
|
|
43
|
+
? {
|
|
44
|
+
role: 'none',
|
|
45
|
+
className: tx('toolbar.inner', 'toolbar', { layoutManaged }, classNames),
|
|
46
|
+
}
|
|
39
47
|
: {};
|
|
40
48
|
|
|
41
49
|
return (
|
|
42
50
|
<ToolbarPrimitive.Root
|
|
43
51
|
{...props}
|
|
44
52
|
data-arrow-keys={props.orientation === 'vertical' ? 'up down' : 'left right'}
|
|
45
|
-
className={tx('toolbar.root', 'toolbar', {
|
|
53
|
+
className={tx('toolbar.root', 'toolbar', { density, disabled, layoutManaged }, classNames)}
|
|
46
54
|
ref={forwardedRef}
|
|
47
55
|
>
|
|
48
56
|
<InnerRoot {...innerRootProps}>{children}</InnerRoot>
|
|
@@ -66,7 +74,7 @@ type ToolbarIconButtonProps = IconButtonProps;
|
|
|
66
74
|
const ToolbarIconButton = forwardRef<HTMLButtonElement, ToolbarIconButtonProps>((props, forwardedRef) => {
|
|
67
75
|
return (
|
|
68
76
|
<ToolbarPrimitive.Button asChild>
|
|
69
|
-
<IconButton {...props} ref={forwardedRef} />
|
|
77
|
+
<IconButton {...props} noTooltip ref={forwardedRef} />
|
|
70
78
|
</ToolbarPrimitive.Button>
|
|
71
79
|
);
|
|
72
80
|
});
|
|
@@ -125,7 +133,18 @@ const ToolbarToggleGroupIconItem = forwardRef<HTMLButtonElement, ToolbarToggleGr
|
|
|
125
133
|
({ variant, density, elevation, classNames, icon, label, iconOnly, ...props }, forwardedRef) => {
|
|
126
134
|
return (
|
|
127
135
|
<ToolbarPrimitive.ToolbarToggleItem {...props} asChild>
|
|
128
|
-
<IconButton
|
|
136
|
+
<IconButton
|
|
137
|
+
{...{
|
|
138
|
+
variant,
|
|
139
|
+
density,
|
|
140
|
+
elevation,
|
|
141
|
+
classNames,
|
|
142
|
+
icon,
|
|
143
|
+
label,
|
|
144
|
+
iconOnly,
|
|
145
|
+
}}
|
|
146
|
+
ref={forwardedRef}
|
|
147
|
+
/>
|
|
129
148
|
</ToolbarPrimitive.ToolbarToggleItem>
|
|
130
149
|
);
|
|
131
150
|
},
|
|
@@ -30,10 +30,10 @@ const DefaultStory = ({ tooltips, defaultOpen }: StoryProps) => (
|
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
const meta = {
|
|
33
|
-
title: 'ui/react-ui-core/Tooltip',
|
|
33
|
+
title: 'ui/react-ui-core/components/Tooltip',
|
|
34
34
|
component: Tooltip as any,
|
|
35
35
|
render: DefaultStory,
|
|
36
|
-
decorators: [withTheme],
|
|
36
|
+
decorators: [withTheme()],
|
|
37
37
|
} satisfies Meta<typeof DefaultStory>;
|
|
38
38
|
|
|
39
39
|
export default meta;
|
|
@@ -41,9 +41,9 @@ type TooltipScopedProps<P = {}> = P & { __scopeTooltip?: Scope };
|
|
|
41
41
|
const [createTooltipContext, createTooltipScope] = createContextScope('Tooltip', [createPopperScope]);
|
|
42
42
|
const usePopperScope = createPopperScope();
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
//
|
|
45
|
+
// Tooltip
|
|
46
|
+
//
|
|
47
47
|
|
|
48
48
|
const DEFAULT_DELAY_DURATION = 700;
|
|
49
49
|
const TOOLTIP_OPEN = 'tooltip.open';
|
|
@@ -228,9 +228,9 @@ const TooltipProvider: FC<TooltipProviderProps> = (props: TooltipScopedProps<Too
|
|
|
228
228
|
|
|
229
229
|
TooltipProvider.displayName = TOOLTIP_NAME;
|
|
230
230
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
//
|
|
232
|
+
// TooltipVirtualTrigger
|
|
233
|
+
//
|
|
234
234
|
|
|
235
235
|
const TooltipVirtualTrigger = ({
|
|
236
236
|
virtualRef,
|
|
@@ -240,9 +240,9 @@ const TooltipVirtualTrigger = ({
|
|
|
240
240
|
return <PopperPrimitive.Anchor asChild {...popperScope} virtualRef={virtualRef} />;
|
|
241
241
|
};
|
|
242
242
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
//
|
|
244
|
+
// TooltipTrigger
|
|
245
|
+
//
|
|
246
246
|
|
|
247
247
|
const TRIGGER_NAME = 'TooltipTrigger';
|
|
248
248
|
|
|
@@ -322,9 +322,9 @@ const TooltipTrigger = forwardRef<TooltipTriggerElement, TooltipTriggerProps>(
|
|
|
322
322
|
|
|
323
323
|
TooltipTrigger.displayName = TRIGGER_NAME;
|
|
324
324
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
325
|
+
//
|
|
326
|
+
// TooltipPortal
|
|
327
|
+
//
|
|
328
328
|
|
|
329
329
|
const PORTAL_NAME = 'TooltipPortal';
|
|
330
330
|
|
|
@@ -363,9 +363,9 @@ const TooltipPortal: FC<TooltipPortalProps> = (props: TooltipScopedProps<Tooltip
|
|
|
363
363
|
|
|
364
364
|
TooltipPortal.displayName = PORTAL_NAME;
|
|
365
365
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
366
|
+
//
|
|
367
|
+
// TooltipContent
|
|
368
|
+
//
|
|
369
369
|
|
|
370
370
|
const CONTENT_NAME = 'TooltipContent';
|
|
371
371
|
|
|
@@ -574,9 +574,9 @@ const TooltipContentImpl = forwardRef<TooltipContentImplElement, TooltipContentI
|
|
|
574
574
|
|
|
575
575
|
TooltipContent.displayName = CONTENT_NAME;
|
|
576
576
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
577
|
+
//
|
|
578
|
+
// TooltipArrow
|
|
579
|
+
//
|
|
580
580
|
|
|
581
581
|
const ARROW_NAME = 'TooltipArrow';
|
|
582
582
|
|
|
@@ -599,8 +599,6 @@ const TooltipArrow = forwardRef<TooltipArrowElement, TooltipArrowProps>(
|
|
|
599
599
|
|
|
600
600
|
TooltipArrow.displayName = ARROW_NAME;
|
|
601
601
|
|
|
602
|
-
/* ----------------------------------------------------------------------------------------------- */
|
|
603
|
-
|
|
604
602
|
type TooltipSide = NonNullable<TooltipContentProps['side']>;
|
|
605
603
|
|
|
606
604
|
const getExitSideFromRect = (point: Point, rect: DOMRect): TooltipSide => {
|
|
@@ -755,6 +753,10 @@ const getHullPresorted = <P extends Point>(points: Readonly<Array<P>>): Array<P>
|
|
|
755
753
|
}
|
|
756
754
|
};
|
|
757
755
|
|
|
756
|
+
//
|
|
757
|
+
// Tooltip
|
|
758
|
+
//
|
|
759
|
+
|
|
758
760
|
export const Tooltip = {
|
|
759
761
|
Provider: TooltipProvider,
|
|
760
762
|
Trigger: TooltipTrigger,
|
package/src/components/index.ts
CHANGED
|
@@ -13,7 +13,7 @@ export * from './Input';
|
|
|
13
13
|
export * from './Link';
|
|
14
14
|
export * from './List';
|
|
15
15
|
export * from './Main';
|
|
16
|
-
export * from './
|
|
16
|
+
export * from './Menu';
|
|
17
17
|
export * from './Message';
|
|
18
18
|
export * from './Popover';
|
|
19
19
|
export * from './Status';
|
|
@@ -21,6 +21,8 @@ export * from './ScrollArea';
|
|
|
21
21
|
export * from './ScrollContainer';
|
|
22
22
|
export * from './Select';
|
|
23
23
|
export * from './Separator';
|
|
24
|
+
export * from './Skeleton';
|
|
25
|
+
export * from './Splitter';
|
|
24
26
|
export * from './Tag';
|
|
25
27
|
export * from './Toast';
|
|
26
28
|
export * from './Toolbar';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { type ReactElement, type Ref, forwardRef } from 'react';
|
|
7
|
+
|
|
8
|
+
import { type SlottableProps } from '@dxos/ui-types';
|
|
9
|
+
|
|
10
|
+
import { withTheme } from '../testing';
|
|
11
|
+
|
|
12
|
+
const ComponentInner = forwardRef<HTMLDivElement, ComponentProps>(({ children, ...props }, forwardedRef) => {
|
|
13
|
+
return (
|
|
14
|
+
<div {...props} ref={forwardedRef}>
|
|
15
|
+
{children}
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
ComponentInner.displayName = 'Component';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Generic component pattern.
|
|
24
|
+
*/
|
|
25
|
+
type ComponentProps<P extends HTMLElement = any> = SlottableProps<P>;
|
|
26
|
+
|
|
27
|
+
const Component = ComponentInner as <P extends HTMLElement>(
|
|
28
|
+
props: SlottableProps<P> & { ref?: Ref<P> },
|
|
29
|
+
) => ReactElement;
|
|
30
|
+
|
|
31
|
+
const meta = {
|
|
32
|
+
title: 'ui/react-ui-core/exemplars/generics',
|
|
33
|
+
component: Component,
|
|
34
|
+
decorators: [withTheme()],
|
|
35
|
+
parameters: {
|
|
36
|
+
layout: 'centered',
|
|
37
|
+
},
|
|
38
|
+
} satisfies Meta;
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
41
|
+
|
|
42
|
+
type Story = StoryObj<typeof meta>;
|
|
43
|
+
|
|
44
|
+
export const Single: Story = {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
6
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
|
+
import React, { type PropsWithChildren, forwardRef } from 'react';
|
|
8
|
+
|
|
9
|
+
import { mx } from '@dxos/ui-theme';
|
|
10
|
+
import { type SlottableClassName, type SlottableProps, type ThemedClassName } from '@dxos/ui-types';
|
|
11
|
+
|
|
12
|
+
import { withTheme } from '../testing';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Composition
|
|
16
|
+
*
|
|
17
|
+
* All Radix primitive parts that render a DOM element accept an asChild prop.
|
|
18
|
+
* When asChild is set to true, Radix will not render a default DOM element, instead cloning the part's child and passing it the props and behavior required to make it functional.
|
|
19
|
+
* https://www.radix-ui.com/primitives/docs/guides/composition
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// Outer primitive (like Tooltip.Trigger or Focus.Group).
|
|
23
|
+
const Outer = forwardRef<HTMLDivElement, SlottableProps<HTMLDivElement>>(
|
|
24
|
+
({ children, className, classNames, asChild, ...props }, forwardedRef) => {
|
|
25
|
+
const Root = asChild ? Slot : 'div';
|
|
26
|
+
return (
|
|
27
|
+
<Root {...props} className={mx(className, classNames)} data-outer='true' ref={forwardedRef}>
|
|
28
|
+
{children}
|
|
29
|
+
</Root>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
// Middle primitive (like Dialog.Trigger or Mosaic.Cell).
|
|
35
|
+
const Middle = forwardRef<HTMLDivElement, SlottableProps<HTMLDivElement>>(
|
|
36
|
+
({ children, className, classNames, asChild, ...props }, forwardedRef) => {
|
|
37
|
+
const Root = asChild ? Slot : 'div';
|
|
38
|
+
return (
|
|
39
|
+
<Root {...props} className={mx(className, classNames)} data-middle='true' ref={forwardedRef}>
|
|
40
|
+
{children}
|
|
41
|
+
</Root>
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
// Leaf component (like Card.Root).
|
|
47
|
+
const Leaf = forwardRef<HTMLButtonElement, SlottableClassName<PropsWithChildren>>(
|
|
48
|
+
({ className, classNames, children, ...props }, forwardedRef) => {
|
|
49
|
+
return (
|
|
50
|
+
<button {...props} className={mx('p-2 outline-none border rounded', className, classNames)} ref={forwardedRef}>
|
|
51
|
+
{children}
|
|
52
|
+
</button>
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
// Test 1: Single asChild.
|
|
58
|
+
const TestSingle = ({ classNames, ...props }: ThemedClassName<{ role?: string }>) => (
|
|
59
|
+
<Outer asChild {...props} className={mx('p-2', classNames)}>
|
|
60
|
+
<Leaf>Single asChild</Leaf>
|
|
61
|
+
</Outer>
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
// Test 2: Nested asChild.
|
|
65
|
+
const TestNested = ({ classNames, ...props }: ThemedClassName<{ role?: string }>) => {
|
|
66
|
+
return (
|
|
67
|
+
<Outer asChild {...props} className={mx('p-2', classNames)}>
|
|
68
|
+
<Middle asChild>
|
|
69
|
+
<Leaf>Nested asChild</Leaf>
|
|
70
|
+
</Middle>
|
|
71
|
+
</Outer>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// Test 3: Complex.
|
|
76
|
+
const TestInner = ({ classNames, ...props }: ThemedClassName<{ role?: string }>) => (
|
|
77
|
+
<Outer asChild {...props} className={mx('p-2', classNames)}>
|
|
78
|
+
<Middle asChild>
|
|
79
|
+
<Leaf>
|
|
80
|
+
<div role='none'>Leaf</div>
|
|
81
|
+
</Leaf>
|
|
82
|
+
</Middle>
|
|
83
|
+
</Outer>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const meta = {
|
|
87
|
+
title: 'ui/react-ui-core/exemplars/slot',
|
|
88
|
+
decorators: [withTheme()],
|
|
89
|
+
parameters: {
|
|
90
|
+
layout: 'centered',
|
|
91
|
+
},
|
|
92
|
+
} satisfies Meta;
|
|
93
|
+
|
|
94
|
+
export default meta;
|
|
95
|
+
|
|
96
|
+
type Story = StoryObj<typeof meta>;
|
|
97
|
+
|
|
98
|
+
export const Single: Story = {
|
|
99
|
+
render: () => <TestSingle role='listitem' classNames='border-red-500' />,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const Nested: Story = {
|
|
103
|
+
render: () => <TestNested role='listitem' classNames='border-green-500' />,
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const Inner: Story = {
|
|
107
|
+
render: () => <TestInner role='listitem' classNames='border-blue-500' />,
|
|
108
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
useArrowNavigationGroup,
|
|
7
|
+
useFocusFinders,
|
|
8
|
+
useFocusableGroup,
|
|
9
|
+
useMergedTabsterAttributes_unstable,
|
|
10
|
+
} from '@fluentui/react-tabster';
|
|
11
|
+
import { type Decorator, type Meta, type StoryObj } from '@storybook/react-vite';
|
|
12
|
+
import React, { forwardRef, useEffect, useMemo, useRef } from 'react';
|
|
13
|
+
import { createTabster, disposeTabster } from 'tabster';
|
|
14
|
+
|
|
15
|
+
import { Input, ScrollArea } from '@dxos/react-ui';
|
|
16
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
17
|
+
import { mx } from '@dxos/ui-theme';
|
|
18
|
+
|
|
19
|
+
// TODO(burdon): Factor out styles (incl. tabster debugging).
|
|
20
|
+
// TODO(burdon): Implement horizontal movement between columns when column is selected.
|
|
21
|
+
// TODO(burdon): Prevent tab out of app.
|
|
22
|
+
|
|
23
|
+
const border =
|
|
24
|
+
'rounded-sm outline-none border border-subduedSeparator focus:border-primary-500 focus-within:border-rose-500';
|
|
25
|
+
|
|
26
|
+
const Board = forwardRef<HTMLDivElement, { columns: string[][] }>(({ columns }, ref) => {
|
|
27
|
+
const arrowNavigationAttrs = useArrowNavigationGroup({ axis: 'horizontal', memorizeCurrent: true, tabbable: true });
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div ref={ref} tabIndex={0} {...arrowNavigationAttrs} className='flex bs-full is-full overflow-hidden'>
|
|
31
|
+
<div className={mx('flex bs-full overflow-x-auto p-4 gap-4')}>
|
|
32
|
+
{columns.map((column) => (
|
|
33
|
+
<Column key={column[0]} items={column} />
|
|
34
|
+
))}
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const Column = forwardRef<HTMLDivElement, { items: string[] }>(({ items }, ref) => {
|
|
41
|
+
const focusableGroupAttrs = useFocusableGroup({ tabBehavior: 'limited' });
|
|
42
|
+
const arrowNavigationAttrs = useArrowNavigationGroup({ axis: 'vertical', memorizeCurrent: true });
|
|
43
|
+
const tabsterAttrs = useMergedTabsterAttributes_unstable(focusableGroupAttrs, arrowNavigationAttrs);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<ScrollArea.Root tabIndex={0} orientation='vertical' classNames={mx('shrink-0 bs-full is-[25rem]', border)}>
|
|
47
|
+
<ScrollArea.Viewport {...tabsterAttrs} classNames='p-4 gap-4' ref={ref}>
|
|
48
|
+
{items.map((item) => (
|
|
49
|
+
<Item key={item} value={item} />
|
|
50
|
+
))}
|
|
51
|
+
</ScrollArea.Viewport>
|
|
52
|
+
</ScrollArea.Root>
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const Item = forwardRef<HTMLDivElement, { value: string }>(({ value }, ref) => {
|
|
57
|
+
const focusableGroupAttrs = useFocusableGroup();
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div
|
|
61
|
+
ref={ref}
|
|
62
|
+
tabIndex={0}
|
|
63
|
+
{...focusableGroupAttrs}
|
|
64
|
+
className={mx('flex shrink-0 is-full gap-4 p-4 items-center', border)}
|
|
65
|
+
>
|
|
66
|
+
<Input.Root>
|
|
67
|
+
<Input.Checkbox />
|
|
68
|
+
</Input.Root>
|
|
69
|
+
<Input.Root>
|
|
70
|
+
<Input.TextInput defaultValue={value} />
|
|
71
|
+
</Input.Root>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const DefaultStory = () => {
|
|
77
|
+
const columns = useMemo(() => {
|
|
78
|
+
return [['A1', 'A2', 'A3'], ['B1'], ['C1', 'C2', 'C3', 'C4', 'C5', 'C6'], ['D1', 'D2']];
|
|
79
|
+
}, []);
|
|
80
|
+
|
|
81
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
82
|
+
const { findFirstFocusable } = useFocusFinders();
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (ref.current) {
|
|
85
|
+
findFirstFocusable(ref.current)?.focus();
|
|
86
|
+
}
|
|
87
|
+
}, []);
|
|
88
|
+
|
|
89
|
+
return <Board columns={columns} ref={ref} />;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// TODO(burdon): This doesn't seem to be necessary or recongized; memoization doesn't work.
|
|
93
|
+
const withTabster: Decorator = (Story) => {
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
const tabster = createTabster(window, {
|
|
96
|
+
autoRoot: {},
|
|
97
|
+
// TODO(burdon): Not called.
|
|
98
|
+
// checkUncontrolledCompletely: (el) => {
|
|
99
|
+
// console.log(el);
|
|
100
|
+
// return true;
|
|
101
|
+
// },
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return () => {
|
|
105
|
+
disposeTabster(tabster);
|
|
106
|
+
};
|
|
107
|
+
}, []);
|
|
108
|
+
|
|
109
|
+
return <Story />;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const meta: Meta<typeof DefaultStory> = {
|
|
113
|
+
title: 'ui/react-ui-core/exemplars/tabster',
|
|
114
|
+
component: DefaultStory,
|
|
115
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' }), withTabster],
|
|
116
|
+
parameters: {
|
|
117
|
+
layout: 'fullscreen',
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export default meta;
|
|
122
|
+
|
|
123
|
+
type Story = StoryObj<typeof meta>;
|
|
124
|
+
|
|
125
|
+
export const Default: Story = {
|
|
126
|
+
args: {},
|
|
127
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -6,8 +6,9 @@ export { type Resource, type TFunction } from 'i18next';
|
|
|
6
6
|
export { Trans } from 'react-i18next';
|
|
7
7
|
|
|
8
8
|
export * from '@dxos/react-hooks';
|
|
9
|
-
export * from '@dxos/
|
|
9
|
+
export * from '@dxos/ui-types';
|
|
10
10
|
|
|
11
11
|
export * from './components';
|
|
12
12
|
export * from './hooks';
|
|
13
|
+
export * from './primitives';
|
|
13
14
|
export * from './util';
|
|
@@ -6,8 +6,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Icon, Input, Select, Toggle, Toolbar } from '../components';
|
|
9
|
-
import { withTheme } from '../testing';
|
|
10
|
-
import { withLayoutVariants } from '../testing';
|
|
9
|
+
import { withLayoutVariants, withTheme } from '../testing';
|
|
11
10
|
|
|
12
11
|
const DefaultStory = () => {
|
|
13
12
|
const [checked, setChecked] = useState<boolean>(false);
|
|
@@ -82,9 +81,9 @@ const DefaultStory = () => {
|
|
|
82
81
|
};
|
|
83
82
|
|
|
84
83
|
const meta = {
|
|
85
|
-
title: 'ui/react-ui-core/
|
|
84
|
+
title: 'ui/react-ui-core/playground/Controls',
|
|
86
85
|
render: DefaultStory,
|
|
87
|
-
decorators: [withTheme, withLayoutVariants()],
|
|
86
|
+
decorators: [withTheme(), withLayoutVariants()],
|
|
88
87
|
} satisfies Meta<typeof Icon>;
|
|
89
88
|
|
|
90
89
|
export default meta;
|
|
@@ -108,10 +108,10 @@ const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
const meta = {
|
|
111
|
-
title: 'ui/react-ui-core/
|
|
111
|
+
title: 'ui/react-ui-core/playground/Custom',
|
|
112
112
|
component: Button,
|
|
113
113
|
render: DefaultStory,
|
|
114
|
-
decorators: [withTheme],
|
|
114
|
+
decorators: [withTheme()],
|
|
115
115
|
parameters: {
|
|
116
116
|
layout: 'centered',
|
|
117
117
|
},
|
|
@@ -43,9 +43,9 @@ const DefaultStory = () => {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
const meta = {
|
|
46
|
-
title: 'ui/react-ui-core/
|
|
46
|
+
title: 'ui/react-ui-core/playground/Typography',
|
|
47
47
|
render: DefaultStory,
|
|
48
|
-
decorators: [withTheme],
|
|
48
|
+
decorators: [withTheme()],
|
|
49
49
|
} satisfies Meta<typeof DefaultStory>;
|
|
50
50
|
|
|
51
51
|
export default meta;
|