@geomak/ui 5.2.0 → 5.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.cjs +847 -255
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +421 -23
- package/dist/index.d.ts +421 -23
- package/dist/index.js +839 -256
- package/dist/index.js.map +1 -1
- package/dist/styles.css +143 -44
- package/package.json +3 -1
package/dist/index.d.cts
CHANGED
|
@@ -1838,6 +1838,76 @@ interface ButtonProps {
|
|
|
1838
1838
|
*/
|
|
1839
1839
|
declare function Button({ content, variant, size, buttonType, loading, disabled, style, icon, onClick, }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
1840
1840
|
|
|
1841
|
+
/**
|
|
1842
|
+
* Shared field foundation for all oxygen-ui inputs.
|
|
1843
|
+
*
|
|
1844
|
+
* Centralises the things every input must agree on:
|
|
1845
|
+
* - the **size scale** (sm / md / lg) → control height + text size + padding
|
|
1846
|
+
* - the **refined focus treatment** — a crisp 1px accent border plus a soft
|
|
1847
|
+
* 3px low-opacity halo (NOT a heavy solid ring band)
|
|
1848
|
+
* - the **resting / hover / error / disabled** border + background states
|
|
1849
|
+
* - a **`<Field>` wrapper** handling label, error region, layout
|
|
1850
|
+
* (horizontal / vertical) and `aria` linkage consistently
|
|
1851
|
+
*
|
|
1852
|
+
* All values map to design-system tokens (control heights, semantic colours,
|
|
1853
|
+
* radii) so a consumer's ThemeProvider override flows straight through.
|
|
1854
|
+
*/
|
|
1855
|
+
type FieldSize = 'sm' | 'md' | 'lg';
|
|
1856
|
+
interface FieldShellOptions {
|
|
1857
|
+
size?: FieldSize;
|
|
1858
|
+
hasError?: boolean;
|
|
1859
|
+
disabled?: boolean;
|
|
1860
|
+
/**
|
|
1861
|
+
* `true` for wrapper elements that hold a real `<input>` inside
|
|
1862
|
+
* (focus-within), `false` for elements that are themselves focusable
|
|
1863
|
+
* like `<button>` triggers (focus-visible). Default `false`.
|
|
1864
|
+
*/
|
|
1865
|
+
focusWithin?: boolean;
|
|
1866
|
+
/** Append height/padding utilities (for single-line inputs). Default `true`. */
|
|
1867
|
+
sized?: boolean;
|
|
1868
|
+
}
|
|
1869
|
+
/**
|
|
1870
|
+
* Compose the className for an input's outer "shell" — the bordered, rounded
|
|
1871
|
+
* box that carries the focus ring. Apply to the `<input>` directly, or to a
|
|
1872
|
+
* wrapper `<div>` that contains an input plus adornments (pass
|
|
1873
|
+
* `focusWithin: true` in that case).
|
|
1874
|
+
*/
|
|
1875
|
+
declare function fieldShell({ size, hasError, disabled, focusWithin, sized, }?: FieldShellOptions): string;
|
|
1876
|
+
interface FieldProps {
|
|
1877
|
+
label?: React$1.ReactNode;
|
|
1878
|
+
/** `id` of the control — links the `<label htmlFor>`. */
|
|
1879
|
+
htmlFor?: string;
|
|
1880
|
+
/** `id` for the error region — pair with `aria-describedby` on the control. */
|
|
1881
|
+
errorId?: string;
|
|
1882
|
+
errorMessage?: React$1.ReactNode;
|
|
1883
|
+
/** Orientation of label vs control. Default `'vertical'`. */
|
|
1884
|
+
layout?: 'horizontal' | 'vertical';
|
|
1885
|
+
/** Show a required asterisk after the label. */
|
|
1886
|
+
required?: boolean;
|
|
1887
|
+
labelStyle?: React$1.CSSProperties;
|
|
1888
|
+
/** Width of the label column in horizontal layout (CSS length). */
|
|
1889
|
+
labelWidth?: string | number;
|
|
1890
|
+
className?: string;
|
|
1891
|
+
/** The control itself (input / trigger / dropzone). */
|
|
1892
|
+
children: React$1.ReactNode;
|
|
1893
|
+
}
|
|
1894
|
+
/**
|
|
1895
|
+
* Layout wrapper shared by every input. Renders:
|
|
1896
|
+
*
|
|
1897
|
+
* ```
|
|
1898
|
+
* vertical: horizontal:
|
|
1899
|
+
* [label] [label] [ control ]
|
|
1900
|
+
* [ control ] [ error message ]
|
|
1901
|
+
* [ error ]
|
|
1902
|
+
* ```
|
|
1903
|
+
*
|
|
1904
|
+
* The error message always sits under the **control only** (never spanning
|
|
1905
|
+
* the label in horizontal layout). Label uses full-contrast foreground +
|
|
1906
|
+
* medium weight so it reads as the anchor, while the input's placeholder is
|
|
1907
|
+
* muted — establishing hierarchy without making the label tiny.
|
|
1908
|
+
*/
|
|
1909
|
+
declare function Field({ label, htmlFor, errorId, errorMessage, layout, required, labelStyle, labelWidth, className, children, }: FieldProps): react_jsx_runtime.JSX.Element;
|
|
1910
|
+
|
|
1841
1911
|
interface TextInputProps {
|
|
1842
1912
|
value?: string;
|
|
1843
1913
|
onChange?: React$1.ChangeEventHandler<HTMLInputElement>;
|
|
@@ -1846,19 +1916,46 @@ interface TextInputProps {
|
|
|
1846
1916
|
htmlFor?: string;
|
|
1847
1917
|
placeholder?: string;
|
|
1848
1918
|
name?: string;
|
|
1919
|
+
/** Native input type. Defaults to `'text'`. */
|
|
1920
|
+
type?: 'text' | 'email' | 'url' | 'tel';
|
|
1849
1921
|
inputStyle?: React$1.CSSProperties;
|
|
1850
1922
|
style?: React$1.CSSProperties;
|
|
1851
|
-
/** Label/input orientation. Defaults to `'
|
|
1923
|
+
/** Label/input orientation. Defaults to `'vertical'`. */
|
|
1852
1924
|
layout?: 'horizontal' | 'vertical';
|
|
1925
|
+
/** Size preset — controls height, padding, and font. Default `'md'`. */
|
|
1926
|
+
size?: FieldSize;
|
|
1853
1927
|
onBlur?: React$1.FocusEventHandler<HTMLInputElement>;
|
|
1854
1928
|
errorMessage?: React$1.ReactNode;
|
|
1855
|
-
|
|
1929
|
+
/** Mark the field required (renders an asterisk after the label). */
|
|
1930
|
+
required?: boolean;
|
|
1931
|
+
/** Optional leading adornment (icon / prefix). */
|
|
1932
|
+
prefix?: React$1.ReactNode;
|
|
1933
|
+
/** Optional trailing adornment (icon / suffix / unit). */
|
|
1934
|
+
suffix?: React$1.ReactNode;
|
|
1856
1935
|
id?: string;
|
|
1857
1936
|
}
|
|
1858
1937
|
/**
|
|
1859
|
-
*
|
|
1938
|
+
* Single-line text input. Full-width by default (responsive) — constrain it
|
|
1939
|
+
* with the parent layout or `style={{ maxWidth }}`. Supports an optional
|
|
1940
|
+
* leading `prefix` and trailing `suffix` adornment (icon, unit, etc.).
|
|
1941
|
+
*
|
|
1942
|
+
* @example
|
|
1943
|
+
* ```tsx
|
|
1944
|
+
* <TextInput label="Vessel name" value={name} onChange={(e) => setName(e.target.value)} />
|
|
1945
|
+
* ```
|
|
1946
|
+
*
|
|
1947
|
+
* @example With adornment + error
|
|
1948
|
+
* ```tsx
|
|
1949
|
+
* <TextInput
|
|
1950
|
+
* label="IMO"
|
|
1951
|
+
* prefix={<HashIcon />}
|
|
1952
|
+
* value={imo}
|
|
1953
|
+
* onChange={onChange}
|
|
1954
|
+
* errorMessage={touched && !valid ? 'Invalid IMO number' : undefined}
|
|
1955
|
+
* />
|
|
1956
|
+
* ```
|
|
1860
1957
|
*/
|
|
1861
|
-
declare function TextInput({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout, onBlur, errorMessage,
|
|
1958
|
+
declare function TextInput({ value, onChange, disabled, label, htmlFor, placeholder, name, type, inputStyle, style, layout, size, onBlur, errorMessage, required, prefix, suffix, }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
1862
1959
|
|
|
1863
1960
|
interface NumberInputProps {
|
|
1864
1961
|
/** Step size for the up/down buttons and native arrow-key handling. Default `1`. */
|
|
@@ -1877,9 +1974,12 @@ interface NumberInputProps {
|
|
|
1877
1974
|
htmlFor?: string;
|
|
1878
1975
|
name?: string;
|
|
1879
1976
|
disabled?: boolean;
|
|
1880
|
-
/** Label/input orientation. Defaults to `'
|
|
1977
|
+
/** Label/input orientation. Defaults to `'vertical'`. */
|
|
1881
1978
|
layout?: 'horizontal' | 'vertical';
|
|
1979
|
+
/** Size preset. Default `'md'`. */
|
|
1980
|
+
size?: FieldSize;
|
|
1882
1981
|
errorMessage?: React$1.ReactNode;
|
|
1982
|
+
required?: boolean;
|
|
1883
1983
|
inputStyle?: React$1.CSSProperties;
|
|
1884
1984
|
labelStyle?: React$1.CSSProperties;
|
|
1885
1985
|
placeholder?: string;
|
|
@@ -1922,7 +2022,7 @@ interface NumberInputProps {
|
|
|
1922
2022
|
* <NumberInput label="Tonnage" step={0.25} precision={2} />
|
|
1923
2023
|
* ```
|
|
1924
2024
|
*/
|
|
1925
|
-
declare function NumberInput({ step, value, onChange, label, htmlFor, name, disabled, layout, errorMessage, inputStyle, labelStyle, placeholder, style, min, max, readOnly, precision, }: NumberInputProps): react_jsx_runtime.JSX.Element;
|
|
2025
|
+
declare function NumberInput({ step, value, onChange, label, htmlFor, name, disabled, layout, size, errorMessage, required, inputStyle, labelStyle, placeholder, style, min, max, readOnly, precision, }: NumberInputProps): react_jsx_runtime.JSX.Element;
|
|
1926
2026
|
|
|
1927
2027
|
interface PasswordProps {
|
|
1928
2028
|
value?: string;
|
|
@@ -1934,17 +2034,28 @@ interface PasswordProps {
|
|
|
1934
2034
|
name?: string;
|
|
1935
2035
|
inputStyle?: React$1.CSSProperties;
|
|
1936
2036
|
style?: React$1.CSSProperties;
|
|
1937
|
-
/** Label/input orientation. Defaults to `'
|
|
2037
|
+
/** Label/input orientation. Defaults to `'vertical'`. */
|
|
1938
2038
|
layout?: 'horizontal' | 'vertical';
|
|
2039
|
+
/** Size preset — controls height, padding, and font. Default `'md'`. */
|
|
2040
|
+
size?: FieldSize;
|
|
1939
2041
|
onBlur?: React$1.FocusEventHandler<HTMLInputElement>;
|
|
1940
2042
|
errorMessage?: React$1.ReactNode;
|
|
1941
|
-
|
|
1942
|
-
|
|
2043
|
+
required?: boolean;
|
|
2044
|
+
/** Override the "reveal" (password hidden) icon. */
|
|
2045
|
+
showIcon?: React$1.ReactNode;
|
|
2046
|
+
/** Override the "hide" (password visible) icon. */
|
|
2047
|
+
hideIcon?: React$1.ReactNode;
|
|
1943
2048
|
}
|
|
1944
2049
|
/**
|
|
1945
|
-
* Password input with show/hide toggle.
|
|
2050
|
+
* Password input with a show/hide reveal toggle. Full-width by default.
|
|
2051
|
+
* The reveal/hide icons can be overridden via `showIcon` / `hideIcon`.
|
|
2052
|
+
*
|
|
2053
|
+
* @example
|
|
2054
|
+
* ```tsx
|
|
2055
|
+
* <Password label="Password" value={pw} onChange={(e) => setPw(e.target.value)} />
|
|
2056
|
+
* ```
|
|
1946
2057
|
*/
|
|
1947
|
-
declare function Password({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout, onBlur, errorMessage,
|
|
2058
|
+
declare function Password({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout, size, onBlur, errorMessage, required, showIcon, hideIcon, }: PasswordProps): react_jsx_runtime.JSX.Element;
|
|
1948
2059
|
|
|
1949
2060
|
interface SearchInputProps {
|
|
1950
2061
|
value?: string;
|
|
@@ -1958,9 +2069,20 @@ interface SearchInputProps {
|
|
|
1958
2069
|
style?: React$1.CSSProperties;
|
|
1959
2070
|
/** Label/input orientation. Defaults to `'vertical'`. */
|
|
1960
2071
|
layout?: 'horizontal' | 'vertical';
|
|
2072
|
+
/** Size preset. Default `'md'`. */
|
|
2073
|
+
size?: FieldSize;
|
|
2074
|
+
/** Override the leading search icon. */
|
|
2075
|
+
icon?: React$1.ReactNode;
|
|
1961
2076
|
}
|
|
1962
2077
|
/**
|
|
1963
|
-
* Search
|
|
2078
|
+
* Search field with a leading magnifier icon. Uses `type="search"` for the
|
|
2079
|
+
* native clear affordance and a search-friendly mobile keyboard. Full-width
|
|
2080
|
+
* by default. Override the icon via `icon`.
|
|
2081
|
+
*
|
|
2082
|
+
* @example
|
|
2083
|
+
* ```tsx
|
|
2084
|
+
* <SearchInput value={q} onChange={(e) => setQ(e.target.value)} placeholder="Search vessels…" />
|
|
2085
|
+
* ```
|
|
1964
2086
|
*/
|
|
1965
2087
|
declare const SearchInput: React$1.ForwardRefExoticComponent<SearchInputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
1966
2088
|
|
|
@@ -2000,6 +2122,58 @@ interface CheckboxProps {
|
|
|
2000
2122
|
declare function Checkbox({ checked, value, // legacy alias
|
|
2001
2123
|
onChange, label, name, htmlFor, errorMessage, disabled, }: CheckboxProps): react_jsx_runtime.JSX.Element;
|
|
2002
2124
|
|
|
2125
|
+
interface RadioOption {
|
|
2126
|
+
/** Stable value submitted / reported on change. */
|
|
2127
|
+
value: string;
|
|
2128
|
+
/** Main label text. */
|
|
2129
|
+
label: React$1.ReactNode;
|
|
2130
|
+
/** Optional secondary description rendered under the label. */
|
|
2131
|
+
description?: React$1.ReactNode;
|
|
2132
|
+
/** Disable this option only. */
|
|
2133
|
+
disabled?: boolean;
|
|
2134
|
+
}
|
|
2135
|
+
interface RadioGroupProps {
|
|
2136
|
+
options: RadioOption[];
|
|
2137
|
+
/** Controlled selected value. */
|
|
2138
|
+
value?: string;
|
|
2139
|
+
/** Uncontrolled initial value. */
|
|
2140
|
+
defaultValue?: string;
|
|
2141
|
+
onChange?: (value: string) => void;
|
|
2142
|
+
name?: string;
|
|
2143
|
+
label?: React$1.ReactNode;
|
|
2144
|
+
/** Group orientation. Default `'vertical'`. */
|
|
2145
|
+
orientation?: 'vertical' | 'horizontal';
|
|
2146
|
+
/** Size preset — controls the dot + text size. Default `'md'`. */
|
|
2147
|
+
size?: FieldSize;
|
|
2148
|
+
disabled?: boolean;
|
|
2149
|
+
required?: boolean;
|
|
2150
|
+
errorMessage?: React$1.ReactNode;
|
|
2151
|
+
}
|
|
2152
|
+
/**
|
|
2153
|
+
* Radio group built on `@radix-ui/react-radio-group`. Each option can carry
|
|
2154
|
+
* a `description`, and options can be disabled individually. Radix handles
|
|
2155
|
+
* arrow-key roving focus, `role="radiogroup"`, and selection semantics.
|
|
2156
|
+
*
|
|
2157
|
+
* Form-friendly: pass `name` for native form serialisation, `errorMessage`
|
|
2158
|
+
* for validation, `required` for the asterisk + `aria-required`.
|
|
2159
|
+
*
|
|
2160
|
+
* @example
|
|
2161
|
+
* ```tsx
|
|
2162
|
+
* <RadioGroup
|
|
2163
|
+
* label="Notification frequency"
|
|
2164
|
+
* name="freq"
|
|
2165
|
+
* value={freq}
|
|
2166
|
+
* onChange={setFreq}
|
|
2167
|
+
* options={[
|
|
2168
|
+
* { value: 'realtime', label: 'Real-time', description: 'Notify me immediately' },
|
|
2169
|
+
* { value: 'daily', label: 'Daily digest' },
|
|
2170
|
+
* { value: 'off', label: 'Off', disabled: true },
|
|
2171
|
+
* ]}
|
|
2172
|
+
* />
|
|
2173
|
+
* ```
|
|
2174
|
+
*/
|
|
2175
|
+
declare function RadioGroup({ options, value, defaultValue, onChange, name, label, orientation, size, disabled, required, errorMessage, }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
2176
|
+
|
|
2003
2177
|
interface SwitchInputProps {
|
|
2004
2178
|
checked?: boolean;
|
|
2005
2179
|
onChange?: (e: {
|
|
@@ -2071,6 +2245,8 @@ interface DropdownProps {
|
|
|
2071
2245
|
items?: DropdownItem[];
|
|
2072
2246
|
labelStyle?: React$1.CSSProperties;
|
|
2073
2247
|
placeholder?: string;
|
|
2248
|
+
/** Size preset. Default `'md'`. */
|
|
2249
|
+
size?: FieldSize;
|
|
2074
2250
|
}
|
|
2075
2251
|
/**
|
|
2076
2252
|
* Select / multi-select dropdown powered by Radix Popover.
|
|
@@ -2087,7 +2263,7 @@ interface DropdownProps {
|
|
|
2087
2263
|
* // Multi-select
|
|
2088
2264
|
* <Dropdown isMultiselect label="Fuels" items={fuels} value={form.fuels} onChange={handleChange} />
|
|
2089
2265
|
*/
|
|
2090
|
-
declare function Dropdown({ isMultiselect, hasSearch, label, name, value, onChange, disabled, layout, errorMessage, style, htmlFor, items, labelStyle, placeholder, showSelectedCount, }: DropdownProps): react_jsx_runtime.JSX.Element;
|
|
2266
|
+
declare function Dropdown({ isMultiselect, hasSearch, label, name, value, onChange, disabled, layout, errorMessage, style, htmlFor, items, labelStyle, placeholder, showSelectedCount, size, }: DropdownProps): react_jsx_runtime.JSX.Element;
|
|
2091
2267
|
|
|
2092
2268
|
interface AutoCompleteItem {
|
|
2093
2269
|
key: string;
|
|
@@ -2127,6 +2303,10 @@ interface AutoCompleteProps {
|
|
|
2127
2303
|
emptyText?: string;
|
|
2128
2304
|
/** Custom "loading" message — shown in async mode while a query is in flight. */
|
|
2129
2305
|
loadingText?: string;
|
|
2306
|
+
/** Size preset. Default `'md'`. */
|
|
2307
|
+
size?: FieldSize;
|
|
2308
|
+
/** Override the leading search icon (hidden while loading). */
|
|
2309
|
+
icon?: React$1.ReactNode;
|
|
2130
2310
|
}
|
|
2131
2311
|
/**
|
|
2132
2312
|
* Search-as-you-type autocomplete powered by Radix Popover. Supports two
|
|
@@ -2164,7 +2344,7 @@ interface AutoCompleteProps {
|
|
|
2164
2344
|
* />
|
|
2165
2345
|
* ```
|
|
2166
2346
|
*/
|
|
2167
|
-
declare function AutoComplete({ disabled, label, placeholder, name, inputStyle, style, layout, items, onSearch, debounce, onItemClick, emptyText, loadingText, }: AutoCompleteProps): react_jsx_runtime.JSX.Element;
|
|
2347
|
+
declare function AutoComplete({ disabled, label, placeholder, name, inputStyle, style, layout, items, onSearch, debounce, onItemClick, emptyText, loadingText, size, icon, }: AutoCompleteProps): react_jsx_runtime.JSX.Element;
|
|
2168
2348
|
|
|
2169
2349
|
interface TreeSelectNode {
|
|
2170
2350
|
key: string | number;
|
|
@@ -2205,6 +2385,8 @@ interface TreeSelectProps {
|
|
|
2205
2385
|
parentsSelectable?: boolean;
|
|
2206
2386
|
/** Keys of nodes that should start expanded. */
|
|
2207
2387
|
defaultExpandedKeys?: (string | number)[];
|
|
2388
|
+
/** Size preset. Default `'md'`. */
|
|
2389
|
+
size?: FieldSize;
|
|
2208
2390
|
}
|
|
2209
2391
|
/**
|
|
2210
2392
|
* Hierarchical single-select with expandable branches.
|
|
@@ -2243,7 +2425,7 @@ interface TreeSelectProps {
|
|
|
2243
2425
|
* />
|
|
2244
2426
|
* ```
|
|
2245
2427
|
*/
|
|
2246
|
-
declare function TreeSelect({ label, name, value, onChange, disabled, layout, errorMessage, style, htmlFor, items, placeholder, parentsSelectable, defaultExpandedKeys, }: TreeSelectProps): react_jsx_runtime.JSX.Element;
|
|
2428
|
+
declare function TreeSelect({ label, name, value, onChange, disabled, layout, errorMessage, style, htmlFor, items, placeholder, parentsSelectable, defaultExpandedKeys, size, }: TreeSelectProps): react_jsx_runtime.JSX.Element;
|
|
2247
2429
|
|
|
2248
2430
|
interface FileInputProps {
|
|
2249
2431
|
allowMultiple?: boolean;
|
|
@@ -2256,22 +2438,43 @@ interface FileInputProps {
|
|
|
2256
2438
|
};
|
|
2257
2439
|
}) => void;
|
|
2258
2440
|
name?: string;
|
|
2259
|
-
|
|
2441
|
+
htmlFor?: string;
|
|
2442
|
+
label?: React$1.ReactNode;
|
|
2443
|
+
/** Accepted MIME types / extensions, e.g. `'.xlsx,application/pdf'`. */
|
|
2260
2444
|
accept?: string;
|
|
2445
|
+
/** Primary call-to-action copy. Default `'Click to upload or drag and drop'`. */
|
|
2446
|
+
prompt?: React$1.ReactNode;
|
|
2447
|
+
/** Secondary hint under the prompt — typically the accepted types / max size. */
|
|
2448
|
+
hint?: React$1.ReactNode;
|
|
2449
|
+
/** Maximum file size in bytes. Files above this are rejected with an error. */
|
|
2450
|
+
maxSize?: number;
|
|
2451
|
+
errorMessage?: React$1.ReactNode;
|
|
2452
|
+
disabled?: boolean;
|
|
2453
|
+
required?: boolean;
|
|
2454
|
+
/** Override the upload glyph in the empty state. */
|
|
2455
|
+
icon?: React$1.ReactNode;
|
|
2261
2456
|
}
|
|
2262
2457
|
/**
|
|
2263
|
-
* Drag-and-drop
|
|
2458
|
+
* Drag-and-drop file input with an enterprise dropzone aesthetic: a calm
|
|
2459
|
+
* dashed surface with a contained icon badge, primary + secondary copy, an
|
|
2460
|
+
* accent-tinted drag-over state, and selected files shown as horizontal chips
|
|
2461
|
+
* with name + size and a remove button.
|
|
2264
2462
|
*
|
|
2265
|
-
*
|
|
2463
|
+
* Keyboard-accessible (the dropzone is a `role="button"` activatable via
|
|
2464
|
+
* Enter / Space) and form-friendly (`errorMessage`, `required`, `name`).
|
|
2266
2465
|
*
|
|
2267
2466
|
* @example
|
|
2467
|
+
* ```tsx
|
|
2268
2468
|
* <FileInput
|
|
2269
|
-
*
|
|
2270
|
-
* accept=".xlsx"
|
|
2469
|
+
* label="Crew manifest"
|
|
2470
|
+
* accept=".xlsx,.csv"
|
|
2471
|
+
* hint="XLSX or CSV, up to 5 MB"
|
|
2472
|
+
* maxSize={5 * 1024 * 1024}
|
|
2271
2473
|
* onChange={(e) => setFile(e.target.files[0])}
|
|
2272
2474
|
* />
|
|
2475
|
+
* ```
|
|
2273
2476
|
*/
|
|
2274
|
-
declare function FileInput({ allowMultiple, onChange, name, accept, }: FileInputProps): react_jsx_runtime.JSX.Element;
|
|
2477
|
+
declare function FileInput({ allowMultiple, onChange, name, htmlFor, label, accept, prompt, hint, maxSize, errorMessage, disabled, required, icon, }: FileInputProps): react_jsx_runtime.JSX.Element;
|
|
2275
2478
|
|
|
2276
2479
|
interface DatePickerProps {
|
|
2277
2480
|
/** Current date. `null` / `undefined` means "no date selected". */
|
|
@@ -2301,6 +2504,8 @@ interface DatePickerProps {
|
|
|
2301
2504
|
weekStartsOn?: 0 | 1;
|
|
2302
2505
|
/** Allow the user to clear the date with a button in the popover. Default `true`. */
|
|
2303
2506
|
clearable?: boolean;
|
|
2507
|
+
/** Size preset. Default `'md'`. */
|
|
2508
|
+
size?: FieldSize;
|
|
2304
2509
|
}
|
|
2305
2510
|
type TemporalPickerProps = DatePickerProps;
|
|
2306
2511
|
/**
|
|
@@ -2338,6 +2543,199 @@ type TemporalPickerProps = DatePickerProps;
|
|
|
2338
2543
|
* />
|
|
2339
2544
|
* ```
|
|
2340
2545
|
*/
|
|
2341
|
-
declare function DatePicker({ value, onChange, label, placeholder, htmlFor, name: _name, layout, disabled, errorMessage, min, max, style, format, weekStartsOn, clearable, }: DatePickerProps): react_jsx_runtime.JSX.Element;
|
|
2546
|
+
declare function DatePicker({ value, onChange, label, placeholder, htmlFor, name: _name, layout, disabled, errorMessage, min, max, style, format, weekStartsOn, clearable, size, }: DatePickerProps): react_jsx_runtime.JSX.Element;
|
|
2547
|
+
|
|
2548
|
+
interface TextAreaProps {
|
|
2549
|
+
value?: string;
|
|
2550
|
+
onChange?: React$1.ChangeEventHandler<HTMLTextAreaElement>;
|
|
2551
|
+
onBlur?: React$1.FocusEventHandler<HTMLTextAreaElement>;
|
|
2552
|
+
disabled?: boolean;
|
|
2553
|
+
label?: React$1.ReactNode;
|
|
2554
|
+
htmlFor?: string;
|
|
2555
|
+
placeholder?: string;
|
|
2556
|
+
name?: string;
|
|
2557
|
+
/** Label/control orientation. Default `'vertical'`. */
|
|
2558
|
+
layout?: 'horizontal' | 'vertical';
|
|
2559
|
+
/** Size preset — controls text size + padding. Default `'md'`. */
|
|
2560
|
+
size?: FieldSize;
|
|
2561
|
+
/** Visible rows when not auto-growing. Default `4`. */
|
|
2562
|
+
rows?: number;
|
|
2563
|
+
/**
|
|
2564
|
+
* Grow the textarea to fit its content instead of scrolling. When set, the
|
|
2565
|
+
* field expands between `rows` (min) and `maxRows` (cap, then scrolls).
|
|
2566
|
+
*/
|
|
2567
|
+
autoGrow?: boolean;
|
|
2568
|
+
/** Max rows when `autoGrow` is on. Default `12`. */
|
|
2569
|
+
maxRows?: number;
|
|
2570
|
+
/** Native maxlength. When set with `showCount`, a live counter renders. */
|
|
2571
|
+
maxLength?: number;
|
|
2572
|
+
/** Show a character counter (uses `maxLength` as the denominator if present). */
|
|
2573
|
+
showCount?: boolean;
|
|
2574
|
+
/** CSS `resize` behaviour. Default `'vertical'` (or `'none'` when autoGrow). */
|
|
2575
|
+
resize?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
2576
|
+
errorMessage?: React$1.ReactNode;
|
|
2577
|
+
required?: boolean;
|
|
2578
|
+
style?: React$1.CSSProperties;
|
|
2579
|
+
inputStyle?: React$1.CSSProperties;
|
|
2580
|
+
}
|
|
2581
|
+
/**
|
|
2582
|
+
* Multi-line text input on the shared field foundation. Optional auto-grow
|
|
2583
|
+
* (expands with content between `rows` and `maxRows`), character counter, and
|
|
2584
|
+
* resize control. Same refined Halo Focus and error handling as the other
|
|
2585
|
+
* inputs.
|
|
2586
|
+
*
|
|
2587
|
+
* @example
|
|
2588
|
+
* ```tsx
|
|
2589
|
+
* <TextArea label="Notes" value={notes} onChange={(e) => setNotes(e.target.value)} autoGrow />
|
|
2590
|
+
* ```
|
|
2591
|
+
*
|
|
2592
|
+
* @example With counter
|
|
2593
|
+
* ```tsx
|
|
2594
|
+
* <TextArea label="Bio" maxLength={280} showCount value={bio} onChange={onChange} />
|
|
2595
|
+
* ```
|
|
2596
|
+
*/
|
|
2597
|
+
declare function TextArea({ value, onChange, onBlur, disabled, label, htmlFor, placeholder, name, layout, size, rows, autoGrow, maxRows, maxLength, showCount, resize, errorMessage, required, style, inputStyle, }: TextAreaProps): react_jsx_runtime.JSX.Element;
|
|
2598
|
+
|
|
2599
|
+
interface SegmentedOption {
|
|
2600
|
+
value: string;
|
|
2601
|
+
label: React$1.ReactNode;
|
|
2602
|
+
icon?: React$1.ReactNode;
|
|
2603
|
+
disabled?: boolean;
|
|
2604
|
+
}
|
|
2605
|
+
interface SegmentedControlProps {
|
|
2606
|
+
options: SegmentedOption[];
|
|
2607
|
+
/** Controlled selected value. */
|
|
2608
|
+
value?: string;
|
|
2609
|
+
/** Uncontrolled initial value. */
|
|
2610
|
+
defaultValue?: string;
|
|
2611
|
+
onChange?: (value: string) => void;
|
|
2612
|
+
/** Size preset. Default `'md'`. */
|
|
2613
|
+
size?: FieldSize;
|
|
2614
|
+
/** Stretch to fill the container, segments share the width equally. */
|
|
2615
|
+
fullWidth?: boolean;
|
|
2616
|
+
disabled?: boolean;
|
|
2617
|
+
'aria-label'?: string;
|
|
2618
|
+
}
|
|
2619
|
+
/**
|
|
2620
|
+
* Text-first segmented control for 2 to 4 mutually exclusive options
|
|
2621
|
+
* (view switchers, billing period, density). Built on
|
|
2622
|
+
* `@radix-ui/react-toggle-group` (single, non-deselectable) so arrow-key
|
|
2623
|
+
* roving focus comes for free.
|
|
2624
|
+
*
|
|
2625
|
+
* The selected segment lifts onto a surface-white "pill" inside a tinted
|
|
2626
|
+
* track, the macOS / iOS segmented-control pattern, rendered with the
|
|
2627
|
+
* system's tight radii and accent-colored active text.
|
|
2628
|
+
*
|
|
2629
|
+
* @example
|
|
2630
|
+
* ```tsx
|
|
2631
|
+
* <SegmentedControl
|
|
2632
|
+
* value={view}
|
|
2633
|
+
* onChange={setView}
|
|
2634
|
+
* options={[
|
|
2635
|
+
* { value: 'list', label: 'List' },
|
|
2636
|
+
* { value: 'board', label: 'Board' },
|
|
2637
|
+
* { value: 'calendar', label: 'Calendar' },
|
|
2638
|
+
* ]}
|
|
2639
|
+
* />
|
|
2640
|
+
* ```
|
|
2641
|
+
*/
|
|
2642
|
+
declare function SegmentedControl({ options, value, defaultValue, onChange, size, fullWidth, disabled, 'aria-label': ariaLabel, }: SegmentedControlProps): react_jsx_runtime.JSX.Element;
|
|
2643
|
+
|
|
2644
|
+
/**
|
|
2645
|
+
* Slider value. A single number for a one-thumb slider, or a `[min, max]`
|
|
2646
|
+
* tuple for a two-thumb range slider. The shape you pass determines the mode.
|
|
2647
|
+
*/
|
|
2648
|
+
type SliderValue = number | [number, number];
|
|
2649
|
+
interface SliderMark {
|
|
2650
|
+
value: number;
|
|
2651
|
+
label?: React$1.ReactNode;
|
|
2652
|
+
}
|
|
2653
|
+
interface SliderProps {
|
|
2654
|
+
value?: SliderValue;
|
|
2655
|
+
defaultValue?: SliderValue;
|
|
2656
|
+
onChange?: (value: SliderValue) => void;
|
|
2657
|
+
/** Fired once at the end of a drag/keyboard interaction. */
|
|
2658
|
+
onChangeEnd?: (value: SliderValue) => void;
|
|
2659
|
+
min?: number;
|
|
2660
|
+
max?: number;
|
|
2661
|
+
step?: number;
|
|
2662
|
+
label?: React$1.ReactNode;
|
|
2663
|
+
/** Show the current value(s) next to the label. */
|
|
2664
|
+
showValue?: boolean;
|
|
2665
|
+
/** Format the displayed value (tooltip + value readout). */
|
|
2666
|
+
formatValue?: (n: number) => string;
|
|
2667
|
+
/** Tick marks under the track. */
|
|
2668
|
+
marks?: SliderMark[];
|
|
2669
|
+
/** Show a value tooltip above the thumb while dragging. */
|
|
2670
|
+
tooltip?: boolean;
|
|
2671
|
+
size?: FieldSize;
|
|
2672
|
+
disabled?: boolean;
|
|
2673
|
+
errorMessage?: React$1.ReactNode;
|
|
2674
|
+
name?: string;
|
|
2675
|
+
htmlFor?: string;
|
|
2676
|
+
}
|
|
2677
|
+
/**
|
|
2678
|
+
* Range slider on `@radix-ui/react-slider`. Pass a single number for a
|
|
2679
|
+
* one-thumb slider or a `[min, max]` tuple for a two-thumb range. Optional
|
|
2680
|
+
* tick marks, a drag tooltip, and a value readout beside the label.
|
|
2681
|
+
*
|
|
2682
|
+
* @example Single
|
|
2683
|
+
* ```tsx
|
|
2684
|
+
* <Slider label="Volume" value={vol} onChange={(v) => setVol(v as number)} showValue />
|
|
2685
|
+
* ```
|
|
2686
|
+
*
|
|
2687
|
+
* @example Range with marks
|
|
2688
|
+
* ```tsx
|
|
2689
|
+
* <Slider
|
|
2690
|
+
* label="Price"
|
|
2691
|
+
* value={[20, 80]}
|
|
2692
|
+
* onChange={(v) => setRange(v as [number, number])}
|
|
2693
|
+
* marks={[{ value: 0, label: '$0' }, { value: 50, label: '$50' }, { value: 100, label: '$100' }]}
|
|
2694
|
+
* tooltip
|
|
2695
|
+
* />
|
|
2696
|
+
* ```
|
|
2697
|
+
*/
|
|
2698
|
+
declare function Slider({ value, defaultValue, onChange, onChangeEnd, min, max, step, label, showValue, formatValue, marks, tooltip, size, disabled, errorMessage, name, htmlFor, }: SliderProps): react_jsx_runtime.JSX.Element;
|
|
2699
|
+
|
|
2700
|
+
interface TagsInputProps {
|
|
2701
|
+
/** Controlled list of tags. */
|
|
2702
|
+
value?: string[];
|
|
2703
|
+
/** Uncontrolled initial tags. */
|
|
2704
|
+
defaultValue?: string[];
|
|
2705
|
+
onChange?: (tags: string[]) => void;
|
|
2706
|
+
label?: React$1.ReactNode;
|
|
2707
|
+
htmlFor?: string;
|
|
2708
|
+
name?: string;
|
|
2709
|
+
placeholder?: string;
|
|
2710
|
+
layout?: 'horizontal' | 'vertical';
|
|
2711
|
+
size?: FieldSize;
|
|
2712
|
+
disabled?: boolean;
|
|
2713
|
+
errorMessage?: React$1.ReactNode;
|
|
2714
|
+
required?: boolean;
|
|
2715
|
+
/** Maximum number of tags. Further input is ignored once reached. */
|
|
2716
|
+
maxTags?: number;
|
|
2717
|
+
/** Reject duplicate tags (case-insensitive). Default `true`. */
|
|
2718
|
+
dedupe?: boolean;
|
|
2719
|
+
/**
|
|
2720
|
+
* Validate a candidate tag before adding. Return `false` (or a string error
|
|
2721
|
+
* to surface) to reject. Receives the trimmed candidate + current tags.
|
|
2722
|
+
*/
|
|
2723
|
+
validate?: (tag: string, tags: string[]) => boolean | string;
|
|
2724
|
+
/** Characters that commit the current input as a tag. Default Enter + comma. */
|
|
2725
|
+
separators?: string[];
|
|
2726
|
+
}
|
|
2727
|
+
/**
|
|
2728
|
+
* Free-text entry that produces removable tag chips, distinct from Dropdown
|
|
2729
|
+
* (which picks from a fixed list). Type and press Enter or comma to add;
|
|
2730
|
+
* Backspace on an empty field removes the last tag; pasting a delimited string
|
|
2731
|
+
* splits into multiple tags. Optional dedupe, max-count, and per-tag validation.
|
|
2732
|
+
*
|
|
2733
|
+
* @example
|
|
2734
|
+
* ```tsx
|
|
2735
|
+
* <TagsInput label="Recipients" value={emails} onChange={setEmails}
|
|
2736
|
+
* validate={(t) => /.+@.+\..+/.test(t) || 'Not a valid email'} />
|
|
2737
|
+
* ```
|
|
2738
|
+
*/
|
|
2739
|
+
declare function TagsInput({ value, defaultValue, onChange, label, htmlFor, name, placeholder, layout, size, disabled, errorMessage, required, maxTags, dedupe, validate, separators, }: TagsInputProps): react_jsx_runtime.JSX.Element;
|
|
2342
2740
|
|
|
2343
|
-
export { AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, Button, type ButtonProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, type DatePickerProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, type DropdownProps, type ExpandRowOptions, FadingBase, type FadingBaseProps, FileInput, type FileInputProps, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Grid, GridCard, type GridCardItem, type GridCardProps, type GridProps, Icon, IconButton, type IconButtonProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, type PaginationOptions, Password, type PasswordProps, Portal, type PortalProps, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, type Spacing, Switch, type SwitchInputProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, DatePicker as Temporal, type TemporalPickerProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, ToggleButton, type ToggleButtonProps, type ToggleItem, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, Wizard, type WizardProps, type WizardStep, useNotification };
|
|
2741
|
+
export { AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, Button, type ButtonProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, type DatePickerProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, type DropdownProps, type ExpandRowOptions, FadingBase, type FadingBaseProps, Field, type FieldProps, type FieldShellOptions, type FieldSize, FileInput, type FileInputProps, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Grid, GridCard, type GridCardItem, type GridCardProps, type GridProps, Icon, IconButton, type IconButtonProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, type PaginationOptions, Password, type PasswordProps, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Slider, type SliderMark, type SliderProps, type SliderValue, type Spacing, Switch, type SwitchInputProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, ToggleButton, type ToggleButtonProps, type ToggleItem, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, Wizard, type WizardProps, type WizardStep, fieldShell, useNotification };
|