@graphty/compact-mantine 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -49,6 +49,7 @@ import { VariantColorsResolver } from '@mantine/core';
49
49
  * @param props.actions - Controls that act, hidden until the row is hovered or focused, and always drawn where the pointer cannot hover
50
50
  * @param props.residentActions - Controls that report a state, which are never hidden
51
51
  * @param props.actionsVisible - Forces the hidden controls shown or hidden instead of letting hover and focus decide
52
+ * @param props.disabled - Whether the row cannot act, which draws its reading at the disabled ink and announces it as unavailable
52
53
  * @param props.onClick - Called when the row's own reading is activated, with the event and the activation source
53
54
  * @param props.onFocus - Called when focus enters the row or moves between its controls
54
55
  * @param props.onBlur - Called when focus leaves a control in the row
@@ -139,6 +140,18 @@ export declare interface ActionRowProps {
139
140
  * scan a column for.
140
141
  */
141
142
  residentActions?: default_2.ReactNode;
143
+ /**
144
+ * Whether this row cannot act, and says so by being drawn dimmer.
145
+ *
146
+ * It is the row half of the "not built yet" group form: where three or more
147
+ * contiguous rows share that status the tag rises once to the group header and the
148
+ * rows below are "dimmed and disabled instead of tagged individually". The reading
149
+ * then takes the disabled ink -- a different token from the ordinary muted one --
150
+ * and the row is announced as unavailable, so nothing about the state depends on
151
+ * telling two greys apart.
152
+ * @default false
153
+ */
154
+ disabled?: boolean;
142
155
  /**
143
156
  * Forces `actions` to be drawn, or forces them hidden, instead of letting
144
157
  * the row decide from hover and focus.
@@ -423,9 +436,11 @@ export declare const COMPACT_SIZING: {
423
436
  * @param props.defaultOpacity - The opacity shown while the reader has set none of their own
424
437
  * @param props.onColorChange - Called with the new colour, or with `undefined` when the control is reset
425
438
  * @param props.onOpacityChange - Called with the new opacity, or with `undefined` when the control is reset
439
+ * @param props.onChange - Called once per gesture with both halves of the colour, whichever of them moved
426
440
  * @param props.label - The field's name, drawn above the control and used to name the group
427
441
  * @param props.showOpacity - Whether to offer an opacity box beside the colour
428
442
  * @param props.disabled - Whether the control cannot be used at all
443
+ * @param props.disabledReason - One sentence saying why the control is off, drawn only while it is off
429
444
  * @param props.onFocus - Called when the hex box or the opacity box takes focus
430
445
  * @param props.onBlur - Called when the hex box or the opacity box loses focus
431
446
  * @returns The joined colour control, and its reset button when something has been set
@@ -443,7 +458,7 @@ export declare const COMPACT_SIZING: {
443
458
  * </PopoutManager>
444
459
  * ```
445
460
  */
446
- export declare function CompactColorInput({ color, defaultColor, opacity, defaultOpacity, onColorChange, onOpacityChange, label, showOpacity, disabled, onFocus, onBlur, }: CompactColorInputProps): default_2.JSX.Element;
461
+ export declare function CompactColorInput({ color, defaultColor, opacity, defaultOpacity, onColorChange, onOpacityChange, onChange, label, showOpacity, disabled, disabledReason, onFocus, onBlur, }: CompactColorInputProps): default_2.JSX.Element;
447
462
 
448
463
  /**
449
464
  * Props for the CompactColorInput component.
@@ -486,6 +501,46 @@ export declare interface CompactColorInputProps {
486
501
  * The percentage comes first; the event that caused the change is second.
487
502
  */
488
503
  onOpacityChange?: ChangeHandler<number | undefined>;
504
+ /**
505
+ * Called once per gesture with BOTH halves of the colour, whichever of them
506
+ * moved.
507
+ *
508
+ * Reach for this one, alone, whenever you drive the control from your own
509
+ * state. `onColorChange` and `onOpacityChange` are kept for call sites that
510
+ * already use them, but they cannot carry a gesture that moves both halves
511
+ * at once.
512
+ *
513
+ * THE DEFECT THIS REPAIRS, reproduced at runtime rather than reasoned
514
+ * about: dragging in the picker used to call `onColorChange` and then
515
+ * `onOpacityChange` back to back inside one React batch. A controlled
516
+ * consumer builds its next state out of the props it is holding -- the only
517
+ * snapshot it has -- and both callbacks run against the SAME pre-gesture
518
+ * snapshot, so the second one writes a state rebuilt from a colour the
519
+ * first one had already replaced. A test in this package
520
+ * (tests/components/CompactColorInput.test.tsx, "the two separate callbacks
521
+ * cannot carry one gesture") drives a picker swatch and watches the second
522
+ * write arrive as `{opacity: 50}` with the new colour gone. The application
523
+ * had already forked this whole component to escape it.
524
+ *
525
+ * Both halves are always passed, so a consumer never has to remember which
526
+ * one moved -- the same shape `GradientEditor` already uses for its stops
527
+ * and its direction. `undefined` keeps its meaning from the props: the
528
+ * reader has chosen nothing for that half and the default is showing.
529
+ *
530
+ * Supplying this ALONGSIDE `onColorChange` or `onOpacityChange` makes every
531
+ * gesture write twice. Pick one route.
532
+ * @example
533
+ * ```tsx
534
+ * <CompactColorInput
535
+ * label="Fill"
536
+ * color={style.color}
537
+ * opacity={style.opacity}
538
+ * defaultColor="#5B8FF9"
539
+ * onChange={(color, opacity) => { setStyle({...style, color, opacity}); }}
540
+ * />
541
+ * ```
542
+ */
543
+ onChange?: (color: string | undefined, opacity: number | undefined, event?: default_2.SyntheticEvent) => void;
489
544
  /**
490
545
  * The field's name, drawn above the control and used to name the group the
491
546
  * three controls sit in.
@@ -509,6 +564,22 @@ export declare interface CompactColorInputProps {
509
564
  * @default false
510
565
  */
511
566
  disabled?: boolean;
567
+ /**
568
+ * One sentence saying why the control is off, shown only while `disabled`
569
+ * is true.
570
+ *
571
+ * It is appended to the control's own name after a full stop and drawn as
572
+ * the tooltip -- "Glow colour. Glow is not drawn yet" -- and it also joins
573
+ * the accessible description of the swatch, the hex box and the opacity
574
+ * box, so the reason reaches a pointer user and a screen reader user alike.
575
+ * With no `label` to append to, the sentence stands on its own.
576
+ *
577
+ * THE DEFECT THIS REPAIRS: a disabled colour control used to be dimmed and
578
+ * silent, so a reader who could not open the picker had no route at all to
579
+ * learning why -- spec:6641 asks for the one reason to travel with the
580
+ * disabled ink, and until now this component had nowhere to put it.
581
+ */
582
+ disabledReason?: string;
512
583
  /** Called when the hex box or the opacity box takes focus. Forwarded unchanged. */
513
584
  onFocus?: default_2.FocusEventHandler<HTMLInputElement>;
514
585
  /**
@@ -889,8 +960,8 @@ export declare const compactThemeOverride: {
889
960
  } | undefined;
890
961
  radius?: {
891
962
  [x: string & {}]: string | undefined;
892
- xs?: string | undefined;
893
963
  sm?: string | undefined;
964
+ xs?: string | undefined;
894
965
  md?: string | undefined;
895
966
  lg?: string | undefined;
896
967
  xl?: string | undefined;
@@ -899,40 +970,40 @@ export declare const compactThemeOverride: {
899
970
  spacing?: {
900
971
  [x: number]: string | undefined;
901
972
  [x: string & {}]: string | undefined;
902
- xs?: string | undefined;
903
973
  sm?: string | undefined;
974
+ xs?: string | undefined;
904
975
  md?: string | undefined;
905
976
  lg?: string | undefined;
906
977
  xl?: string | undefined;
907
978
  } | undefined;
908
979
  fontSizes?: {
909
980
  [x: string & {}]: string | undefined;
910
- xs?: string | undefined;
911
981
  sm?: string | undefined;
982
+ xs?: string | undefined;
912
983
  md?: string | undefined;
913
984
  lg?: string | undefined;
914
985
  xl?: string | undefined;
915
986
  } | undefined;
916
987
  lineHeights?: {
917
988
  [x: string & {}]: string | undefined;
918
- xs?: string | undefined;
919
989
  sm?: string | undefined;
990
+ xs?: string | undefined;
920
991
  md?: string | undefined;
921
992
  lg?: string | undefined;
922
993
  xl?: string | undefined;
923
994
  } | undefined;
924
995
  breakpoints?: {
925
996
  [x: string & {}]: string | undefined;
926
- xs?: string | undefined;
927
997
  sm?: string | undefined;
998
+ xs?: string | undefined;
928
999
  md?: string | undefined;
929
1000
  lg?: string | undefined;
930
1001
  xl?: string | undefined;
931
1002
  } | undefined;
932
1003
  shadows?: {
933
1004
  [x: string & {}]: string | undefined;
934
- xs?: string | undefined;
935
1005
  sm?: string | undefined;
1006
+ xs?: string | undefined;
936
1007
  md?: string | undefined;
937
1008
  lg?: string | undefined;
938
1009
  xl?: string | undefined;
@@ -1274,6 +1345,7 @@ export declare interface ControlGroupProps {
1274
1345
  * section is correct in either direction with nothing to configure.
1275
1346
  * @param props - Component props
1276
1347
  * @param props.label - The section's name, drawn in its header
1348
+ * @param props.technicalName - The technical half of the 6.3 pair, drawn in the secondary ink inside the same label
1277
1349
  * @param props.opened - Whether the section is expanded, when you drive it from your own state
1278
1350
  * @param props.defaultOpened - Whether the section starts expanded when it keeps its own state, defaulting to true
1279
1351
  * @param props.onOpenChange - Called when the section expands or collapses, with the new state first and the event second
@@ -1312,6 +1384,16 @@ export declare function ControlSection(props: ControlSectionProps): default_2.JS
1312
1384
  export declare interface ControlSectionProps extends DisclosureProps {
1313
1385
  /** The section's name, drawn in its header. One to three words, sentence case. */
1314
1386
  label: string;
1387
+ /**
1388
+ * The technical name for the same thing, WITHOUT its parentheses -- `"Layout"`
1389
+ * beside `"Arrangement"`, `"Node and edge table"` beside `"Data table"`.
1390
+ *
1391
+ * One drawing only: plain name, space, technical name in parentheses in the
1392
+ * secondary ink, inside this one label. It joins the header's tooltip and the
1393
+ * group's accessible name as well, so the pair is never something only a pointer
1394
+ * can reach.
1395
+ */
1396
+ technicalName?: string;
1315
1397
  /**
1316
1398
  * Whether the section holds settings the reader changed from their
1317
1399
  * defaults. A 6px accent dot follows the name, announced to a screen reader
@@ -2680,6 +2762,7 @@ export declare interface IconGroupOption {
2680
2762
  * @param props.labelledBy - The `id` of the element that already names the group
2681
2763
  * @param props.name - The name shared by the group's radio inputs
2682
2764
  * @param props.disabled - Whether the whole group cannot be used
2765
+ * @param props.disabledReason - One sentence saying why the group is off, drawn only while it is off
2683
2766
  * @param props.hybrid - Draw the word beside the drawing on the selected option only
2684
2767
  * @param props.width - How wide the track is drawn, or `"fill"` to take the rest of the row
2685
2768
  * @param props.trailing - The row's 24px trailing slot
@@ -2757,6 +2840,23 @@ export declare interface IconGroupRowProps {
2757
2840
  * @default false
2758
2841
  */
2759
2842
  disabled?: boolean;
2843
+ /**
2844
+ * One sentence saying why the whole group is off, shown only while
2845
+ * `disabled` is true.
2846
+ *
2847
+ * It is appended to the group's own name after a full stop and drawn as the
2848
+ * row's tooltip -- "Node shape. Load data first" -- and it joins the
2849
+ * group's accessible description, so the reason reaches a pointer user and
2850
+ * a screen reader user alike. With no `label` to append to, the sentence
2851
+ * stands on its own.
2852
+ *
2853
+ * It says nothing about one option: a single unavailable choice is
2854
+ * `disabled` on that option, and its own word still names it. THE DEFECT
2855
+ * THIS REPAIRS: a whole group drawn dimmed with no explanation reads as a
2856
+ * broken control, which is what spec:6641 forbids -- and until now this row
2857
+ * had nowhere to put the one reason.
2858
+ */
2859
+ disabledReason?: string;
2760
2860
  /**
2761
2861
  * Draw the word beside the drawing on the selected option only.
2762
2862
  *
@@ -3789,6 +3889,15 @@ export declare interface PopoutContextValue {
3789
3889
  * everything opened from it.
3790
3890
  */
3791
3891
  parentId: string | null;
3892
+ /**
3893
+ * The region this pop-out was opened in, or null when it sits in no region.
3894
+ *
3895
+ * Root-level pop-outs compete for one open slot per region, so a pop-out
3896
+ * opened in a panel and one opened in an inspector can both be open while
3897
+ * two opened in the same panel cannot. It is the opener's region, not the
3898
+ * panel's screen position.
3899
+ */
3900
+ region: string | null;
3792
3901
  }
