@dataverse-kit/surface-kit 0.1.0 → 0.2.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 khester
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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.