@dataverse-kit/surface-kit 0.1.0 → 0.2.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/README.md +59 -0
- package/dist/index.cjs +150 -181
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -46
- package/dist/index.d.ts +18 -46
- package/dist/index.mjs +23 -56
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -1
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# @dataverse-kit/surface-kit
|
|
2
|
+
|
|
3
|
+
Responsive form shells, containers, sections, and overlay surfaces for Dynamics 365, built on Fluent UI v8 to match Dynamics CE.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
surface-kit is the shared surface/layout layer for Dynamics 365 React apps. It provides the form canvas (`FormSurface`), positioned card sections (`Section`, `SectionCard`), responsive layouts (`ColumnLayout`, `TwoColumnLayout`, `FieldRow`), chrome (`FormHeader`, `CommandSurface`, `ActionBar`, `PivotSurface`, `Footer`), and overlay surfaces (`FormDialogSurface`, `ModalSurface`, `PanelSurface`, `CalloutSurface`, `TooltipSurface`) — all styled to match Dynamics CE and to host grid-kit grids. Every responsive stacking decision flows through shared breakpoints, so viewport (`@media`) and container (PCF `allocatedWidth`) layouts behave identically. The `./core` (pure sizing scalars) and `./responsive` (pure breakpoint/style builders) subpaths are framework-agnostic — no React or Fluent — and are inlined by the export-engine codegen at zero React cost.
|
|
8
|
+
|
|
9
|
+
## When to use it
|
|
10
|
+
|
|
11
|
+
Reach for surface-kit when you need the **form shell** — the page canvas, sections, tabs, command bars, and dialog/panel/modal/callout overlays that wrap your content. For the data **grids** that sit inside those sections, use `@dataverse-kit/grid-kit` instead (surface-kit containers just render `children`; you pass the grid in). For one-off custom-page business controls, use `reusable-components`. surface-kit is the responsive, Dynamics-CE-matching chrome around everything else.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @dataverse-kit/surface-kit
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Requires React 18 and Fluent UI v8 as peer dependencies: `react`, `react-dom`, and `@fluentui/react` (^8.115.6).
|
|
20
|
+
|
|
21
|
+
## Minimal example
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { FormSurface, Section, TwoColumnLayout } from '@dataverse-kit/surface-kit';
|
|
25
|
+
import { TextField } from '@fluentui/react';
|
|
26
|
+
|
|
27
|
+
export function AccountForm() {
|
|
28
|
+
return (
|
|
29
|
+
<FormSurface columns={12} maxWidth={1200}>
|
|
30
|
+
<Section title="Account Information" columnSpan={12} collapsible>
|
|
31
|
+
<TwoColumnLayout>
|
|
32
|
+
<TextField label="Account Name" />
|
|
33
|
+
<TextField label="Phone" />
|
|
34
|
+
</TwoColumnLayout>
|
|
35
|
+
</Section>
|
|
36
|
+
|
|
37
|
+
<Section title="Address" columnSpan={6} variant="flat">
|
|
38
|
+
<TextField label="City" />
|
|
39
|
+
</Section>
|
|
40
|
+
</FormSurface>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Key exports
|
|
46
|
+
|
|
47
|
+
| Export | Purpose |
|
|
48
|
+
|--------|---------|
|
|
49
|
+
| `FormSurface` | The N-column form canvas that hosts Sections; stacks to one column below a breakpoint (viewport or PCF container width). |
|
|
50
|
+
| `Section` / `SectionCard` | Dynamics-CE form section — a grid-positioned card with header, optional command bar, and an internal field grid; supports `card`/`flat`/`placeholder` variants and collapse. |
|
|
51
|
+
| `TwoColumnLayout` / `ColumnLayout` / `FieldRow` | Responsive field layouts that collapse to a single column below `collapseBelow`. |
|
|
52
|
+
| `FormDialogSurface` / `ModalSurface` / `PanelSurface` / `CalloutSurface` / `TooltipSurface` | Fluent v8 overlay surfaces sized to match the Dynamics CE / codegen presets. |
|
|
53
|
+
| `FormHeader` / `CommandSurface` / `ActionBar` / `PivotSurface` / `Footer` | Form chrome — header, command bars, tabs, and footer. |
|
|
54
|
+
| `MasterDetailSurface` / `DashboardSurface` | Composite multi-pane surfaces. |
|
|
55
|
+
| `fromFormDefinition` | Adapter that builds a surface tree from a (duck-typed) form definition. |
|
|
56
|
+
| `createDynamicsTheme` | Canonical Dynamics token theme factory. |
|
|
57
|
+
| `./core`, `./responsive` (subpaths) | Pure-TS sizing scalars and breakpoint/style builders — framework-agnostic, shared with the export-engine codegen. |
|
|
58
|
+
|
|
59
|
+
> See [`CLAUDE.md`](./CLAUDE.md) for the full architecture / contributor reference.
|