@dxos/plugin-preview 0.8.4-main.f9ba587 → 0.8.4-main.fcfe5033a5
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 +41 -42
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +42 -42
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/PreviewPlugin.d.ts +2 -1
- package/dist/types/src/PreviewPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +3 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/preview-popover.d.ts +3 -2
- package/dist/types/src/capabilities/preview-popover.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/cards/FormCard.d.ts +7 -0
- package/dist/types/src/cards/FormCard.d.ts.map +1 -0
- package/dist/types/src/cards/JsonCard.d.ts +5 -0
- package/dist/types/src/cards/JsonCard.d.ts.map +1 -0
- package/dist/types/src/cards/OrganizationCard.d.ts +5 -0
- package/dist/types/src/cards/OrganizationCard.d.ts.map +1 -0
- package/dist/types/src/cards/PersonCard.d.ts +5 -0
- package/dist/types/src/cards/PersonCard.d.ts.map +1 -0
- package/dist/types/src/cards/ProjectCard.d.ts +5 -0
- package/dist/types/src/cards/ProjectCard.d.ts.map +1 -0
- package/dist/types/src/cards/TaskCard.d.ts +5 -0
- package/dist/types/src/cards/TaskCard.d.ts.map +1 -0
- package/dist/types/src/cards/index.d.ts +7 -0
- package/dist/types/src/cards/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/stories/Card.stories.d.ts +36 -0
- package/dist/types/src/stories/Card.stories.d.ts.map +1 -0
- package/dist/types/src/stories/testing.d.ts +19 -0
- package/dist/types/src/stories/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +8 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -29
- package/src/PreviewPlugin.tsx +17 -28
- package/src/capabilities/index.ts +3 -3
- package/src/capabilities/preview-popover.ts +69 -50
- package/src/capabilities/react-surface.tsx +101 -120
- package/src/cards/FormCard.tsx +48 -0
- package/src/cards/JsonCard.tsx +16 -0
- package/src/cards/OrganizationCard.tsx +29 -0
- package/src/cards/PersonCard.tsx +65 -0
- package/src/cards/ProjectCard.tsx +22 -0
- package/src/cards/TaskCard.tsx +44 -0
- package/src/cards/index.ts +10 -0
- package/src/index.ts +0 -1
- package/src/meta.ts +8 -5
- package/src/stories/Card.stories.tsx +107 -0
- package/src/stories/testing.tsx +91 -0
- package/src/translations.ts +8 -2
- package/dist/lib/browser/chunk-Z73ENKLE.mjs +0 -14
- package/dist/lib/browser/chunk-Z73ENKLE.mjs.map +0 -7
- package/dist/lib/browser/preview-popover-2UCEZUQW.mjs +0 -69
- package/dist/lib/browser/preview-popover-2UCEZUQW.mjs.map +0 -7
- package/dist/lib/browser/react-surface-P5GWVHQD.mjs +0 -272
- package/dist/lib/browser/react-surface-P5GWVHQD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2ORSL4GJ.mjs +0 -16
- package/dist/lib/node-esm/chunk-2ORSL4GJ.mjs.map +0 -7
- package/dist/lib/node-esm/preview-popover-OSHWR2YE.mjs +0 -71
- package/dist/lib/node-esm/preview-popover-OSHWR2YE.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-KBHIRVNI.mjs +0 -273
- package/dist/lib/node-esm/react-surface-KBHIRVNI.mjs.map +0 -7
- package/dist/types/src/Preview.stories.d.ts +0 -127
- package/dist/types/src/Preview.stories.d.ts.map +0 -1
- package/dist/types/src/components/ContactCard.d.ts +0 -7
- package/dist/types/src/components/ContactCard.d.ts.map +0 -1
- package/dist/types/src/components/OrganizationCard.d.ts +0 -5
- package/dist/types/src/components/OrganizationCard.d.ts.map +0 -1
- package/dist/types/src/components/ProjectCard.d.ts +0 -5
- package/dist/types/src/components/ProjectCard.d.ts.map +0 -1
- package/dist/types/src/components/index.d.ts +0 -4
- package/dist/types/src/components/index.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -6
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/Preview.stories.tsx +0 -147
- package/src/components/ContactCard.tsx +0 -70
- package/src/components/OrganizationCard.tsx +0 -41
- package/src/components/ProjectCard.tsx +0 -20
- package/src/components/index.ts +0 -7
- package/src/types.ts +0 -11
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { Fragment } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Icon, Avatar, Button } from '@dxos/react-ui';
|
|
8
|
-
import { Card, cardHeading, cardText } from '@dxos/react-ui-stack';
|
|
9
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
10
|
-
import { type DataType } from '@dxos/schema';
|
|
11
|
-
|
|
12
|
-
import { type PreviewProps } from '../types';
|
|
13
|
-
|
|
14
|
-
export const ContactCard = ({
|
|
15
|
-
children,
|
|
16
|
-
subject: { fullName, image, organization, emails },
|
|
17
|
-
onOrgClick,
|
|
18
|
-
role,
|
|
19
|
-
}: PreviewProps<DataType.Person> & { onOrgClick?: (org: DataType.Organization) => void }) => {
|
|
20
|
-
const organizationName = organization && typeof organization === 'object' ? organization.target?.name : organization;
|
|
21
|
-
return (
|
|
22
|
-
<Card.SurfaceRoot role={role}>
|
|
23
|
-
<Avatar.Root>
|
|
24
|
-
<Card.Text role='group' classNames='grid gap-3 grid-cols-[min-content_1fr]'>
|
|
25
|
-
<Avatar.Content imgSrc={image} icon='ph--user--regular' size={16} hue='neutral' />
|
|
26
|
-
<div role='none' className='bs-min self-center'>
|
|
27
|
-
<Avatar.Label asChild>
|
|
28
|
-
<h2 className={cardHeading}>{fullName}</h2>
|
|
29
|
-
</Avatar.Label>
|
|
30
|
-
</div>
|
|
31
|
-
</Card.Text>
|
|
32
|
-
</Avatar.Root>
|
|
33
|
-
{organizationName && (
|
|
34
|
-
<Card.Chrome>
|
|
35
|
-
{typeof organization === 'object' && onOrgClick ? (
|
|
36
|
-
<Button variant='ghost' classNames='gap-2 text-start' onClick={() => onOrgClick(organization.target!)}>
|
|
37
|
-
<Icon icon='ph--buildings--regular' size={5} classNames='text-subdued' />
|
|
38
|
-
<span className='min-is-0 flex-1 truncate'>{organizationName}</span>
|
|
39
|
-
<Icon icon='ph--arrow-right--regular' />
|
|
40
|
-
</Button>
|
|
41
|
-
) : (
|
|
42
|
-
<p className='dx-button gap-2' data-variant='ghost'>
|
|
43
|
-
<Icon icon='ph--buildings--regular' size={5} classNames='text-subdued' />
|
|
44
|
-
<span className='min-is-0 flex-1 truncate'>{organizationName}</span>
|
|
45
|
-
</p>
|
|
46
|
-
)}
|
|
47
|
-
</Card.Chrome>
|
|
48
|
-
)}
|
|
49
|
-
<dl
|
|
50
|
-
className={mx(
|
|
51
|
-
cardText,
|
|
52
|
-
'grid gap-2 grid-cols-[min-content_1fr] [&_dt]:text-subdued [&_dt]:pbs-0.5 [&_dd]:min-is-0',
|
|
53
|
-
)}
|
|
54
|
-
>
|
|
55
|
-
{emails?.length &&
|
|
56
|
-
emails.map(({ label, value }) => (
|
|
57
|
-
<Fragment key={value}>
|
|
58
|
-
<dt>
|
|
59
|
-
<Icon icon='ph--at--regular' size={5} />
|
|
60
|
-
</dt>
|
|
61
|
-
<dd key={value} className='break-words'>
|
|
62
|
-
{value}
|
|
63
|
-
</dd>
|
|
64
|
-
</Fragment>
|
|
65
|
-
))}
|
|
66
|
-
</dl>
|
|
67
|
-
{children}
|
|
68
|
-
</Card.SurfaceRoot>
|
|
69
|
-
);
|
|
70
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Icon } from '@dxos/react-ui';
|
|
8
|
-
import { Card } from '@dxos/react-ui-stack';
|
|
9
|
-
import { type DataType } from '@dxos/schema';
|
|
10
|
-
|
|
11
|
-
import { type PreviewProps } from '../types';
|
|
12
|
-
|
|
13
|
-
export const OrganizationCard = ({
|
|
14
|
-
children,
|
|
15
|
-
subject: { name, image, description, website },
|
|
16
|
-
role,
|
|
17
|
-
}: PreviewProps<DataType.Organization>) => {
|
|
18
|
-
return (
|
|
19
|
-
<Card.SurfaceRoot role={role}>
|
|
20
|
-
<Card.Poster alt={name!} {...(image ? { image } : { icon: 'ph--building-office--regular' })} />
|
|
21
|
-
<Card.Heading>{name}</Card.Heading>
|
|
22
|
-
{description && <Card.Text classNames='line-clamp-2'>{description}</Card.Text>}
|
|
23
|
-
{website && (
|
|
24
|
-
<Card.Chrome>
|
|
25
|
-
<a
|
|
26
|
-
className='dx-button dx-focus-ring gap-2'
|
|
27
|
-
data-variant='ghost'
|
|
28
|
-
href={website}
|
|
29
|
-
target='_blank'
|
|
30
|
-
rel='noreferrer'
|
|
31
|
-
>
|
|
32
|
-
<Icon icon='ph--link--regular' size={5} classNames='text-subdued' />
|
|
33
|
-
<span className='grow'>{website}</span>
|
|
34
|
-
<Icon icon='ph--arrow-square-out--regular' />
|
|
35
|
-
</a>
|
|
36
|
-
</Card.Chrome>
|
|
37
|
-
)}
|
|
38
|
-
{children}
|
|
39
|
-
</Card.SurfaceRoot>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Card } from '@dxos/react-ui-stack';
|
|
8
|
-
import { type DataType } from '@dxos/schema';
|
|
9
|
-
|
|
10
|
-
import { type PreviewProps } from '../types';
|
|
11
|
-
|
|
12
|
-
export const ProjectCard = ({ subject: { name, image, description }, role }: PreviewProps<DataType.Project>) => {
|
|
13
|
-
return (
|
|
14
|
-
<Card.SurfaceRoot role={role}>
|
|
15
|
-
{image && <Card.Poster image={image} alt={name} aspect='auto' />}
|
|
16
|
-
<Card.Heading>{name}</Card.Heading>
|
|
17
|
-
{description && <Card.Text classNames='line-clamp-2'>{description}</Card.Text>}
|
|
18
|
-
</Card.SurfaceRoot>
|
|
19
|
-
);
|
|
20
|
-
};
|
package/src/components/index.ts
DELETED
package/src/types.ts
DELETED