@graphty/compact-mantine 0.8.18 → 0.8.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +52 -13
- package/dist/index.d.ts +52 -13
- package/dist/index.js +2067 -1973
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -12,6 +12,7 @@ import { ReactNode } from 'react';
|
|
|
12
12
|
import { ReactPortal } from 'react';
|
|
13
13
|
import { RefAttributes } from 'react';
|
|
14
14
|
import { RefObject } from 'react';
|
|
15
|
+
import { SegmentedControl as SegmentedControl_2 } from '@mantine/core';
|
|
15
16
|
import { SyntheticEvent } from 'react';
|
|
16
17
|
import { VariantColorsResolver } from '@mantine/core';
|
|
17
18
|
|
|
@@ -492,6 +493,8 @@ export declare interface CompactColorInputProps {
|
|
|
492
493
|
* The colour comes first, as `#RRGGBB` in upper case; the event that caused
|
|
493
494
|
* the change is second and is absent for a change made from the picker,
|
|
494
495
|
* which reports none.
|
|
496
|
+
*
|
|
497
|
+
* Not called when `onChange` is supplied.
|
|
495
498
|
*/
|
|
496
499
|
onColorChange?: ChangeHandler<string | undefined>;
|
|
497
500
|
/**
|
|
@@ -499,6 +502,8 @@ export declare interface CompactColorInputProps {
|
|
|
499
502
|
* reset to its default.
|
|
500
503
|
*
|
|
501
504
|
* The percentage comes first; the event that caused the change is second.
|
|
505
|
+
*
|
|
506
|
+
* Not called when `onChange` is supplied.
|
|
502
507
|
*/
|
|
503
508
|
onOpacityChange?: ChangeHandler<number | undefined>;
|
|
504
509
|
/**
|
|
@@ -527,8 +532,9 @@ export declare interface CompactColorInputProps {
|
|
|
527
532
|
* and its direction. `undefined` keeps its meaning from the props: the
|
|
528
533
|
* reader has chosen nothing for that half and the default is showing.
|
|
529
534
|
*
|
|
530
|
-
*
|
|
531
|
-
* gesture write
|
|
535
|
+
* When this is supplied, `onColorChange` and `onOpacityChange` are not
|
|
536
|
+
* called: one gesture makes one write. Passing both routes logs a
|
|
537
|
+
* development warning naming the conflict.
|
|
532
538
|
* @example
|
|
533
539
|
* ```tsx
|
|
534
540
|
* <CompactColorInput
|
|
@@ -3365,14 +3371,12 @@ export declare const PANEL_INK: {
|
|
|
3365
3371
|
* token to serve a selected item is what made a chip's label and a bar's
|
|
3366
3372
|
* fill unreadable, so the two roles are two tokens.
|
|
3367
3373
|
*
|
|
3368
|
-
*
|
|
3369
|
-
*
|
|
3374
|
+
* One pairing on this token is still short of WCAG AA, and it cannot be
|
|
3375
|
+
* fixed by moving it. A chip labelled in the secondary text colour
|
|
3370
3376
|
* measures 4.43:1 in the dark scheme against the 4.5:1 for text; the same
|
|
3371
|
-
* chip labelled in the primary text colour measures 7.33:1
|
|
3372
|
-
* on this track measures
|
|
3373
|
-
* for a shape that carries meaning
|
|
3374
|
-
* 3.12:1 and 3.56:1. Both are settled where they are drawn, by choosing
|
|
3375
|
-
* the ink or the ground, not by another value here.
|
|
3377
|
+
* chip labelled in the primary text colour measures 7.33:1, which is what
|
|
3378
|
+
* the row draws. An accent fill on this track measures 3.53:1 (dark) and
|
|
3379
|
+
* 3.86:1 (light), past the 3:1 for a shape that carries meaning.
|
|
3376
3380
|
*/
|
|
3377
3381
|
readonly RAISED: "light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-5))";
|
|
3378
3382
|
/**
|
|
@@ -3419,16 +3423,24 @@ export declare const PANEL_INK: {
|
|
|
3419
3423
|
readonly DIVIDER: "light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))";
|
|
3420
3424
|
/**
|
|
3421
3425
|
* accent: a checked box, the highlighted bin, a filled micro-bar, the Run
|
|
3422
|
-
* button (#1971c2 in the
|
|
3426
|
+
* button (#1971c2, blue-8, in the light scheme; #339af0, blue-5, in the
|
|
3427
|
+
* dark one).
|
|
3428
|
+
*
|
|
3429
|
+
* The theme sets `primaryShade` so the fill stands at least 3:1 off the
|
|
3430
|
+
* panel, a field and the raised surface in both schemes (WCAG 1.4.11):
|
|
3431
|
+
* 3.86:1 or more in the light scheme, 3.53:1 or more in the dark one.
|
|
3423
3432
|
*
|
|
3424
3433
|
* This token and `ON_ACCENT` follow a consumer's own `primaryColor`;
|
|
3425
3434
|
* `WARNING`, `SUCCESS` and `DANGER` are stock Mantine yellow, green and
|
|
3426
|
-
* red. The theme
|
|
3427
|
-
* so none of the five is overridden here, and a consumer who sets one gets
|
|
3435
|
+
* red. The theme sets no `primaryColor`, so a consumer who sets one gets
|
|
3428
3436
|
* it throughout.
|
|
3429
3437
|
*/
|
|
3430
3438
|
readonly ACCENT: "var(--mantine-primary-color-filled)";
|
|
3431
|
-
/**
|
|
3439
|
+
/**
|
|
3440
|
+
* text and glyphs drawn on the accent: white in the light scheme (5.02:1)
|
|
3441
|
+
* and black in the dark one (7.02:1), chosen by the theme's `autoContrast`
|
|
3442
|
+
* from the fill's luminance, so both pass WCAG 1.4.3's 4.5:1.
|
|
3443
|
+
*/
|
|
3432
3444
|
readonly ON_ACCENT: "var(--mantine-primary-color-contrast)";
|
|
3433
3445
|
/** the warning glyph on a departure line (#fab005) */
|
|
3434
3446
|
readonly WARNING: "var(--mantine-color-yellow-6)";
|
|
@@ -4762,6 +4774,33 @@ export declare interface RankChipProps {
|
|
|
4762
4774
|
children: default_2.ReactNode;
|
|
4763
4775
|
}
|
|
4764
4776
|
|
|
4777
|
+
/**
|
|
4778
|
+
* Mantine's SegmentedControl, named by the `Input.Wrapper` around it.
|
|
4779
|
+
*
|
|
4780
|
+
* `Input.Wrapper` names its child with `<label for={id}>`, and only a control
|
|
4781
|
+
* that reads the wrapper's context takes that id. Mantine's SegmentedControl
|
|
4782
|
+
* does not, so inside a wrapper its radiogroup is announced with no name and
|
|
4783
|
+
* no description. This drop-in reads the wrapper's label and description ids
|
|
4784
|
+
* and puts them on the radiogroup as `aria-labelledby` and `aria-describedby`.
|
|
4785
|
+
* Either attribute passed by the caller wins. Outside a wrapper it is exactly
|
|
4786
|
+
* Mantine's control. A theme extension cannot do this, because a component's
|
|
4787
|
+
* theme defaults cannot read React context.
|
|
4788
|
+
*
|
|
4789
|
+
* Mantine's wrapper publishes a label id even when it renders no label, so a
|
|
4790
|
+
* wrapper with only a description or an error leaves `aria-labelledby`
|
|
4791
|
+
* pointing at no element. Browsers skip a missing id and fall back to any
|
|
4792
|
+
* `aria-label`, so give the control one in that case.
|
|
4793
|
+
* @param props - Mantine's SegmentedControl props
|
|
4794
|
+
* @returns The segmented control
|
|
4795
|
+
* @example
|
|
4796
|
+
* ```tsx
|
|
4797
|
+
* <Input.Wrapper label="Mode" description="How the graph is drawn">
|
|
4798
|
+
* <SegmentedControl data={["2D", "3D"]} />
|
|
4799
|
+
* </Input.Wrapper>
|
|
4800
|
+
* ```
|
|
4801
|
+
*/
|
|
4802
|
+
export declare function SegmentedControl(props: default_2.ComponentProps<typeof SegmentedControl_2>): default_2.JSX.Element;
|
|
4803
|
+
|
|
4765
4804
|
/**
|
|
4766
4805
|
* The same chart at half the height, for a series rather than a distribution.
|
|
4767
4806
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { ReactNode } from 'react';
|
|
|
12
12
|
import { ReactPortal } from 'react';
|
|
13
13
|
import { RefAttributes } from 'react';
|
|
14
14
|
import { RefObject } from 'react';
|
|
15
|
+
import { SegmentedControl as SegmentedControl_2 } from '@mantine/core';
|
|
15
16
|
import { SyntheticEvent } from 'react';
|
|
16
17
|
import { VariantColorsResolver } from '@mantine/core';
|
|
17
18
|
|
|
@@ -492,6 +493,8 @@ export declare interface CompactColorInputProps {
|
|
|
492
493
|
* The colour comes first, as `#RRGGBB` in upper case; the event that caused
|
|
493
494
|
* the change is second and is absent for a change made from the picker,
|
|
494
495
|
* which reports none.
|
|
496
|
+
*
|
|
497
|
+
* Not called when `onChange` is supplied.
|
|
495
498
|
*/
|
|
496
499
|
onColorChange?: ChangeHandler<string | undefined>;
|
|
497
500
|
/**
|
|
@@ -499,6 +502,8 @@ export declare interface CompactColorInputProps {
|
|
|
499
502
|
* reset to its default.
|
|
500
503
|
*
|
|
501
504
|
* The percentage comes first; the event that caused the change is second.
|
|
505
|
+
*
|
|
506
|
+
* Not called when `onChange` is supplied.
|
|
502
507
|
*/
|
|
503
508
|
onOpacityChange?: ChangeHandler<number | undefined>;
|
|
504
509
|
/**
|
|
@@ -527,8 +532,9 @@ export declare interface CompactColorInputProps {
|
|
|
527
532
|
* and its direction. `undefined` keeps its meaning from the props: the
|
|
528
533
|
* reader has chosen nothing for that half and the default is showing.
|
|
529
534
|
*
|
|
530
|
-
*
|
|
531
|
-
* gesture write
|
|
535
|
+
* When this is supplied, `onColorChange` and `onOpacityChange` are not
|
|
536
|
+
* called: one gesture makes one write. Passing both routes logs a
|
|
537
|
+
* development warning naming the conflict.
|
|
532
538
|
* @example
|
|
533
539
|
* ```tsx
|
|
534
540
|
* <CompactColorInput
|
|
@@ -3365,14 +3371,12 @@ export declare const PANEL_INK: {
|
|
|
3365
3371
|
* token to serve a selected item is what made a chip's label and a bar's
|
|
3366
3372
|
* fill unreadable, so the two roles are two tokens.
|
|
3367
3373
|
*
|
|
3368
|
-
*
|
|
3369
|
-
*
|
|
3374
|
+
* One pairing on this token is still short of WCAG AA, and it cannot be
|
|
3375
|
+
* fixed by moving it. A chip labelled in the secondary text colour
|
|
3370
3376
|
* measures 4.43:1 in the dark scheme against the 4.5:1 for text; the same
|
|
3371
|
-
* chip labelled in the primary text colour measures 7.33:1
|
|
3372
|
-
* on this track measures
|
|
3373
|
-
* for a shape that carries meaning
|
|
3374
|
-
* 3.12:1 and 3.56:1. Both are settled where they are drawn, by choosing
|
|
3375
|
-
* the ink or the ground, not by another value here.
|
|
3377
|
+
* chip labelled in the primary text colour measures 7.33:1, which is what
|
|
3378
|
+
* the row draws. An accent fill on this track measures 3.53:1 (dark) and
|
|
3379
|
+
* 3.86:1 (light), past the 3:1 for a shape that carries meaning.
|
|
3376
3380
|
*/
|
|
3377
3381
|
readonly RAISED: "light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-5))";
|
|
3378
3382
|
/**
|
|
@@ -3419,16 +3423,24 @@ export declare const PANEL_INK: {
|
|
|
3419
3423
|
readonly DIVIDER: "light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))";
|
|
3420
3424
|
/**
|
|
3421
3425
|
* accent: a checked box, the highlighted bin, a filled micro-bar, the Run
|
|
3422
|
-
* button (#1971c2 in the
|
|
3426
|
+
* button (#1971c2, blue-8, in the light scheme; #339af0, blue-5, in the
|
|
3427
|
+
* dark one).
|
|
3428
|
+
*
|
|
3429
|
+
* The theme sets `primaryShade` so the fill stands at least 3:1 off the
|
|
3430
|
+
* panel, a field and the raised surface in both schemes (WCAG 1.4.11):
|
|
3431
|
+
* 3.86:1 or more in the light scheme, 3.53:1 or more in the dark one.
|
|
3423
3432
|
*
|
|
3424
3433
|
* This token and `ON_ACCENT` follow a consumer's own `primaryColor`;
|
|
3425
3434
|
* `WARNING`, `SUCCESS` and `DANGER` are stock Mantine yellow, green and
|
|
3426
|
-
* red. The theme
|
|
3427
|
-
* so none of the five is overridden here, and a consumer who sets one gets
|
|
3435
|
+
* red. The theme sets no `primaryColor`, so a consumer who sets one gets
|
|
3428
3436
|
* it throughout.
|
|
3429
3437
|
*/
|
|
3430
3438
|
readonly ACCENT: "var(--mantine-primary-color-filled)";
|
|
3431
|
-
/**
|
|
3439
|
+
/**
|
|
3440
|
+
* text and glyphs drawn on the accent: white in the light scheme (5.02:1)
|
|
3441
|
+
* and black in the dark one (7.02:1), chosen by the theme's `autoContrast`
|
|
3442
|
+
* from the fill's luminance, so both pass WCAG 1.4.3's 4.5:1.
|
|
3443
|
+
*/
|
|
3432
3444
|
readonly ON_ACCENT: "var(--mantine-primary-color-contrast)";
|
|
3433
3445
|
/** the warning glyph on a departure line (#fab005) */
|
|
3434
3446
|
readonly WARNING: "var(--mantine-color-yellow-6)";
|
|
@@ -4762,6 +4774,33 @@ export declare interface RankChipProps {
|
|
|
4762
4774
|
children: default_2.ReactNode;
|
|
4763
4775
|
}
|
|
4764
4776
|
|
|
4777
|
+
/**
|
|
4778
|
+
* Mantine's SegmentedControl, named by the `Input.Wrapper` around it.
|
|
4779
|
+
*
|
|
4780
|
+
* `Input.Wrapper` names its child with `<label for={id}>`, and only a control
|
|
4781
|
+
* that reads the wrapper's context takes that id. Mantine's SegmentedControl
|
|
4782
|
+
* does not, so inside a wrapper its radiogroup is announced with no name and
|
|
4783
|
+
* no description. This drop-in reads the wrapper's label and description ids
|
|
4784
|
+
* and puts them on the radiogroup as `aria-labelledby` and `aria-describedby`.
|
|
4785
|
+
* Either attribute passed by the caller wins. Outside a wrapper it is exactly
|
|
4786
|
+
* Mantine's control. A theme extension cannot do this, because a component's
|
|
4787
|
+
* theme defaults cannot read React context.
|
|
4788
|
+
*
|
|
4789
|
+
* Mantine's wrapper publishes a label id even when it renders no label, so a
|
|
4790
|
+
* wrapper with only a description or an error leaves `aria-labelledby`
|
|
4791
|
+
* pointing at no element. Browsers skip a missing id and fall back to any
|
|
4792
|
+
* `aria-label`, so give the control one in that case.
|
|
4793
|
+
* @param props - Mantine's SegmentedControl props
|
|
4794
|
+
* @returns The segmented control
|
|
4795
|
+
* @example
|
|
4796
|
+
* ```tsx
|
|
4797
|
+
* <Input.Wrapper label="Mode" description="How the graph is drawn">
|
|
4798
|
+
* <SegmentedControl data={["2D", "3D"]} />
|
|
4799
|
+
* </Input.Wrapper>
|
|
4800
|
+
* ```
|
|
4801
|
+
*/
|
|
4802
|
+
export declare function SegmentedControl(props: default_2.ComponentProps<typeof SegmentedControl_2>): default_2.JSX.Element;
|
|
4803
|
+
|
|
4765
4804
|
/**
|
|
4766
4805
|
* The same chart at half the height, for a series rather than a distribution.
|
|
4767
4806
|
*
|