cursedbelt 5.39.0 → 5.40.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.
Files changed (104) hide show
  1. package/dist/react/components/ActionGroup.d.ts +3 -0
  2. package/dist/react/components/ActionGroup.d.ts.map +1 -1
  3. package/dist/react/components/ActionGroup.js +1 -0
  4. package/dist/react/components/ActionGroup.js.map +1 -1
  5. package/dist/react/components/Button.d.ts.map +1 -1
  6. package/dist/react/components/Button.js +1 -1
  7. package/dist/react/components/Button.js.map +1 -1
  8. package/dist/react/components/ControlPanel.d.ts +46 -0
  9. package/dist/react/components/ControlPanel.d.ts.map +1 -0
  10. package/dist/react/components/ControlPanel.js +38 -0
  11. package/dist/react/components/ControlPanel.js.map +1 -0
  12. package/dist/react/components/Field.d.ts +16 -6
  13. package/dist/react/components/Field.d.ts.map +1 -1
  14. package/dist/react/components/Field.js +17 -11
  15. package/dist/react/components/Field.js.map +1 -1
  16. package/dist/react/components/FieldGrid.d.ts +23 -0
  17. package/dist/react/components/FieldGrid.d.ts.map +1 -0
  18. package/dist/react/components/FieldGrid.js +21 -0
  19. package/dist/react/components/FieldGrid.js.map +1 -0
  20. package/dist/react/components/InfoHint.d.ts +15 -20
  21. package/dist/react/components/InfoHint.d.ts.map +1 -1
  22. package/dist/react/components/InfoHint.js +61 -58
  23. package/dist/react/components/InfoHint.js.map +1 -1
  24. package/dist/react/components/InfoHintImpl.d.ts +16 -0
  25. package/dist/react/components/InfoHintImpl.d.ts.map +1 -0
  26. package/dist/react/components/InfoHintImpl.js +70 -0
  27. package/dist/react/components/InfoHintImpl.js.map +1 -0
  28. package/dist/react/components/NativeSelect.d.ts.map +1 -1
  29. package/dist/react/components/NativeSelect.js +3 -2
  30. package/dist/react/components/NativeSelect.js.map +1 -1
  31. package/dist/react/components/SegmentedControl.d.ts +13 -1
  32. package/dist/react/components/SegmentedControl.d.ts.map +1 -1
  33. package/dist/react/components/SegmentedControl.js +17 -4
  34. package/dist/react/components/SegmentedControl.js.map +1 -1
  35. package/dist/react/components/SelectField.d.ts.map +1 -1
  36. package/dist/react/components/SelectField.js +3 -2
  37. package/dist/react/components/SelectField.js.map +1 -1
  38. package/dist/react/components/Slider.d.ts +3 -1
  39. package/dist/react/components/Slider.d.ts.map +1 -1
  40. package/dist/react/components/Slider.js +2 -2
  41. package/dist/react/components/Slider.js.map +1 -1
  42. package/dist/react/components/SliderField.d.ts +34 -13
  43. package/dist/react/components/SliderField.d.ts.map +1 -1
  44. package/dist/react/components/SliderField.js +79 -12
  45. package/dist/react/components/SliderField.js.map +1 -1
  46. package/dist/react/components/TooltipImpl.d.ts.map +1 -1
  47. package/dist/react/components/TooltipImpl.js +1 -1
  48. package/dist/react/components/TooltipImpl.js.map +1 -1
  49. package/dist/react/index.d.ts +5 -3
  50. package/dist/react/index.d.ts.map +1 -1
  51. package/dist/react/index.js +5 -3
  52. package/dist/react/index.js.map +1 -1
  53. package/dist/react/lib/field.d.ts +14 -0
  54. package/dist/react/lib/field.d.ts.map +1 -1
  55. package/dist/react/lib/field.js +24 -0
  56. package/dist/react/lib/field.js.map +1 -1
  57. package/dist/react/lib/infoHint.d.ts +25 -0
  58. package/dist/react/lib/infoHint.d.ts.map +1 -0
  59. package/dist/react/lib/infoHint.js +6 -0
  60. package/dist/react/lib/infoHint.js.map +1 -0
  61. package/dist/scripts/guardrailsEnforce.d.ts.map +1 -1
  62. package/dist/styles-areas/analytics.css +10 -10
  63. package/dist/styles-areas/core.css +25 -23
  64. package/dist/styles-areas/data-table.css +10 -10
  65. package/dist/styles-areas/fields.css +5 -4
  66. package/dist/styles-areas/nav.css +8 -9
  67. package/dist/styles-areas/notifications.css +4 -5
  68. package/dist/styles-static.css +99 -0
  69. package/dist/styles-utilities.css +16 -0
  70. package/dist/styles.css +99 -0
  71. package/package.json +3 -3
  72. package/scripts/guardrailsEnforce.spec.ts +54 -2
  73. package/scripts/guardrailsEnforce.ts +216 -9
  74. package/scripts/styleAreas.ts +4 -0
  75. package/src/react/components/ActionGroup.tsx +4 -0
  76. package/src/react/components/Button.tsx +8 -1
  77. package/src/react/components/ControlPanel.tsx +115 -0
  78. package/src/react/components/Field.spec.tsx +72 -1
  79. package/src/react/components/Field.tsx +59 -30
  80. package/src/react/components/Field.width.spec.tsx +16 -8
  81. package/src/react/components/FieldGrid.tsx +43 -0
  82. package/src/react/components/InfoHint.spec.tsx +32 -0
  83. package/src/react/components/InfoHint.tsx +71 -109
  84. package/src/react/components/InfoHintImpl.tsx +116 -0
  85. package/src/react/components/NativeSelect.tsx +3 -2
  86. package/src/react/components/SegmentedControl.spec.tsx +22 -1
  87. package/src/react/components/SegmentedControl.tsx +25 -1
  88. package/src/react/components/SelectField.tsx +3 -2
  89. package/src/react/components/Slider.tsx +4 -1
  90. package/src/react/components/SliderField.spec.ts +23 -1
  91. package/src/react/components/SliderField.tsx +141 -55
  92. package/src/react/components/TooltipImpl.tsx +5 -3
  93. package/src/react/index.ts +17 -1
  94. package/src/react/lib/field.ts +26 -0
  95. package/src/react/lib/infoHint.ts +30 -0
  96. package/src/styles-areas/analytics.css +10 -10
  97. package/src/styles-areas/core.css +25 -23
  98. package/src/styles-areas/data-table.css +10 -10
  99. package/src/styles-areas/fields.css +5 -4
  100. package/src/styles-areas/nav.css +8 -9
  101. package/src/styles-areas/notifications.css +4 -5
  102. package/src/styles-static.css +99 -0
  103. package/src/styles-utilities.css +16 -0
  104. package/src/styles.css +99 -0
