@xeonr/platform-ui 1.3.0 → 1.4.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 +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/kit/Anchored.d.ts +13 -2
- package/dist/kit/Anchored.d.ts.map +1 -1
- package/dist/kit/Anchored.js +47 -18
- package/dist/kit/Anchored.js.map +1 -1
- package/dist/kit/Badge.d.ts +1 -0
- package/dist/kit/Badge.d.ts.map +1 -1
- package/dist/kit/Badge.js +14 -0
- package/dist/kit/Badge.js.map +1 -1
- package/dist/kit/Blocks.d.ts.map +1 -1
- package/dist/kit/Blocks.js +4 -2
- package/dist/kit/Blocks.js.map +1 -1
- package/dist/kit/Button.d.ts +8 -2
- package/dist/kit/Button.d.ts.map +1 -1
- package/dist/kit/Button.js +17 -3
- package/dist/kit/Button.js.map +1 -1
- package/dist/kit/Chip.d.ts +6 -0
- package/dist/kit/Chip.d.ts.map +1 -1
- package/dist/kit/Chip.js +2 -1
- package/dist/kit/Chip.js.map +1 -1
- package/dist/kit/Color.d.ts +69 -0
- package/dist/kit/Color.d.ts.map +1 -0
- package/dist/kit/Color.js +150 -0
- package/dist/kit/Color.js.map +1 -0
- package/dist/kit/Combobox.d.ts +5 -1
- package/dist/kit/Combobox.d.ts.map +1 -1
- package/dist/kit/Combobox.js +39 -28
- package/dist/kit/Combobox.js.map +1 -1
- package/dist/kit/Controls.d.ts +184 -0
- package/dist/kit/Controls.d.ts.map +1 -0
- package/dist/kit/Controls.js +344 -0
- package/dist/kit/Controls.js.map +1 -0
- package/dist/kit/DatePicker.d.ts +125 -0
- package/dist/kit/DatePicker.d.ts.map +1 -0
- package/dist/kit/DatePicker.js +438 -0
- package/dist/kit/DatePicker.js.map +1 -0
- package/dist/kit/Dropzone.d.ts +41 -0
- package/dist/kit/Dropzone.d.ts.map +1 -0
- package/dist/kit/Dropzone.js +118 -0
- package/dist/kit/Dropzone.js.map +1 -0
- package/dist/kit/Form.d.ts +86 -13
- package/dist/kit/Form.d.ts.map +1 -1
- package/dist/kit/Form.js +124 -13
- package/dist/kit/Form.js.map +1 -1
- package/dist/kit/Icon.d.ts +4 -0
- package/dist/kit/Icon.d.ts.map +1 -1
- package/dist/kit/Icon.js +5 -1
- package/dist/kit/Icon.js.map +1 -1
- package/dist/kit/List.d.ts +55 -8
- package/dist/kit/List.d.ts.map +1 -1
- package/dist/kit/List.js +43 -6
- package/dist/kit/List.js.map +1 -1
- package/dist/kit/Menu.d.ts +71 -9
- package/dist/kit/Menu.d.ts.map +1 -1
- package/dist/kit/Menu.js +119 -21
- package/dist/kit/Menu.js.map +1 -1
- package/dist/kit/Modal.d.ts +37 -4
- package/dist/kit/Modal.d.ts.map +1 -1
- package/dist/kit/Modal.js +42 -14
- package/dist/kit/Modal.js.map +1 -1
- package/dist/kit/MultiCombobox.d.ts +48 -1
- package/dist/kit/MultiCombobox.d.ts.map +1 -1
- package/dist/kit/MultiCombobox.js +100 -27
- package/dist/kit/MultiCombobox.js.map +1 -1
- package/dist/kit/Picker.d.ts +6 -1
- package/dist/kit/Picker.d.ts.map +1 -1
- package/dist/kit/Picker.js +10 -5
- package/dist/kit/Picker.js.map +1 -1
- package/dist/kit/Popover.d.ts +13 -1
- package/dist/kit/Popover.d.ts.map +1 -1
- package/dist/kit/Popover.js +31 -9
- package/dist/kit/Popover.js.map +1 -1
- package/dist/kit/Skeleton.d.ts +44 -3
- package/dist/kit/Skeleton.d.ts.map +1 -1
- package/dist/kit/Skeleton.js +39 -1
- package/dist/kit/Skeleton.js.map +1 -1
- package/dist/kit/Stepper.d.ts +33 -0
- package/dist/kit/Stepper.d.ts.map +1 -0
- package/dist/kit/Stepper.js +97 -0
- package/dist/kit/Stepper.js.map +1 -0
- package/dist/kit/TabStrip.d.ts.map +1 -1
- package/dist/kit/TabStrip.js +7 -2
- package/dist/kit/TabStrip.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { type ChangeEvent, type CSSProperties, type HTMLAttributes, type MouseEvent, type ReactNode } from "react";
|
|
2
|
+
import { type IconName } from "./Icon.tsx";
|
|
3
|
+
import { type SegmentedTone } from "./Form.tsx";
|
|
4
|
+
export interface InputGroupProps {
|
|
5
|
+
/** a leading glyph — a magnifier on a search box, a globe on a hostname */
|
|
6
|
+
icon?: IconName | (string & {}) | undefined;
|
|
7
|
+
/** fixed text before the value, inside the box (`https://`) */
|
|
8
|
+
prefix?: ReactNode | undefined;
|
|
9
|
+
/** fixed text after the value, inside the box (`.example.com`, `MB`, `%`) */
|
|
10
|
+
suffix?: ReactNode | undefined;
|
|
11
|
+
/** controls at the trailing edge — a clear button, a reveal toggle */
|
|
12
|
+
end?: ReactNode | undefined;
|
|
13
|
+
/** mono value and affixes, for hostnames, ids and paths */
|
|
14
|
+
mono?: boolean | undefined;
|
|
15
|
+
/** draw the group in error; inside a Field with `error` this is automatic */
|
|
16
|
+
invalid?: boolean | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The group is off: drawn dimmed, and the input inside is disabled too — a
|
|
19
|
+
* direct child element that does not set `disabled` itself gets
|
|
20
|
+
* `disabled` (1.4). An input nested deeper must be disabled by the caller.
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean | undefined;
|
|
23
|
+
/** the group's width in px (default: its container's) */
|
|
24
|
+
width?: number | undefined;
|
|
25
|
+
style?: CSSProperties | undefined;
|
|
26
|
+
className?: string | undefined;
|
|
27
|
+
/** the input: a kit `Input`, `MonoInput`, or a plain <input> */
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* InputGroup: an input with a glyph, fixed text or controls inside its box.
|
|
32
|
+
* The affixes are part of the field — a subdomain box reads `luke` `.upl.im`
|
|
33
|
+
* as one value — and a click anywhere on the box focuses the input. Unlike
|
|
34
|
+
* SearchBox it holds no state of its own, so it does not debounce: the input
|
|
35
|
+
* inside is the caller's, controlled as they like.
|
|
36
|
+
*/
|
|
37
|
+
export declare function InputGroup({ icon, prefix, suffix, end, mono, invalid, disabled, width, style, className, children }: InputGroupProps): import("react").JSX.Element;
|
|
38
|
+
export interface NumberInputProps {
|
|
39
|
+
/** the number, or null for an empty box */
|
|
40
|
+
value: number | null;
|
|
41
|
+
/** a parsed number while typing (unclamped), null for an empty box; clamped to min/max on blur */
|
|
42
|
+
onChange: (value: number | null) => void;
|
|
43
|
+
min?: number | undefined;
|
|
44
|
+
max?: number | undefined;
|
|
45
|
+
/** what ArrowUp/ArrowDown and the stepper add (default 1; Shift ×10) */
|
|
46
|
+
step?: number | undefined;
|
|
47
|
+
/** the unit after the value, inside the box (`MB`, `days`, `%`) */
|
|
48
|
+
unit?: ReactNode | undefined;
|
|
49
|
+
/** fixed text before the value (`$`) */
|
|
50
|
+
prefix?: ReactNode | undefined;
|
|
51
|
+
/** − / + buttons at the trailing edge */
|
|
52
|
+
stepper?: boolean | undefined;
|
|
53
|
+
placeholder?: string | undefined;
|
|
54
|
+
disabled?: boolean | undefined;
|
|
55
|
+
/** width of the whole control in px (default: its container's) */
|
|
56
|
+
width?: number | undefined;
|
|
57
|
+
/** accessible name, when no Field label names it */
|
|
58
|
+
label?: string | undefined;
|
|
59
|
+
id?: string | undefined;
|
|
60
|
+
name?: string | undefined;
|
|
61
|
+
autoFocus?: boolean | undefined;
|
|
62
|
+
/** accept a decimal point (default: only when `step` is fractional) */
|
|
63
|
+
decimal?: boolean | undefined;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* NumberInput: a number with its unit, its bounds and a keyboard step. Typed
|
|
67
|
+
* text is held as typed ("1." stays "1.") and handed up parsed; the bounds are
|
|
68
|
+
* applied when the field is left, not while a person is half-way through
|
|
69
|
+
* typing "150" into a box whose minimum is 100. A text input with
|
|
70
|
+
* `role="spinbutton"`, not `type="number"`, so a scroll wheel passing over it
|
|
71
|
+
* never changes the value and "e" is not a digit.
|
|
72
|
+
*/
|
|
73
|
+
export declare function NumberInput({ value, onChange, min, max, step, unit, prefix, stepper, placeholder, disabled, width, label, id, name, autoFocus, decimal, }: NumberInputProps): import("react").JSX.Element;
|
|
74
|
+
export interface SliderProps {
|
|
75
|
+
/** controlled value; omit it (and pass `defaultValue`) to let the slider hold it */
|
|
76
|
+
value?: number | undefined;
|
|
77
|
+
defaultValue?: number | undefined;
|
|
78
|
+
/** every movement */
|
|
79
|
+
onChange?: ((value: number) => void) | undefined;
|
|
80
|
+
/** once the pointer or key is released — for a value that costs a request to apply */
|
|
81
|
+
onCommit?: ((value: number) => void) | undefined;
|
|
82
|
+
min?: number | undefined;
|
|
83
|
+
max?: number | undefined;
|
|
84
|
+
step?: number | undefined;
|
|
85
|
+
/** accessible name */
|
|
86
|
+
label: string;
|
|
87
|
+
disabled?: boolean | undefined;
|
|
88
|
+
/** show the value beside the track (default true); a function formats it (`(n) => \`${n}px\``) */
|
|
89
|
+
showValue?: boolean | ((value: number) => ReactNode) | undefined;
|
|
90
|
+
/** width of the whole control in px (default: its container's) */
|
|
91
|
+
width?: number | undefined;
|
|
92
|
+
id?: string | undefined;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Slider: a number picked by feel rather than typed — a stroke width, a blur
|
|
96
|
+
* strength, an opacity. A native range input drawn on the tokens, so the
|
|
97
|
+
* keyboard (arrows, Page Up/Down, Home/End) and the slider role come free.
|
|
98
|
+
* Its value is shown beside it, because a slider whose number you cannot see
|
|
99
|
+
* is a slider people overshoot. Reach for NumberInput when the exact value
|
|
100
|
+
* matters more than the gesture.
|
|
101
|
+
*/
|
|
102
|
+
export declare function Slider({ value, defaultValue, onChange, onCommit, min, max, step, label, disabled, showValue, width, id }: SliderProps): import("react").JSX.Element;
|
|
103
|
+
export interface CheckboxProps {
|
|
104
|
+
checked: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Optional (1.4): a box whose row handles the click itself (`onClick`, or a
|
|
107
|
+
* click on the row) needs none; it stays controlled by `checked` either way.
|
|
108
|
+
*/
|
|
109
|
+
onChange?: ((checked: boolean, event: ChangeEvent<HTMLInputElement>) => void) | undefined;
|
|
110
|
+
/** some but not all of what it stands for — a select-all over a partial selection */
|
|
111
|
+
indeterminate?: boolean | undefined;
|
|
112
|
+
disabled?: boolean | undefined;
|
|
113
|
+
/** accessible name — the row it selects ("Select report.pdf") */
|
|
114
|
+
label?: string | undefined;
|
|
115
|
+
/** px (default 16) */
|
|
116
|
+
size?: number | undefined;
|
|
117
|
+
id?: string | undefined;
|
|
118
|
+
name?: string | undefined;
|
|
119
|
+
value?: string | undefined;
|
|
120
|
+
title?: string | undefined;
|
|
121
|
+
/** the click, before onChange — stop it here when the row it sits on is itself a link or a button */
|
|
122
|
+
onClick?: ((e: MouseEvent<HTMLInputElement>) => void) | undefined;
|
|
123
|
+
/** on the box (the outer element), for placing it — absolutely over a card's corner, say */
|
|
124
|
+
className?: string | undefined;
|
|
125
|
+
style?: CSSProperties | undefined;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Checkbox: the box alone, with no label around it — for selecting a table
|
|
129
|
+
* row, a list item or a card, where the row is the label. Toggle and CheckRow
|
|
130
|
+
* wrap their input in a <label>, which inside a row that is itself a link
|
|
131
|
+
* changes what a click activates; this is a real checkbox input the row can
|
|
132
|
+
* stop. `indeterminate` is the select-all over a partial selection.
|
|
133
|
+
*/
|
|
134
|
+
export declare function Checkbox({ checked, onChange, indeterminate, disabled, label, size, id, name, value, title, onClick, className, style }: CheckboxProps): import("react").JSX.Element;
|
|
135
|
+
/**
|
|
136
|
+
* TriToggle: On / Off / Inherit — a setting that is either set here or left
|
|
137
|
+
* to whatever the level above says (a bucket inheriting its account's
|
|
138
|
+
* default, a folder its bucket's). `undefined` is Inherit. The chosen segment
|
|
139
|
+
* wears the answer's colour — on is ok, off is crit, inherit neutral — so a
|
|
140
|
+
* column of them reads at a glance. `inherit={false}` drops the third option
|
|
141
|
+
* where there is nothing to inherit from; there, `undefined` means not yet
|
|
142
|
+
* chosen and neither On nor Off is shown selected — showing Off would read as
|
|
143
|
+
* a decision nobody made. The first segment keeps the tab stop.
|
|
144
|
+
*/
|
|
145
|
+
export declare function TriToggle({ value, onChange, inherit, labels, inheritHint, tones, disabled, label, size }: {
|
|
146
|
+
value: boolean | undefined;
|
|
147
|
+
onChange: (value: boolean | undefined) => void;
|
|
148
|
+
/** offer Inherit (default true); without it, `undefined` shows nothing selected */
|
|
149
|
+
inherit?: boolean | undefined;
|
|
150
|
+
/** the three captions (default On / Off / Inherit) */
|
|
151
|
+
labels?: {
|
|
152
|
+
on?: ReactNode;
|
|
153
|
+
off?: ReactNode;
|
|
154
|
+
inherit?: ReactNode;
|
|
155
|
+
} | undefined;
|
|
156
|
+
/** what Inherit currently resolves to, as its tooltip ("Inherits: on, from the account") */
|
|
157
|
+
inheritHint?: ReactNode | undefined;
|
|
158
|
+
/** the colour each answer wears when chosen (default on: ok, off: crit, inherit: mut) */
|
|
159
|
+
tones?: {
|
|
160
|
+
on?: SegmentedTone;
|
|
161
|
+
off?: SegmentedTone;
|
|
162
|
+
inherit?: SegmentedTone;
|
|
163
|
+
} | undefined;
|
|
164
|
+
disabled?: boolean | undefined;
|
|
165
|
+
/** accessible name of the group */
|
|
166
|
+
label?: string | undefined;
|
|
167
|
+
size?: "sm" | "md" | undefined;
|
|
168
|
+
}): import("react").JSX.Element;
|
|
169
|
+
/**
|
|
170
|
+
* SettingRow: one setting on one line — its name and what it means on the
|
|
171
|
+
* left, its control on the right. The shape of a settings card that is a list
|
|
172
|
+
* of switches (TriToggle, Toggle, Segmented, a NumberInput) rather than a
|
|
173
|
+
* form of fields; stacks under 640px.
|
|
174
|
+
*/
|
|
175
|
+
export declare function SettingRow({ label, hint, dim, children, ...rest }: {
|
|
176
|
+
label: ReactNode;
|
|
177
|
+
/** what the setting does, or why it has no effect right now */
|
|
178
|
+
hint?: ReactNode | undefined;
|
|
179
|
+
/** the setting has no effect right now (its name is muted) */
|
|
180
|
+
dim?: boolean | undefined;
|
|
181
|
+
/** the control */
|
|
182
|
+
children?: ReactNode | undefined;
|
|
183
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "children">): import("react").JSX.Element;
|
|
184
|
+
//# sourceMappingURL=Controls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Controls.d.ts","sourceRoot":"","sources":["../../src/kit/Controls.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiF,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlM,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAsC,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAyDpF,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,IAAI,CAAC,EAAE,QAAQ,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC;IAC5C,+DAA+D;IAC/D,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,6EAA6E;IAC7E,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,sEAAsE;IACtE,GAAG,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC5B,2DAA2D;IAC3D,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,6EAA6E;IAC7E,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,gEAAgE;IAChE,QAAQ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C,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,+BAUnD"}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Children, Fragment, cloneElement, isValidElement, useEffect, useRef, useState } from "react";
|
|
3
|
+
import styled, { css } from "styled-components";
|
|
4
|
+
import { v } from "../theme/tokens.js";
|
|
5
|
+
import { Icon } from "./Icon.js";
|
|
6
|
+
import { Segmented, useField, useFieldAttrs } from "./Form.js";
|
|
7
|
+
// The form controls the upl.im dashboard had each drawn for itself: a field
|
|
8
|
+
// with a glyph or a unit inside its box, a number field, a slider, a bare
|
|
9
|
+
// checkbox for selecting rows, the on/off/inherit switch, and the
|
|
10
|
+
// name-left-control-right settings row. Added for the upl.im dashboard (1.4).
|
|
11
|
+
/* ------------------------------------------------------------------ InputGroup */
|
|
12
|
+
const GroupBox = styled.div `
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 8px;
|
|
16
|
+
width: 100%;
|
|
17
|
+
min-width: 0;
|
|
18
|
+
height: 32px;
|
|
19
|
+
padding: 0 10px;
|
|
20
|
+
border-radius: ${v.rCtl};
|
|
21
|
+
background: ${v.field};
|
|
22
|
+
border: 1px solid ${(p) => (p.$invalid ? v.danger : v.fieldLine)};
|
|
23
|
+
color: ${v.text};
|
|
24
|
+
font-size: 12.5px;
|
|
25
|
+
cursor: text;
|
|
26
|
+
transition: border-color 0.14s ease, box-shadow 0.14s ease;
|
|
27
|
+
${(p) => p.$disabled && css `opacity: 0.55; cursor: not-allowed;`}
|
|
28
|
+
&:focus-within {
|
|
29
|
+
border-color: ${(p) => (p.$invalid ? v.danger : v.brand55)};
|
|
30
|
+
box-shadow: 0 0 0 3px ${(p) => (p.$invalid ? v.dangerBg : v.brand08)};
|
|
31
|
+
}
|
|
32
|
+
&:has(input[aria-invalid="true"]) { border-color: ${v.danger}; }
|
|
33
|
+
|
|
34
|
+
/* the input inside gives up its own box: the group is the box */
|
|
35
|
+
> input, > .x-group-input {
|
|
36
|
+
flex: 1 1 auto;
|
|
37
|
+
min-width: 0;
|
|
38
|
+
width: auto;
|
|
39
|
+
height: 100%;
|
|
40
|
+
padding: 0;
|
|
41
|
+
border: none;
|
|
42
|
+
border-radius: 0;
|
|
43
|
+
background: transparent;
|
|
44
|
+
box-shadow: none;
|
|
45
|
+
${(p) => p.$mono && css `font-family: ${v.mono}; font-size: 11.5px;`}
|
|
46
|
+
&:focus, &:focus-visible { outline: none; box-shadow: none; border: none; }
|
|
47
|
+
&:disabled { opacity: 1; cursor: not-allowed; }
|
|
48
|
+
}
|
|
49
|
+
> .glyph { flex: none; color: ${v.faint}; font-size: 12px; display: inline-flex; }
|
|
50
|
+
> .affix {
|
|
51
|
+
flex: none;
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
color: ${v.muted};
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
${(p) => p.$mono && css `font-family: ${v.mono}; font-size: 11.5px;`}
|
|
56
|
+
}
|
|
57
|
+
> .end { flex: none; display: inline-flex; align-items: center; gap: 2px; margin-right: -6px; }
|
|
58
|
+
`;
|
|
59
|
+
/**
|
|
60
|
+
* InputGroup: an input with a glyph, fixed text or controls inside its box.
|
|
61
|
+
* The affixes are part of the field — a subdomain box reads `luke` `.upl.im`
|
|
62
|
+
* as one value — and a click anywhere on the box focuses the input. Unlike
|
|
63
|
+
* SearchBox it holds no state of its own, so it does not debounce: the input
|
|
64
|
+
* inside is the caller's, controlled as they like.
|
|
65
|
+
*/
|
|
66
|
+
export function InputGroup({ icon, prefix, suffix, end, mono, invalid, disabled, width, style, className, children }) {
|
|
67
|
+
const field = useField();
|
|
68
|
+
const ref = useRef(null);
|
|
69
|
+
return (_jsxs(GroupBox, { ref: ref, className: className, style: width ? { width, ...style } : style, "$invalid": !!invalid || !!field?.invalid, "$disabled": !!disabled, "$mono": !!mono, onMouseDown: (e) => {
|
|
70
|
+
// the box is the field: a press on its padding or an affix focuses the input
|
|
71
|
+
const t = e.target;
|
|
72
|
+
if (t.closest("input, button, a, [tabindex]"))
|
|
73
|
+
return;
|
|
74
|
+
const input = ref.current?.querySelector("input");
|
|
75
|
+
if (input && !input.disabled) {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
input.focus();
|
|
78
|
+
}
|
|
79
|
+
}, children: [icon ? _jsx("span", { className: "glyph", "aria-hidden": true, children: _jsx(Icon, { name: icon }) }) : null, prefix ? _jsx("span", { className: "affix", "aria-hidden": true, children: prefix }) : null, disabled ? disableChildren(children) : children, suffix ? _jsx("span", { className: "affix", "aria-hidden": true, children: suffix }) : null, end ? _jsx("span", { className: "end", children: end }) : null] }));
|
|
80
|
+
}
|
|
81
|
+
// The input inside goes off with the group, unless it says otherwise itself.
|
|
82
|
+
function disableChildren(children) {
|
|
83
|
+
return Children.map(children, (c) => {
|
|
84
|
+
if (!isValidElement(c) || c.type === Fragment || c.props.disabled !== undefined)
|
|
85
|
+
return c;
|
|
86
|
+
return cloneElement(c, { disabled: true });
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/* ------------------------------------------------------------------ NumberInput */
|
|
90
|
+
const Step = styled.button `
|
|
91
|
+
width: 20px;
|
|
92
|
+
height: 22px;
|
|
93
|
+
display: inline-grid;
|
|
94
|
+
place-items: center;
|
|
95
|
+
border-radius: 5px;
|
|
96
|
+
color: ${v.faint};
|
|
97
|
+
font-size: 9px;
|
|
98
|
+
&:hover:not(:disabled) { background: ${v.hover}; color: ${v.text}; }
|
|
99
|
+
&:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
100
|
+
`;
|
|
101
|
+
const NumInput = styled.input.attrs(useFieldAttrs) `
|
|
102
|
+
font-variant-numeric: tabular-nums;
|
|
103
|
+
color: ${v.text};
|
|
104
|
+
&::placeholder { color: ${v.faint}; }
|
|
105
|
+
`;
|
|
106
|
+
const clamp = (n, min, max) => Math.min(max ?? Infinity, Math.max(min ?? -Infinity, n));
|
|
107
|
+
// Steps of 0.1 should land on 0.3, not 0.30000000000000004.
|
|
108
|
+
const roundTo = (n, step) => {
|
|
109
|
+
const dp = (String(step).split(".")[1] ?? "").length;
|
|
110
|
+
return dp ? Number(n.toFixed(dp)) : n;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* NumberInput: a number with its unit, its bounds and a keyboard step. Typed
|
|
114
|
+
* text is held as typed ("1." stays "1.") and handed up parsed; the bounds are
|
|
115
|
+
* applied when the field is left, not while a person is half-way through
|
|
116
|
+
* typing "150" into a box whose minimum is 100. A text input with
|
|
117
|
+
* `role="spinbutton"`, not `type="number"`, so a scroll wheel passing over it
|
|
118
|
+
* never changes the value and "e" is not a digit.
|
|
119
|
+
*/
|
|
120
|
+
export function NumberInput({ value, onChange, min, max, step = 1, unit, prefix, stepper, placeholder, disabled, width, label, id, name, autoFocus, decimal, }) {
|
|
121
|
+
const show = (n) => (n === null || Number.isNaN(n) ? "" : String(n));
|
|
122
|
+
const [draft, setDraft] = useState(show(value));
|
|
123
|
+
// Follow the value when it changes from outside, without clobbering a draft
|
|
124
|
+
// that already means it ("1." while the value is 1). Adjusted during render.
|
|
125
|
+
const [seen, setSeen] = useState(value);
|
|
126
|
+
if (seen !== value) {
|
|
127
|
+
setSeen(value);
|
|
128
|
+
const parsed = draft.trim() === "" ? null : Number(draft);
|
|
129
|
+
if (parsed !== value)
|
|
130
|
+
setDraft(show(value));
|
|
131
|
+
}
|
|
132
|
+
const allowDot = decimal ?? !Number.isInteger(step);
|
|
133
|
+
const pattern = allowDot ? /^-?\d*\.?\d*$/ : /^-?\d*$/;
|
|
134
|
+
const commit = (n) => {
|
|
135
|
+
setDraft(show(n));
|
|
136
|
+
if (n !== value)
|
|
137
|
+
onChange(n);
|
|
138
|
+
};
|
|
139
|
+
const bump = (dir, times = 1) => {
|
|
140
|
+
const base = value ?? (dir > 0 ? (min ?? 0) - step : (max ?? 0) + step);
|
|
141
|
+
commit(clamp(roundTo(base + dir * step * times, step), min, max));
|
|
142
|
+
};
|
|
143
|
+
return (_jsx(InputGroup, { suffix: unit, prefix: prefix, disabled: disabled, width: width, end: stepper ? (_jsxs(_Fragment, { children: [_jsx(Step, { type: "button", tabIndex: -1, "aria-label": "Decrease", disabled: disabled || (value !== null && min !== undefined && value <= min), onClick: () => bump(-1), children: _jsx(Icon, { name: "minus" }) }), _jsx(Step, { type: "button", tabIndex: -1, "aria-label": "Increase", disabled: disabled || (value !== null && max !== undefined && value >= max), onClick: () => bump(1), children: _jsx(Icon, { name: "add" }) })] })) : undefined, children: _jsx(NumInput, { type: "text", inputMode: allowDot ? "decimal" : "numeric", role: "spinbutton", "aria-label": label, "aria-valuenow": value ?? undefined, "aria-valuemin": min, "aria-valuemax": max, id: id, name: name, autoFocus: autoFocus, autoComplete: "off", value: draft, placeholder: placeholder, disabled: disabled, onChange: (e) => {
|
|
144
|
+
const t = e.target.value.trim();
|
|
145
|
+
if (!pattern.test(t))
|
|
146
|
+
return;
|
|
147
|
+
setDraft(e.target.value);
|
|
148
|
+
if (t === "") {
|
|
149
|
+
if (value !== null)
|
|
150
|
+
onChange(null);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const n = Number(t);
|
|
154
|
+
if (Number.isFinite(n) && t !== "-" && n !== value)
|
|
155
|
+
onChange(n);
|
|
156
|
+
}, onBlur: () => {
|
|
157
|
+
if (value === null) {
|
|
158
|
+
setDraft("");
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
commit(clamp(value, min, max));
|
|
162
|
+
}, onKeyDown: (e) => {
|
|
163
|
+
if (e.key === "ArrowUp") {
|
|
164
|
+
e.preventDefault();
|
|
165
|
+
bump(1, e.shiftKey ? 10 : 1);
|
|
166
|
+
}
|
|
167
|
+
else if (e.key === "ArrowDown") {
|
|
168
|
+
e.preventDefault();
|
|
169
|
+
bump(-1, e.shiftKey ? 10 : 1);
|
|
170
|
+
}
|
|
171
|
+
else if (e.key === "Home" && min !== undefined) {
|
|
172
|
+
e.preventDefault();
|
|
173
|
+
commit(min);
|
|
174
|
+
}
|
|
175
|
+
else if (e.key === "End" && max !== undefined) {
|
|
176
|
+
e.preventDefault();
|
|
177
|
+
commit(max);
|
|
178
|
+
}
|
|
179
|
+
} }) }));
|
|
180
|
+
}
|
|
181
|
+
/* ------------------------------------------------------------------ Slider */
|
|
182
|
+
const thumb = css `
|
|
183
|
+
width: 14px;
|
|
184
|
+
height: 14px;
|
|
185
|
+
border-radius: 50%;
|
|
186
|
+
background: ${v.surface};
|
|
187
|
+
border: 2px solid ${v.brand};
|
|
188
|
+
box-shadow: 0 1px 3px ${v.scrim};
|
|
189
|
+
`;
|
|
190
|
+
const SliderWrap = styled.div `
|
|
191
|
+
display: inline-flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
gap: 10px;
|
|
194
|
+
width: ${(p) => (p.$width ? `${p.$width}px` : "100%")};
|
|
195
|
+
min-width: 0;
|
|
196
|
+
${(p) => p.$disabled && css `opacity: 0.55;`}
|
|
197
|
+
> .val {
|
|
198
|
+
flex: none;
|
|
199
|
+
min-width: 3ch;
|
|
200
|
+
text-align: right;
|
|
201
|
+
font-family: ${v.mono};
|
|
202
|
+
font-size: 11px;
|
|
203
|
+
color: ${v.text};
|
|
204
|
+
font-variant-numeric: tabular-nums;
|
|
205
|
+
}
|
|
206
|
+
`;
|
|
207
|
+
const Range = styled.input `
|
|
208
|
+
flex: 1 1 auto;
|
|
209
|
+
min-width: 60px;
|
|
210
|
+
height: 18px;
|
|
211
|
+
margin: 0;
|
|
212
|
+
background: transparent;
|
|
213
|
+
appearance: none;
|
|
214
|
+
-webkit-appearance: none;
|
|
215
|
+
cursor: pointer;
|
|
216
|
+
&:disabled { cursor: not-allowed; }
|
|
217
|
+
&:focus-visible { outline: none; box-shadow: none; }
|
|
218
|
+
|
|
219
|
+
&::-webkit-slider-runnable-track {
|
|
220
|
+
height: 4px;
|
|
221
|
+
border-radius: 999px;
|
|
222
|
+
background: linear-gradient(to right, ${v.brand} var(--x-fill), ${v.line2} var(--x-fill));
|
|
223
|
+
}
|
|
224
|
+
&::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; margin-top: -5px; ${thumb} }
|
|
225
|
+
&:focus-visible::-webkit-slider-thumb { box-shadow: ${v.ring}; }
|
|
226
|
+
|
|
227
|
+
&::-moz-range-track { height: 4px; border-radius: 999px; background: ${v.line2}; }
|
|
228
|
+
&::-moz-range-progress { height: 4px; border-radius: 999px; background: ${v.brand}; }
|
|
229
|
+
&::-moz-range-thumb { ${thumb} width: 10px; height: 10px; }
|
|
230
|
+
&:focus-visible::-moz-range-thumb { box-shadow: ${v.ring}; }
|
|
231
|
+
`;
|
|
232
|
+
/**
|
|
233
|
+
* Slider: a number picked by feel rather than typed — a stroke width, a blur
|
|
234
|
+
* strength, an opacity. A native range input drawn on the tokens, so the
|
|
235
|
+
* keyboard (arrows, Page Up/Down, Home/End) and the slider role come free.
|
|
236
|
+
* Its value is shown beside it, because a slider whose number you cannot see
|
|
237
|
+
* is a slider people overshoot. Reach for NumberInput when the exact value
|
|
238
|
+
* matters more than the gesture.
|
|
239
|
+
*/
|
|
240
|
+
export function Slider({ value, defaultValue, onChange, onCommit, min = 0, max = 100, step = 1, label, disabled, showValue = true, width, id }) {
|
|
241
|
+
const [own, setOwn] = useState(defaultValue ?? min);
|
|
242
|
+
const current = value ?? own;
|
|
243
|
+
const pct = max > min ? ((clamp(current, min, max) - min) / (max - min)) * 100 : 0;
|
|
244
|
+
const latest = useRef(current);
|
|
245
|
+
useEffect(() => { latest.current = current; });
|
|
246
|
+
return (_jsxs(SliderWrap, { "$width": width, "$disabled": !!disabled, children: [_jsx(Range, { type: "range", id: id, min: min, max: max, step: step, value: current, disabled: disabled, "aria-label": label, style: { "--x-fill": `${pct}%` }, onChange: (e) => {
|
|
247
|
+
const n = Number(e.target.value);
|
|
248
|
+
if (value === undefined)
|
|
249
|
+
setOwn(n);
|
|
250
|
+
onChange?.(n);
|
|
251
|
+
}, onPointerUp: () => onCommit?.(latest.current), onKeyUp: () => onCommit?.(latest.current) }), showValue ? _jsx("span", { className: "val", "aria-hidden": true, children: typeof showValue === "function" ? showValue(current) : current }) : null] }));
|
|
252
|
+
}
|
|
253
|
+
/* ------------------------------------------------------------------ Checkbox */
|
|
254
|
+
const CheckBox = styled.span `
|
|
255
|
+
position: relative;
|
|
256
|
+
display: inline-grid;
|
|
257
|
+
place-items: center;
|
|
258
|
+
flex: none;
|
|
259
|
+
width: ${(p) => p.$size}px;
|
|
260
|
+
height: ${(p) => p.$size}px;
|
|
261
|
+
border-radius: ${(p) => Math.round(p.$size / 3.2)}px;
|
|
262
|
+
border: 1.5px solid ${(p) => (p.$on ? "transparent" : v.line2)};
|
|
263
|
+
background: ${(p) => (p.$on ? v.grad : v.field)};
|
|
264
|
+
color: ${v.onBrand};
|
|
265
|
+
font-size: ${(p) => Math.round(p.$size * 0.6)}px;
|
|
266
|
+
transition: background 0.14s ease, border-color 0.14s ease;
|
|
267
|
+
${(p) => p.$disabled && css `opacity: 0.5;`}
|
|
268
|
+
${(p) => !p.$on && !p.$disabled && css `&:hover { border-color: ${v.brand55}; }`}
|
|
269
|
+
> input {
|
|
270
|
+
position: absolute;
|
|
271
|
+
inset: -4px;
|
|
272
|
+
width: calc(100% + 8px);
|
|
273
|
+
height: calc(100% + 8px);
|
|
274
|
+
margin: 0;
|
|
275
|
+
opacity: 0;
|
|
276
|
+
cursor: ${(p) => (p.$disabled ? "not-allowed" : "pointer")};
|
|
277
|
+
}
|
|
278
|
+
&:has(> input:focus-visible) { box-shadow: ${v.ring}; }
|
|
279
|
+
> svg { pointer-events: none; }
|
|
280
|
+
`;
|
|
281
|
+
/**
|
|
282
|
+
* Checkbox: the box alone, with no label around it — for selecting a table
|
|
283
|
+
* row, a list item or a card, where the row is the label. Toggle and CheckRow
|
|
284
|
+
* wrap their input in a <label>, which inside a row that is itself a link
|
|
285
|
+
* changes what a click activates; this is a real checkbox input the row can
|
|
286
|
+
* stop. `indeterminate` is the select-all over a partial selection.
|
|
287
|
+
*/
|
|
288
|
+
export function Checkbox({ checked, onChange, indeterminate, disabled, label, size = 16, id, name, value, title, onClick, className, style }) {
|
|
289
|
+
const ref = useRef(null);
|
|
290
|
+
useEffect(() => {
|
|
291
|
+
if (ref.current)
|
|
292
|
+
ref.current.indeterminate = !!indeterminate;
|
|
293
|
+
}, [indeterminate]);
|
|
294
|
+
const on = checked || !!indeterminate;
|
|
295
|
+
return (_jsxs(CheckBox, { "$size": size, "$on": on, "$disabled": !!disabled, title: title, className: className, style: style, children: [_jsx("input", { ref: ref, type: "checkbox", id: id, name: name, value: value, checked: checked, disabled: disabled, "aria-label": label, onClick: onClick, onChange: (e) => { if (!disabled)
|
|
296
|
+
onChange?.(e.target.checked, e); } }), indeterminate ? _jsx(Icon, { name: "minus" }) : checked ? _jsx(Icon, { name: "check" }) : null] }));
|
|
297
|
+
}
|
|
298
|
+
/* ------------------------------------------------------------------ TriToggle */
|
|
299
|
+
/**
|
|
300
|
+
* TriToggle: On / Off / Inherit — a setting that is either set here or left
|
|
301
|
+
* to whatever the level above says (a bucket inheriting its account's
|
|
302
|
+
* default, a folder its bucket's). `undefined` is Inherit. The chosen segment
|
|
303
|
+
* wears the answer's colour — on is ok, off is crit, inherit neutral — so a
|
|
304
|
+
* column of them reads at a glance. `inherit={false}` drops the third option
|
|
305
|
+
* where there is nothing to inherit from; there, `undefined` means not yet
|
|
306
|
+
* chosen and neither On nor Off is shown selected — showing Off would read as
|
|
307
|
+
* a decision nobody made. The first segment keeps the tab stop.
|
|
308
|
+
*/
|
|
309
|
+
export function TriToggle({ value, onChange, inherit = true, labels, inheritHint, tones, disabled, label, size }) {
|
|
310
|
+
const current = value === undefined ? (inherit ? "inherit" : "unset") : value ? "on" : "off";
|
|
311
|
+
return (_jsx(Segmented, { label: label, disabled: disabled, size: size, value: current, onChange: (k) => onChange(k === "inherit" ? undefined : k === "on"), options: [
|
|
312
|
+
{ value: "on", label: labels?.on ?? "On", icon: "check", tone: tones?.on ?? "ok" },
|
|
313
|
+
{ value: "off", label: labels?.off ?? "Off", icon: "close", tone: tones?.off ?? "crit" },
|
|
314
|
+
...(inherit
|
|
315
|
+
? [{ value: "inherit", label: labels?.inherit ?? "Inherit", icon: "minus", tone: tones?.inherit ?? "mut", tooltip: inheritHint }]
|
|
316
|
+
: []),
|
|
317
|
+
] }));
|
|
318
|
+
}
|
|
319
|
+
/* ------------------------------------------------------------------ SettingRow */
|
|
320
|
+
const RowWrap = styled.div `
|
|
321
|
+
display: flex;
|
|
322
|
+
align-items: center;
|
|
323
|
+
justify-content: space-between;
|
|
324
|
+
gap: 16px;
|
|
325
|
+
min-width: 0;
|
|
326
|
+
@media (max-width: 640px) { flex-wrap: wrap; }
|
|
327
|
+
> .ctl { flex: none; display: flex; align-items: center; gap: 8px; }
|
|
328
|
+
`;
|
|
329
|
+
const RowText = styled.div `
|
|
330
|
+
min-width: 0;
|
|
331
|
+
flex: 1 1 260px;
|
|
332
|
+
> .name { display: block; font-size: 13px; font-weight: 600; color: ${(p) => (p.$dim ? v.muted : v.text)}; }
|
|
333
|
+
> .desc { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.5; color: ${v.faint}; }
|
|
334
|
+
`;
|
|
335
|
+
/**
|
|
336
|
+
* SettingRow: one setting on one line — its name and what it means on the
|
|
337
|
+
* left, its control on the right. The shape of a settings card that is a list
|
|
338
|
+
* of switches (TriToggle, Toggle, Segmented, a NumberInput) rather than a
|
|
339
|
+
* form of fields; stacks under 640px.
|
|
340
|
+
*/
|
|
341
|
+
export function SettingRow({ label, hint, dim, children, ...rest }) {
|
|
342
|
+
return (_jsxs(RowWrap, { ...rest, children: [_jsxs(RowText, { "$dim": !!dim, children: [_jsx("span", { className: "name", children: label }), hint ? _jsx("span", { className: "desc", children: hint }) : null] }), children ? _jsx("div", { className: "ctl", children: children }) : null] }));
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=Controls.js.map
|
|
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