@umriss-ui/core 0.54.0 → 0.55.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/de.d.ts CHANGED
@@ -162,6 +162,41 @@ declare interface Wording {
162
162
  /** The clearing x of the range with time - kept apart from the range without,
163
163
  so that an application can call the two differently. */
164
164
  dateTimeRangeClear: string;
165
+ colorPlaceholder: string;
166
+ /** The name of the ColorPicker trigger where nothing else names it: the colour as hex, or `null` for none. */
167
+ colorTrigger: (hex: string | null) => string;
168
+ /** Accessible name of the ColorPicker panel, where its field names it no other way. */
169
+ colorPanel: string;
170
+ /** The name and the visible label of the hex field. */
171
+ colorHex: string;
172
+ colorBefore: string;
173
+ colorAfter: string;
174
+ /** Stands for no colour in the strip that compares the colour the panel opened with and the colour now. */
175
+ colorNone: string;
176
+ /** The strip as one sentence, for a screen reader. */
177
+ colorBeforeAfter: (before: string, after: string) => string;
178
+ colorDone: string;
179
+ /** Name of the row of the application's own colours. */
180
+ colorSwatches: string;
181
+ /** The name of core's light surface in the contrast readout. */
182
+ colorSurfaceLight: string;
183
+ /** The name of core's dark surface in the contrast readout. */
184
+ colorSurfaceDark: string;
185
+ /** The verdict of the contrast readout at 3:1 and above, and below it; words, so that the colour is not the only sign. */
186
+ colorPass: string;
187
+ colorFail: string;
188
+ /** Names of the red, green and blue fields of the ColorPicker panel. */
189
+ colorRed: string;
190
+ colorGreen: string;
191
+ colorBlue: string;
192
+ /** The button that picks a colour from the screen. */
193
+ colorEyedropper: string;
194
+ /** Names of the square and the hue strip, the square's role description, and what they say as value. */
195
+ colorSquare: string;
196
+ colorSquareRole: string;
197
+ colorSquareValue: (saturation: number, brightness: number) => string;
198
+ colorHue: string;
199
+ colorHueValue: (degrees: number) => string;
165
200
  previousMonth: string;
166
201
  nextMonth: string;
167
202
  /** Name of the calendar head's month list. */
package/dist/index.d.ts CHANGED
@@ -348,6 +348,53 @@ export declare interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInpu
348
348
  /** A clock face at a quarter past - the time pickers' character. */
349
349
  export declare function ClockGlyph({ ref, size, ...rest }: GlyphProps): JSX.Element;
350
350
 
351
+ /** A colour field: a trigger with the colour's swatch and hex value, and a panel with the saturation and brightness square, the hue strip, the hex field, the red, green and blue fields, the eyedropper where the browser has one, the application's own swatches, the contrast against light and dark surfaces, the colour as it was when the panel opened beside the colour now, Cancel and Done. */
352
+ export declare function ColorPicker(props: ColorPickerProps): JSX.Element;
353
+
354
+ /** The props of `ColorPicker`: the field's value contract (ADR-0081) with a hex colour for the value. */
355
+ export declare interface ColorPickerProps extends Omit<HTMLAttributes<HTMLButtonElement>, "onChange" | "defaultValue">, RefProp<HTMLButtonElement>, FormPostProps<string> {
356
+ /** The colour as a hex string - `#2563eb`, `2563EB` and `#26e` are read; `null` means none. Anything else warns in development and reads as `null`. It leaves as lowercase `#rrggbb`. */
357
+ value?: string | null;
358
+ /** Uncontrolled: the colour to start at.
359
+ @default null */
360
+ defaultValue?: string | null;
361
+ /** Runs on every settled step - a hex value as soon as it is a whole colour - and once more with the colour the panel opened with when Cancel or Escape put it back. */
362
+ onValueChange?: (value: string | null) => void;
363
+ /** What stands in the empty field. */
364
+ placeholder?: string;
365
+ /** A cross on the trigger and Clear in the panel set `null`.
366
+ @default false */
367
+ clearable?: boolean;
368
+ /** Locks the field and the panel. */
369
+ disabled?: boolean;
370
+ /** Marks the field as invalid. `FormField` sets it itself as soon as it
371
+ carries an `error` - by hand only necessary without `FormField`. */
372
+ invalid?: boolean;
373
+ /** `sm` for a toolbar and dense forms, `md` otherwise.
374
+ @default the size of a `ControlSizeProvider` around it, else `"md"` */
375
+ size?: "sm" | "md";
376
+ /** The width in characters - room for the value; the field adds its own
377
+ padding, swatch and chevron. Given, the field is that wide wherever it
378
+ stands, and never wider than its place. Without it the field fills its
379
+ place, and where the place asks - in a toolbar or a row - it is as wide
380
+ as a hex value. */
381
+ chars?: number;
382
+ /** The application's own colours as one-click choices in the panel, named for a screen reader and on hover; the one matching the colour is pressed.
383
+ @default no default */
384
+ swatches?: readonly ColorSwatch[];
385
+ /** The surfaces the panel measures the colour against, each with its contrast ratio and Pass or Fail at 3:1 (WCAG 1.4.11 - for marks and lines, not text). An empty list hides the readout.
386
+ @default core's light and dark surface */
387
+ contrastAgainst?: readonly ColorSwatch[];
388
+ }
389
+
390
+ /** A named colour: an entry of `swatches`, or a surface in `contrastAgainst`. */
391
+ export declare interface ColorSwatch {
392
+ /** What the colour is called: said by a screen reader and shown on hover (swatch), or the surface's name in the readout. */
393
+ name: string;
394
+ /** A hex colour, `#2563eb` or `2563EB`. */
395
+ value: string;
396
+ }
397
+
351
398
  /** A searchable select field (the combobox pattern with a listbox panel).
352
399
  The label of the chosen `value` is kept from the last `options` that held
353
400
  it, so a search that replaces the options does not empty the field - an
@@ -936,6 +983,9 @@ export declare interface DrawerProps extends Omit<ModalProps, "size"> {
936
983
  side?: "right" | "left";
937
984
  }
938
985
 
986
+ /** An eyedropper: a pipette with its bulb at the top and its tip at the bottom left. */
987
+ export declare function DropperGlyph({ ref, size, ...rest }: GlyphProps): JSX.Element;
988
+
939
989
  /** The first key that occurs twice, otherwise null. Two nodes with the same
940
990
  key break the cascade and the active node silently - `useTree` reports
941
991
  that during development. */
@@ -1750,13 +1800,19 @@ export declare function PlusGlyph({ ref, size, ...rest }: GlyphProps): JSX.Eleme
1750
1800
  */
1751
1801
  export declare function Popover({ open, onOpenChange, anchorRef, focusRef, insideRefs, align, offset, width, minWidth, restoreFocus, hideOnScroll, role: roleProp, "aria-label": name, id, className, closeOnTabOut, onBlur, children, }: PopoverProps): ReactPortal | null;
1752
1802
 
1803
+ /** Why a popover asks to close: Escape, a click outside, a scroll
1804
+ (`hideOnScroll`), the anchor clipped away by a scrolling container, a Tab
1805
+ out of the panel (`closeOnTabOut`). */
1806
+ export declare type PopoverCloseReason = "escape" | "outside" | "scroll" | "clipped" | "tab";
1807
+
1753
1808
  /** The props of `Popover`. */
1754
1809
  export declare interface PopoverProps {
1755
1810
  /** Whether the surface stands. Controlled: the popover never opens itself. */
1756
1811
  open: boolean;
1757
1812
  /** Reports every wish to change the state – outside click, Escape,
1758
- scrolling. Whether it closes as a result is the caller's decision. */
1759
- onOpenChange: (open: boolean) => void;
1813
+ scrolling. Whether it closes as a result is the caller's decision. A
1814
+ wish to close carries its `PopoverCloseReason`. */
1815
+ onOpenChange: (open: boolean, reason?: PopoverCloseReason) => void;
1760
1816
  /** Trigger the panel hangs from (the reference for the position). */
1761
1817
  anchorRef: RefObject<HTMLElement | null>;
1762
1818
  /**
@@ -3151,6 +3207,41 @@ export declare interface Wording {
3151
3207
  /** The clearing x of the range with time - kept apart from the range without,
3152
3208
  so that an application can call the two differently. */
3153
3209
  dateTimeRangeClear: string;
3210
+ colorPlaceholder: string;
3211
+ /** The name of the ColorPicker trigger where nothing else names it: the colour as hex, or `null` for none. */
3212
+ colorTrigger: (hex: string | null) => string;
3213
+ /** Accessible name of the ColorPicker panel, where its field names it no other way. */
3214
+ colorPanel: string;
3215
+ /** The name and the visible label of the hex field. */
3216
+ colorHex: string;
3217
+ colorBefore: string;
3218
+ colorAfter: string;
3219
+ /** Stands for no colour in the strip that compares the colour the panel opened with and the colour now. */
3220
+ colorNone: string;
3221
+ /** The strip as one sentence, for a screen reader. */
3222
+ colorBeforeAfter: (before: string, after: string) => string;
3223
+ colorDone: string;
3224
+ /** Name of the row of the application's own colours. */
3225
+ colorSwatches: string;
3226
+ /** The name of core's light surface in the contrast readout. */
3227
+ colorSurfaceLight: string;
3228
+ /** The name of core's dark surface in the contrast readout. */
3229
+ colorSurfaceDark: string;
3230
+ /** The verdict of the contrast readout at 3:1 and above, and below it; words, so that the colour is not the only sign. */
3231
+ colorPass: string;
3232
+ colorFail: string;
3233
+ /** Names of the red, green and blue fields of the ColorPicker panel. */
3234
+ colorRed: string;
3235
+ colorGreen: string;
3236
+ colorBlue: string;
3237
+ /** The button that picks a colour from the screen. */
3238
+ colorEyedropper: string;
3239
+ /** Names of the square and the hue strip, the square's role description, and what they say as value. */
3240
+ colorSquare: string;
3241
+ colorSquareRole: string;
3242
+ colorSquareValue: (saturation: number, brightness: number) => string;
3243
+ colorHue: string;
3244
+ colorHueValue: (degrees: number) => string;
3154
3245
  previousMonth: string;
3155
3246
  nextMonth: string;
3156
3247
  /** Name of the calendar head's month list. */
@@ -52,6 +52,29 @@ const u = /* @__PURE__ */ d("de-DE"), c = {
52
52
  dateRangeClear: "Zeitraum leeren",
53
53
  dateTimeRangePanel: "Zeitraum mit Uhrzeit wählen",
54
54
  dateTimeRangeClear: "Zeitraum mit Uhrzeit leeren",
55
+ colorPlaceholder: "Farbe wählen",
56
+ colorTrigger: (e) => e ? `Farbe ${e}` : "Farbe: keine",
57
+ colorPanel: "Farbe wählen",
58
+ colorHex: "Hex",
59
+ colorBefore: "Vorher",
60
+ colorAfter: "Nachher",
61
+ colorNone: "Keine",
62
+ colorBeforeAfter: (e, n) => `Vorher ${e}, nachher ${n}`,
63
+ colorDone: "Fertig",
64
+ colorSwatches: "Farbfelder",
65
+ colorSurfaceLight: "Hell",
66
+ colorSurfaceDark: "Dunkel",
67
+ colorPass: "Bestanden",
68
+ colorFail: "Nicht bestanden",
69
+ colorRed: "Rot",
70
+ colorGreen: "Grün",
71
+ colorBlue: "Blau",
72
+ colorEyedropper: "Farbe vom Bildschirm aufnehmen",
73
+ colorSquare: "Sättigung und Helligkeit",
74
+ colorSquareRole: "zweiachsige Farbfläche",
75
+ colorSquareValue: (e, n) => `Sättigung ${e} %, Helligkeit ${n} %`,
76
+ colorHue: "Farbton",
77
+ colorHueValue: (e) => `${e} Grad`,
55
78
  previousMonth: "Voriger Monat",
56
79
  nextMonth: "Nächster Monat",
57
80
  monthSelect: "Monat",