@multiplatform.one/components 7.6.1 → 7.6.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/components",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.2",
|
|
4
4
|
"description": "multiplatform.one ui components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
"link": "^2.1.2",
|
|
76
76
|
"shiki": "^4.0.2",
|
|
77
77
|
"tamagui": "2.7.6",
|
|
78
|
-
"@multiplatform.one/forms": "7.6.
|
|
79
|
-
"@multiplatform.one/i18n": "7.6.
|
|
80
|
-
"@multiplatform.one/platform": "7.6.
|
|
81
|
-
"@multiplatform.one/router": "7.6.
|
|
82
|
-
"@multiplatform.one/theme": "7.6.
|
|
78
|
+
"@multiplatform.one/forms": "7.6.2",
|
|
79
|
+
"@multiplatform.one/i18n": "7.6.2",
|
|
80
|
+
"@multiplatform.one/platform": "7.6.2",
|
|
81
|
+
"@multiplatform.one/router": "7.6.2",
|
|
82
|
+
"@multiplatform.one/theme": "7.6.2"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@tamagui/build": "2.7.6",
|
|
@@ -99,9 +99,9 @@
|
|
|
99
99
|
"react-native-svg": "15.15.4",
|
|
100
100
|
"react-native-web": "^0.21.2",
|
|
101
101
|
"vitest": "^4.1.5",
|
|
102
|
-
"@multiplatform.one/config": "7.6.
|
|
103
|
-
"@multiplatform.one/storybook": "7.6.
|
|
104
|
-
"@multiplatform.one/test-utils": "7.6.
|
|
102
|
+
"@multiplatform.one/config": "7.6.2",
|
|
103
|
+
"@multiplatform.one/storybook": "7.6.2",
|
|
104
|
+
"@multiplatform.one/test-utils": "7.6.2"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"@mdx-js/mdx": "^3.1.1",
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AsyncSkeleton — the layout-matched loading face AsyncBoundary uses on
|
|
3
|
+
* first load. The boundary has stories; this export did not, so Kitchen
|
|
4
|
+
* Sink never showed the skeleton itself.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
8
|
+
import { YStack } from "tamagui";
|
|
9
|
+
import { AsyncSkeleton, type AsyncBoundaryLayout } from "./AsyncBoundary";
|
|
10
|
+
|
|
11
|
+
const LAYOUTS: AsyncBoundaryLayout[] = ["list", "table", "kanban", "dashboard", "generic"];
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof AsyncSkeleton> = {
|
|
14
|
+
title: "Components/AsyncSkeleton",
|
|
15
|
+
component: AsyncSkeleton,
|
|
16
|
+
parameters: {
|
|
17
|
+
status: { type: "stable" },
|
|
18
|
+
skeletonSpecimen: true,
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component:
|
|
22
|
+
"SKELETON SPECIMEN (D-10). Layout-matched loading placeholder (DG-ST-02). These skeletons persist because the skeleton is the subject.",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
layout: { control: "select", options: LAYOUTS },
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default meta;
|
|
32
|
+
type Story = StoryObj<typeof AsyncSkeleton>;
|
|
33
|
+
|
|
34
|
+
export const Main: Story = {
|
|
35
|
+
name: "Main",
|
|
36
|
+
args: { layout: "list" },
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const List: Story = { args: { layout: "list" } };
|
|
40
|
+
export const Table: Story = { args: { layout: "table" } };
|
|
41
|
+
export const Kanban: Story = { args: { layout: "kanban" } };
|
|
42
|
+
export const Dashboard: Story = { args: { layout: "dashboard" } };
|
|
43
|
+
export const Generic: Story = { args: { layout: "generic" } };
|
|
44
|
+
|
|
45
|
+
export const AllLayouts: Story = {
|
|
46
|
+
render: () => (
|
|
47
|
+
<YStack gap="$6" padding="$4">
|
|
48
|
+
{LAYOUTS.map((layout) => (
|
|
49
|
+
<YStack key={layout} gap="$2">
|
|
50
|
+
<AsyncSkeleton layout={layout} />
|
|
51
|
+
</YStack>
|
|
52
|
+
))}
|
|
53
|
+
</YStack>
|
|
54
|
+
),
|
|
55
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ListCard — Frappe link card / Polaris resource list / Grafana table-lite.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { action } from "@multiplatform.one/storybook";
|
|
6
|
+
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
7
|
+
import { YStack } from "tamagui";
|
|
8
|
+
import { ListCard } from "./Dashboard";
|
|
9
|
+
|
|
10
|
+
const meta: Meta<typeof ListCard> = {
|
|
11
|
+
title: "Components/ListCard",
|
|
12
|
+
component: ListCard,
|
|
13
|
+
parameters: {
|
|
14
|
+
status: { type: "stable" },
|
|
15
|
+
docs: {
|
|
16
|
+
description: {
|
|
17
|
+
component: "Dashboard list widget: a titled card of clickable rows with optional meta.",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof ListCard>;
|
|
25
|
+
|
|
26
|
+
export const Main: Story = {
|
|
27
|
+
name: "Main",
|
|
28
|
+
args: {
|
|
29
|
+
config: {
|
|
30
|
+
id: "links",
|
|
31
|
+
title: "Shortcuts",
|
|
32
|
+
items: [
|
|
33
|
+
{ id: "open", label: "Open quotations", meta: "12", onClick: action("list:open") },
|
|
34
|
+
{ id: "overdue", label: "Overdue invoices", meta: "4", onClick: action("list:overdue") },
|
|
35
|
+
{ id: "draft", label: "Draft orders", meta: "9", onClick: action("list:draft") },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
render: (args) => (
|
|
40
|
+
<YStack width={320} padding="$4">
|
|
41
|
+
<ListCard {...args} />
|
|
42
|
+
</YStack>
|
|
43
|
+
),
|
|
44
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProgressCard — dashboard bar-gauge. The rail is Meter (position within
|
|
3
|
+
* bounds), not Progress-the-task. Composed Dashboard already mounts one;
|
|
4
|
+
* this file is the export's own Kitchen Sink title.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
8
|
+
import { YStack } from "tamagui";
|
|
9
|
+
import { ProgressCard } from "./Dashboard";
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof ProgressCard> = {
|
|
12
|
+
title: "Components/ProgressCard",
|
|
13
|
+
component: ProgressCard,
|
|
14
|
+
parameters: {
|
|
15
|
+
status: { type: "stable" },
|
|
16
|
+
docs: {
|
|
17
|
+
description: {
|
|
18
|
+
component:
|
|
19
|
+
"Dashboard bar-gauge card. The rail is Meter — capacity, not activity toward completion.",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof ProgressCard>;
|
|
27
|
+
|
|
28
|
+
export const Main: Story = {
|
|
29
|
+
name: "Main",
|
|
30
|
+
args: {
|
|
31
|
+
config: {
|
|
32
|
+
id: "quota",
|
|
33
|
+
title: "Quota filled",
|
|
34
|
+
value: 72,
|
|
35
|
+
max: 100,
|
|
36
|
+
format: "percent",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
render: (args) => (
|
|
40
|
+
<YStack width={280} padding="$4">
|
|
41
|
+
<ProgressCard {...args} />
|
|
42
|
+
</YStack>
|
|
43
|
+
),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const NumberFormat: Story = {
|
|
47
|
+
render: () => (
|
|
48
|
+
<YStack width={280} padding="$4">
|
|
49
|
+
<ProgressCard
|
|
50
|
+
config={{
|
|
51
|
+
id: "seats",
|
|
52
|
+
title: "Seats used",
|
|
53
|
+
value: 18,
|
|
54
|
+
max: 25,
|
|
55
|
+
format: "number",
|
|
56
|
+
}}
|
|
57
|
+
/>
|
|
58
|
+
</YStack>
|
|
59
|
+
),
|
|
60
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ShortcutCard — Frappe workspace shortcut: label + nested count pill.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { action } from "@multiplatform.one/storybook";
|
|
6
|
+
import { ShoppingCartIcon } from "@phosphor-icons/react";
|
|
7
|
+
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
8
|
+
import { YStack } from "tamagui";
|
|
9
|
+
import { ShortcutCard } from "./Dashboard";
|
|
10
|
+
|
|
11
|
+
const iconSize = 16;
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof ShortcutCard> = {
|
|
14
|
+
title: "Components/ShortcutCard",
|
|
15
|
+
component: ShortcutCard,
|
|
16
|
+
parameters: {
|
|
17
|
+
status: { type: "stable" },
|
|
18
|
+
docs: {
|
|
19
|
+
description: {
|
|
20
|
+
component: "Frappe workspace shortcut: label plus a nested count pill.",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof ShortcutCard>;
|
|
28
|
+
|
|
29
|
+
export const Main: Story = {
|
|
30
|
+
name: "Main",
|
|
31
|
+
args: {
|
|
32
|
+
config: {
|
|
33
|
+
id: "orders",
|
|
34
|
+
title: "Sales Orders",
|
|
35
|
+
count: 18,
|
|
36
|
+
icon: <ShoppingCartIcon size={iconSize} />,
|
|
37
|
+
onClick: action("shortcut:orders"),
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
render: (args) => (
|
|
41
|
+
<YStack width={280} padding="$4">
|
|
42
|
+
<ShortcutCard {...args} />
|
|
43
|
+
</YStack>
|
|
44
|
+
),
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const NoCount: Story = {
|
|
48
|
+
render: () => (
|
|
49
|
+
<YStack width={280} padding="$4">
|
|
50
|
+
<ShortcutCard
|
|
51
|
+
config={{
|
|
52
|
+
id: "new-order",
|
|
53
|
+
title: "New Order",
|
|
54
|
+
icon: <ShoppingCartIcon size={iconSize} />,
|
|
55
|
+
onClick: action("shortcut:new"),
|
|
56
|
+
}}
|
|
57
|
+
/>
|
|
58
|
+
</YStack>
|
|
59
|
+
),
|
|
60
|
+
};
|