3793
3902
 
3794
3903
  /**
@@ -3883,8 +3992,11 @@ export declare function PopoutManager({ children }: PopoutManagerProps): JSX.Ele
3883
3992
  * out of `Popout` never needs it.
3884
3993
  */
3885
3994
  export declare interface PopoutManagerContextValue {
3886
- /** Adds a pop-out to the layer, with the callback that closes it and the pop-out it was opened from. */
3887
- register: (id: string, closeCallback: () => void, parentId?: string | null) => void;
3995
+ /**
3996
+ * Adds a pop-out to the layer, with the callback that closes it, the pop-out
3997
+ * it was opened from, and the region it was opened in.
3998
+ */
3999
+ register: (id: string, closeCallback: () => void, parentId?: string | null, region?: string | null) => void;
3888
4000
  /** Takes a pop-out out of the layer, when it leaves the page. */
3889
4001
  unregister: (id: string) => void;
3890
4002
  /** The stacking order a pop-out currently draws at. */
@@ -4102,6 +4214,56 @@ export declare interface PopoutProps extends DisclosureProps {
4102
4214
  children: ReactNode;
4103
4215
  }
4104
4216
 
4217
+ /**
4218
+ * Which region the pop-outs beneath this point belong to.
4219
+ *
4220
+ * A shell is divided into regions -- a properties panel, an inspector, the
4221
+ * surface between them, a dialog, a dock -- and a reader may hold one pop-out
4222
+ * open in each, because two pop-outs describing two different objects are not
4223
+ * competing for the same answer. What they may not do is stack up inside ONE
4224
+ * region: opening a second there closes the first, because both describe the
4225
+ * same object and the second is the reader changing their mind.
4226
+ *
4227
+ * Without a region, every pop-out opened straight from the page is a sibling of
4228
+ * every other, so an inspector pop-out closes a panel pop-out that has nothing
4229
+ * to do with it. That is the behaviour this component exists to divide up, and
4230
+ * it is why the default -- no region at all -- keeps the older whole-page rule:
4231
+ * an application that never mentions regions is unaffected.
4232
+ *
4233
+ * The region is the OPENER's, not the surface's screen position. Wrap the
4234
+ * region's own markup, and a pop-out that slides out over neighbouring space
4235
+ * still counts against the region whose control opened it.
4236
+ *
4237
+ * Nesting is unaffected either way. A pop-out opened from another pop-out is
4238
+ * grouped by its parent, as it always was, and inherits this region only for
4239
+ * the benefit of anything it opens in turn.
4240
+ * @param props - Component props
4241
+ * @param props.id - What to call this region
4242
+ * @param props.children - The part of the tree whose pop-outs belong to it
4243
+ * @returns The provider the pop-outs inside it read their region from
4244
+ * @example
4245
+ * ```tsx
4246
+ * <PopoutManager>
4247
+ * <PopoutRegion id="panel">{panel}</PopoutRegion>
4248
+ * <PopoutRegion id="inspector">{inspector}</PopoutRegion>
4249
+ * </PopoutManager>
4250
+ * ```
4251
+ */
4252
+ export declare function PopoutRegion({ id, children }: PopoutRegionProps): JSX.Element;
4253
+
4254
+ /**
4255
+ * Props for the PopoutRegion component.
4256
+ */
4257
+ export declare interface PopoutRegionProps {
4258
+ /**
4259
+ * What to call this region. Any stable string; two regions are the same
4260
+ * region when their ids are equal.
4261
+ */
4262
+ id: string;
4263
+ /** The part of the tree whose pop-outs belong to this region. */
4264
+ children: ReactNode;
4265
+ }
4266
+
4105
4267
  /**
4106
4268
  * A floating panel that opens from a trigger and can be dragged, nested and
4107
4269
  * dismissed without leaving the page.
@@ -4688,6 +4850,7 @@ export declare interface SparklineRowProps {
4688
4850
  * @param props.suffix - A unit written after the number
4689
4851
  * @param props.hideControls - Whether to leave out the up and down steppers, which are left out by default
4690
4852
  * @param props.disabled - Whether the control cannot be used at all
4853
+ * @param props.disabledReason - One sentence saying why the control is off, drawn only while it is off
4691
4854
  * @param props.onFocus - Called when the control takes focus
4692
4855
  * @param props.onBlur - Called when the control loses focus, after the number has been committed
4693
4856
  * @returns The number box, and its reset button when a number has been entered
@@ -4706,7 +4869,7 @@ export declare interface SparklineRowProps {
4706
4869
  * />
4707
4870
  * ```
4708
4871
  */
4709
- export declare function StyleNumberInput({ label, value, defaultValue, onChange, min, max, step, decimalScale, suffix, hideControls, disabled, onFocus, onBlur, }: StyleNumberInputProps): default_2.JSX.Element;
4872
+ export declare function StyleNumberInput({ label, value, defaultValue, onChange, min, max, step, decimalScale, suffix, hideControls, disabled, disabledReason, onFocus, onBlur, }: StyleNumberInputProps): default_2.JSX.Element;
4710
4873
 
4711
4874
  /**
4712
4875
  * Props for the StyleNumberInput component.
@@ -4760,6 +4923,22 @@ export declare interface StyleNumberInputProps {
4760
4923
  * @default false
4761
4924
  */
4762
4925
  disabled?: boolean;
4926
+ /**
4927
+ * One sentence saying why the control is off, shown only while `disabled`
4928
+ * is true.
4929
+ *
4930
+ * It is appended to the control's own name after a full stop and drawn as
4931
+ * the tooltip -- "Width. Load data first" -- and it also joins the
4932
+ * control's accessible description, so a screen reader reads the reason out
4933
+ * instead of announcing an unexplained unavailable control.
4934
+ *
4935
+ * Write it as a whole sentence naming what would make the control usable
4936
+ * again. THE DEFECT THIS REPAIRS: a disabled control here used to be dimmed
4937
+ * and silent, so a reader who could not type into it had no route at all to
4938
+ * learning why -- spec:6641 asks for the reason to travel with the ink, and
4939
+ * until now this component had nowhere to put it.
4940
+ */
4941
+ disabledReason?: string;
4763
4942
  /** Called when the control takes focus. Forwarded unchanged. */
4764
4943
  onFocus?: default_2.FocusEventHandler<HTMLInputElement>;
4765
4944
  /**
@@ -4791,6 +4970,7 @@ export declare interface StyleNumberInputProps {
4791
4970
  * @param props.options - The choices offered
4792
4971
  * @param props.onChange - Called with the new choice, or with `undefined` when the control is reset
4793
4972
  * @param props.disabled - Whether the control cannot be used at all
4973
+ * @param props.disabledReason - One sentence saying why the control is off, drawn only while it is off
4794
4974
  * @param props.onFocus - Called when the control takes focus
4795
4975
  * @param props.onBlur - Called when the control loses focus
4796
4976
  * @returns The dropdown, and its reset button when a choice has been made
@@ -4810,7 +4990,7 @@ export declare interface StyleNumberInputProps {
4810
4990
  * />
4811
4991
  * ```
4812
4992
  */
4813
- export declare function StyleSelect({ label, value, defaultValue, options, onChange, disabled, onFocus, onBlur, }: StyleSelectProps): default_2.JSX.Element;
4993
+ export declare function StyleSelect({ label, value, defaultValue, options, onChange, disabled, disabledReason, onFocus, onBlur, }: StyleSelectProps): default_2.JSX.Element;
4814
4994
 
4815
4995
  /**
4816
4996
  * One choice in a {@link StyleSelect}.
@@ -4857,6 +5037,23 @@ export declare interface StyleSelectProps {
4857
5037
  * @default false
4858
5038
  */
4859
5039
  disabled?: boolean;
5040
+ /**
5041
+ * One sentence saying why the control is off, shown only while `disabled`
5042
+ * is true.
5043
+ *
5044
+ * It is appended to the control's own name after a full stop and drawn as
5045
+ * the tooltip -- "Fill. Load data first" -- and it also joins the control's
5046
+ * accessible description, so a screen reader reads the reason out instead
5047
+ * of announcing an unexplained unavailable control.
5048
+ *
5049
+ * Write it as a whole sentence naming what would make the control usable
5050
+ * again, not as a restatement that it is off. THE DEFECT THIS REPAIRS: a
5051
+ * disabled control here used to be dimmed and silent, so a reader who could
5052
+ * not press it had no route at all to learning why -- spec:6641 asks for
5053
+ * the reason to travel with the ink, and until now this component had
5054
+ * nowhere to put it.
5055
+ */
5056
+ disabledReason?: string;
4860
5057
  /** Called when the control takes focus. Forwarded unchanged. */
4861
5058
  onFocus?: default_2.FocusEventHandler<HTMLInputElement>;
4862
5059
  /** Called when the control loses focus. Forwarded unchanged. */
@@ -4900,6 +5097,9 @@ export declare const SWATCH_COLORS_HEXA: readonly ["#5B8FF9FF", "#FF6B6BFF", "#6
4900
5097
  * @param props.control - Which control to draw: a 16px checkbox, or a 28x16 switch for a live mode
4901
5098
  * @param props.trailing - What to put in the fixed 24px slot at the end of the row
4902
5099
  * @param props.disabled - Whether the toggle can be changed
5100
+ * @param props.disabledReason - One sentence saying why the toggle is off, drawn only while it is off
5101
+ * @param props.bound - Whether the boolean comes from a data attribute rather than being set by hand
5102
+ * @param props.boundDescription - What a screen reader says about a bound row, defaulting to `fieldBound`
4903
5103
  * @param props.onFocus - Called when the control takes focus
4904
5104
  * @param props.onBlur - Called when the control loses focus
4905
5105
  * @returns The toggle row
@@ -4911,7 +5111,7 @@ export declare const SWATCH_COLORS_HEXA: readonly ["#5B8FF9FF", "#FF6B6BFF", "#6
4911
5111
  * </ToggleRowGroup>
4912
5112
  * ```
4913
5113
  */
4914
- export declare function ToggleRow({ label, checked, defaultChecked, onChange, control, trailing, disabled, onFocus, onBlur, }: ToggleRowProps): default_2.JSX.Element;
5114
+ export declare function ToggleRow({ label, checked, defaultChecked, onChange, control, trailing, disabled, disabledReason, bound, boundDescription, onFocus, onBlur, }: ToggleRowProps): default_2.JSX.Element;
4915
5115
 
4916
5116
  /**
4917
5117
  * The column two or more toggle rows are packed into.
@@ -5040,6 +5240,48 @@ export declare interface ToggleRowProps {
5040
5240
  * unavailable rather than merely looking it.
5041
5241
  */
5042
5242
  disabled?: boolean;
5243
+ /**
5244
+ * One sentence saying why the toggle is off, shown only while `disabled` is
5245
+ * true.
5246
+ *
5247
+ * It is appended to the row's own word after a full stop and becomes the
5248
+ * row's tooltip -- "Legend. Nothing is encoded yet" -- and it joins the
5249
+ * control's accessible description, so the reason reaches a pointer user
5250
+ * and a screen reader user alike.
5251
+ *
5252
+ * THE DEFECT THIS REPAIRS, and it was the sharper half of the two: this row
5253
+ * used to hardcode its tooltip as `wrapperProps = {title: label}`, so a
5254
+ * call site could not append a reason even by hand. A disabled toggle was
5255
+ * therefore dimmed and permanently unexplained, which is what spec:6641
5256
+ * forbids. The caller supplies the sentence; the library never invents one,
5257
+ * because only the call site knows what would turn the control back on.
5258
+ */
5259
+ disabledReason?: string;
5260
+ /**
5261
+ * Whether the boolean comes from a data attribute rather than being set by
5262
+ * hand.
5263
+ *
5264
+ * The row draws a filled attribute glyph beside its word -- the same filled
5265
+ * glyph `PanelField` uses to say the same thing -- so a panel can say "this
5266
+ * follows the data" without spending a row on a fixed-or-by-attribute
5267
+ * switch. A boolean channel can be bound just as a numeric one can, and
5268
+ * until now `PanelField` was the only control in the library able to say
5269
+ * so, which is why a bound boolean had to be drawn as a number field or not
5270
+ * drawn at all.
5271
+ * @default false
5272
+ */
5273
+ bound?: boolean;
5274
+ /**
5275
+ * What a screen reader says about a row whose value comes from a data
5276
+ * attribute. Only used when `bound` is set.
5277
+ *
5278
+ * Defaults to the `fieldBound` string, so translating it once through
5279
+ * `LabelsProvider` covers every bound control in the panel. Pass it here
5280
+ * only to say something more specific about one row, and pass an empty
5281
+ * string to say nothing -- byte for byte the contract `PanelField` already
5282
+ * documents.
5283
+ */
5284
+ boundDescription?: string;
5043
5285
  /** Called when the control takes focus. */
5044
5286
  onFocus?: default_2.FocusEventHandler<HTMLInputElement>;
5045
5287
  /** Called when the control loses focus. */
@@ -5074,6 +5316,9 @@ export declare interface ToggleRowProps {
5074
5316
  * @param props.defaultChecked - Whether the toggle starts on, when the component keeps its own state
5075
5317
  * @param props.onChange - Called with the new state first and the event that caused it second
5076
5318
  * @param props.disabled - Whether the toggle can be changed
5319
+ * @param props.disabledReason - One sentence saying why the toggle is off, drawn only while it is off
5320
+ * @param props.bound - Whether the boolean comes from a data attribute rather than being set by hand
5321
+ * @param props.boundDescription - What a screen reader says about a bound toggle, defaulting to `fieldBound`
5077
5322
  * @param props.onFocus - Called when the checkbox takes focus
5078
5323
  * @param props.onBlur - Called when the checkbox loses focus
5079
5324
  * @param props.children - The controls shown only while the feature is on
@@ -5086,7 +5331,7 @@ export declare interface ToggleRowProps {
5086
5331
  * </ToggleWithContent>
5087
5332
  * ```
5088
5333
  */
5089
- export declare function ToggleWithContent({ label, checked, defaultChecked, onChange, disabled, onFocus, onBlur, children, }: ToggleWithContentProps): default_2.JSX.Element;
5334
+ export declare function ToggleWithContent({ label, checked, defaultChecked, onChange, disabled, disabledReason, bound, boundDescription, onFocus, onBlur, children, }: ToggleWithContentProps): default_2.JSX.Element;
5090
5335
 
5091
5336
  /**
5092
5337
  * Props for the ToggleWithContent component.
@@ -5129,6 +5374,47 @@ export declare interface ToggleWithContentProps {
5129
5374
  * revealed; disable them yourself if they should not be touched either.
5130
5375
  */
5131
5376
  disabled?: boolean;
5377
+ /**
5378
+ * One sentence saying why the toggle is off, shown only while `disabled` is
5379
+ * true.
5380
+ *
5381
+ * It is appended to the toggle's own word after a full stop and becomes its
5382
+ * tooltip -- "Glow. Glow is not drawn yet" -- and it joins the control's
5383
+ * accessible description, so the reason reaches a pointer user and a screen
5384
+ * reader user alike.
5385
+ *
5386
+ * THE DEFECT THIS REPAIRS: a feature that cannot be turned on yet used to
5387
+ * be drawn as a dimmed checkbox with nothing to say for itself, which reads
5388
+ * as a broken control rather than as an unfinished feature. spec:6641 asks
5389
+ * for the one reason to travel with the disabled ink; until now this
5390
+ * component had nowhere to put it. The caller supplies the sentence -- only
5391
+ * the call site knows what would turn the feature back on.
5392
+ */
5393
+ disabledReason?: string;
5394
+ /**
5395
+ * Whether the boolean comes from a data attribute rather than being set by
5396
+ * hand.
5397
+ *
5398
+ * The toggle draws a filled attribute glyph beside its word -- the same
5399
+ * filled glyph `PanelField` uses to say the same thing -- so a panel can
5400
+ * say "this follows the data" without spending a row on a
5401
+ * fixed-or-by-attribute switch. A boolean channel can be bound just as a
5402
+ * numeric one can, and until now `PanelField` was the only control in the
5403
+ * library able to say so.
5404
+ * @default false
5405
+ */
5406
+ bound?: boolean;
5407
+ /**
5408
+ * What a screen reader says about a toggle whose value comes from a data
5409
+ * attribute. Only used when `bound` is set.
5410
+ *
5411
+ * Defaults to the `fieldBound` string, so translating it once through
5412
+ * `LabelsProvider` covers every bound control in the panel. Pass it here
5413
+ * only to say something more specific about one toggle, and pass an empty
5414
+ * string to say nothing -- byte for byte the contract `PanelField` already
5415
+ * documents.
5416
+ */
5417
+ boundDescription?: string;
5132
5418
  /** Called when the checkbox takes focus. */
5133
5419
  onFocus?: default_2.FocusEventHandler<HTMLInputElement>;
5134
5420
  /** Called when the checkbox loses focus. */
@@ -5207,7 +5493,7 @@ export declare function UiGlyph({ name, size }: UiGlyphProps): default_2.JSX.Ele
5207
5493
  * Shared UI glyphs: the chevrons, the doors and the status marks the row types
5208
5494
  * draw outside a field's slot.
5209
5495
  */
5210
- export declare type UiGlyphName = "chevronDown" | "chevronRight" | "chevronLeft" | "close" | "plus" | "minus" | "gear" | "warning" | "check" | "eye" | "refresh" | "copy" | "pin" | "info" | "reset";
5496
+ export declare type UiGlyphName = "chevronDown" | "chevronRight" | "chevronLeft" | "close" | "plus" | "minus" | "gear" | "warning" | "check" | "eye" | "refresh" | "copy" | "pin" | "keepOpen" | "info" | "reset";
5211
5497
 
5212
5498
  /**
5213
5499
  * Props for the UiGlyph component.
@@ -5342,8 +5628,14 @@ export declare function useOrdinalFormatter(): (value: number) => string;
5342
5628
  */
5343
5629
  export declare function usePanelLabels(): boolean;
5344
5630
 
5631
+ /**
5632
+ * The region the calling component sits in.
5633
+ * @returns The region's id, or null when there is no enclosing region.
5634
+ */
5635
+ export declare function usePopoutRegion(): string | null;
5636
+
5345
5637
  /** The released version of this package. */
5346
- export declare const VERSION = "0.6.0";
5638
+ export declare const VERSION = "0.7.0";
5347
5639
 
5348
5640
  export { }
5349
5641