@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/dist/index.cjs CHANGED
@@ -29,6 +29,7 @@ __export(src_exports, {
29
29
  CommandSurface: () => CommandSurface,
30
30
  DIALOG_SIZE_PX: () => DIALOG_SIZE_PX,
31
31
  DashboardSurface: () => DashboardSurface,
32
+ DensityContext: () => DensityContext,
32
33
  FieldRow: () => FieldRow,
33
34
  Footer: () => Footer,
34
35
  FormDialogSurface: () => FormDialogSurface,
@@ -49,7 +50,7 @@ __export(src_exports, {
49
50
  calloutFormDefaults: () => calloutFormDefaults,
50
51
  calloutWidthPx: () => calloutWidthPx,
51
52
  clampSpan: () => clampSpan,
52
- colors: () => colors,
53
+ colors: () => import_design_tokens.colors,
53
54
  createDynamicsTheme: () => createDynamicsTheme,
54
55
  densityScale: () => densityScale,
55
56
  dialogHeightCss: () => dialogHeightCss,
@@ -59,19 +60,20 @@ __export(src_exports, {
59
60
  fieldRowStyle: () => fieldRowStyle,
60
61
  fromFormDefinition: () => fromFormDefinition,
61
62
  gridTemplateForColumns: () => gridTemplateForColumns,
62
- layout: () => layout,
63
+ layout: () => import_design_tokens.layout,
63
64
  panelCustomWidthPx: () => panelCustomWidthPx,
64
65
  panelKindFromWidth: () => panelKindFromWidth,
65
- radius: () => radius,
66
+ radius: () => import_design_tokens.radius,
66
67
  resolveBreakpoint: () => resolveBreakpoint,
67
68
  resolveResponsiveValue: () => resolveResponsiveValue,
68
69
  scaleSpacing: () => scaleSpacing,
69
70
  sectionStackingStyle: () => sectionStackingStyle,
70
- spacing: () => spacing,
71
- typography: () => typography,
71
+ spacing: () => import_design_tokens.spacing,
72
+ typography: () => import_design_tokens.typography,
72
73
  useContainerBreakpoint: () => useContainerBreakpoint,
73
74
  useContainerSize: () => useContainerSize,
74
75
  useContainerWidth: () => useContainerWidth,
76
+ useDensity: () => useDensity,
75
77
  useMediaQuery: () => useMediaQuery,
76
78
  useResponsiveValue: () => useResponsiveValue
77
79
  });
@@ -199,80 +201,32 @@ function fieldRowStyle(labelWidth = "130px", mode = "media") {
199
201
  }
200
202
 
201
203
  // src/tokens/tokens.ts
202
- var colors = {
203
- brand: "#0078d4",
204
- brandHover: "#106ebe",
205
- brandDark: "#005a9e",
206
- borderNeutral: "#edebe9",
207
- textPrimary: "#323130",
208
- textSecondary: "#605e5c",
209
- surface: "#ffffff",
210
- surfaceAlt: "#f5f5f5",
211
- // App canvas behind cards/forms (matches the Dynamics model-driven form background).
212
- canvas: "#fafafa",
213
- // Required-field asterisk / error accent (Fluent error red).
214
- danger: "#a4262c",
215
- // Field input: subtle idle fill + neutral border (Dynamics-style).
216
- fieldFill: "#faf9f8",
217
- fieldFillReadonly: "#f3f2f1",
218
- fieldBorder: "#e1dfdd"
219
- };
220
- var spacing = {
221
- xs: 4,
222
- sm: 8,
223
- md: 12,
224
- lg: 16,
225
- xl: 24,
226
- xxl: 40
227
- };
228
- var typography = {
229
- fontFamily: '"Segoe UI", Arial, sans-serif',
230
- fontFamilySemibold: '"Segoe UI Semibold", "Segoe UI", sans-serif',
231
- fontSize: {
232
- sm: "12px",
233
- smPlus: "13px",
234
- md: "14px",
235
- lg: "17px"
236
- },
237
- fontWeight: {
238
- regular: 400,
239
- semibold: 600
240
- }
241
- };
242
- var radius = {
243
- card: "4px",
244
- // Softer rounding for the outer form shell (matches Dynamics cards).
245
- lg: "8px"
246
- };
247
- var layout = {
248
- // Width of the label column in a two-column "Label : input" field row.
249
- labelColWidth: "130px"
250
- };
204
+ var import_design_tokens = require("@dataverse-kit/design-tokens");
251
205
 
252
206
  // src/tokens/theme.ts
253
207
  var import_react = require("@fluentui/react");
254
208
  function createDynamicsTheme() {
255
209
  return (0, import_react.createTheme)({
256
210
  palette: {
257
- themePrimary: colors.brand,
258
- themeDarkAlt: colors.brandHover,
259
- themeDark: colors.brandDark,
260
- themeDarker: colors.brandDark,
261
- neutralPrimary: colors.textPrimary,
262
- neutralSecondary: colors.textSecondary,
263
- neutralLight: colors.borderNeutral,
264
- neutralLighter: colors.surfaceAlt,
265
- white: colors.surface,
266
- redDark: colors.danger
211
+ themePrimary: import_design_tokens.colors.brand,
212
+ themeDarkAlt: import_design_tokens.colors.brandHover,
213
+ themeDark: import_design_tokens.colors.brandDark,
214
+ themeDarker: import_design_tokens.colors.brandDark,
215
+ neutralPrimary: import_design_tokens.colors.textPrimary,
216
+ neutralSecondary: import_design_tokens.colors.textSecondary,
217
+ neutralLight: import_design_tokens.colors.borderNeutral,
218
+ neutralLighter: import_design_tokens.colors.surfaceAlt,
219
+ white: import_design_tokens.colors.surface,
220
+ redDark: import_design_tokens.colors.danger
267
221
  },
268
222
  defaultFontStyle: {
269
- fontFamily: typography.fontFamily
223
+ fontFamily: import_design_tokens.typography.fontFamily
270
224
  },
271
225
  semanticColors: {
272
- errorText: colors.danger,
273
- inputBorder: colors.fieldBorder,
274
- inputBackground: colors.fieldFill,
275
- bodyBackground: colors.surface
226
+ errorText: import_design_tokens.colors.danger,
227
+ inputBorder: import_design_tokens.colors.fieldBorder,
228
+ inputBackground: import_design_tokens.colors.fieldFill,
229
+ bodyBackground: import_design_tokens.colors.surface
276
230
  }
277
231
  });
278
232
  }
@@ -344,8 +298,13 @@ function useMediaQuery(query) {
344
298
  return matches;
345
299
  }
346
300
 
301
+ // src/hooks/useDensity.ts
302
+ var import_react5 = require("react");
303
+ var DensityContext = (0, import_react5.createContext)("comfortable");
304
+ var useDensity = () => (0, import_react5.useContext)(DensityContext);
305
+
347
306
  // src/layouts/ColumnLayout.tsx
348
- var import_react5 = require("@fluentui/react");
307
+ var import_react6 = require("@fluentui/react");
349
308
  var import_jsx_runtime = require("react/jsx-runtime");
350
309
  var ColumnLayout = ({
351
310
  columns,
@@ -357,12 +316,12 @@ var ColumnLayout = ({
357
316
  children
358
317
  }) => {
359
318
  const base = responsive ? fieldGridStyle(columns, mode) : { display: "grid", gridTemplateColumns: gridTemplateForColumns(columns) };
360
- const cls = (0, import_react5.mergeStyles)(base, { gap }, className);
319
+ const cls = (0, import_react6.mergeStyles)(base, { gap }, className);
361
320
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cls, style, children });
362
321
  };
363
322
 
364
323
  // src/layouts/TwoColumnLayout.tsx
365
- var import_react6 = require("@fluentui/react");
324
+ var import_react7 = require("@fluentui/react");
366
325
  var import_jsx_runtime2 = require("react/jsx-runtime");
367
326
  var TwoColumnLayout = ({
368
327
  gap = 16,
@@ -371,7 +330,7 @@ var TwoColumnLayout = ({
371
330
  style,
372
331
  children
373
332
  }) => {
374
- const cls = (0, import_react6.mergeStyles)(
333
+ const cls = (0, import_react7.mergeStyles)(
375
334
  {
376
335
  display: "grid",
377
336
  gridTemplateColumns: "1fr 1fr",
@@ -387,7 +346,7 @@ var TwoColumnLayout = ({
387
346
  };
388
347
 
389
348
  // src/layouts/FieldRow.tsx
390
- var import_react7 = require("@fluentui/react");
349
+ var import_react8 = require("@fluentui/react");
391
350
  var import_jsx_runtime3 = require("react/jsx-runtime");
392
351
  var FieldRow = ({
393
352
  label,
@@ -398,7 +357,7 @@ var FieldRow = ({
398
357
  className,
399
358
  children
400
359
  }) => {
401
- const styles = (0, import_react7.mergeStyleSets)({
360
+ const styles = (0, import_react8.mergeStyleSets)({
402
361
  // The beside layout IS the shared responsive builder (130px label grid + @480
403
362
  // stack) — no hand-written breakpoint here.
404
363
  rowBeside: fieldRowStyle(labelWidth, "media"),
@@ -409,14 +368,14 @@ var FieldRow = ({
409
368
  minHeight: 38
410
369
  },
411
370
  label: {
412
- fontSize: typography.fontSize.sm,
413
- fontWeight: typography.fontWeight.semibold,
414
- color: colors.textPrimary,
415
- fontFamily: typography.fontFamily,
371
+ fontSize: import_design_tokens.typography.fontSize.sm,
372
+ fontWeight: import_design_tokens.typography.fontWeight.semibold,
373
+ color: import_design_tokens.colors.textPrimary,
374
+ fontFamily: import_design_tokens.typography.fontFamily,
416
375
  lineHeight: "1.3",
417
376
  wordBreak: "break-word"
418
377
  },
419
- required: { color: colors.danger, marginLeft: 2, fontWeight: typography.fontWeight.semibold },
378
+ required: { color: import_design_tokens.colors.danger, marginLeft: 2, fontWeight: import_design_tokens.typography.fontWeight.semibold },
420
379
  full: { gridColumn: "1 / -1" }
421
380
  });
422
381
  const cls = [
@@ -434,21 +393,21 @@ var FieldRow = ({
434
393
  };
435
394
 
436
395
  // src/containers/FormSurface.tsx
437
- var import_react8 = require("@fluentui/react");
396
+ var import_react9 = require("@fluentui/react");
438
397
 
439
398
  // src/internal/styles.ts
440
399
  var sharedTitleStyle = {
441
- fontWeight: typography.fontWeight.semibold,
442
- fontSize: typography.fontSize.md,
443
- color: colors.textPrimary,
444
- fontFamily: typography.fontFamilySemibold,
400
+ fontWeight: import_design_tokens.typography.fontWeight.semibold,
401
+ fontSize: import_design_tokens.typography.fontSize.md,
402
+ color: import_design_tokens.colors.textPrimary,
403
+ fontFamily: import_design_tokens.typography.fontFamilySemibold,
445
404
  paddingBottom: 0,
446
405
  marginBottom: 0
447
406
  };
448
407
  var dynamicsCardStyle = {
449
- background: colors.surface,
450
- border: `1px solid ${colors.borderNeutral}`,
451
- borderRadius: radius.card,
408
+ background: import_design_tokens.colors.surface,
409
+ border: `1px solid ${import_design_tokens.colors.borderNeutral}`,
410
+ borderRadius: import_design_tokens.radius.card,
452
411
  overflow: "hidden"
453
412
  };
454
413
  var cardShadow = "0 1.6px 3.6px rgba(0, 0, 0, 0.08), 0 0.3px 0.9px rgba(0, 0, 0, 0.05)";
@@ -468,7 +427,8 @@ var FormSurface = ({
468
427
  columns = 12,
469
428
  gap = 20,
470
429
  padding = 20,
471
- background = colors.canvas,
430
+ density = "comfortable",
431
+ background = import_design_tokens.colors.canvas,
472
432
  containerWidth,
473
433
  collapseBelow = "sm",
474
434
  maxWidth,
@@ -478,12 +438,14 @@ var FormSurface = ({
478
438
  }) => {
479
439
  const collapsePx = BREAKPOINTS[collapseBelow];
480
440
  const forceStack = containerWidth != null && containerWidth <= collapsePx;
481
- const cls = (0, import_react8.mergeStyles)(
441
+ const scaledGap = scaleSpacing(gap, density);
442
+ const scaledPadding = scaleSpacing(padding, density);
443
+ const cls = (0, import_react9.mergeStyles)(
482
444
  {
483
445
  display: "grid",
484
446
  gridTemplateColumns: forceStack ? "1fr" : `repeat(${columns}, 1fr)`,
485
- gap,
486
- padding,
447
+ gap: scaledGap,
448
+ padding: scaledPadding,
487
449
  background,
488
450
  alignItems: "start",
489
451
  ...maxWidth != null ? { maxWidth, marginLeft: "auto", marginRight: "auto" } : {},
@@ -497,7 +459,7 @@ var FormSurface = ({
497
459
  },
498
460
  className
499
461
  );
500
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: cls, style, children });
462
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DensityContext.Provider, { value: density, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: cls, style, children }) });
501
463
  };
502
464
 
503
465
  // src/containers/PageSurface.tsx
@@ -505,11 +467,11 @@ var import_jsx_runtime5 = require("react/jsx-runtime");
505
467
  var PageSurface = ({ centered, maxWidth, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FormSurface, { maxWidth: maxWidth ?? (centered ? 1200 : void 0), ...rest });
506
468
 
507
469
  // src/containers/Section.tsx
508
- var import_react10 = require("react");
509
- var import_react11 = require("@fluentui/react");
470
+ var import_react11 = require("react");
471
+ var import_react12 = require("@fluentui/react");
510
472
 
511
473
  // src/containers/SectionHeader.tsx
512
- var import_react9 = require("@fluentui/react");
474
+ var import_react10 = require("@fluentui/react");
513
475
  var import_jsx_runtime6 = require("react/jsx-runtime");
514
476
  var SectionHeader = ({
515
477
  title,
@@ -521,20 +483,20 @@ var SectionHeader = ({
521
483
  collapsed,
522
484
  onToggle
523
485
  }) => {
524
- const styles = (0, import_react9.mergeStyleSets)({
486
+ const styles = (0, import_react10.mergeStyleSets)({
525
487
  root: {
526
488
  display: "flex",
527
489
  justifyContent: "space-between",
528
490
  alignItems: "center",
529
491
  flexWrap: "nowrap",
530
- borderBottom: `1px solid ${colors.borderNeutral}`,
492
+ borderBottom: `1px solid ${import_design_tokens.colors.borderNeutral}`,
531
493
  marginBottom: 16,
532
494
  minHeight: 48,
533
495
  width: "100%"
534
496
  },
535
497
  left: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 },
536
498
  title: sharedTitleStyle,
537
- status: { marginLeft: 8, fontSize: "0.9em", color: colors.textSecondary },
499
+ status: { marginLeft: 8, fontSize: "0.9em", color: import_design_tokens.colors.textSecondary },
538
500
  chevron: {
539
501
  cursor: "pointer",
540
502
  border: "none",
@@ -542,7 +504,7 @@ var SectionHeader = ({
542
504
  padding: 4,
543
505
  display: "flex",
544
506
  alignItems: "center",
545
- color: colors.textSecondary
507
+ color: import_design_tokens.colors.textSecondary
546
508
  }
547
509
  });
548
510
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: styles.root, children: [
@@ -555,14 +517,14 @@ var SectionHeader = ({
555
517
  onClick: onToggle,
556
518
  "aria-label": collapsed ? "Expand section" : "Collapse section",
557
519
  "aria-expanded": !collapsed,
558
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react9.Icon, { iconName: collapsed ? "ChevronRight" : "ChevronDown" })
520
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react10.Icon, { iconName: collapsed ? "ChevronRight" : "ChevronDown" })
559
521
  }
560
522
  ),
561
523
  title && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: styles.title, children: title }),
562
524
  statusText && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: styles.status, children: statusText })
563
525
  ] }),
564
526
  actions ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: actions }) : showCommandBar && commandBarItems.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
565
- import_react9.CommandBar,
527
+ import_react10.CommandBar,
566
528
  {
567
529
  items: commandBarItems.slice(0, 2),
568
530
  overflowItems: commandBarItems.slice(2),
@@ -590,45 +552,50 @@ var Section = ({
590
552
  onCollapsedChange,
591
553
  variant = "card",
592
554
  minHeight = 80,
555
+ density: densityProp,
593
556
  className,
594
557
  style,
595
558
  children
596
559
  }) => {
597
- const [internalCollapsed, setInternalCollapsed] = (0, import_react10.useState)(defaultCollapsed);
560
+ const [internalCollapsed, setInternalCollapsed] = (0, import_react11.useState)(defaultCollapsed);
598
561
  const collapsed = controlledCollapsed ?? internalCollapsed;
599
562
  const toggle = () => {
600
563
  const next = !collapsed;
601
564
  if (controlledCollapsed == null) setInternalCollapsed(next);
602
565
  onCollapsedChange?.(next);
603
566
  };
567
+ const ctxDensity = useDensity();
568
+ const density = densityProp ?? ctxDensity;
569
+ const cardPad = `${scaleSpacing(3, density)}px ${scaleSpacing(20, density)}px ${scaleSpacing(20, density)}px ${scaleSpacing(20, density)}px`;
570
+ const bodyGap = scaleSpacing(7, density);
604
571
  const gridColumn = columnStart ? `${columnStart} / span ${columnSpan}` : `span ${columnSpan}`;
605
572
  const rootStyle = {
606
573
  gridColumn,
607
574
  ...rowPosition ? { gridRowStart: rowPosition } : {},
608
575
  ...style
609
576
  };
610
- const styles = (0, import_react11.mergeStyleSets)({
611
- card: { ...dynamicsCardStyle, boxShadow: cardShadow, padding: "3px 20px 20px 20px", minWidth: 300, width: "100%" },
577
+ const styles = (0, import_react12.mergeStyleSets)({
578
+ card: { ...dynamicsCardStyle, boxShadow: cardShadow, padding: cardPad, minWidth: 300, width: "100%" },
612
579
  flat: {
613
- background: colors.surface,
614
- borderRadius: radius.card,
615
- padding: "3px 20px 20px 20px",
580
+ background: import_design_tokens.colors.surface,
581
+ borderRadius: import_design_tokens.radius.card,
582
+ padding: cardPad,
616
583
  minWidth: 300,
617
584
  width: "100%",
618
585
  overflow: "hidden"
619
586
  },
620
587
  placeholder: {
621
- border: `1px dashed ${colors.borderNeutral}`,
622
- borderRadius: radius.card,
588
+ border: `1px dashed ${import_design_tokens.colors.borderNeutral}`,
589
+ borderRadius: import_design_tokens.radius.card,
623
590
  minHeight,
624
591
  width: "100%",
625
592
  background: "transparent"
626
593
  },
627
- notification: { marginBottom: 8 },
594
+ notification: { marginBottom: scaleSpacing(8, density) },
628
595
  body: {
629
596
  display: "grid",
630
597
  gridTemplateColumns: `repeat(${internalColumns}, 1fr)`,
631
- gap: 7,
598
+ gap: bodyGap,
632
599
  alignItems: "start",
633
600
  selectors: {
634
601
  [`@media (max-width: ${BREAKPOINTS.sm}px)`]: { selectors: { "> *": { gridColumn: "1 / -1" } } }
@@ -660,7 +627,7 @@ var Section = ({
660
627
  // src/containers/SectionCard.tsx
661
628
  var import_jsx_runtime8 = require("react/jsx-runtime");
662
629
  var SectionCard = ({
663
- accentColor = colors.brand,
630
+ accentColor = import_design_tokens.colors.brand,
664
631
  accentWidth = 3,
665
632
  variant = "card",
666
633
  style,
@@ -675,7 +642,7 @@ var SectionCard = ({
675
642
  );
676
643
 
677
644
  // src/containers/FormHeader.tsx
678
- var import_react12 = require("@fluentui/react");
645
+ var import_react13 = require("@fluentui/react");
679
646
  var import_jsx_runtime9 = require("react/jsx-runtime");
680
647
  var FormHeader = ({
681
648
  title,
@@ -687,27 +654,27 @@ var FormHeader = ({
687
654
  actions,
688
655
  className
689
656
  }) => {
690
- const styles = (0, import_react12.mergeStyleSets)({
657
+ const styles = (0, import_react13.mergeStyleSets)({
691
658
  root: {
692
659
  display: "flex",
693
660
  alignItems: "center",
694
661
  justifyContent: "space-between",
695
662
  gap: 12,
696
663
  padding: "12px 24px",
697
- borderBottom: `1px solid ${colors.borderNeutral}`,
698
- background: colors.surface
664
+ borderBottom: `1px solid ${import_design_tokens.colors.borderNeutral}`,
665
+ background: import_design_tokens.colors.surface
699
666
  },
700
667
  main: { display: "flex", alignItems: "center", gap: 12, minWidth: 0 },
701
668
  titleRow: { display: "flex", alignItems: "baseline", gap: 8, flexWrap: "wrap" },
702
669
  title: {
703
- fontSize: typography.fontSize.lg,
704
- fontWeight: typography.fontWeight.semibold,
705
- fontFamily: typography.fontFamilySemibold,
706
- color: titleColor || colors.textPrimary,
670
+ fontSize: import_design_tokens.typography.fontSize.lg,
671
+ fontWeight: import_design_tokens.typography.fontWeight.semibold,
672
+ fontFamily: import_design_tokens.typography.fontFamilySemibold,
673
+ color: titleColor || import_design_tokens.colors.textPrimary,
707
674
  lineHeight: "1.3"
708
675
  },
709
- status: { fontSize: typography.fontSize.smPlus, color: colors.textSecondary },
710
- subtitle: { fontSize: typography.fontSize.smPlus, color: subtitleColor || colors.textSecondary, marginTop: 2 }
676
+ status: { fontSize: import_design_tokens.typography.fontSize.smPlus, color: import_design_tokens.colors.textSecondary },
677
+ subtitle: { fontSize: import_design_tokens.typography.fontSize.smPlus, color: subtitleColor || import_design_tokens.colors.textSecondary, marginTop: 2 }
711
678
  });
712
679
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: [styles.root, className].filter(Boolean).join(" "), children: [
713
680
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: styles.main, children: [
@@ -725,8 +692,8 @@ var FormHeader = ({
725
692
  };
726
693
 
727
694
  // src/containers/PivotSurface.tsx
728
- var import_react13 = require("react");
729
- var import_react14 = require("@fluentui/react");
695
+ var import_react14 = require("react");
696
+ var import_react15 = require("@fluentui/react");
730
697
  var import_jsx_runtime10 = require("react/jsx-runtime");
731
698
  var PivotSurface = ({
732
699
  tabs,
@@ -737,7 +704,7 @@ var PivotSurface = ({
737
704
  className
738
705
  }) => {
739
706
  const firstEnabledId = tabs.find((t) => !t.disabled)?.id ?? tabs[0]?.id;
740
- const [internal, setInternal] = (0, import_react13.useState)(defaultSelectedId ?? firstEnabledId);
707
+ const [internal, setInternal] = (0, import_react14.useState)(defaultSelectedId ?? firstEnabledId);
741
708
  const selected = selectedId ?? internal;
742
709
  const handleLinkClick = (item) => {
743
710
  const id = item?.props.itemKey;
@@ -748,14 +715,14 @@ var PivotSurface = ({
748
715
  const active = tabs.find((t) => t.id === selected) ?? tabs[0];
749
716
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className, children: [
750
717
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
751
- import_react14.Pivot,
718
+ import_react15.Pivot,
752
719
  {
753
720
  selectedKey: selected,
754
721
  onLinkClick: handleLinkClick,
755
722
  linkFormat,
756
723
  headersOnly: true,
757
724
  children: tabs.map((t) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
758
- import_react14.PivotItem,
725
+ import_react15.PivotItem,
759
726
  {
760
727
  itemKey: t.id,
761
728
  headerText: t.label,
@@ -771,12 +738,12 @@ var PivotSurface = ({
771
738
  };
772
739
 
773
740
  // src/containers/CommandSurface.tsx
774
- var import_react15 = require("@fluentui/react");
741
+ var import_react16 = require("@fluentui/react");
775
742
  var import_jsx_runtime11 = require("react/jsx-runtime");
776
- var CommandSurface = ({ items, overflowItems, farItems, className }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react15.CommandBar, { items, overflowItems, farItems, styles: { root: { padding: 0 } } }) });
743
+ var CommandSurface = ({ items, overflowItems, farItems, className }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react16.CommandBar, { items, overflowItems, farItems, styles: { root: { padding: 0 } } }) });
777
744
 
778
745
  // src/containers/ActionBar.tsx
779
- var import_react16 = require("@fluentui/react");
746
+ var import_react17 = require("@fluentui/react");
780
747
  var import_jsx_runtime12 = require("react/jsx-runtime");
781
748
  function renderButton(b) {
782
749
  const common = {
@@ -785,24 +752,24 @@ function renderButton(b) {
785
752
  onClick: b.onClick,
786
753
  iconProps: b.iconName ? { iconName: b.iconName } : void 0
787
754
  };
788
- if (b.appearance === "primary") return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react16.PrimaryButton, { ...common }, b.id);
789
- if (b.appearance === "subtle") return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react16.ActionButton, { ...common }, b.id);
790
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react16.DefaultButton, { ...common }, b.id);
755
+ if (b.appearance === "primary") return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react17.PrimaryButton, { ...common }, b.id);
756
+ if (b.appearance === "subtle") return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react17.ActionButton, { ...common }, b.id);
757
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react17.DefaultButton, { ...common }, b.id);
791
758
  }
792
759
  var ActionBar = ({ buttons, alignment = "right", sticky = true, className }) => {
793
760
  const justify = alignment === "left" ? "flex-start" : alignment === "center" ? "center" : "flex-end";
794
761
  const visible = buttons.filter((b) => !b.hidden);
795
762
  const left = visible.filter((b) => b.position === "left");
796
763
  const right = visible.filter((b) => b.position !== "left");
797
- const cls = (0, import_react16.mergeStyles)(
764
+ const cls = (0, import_react17.mergeStyles)(
798
765
  {
799
766
  display: "flex",
800
767
  alignItems: "center",
801
768
  justifyContent: left.length ? "space-between" : justify,
802
769
  gap: 8,
803
770
  padding: "12px 24px",
804
- borderTop: `1px solid ${colors.borderNeutral}`,
805
- background: colors.surface,
771
+ borderTop: `1px solid ${import_design_tokens.colors.borderNeutral}`,
772
+ background: import_design_tokens.colors.surface,
806
773
  ...sticky ? { position: "sticky", bottom: 0, zIndex: 1 } : {}
807
774
  },
808
775
  className
@@ -814,19 +781,19 @@ var ActionBar = ({ buttons, alignment = "right", sticky = true, className }) =>
814
781
  };
815
782
 
816
783
  // src/containers/Footer.tsx
817
- var import_react17 = require("@fluentui/react");
784
+ var import_react18 = require("@fluentui/react");
818
785
  var import_jsx_runtime13 = require("react/jsx-runtime");
819
786
  var Footer = ({ sticky = true, align = "right", className, children }) => {
820
787
  const justify = align === "left" ? "flex-start" : align === "center" ? "center" : "flex-end";
821
- const cls = (0, import_react17.mergeStyles)(
788
+ const cls = (0, import_react18.mergeStyles)(
822
789
  {
823
790
  display: "flex",
824
791
  alignItems: "center",
825
792
  justifyContent: justify,
826
793
  gap: 8,
827
794
  padding: "12px 24px",
828
- borderTop: `1px solid ${colors.borderNeutral}`,
829
- background: colors.surface,
795
+ borderTop: `1px solid ${import_design_tokens.colors.borderNeutral}`,
796
+ background: import_design_tokens.colors.surface,
830
797
  ...sticky ? { position: "sticky", bottom: 0, zIndex: 1 } : {}
831
798
  },
832
799
  className
@@ -835,7 +802,7 @@ var Footer = ({ sticky = true, align = "right", className, children }) => {
835
802
  };
836
803
 
837
804
  // src/overlays/FormDialogSurface.tsx
838
- var import_react18 = require("@fluentui/react");
805
+ var import_react19 = require("@fluentui/react");
839
806
  var import_jsx_runtime14 = require("react/jsx-runtime");
840
807
  var FormDialogSurface = ({
841
808
  isOpen,
@@ -853,31 +820,31 @@ var FormDialogSurface = ({
853
820
  }) => {
854
821
  const widthCss = dialogWidthCss({ width, size });
855
822
  const heightCss = dialogHeightCss(height);
856
- const styles = (0, import_react18.mergeStyleSets)({
823
+ const styles = (0, import_react19.mergeStyleSets)({
857
824
  header: {
858
825
  display: "flex",
859
826
  alignItems: "center",
860
827
  justifyContent: "space-between",
861
828
  gap: 12,
862
829
  padding: "12px 20px",
863
- borderBottom: `1px solid ${colors.borderNeutral}`
830
+ borderBottom: `1px solid ${import_design_tokens.colors.borderNeutral}`
864
831
  },
865
832
  headerLeft: { display: "flex", flexDirection: "column", minWidth: 0 },
866
833
  title: {
867
- fontSize: typography.fontSize.lg,
868
- fontWeight: typography.fontWeight.semibold,
869
- fontFamily: typography.fontFamilySemibold,
870
- color: colors.textPrimary
834
+ fontSize: import_design_tokens.typography.fontSize.lg,
835
+ fontWeight: import_design_tokens.typography.fontWeight.semibold,
836
+ fontFamily: import_design_tokens.typography.fontFamilySemibold,
837
+ color: import_design_tokens.colors.textPrimary
871
838
  },
872
- subheader: { fontSize: typography.fontSize.smPlus, color: colors.textSecondary, marginTop: 2 },
839
+ subheader: { fontSize: import_design_tokens.typography.fontSize.smPlus, color: import_design_tokens.colors.textSecondary, marginTop: 2 },
873
840
  headerRight: { display: "flex", alignItems: "center", gap: 8 },
874
- counter: { fontSize: typography.fontSize.smPlus, color: colors.textSecondary },
841
+ counter: { fontSize: import_design_tokens.typography.fontSize.smPlus, color: import_design_tokens.colors.textSecondary },
875
842
  content: { flex: 1, minHeight: 0, overflow: "auto", padding: 20 },
876
- footer: { borderTop: `1px solid ${colors.borderNeutral}`, padding: "12px 20px" }
843
+ footer: { borderTop: `1px solid ${import_design_tokens.colors.borderNeutral}`, padding: "12px 20px" }
877
844
  });
878
845
  const showHeader = Boolean(title) || Boolean(recordCounter) || Boolean(onDismiss);
879
846
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
880
- import_react18.Modal,
847
+ import_react19.Modal,
881
848
  {
882
849
  isOpen,
883
850
  onDismiss,
@@ -913,12 +880,12 @@ var FormDialogSurface = ({
913
880
  recordCounter.total
914
881
  ] }),
915
882
  onDismiss && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
916
- import_react18.IconButton,
883
+ import_react19.IconButton,
917
884
  {
918
885
  iconProps: { iconName: "Cancel" },
919
886
  ariaLabel: "Close",
920
887
  onClick: onDismiss,
921
- styles: { root: { color: colors.textSecondary } }
888
+ styles: { root: { color: import_design_tokens.colors.textSecondary } }
922
889
  }
923
890
  )
924
891
  ] })
@@ -931,7 +898,7 @@ var FormDialogSurface = ({
931
898
  };
932
899
 
933
900
  // src/overlays/ModalSurface.tsx
934
- var import_react19 = require("@fluentui/react");
901
+ var import_react20 = require("@fluentui/react");
935
902
  var import_jsx_runtime15 = require("react/jsx-runtime");
936
903
  var ModalSurface = ({
937
904
  isOpen,
@@ -946,24 +913,24 @@ var ModalSurface = ({
946
913
  children
947
914
  }) => {
948
915
  const main = autoSize ? { width: "auto", minWidth: MODAL_AUTOSIZE_MIN_WIDTH, maxWidth: "100%" } : { maxWidth: "95vw", width: `${dialogWidthPx({ width, size })}px` };
949
- const styles = (0, import_react19.mergeStyleSets)({
916
+ const styles = (0, import_react20.mergeStyleSets)({
950
917
  title: {
951
- fontSize: typography.fontSize.lg,
952
- fontWeight: typography.fontWeight.semibold,
953
- fontFamily: typography.fontFamilySemibold,
954
- color: colors.textPrimary,
918
+ fontSize: import_design_tokens.typography.fontSize.lg,
919
+ fontWeight: import_design_tokens.typography.fontWeight.semibold,
920
+ fontFamily: import_design_tokens.typography.fontFamilySemibold,
921
+ color: import_design_tokens.colors.textPrimary,
955
922
  padding: "16px 20px 0"
956
923
  },
957
924
  content: { padding: 20 },
958
925
  footer: {
959
- borderTop: `1px solid ${colors.borderNeutral}`,
926
+ borderTop: `1px solid ${import_design_tokens.colors.borderNeutral}`,
960
927
  padding: "12px 20px",
961
928
  display: "flex",
962
929
  justifyContent: "flex-end",
963
930
  gap: 8
964
931
  }
965
932
  });
966
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Modal, { isOpen, onDismiss, isBlocking, className, styles: { main }, children: [
933
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react20.Modal, { isOpen, onDismiss, isBlocking, className, styles: { main }, children: [
967
934
  title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: styles.title, children: title }),
968
935
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: styles.content, children }),
969
936
  footer && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: styles.footer, children: footer })
@@ -971,7 +938,7 @@ var ModalSurface = ({
971
938
  };
972
939
 
973
940
  // src/overlays/PanelSurface.tsx
974
- var import_react20 = require("@fluentui/react");
941
+ var import_react21 = require("@fluentui/react");
975
942
  var import_jsx_runtime16 = require("react/jsx-runtime");
976
943
  var PanelSurface = ({
977
944
  isOpen,
@@ -987,10 +954,10 @@ var PanelSurface = ({
987
954
  children
988
955
  }) => {
989
956
  const kind = panelType ?? panelKindFromWidth(width);
990
- const resolvedType = import_react20.PanelType[kind];
957
+ const resolvedType = import_react21.PanelType[kind];
991
958
  const customWidth = kind === "custom" || kind === "customNear" ? `${panelCustomWidthPx(width)}px` : void 0;
992
959
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
993
- import_react20.Panel,
960
+ import_react21.Panel,
994
961
  {
995
962
  isOpen,
996
963
  onDismiss,
@@ -1008,7 +975,7 @@ var PanelSurface = ({
1008
975
  };
1009
976
 
1010
977
  // src/overlays/CalloutSurface.tsx
1011
- var import_react21 = require("@fluentui/react");
978
+ var import_react22 = require("@fluentui/react");
1012
979
  var import_jsx_runtime17 = require("react/jsx-runtime");
1013
980
  var CalloutSurface = ({
1014
981
  target,
@@ -1024,11 +991,11 @@ var CalloutSurface = ({
1024
991
  }) => {
1025
992
  if (!isOpen) return null;
1026
993
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1027
- import_react21.Callout,
994
+ import_react22.Callout,
1028
995
  {
1029
996
  target: target ?? void 0,
1030
997
  onDismiss,
1031
- directionalHint: import_react21.DirectionalHint[directionalHint],
998
+ directionalHint: import_react22.DirectionalHint[directionalHint],
1032
999
  isBeakVisible,
1033
1000
  beakWidth,
1034
1001
  gapSpace,
@@ -1040,22 +1007,22 @@ var CalloutSurface = ({
1040
1007
  };
1041
1008
 
1042
1009
  // src/overlays/TooltipSurface.tsx
1043
- var import_react22 = require("@fluentui/react");
1010
+ var import_react23 = require("@fluentui/react");
1044
1011
  var import_jsx_runtime18 = require("react/jsx-runtime");
1045
1012
  var DELAY_MAP = {
1046
- zero: import_react22.TooltipDelay.zero,
1047
- medium: import_react22.TooltipDelay.medium,
1048
- long: import_react22.TooltipDelay.long
1013
+ zero: import_react23.TooltipDelay.zero,
1014
+ medium: import_react23.TooltipDelay.medium,
1015
+ long: import_react23.TooltipDelay.long
1049
1016
  };
1050
1017
  var TooltipSurface = ({
1051
1018
  content,
1052
1019
  directionalHint = "bottomCenter",
1053
1020
  delay = "medium",
1054
1021
  children
1055
- }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react22.TooltipHost, { content, directionalHint: import_react22.DirectionalHint[directionalHint], delay: DELAY_MAP[delay], children });
1022
+ }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react23.TooltipHost, { content, directionalHint: import_react23.DirectionalHint[directionalHint], delay: DELAY_MAP[delay], children });
1056
1023
 
1057
1024
  // src/composites/MasterDetailSurface.tsx
1058
- var import_react23 = require("@fluentui/react");
1025
+ var import_react24 = require("@fluentui/react");
1059
1026
  var import_jsx_runtime19 = require("react/jsx-runtime");
1060
1027
  var MasterDetailSurface = ({
1061
1028
  master,
@@ -1068,7 +1035,7 @@ var MasterDetailSurface = ({
1068
1035
  const masterFr = Math.min(90, Math.max(10, Math.round(splitRatio * 100)));
1069
1036
  const detailFr = 100 - masterFr;
1070
1037
  const collapsePx = BREAKPOINTS[collapseBelow];
1071
- const rootCls = (0, import_react23.mergeStyles)(
1038
+ const rootCls = (0, import_react24.mergeStyles)(
1072
1039
  {
1073
1040
  display: "grid",
1074
1041
  gridTemplateColumns: `${masterFr}fr ${detailFr}fr`,
@@ -1077,18 +1044,18 @@ var MasterDetailSurface = ({
1077
1044
  },
1078
1045
  className
1079
1046
  );
1080
- const masterCls = (0, import_react23.mergeStyles)({
1047
+ const masterCls = (0, import_react24.mergeStyles)({
1081
1048
  minWidth: 0,
1082
1049
  overflow: "auto",
1083
- borderRight: `1px solid ${colors.borderNeutral}`,
1050
+ borderRight: `1px solid ${import_design_tokens.colors.borderNeutral}`,
1084
1051
  selectors: {
1085
1052
  [`@media (max-width: ${collapsePx}px)`]: {
1086
1053
  borderRight: "none",
1087
- borderBottom: `1px solid ${colors.borderNeutral}`
1054
+ borderBottom: `1px solid ${import_design_tokens.colors.borderNeutral}`
1088
1055
  }
1089
1056
  }
1090
1057
  });
1091
- const detailCls = (0, import_react23.mergeStyles)({ minWidth: 0, overflow: "auto" });
1058
+ const detailCls = (0, import_react24.mergeStyles)({ minWidth: 0, overflow: "auto" });
1092
1059
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: rootCls, children: [
1093
1060
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: masterCls, children: master }),
1094
1061
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: detailCls, children: detail ?? detailFallback })
@@ -1096,10 +1063,10 @@ var MasterDetailSurface = ({
1096
1063
  };
1097
1064
 
1098
1065
  // src/composites/DashboardSurface.tsx
1099
- var import_react24 = require("@fluentui/react");
1066
+ var import_react25 = require("@fluentui/react");
1100
1067
  var import_jsx_runtime20 = require("react/jsx-runtime");
1101
1068
  var DashboardSurface = ({ tiles, columns = 2, gap = 16, className }) => {
1102
- const cls = (0, import_react24.mergeStyles)(
1069
+ const cls = (0, import_react25.mergeStyles)(
1103
1070
  {
1104
1071
  display: "grid",
1105
1072
  gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
@@ -1153,6 +1120,7 @@ function fromFormDefinition(def) {
1153
1120
  CommandSurface,
1154
1121
  DIALOG_SIZE_PX,
1155
1122
  DashboardSurface,
1123
+ DensityContext,
1156
1124
  FieldRow,
1157
1125
  Footer,
1158
1126
  FormDialogSurface,
@@ -1196,6 +1164,7 @@ function fromFormDefinition(def) {
1196
1164
  useContainerBreakpoint,
1197
1165
  useContainerSize,
1198
1166
  useContainerWidth,
1167
+ useDensity,
1199
1168
  useMediaQuery,
1200
1169
  useResponsiveValue
1201
1170
  });