@dxos/react-ui 0.8.3-staging.0fa589b → 0.8.4-main.84f28bd
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-WXW6KSRL.mjs → chunk-T6YPS45E.mjs} +68 -68
- package/dist/lib/browser/chunk-T6YPS45E.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2 -2
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +4 -4
- package/dist/lib/browser/testing/index.mjs.map +2 -2
- package/dist/lib/node-esm/{chunk-EQ7EG74H.mjs → chunk-TYVQJ4KW.mjs} +68 -68
- package/dist/lib/node-esm/chunk-TYVQJ4KW.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +2 -2
- package/dist/lib/node-esm/index.mjs.map +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +4 -4
- package/dist/lib/node-esm/testing/index.mjs.map +2 -2
- package/dist/types/src/components/Buttons/Button.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts +1 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +4 -5
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +2 -3
- package/dist/types/src/components/Clipboard/index.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +1 -1
- package/dist/types/src/components/Input/Input.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/Select/Select.stories.d.ts +1 -1
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/src/components/Buttons/Button.stories.tsx +1 -1
- package/src/components/Buttons/Button.tsx +1 -0
- package/src/components/Buttons/IconButton.tsx +1 -1
- package/src/components/Clipboard/CopyButton.tsx +10 -12
- package/src/components/Input/Input.stories.tsx +1 -1
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/Select/Select.stories.tsx +1 -1
- package/src/components/ThemeProvider/ThemeProvider.tsx +1 -2
- package/src/components/ThemeProvider/TranslationsProvider.tsx +1 -1
- package/src/components/ThemeProvider/index.ts +3 -1
- package/src/index.ts +1 -1
- package/src/playground/Custom.stories.tsx +1 -1
- package/src/testing/decorators/withSurfaceVariantsLayout.tsx +1 -1
- package/README.yml +0 -1
- package/dist/lib/browser/chunk-WXW6KSRL.mjs.map +0 -7
- package/dist/lib/node/chunk-3E3QKWX4.cjs +0 -4363
- package/dist/lib/node/chunk-3E3QKWX4.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -175
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/testing/index.cjs +0 -114
- package/dist/lib/node/testing/index.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-EQ7EG74H.mjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4-main.84f28bd",
|
|
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",
|
|
@@ -72,14 +72,14 @@
|
|
|
72
72
|
"keyborg": "^2.5.0",
|
|
73
73
|
"react-i18next": "^11.18.6",
|
|
74
74
|
"react-remove-scroll": "^2.6.0",
|
|
75
|
-
"@dxos/debug": "0.8.
|
|
76
|
-
"@dxos/lit-ui": "0.8.
|
|
77
|
-
"@dxos/log": "0.8.
|
|
78
|
-
"@dxos/react-hooks": "0.8.
|
|
79
|
-
"@dxos/react-
|
|
80
|
-
"@dxos/react-
|
|
81
|
-
"@dxos/react-ui-types": "0.8.
|
|
82
|
-
"@dxos/util": "0.8.
|
|
75
|
+
"@dxos/debug": "0.8.4-main.84f28bd",
|
|
76
|
+
"@dxos/lit-ui": "0.8.4-main.84f28bd",
|
|
77
|
+
"@dxos/log": "0.8.4-main.84f28bd",
|
|
78
|
+
"@dxos/react-hooks": "0.8.4-main.84f28bd",
|
|
79
|
+
"@dxos/react-input": "0.8.4-main.84f28bd",
|
|
80
|
+
"@dxos/react-list": "0.8.4-main.84f28bd",
|
|
81
|
+
"@dxos/react-ui-types": "0.8.4-main.84f28bd",
|
|
82
|
+
"@dxos/util": "0.8.4-main.84f28bd"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@dnd-kit/core": "^6.0.5",
|
|
@@ -91,15 +91,15 @@
|
|
|
91
91
|
"react": "~18.2.0",
|
|
92
92
|
"react-dom": "~18.2.0",
|
|
93
93
|
"vite": "5.4.7",
|
|
94
|
-
"@dxos/
|
|
95
|
-
"@dxos/
|
|
96
|
-
"@dxos/util": "0.8.
|
|
94
|
+
"@dxos/random": "0.8.4-main.84f28bd",
|
|
95
|
+
"@dxos/react-ui-theme": "0.8.4-main.84f28bd",
|
|
96
|
+
"@dxos/util": "0.8.4-main.84f28bd"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"@phosphor-icons/react": "^2.1.5",
|
|
100
100
|
"react": "~18.2.0",
|
|
101
101
|
"react-dom": "~18.2.0",
|
|
102
|
-
"@dxos/react-ui-theme": "0.8.
|
|
102
|
+
"@dxos/react-ui-theme": "0.8.4-main.84f28bd"
|
|
103
103
|
},
|
|
104
104
|
"publishConfig": {
|
|
105
105
|
"access": "public"
|
|
@@ -5,7 +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
|
+
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
9
9
|
import React from 'react';
|
|
10
10
|
|
|
11
11
|
import { Button, ButtonGroup, type ButtonProps } from './Button';
|
|
@@ -23,6 +23,7 @@ type ButtonGroupContextValue = { inGroup?: boolean };
|
|
|
23
23
|
|
|
24
24
|
const BUTTON_GROUP_NAME = 'ButtonGroup';
|
|
25
25
|
const BUTTON_NAME = 'Button';
|
|
26
|
+
|
|
26
27
|
const [ButtonGroupProvider, useButtonGroupContext] = createContext<ButtonGroupContextValue>(BUTTON_GROUP_NAME, {
|
|
27
28
|
inGroup: false,
|
|
28
29
|
});
|
|
@@ -38,7 +38,7 @@ const LabelledIconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
|
38
38
|
({ icon, size, iconOnly, label, classNames, iconClassNames, caretDown, ...props }, forwardedRef) => {
|
|
39
39
|
const { tx } = useThemeContext();
|
|
40
40
|
return (
|
|
41
|
-
<Button {...props} classNames={tx('iconButton.root', 'iconButton', {}, classNames)} ref={forwardedRef}>
|
|
41
|
+
<Button {...props} classNames={tx('iconButton.root', 'iconButton', { iconOnly }, classNames)} ref={forwardedRef}>
|
|
42
42
|
<Icon icon={icon} size={size} classNames={iconClassNames} />
|
|
43
43
|
<span className={iconOnly ? 'sr-only' : undefined}>{label}</span>
|
|
44
44
|
{caretDown && <Icon size={3} icon='ph--caret-down--bold' />}
|
|
@@ -2,25 +2,24 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type IconProps } from '@phosphor-icons/react';
|
|
6
5
|
import React from 'react';
|
|
7
6
|
|
|
8
7
|
import { mx } from '@dxos/react-ui-theme';
|
|
9
8
|
|
|
10
9
|
import { useClipboard } from './ClipboardProvider';
|
|
11
10
|
import { Button, type ButtonProps, IconButton } from '../Buttons';
|
|
12
|
-
import { Icon } from '../Icon';
|
|
11
|
+
import { Icon, type IconProps } from '../Icon';
|
|
13
12
|
import { useTranslation } from '../ThemeProvider';
|
|
14
13
|
import { type TooltipScopedProps, useTooltipContext } from '../Tooltip';
|
|
15
14
|
|
|
16
|
-
export type CopyButtonProps = ButtonProps &
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
15
|
+
export type CopyButtonProps = ButtonProps &
|
|
16
|
+
Pick<IconProps, 'size'> & {
|
|
17
|
+
value: string;
|
|
18
|
+
};
|
|
20
19
|
|
|
21
20
|
const inactiveLabelStyles = 'invisible bs-px -mbe-px overflow-hidden';
|
|
22
21
|
|
|
23
|
-
export const CopyButton = ({
|
|
22
|
+
export const CopyButton = ({ classNames, value, size = 5, ...props }: CopyButtonProps) => {
|
|
24
23
|
const { t } = useTranslation('os');
|
|
25
24
|
const { textValue, setTextValue } = useClipboard();
|
|
26
25
|
const isCopied = textValue === value;
|
|
@@ -33,12 +32,11 @@ export const CopyButton = ({ value, classNames, iconProps, ...props }: CopyButto
|
|
|
33
32
|
>
|
|
34
33
|
<div role='none' className={mx('flex gap-1 items-center', isCopied && inactiveLabelStyles)}>
|
|
35
34
|
<span className='pli-1'>{t('copy label')}</span>
|
|
36
|
-
|
|
37
|
-
<Icon icon='ph--copy--regular' size={5 as any} {...iconProps} />
|
|
35
|
+
<Icon icon='ph--copy--regular' size={size} />
|
|
38
36
|
</div>
|
|
39
37
|
<div role='none' className={mx('flex gap-1 items-center', !isCopied && inactiveLabelStyles)}>
|
|
40
38
|
<span className='pli-1'>{t('copy success label')}</span>
|
|
41
|
-
<Icon icon='ph--check--regular' size={
|
|
39
|
+
<Icon icon='ph--check--regular' size={size} />
|
|
42
40
|
</div>
|
|
43
41
|
</Button>
|
|
44
42
|
);
|
|
@@ -52,7 +50,7 @@ export const CopyButtonIconOnly = ({
|
|
|
52
50
|
__scopeTooltip,
|
|
53
51
|
value,
|
|
54
52
|
classNames,
|
|
55
|
-
|
|
53
|
+
size,
|
|
56
54
|
variant,
|
|
57
55
|
...props
|
|
58
56
|
}: TooltipScopedProps<CopyButtonIconOnlyProps>) => {
|
|
@@ -66,7 +64,7 @@ export const CopyButtonIconOnly = ({
|
|
|
66
64
|
iconOnly
|
|
67
65
|
label={label!}
|
|
68
66
|
icon='ph--copy--regular'
|
|
69
|
-
size={
|
|
67
|
+
size={size}
|
|
70
68
|
variant={variant}
|
|
71
69
|
classNames={['inline-flex flex-col justify-center', classNames]}
|
|
72
70
|
onClick={() => setTextValue(value).then(onOpen)}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react';
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { baseSurface, modalSurface, activeSurface, mx, surfaceShadow } from '@dxos/react-ui-theme';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { composeEventHandlers } from '@radix-ui/primitive';
|
|
8
8
|
import { useComposedRefs } from '@radix-ui/react-compose-refs';
|
|
9
9
|
import { createContextScope } from '@radix-ui/react-context';
|
|
10
|
-
import type
|
|
10
|
+
import { type Scope } from '@radix-ui/react-context';
|
|
11
11
|
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
|
12
12
|
import { useFocusGuards } from '@radix-ui/react-focus-guards';
|
|
13
13
|
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
@@ -13,7 +13,7 @@ import { hasIosKeyboard } from '../../util';
|
|
|
13
13
|
import { DensityProvider } from '../DensityProvider';
|
|
14
14
|
import { ElevationProvider } from '../ElevationProvider';
|
|
15
15
|
|
|
16
|
-
export type ThemeMode = '
|
|
16
|
+
export type ThemeMode = 'dark' | 'light';
|
|
17
17
|
|
|
18
18
|
export type ThemeContextValue = {
|
|
19
19
|
tx: ThemeFunction<any>;
|
|
@@ -54,7 +54,6 @@ export const ThemeProvider = ({
|
|
|
54
54
|
}, []);
|
|
55
55
|
|
|
56
56
|
const safeAreaPadding = useSafeArea();
|
|
57
|
-
|
|
58
57
|
const contextValue = useMemo(
|
|
59
58
|
() => ({ tx, themeMode, hasIosKeyboard: hasIosKeyboard(), safeAreaPadding, ...rest }),
|
|
60
59
|
[tx, themeMode, safeAreaPadding, rest],
|
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
export * from './ThemeProvider';
|
|
6
|
-
export { type Label, toLocalizedString, useTranslation
|
|
6
|
+
export { type Label, isLabel, toLocalizedString, useTranslation } from './TranslationsProvider';
|
|
7
|
+
|
|
8
|
+
// TODO(burdon): Use `@internal` with barrel exports (rather than picking individual exports?)
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react';
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { Button, IconButton, type ButtonProps, Tooltip } from '../components';
|
|
@@ -14,7 +14,7 @@ type Config = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const Container = ({ children, elevation, surface }: PropsWithChildren<{ elevation: Elevation; surface?: string }>) => (
|
|
17
|
-
<div className={mx('rounded-md border border-separator', surface, surfaceShadow({ elevation }))}>{children}</div>
|
|
17
|
+
<div className={mx('rounded-md border border-separator p-2', surface, surfaceShadow({ elevation }))}>{children}</div>
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
const Panel = ({
|
package/README.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
guideUrl: https://docs.dxos.org/guide/react/aurora/
|