@zvk/composite 0.1.2 → 0.1.4

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +158 -1
  3. package/dist/domains/activity.d.ts +2 -0
  4. package/dist/domains/activity.js +1 -0
  5. package/dist/domains/ai.d.ts +6 -0
  6. package/dist/domains/ai.js +3 -0
  7. package/dist/domains/data.d.ts +10 -0
  8. package/dist/domains/data.js +5 -0
  9. package/dist/domains/detail.d.ts +2 -0
  10. package/dist/domains/detail.js +1 -0
  11. package/dist/domains/forms.d.ts +4 -0
  12. package/dist/domains/forms.js +2 -0
  13. package/dist/domains/navigation.d.ts +16 -0
  14. package/dist/domains/navigation.js +8 -0
  15. package/dist/domains/settings.d.ts +6 -0
  16. package/dist/domains/settings.js +3 -0
  17. package/dist/domains/shell.d.ts +6 -0
  18. package/dist/domains/shell.js +3 -0
  19. package/dist/domains/state.d.ts +4 -0
  20. package/dist/domains/state.js +2 -0
  21. package/dist/domains/workflow.d.ts +8 -0
  22. package/dist/domains/workflow.js +4 -0
  23. package/dist/index.d.ts +10 -56
  24. package/dist/index.js +10 -28
  25. package/dist/layout/page-scaffold.js +17 -9
  26. package/dist/navigation/command-palette-shell.d.ts +2 -1
  27. package/dist/navigation/command-palette-shell.js +3 -13
  28. package/dist/navigation/entity-switcher-menu.js +1 -11
  29. package/dist/navigation/resource-explorer-shell.d.ts +31 -0
  30. package/dist/navigation/resource-explorer-shell.js +30 -0
  31. package/dist/navigation/sectioned-workspace-shell.js +13 -6
  32. package/dist/navigation/shell-slot-rendering.d.ts +13 -0
  33. package/dist/navigation/shell-slot-rendering.js +25 -0
  34. package/dist/navigation/simple-workspace-shell.d.ts +16 -0
  35. package/dist/navigation/simple-workspace-shell.js +25 -0
  36. package/dist/navigation/split-workspace-shell.d.ts +24 -0
  37. package/dist/navigation/split-workspace-shell.js +32 -0
  38. package/dist/styles.css +272 -20
  39. package/dist/utils/use-controllable-value.d.ts +7 -0
  40. package/dist/utils/use-controllable-value.js +12 -0
  41. package/dist/workflows/wizard-shell.d.ts +24 -0
  42. package/dist/workflows/wizard-shell.js +32 -0
  43. package/package.json +22 -2
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Stepper } from "@zvk/ui/stepper";
5
+ import { cn } from "../utils/cn.js";
6
+ import { WorkspaceHeader } from "../navigation/workspace-header.js";
7
+ function toStepperItem(step) {
8
+ return {
9
+ description: step.description,
10
+ disabled: step.disabled === true || step.status === "disabled",
11
+ id: step.id,
12
+ label: step.label
13
+ };
14
+ }
15
+ function isLinear(steps, currentStepId) {
16
+ const currentIndex = steps.findIndex((step) => step.id === currentStepId);
17
+ return steps.every((step, index) => {
18
+ if (step.status === "complete" || step.status === "current") {
19
+ return index <= currentIndex;
20
+ }
21
+ return true;
22
+ });
23
+ }
24
+ export function WizardShell({ actions, children, className, currentStepId, description, footer, headingLevel, onStepChange, progress, ref, steps, title, ...props }) {
25
+ const stepperProps = {
26
+ ...(onStepChange === undefined ? {} : { onValueChange: onStepChange })
27
+ };
28
+ const headerProps = {
29
+ ...(headingLevel === undefined ? {} : { headingLevel })
30
+ };
31
+ return (_jsxs("div", { ...props, ref: ref, className: cn("zvk-composite-wizard-shell", className), children: [_jsx(WorkspaceHeader, { ...headerProps, actions: actions, className: "zvk-composite-wizard-shell__header", description: description, title: title }), _jsx("div", { className: "zvk-composite-wizard-shell__progress", children: progress ?? (_jsx(Stepper, { ...stepperProps, "aria-label": "Wizard progress", interactive: Boolean(onStepChange), items: steps.map(toStepperItem), linear: isLinear(steps, currentStepId), value: currentStepId })) }), _jsx("main", { className: "zvk-composite-wizard-shell__content", children: children }), footer ? _jsx("footer", { className: "zvk-composite-wizard-shell__footer", children: footer }) : null] }));
32
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zvk/composite",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Drop-in composite React components built from @zvk/ui primitives for product workspaces.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -49,11 +49,26 @@
49
49
  "import": "./dist/navigation/command-palette-shell.js",
50
50
  "default": "./dist/navigation/command-palette-shell.js"
51
51
  },
52
+ "./resource-explorer-shell": {
53
+ "types": "./dist/navigation/resource-explorer-shell.d.ts",
54
+ "import": "./dist/navigation/resource-explorer-shell.js",
55
+ "default": "./dist/navigation/resource-explorer-shell.js"
56
+ },
52
57
  "./sectioned-workspace-shell": {
53
58
  "types": "./dist/navigation/sectioned-workspace-shell.d.ts",
54
59
  "import": "./dist/navigation/sectioned-workspace-shell.js",
55
60
  "default": "./dist/navigation/sectioned-workspace-shell.js"
56
61
  },
62
+ "./simple-workspace-shell": {
63
+ "types": "./dist/navigation/simple-workspace-shell.d.ts",
64
+ "import": "./dist/navigation/simple-workspace-shell.js",
65
+ "default": "./dist/navigation/simple-workspace-shell.js"
66
+ },
67
+ "./split-workspace-shell": {
68
+ "types": "./dist/navigation/split-workspace-shell.d.ts",
69
+ "import": "./dist/navigation/split-workspace-shell.js",
70
+ "default": "./dist/navigation/split-workspace-shell.js"
71
+ },
57
72
  "./workspace-header": {
58
73
  "types": "./dist/navigation/workspace-header.d.ts",
59
74
  "import": "./dist/navigation/workspace-header.js",
@@ -129,6 +144,11 @@
129
144
  "import": "./dist/workflows/process-list-panel.js",
130
145
  "default": "./dist/workflows/process-list-panel.js"
131
146
  },
147
+ "./wizard-shell": {
148
+ "types": "./dist/workflows/wizard-shell.d.ts",
149
+ "import": "./dist/workflows/wizard-shell.js",
150
+ "default": "./dist/workflows/wizard-shell.js"
151
+ },
132
152
  "./parameter-editor": {
133
153
  "types": "./dist/settings/parameter-editor.d.ts",
134
154
  "import": "./dist/settings/parameter-editor.js",
@@ -197,7 +217,7 @@
197
217
  "react-dom": "^19.0.0"
198
218
  },
199
219
  "dependencies": {
200
- "@zvk/ui": "^0.1.9"
220
+ "@zvk/ui": "^0.1.12"
201
221
  },
202
222
  "tsd": {
203
223
  "directory": "tests/types"