@umriss-ui/core 0.26.0 → 0.27.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 +36 -0
- package/README.md +4 -3
- package/dist/core.css +1 -1
- package/dist/core.js +1136 -1128
- package/dist/index.d.ts +14 -0
- package/docs/llms-full.md +135 -21
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1774,6 +1774,15 @@ export declare interface SegmentedControlProps<T extends string> extends Omit<HT
|
|
|
1774
1774
|
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1775
1775
|
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
1776
1776
|
size?: "sm" | "md";
|
|
1777
|
+
/** How it is drawn. `inset`: a sunken track without an edge, the choice a
|
|
1778
|
+
surface lifted out of it. `field`: a field's edge, the choice filled
|
|
1779
|
+
with ink - for a row whose fields it should match box for box.
|
|
1780
|
+
@default "inset" */
|
|
1781
|
+
variant?: "field" | "inset";
|
|
1782
|
+
/** Takes the whole width its place gives it, as a field in a column does,
|
|
1783
|
+
and shares it equally between the segments. Without it the control is
|
|
1784
|
+
as wide as its words. */
|
|
1785
|
+
fill?: boolean;
|
|
1777
1786
|
/** Disables the whole control. `SegmentedOption` disables single
|
|
1778
1787
|
possibilities. */
|
|
1779
1788
|
disabled?: boolean;
|
|
@@ -1788,6 +1797,11 @@ export declare interface SegmentedOption<T extends string> {
|
|
|
1788
1797
|
value: T;
|
|
1789
1798
|
/** The segment's word - a short one; a long label ends in an ellipsis. */
|
|
1790
1799
|
label: ReactNode;
|
|
1800
|
+
/** An icon before the word: an SVG, a glyph of the set or an icon font's
|
|
1801
|
+
element. The control sets its size - `--u-icon-size`, `--u-icon-size-sm`
|
|
1802
|
+
at `sm` - and hides it from assistive technology: the word names the
|
|
1803
|
+
possibility. */
|
|
1804
|
+
icon?: ReactNode;
|
|
1791
1805
|
/** Takes the possibility out of the choice but leaves it visible. */
|
|
1792
1806
|
disabled?: boolean;
|
|
1793
1807
|
}
|
package/docs/llms-full.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @umriss-ui/core 0.
|
|
1
|
+
# @umriss-ui/core 0.27.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
|
|
|
@@ -2899,6 +2899,15 @@ The travel of the grip is the knob to turn when the gesture feels lifeless: [ADR
|
|
|
2899
2899
|
| `--u-dock-refusal-duration` | `1400ms` | same | — |
|
|
2900
2900
|
| `--u-drawer-width` | `400px` | same | The width of a drawer (core-foundations 03). A token rather than a size prop: a detail beside a process picture wants one width across an application, and one drawer that needs another sets it in its `style`. |
|
|
2901
2901
|
|
|
2902
|
+
##### Toast (toast-inset-tokens)
|
|
2903
|
+
|
|
2904
|
+
How far the toasts stand from the window's top and bottom edge - set it to keep them clear of a fixed header or a toolbar at the bottom. The region hangs in `body`, so set them on `:root`; a media query of your own may set another value per width.
|
|
2905
|
+
|
|
2906
|
+
| Token | Light | Dark | Description |
|
|
2907
|
+
|---|---|---|---|
|
|
2908
|
+
| `--u-toast-inset-top` | `var(`[--u-space-5](#token-u-space-5)`)` | same | for the three `top-*` positions; `var(--u-space-4)` up to 600 px wide |
|
|
2909
|
+
| `--u-toast-inset-bottom` | `var(`[--u-space-5](#token-u-space-5)`)` | same | for the three `bottom-*` positions; `var(--u-space-4)` up to 600 px wide |
|
|
2910
|
+
|
|
2902
2911
|
##### Shadow stacks: every step has one job
|
|
2903
2912
|
|
|
2904
2913
|
Card: edge, contact with the ground, soft depth. Overlay: edge, near shadow, depth.
|
|
@@ -3079,7 +3088,7 @@ From `BadgeProps` — the full table stands on [Badge](#/badge/type-BadgeProps).
|
|
|
3079
3088
|
|
|
3080
3089
|
- No theme object, no theme provider and no theme switch: a theme is a set of token overrides in your stylesheet, the mode is the page's `color-scheme` ([ADR-0021](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0021-the-styles-load-themselves-and-touch-nothing-else.md)).
|
|
3081
3090
|
- A token that names another resolves where it is declared: set `--u-color-accent` on a region, and `--u-focus-ring`, which names it on `:root`, still draws the application's accent there. Set the naming token in the region too.
|
|
3082
|
-
- A panel opened in a portal - a popover, a tooltip, a toast - takes the tokens and the `color-scheme` of the place it lands, not of the region it was opened from. Give [UmrissProvider](#/umrissprovider) a `portalTarget` inside the region, or override on `:root`.
|
|
3091
|
+
- A panel opened in a portal - a popover, a tooltip, a toast - takes the tokens and the `color-scheme` of the place it lands, not of the region it was opened from. Give [UmrissProvider](#/umrissprovider) a `portalTarget` inside the region, or override on `:root` - as for the toasts' distance from the window's edge, `--u-toast-inset-top` and `--u-toast-inset-bottom`.
|
|
3083
3092
|
|
|
3084
3093
|
What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
|
|
3085
3094
|
|
|
@@ -3346,7 +3355,7 @@ export default function NarrowPlaces() {
|
|
|
3346
3355
|
|
|
3347
3356
|
##### A row of fields
|
|
3348
3357
|
|
|
3349
|
-
Fields side by side share one line: their labels on one line, their boxes on one height, their words on the line the select's value stands on. A segmented control is a field
|
|
3358
|
+
Fields side by side share one line: their labels on one line, their boxes on one height, their words on the line the select's value stands on. A segmented control is as tall as a field; a horizontal radio group is as tall as a control, and so are a checkbox and a switch in a field, so their words stand on that line too - at either size.
|
|
3350
3359
|
|
|
3351
3360
|
```tsx
|
|
3352
3361
|
import { Checkbox, ControlSizeProvider, FormField, RadioGroup, SegmentedControl, Select, Stack, Switch } from "@umriss-ui/core";
|
|
@@ -3425,8 +3434,8 @@ The keys of [Button](#/button/keyboard-button), [ButtonGroup](#/buttongroup/keyb
|
|
|
3425
3434
|
|
|
3426
3435
|
| Prop | Type | Default | Description |
|
|
3427
3436
|
|---|---|---|---|
|
|
3428
|
-
| `size` *required* | [`ControlSize`](#type-ControlSize)<br>`"sm" \| "md"` | — | The size of every control inside that does not say its own.<br>Shown in: [One size for a place](#/sizes/one-size-for-a-place), [A row of fields](#/sizes/a-row-of-fields) |
|
|
3429
|
-
| `children` *required* | `ReactNode` | — | The place the size holds for.<br>Shown in: [One size for a place](#/sizes/one-size-for-a-place), [A row of fields](#/sizes/a-row-of-fields) |
|
|
3437
|
+
| `size` *required* | [`ControlSize`](#type-ControlSize)<br>`"sm" \| "md"` | — | The size of every control inside that does not say its own.<br>Shown in: [One size for a place](#/sizes/one-size-for-a-place), [A row of fields](#/sizes/a-row-of-fields), [Drawn as a field (SegmentedControl)](#/segmentedcontrol/drawn-as-a-field) |
|
|
3438
|
+
| `children` *required* | `ReactNode` | — | The place the size holds for.<br>Shown in: [One size for a place](#/sizes/one-size-for-a-place), [A row of fields](#/sizes/a-row-of-fields), [Drawn as a field (SegmentedControl)](#/segmentedcontrol/drawn-as-a-field) |
|
|
3430
3439
|
|
|
3431
3440
|
##### Types on this page
|
|
3432
3441
|
|
|
@@ -4725,11 +4734,11 @@ The keys of [Button](#/button/keyboard-button) apply here.
|
|
|
4725
4734
|
|
|
4726
4735
|
| Prop | Type | Default | Description |
|
|
4727
4736
|
|---|---|---|---|
|
|
4728
|
-
| `direction` | `"row" \| "column"` | `"column"` | Below one another or beside one another. Below is the direction content stands in anyway, without being asked.<br>Shown in: [A row](#/stack-and-grid/a-row), [Gaps](#/stack-and-grid/gaps), [Wrapping](#/stack-and-grid/wrapping) and
|
|
4729
|
-
| `gap` | [`SpaceStep`](#type-SpaceStep)<br>`1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8` | `3` | Spacing as a step of the 4 px spacing steps (1–8).<br>Shown in: [A column](#/stack-and-grid/a-column), [A row](#/stack-and-grid/a-row), [Gaps](#/stack-and-grid/gaps) and
|
|
4737
|
+
| `direction` | `"row" \| "column"` | `"column"` | Below one another or beside one another. Below is the direction content stands in anyway, without being asked.<br>Shown in: [A row](#/stack-and-grid/a-row), [Gaps](#/stack-and-grid/gaps), [Wrapping](#/stack-and-grid/wrapping) and 68 more |
|
|
4738
|
+
| `gap` | [`SpaceStep`](#type-SpaceStep)<br>`1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8` | `3` | Spacing as a step of the 4 px spacing steps (1–8).<br>Shown in: [A column](#/stack-and-grid/a-column), [A row](#/stack-and-grid/a-row), [Gaps](#/stack-and-grid/gaps) and 165 more |
|
|
4730
4739
|
| `align` | `CSSProperties["alignItems"]` | — | Alignment across the direction – `alignItems` unchanged.<br>Shown in: [A row](#/stack-and-grid/a-row), [Gaps](#/stack-and-grid/gaps), [A tour summary](#/stack-and-grid/a-tour-summary) and 77 more |
|
|
4731
4740
|
| `justify` | `CSSProperties["justifyContent"]` | — | Distribution along the direction – `justifyContent` unchanged.<br>Shown in: [A row](#/stack-and-grid/a-row), [A tour summary](#/stack-and-grid/a-tour-summary), [Name the same action in every row (VisuallyHidden)](#/visuallyhidden/actions-in-rows) and 9 more |
|
|
4732
|
-
| `wrap` | `boolean` | `false` | Lets the children wrap when the line does not suffice.<br>Shown in: [Gaps](#/stack-and-grid/gaps), [Wrapping](#/stack-and-grid/wrapping), [Sized to the value (Sizes)](#/sizes/sized-to-the-value) and
|
|
4741
|
+
| `wrap` | `boolean` | `false` | Lets the children wrap when the line does not suffice.<br>Shown in: [Gaps](#/stack-and-grid/gaps), [Wrapping](#/stack-and-grid/wrapping), [Sized to the value (Sizes)](#/sizes/sized-to-the-value) and 32 more |
|
|
4733
4742
|
|
|
4734
4743
|
Also takes every attribute of `<div>`.
|
|
4735
4744
|
|
|
@@ -8057,7 +8066,7 @@ The keys of [Input](#/input/keyboard-input), [NumberInput](#/numberinput/keyboar
|
|
|
8057
8066
|
|
|
8058
8067
|
| Prop | Type | Default | Description |
|
|
8059
8068
|
|---|---|---|---|
|
|
8060
|
-
| `label` *required* | `ReactNode` | — | The label of the field. It is mandatory: a field without a name is a field without a question for a screen reader.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Label and hint](#/formfield/label-and-hint), [Show an error](#/formfield/show-an-error) and
|
|
8069
|
+
| `label` *required* | `ReactNode` | — | The label of the field. It is mandatory: a field without a name is a field without a question for a screen reader.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Label and hint](#/formfield/label-and-hint), [Show an error](#/formfield/show-an-error) and 76 more |
|
|
8061
8070
|
| `hint` | `ReactNode` | — | Help text below the field. Replaced by `error`.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Label and hint](#/formfield/label-and-hint), [Show an error](#/formfield/show-an-error) and 33 more |
|
|
8062
8071
|
| `error` | `ReactNode` | — | Error message; it marks the field as invalid at the same time.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Show an error](#/formfield/show-an-error), [Check an invoice on submit](#/formfield/check-an-invoice-on-submit) and 22 more |
|
|
8063
8072
|
| `required` | `boolean` | `false` | Sets the required mark on the label and `aria-required` on the field - on Input, Select, Textarea, NumberInput, Combobox, RadioGroup and Checkbox. The triggers of the pickers and of the MultiSelect are buttons, on which `aria-required` is not a permitted attribute; there the mark carries it alone. It validates nothing - validation belongs to the caller.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Mark a field as required](#/formfield/mark-a-field-as-required), [Check an invoice on submit](#/formfield/check-an-invoice-on-submit) and 9 more |
|
|
@@ -9203,7 +9212,7 @@ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
|
9203
9212
|
|
|
9204
9213
|
### SegmentedControl
|
|
9205
9214
|
|
|
9206
|
-
One choice out of a few short possibilities, drawn as one
|
|
9215
|
+
One choice out of a few short possibilities, drawn as one control with a segment for each (segmented button, button toggle): a sunken track, the choice lifted out of it. As tall as a select, so it stands in a row of fields too.
|
|
9207
9216
|
|
|
9208
9217
|
```ts
|
|
9209
9218
|
import { SegmentedControl } from "@umriss-ui/core";
|
|
@@ -9213,7 +9222,9 @@ Demo page: https://romanhaendler.github.io/umriss-ui/core/segmentedcontrol/
|
|
|
9213
9222
|
|
|
9214
9223
|
A screen reader hears a radio group, each segment a radio with its position and whether it is chosen; the control is one tab stop, and the arrow keys move and choose at once, skipping disabled possibilities.
|
|
9215
9224
|
|
|
9216
|
-
Each segment is as wide as its word, and the
|
|
9225
|
+
Each segment is as wide as its word, and the width never follows the choice. `fill` takes the width of the place instead and shares it equally; an option's `icon` stands before its word.
|
|
9226
|
+
|
|
9227
|
+
Two drawings: `inset`, the default - a sunken track with the choice lifted out of it; and `field` - a field's edge, the choice filled with ink, for a row whose fields it should match box for box. Both are a control's height with their words on a select's line, and the keys are the same.
|
|
9217
9228
|
|
|
9218
9229
|
#### Examples
|
|
9219
9230
|
|
|
@@ -9339,6 +9350,106 @@ export default function LongWordsInANarrowPlace() {
|
|
|
9339
9350
|
}
|
|
9340
9351
|
```
|
|
9341
9352
|
|
|
9353
|
+
##### A theme switch
|
|
9354
|
+
|
|
9355
|
+
A choice that stands on its own, in a menu or a settings panel. `fill` takes the panel's width and shares it equally between the segments; an option's `icon` stands before its word, at the size the control gives it.
|
|
9356
|
+
|
|
9357
|
+
```tsx
|
|
9358
|
+
import { Card, CardBody, FormField, SegmentedControl } from "@umriss-ui/core";
|
|
9359
|
+
|
|
9360
|
+
/* Icons from outside the set: any SVG, sized by the control. */
|
|
9361
|
+
const stroke = { fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" } as const;
|
|
9362
|
+
|
|
9363
|
+
function Sun() {
|
|
9364
|
+
return (
|
|
9365
|
+
<svg viewBox="0 0 24 24" {...stroke}>
|
|
9366
|
+
<circle cx="12" cy="12" r="4" />
|
|
9367
|
+
<path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" />
|
|
9368
|
+
</svg>
|
|
9369
|
+
);
|
|
9370
|
+
}
|
|
9371
|
+
|
|
9372
|
+
function Moon() {
|
|
9373
|
+
return (
|
|
9374
|
+
<svg viewBox="0 0 24 24" {...stroke}>
|
|
9375
|
+
<path d="M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z" />
|
|
9376
|
+
</svg>
|
|
9377
|
+
);
|
|
9378
|
+
}
|
|
9379
|
+
|
|
9380
|
+
function Monitor() {
|
|
9381
|
+
return (
|
|
9382
|
+
<svg viewBox="0 0 24 24" {...stroke}>
|
|
9383
|
+
<rect x="3" y="4" width="18" height="12" rx="2" />
|
|
9384
|
+
<path d="M8 20h8M12 16v4" />
|
|
9385
|
+
</svg>
|
|
9386
|
+
);
|
|
9387
|
+
}
|
|
9388
|
+
|
|
9389
|
+
export default function ThemeSwitch() {
|
|
9390
|
+
return (
|
|
9391
|
+
<Card style={{ maxWidth: 320 }}>
|
|
9392
|
+
<CardBody>
|
|
9393
|
+
<FormField label="Theme">
|
|
9394
|
+
<SegmentedControl
|
|
9395
|
+
fill
|
|
9396
|
+
defaultValue="system"
|
|
9397
|
+
options={[
|
|
9398
|
+
{ value: "light", label: "Light", icon: <Sun /> },
|
|
9399
|
+
{ value: "dark", label: "Dark", icon: <Moon /> },
|
|
9400
|
+
{ value: "system", label: "System", icon: <Monitor /> },
|
|
9401
|
+
]}
|
|
9402
|
+
/>
|
|
9403
|
+
</FormField>
|
|
9404
|
+
</CardBody>
|
|
9405
|
+
</Card>
|
|
9406
|
+
);
|
|
9407
|
+
}
|
|
9408
|
+
```
|
|
9409
|
+
|
|
9410
|
+
##### Drawn as a field
|
|
9411
|
+
|
|
9412
|
+
`variant="field"` gives it a field's edge and fills the choice with ink, for a row whose fields it should match box for box. Inset or a field, it is a control's height and its words stand on the select's line - at either size.
|
|
9413
|
+
|
|
9414
|
+
```tsx
|
|
9415
|
+
import { ControlSizeProvider, FormField, SegmentedControl, Select, Stack } from "@umriss-ui/core";
|
|
9416
|
+
import type { ControlSize } from "@umriss-ui/core";
|
|
9417
|
+
|
|
9418
|
+
function Row({ size }: { size: ControlSize }) {
|
|
9419
|
+
return (
|
|
9420
|
+
<Stack role="group" aria-label={size === "sm" ? "Small" : "Medium"} direction="row" gap={3} wrap>
|
|
9421
|
+
<FormField label="Caster">
|
|
9422
|
+
<Select defaultValue="">
|
|
9423
|
+
<option value="">Every caster</option>
|
|
9424
|
+
<option>Caster 1</option>
|
|
9425
|
+
</Select>
|
|
9426
|
+
</FormField>
|
|
9427
|
+
<FormField label="Values">
|
|
9428
|
+
<SegmentedControl
|
|
9429
|
+
variant="field"
|
|
9430
|
+
defaultValue="measured"
|
|
9431
|
+
options={[
|
|
9432
|
+
{ value: "measured", label: "Measured" },
|
|
9433
|
+
{ value: "forecast", label: "Forecast" },
|
|
9434
|
+
]}
|
|
9435
|
+
/>
|
|
9436
|
+
</FormField>
|
|
9437
|
+
</Stack>
|
|
9438
|
+
);
|
|
9439
|
+
}
|
|
9440
|
+
|
|
9441
|
+
export default function DrawnAsAField() {
|
|
9442
|
+
return (
|
|
9443
|
+
<Stack gap={5}>
|
|
9444
|
+
<Row size="md" />
|
|
9445
|
+
<ControlSizeProvider size="sm">
|
|
9446
|
+
<Row size="sm" />
|
|
9447
|
+
</ControlSizeProvider>
|
|
9448
|
+
</Stack>
|
|
9449
|
+
);
|
|
9450
|
+
}
|
|
9451
|
+
```
|
|
9452
|
+
|
|
9342
9453
|
#### When to use something else
|
|
9343
9454
|
|
|
9344
9455
|
- Possibilities that need a line of explanation each → RadioGroup
|
|
@@ -9359,10 +9470,12 @@ export default function LongWordsInANarrowPlace() {
|
|
|
9359
9470
|
|
|
9360
9471
|
| Prop | Type | Default | Description |
|
|
9361
9472
|
|---|---|---|---|
|
|
9362
|
-
| `options` *required* | `readonly `[`SegmentedOption`](#type-SegmentedOption)`<T>[]` | — | The possibilities, two to four, in the order in which they stand.<br>Shown in: [Configurator](#/segmentedcontrol/configurator-segmentedcontrol), [Segmented control](#/segmentedcontrol/segmented-control), [In a field](#/segmentedcontrol/in-a-field) and
|
|
9363
|
-
| `defaultValue` | `T \| null` | — | Initial value of an uncontrolled control. Not together with `value`.<br>Shown in: [Configurator](#/segmentedcontrol/configurator-segmentedcontrol), [States and sizes](#/segmentedcontrol/states-and-sizes), [Long words in a narrow place](#/segmentedcontrol/long-words-in-a-narrow-place) and
|
|
9473
|
+
| `options` *required* | `readonly `[`SegmentedOption`](#type-SegmentedOption)`<T>[]` | — | The possibilities, two to four, in the order in which they stand.<br>Shown in: [Configurator](#/segmentedcontrol/configurator-segmentedcontrol), [Segmented control](#/segmentedcontrol/segmented-control), [In a field](#/segmentedcontrol/in-a-field) and 5 more |
|
|
9474
|
+
| `defaultValue` | `T \| null` | — | Initial value of an uncontrolled control. Not together with `value`.<br>Shown in: [Configurator](#/segmentedcontrol/configurator-segmentedcontrol), [States and sizes](#/segmentedcontrol/states-and-sizes), [Long words in a narrow place](#/segmentedcontrol/long-words-in-a-narrow-place) and 3 more |
|
|
9364
9475
|
| `value` | `T \| null` | — | The chosen possibility; `null` means: none yet. Together with `onChange` the control is controlled.<br>Shown in: [Segmented control](#/segmentedcontrol/segmented-control), [In a field](#/segmentedcontrol/in-a-field) |
|
|
9365
9476
|
| `size` | `"sm" \| "md"` | the size of a `ControlSizeProvider` around it, else `"md"` | `sm` for a toolbar and dense forms, `md` otherwise.<br>Shown in: [Configurator](#/segmentedcontrol/configurator-segmentedcontrol), [States and sizes](#/segmentedcontrol/states-and-sizes) |
|
|
9477
|
+
| `variant` | `"field" \| "inset"` | `"inset"` | How it is drawn. `inset`: a sunken track without an edge, the choice a surface lifted out of it. `field`: a field's edge, the choice filled with ink - for a row whose fields it should match box for box.<br>Shown in: [Configurator](#/segmentedcontrol/configurator-segmentedcontrol), [Drawn as a field](#/segmentedcontrol/drawn-as-a-field) |
|
|
9478
|
+
| `fill` | `boolean` | `false` | Takes the whole width its place gives it, as a field in a column does, and shares it equally between the segments. Without it the control is as wide as its words.<br>Shown in: [Configurator](#/segmentedcontrol/configurator-segmentedcontrol), [A theme switch](#/segmentedcontrol/a-theme-switch) |
|
|
9366
9479
|
| `disabled` | `boolean` | `false` | Disables the whole control. `SegmentedOption` disables single possibilities.<br>Shown in: [Configurator](#/segmentedcontrol/configurator-segmentedcontrol), [States and sizes](#/segmentedcontrol/states-and-sizes) |
|
|
9367
9480
|
| `name` | `string` | a generated one | Name of the radio group within the form. |
|
|
9368
9481
|
|
|
@@ -9378,8 +9491,9 @@ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
|
9378
9491
|
|
|
9379
9492
|
| Prop | Type | Default | Description |
|
|
9380
9493
|
|---|---|---|---|
|
|
9381
|
-
| `value` *required* | `T` | — | What comes back when this possibility is chosen.<br>Shown in: [Segmented control](#/segmentedcontrol/segmented-control), [In a field](#/segmentedcontrol/in-a-field), [States and sizes](#/segmentedcontrol/states-and-sizes) and
|
|
9382
|
-
| `label` *required* | `ReactNode` | — | The segment's word - a short one; a long label ends in an ellipsis.<br>Shown in: [Segmented control](#/segmentedcontrol/segmented-control), [In a field](#/segmentedcontrol/in-a-field), [States and sizes](#/segmentedcontrol/states-and-sizes) and
|
|
9494
|
+
| `value` *required* | `T` | — | What comes back when this possibility is chosen.<br>Shown in: [Segmented control](#/segmentedcontrol/segmented-control), [In a field](#/segmentedcontrol/in-a-field), [States and sizes](#/segmentedcontrol/states-and-sizes) and 4 more |
|
|
9495
|
+
| `label` *required* | `ReactNode` | — | The segment's word - a short one; a long label ends in an ellipsis.<br>Shown in: [Segmented control](#/segmentedcontrol/segmented-control), [In a field](#/segmentedcontrol/in-a-field), [States and sizes](#/segmentedcontrol/states-and-sizes) and 4 more |
|
|
9496
|
+
| `icon` | `ReactNode` | — | An icon before the word: an SVG, a glyph of the set or an icon font's element. The control sets its size - `--u-icon-size`, `--u-icon-size-sm` at `sm` - and hides it from assistive technology: the word names the possibility.<br>Shown in: [A theme switch](#/segmentedcontrol/a-theme-switch) |
|
|
9383
9497
|
| `disabled` | `boolean` | — | Takes the possibility out of the choice but leaves it visible.<br>Shown in: [States and sizes](#/segmentedcontrol/states-and-sizes) |
|
|
9384
9498
|
|
|
9385
9499
|
#### Known limits
|
|
@@ -12187,7 +12301,7 @@ export default function AfterAnAction() {
|
|
|
12187
12301
|
|
|
12188
12302
|
##### Where they stand
|
|
12189
12303
|
|
|
12190
|
-
`toast.position` in the `UmrissProvider` puts every toast of the application at one edge and one place along it; the deck grows away from that edge. On a phone they take the window's width, and only the edge counts.
|
|
12304
|
+
`toast.position` in the `UmrissProvider` puts every toast of the application at one edge and one place along it; the deck grows away from that edge. On a phone they take the window's width, and only the edge counts. How far they stand from the edge is `--u-toast-inset-top` and `--u-toast-inset-bottom` on `:root` - below a fixed header, above a toolbar at the bottom.
|
|
12191
12305
|
|
|
12192
12306
|
```tsx
|
|
12193
12307
|
import { useMemo, useState } from "react";
|
|
@@ -18065,14 +18179,14 @@ const CalendarGlyph: import("react").ForwardRefExoticComponent<Omit<GlyphProps &
|
|
|
18065
18179
|
|
|
18066
18180
|
[Card](#/card) – A surface that holds one block of a screen together: a head with its title and actions, and a body (also called a panel or tile). Reach for it for each block of a dashboard or a detail view.
|
|
18067
18181
|
|
|
18068
|
-
Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Theming](#/theming), [Sizes](#/sizes), [Stack and Grid](#/stack-and-grid), [Card](#/card), [Splitter](#/splitter), [Typography](#/typography), [Button](#/button), [NumberInput](#/numberinput), [Slider](#/slider), [Switch](#/switch), [FileInput](#/fileinput), [Combobox](#/combobox), [Spinner](#/spinner), [ProgressBar](#/progressbar), [EmptyState](#/emptystate), [CommandPalette](#/commandpalette), [Breadcrumb](#/breadcrumb), [Tabs](#/tabs), [Accordion](#/accordion), [Stepper](#/stepper) and [Stat](#/stat).
|
|
18182
|
+
Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Theming](#/theming), [Sizes](#/sizes), [Stack and Grid](#/stack-and-grid), [Card](#/card), [Splitter](#/splitter), [Typography](#/typography), [Button](#/button), [NumberInput](#/numberinput), [Slider](#/slider), [Switch](#/switch), [SegmentedControl](#/segmentedcontrol), [FileInput](#/fileinput), [Combobox](#/combobox), [Spinner](#/spinner), [ProgressBar](#/progressbar), [EmptyState](#/emptystate), [CommandPalette](#/commandpalette), [Breadcrumb](#/breadcrumb), [Tabs](#/tabs), [Accordion](#/accordion), [Stepper](#/stepper) and [Stat](#/stat).
|
|
18069
18183
|
|
|
18070
18184
|
##### `CardBody`
|
|
18071
18185
|
|
|
18072
18186
|
[Card](#/card) – The content of a `Card`; the part that folds away in a collapsible card.
|
|
18073
18187
|
`flush` removes the padding for a table or a log.
|
|
18074
18188
|
|
|
18075
|
-
Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Theming](#/theming), [Sizes](#/sizes), [Stack and Grid](#/stack-and-grid), [Card](#/card), [Typography](#/typography), [Button](#/button), [NumberInput](#/numberinput), [Slider](#/slider), [Switch](#/switch), [FileInput](#/fileinput), [Combobox](#/combobox), [Spinner](#/spinner), [ProgressBar](#/progressbar), [EmptyState](#/emptystate), [Breadcrumb](#/breadcrumb), [Tabs](#/tabs), [Accordion](#/accordion), [Stepper](#/stepper) and [Stat](#/stat).
|
|
18189
|
+
Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Theming](#/theming), [Sizes](#/sizes), [Stack and Grid](#/stack-and-grid), [Card](#/card), [Typography](#/typography), [Button](#/button), [NumberInput](#/numberinput), [Slider](#/slider), [Switch](#/switch), [SegmentedControl](#/segmentedcontrol), [FileInput](#/fileinput), [Combobox](#/combobox), [Spinner](#/spinner), [ProgressBar](#/progressbar), [EmptyState](#/emptystate), [Breadcrumb](#/breadcrumb), [Tabs](#/tabs), [Accordion](#/accordion), [Stepper](#/stepper) and [Stat](#/stat).
|
|
18076
18190
|
|
|
18077
18191
|
##### `CardHeader`
|
|
18078
18192
|
|
|
@@ -18409,7 +18523,7 @@ Used on [Scenarios](#/), [Sizes](#/sizes) and [RadioGroup](#/radiogroup).
|
|
|
18409
18523
|
|
|
18410
18524
|
##### `SegmentedControl`
|
|
18411
18525
|
|
|
18412
|
-
[SegmentedControl](#/segmentedcontrol) – One choice out of a few short possibilities, drawn as one
|
|
18526
|
+
[SegmentedControl](#/segmentedcontrol) – One choice out of a few short possibilities, drawn as one control with a segment for each (segmented button, button toggle): a sunken track, the choice lifted out of it. As tall as a select, so it stands in a row of fields too.
|
|
18413
18527
|
|
|
18414
18528
|
Used on [Sizes](#/sizes) and [SegmentedControl](#/segmentedcontrol).
|
|
18415
18529
|
|
|
@@ -18417,7 +18531,7 @@ Used on [Sizes](#/sizes) and [SegmentedControl](#/segmentedcontrol).
|
|
|
18417
18531
|
|
|
18418
18532
|
[Select](#/select) – 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.
|
|
18419
18533
|
|
|
18420
|
-
Used on [Scenarios](#/), [Sizes](#/sizes), [FormField](#/formfield), [Select](#/select), [Popover](#/popover), [Modal](#/modal), [CommandPalette](#/commandpalette), [Accordion](#/accordion) and [Tag](#/tag).
|
|
18534
|
+
Used on [Scenarios](#/), [Sizes](#/sizes), [FormField](#/formfield), [SegmentedControl](#/segmentedcontrol), [Select](#/select), [Popover](#/popover), [Modal](#/modal), [CommandPalette](#/commandpalette), [Accordion](#/accordion) and [Tag](#/tag).
|
|
18421
18535
|
|
|
18422
18536
|
##### `Skeleton`
|
|
18423
18537
|
|
|
@@ -19298,7 +19412,7 @@ otherwise.
|
|
|
19298
19412
|
type ControlSize = "sm" | "md";
|
|
19299
19413
|
```
|
|
19300
19414
|
|
|
19301
|
-
Used on [Sizes](#/sizes).
|
|
19415
|
+
Used on [Sizes](#/sizes) and [SegmentedControl](#/segmentedcontrol).
|
|
19302
19416
|
|
|
19303
19417
|
##### `ControlSizeProviderProps`
|
|
19304
19418
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umriss-ui/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.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",
|