@minlang/design-system 0.2.0 → 0.3.0
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/components/DetailCard.d.ts +3 -0
- package/dist/components/DetailCard.js +9 -0
- package/dist/components/EffectForm.d.ts +3 -0
- package/dist/components/EffectForm.js +7 -0
- package/dist/components/FormField.js +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/registry.js +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cellText, rowsFromViewModel } from "./cellText.js";
|
|
3
|
+
export const DetailCard = ({ node, deps }) => {
|
|
4
|
+
const row = rowsFromViewModel(deps.viewModels[node.query])[0];
|
|
5
|
+
if (row === undefined) {
|
|
6
|
+
return (_jsx("p", { role: "note", className: "rounded-ml-md border border-dashed border-edge p-ml-lg text-center text-ink-muted", children: "No result yet." }));
|
|
7
|
+
}
|
|
8
|
+
return (_jsx("section", { "aria-label": node.a11y.label, className: "rounded-ml-lg border border-edge bg-surface p-ml-lg", children: _jsx("dl", { className: "grid gap-ml-sm", children: node.fields.map((field) => (_jsxs("div", { className: "grid gap-1", children: [_jsx("dt", { className: "text-xs font-semibold uppercase tracking-wide text-ink-muted", children: field.label }), _jsx("dd", { className: "text-ink", children: cellText(row, field) })] }, field.field))) }) }));
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ActionFormClient } from "./ActionFormClient.js";
|
|
3
|
+
import { fieldOptions } from "./fieldOptions.js";
|
|
4
|
+
export const EffectForm = ({ node, deps }) => (_jsxs("section", { "aria-label": node.a11y.label, className: "rounded-ml-lg border border-edge bg-surface p-ml-lg shadow-ml-sm", children: [_jsx(ActionFormClient, { label: node.a11y.label, submitLabel: node.submitLabel, errorId: `effect-form-error-${node.name}`, fields: node.fields.map((field) => ({
|
|
5
|
+
field,
|
|
6
|
+
options: fieldOptions(field, deps.state),
|
|
7
|
+
})), handler: deps.actions[node.action] ?? null }), _jsx("p", { className: "mt-ml-sm text-sm text-ink-muted", "aria-live": "polite", children: node.pendingCopy })] }));
|
|
@@ -8,6 +8,9 @@ const Control = ({ id, field, options, }) => {
|
|
|
8
8
|
if (field.control === "checkbox") {
|
|
9
9
|
return _jsx("input", { id: id, name: field.name, type: "checkbox", className: "h-4 w-4 accent-primary" });
|
|
10
10
|
}
|
|
11
|
+
if (field.control === "file") {
|
|
12
|
+
return _jsx("input", { id: id, name: field.name, type: "file", className: inputClass });
|
|
13
|
+
}
|
|
11
14
|
const type = field.control === "number" ? "number" : field.control === "datetime" ? "datetime-local" : "text";
|
|
12
15
|
return _jsx("input", { id: id, name: field.name, type: type, className: inputClass });
|
|
13
16
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export { ActionForm } from "./components/ActionForm.js";
|
|
|
10
10
|
export { ActionFormClient } from "./components/ActionFormClient.js";
|
|
11
11
|
export { CardGrid } from "./components/CardGrid.js";
|
|
12
12
|
export { DataTable } from "./components/DataTable.js";
|
|
13
|
+
export { DetailCard } from "./components/DetailCard.js";
|
|
14
|
+
export { EffectForm } from "./components/EffectForm.js";
|
|
13
15
|
export { EmptyState } from "./components/EmptyState.js";
|
|
14
16
|
export { FormField } from "./components/FormField.js";
|
|
15
17
|
export { Heading } from "./components/Heading.js";
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,8 @@ export { ActionForm } from "./components/ActionForm.js";
|
|
|
12
12
|
export { ActionFormClient } from "./components/ActionFormClient.js";
|
|
13
13
|
export { CardGrid } from "./components/CardGrid.js";
|
|
14
14
|
export { DataTable } from "./components/DataTable.js";
|
|
15
|
+
export { DetailCard } from "./components/DetailCard.js";
|
|
16
|
+
export { EffectForm } from "./components/EffectForm.js";
|
|
15
17
|
export { EmptyState } from "./components/EmptyState.js";
|
|
16
18
|
export { FormField } from "./components/FormField.js";
|
|
17
19
|
export { Heading } from "./components/Heading.js";
|
package/dist/registry.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import { ActionForm } from "./components/ActionForm.js";
|
|
6
6
|
import { CardGrid } from "./components/CardGrid.js";
|
|
7
7
|
import { DataTable } from "./components/DataTable.js";
|
|
8
|
+
import { DetailCard } from "./components/DetailCard.js";
|
|
9
|
+
import { EffectForm } from "./components/EffectForm.js";
|
|
8
10
|
import { EmptyState } from "./components/EmptyState.js";
|
|
9
11
|
import { Heading } from "./components/Heading.js";
|
|
10
12
|
import { HeadlineBanner } from "./components/HeadlineBanner.js";
|
|
@@ -24,6 +26,8 @@ export const defaultRegistry = {
|
|
|
24
26
|
table: DataTable,
|
|
25
27
|
card_grid: CardGrid,
|
|
26
28
|
form: ActionForm,
|
|
29
|
+
effect_form: EffectForm,
|
|
30
|
+
detail: DetailCard,
|
|
27
31
|
primary_action: PrimaryActionButton,
|
|
28
32
|
secondary_action: SecondaryActionButton,
|
|
29
33
|
tap_target: TapTargetButton,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minlang/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@minlang/runtime-web": "^0.
|
|
12
|
+
"@minlang/runtime-web": "^0.3.0"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": "19.2.7"
|