@@ -13,6 +13,9 @@ export interface ActionGroupItem {
13
13
  /** Async action — inherits {@link Button}'s spinner/success/error handling. */
14
14
  onAsyncClick?: (e: MouseEvent<HTMLButtonElement>) => Promise<unknown>;
15
15
  disabled?: boolean;
16
+ /** Why this action cannot work here: drawn disabled, refused on press, and the reason shows on
17
+ * hover AND on tap (STA-6) — see {@link Button}'s `unavailableReason`. */
18
+ unavailableReason?: string;
16
19
  /** Quiet destructive weight — red text, solid red only on hover/focus. For a
17
20
  * persisted-item DELETE use {@link DeleteButton} beside the group instead:
18
21
  * this strip never confirms. */
@@ -1 +1 @@
1
- {"version":3,"file":"ActionGroup.d.ts","sourceRoot":"","sources":["../../../src/react/components/ActionGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKnD,MAAM,WAAW,eAAe;IAC9B,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ;gEAC4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACrD,+EAA+E;IAC/E,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;qCAEiC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,mFAAmF;IACnF,IAAI,CAAC,EAAE,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAClC,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,IAAW,EACX,YAAY,EAAE,SAAqB,EACnC,SAAS,GACV,EAAE,gBAAgB,+BAsClB"}
1
+ {"version":3,"file":"ActionGroup.d.ts","sourceRoot":"","sources":["../../../src/react/components/ActionGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKnD,MAAM,WAAW,eAAe;IAC9B,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ;gEAC4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACrD,+EAA+E;IAC/E,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;+EAC2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;qCAEiC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,mFAAmF;IACnF,IAAI,CAAC,EAAE,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAClC,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,IAAW,EACX,YAAY,EAAE,SAAqB,EACnC,SAAS,GACV,EAAE,gBAAgB,+BAuClB"}
@@ -24,6 +24,7 @@ export function ActionGroup({ items, size = 'sm', 'aria-label': ariaLabel = 'Act
24
24
  const common = {
25
25
  variant,
26
26
  disabled: item.disabled,
27
+ unavailableReason: item.unavailableReason,
27
28
  onClick: item.onClick,
28
29
  onAsyncClick: item.onAsyncClick,
29
30
  };
@@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,CAAC,IAAI,KACf,MAAM,YAET,IAAI,CAAC,KAAK,IANN,IAAI,CAAC,GAAG,CAON,CACV,CAAC;QACJ,CAAC,CAAC,GACU,CACf,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"ActionGroup.js","sourceRoot":"","sources":["../../../src/react/components/ActionGroup.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAiC7C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,IAAI,GAAG,IAAI,EACX,YAAY,EAAE,SAAS,GAAG,SAAS,EACnC,SAAS,GACQ;IACjB,OAAO,CACL,KAAC,WAAW,kBACE,SAAS,EACrB,SAAS,EAAE,EAAE,CACX,4CAA4C;QAC5C,8EAA8E;QAC9E,mEAAmE;QACnE,kFAAkF,EAClF,SAAS,CACV,YAEA,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAClB,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC;YAC3D,MAAM,MAAM,GAAG;gBACb,OAAO;gBACP,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,YAAY,EAAE,IAAI,CAAC,YAAY;aACvB,CAAC;YACX,OAAO,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CACpC,KAAC,UAAU,IAAgB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,KAAM,MAAM,YACjE,IAAI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OAAO,EACP,IAAI,EACJ,OAAe,EACf,OAAe,EACf,QAAQ,EACR,OAAO,EACP,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAsB,EACtB,YAAmB,EACnB,OAAc,EACd,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,WAAW,+BA0Gb"}
@@ -171,6 +171,6 @@ export function Button({ className, variant, size, asChild = false, loading = fa
171
171
  // The single "button with a tooltip" seam: wrap once, here, so no call site re-implements it.
172
172
  // `multiline`: a hint that is a sentence ("Nothing to restore — the trash is empty") wraps
173
173
  // inside a capped bubble instead of running off a narrow pane; a short one is unchanged.
174
- return (_jsx(Tooltip, { content: refused ? reason : tooltip, side: tooltipSide, mobile: tooltipMobile, multiline: true, children: el }));
174
+ return (_jsx(Tooltip, { content: refused ? reason : tooltip, side: tooltipSide, mobile: refused ? (tooltipMobile && tooltipMobile !== 'off' ? tooltipMobile : 'tap') : tooltipMobile, multiline: true, children: el }));
175
175
  }
176
176
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/react/components/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAML,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAA6C,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC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AW,EACjB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,IAAI,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,EACpG,SAAS,kBAER,EAAE,GACK,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type FieldGridProps } from './FieldGrid.js';
3
+ export interface ControlGroupProps {
4
+ /** The topic, as an eyebrow ("Color", "Texture", "Quality") — FRM-15. */
5
+ title: string;
6
+ /** The group's fields: `SliderField`s, `Field layout="inline"`s, a `SegmentedControl` row. */
7
+ children: ReactNode;
8
+ /** On a phone, whether this group starts open (default closed — open the one most tuned). */
9
+ defaultOpen?: boolean;
10
+ /** The label column the group's fields share (see {@link FieldGrid}). */
11
+ labelWidth?: FieldGridProps['labelWidth'];
12
+ className?: string;
13
+ }
14
+ export interface ControlPanelProps {
15
+ /** The panel's name, shown at the left of its header row. */
16
+ title?: ReactNode;
17
+ /**
18
+ * Global controls — settings, reset-all, presets, theme. They live in the header row, never as
19
+ * a stray gear inside a parameter column (FRM-16).
20
+ */
21
+ actions?: ReactNode;
22
+ /** `ControlGroup`s, one column each. */
23
+ children: ReactNode;
24
+ /**
25
+ * The narrowest a column may get before the columns wrap whole (LAY-4): `sm` 20rem · `md`
26
+ * 23rem (default) · `lg` 28rem. A one-row slider needs about 22rem — label column, a usable
27
+ * track and the value box — so a column never gets narrower than that by default.
28
+ */
29
+ columnMin?: 'sm' | 'md' | 'lg';
30
+ className?: string;
31
+ }
32
+ /**
33
+ * The control-studio's parameter panel (FRM-15 … FRM-17, `docs/design/blueprints/control-studio.md`):
34
+ * a header row holding the panel's global controls, then one column per topic group with NO
35
+ * boxes — whitespace and a 1px vertical rule between columns. Columns wrap whole, every column in
36
+ * a row is the same height and padding, and each group's fields share one label column. On a
37
+ * phone the groups become stacked accordions (the first open), so the canvas above stays in view
38
+ * and no column is squeezed past use.
39
+ */
40
+ export declare function ControlPanel({ title, actions, children, columnMin, className }: ControlPanelProps): import("react").JSX.Element;
41
+ /**
42
+ * One topic column of a {@link ControlPanel}: a `.cb-meta-label` eyebrow over a {@link FieldGrid},
43
+ * cardless. On a phone it is a collapsible section instead.
44
+ */
45
+ export declare function ControlGroup({ title, children, defaultOpen, labelWidth, className }: ControlGroupProps): import("react").JSX.Element;
46
+ //# sourceMappingURL=ControlPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ControlPanel.d.ts","sourceRoot":"","sources":["../../../src/react/components/ControlPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAItD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAKhE,MAAM,WAAW,iBAAiB;IAChC,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,8FAA8F;IAC9F,QAAQ,EAAE,SAAS,CAAC;IACpB,6FAA6F;IAC7F,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yEAAyE;IACzE,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,wCAAwC;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAgB,EAAE,SAAS,EAAE,EAAE,iBAAiB,+BAgCxG;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAiB,EAAE,SAAS,EAAE,EAAE,iBAAiB,+BAsB7G"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMediaQuery } from '../hooks/useMediaQuery.js';
3
+ import { cn } from '../lib/cn.js';
4
+ import { Collapsible } from './Collapsible.js';
5
+ import { FieldGrid } from './FieldGrid.js';
6
+ /** Below this a panel's columns would be squeezed past use, so they stack as accordions (FRM-17). */
7
+ const PHONE_QUERY = '(max-width: 639px)';
8
+ const COLUMN_MIN = {
9
+ sm: '20rem',
10
+ md: '23rem',
11
+ lg: '28rem',
12
+ };
13
+ /**
14
+ * The control-studio's parameter panel (FRM-15 … FRM-17, `docs/design/blueprints/control-studio.md`):
15
+ * a header row holding the panel's global controls, then one column per topic group with NO
16
+ * boxes — whitespace and a 1px vertical rule between columns. Columns wrap whole, every column in
17
+ * a row is the same height and padding, and each group's fields share one label column. On a
18
+ * phone the groups become stacked accordions (the first open), so the canvas above stays in view
19
+ * and no column is squeezed past use.
20
+ */
21
+ export function ControlPanel({ title, actions, children, columnMin = 'md', className }) {
22
+ const phone = useMediaQuery(PHONE_QUERY);
23
+ const name = typeof title === 'string' ? title : undefined;
24
+ return (_jsxs("section", { className: cn('flex min-w-0 flex-col gap-4', className), "data-cb-control-panel": phone ? 'stacked' : 'columns', "aria-label": name, children: [title != null || actions != null ? (_jsxs("div", { className: 'flex min-w-0 items-center justify-between gap-3', "data-cb-control-panel-header": '', children: [title != null ? _jsx("h2", { className: 'm-0 min-w-0 truncate text-sm font-semibold text-foreground', children: title }) : _jsx("span", {}), actions != null ? _jsx("div", { className: 'flex shrink-0 items-center gap-2', children: actions }) : null] })) : null, phone ? (_jsx("div", { className: 'flex flex-col divide-y divide-border', "data-cb-control-panel-groups": '', "data-phone": '', children: children })) : (_jsx("div", { className: 'cb-control-panel-frame', children: _jsx("div", { className: 'cb-control-panel-groups', "data-cb-control-panel-groups": '', style: { '--cb-panel-col-min': COLUMN_MIN[columnMin] }, children: children }) }))] }));
25
+ }
26
+ /**
27
+ * One topic column of a {@link ControlPanel}: a `.cb-meta-label` eyebrow over a {@link FieldGrid},
28
+ * cardless. On a phone it is a collapsible section instead.
29
+ */
30
+ export function ControlGroup({ title, children, defaultOpen, labelWidth = 'md', className }) {
31
+ const phone = useMediaQuery(PHONE_QUERY);
32
+ const body = _jsx(FieldGrid, { labelWidth: labelWidth, children: children });
33
+ if (phone) {
34
+ return (_jsx("div", { className: className, "data-cb-control-group": '', children: _jsx(Collapsible, { trigger: _jsx("span", { className: 'cb-meta-label', children: title }), defaultOpen: defaultOpen, contentClassName: 'pb-4 pt-1', children: body }) }));
35
+ }
36
+ return (_jsxs("fieldset", { className: cn('m-0 min-w-0 border-0 p-0', className), "data-cb-control-group": '', children: [_jsx("legend", { className: 'cb-meta-label mb-3 p-0', children: title }), body] }));
37
+ }
38
+ //# sourceMappingURL=ControlPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ControlPanel.js","sourceRoot":"","sources":["../../../src/react/components/ControlPanel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAuB,MAAM,gBAAgB,CAAC;AAEhE,qGAAqG;AACrG,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAiCzC,MAAM,UAAU,GAAgE;IAC9E,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;CACZ,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,GAAG,IAAI,EAAE,SAA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S,IAAC,UAAU,EAAE,UAAU,YAAG,QAAQ,GAAa,CAAC;IACvE,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CACL,cAAK,SAAS,EAAE,SAAS,2BAAwB,EAAE,YACjD,KAAC,WAAW,IACV,OAAO,EAAE,eAAM,SAAS,EAAC,eAAe,YAAE,KAAK,GAAQ,EACvD,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAC,WAAW,YAE3B,IAAI,GACO,GACV,CACP,CAAC;IACJ,CAAC;IACD,OAAO,CACL,oBAAU,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,2BAAwB,EAAE,aACtF,iBAAQ,SAAS,EAAC,wBAAwB,YAAE,KAAK,GAAU,EAC1D,IAAI,IACI,CACZ,CAAC;AACJ,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { type ReactElement, type ReactNode } from 'react';
2
- import { DESCRIPTION_FOLD_CHARS, type FieldWidth } from '../lib/field.js';
3
- export { DESCRIPTION_FOLD_CHARS };
2
+ import { DESCRIPTION_FOLD_CHARS, HELP_FOLD_CHARS, type FieldWidth } from '../lib/field.js';
3
+ export { DESCRIPTION_FOLD_CHARS, HELP_FOLD_CHARS };
4
4
  /** The id + aria a control needs to be wired to its label, description, and error.
5
5
  * Injected into a single child via `cloneElement`, or handed to a render-prop child
6
6
  * (e.g. inside a `<Controller>`, where cloneElement can't reach the real control). */
@@ -23,8 +23,18 @@ interface FieldBaseProps {
23
23
  label?: ReactNode;
24
24
  /** "ⓘ" help shown next to the label (renders an {@link InfoHint}). */
25
25
  hint?: ReactNode;
26
- /** Help text rendered below the label, above the control. */
26
+ /**
27
+ * Help text, directly UNDER the control: 12px, muted, at most two lines (FRM-9). A string
28
+ * longer than {@link HELP_FOLD_CHARS} moves into the label's ⓘ at every width instead. A
29
+ * validation error takes this slot while it shows (FRM-10), so nothing below moves.
30
+ */
27
31
  description?: ReactNode;
32
+ /**
33
+ * `stacked` (default): the label sits over its control (FRM-1). `inline`: the label sits in
34
+ * the row's label column — the shared `--cb-label-col` track a {@link FieldGrid} sets — so
35
+ * every label and every control in the grid share their edges (FRM-2). A phone stacks it.
36
+ */
37
+ layout?: 'stacked' | 'inline';
28
38
  required?: boolean;
29
39
  className?: string;
30
40
  /**
@@ -85,8 +95,8 @@ export type FieldProps = FieldBaseProps & ({
85
95
  children: ReactNode;
86
96
  });
87
97
  /**
88
- * The atomic form-row: label + optional ⓘ hint + description + control + inline
89
- * error, wired to the surrounding react-hook-form context so the control's `id`,
98
+ * The atomic form-row: label + optional ⓘ hint + control + one help slot under it that the
99
+ * inline error takes over (FRM-9, FRM-10), wired to the surrounding react-hook-form context so the control's `id`,
90
100
  * `aria-invalid`, and `aria-describedby` are automatic and the error reads with
91
101
  * `role="alert"` + a destructive icon + color + text.
92
102
  *
@@ -102,5 +112,5 @@ export type FieldProps = FieldBaseProps & ({
102
112
  * Usable outside a `FormProvider` (label + control render; no error) so option-form
103
113
  * snippets can reuse it, but the error wiring needs a form context.
104
114
  */
105
- export declare function Field({ name, label, hint, description, required, children, className, reserveErrorSpace, width, descriptionOnNarrow, group, }: FieldProps): import("react").JSX.Element;
115
+ export declare function Field({ name, label, hint, description, required, children, className, reserveErrorSpace, width, descriptionOnNarrow, layout, group, }: FieldProps): import("react").JSX.Element;
106
116
  //# sourceMappingURL=Field.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/react/components/Field.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgC,KAAK,YAAY,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAG/F,OAAO,EACL,sBAAsB,EAEtB,KAAK,UAAU,EAEhB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC;;uFAEuF;AACvF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,cAAc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;;;;;;;;;;GAiBG;AACH,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,iBAAyB,EACzB,KAAK,EACL,mBAA4B,EAC5B,MAAkB,EAClB,KAAa,GACd,EAAE,UAAU,+BAiKZ"}
@@ -3,12 +3,12 @@ import { AlertCircle } from 'lucide-react';
3
3
  import { cloneElement, isValidElement, useId } from 'react';
4
4
  import { get, useFormContext } from 'react-hook-form';
5
5
  import { cn } from '../lib/cn.js';
6
- import { DESCRIPTION_FOLD_CHARS, FIELD_WIDTH_CLASS, naturalFieldWidth, } from '../lib/field.js';
6
+ import { DESCRIPTION_FOLD_CHARS, FIELD_WIDTH_CLASS, HELP_FOLD_CHARS, naturalFieldWidth, } from '../lib/field.js';
7
7
  import { InfoHint } from './InfoHint.js';
8
- export { DESCRIPTION_FOLD_CHARS };
8
+ export { DESCRIPTION_FOLD_CHARS, HELP_FOLD_CHARS };
9
9
  /**
10
- * The atomic form-row: label + optional ⓘ hint + description + control + inline
11
- * error, wired to the surrounding react-hook-form context so the control's `id`,
10
+ * The atomic form-row: label + optional ⓘ hint + control + one help slot under it that the
11
+ * inline error takes over (FRM-9, FRM-10), wired to the surrounding react-hook-form context so the control's `id`,
12
12
  * `aria-invalid`, and `aria-describedby` are automatic and the error reads with
13
13
  * `role="alert"` + a destructive icon + color + text.
14
14
  *
@@ -24,7 +24,7 @@ export { DESCRIPTION_FOLD_CHARS };
24
24
  * Usable outside a `FormProvider` (label + control render; no error) so option-form
25
25
  * snippets can reuse it, but the error wiring needs a form context.
26
26
  */
27
- export function Field({ name, label, hint, description, required, children, className, reserveErrorSpace = false, width, descriptionOnNarrow = 'auto', group = false, }) {
27
+ export function Field({ name, label, hint, description, required, children, className, reserveErrorSpace = false, width, descriptionOnNarrow = 'auto', layout = 'stacked', group = false, }) {
28
28
  const form = useFormContext();
29
29
  const errors = form?.formState.errors;
30
30
  const error = (errors && name ? get(errors, name)?.message : undefined);
@@ -45,11 +45,16 @@ export function Field({ name, label, hint, description, required, children, clas
45
45
  ? naturalFieldWidth(children.type, (children.props ?? {}))
46
46
  : 'full');
47
47
  const widthClass = FIELD_WIDTH_CLASS[resolvedWidth];
48
- const folds = description != null &&
48
+ // Help too long for two lines lives in the ⓘ at every width (FRM-9) …
49
+ const foldsAlways = description != null &&
49
50
  (descriptionOnNarrow === 'hint' ||
50
- (descriptionOnNarrow === 'auto' &&
51
- typeof description === 'string' &&
52
- description.length > DESCRIPTION_FOLD_CHARS));
51
+ (descriptionOnNarrow === 'auto' && typeof description === 'string' && description.length > HELP_FOLD_CHARS));
52
+ // … and help longer than a phone's line folds there only.
53
+ const folds = !foldsAlways &&
54
+ description != null &&
55
+ descriptionOnNarrow === 'auto' &&
56
+ typeof description === 'string' &&
57
+ description.length > DESCRIPTION_FOLD_CHARS;
53
58
  const control = typeof children === 'function'
54
59
  ? children(aria)
55
60
  : !group && isValidElement(children)
@@ -62,12 +67,13 @@ export function Field({ name, label, hint, description, required, children, clas
62
67
  })
63
68
  : children;
64
69
  const asterisk = required ? (_jsxs("span", { className: 'text-field-error', "aria-hidden": true, children: [' ', "*"] })) : null;
65
- return (_jsxs("div", { className: cn('flex flex-col gap-1.5', className), "data-cb-field": '', "data-cb-field-width": resolvedWidth, ...(group
70
+ const labelTitle = typeof label === 'string' ? label : undefined;
71
+ return (_jsxs("div", { className: cn(layout === 'inline' ? 'cb-field-inline' : 'flex flex-col gap-1.5', className), "data-cb-field": '', "data-cb-field-width": resolvedWidth, "data-cb-field-layout": layout, ...(group
66
72
  ? {
67
73
  role: 'group',
68
74
  'aria-labelledby': label != null ? labelId : undefined,
69
75
  'aria-describedby': describedBy,
70
76
  }
71
- : {}), children: [label != null || hint != null || folds ? (_jsxs("div", { className: 'flex items-center gap-1', children: [label != null ? (group ? (_jsxs("span", { id: labelId, className: 'text-sm font-medium text-foreground', "data-cb-field-label": '', children: [label, asterisk] })) : (_jsxs("label", { htmlFor: id, className: 'text-sm font-medium text-foreground', "data-cb-field-label": '', children: [label, asterisk] }))) : null, hint != null && !folds ? (_jsx(InfoHint, { title: typeof label === 'string' ? label : undefined, children: hint })) : null, folds ? (_jsxs(_Fragment, { children: [hint != null ? (_jsx("span", { className: 'inline-flex max-sm:hidden', children: _jsx(InfoHint, { title: typeof label === 'string' ? label : undefined, children: hint }) })) : null, _jsx("span", { className: 'inline-flex sm:hidden', children: _jsxs(InfoHint, { title: typeof label === 'string' ? label : undefined, children: [hint != null ? _jsx("p", { className: 'mb-1', children: hint }) : null, description] }) })] })) : null] })) : null, description != null ? (_jsx("p", { id: descId, "data-cb-field-description": '', className: cn('text-xs font-normal leading-snug text-muted-foreground', folds && 'max-sm:hidden'), children: description })) : null, widthClass ? (_jsx("div", { className: cn('w-full', widthClass), "data-cb-field-control": '', children: control })) : (control), error ? (_jsxs("p", { id: errId, role: 'alert', className: 'flex items-center gap-1.5 text-sm text-field-error', children: [_jsx(AlertCircle, { className: 'size-4 shrink-0', "aria-hidden": true }), error] })) : reserveErrorSpace ? (_jsx("p", { "aria-hidden": true, className: 'min-h-[1lh] text-sm', "data-cc-field-error-reserved": '' })) : null] }));
77
+ : {}), children: [label != null || hint != null || folds || foldsAlways ? (_jsxs("div", { className: 'flex min-w-0 items-center gap-1', "data-cb-field-head": '', children: [label != null ? (group ? (_jsxs("span", { id: labelId, className: 'text-sm font-medium text-foreground', "data-cb-field-label": '', children: [label, asterisk] })) : (_jsxs("label", { htmlFor: id, className: 'text-sm font-medium text-foreground', "data-cb-field-label": '', children: [label, asterisk] }))) : null, foldsAlways ? (_jsxs(InfoHint, { title: labelTitle, children: [hint != null ? _jsx("p", { className: 'mb-1', children: hint }) : null, description] })) : null, hint != null && !folds && !foldsAlways ? _jsx(InfoHint, { title: labelTitle, children: hint }) : null, folds ? (_jsxs(_Fragment, { children: [hint != null ? (_jsx("span", { className: 'inline-flex max-sm:hidden', children: _jsx(InfoHint, { title: labelTitle, children: hint }) })) : null, _jsx("span", { className: 'inline-flex sm:hidden', children: _jsxs(InfoHint, { title: labelTitle, children: [hint != null ? _jsx("p", { className: 'mb-1', children: hint }) : null, description] }) })] })) : null] })) : null, widthClass ? (_jsx("div", { className: cn('w-full', widthClass), "data-cb-field-control": '', children: control })) : (control), description != null ? (_jsx("p", { id: descId, "data-cb-field-description": '', "data-cb-field-help": '', className: cn('m-0 line-clamp-2 text-xs font-normal leading-snug text-muted-foreground', (error || foldsAlways) && 'sr-only', folds && 'max-sm:hidden'), children: description })) : null, error ? (_jsxs("p", { id: errId, role: 'alert', className: 'm-0 flex items-center gap-1.5 text-sm text-field-error', "data-cb-field-error": '', children: [_jsx(AlertCircle, { className: 'size-4 shrink-0', "aria-hidden": true }), error] })) : reserveErrorSpace && (description == null || foldsAlways) ? (_jsx("p", { "aria-hidden": true, className: 'min-h-[1lh] text-sm', "data-cc-field-error-reserved": '' })) : null] }));
72
78
  }
73
79
  //# sourceMappingURL=Field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../src/react/components/Field.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAqC,KAAK,EAAE,MAAM,OAAO,CAAC;AAC/F,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EAEjB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,sBAAsB,EAAE,CAAC;AA4FlC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,KAAK,CAAC,EACpB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,QA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AEP,KAAK,CAAC,CAAC,CAAC,CACP,aAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,wDAAwD,yBAAqB,EAAE,aAClH,KAAC,WAAW,IAAC,SAAS,EAAC,iBAAiB,wBAAe,EACtD,KAAK,IACJ,CACL,CAAC,CAAC,CAAC,iBAAiB,IAAI,CAAC,WAAW,IAAI,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAO9D,iCAAe,SAAS,EAAC,qBAAqB,kCAA8B,EAAE,GAAG,CAClF,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface FieldGridProps {
3
+ /** `Field layout="inline"`s and `SliderField`s — each draws its label in the grid's one label column. */
4
+ children: ReactNode;
5
+ /**
6
+ * The label column's width: `sm` 7rem · `md` 9rem (default) · `lg` 11rem. One track for every
7
+ * row, sized by token, never per row to its own text (FRM-1). A longer label wraps inside it.
8
+ */
9
+ labelWidth?: 'sm' | 'md' | 'lg';
10
+ /** `dense` (default): 12px between fields, for a control panel · `standard`: 16px, for a form (FRM-4). */
11
+ density?: 'dense' | 'standard';
12
+ className?: string;
13
+ }
14
+ /**
15
+ * A column of fields whose labels share ONE label column (FRM-1, FRM-2): every label shares a
16
+ * left edge, and every control shares its left edge, so a dense settings list or a control
17
+ * panel reads as one straight-edged table instead of a zig-zag. Put `Field layout="inline"`
18
+ * and `SliderField` inside it. Stacked labels (a plain `Stack` of `Field`s) stay the default
19
+ * for an ordinary form; reach for this only for a dense panel or a settings list. On a phone
20
+ * each row stacks its label over its control.
21
+ */
22
+ export declare function FieldGrid({ children, labelWidth, density, className }: FieldGridProps): import("react").JSX.Element;
23
+ //# sourceMappingURL=FieldGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldGrid.d.ts","sourceRoot":"","sources":["../../../src/react/components/FieldGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtD,MAAM,WAAW,cAAc;IAC7B,yGAAyG;IACzG,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAChC,0GAA0G;IAC1G,OAAO,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,UAAiB,EAAE,OAAiB,EAAE,SAAS,EAAE,EAAE,cAAc,+BAYtG"}
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../lib/cn.js';
3
+ const LABEL_COL = {
4
+ sm: '7rem',
5
+ md: '9rem',
6
+ lg: '11rem',
7
+ };
8
+ /**
9
+ * A column of fields whose labels share ONE label column (FRM-1, FRM-2): every label shares a
10
+ * left edge, and every control shares its left edge, so a dense settings list or a control
11
+ * panel reads as one straight-edged table instead of a zig-zag. Put `Field layout="inline"`
12
+ * and `SliderField` inside it. Stacked labels (a plain `Stack` of `Field`s) stay the default
13
+ * for an ordinary form; reach for this only for a dense panel or a settings list. On a phone
14
+ * each row stacks its label over its control.
15
+ */
16
+ export function FieldGrid({ children, labelWidth = 'md', density = 'dense', className }) {
17
+ return (_jsx("div", { className: cn('cb-field-grid', className), "data-cb-field-grid": '', "data-density": density,
18
+ // A live custom property — the one track every row's label column reads.
19
+ style: { '--cb-label-col': LABEL_COL[labelWidth] }, children: children }));
20
+ }
21
+ //# sourceMappingURL=FieldGrid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldGrid.js","sourceRoot":"","sources":["../../../src/react/components/FieldGrid.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAelC,MAAM,SAAS,GAA8D;IAC3E,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,OAAO;CACZ,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,QAAQ,EAAE,UAAU,GAAG,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,SAAS,EAAkB;IACrG,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,wBACtB,EAAE,kBACP,OAAO;QACrB,yEAAyE;QACzE,KAAK,EAAE,EAAE,gBAAgB,EAAE,SAAS,CAAC,UAAU,CAAC,EAAmB,YAElE,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
@@ -1,24 +1,19 @@
1
- import { type ReactNode } from 'react';
2
- export interface InfoHintProps {
3
- /** The help body. */
4
- children?: ReactNode;
5
- /** Optional bold heading above the body. */
6
- title?: ReactNode;
7
- /** Which side of the trigger the panel aligns to (default `'left'`). */
8
- align?: 'left' | 'right';
9
- className?: string;
10
- label?: string;
11
- }
1
+ import { type InfoHintProps } from '../lib/infoHint.js';
2
+ export type { InfoHintProps };
12
3
  /**
13
- * "ⓘ" field-help — the bespoke anchored composite on @floating-ui/react (portaled,
14
- * flips + shifts, never clipped by an overflow ancestor). The reference model for
15
- * any future bespoke anchored composite (color picker on a swatch, date picker on an
16
- * input); standard primitives (Tooltip/DropdownMenu/SelectField/Popover/HoverCard)
17
- * use Radix instead.
4
+ * "ⓘ" field-help: hover + focus on pointer devices, click/tap everywhere, the panel portaled
5
+ * and never clipped (the behaviour is `InfoHintImpl.tsx`).
18
6
  *
19
- * Opens on hover + focus on pointer devices, and on click/tap everywhere — so it is
20
- * reachable on touch screens (which have no hover). `useHasHover` disables the hover
21
- * interaction on touch devices so the panel isn't left stuck open after a tap.
7
+ * ── Why this file is a wrapper and not the hint ─────────────────────────────
8
+ * 🔴 The panel is built on `@floating-ui/react` (+ `tabbable`), ~10 KB gzip, and every field
9
+ * primitive renders an InfoHint for a long `hint` — so a static import put that engine in the
10
+ * chunk of every page that renders a `SliderField` or `Field`, hint or not. cursedbelt 5.40.0's
11
+ * SliderField did exactly that to roms' controls chunk: ShortcutsPanel 14.68 → 25.24 kB gzip
12
+ * (forge task 2518). A hint is a closed icon until it is asked for, so the engine is a dynamic
13
+ * `import()` and this file — React, an icon and a class string — is what a page carries.
14
+ *
15
+ * A press or focus that beats the fetch is not lost: the placeholder records it and the real
16
+ * hint opens (or takes the focus) the moment it replaces it.
22
17
  */
23
- export declare function InfoHint({ children, title, align, className, label, }: InfoHintProps): import("react").JSX.Element;
18
+ export declare function InfoHint(props: InfoHintProps): import("react").JSX.Element;
24
19
  //# sourceMappingURL=InfoHint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InfoHint.d.ts","sourceRoot":"","sources":["../../../src/react/components/InfoHint.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAMjD,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,KAAK,EACL,KAAc,EACd,SAAS,EACT,KAAmB,GACpB,EAAE,aAAa,+BAuEf"}
1
+ {"version":3,"file":"InfoHint.d.ts","sourceRoot":"","sources":["../../../src/react/components/InfoHint.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnG,YAAY,EAAE,aAAa,EAAE,CAAC;AAsB9B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAwC5C"}
@@ -1,65 +1,68 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { autoUpdate, FloatingPortal, flip, offset, shift, useClick, useDismiss, useFloating, useFocus, useHover, useInteractions, useRole, } from '@floating-ui/react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
3
2
  import { Info } from 'lucide-react';
4
- import { useState } from 'react';
5
- import { useHasHover } from '../hooks/useHasHover.js';
3
+ import { useEffect, useRef, useState } from 'react';
6
4
  import { cn } from '../lib/cn.js';
7
- import { HOVER_HINT_DELAY_MS } from '../lib/hoverIntent.js';
8
- import { TAP_TARGET } from '../lib/tapTarget.js';
5
+ import { INFO_HINT_TRIGGER } from '../lib/infoHint.js';
6
+ let loadedImpl = null;
7
+ let pendingImpl = null;
8
+ /** Fetch the floating-ui implementation once per page. */
9
+ function preloadInfoHint() {
10
+ if (!pendingImpl) {
11
+ pendingImpl = import('./InfoHintImpl.js').then((m) => {
12
+ loadedImpl = m.default;
13
+ return m.default;
14
+ });
15
+ }
16
+ return pendingImpl;
17
+ }
18
+ // Start the fetch when this module is evaluated, so the implementation is normally there
19
+ // before the first hint mounts and no trigger is ever swapped (Tooltip.tsx has the history).
20
+ if (typeof window !== 'undefined')
21
+ void preloadInfoHint();
9
22
  /**
10
- * "ⓘ" field-help — the bespoke anchored composite on @floating-ui/react (portaled,
11
- * flips + shifts, never clipped by an overflow ancestor). The reference model for
12
- * any future bespoke anchored composite (color picker on a swatch, date picker on an
13
- * input); standard primitives (Tooltip/DropdownMenu/SelectField/Popover/HoverCard)
14
- * use Radix instead.
23
+ * "ⓘ" field-help: hover + focus on pointer devices, click/tap everywhere, the panel portaled
24
+ * and never clipped (the behaviour is `InfoHintImpl.tsx`).
25
+ *
26
+ * ── Why this file is a wrapper and not the hint ─────────────────────────────
27
+ * 🔴 The panel is built on `@floating-ui/react` (+ `tabbable`), ~10 KB gzip, and every field
28
+ * primitive renders an InfoHint for a long `hint` — so a static import put that engine in the
29
+ * chunk of every page that renders a `SliderField` or `Field`, hint or not. cursedbelt 5.40.0's
30
+ * SliderField did exactly that to roms' controls chunk: ShortcutsPanel 14.68 → 25.24 kB gzip
31
+ * (forge task 2518). A hint is a closed icon until it is asked for, so the engine is a dynamic
32
+ * `import()` and this file — React, an icon and a class string — is what a page carries.
15
33
  *
16
- * Opens on hover + focus on pointer devices, and on click/tap everywhere — so it is
17
- * reachable on touch screens (which have no hover). `useHasHover` disables the hover
18
- * interaction on touch devices so the panel isn't left stuck open after a tap.
34
+ * A press or focus that beats the fetch is not lost: the placeholder records it and the real
35
+ * hint opens (or takes the focus) the moment it replaces it.
19
36
  */
20
- export function InfoHint({ children, title, align = 'left', className, label = 'More info', }) {
21
- const [open, setOpen] = useState(false);
22
- const hasHover = useHasHover();
23
- const { refs, floatingStyles, context } = useFloating({
24
- open,
25
- onOpenChange: setOpen,
26
- placement: align === 'right' ? 'bottom-end' : 'bottom-start',
27
- whileElementsMounted: autoUpdate,
28
- middleware: [offset(6), flip(), shift({ padding: 8 })],
29
- });
30
- // Hover only where a hover pointer exists; click/tap works on every device.
31
- //
32
- // 🔴 The hover half waits (`lib/hoverIntent.ts`); the CLICK half does not, and that
33
- // asymmetry is the point. An (i) is small and it sits inside dense label rows, so a
34
- // pointer on its way somewhere else crosses it constantly — this panel is richer than
35
- // a tooltip bubble and occludes correspondingly more when it fires by accident. A
36
- // click on it is an unambiguous request and still opens instantly, below.
37
- const hover = useHover(context, {
38
- move: false,
39
- enabled: hasHover,
40
- delay: { open: HOVER_HINT_DELAY_MS, close: 0 },
41
- });
42
- const focus = useFocus(context);
43
- const click = useClick(context);
44
- const dismiss = useDismiss(context);
45
- const role = useRole(context, { role: 'tooltip' });
46
- const { getReferenceProps, getFloatingProps } = useInteractions([
47
- hover,
48
- focus,
49
- click,
50
- dismiss,
51
- role,
52
- ]);
53
- return (_jsxs(_Fragment, { children: [_jsx("button", {
54
- // guardrails-ignore no-raw-action-button: presentational hover/click disclosure
55
- // trigger for the floating help panel — no destructive/mutating intent, and the
56
- // floating-ui ref/interaction wiring here doesn't fit the Button primitive.
57
- type: 'button', ref: refs.setReference, "aria-label": label, className: cn(
58
- // ≥44px touch target on coarse pointers (the same `TAP_TARGET` floor
59
- // Button/IconButton carry — a bare `size-4` icon glyph with no padding
60
- // measured 16×16px on mobile, cc/197).
61
- `inline-flex items-center justify-center text-muted-foreground hover:text-accent ${TAP_TARGET}`, className), ...getReferenceProps(), children: _jsx(Info, { className: 'size-4', "aria-hidden": true }) }), open ? (_jsx(FloatingPortal, { children: _jsxs("div", {
62
- // guardrails-ignore no-hand-rolled-surface: the hint's floating-ui bubble — a tooltip-class overlay with its own z-index and shadow, not a card
63
- ref: refs.setFloating, "data-cb-prose": '', style: floatingStyles, ...getFloatingProps(), className: 'z-50 max-w-xs rounded-md border border-border bg-popover px-3 py-2 text-xs text-popover-foreground shadow-[var(--shadow-overlay)]', children: [title ? _jsx("p", { className: 'mb-1 font-semibold', children: title }) : null, children] }) })) : null] }));
37
+ export function InfoHint(props) {
38
+ // `() => loadedImpl`: a component IS a function, and `useState(fn)` would call it.
39
+ const [Impl, setImpl] = useState(() => loadedImpl);
40
+ const pressed = useRef(false);
41
+ const focused = useRef(false);
42
+ useEffect(() => {
43
+ if (Impl)
44
+ return;
45
+ let alive = true;
46
+ void preloadInfoHint().then((c) => {
47
+ if (alive)
48
+ setImpl(() => c);
49
+ });
50
+ return () => {
51
+ alive = false;
52
+ };
53
+ }, [Impl]);
54
+ if (Impl)
55
+ return _jsx(Impl, { ...props, initialOpen: pressed.current, initialFocus: focused.current });
56
+ const { label = 'More info', className } = props;
57
+ return (_jsx("button", {
58
+ // guardrails-ignore no-raw-action-button: the ⓘ disclosure's placeholder until its
59
+ // floating panel loads — the same presentational trigger InfoHintImpl renders.
60
+ type: 'button', "aria-label": label, className: cn(INFO_HINT_TRIGGER, className), onClick: () => {
61
+ pressed.current = true;
62
+ }, onFocus: () => {
63
+ focused.current = true;
64
+ }, onBlur: () => {
65
+ focused.current = false;
66
+ }, children: _jsx(Info, { className: 'size-4', "aria-hidden": true }) }));
64
67
  }
65
68
  //# sourceMappingURL=InfoHint.js.map