@umriss-ui/core 0.22.0 → 0.24.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/CHANGELOG.md +45 -0
- package/README.md +2 -2
- package/dist/core.css +1 -1
- package/dist/core.js +3410 -3219
- package/dist/index.d.ts +8 -3
- package/docs/llms-full.md +18 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1267,6 +1267,10 @@ export declare interface MultiSelectProps<T extends string = string> extends Omi
|
|
|
1267
1267
|
/** Marks the field as invalid. `FormField` sets it itself as soon as it
|
|
1268
1268
|
carries an `error` – by hand only necessary without `FormField`. */
|
|
1269
1269
|
invalid?: boolean;
|
|
1270
|
+
/** Shows a cross beside the chips that empties the selection, as "Select
|
|
1271
|
+
none" does: a chosen value whose option is disabled stays. The field
|
|
1272
|
+
keeps room for it, chosen values or none, so that it never moves. */
|
|
1273
|
+
clearable?: boolean;
|
|
1270
1274
|
}
|
|
1271
1275
|
|
|
1272
1276
|
/** How a node is read - handed over once, not per node. The node's own type
|
|
@@ -1550,9 +1554,10 @@ export declare interface RowWindow {
|
|
|
1550
1554
|
export declare function scrollForRow(index: number, { rowHeight, scrollTop, viewportHeight, headerHeight }: RowPlacement): number | null;
|
|
1551
1555
|
|
|
1552
1556
|
/**
|
|
1553
|
-
*
|
|
1554
|
-
*
|
|
1555
|
-
*
|
|
1557
|
+
* The select field. The `<select>` holds the value, the form and the keys;
|
|
1558
|
+
* under a mouse, a pen and the keyboard it opens the library's own list - the
|
|
1559
|
+
* Combobox's - and under a finger the system's picker (ADR-0043). The arrow is
|
|
1560
|
+
* drawn in CSS and therefore follows the theme tokens.
|
|
1556
1561
|
*/
|
|
1557
1562
|
export declare const Select: ForwardRefExoticComponent<SelectProps & RefAttributes<HTMLSelectElement>>;
|
|
1558
1563
|
|
package/docs/llms-full.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @umriss-ui/core 0.
|
|
1
|
+
# @umriss-ui/core 0.24.0
|
|
2
2
|
|
|
3
3
|
> React component library for data-dense dashboards and tools - forms, date pickers, overlays, a tree view and a command palette. Precise, quiet, professional.
|
|
4
4
|
|
|
@@ -6349,7 +6349,7 @@ export default function SizedToTheValue() {
|
|
|
6349
6349
|
|
|
6350
6350
|
##### A row that holds still
|
|
6351
6351
|
|
|
6352
|
-
In a row a field is its natural width - a count of characters of its own type - and never what it shows. Choose carriers, clear them, pick the long status: nothing in the row moves. The chips that do not fit stand as "+N", and the figures below are the fields' widths, measured live.
|
|
6352
|
+
In a row a field is its natural width - a count of characters of its own type - and never what it shows. Choose carriers, clear them one by one or all at once, pick the long status: nothing in the row moves. The chips that do not fit stand as "+N", and the figures below are the fields' widths, measured live.
|
|
6353
6353
|
|
|
6354
6354
|
```tsx
|
|
6355
6355
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
@@ -6399,7 +6399,7 @@ export default function ARowThatHoldsStill() {
|
|
|
6399
6399
|
<option>Out for delivery</option>
|
|
6400
6400
|
<option>Held at customs until the papers of origin are checked</option>
|
|
6401
6401
|
</Select>
|
|
6402
|
-
<MultiSelect ref={carriersRef} aria-label="Carriers" placeholder="Every carrier" options={CARRIERS} value={carriers} onChange={setCarriers} />
|
|
6402
|
+
<MultiSelect ref={carriersRef} aria-label="Carriers" placeholder="Every carrier" options={CARRIERS} value={carriers} onChange={setCarriers} clearable />
|
|
6403
6403
|
<DateRangePicker aria-label="Shipped" value={period} onChange={setPeriod} clearable />
|
|
6404
6404
|
<Switch label="Late only" />
|
|
6405
6405
|
</Stack>
|
|
@@ -7737,7 +7737,7 @@ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
|
7737
7737
|
|
|
7738
7738
|
### Select
|
|
7739
7739
|
|
|
7740
|
-
One choice from a short, known list (dropdown)
|
|
7740
|
+
One choice from a short, known list (dropdown). Under a mouse and the keys it opens the Combobox's list; under a finger the system's picker, a wheel on the phone.
|
|
7741
7741
|
|
|
7742
7742
|
```ts
|
|
7743
7743
|
import { Select } from "@umriss-ui/core";
|
|
@@ -7745,6 +7745,10 @@ import { Select } from "@umriss-ui/core";
|
|
|
7745
7745
|
|
|
7746
7746
|
Demo page: https://romanhaendler.github.io/umriss-ui/core/select/
|
|
7747
7747
|
|
|
7748
|
+
The field is a native `<select>`: it holds the value and the form, and `onChange` fires as it always did. Write the choices as `<option>` and `<optgroup>`; the list is drawn from them.
|
|
7749
|
+
|
|
7750
|
+
An option with the empty value is the placeholder: muted in the field, and never marked as the choice in the list.
|
|
7751
|
+
|
|
7748
7752
|
#### Examples
|
|
7749
7753
|
|
|
7750
7754
|
##### Select
|
|
@@ -7856,9 +7860,11 @@ export default function ClearTheChoice() {
|
|
|
7856
7860
|
|
|
7857
7861
|
| Key | Action |
|
|
7858
7862
|
|---|---|
|
|
7859
|
-
| `Arrow
|
|
7860
|
-
| `
|
|
7861
|
-
| `Typing a letter` | Jumps to the next option starting with it. |
|
|
7863
|
+
| `Arrow Down / Arrow Up, Space, Alt + Arrow, F4` | Opens the list on the chosen option. Enter in a closed field is passed on, to a form or a grid. |
|
|
7864
|
+
| `Arrow Up / Arrow Down, Home / End, Page Up / Page Down` | Moves in the open list. |
|
|
7865
|
+
| `Typing a letter` | Jumps to the next option starting with it; in a closed field it changes the choice. |
|
|
7866
|
+
| `Enter or Space` | Chooses the option the list stands on. |
|
|
7867
|
+
| `Escape or Tab` | Closes the list. |
|
|
7862
7868
|
|
|
7863
7869
|
#### API
|
|
7864
7870
|
|
|
@@ -7876,7 +7882,7 @@ Also takes every attribute of `<select>` – without `size`.
|
|
|
7876
7882
|
|
|
7877
7883
|
#### Known limits
|
|
7878
7884
|
|
|
7879
|
-
- The
|
|
7885
|
+
- The list shows the options' text: no icons, descriptions or search inside it - the Combobox searches.
|
|
7880
7886
|
|
|
7881
7887
|
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0032-what-umriss-is-not.md).
|
|
7882
7888
|
|
|
@@ -8057,7 +8063,7 @@ export default function AssignAnIncident() {
|
|
|
8057
8063
|
|
|
8058
8064
|
#### When to use something else
|
|
8059
8065
|
|
|
8060
|
-
- A short list
|
|
8066
|
+
- A short list that needs no search, with the system's picker under a finger → Select
|
|
8061
8067
|
- Several values at once → MultiSelect
|
|
8062
8068
|
|
|
8063
8069
|
#### Keyboard
|
|
@@ -8193,7 +8199,7 @@ export default function States() {
|
|
|
8193
8199
|
|
|
8194
8200
|
##### Filter incidents by service
|
|
8195
8201
|
|
|
8196
|
-
An empty value means no filter; the panel's search, select-all and chosen view help once the list is long.
|
|
8202
|
+
An empty value means no filter, and the cross takes the field back there in one click; the panel's search, select-all and chosen view help once the list is long.
|
|
8197
8203
|
|
|
8198
8204
|
```tsx
|
|
8199
8205
|
import { useState } from "react";
|
|
@@ -8261,6 +8267,7 @@ export default function FilterIncidentsByService() {
|
|
|
8261
8267
|
placeholder="All services"
|
|
8262
8268
|
searchPlaceholder="Search services"
|
|
8263
8269
|
options={SERVICES.map((s) => ({ value: s.id, label: s.name }))}
|
|
8270
|
+
clearable
|
|
8264
8271
|
/>
|
|
8265
8272
|
</FormField>
|
|
8266
8273
|
<Stack gap={2}>
|
|
@@ -8316,6 +8323,7 @@ export default function FilterIncidentsByService() {
|
|
|
8316
8323
|
| `chars` | `number` | — | The width in characters - room for the chips; the field adds its own padding and chevron. Given, the field is that wide wherever it stands, and never wider than its place. Without it the field fills its place, and is 20 characters wide where the place asks - in a toolbar or a row, room for two short chips and the counter. Either way, choosing and removing values never moves it: the chips that do not fit stand as "+N". |
|
|
8317
8324
|
| `disabled` | `boolean` | `false` | Locks field and panel. |
|
|
8318
8325
|
| `invalid` | `boolean` | — | Marks the field as invalid. `FormField` sets it itself as soon as it carries an `error` – by hand only necessary without `FormField`. |
|
|
8326
|
+
| `clearable` | `boolean` | `false` | Shows a cross beside the chips that empties the selection, as "Select none" does: a chosen value whose option is disabled stays. The field keeps room for it, chosen values or none, so that it never moves. |
|
|
8319
8327
|
|
|
8320
8328
|
Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
8321
8329
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umriss-ui/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "React component library for data-dense dashboards and tools - forms, date pickers, overlays, a tree view and a command palette. Precise, quiet, professional.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Roman Händler",
|