@dxos/brand 0.8.4-main.84f28bd → 0.8.4-main.ae835ea
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 +38 -24
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/Icons.stories.d.ts +5 -7
- package/dist/types/src/Icons.stories.d.ts.map +1 -1
- package/dist/types/src/Logotypes.stories.d.ts +5 -7
- package/dist/types/src/Logotypes.stories.d.ts.map +1 -1
- package/dist/types/src/components/ComposerLogo/ComposerLogo.d.ts.map +1 -1
- package/dist/types/src/components/ComposerLogo/ComposerLogo.stories.d.ts +9 -18
- package/dist/types/src/components/ComposerLogo/ComposerLogo.stories.d.ts.map +1 -1
- package/dist/types/src/components/rive.stories.d.ts +9 -4
- package/dist/types/src/components/rive.stories.d.ts.map +1 -1
- package/dist/types/src/icons/Composer.d.ts +1 -2
- package/dist/types/src/icons/Composer.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -11
- package/src/Icons.stories.tsx +10 -7
- package/src/Logotypes.stories.tsx +10 -7
- package/src/components/ComposerLogo/ComposerLogo.stories.tsx +20 -17
- package/src/components/ComposerLogo/ComposerLogo.tsx +18 -4
- package/src/components/rive.stories.tsx +26 -12
- package/src/icons/Composer.tsx +19 -5
- package/src/icons/DXNS.tsx +1 -1
- package/src/icons/DXOS.tsx +1 -1
- package/src/icons/ECHO.tsx +1 -1
- package/src/icons/HALO.tsx +1 -1
- package/src/icons/KUBE.tsx +1 -1
- package/src/icons/MESH.tsx +1 -1
- package/dist/lib/node-esm/index.mjs +0 -553
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/brand",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.ae835ea",
|
|
4
4
|
"description": "DXOS brand assets.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs"
|
|
15
16
|
}
|
|
@@ -28,20 +29,21 @@
|
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@fontsource/k2d": "^5.0.18",
|
|
31
|
-
"@phosphor-icons/react": "^2.1.
|
|
32
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
32
33
|
"@rive-app/react-canvas": "^4.14.0",
|
|
33
34
|
"@types/d3": "^7.4.3",
|
|
34
|
-
"react": "~
|
|
35
|
-
"react-dom": "~
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
38
|
-
"@dxos/
|
|
35
|
+
"react": "~19.2.0",
|
|
36
|
+
"react-dom": "~19.2.0",
|
|
37
|
+
"@dxos/log": "0.8.4-main.ae835ea",
|
|
38
|
+
"@dxos/react-ui-theme": "0.8.4-main.ae835ea",
|
|
39
|
+
"@dxos/react-ui": "0.8.4-main.ae835ea",
|
|
40
|
+
"@dxos/storybook-utils": "0.8.4-main.ae835ea"
|
|
39
41
|
},
|
|
40
42
|
"peerDependencies": {
|
|
41
43
|
"@phosphor-icons/react": "^2.1.5",
|
|
42
|
-
"react": "
|
|
43
|
-
"react-dom": "
|
|
44
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
45
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
44
|
+
"react": "^19.0.0",
|
|
45
|
+
"react-dom": "^19.0.0",
|
|
46
|
+
"@dxos/react-ui": "0.8.4-main.ae835ea",
|
|
47
|
+
"@dxos/react-ui-theme": "0.8.4-main.ae835ea"
|
|
46
48
|
}
|
|
47
49
|
}
|
package/src/Icons.stories.tsx
CHANGED
|
@@ -2,24 +2,27 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
|
|
8
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
9
9
|
import { mx } from '@dxos/react-ui-theme';
|
|
10
|
-
import { withTheme } from '@dxos/storybook-utils';
|
|
11
10
|
|
|
12
|
-
import { DXNS, DXOS, ECHO, HALO, KUBE, MESH
|
|
11
|
+
import { Composer, DXNS, DXOS, ECHO, HALO, KUBE, MESH } from './icons';
|
|
13
12
|
|
|
14
13
|
const Icon = () => null;
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
const meta = {
|
|
17
16
|
title: 'ui/brand/Icons',
|
|
18
17
|
component: Icon,
|
|
19
18
|
decorators: [withTheme],
|
|
20
|
-
}
|
|
19
|
+
} satisfies Meta<typeof Icon>;
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
21
24
|
|
|
22
|
-
export const Default = {
|
|
25
|
+
export const Default: Story = {
|
|
23
26
|
render: () => {
|
|
24
27
|
const size = 'w-[128px] h-[128px]';
|
|
25
28
|
return (
|
|
@@ -2,22 +2,25 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
6
|
import React, { type FC, type ReactNode } from 'react';
|
|
8
7
|
|
|
8
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
9
9
|
import { mx } from '@dxos/react-ui-theme';
|
|
10
|
-
import { withTheme } from '@dxos/storybook-utils';
|
|
11
10
|
|
|
12
|
-
import {
|
|
11
|
+
import { DXOSHorizontalType, DXOSType, DXOSVerticalType } from './logotypes';
|
|
13
12
|
|
|
14
13
|
const Icon = () => null;
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
const meta = {
|
|
17
16
|
title: 'ui/brand/LogoTypes',
|
|
18
17
|
component: Icon,
|
|
19
18
|
decorators: [withTheme],
|
|
20
|
-
}
|
|
19
|
+
} satisfies Meta<typeof Icon>;
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
21
24
|
|
|
22
25
|
const Cell: FC<{ children: ReactNode; dark?: boolean }> = ({ children, dark }) => (
|
|
23
26
|
<div className={mx('flex p-4 justify-center rounded-md', dark ? 'bg-zinc-800 fill-zinc-50' : 'bg-white')}>
|
|
@@ -25,7 +28,7 @@ const Cell: FC<{ children: ReactNode; dark?: boolean }> = ({ children, dark }) =
|
|
|
25
28
|
</div>
|
|
26
29
|
);
|
|
27
30
|
|
|
28
|
-
export const Default = {
|
|
31
|
+
export const Default: Story = {
|
|
29
32
|
render: () => {
|
|
30
33
|
return (
|
|
31
34
|
<div className='absolute flex w-full h-full items-center justify-center'>
|
|
@@ -2,29 +2,32 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import '@fontsource/k2d/100-italic.css';
|
|
8
6
|
|
|
9
|
-
import {
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
10
8
|
import React, { useRef, useState } from 'react';
|
|
11
9
|
|
|
12
|
-
import { Button } from '@dxos/react-ui';
|
|
10
|
+
import { Button, Icon } from '@dxos/react-ui';
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
13
12
|
import { mx } from '@dxos/react-ui-theme';
|
|
14
|
-
import { withTheme } from '@dxos/storybook-utils';
|
|
15
13
|
|
|
16
|
-
import { type AnimationController, ComposerLogo, ComposerSpinner } from './ComposerLogo';
|
|
17
14
|
import { DXOS } from '../../icons';
|
|
18
15
|
|
|
16
|
+
import { type AnimationController, ComposerLogo, ComposerSpinner } from './ComposerLogo';
|
|
17
|
+
|
|
19
18
|
// import ident from '../../../assets/sounds/ident-1.mp3';
|
|
20
19
|
|
|
21
20
|
// https://pixabay.com/sound-effects/search/logo/?pagi=2
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
const meta = {
|
|
24
23
|
title: 'ui/brand/Logo',
|
|
25
24
|
component: ComposerLogo,
|
|
26
25
|
decorators: [withTheme],
|
|
27
|
-
}
|
|
26
|
+
} satisfies Meta<typeof ComposerLogo>;
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
28
31
|
|
|
29
32
|
// TODO(burdon): Get from theme?
|
|
30
33
|
const colors = {
|
|
@@ -35,7 +38,7 @@ const colors = {
|
|
|
35
38
|
blue: '#539ACD',
|
|
36
39
|
};
|
|
37
40
|
|
|
38
|
-
export const Default = {
|
|
41
|
+
export const Default: Story = {
|
|
39
42
|
render: () => {
|
|
40
43
|
const controller = useRef<AnimationController>(null);
|
|
41
44
|
const [logo, setLogo] = useState(false);
|
|
@@ -76,7 +79,7 @@ export const Default = {
|
|
|
76
79
|
};
|
|
77
80
|
|
|
78
81
|
// TODO(burdon): Camo.
|
|
79
|
-
export const Colors = {
|
|
82
|
+
export const Colors: Story = {
|
|
80
83
|
render: () => {
|
|
81
84
|
const colors = [
|
|
82
85
|
['fill-teal-400', 'fill-teal-500', 'fill-teal-600'],
|
|
@@ -104,7 +107,7 @@ export const Colors = {
|
|
|
104
107
|
},
|
|
105
108
|
};
|
|
106
109
|
|
|
107
|
-
export const Pacman = {
|
|
110
|
+
export const Pacman: Story = {
|
|
108
111
|
render: () => {
|
|
109
112
|
return (
|
|
110
113
|
<div className='absolute inset-0 flex flex-col justify-center'>
|
|
@@ -112,13 +115,13 @@ export const Pacman = {
|
|
|
112
115
|
<div className='flex items-center p-4'>
|
|
113
116
|
<div className='flex ml-8 mr-[100px]'>
|
|
114
117
|
<div>
|
|
115
|
-
<
|
|
118
|
+
<Icon icon='ph--ghost--duotone' classNames='w-[180px] h-[180px] text-blue-500' />
|
|
116
119
|
</div>
|
|
117
120
|
<div>
|
|
118
|
-
<
|
|
121
|
+
<Icon icon='ph--ghost--duotone' classNames='w-[180px] h-[180px] text-purple-500' />
|
|
119
122
|
</div>
|
|
120
123
|
<div>
|
|
121
|
-
<
|
|
124
|
+
<Icon icon='ph--ghost--duotone' classNames='w-[180px] h-[180px] text-red-500' />
|
|
122
125
|
</div>
|
|
123
126
|
</div>
|
|
124
127
|
|
|
@@ -127,7 +130,7 @@ export const Pacman = {
|
|
|
127
130
|
<div className='flex -ml-10'>
|
|
128
131
|
{Array.from({ length: 6 }).map((_, i) => (
|
|
129
132
|
<div key={i} className='p-4'>
|
|
130
|
-
<
|
|
133
|
+
<Icon icon='ph--square--duotone' classNames='w-6 h-6 text-yellow-200' />
|
|
131
134
|
</div>
|
|
132
135
|
))}
|
|
133
136
|
</div>
|
|
@@ -179,7 +182,7 @@ const SpinnerContainer = () => {
|
|
|
179
182
|
);
|
|
180
183
|
};
|
|
181
184
|
|
|
182
|
-
export const Spinner = {
|
|
185
|
+
export const Spinner: Story = {
|
|
183
186
|
render: () => {
|
|
184
187
|
return (
|
|
185
188
|
<div className='absolute inset-0 flex items-center justify-center'>
|
|
@@ -190,7 +193,7 @@ export const Spinner = {
|
|
|
190
193
|
};
|
|
191
194
|
|
|
192
195
|
// https://github.com/grafana/grafana/blob/main/packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx
|
|
193
|
-
export const Linear = {
|
|
196
|
+
export const Linear: Story = {
|
|
194
197
|
render: () => {
|
|
195
198
|
return (
|
|
196
199
|
<div className='absolute flex flex-col inset-0 bg-black'>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type IconWeight } from '@phosphor-icons/react';
|
|
6
6
|
import { arc, interpolateString, select } from 'd3';
|
|
7
7
|
import React, {
|
|
8
8
|
type CSSProperties,
|
|
@@ -28,9 +28,23 @@ const weights = new Map<IconWeight, ReactElement>([
|
|
|
28
28
|
],
|
|
29
29
|
]);
|
|
30
30
|
|
|
31
|
-
const Composer = forwardRef<SVGSVGElement,
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const Composer = forwardRef<SVGSVGElement, any>((props, ref) => {
|
|
32
|
+
const weight = props.weight || 'regular';
|
|
33
|
+
const size = props.size || 256;
|
|
34
|
+
return (
|
|
35
|
+
<svg
|
|
36
|
+
ref={ref}
|
|
37
|
+
{...props}
|
|
38
|
+
width={size}
|
|
39
|
+
height={size}
|
|
40
|
+
viewBox='0 0 256 256'
|
|
41
|
+
fill='currentColor'
|
|
42
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
43
|
+
>
|
|
44
|
+
{weights.get(weight)}
|
|
45
|
+
</svg>
|
|
46
|
+
);
|
|
47
|
+
});
|
|
34
48
|
|
|
35
49
|
export interface AnimationController {
|
|
36
50
|
spin: () => void;
|
|
@@ -2,19 +2,15 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Rive, useRive } from '@rive-app/react-canvas';
|
|
6
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
7
|
import React, { useEffect } from 'react';
|
|
9
8
|
|
|
9
|
+
import { log } from '@dxos/log';
|
|
10
10
|
import { useAsyncState } from '@dxos/react-ui';
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
12
|
import { mx } from '@dxos/react-ui-theme';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
export default {
|
|
15
|
-
title: 'ui/brand/Rive',
|
|
16
|
-
decorators: [withTheme, withLayout({ fullscreen: true, classNames: ['absolute inset-0 bg-black'] })],
|
|
17
|
-
};
|
|
13
|
+
import { render } from '@dxos/storybook-utils';
|
|
18
14
|
|
|
19
15
|
const useFlash = (rive: Rive | null, name: string, delay: number, period: number) => {
|
|
20
16
|
useEffect(() => {
|
|
@@ -45,13 +41,16 @@ const Component = ({ buffer }: { buffer: ArrayBuffer }) => {
|
|
|
45
41
|
);
|
|
46
42
|
};
|
|
47
43
|
|
|
48
|
-
|
|
44
|
+
const DefaultStory = () => {
|
|
49
45
|
const [buffer] = useAsyncState<ArrayBuffer>(async () => {
|
|
50
46
|
// CORS set via dashboard.
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
// TODO(wittjosiah): Fetch to external url fails in headless storybook test.
|
|
48
|
+
const response = await fetch('https://dxos.network/dxos.riv', { mode: 'cors' }).catch((error) => {
|
|
49
|
+
log.catch(error);
|
|
50
|
+
});
|
|
51
|
+
if (response?.ok) {
|
|
53
52
|
return await response.arrayBuffer();
|
|
54
|
-
} else {
|
|
53
|
+
} else if (response) {
|
|
55
54
|
console.log(response.status);
|
|
56
55
|
}
|
|
57
56
|
});
|
|
@@ -82,3 +81,18 @@ export const Default = () => {
|
|
|
82
81
|
</>
|
|
83
82
|
);
|
|
84
83
|
};
|
|
84
|
+
|
|
85
|
+
const meta = {
|
|
86
|
+
title: 'ui/brand/Rive',
|
|
87
|
+
render: render(DefaultStory),
|
|
88
|
+
decorators: [withTheme],
|
|
89
|
+
parameters: {
|
|
90
|
+
layout: 'fullscreen',
|
|
91
|
+
},
|
|
92
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
93
|
+
|
|
94
|
+
export default meta;
|
|
95
|
+
|
|
96
|
+
type Story = StoryObj<typeof meta>;
|
|
97
|
+
|
|
98
|
+
export const Default: Story = {};
|
package/src/icons/Composer.tsx
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import React, {
|
|
5
|
+
import { type IconWeight } from '@phosphor-icons/react';
|
|
6
|
+
import React, { type ReactElement, forwardRef } from 'react';
|
|
7
7
|
|
|
8
8
|
const weights = new Map<IconWeight, ReactElement>([
|
|
9
9
|
[
|
|
@@ -36,8 +36,22 @@ const weights = new Map<IconWeight, ReactElement>([
|
|
|
36
36
|
],
|
|
37
37
|
]);
|
|
38
38
|
|
|
39
|
-
export const Composer = forwardRef<SVGSVGElement,
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
export const Composer = forwardRef<SVGSVGElement, any>((props, ref) => {
|
|
40
|
+
const weight = props.weight || 'regular';
|
|
41
|
+
const size = props.size || 256;
|
|
42
|
+
return (
|
|
43
|
+
<svg
|
|
44
|
+
ref={ref}
|
|
45
|
+
{...props}
|
|
46
|
+
width={size}
|
|
47
|
+
height={size}
|
|
48
|
+
viewBox='0 0 256 256'
|
|
49
|
+
fill='currentColor'
|
|
50
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
51
|
+
>
|
|
52
|
+
{weights.get(weight)}
|
|
53
|
+
</svg>
|
|
54
|
+
);
|
|
55
|
+
});
|
|
42
56
|
|
|
43
57
|
Composer.displayName = 'Composer';
|
package/src/icons/DXNS.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { IconBase, type IconProps, type IconWeight } from '@phosphor-icons/react';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { type ReactElement, forwardRef } from 'react';
|
|
7
7
|
|
|
8
8
|
const weights = new Map<IconWeight, ReactElement>([
|
|
9
9
|
[
|
package/src/icons/DXOS.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { IconBase, type IconProps, type IconWeight } from '@phosphor-icons/react';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { type ReactElement, forwardRef } from 'react';
|
|
7
7
|
|
|
8
8
|
const weights = new Map<IconWeight, ReactElement>([
|
|
9
9
|
[
|
package/src/icons/ECHO.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { IconBase, type IconProps, type IconWeight } from '@phosphor-icons/react';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { type ReactElement, forwardRef } from 'react';
|
|
7
7
|
|
|
8
8
|
const weights = new Map<IconWeight, ReactElement>([
|
|
9
9
|
[
|
package/src/icons/HALO.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { IconBase, type IconProps, type IconWeight } from '@phosphor-icons/react';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { type ReactElement, forwardRef } from 'react';
|
|
7
7
|
|
|
8
8
|
const weights = new Map<IconWeight, ReactElement>([
|
|
9
9
|
[
|
package/src/icons/KUBE.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { IconBase, type IconProps, type IconWeight } from '@phosphor-icons/react';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { type ReactElement, forwardRef } from 'react';
|
|
7
7
|
|
|
8
8
|
const weights = new Map<IconWeight, ReactElement>([
|
|
9
9
|
[
|
package/src/icons/MESH.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { IconBase, type IconProps, type IconWeight } from '@phosphor-icons/react';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { type ReactElement, forwardRef } from 'react';
|
|
7
7
|
|
|
8
8
|
const weights = new Map<IconWeight, ReactElement>([
|
|
9
9
|
[
|