@dxos/react-ui 0.3.9-main.84a0b01 → 0.3.9-main.8b3b359
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 +172 -172
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/AnchoredOverflow/AnchoredOverflow.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/Lists/List.d.ts.map +1 -0
- package/dist/types/src/components/Lists/List.stories.d.ts.map +1 -0
- package/dist/types/src/components/Lists/Tree.d.ts.map +1 -0
- package/dist/types/src/components/Lists/Tree.stories.d.ts.map +1 -0
- package/dist/types/src/components/Lists/index.d.ts.map +1 -0
- package/dist/types/src/components/Status/Status.d.ts +10 -0
- package/dist/types/src/components/Status/Status.d.ts.map +1 -0
- package/dist/types/src/components/Status/Status.stories.d.ts +12 -0
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -0
- package/dist/types/src/components/Status/index.d.ts +2 -0
- package/dist/types/src/components/Status/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/AnchoredOverflow/AnchoredOverflow.tsx +12 -2
- package/src/components/Breadcrumb/Breadcrumb.tsx +9 -1
- package/src/components/Status/Status.stories.tsx +33 -0
- package/src/components/Status/Status.tsx +38 -0
- package/src/components/{Center → Status}/index.ts +1 -1
- package/src/components/index.ts +2 -3
- package/dist/types/src/components/Center/Center.d.ts +0 -4
- package/dist/types/src/components/Center/Center.d.ts.map +0 -1
- package/dist/types/src/components/Center/Center.stories.d.ts +0 -11
- package/dist/types/src/components/Center/Center.stories.d.ts.map +0 -1
- package/dist/types/src/components/Center/index.d.ts +0 -2
- package/dist/types/src/components/Center/index.d.ts.map +0 -1
- package/dist/types/src/components/List/List.d.ts.map +0 -1
- package/dist/types/src/components/List/List.stories.d.ts.map +0 -1
- package/dist/types/src/components/List/Tree.d.ts.map +0 -1
- package/dist/types/src/components/List/Tree.stories.d.ts.map +0 -1
- package/dist/types/src/components/List/index.d.ts.map +0 -1
- package/dist/types/src/components/ProgressBar/ProgressBar.d.ts +0 -7
- package/dist/types/src/components/ProgressBar/ProgressBar.d.ts.map +0 -1
- package/dist/types/src/components/ProgressBar/ProgressBar.stories.d.ts +0 -12
- package/dist/types/src/components/ProgressBar/ProgressBar.stories.d.ts.map +0 -1
- package/dist/types/src/components/ProgressBar/index.d.ts +0 -2
- package/dist/types/src/components/ProgressBar/index.d.ts.map +0 -1
- package/src/components/Center/Center.stories.tsx +0 -18
- package/src/components/Center/Center.tsx +0 -16
- package/src/components/ProgressBar/ProgressBar.stories.tsx +0 -33
- package/src/components/ProgressBar/ProgressBar.tsx +0 -29
- package/src/components/ProgressBar/index.ts +0 -5
- /package/dist/types/src/components/{List → Lists}/List.d.ts +0 -0
- /package/dist/types/src/components/{List → Lists}/List.stories.d.ts +0 -0
- /package/dist/types/src/components/{List → Lists}/Tree.d.ts +0 -0
- /package/dist/types/src/components/{List → Lists}/Tree.stories.d.ts +0 -0
- /package/dist/types/src/components/{List → Lists}/index.d.ts +0 -0
- /package/src/components/{List → Lists}/List.stories.tsx +0 -0
- /package/src/components/{List → Lists}/List.tsx +0 -0
- /package/src/components/{List → Lists}/Tree.stories.tsx +0 -0
- /package/src/components/{List → Lists}/Tree.tsx +0 -0
- /package/src/components/{List → Lists}/index.ts +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type ComponentPropsWithRef, forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useThemeContext } from '../../hooks';
|
|
8
|
+
import { type ThemedClassName } from '../../util';
|
|
9
|
+
|
|
10
|
+
type StatusProps = ThemedClassName<ComponentPropsWithRef<'span'>> & {
|
|
11
|
+
indeterminate?: boolean;
|
|
12
|
+
progress?: number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const Status = forwardRef<HTMLSpanElement, StatusProps>(
|
|
16
|
+
({ classNames, children, progress = 0, indeterminate, ...props }, forwardedRef) => {
|
|
17
|
+
const { tx } = useThemeContext();
|
|
18
|
+
return (
|
|
19
|
+
<span
|
|
20
|
+
role='status'
|
|
21
|
+
{...props}
|
|
22
|
+
className={tx('status.root', 'status', { indeterminate }, classNames)}
|
|
23
|
+
ref={forwardedRef}
|
|
24
|
+
>
|
|
25
|
+
<span
|
|
26
|
+
role='none'
|
|
27
|
+
className={tx('status.bar', 'status__bar', { indeterminate }, classNames)}
|
|
28
|
+
{...(!indeterminate && { style: { width: `${Math.round(progress * 100)}%` } })}
|
|
29
|
+
/>
|
|
30
|
+
{children}
|
|
31
|
+
</span>
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export { Status };
|
|
37
|
+
|
|
38
|
+
export type { StatusProps };
|
package/src/components/index.ts
CHANGED
|
@@ -7,16 +7,15 @@ export * from './Avatars';
|
|
|
7
7
|
export * from './Breadcrumb';
|
|
8
8
|
export * from './Buttons';
|
|
9
9
|
export * from './Card';
|
|
10
|
-
export * from './Center';
|
|
11
10
|
export * from './Dialogs';
|
|
12
11
|
export * from './DropdownMenu';
|
|
13
12
|
export * from './Input';
|
|
14
13
|
export * from './Link';
|
|
15
|
-
export * from './
|
|
14
|
+
export * from './Lists';
|
|
16
15
|
export * from './Main';
|
|
17
16
|
export * from './Message';
|
|
18
17
|
export * from './Popover';
|
|
19
|
-
export * from './
|
|
18
|
+
export * from './Status';
|
|
20
19
|
export * from './ScrollArea';
|
|
21
20
|
export * from './Select';
|
|
22
21
|
export * from './Separator';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type DetailedHTMLProps, type PropsWithChildren, type HTMLAttributes } from 'react';
|
|
2
|
-
export type CenterProps = PropsWithChildren<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
3
|
-
export declare const Center: (props: CenterProps) => JSX.Element;
|
|
4
|
-
//# sourceMappingURL=Center.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Center.d.ts","sourceRoot":"","sources":["../../../../../src/components/Center/Center.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAEnG,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC;AAE/G,eAAO,MAAM,MAAM,UAAW,WAAW,gBAOxC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import '@dxosTheme';
|
|
3
|
-
declare const _default: {
|
|
4
|
-
component: (props: import("./Center").CenterProps) => JSX.Element;
|
|
5
|
-
actions: {
|
|
6
|
-
argTypesRegex: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
10
|
-
export declare const Normal: (props: any) => JSX.Element;
|
|
11
|
-
//# sourceMappingURL=Center.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Center.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Center/Center.stories.tsx"],"names":[],"mappings":";AAIA,OAAO,YAAY,CAAC;;;;;;;AAMpB,wBAGE;AAEF,eAAO,MAAM,MAAM,UAAW,GAAG,gBAEhC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Center/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"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BAAyB,CAAC,wBAAwB,CAAC,CAAC;IACjE,kBAAkB,EAAE,yBAAyB,CAAC,+BAA+B,CAAC,CAAC;IAC/E,eAAe,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;CAQzF,CAAC;AAEF,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,kBAAkB,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;AAE/E,YAAY,EACV,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,+BAA+B,GAChC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/List.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAMpB,OAAO,KAA4C,MAAM,OAAO,CAAC;AAIjE,OAAO,EAAkB,KAAK,SAAS,EAAwB,MAAM,QAAQ,CAAC;;;;AAE9E,wBAEE;AAuBF,eAAO,MAAM,oBAAoB;;;;;CAgChC,CAAC;AA+BF,eAAO,MAAM,kBAAkB;;;;;CA8C9B,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;CA+BvB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/Tree.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,wBAAwB,EAAE,KAAK,EAAE,EAAc,KAAK,yBAAyB,EAAE,MAAM,OAAO,CAAC;AAElH,OAAO,EAIL,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,SAAS,EAGf,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,KAAK,aAAa,GAAG,SAAS,CAAC;AAE/B,KAAK,aAAa,GAAG,iBAAiB,CAAC;AAwBvC,KAAK,oBAAoB,GAAG,oBAAoB,CAAC;AAIjD,KAAK,wBAAwB,GAAG,wBAAwB,CAAC;AAMzD,KAAK,iBAAiB,GAAG,+BAA+B,CAAC;AAIzD,eAAO,MAAM,IAAI;;;CAAyC,CAAC;AAC3D,eAAO,MAAM,QAAQ,EAAE;IACrB,IAAI,EAAE,yBAAyB,CAAC,aAAa,CAAC,CAAC;IAC/C,OAAO,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,CAAC;IACzD,IAAI,EAAE,yBAAyB,CAAC,iBAAiB,CAAC,CAAC;IACnD,WAAW,EAAE,yBAAyB,CAAC,wBAAwB,CAAC,CAAC;IACjE,eAAe,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;CAOzF,CAAC;AAEF,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/Tree.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAMpB,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,GAAG,CAAC;CACX,CAAC;;;;AA4CF,wBAEE;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;CAmBnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,gBAAgB,gBAgBlD,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import '@dxosTheme';
|
|
3
|
-
declare const _default: {
|
|
4
|
-
component: (props: import("./ProgressBar").ProgressBarProps) => JSX.Element;
|
|
5
|
-
actions: {
|
|
6
|
-
argTypesRegex: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
10
|
-
export declare const Normal: (props: any) => JSX.Element;
|
|
11
|
-
export declare const Indeterminate: (props: any) => JSX.Element;
|
|
12
|
-
//# sourceMappingURL=ProgressBar.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ProgressBar/ProgressBar.stories.tsx"],"names":[],"mappings":";AAIA,OAAO,YAAY,CAAC;;;;;;;AAMpB,wBAGE;AAEF,eAAO,MAAM,MAAM,UAAW,GAAG,gBAShC,CAAC;AAEF,eAAO,MAAM,aAAa,UAAW,GAAG,gBAMvC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ProgressBar/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxosTheme';
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
import { Center } from './Center';
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
component: Center,
|
|
13
|
-
actions: { argTypesRegex: '^on.*' },
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const Normal = (props: any) => {
|
|
17
|
-
return <Center {...props}>✨</Center>;
|
|
18
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type DetailedHTMLProps, type PropsWithChildren, type HTMLAttributes } from 'react';
|
|
6
|
-
|
|
7
|
-
export type CenterProps = PropsWithChildren<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
8
|
-
|
|
9
|
-
export const Center = (props: CenterProps) => {
|
|
10
|
-
const { children, className, ...rest } = props;
|
|
11
|
-
return (
|
|
12
|
-
<div className={'h-full flex items-center justify-center ' + className} {...rest}>
|
|
13
|
-
{children}
|
|
14
|
-
</div>
|
|
15
|
-
);
|
|
16
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxosTheme';
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
import { ProgressBar } from './ProgressBar';
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
component: ProgressBar,
|
|
13
|
-
actions: { argTypesRegex: '^on.*' },
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const Normal = (props: any) => {
|
|
17
|
-
return (
|
|
18
|
-
<div className='flex flex-col gap-5'>
|
|
19
|
-
<ProgressBar progress={0} {...props} />
|
|
20
|
-
<ProgressBar progress={0.3} {...props} />
|
|
21
|
-
<ProgressBar progress={0.7} {...props} />
|
|
22
|
-
<ProgressBar progress={1} {...props} />
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const Indeterminate = (props: any) => {
|
|
28
|
-
return (
|
|
29
|
-
<>
|
|
30
|
-
<ProgressBar className='m-4' indeterminate {...props} />
|
|
31
|
-
</>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
export type ProgressBarProps = {
|
|
8
|
-
indeterminate?: boolean;
|
|
9
|
-
progress?: number;
|
|
10
|
-
className?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const ProgressBar = (props: ProgressBarProps) => {
|
|
14
|
-
const { className, indeterminate = false, progress = 0 } = props;
|
|
15
|
-
return (
|
|
16
|
-
<span
|
|
17
|
-
role='none'
|
|
18
|
-
className={'w-20 h-1 inline-block relative bg-neutral-400/25 rounded-full' + (className ? ' ' + className : '')}
|
|
19
|
-
>
|
|
20
|
-
<span
|
|
21
|
-
className={
|
|
22
|
-
'absolute left-0 top-0 bottom-0 inline-block bg-neutral-400 rounded-full' +
|
|
23
|
-
(indeterminate ? ' animate-progress-indeterminate' : '')
|
|
24
|
-
}
|
|
25
|
-
{...(indeterminate ? {} : { style: { width: `${(progress * 100).toFixed(0)}%` } })}
|
|
26
|
-
/>
|
|
27
|
-
</span>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|