@galaxy-io/dls 2.4.1 → 2.5.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/beacons/Beacon.d.ts +6 -6
- package/dist/beacons/Beacon.js +22 -19
- package/dist/buttons/Button.d.ts +6 -0
- package/dist/buttons/Button.js +3 -2
- package/dist/charts/BarChart.d.ts +2 -2
- package/dist/charts/ChartLegend.js +2 -1
- package/dist/charts/LineChart.js +1 -0
- package/dist/charts/PieChart.js +1 -0
- package/dist/charts/Sparkline.d.ts +5 -4
- package/dist/charts/Sparkline.js +21 -18
- package/dist/charts/barChartGeometry.d.ts +2 -2
- package/dist/charts/barChartLegend.js +2 -0
- package/dist/charts/chartPalette.d.ts +9 -5
- package/dist/charts/chartPalette.js +8 -2
- package/dist/charts/types.d.ts +7 -5
- package/dist/charts/useSeriesColorResolver.d.ts +2 -1
- package/dist/chips/Chip.d.ts +6 -5
- package/dist/chips/Chip.js +24 -21
- package/dist/feedback/EmptyState.d.ts +29 -3
- package/dist/feedback/EmptyState.js +39 -13
- package/dist/feedback/ProgressBar.d.ts +5 -4
- package/dist/feedback/ProgressBar.js +25 -22
- package/dist/feedback/ProgressCircle.d.ts +5 -4
- package/dist/feedback/ProgressCircle.js +25 -22
- package/dist/inputs/CheckboxGroup.d.ts +5 -1
- package/dist/inputs/CheckboxGroup.js +4 -2
- package/dist/inputs/ColorInput.d.ts +6 -2
- package/dist/inputs/ColorInput.js +4 -2
- package/dist/inputs/CopyInput.d.ts +6 -2
- package/dist/inputs/CopyInput.js +1 -1
- package/dist/inputs/CronInput.d.ts +6 -2
- package/dist/inputs/CronInput.js +4 -2
- package/dist/inputs/DateInput.d.ts +6 -2
- package/dist/inputs/DateInput.js +4 -2
- package/dist/inputs/DurationInput.d.ts +6 -2
- package/dist/inputs/DurationInput.js +4 -2
- package/dist/inputs/FileInput.d.ts +5 -1
- package/dist/inputs/FileInput.js +4 -2
- package/dist/inputs/Input.d.ts +7 -1
- package/dist/inputs/Input.js +7 -4
- package/dist/inputs/KeyValueInput.d.ts +6 -2
- package/dist/inputs/KeyValueInput.js +4 -2
- package/dist/inputs/MultiSelectInput.d.ts +5 -1
- package/dist/inputs/NumberInput.js +2 -1
- package/dist/inputs/PasswordInput.js +2 -1
- package/dist/inputs/PinInput.d.ts +6 -2
- package/dist/inputs/PinInput.js +4 -2
- package/dist/inputs/RadioGroup.d.ts +5 -1
- package/dist/inputs/RadioGroup.js +4 -2
- package/dist/inputs/SelectInput.d.ts +5 -1
- package/dist/inputs/SelectInput.js +4 -2
- package/dist/inputs/SliderInput.d.ts +6 -2
- package/dist/inputs/SliderInput.js +4 -2
- package/dist/inputs/TagInput.d.ts +6 -2
- package/dist/inputs/TagInput.js +4 -2
- package/dist/inputs/TextAreaInput.d.ts +6 -2
- package/dist/inputs/TextAreaInput.js +6 -3
- package/dist/inputs/ToggleInput.d.ts +5 -1
- package/dist/inputs/ToggleInput.js +4 -2
- package/dist/inputs/internal/ownField.d.ts +10 -5
- package/dist/inputs/internal/ownField.js +14 -9
- package/dist/layout/Box.d.ts +1 -1
- package/dist/layout/Box.js +20 -27
- package/dist/layout/Flex.d.ts +24 -1
- package/dist/layout/Flex.js +25 -5
- package/dist/layout/FlexItem.d.ts +24 -1
- package/dist/layout/FlexItem.js +22 -3
- package/dist/layout/internal/surface.d.ts +13 -0
- package/dist/layout/internal/surface.js +28 -0
- package/dist/lists/DescriptionList.d.ts +6 -0
- package/dist/lists/DescriptionList.js +13 -11
- package/dist/modal/ConfirmDialog.d.ts +4 -0
- package/dist/modal/ConfirmDialog.js +7 -4
- package/dist/shapes/Circle.d.ts +6 -5
- package/dist/shapes/Circle.js +21 -18
- package/dist/shapes/Square.d.ts +6 -5
- package/dist/shapes/Square.js +21 -18
- package/dist/styles.css +1 -1
- package/dist/table/TableCore.js +3 -2
- package/dist/theme/enums.d.ts +1 -1
- package/dist/theme/enums.js +1 -1
- package/dist/theme/tokens/palette.d.ts +5 -1
- package/dist/theme/tokens/palette.js +9 -1
- package/dist/theme/tokens/types.d.ts +9 -1
- package/dist/timeline/Timeline.d.ts +6 -5
- package/dist/timeline/Timeline.js +20 -17
- package/package.json +1 -1
|
@@ -26,6 +26,14 @@ var EmptyStateSize = /* @__PURE__ */ function(EmptyStateSize) {
|
|
|
26
26
|
EmptyStateSize["LARGE"] = "LARGE";
|
|
27
27
|
return EmptyStateSize;
|
|
28
28
|
}({});
|
|
29
|
+
/** Color role of the tile (color set, subset). */
|
|
30
|
+
var EmptyStateVariant = /* @__PURE__ */ function(EmptyStateVariant) {
|
|
31
|
+
/** A quiet tile: `text.secondary` icon on a `border.primary` hairline. The default. */
|
|
32
|
+
EmptyStateVariant["SECONDARY"] = "SECONDARY";
|
|
33
|
+
/** Something failed: `text.error` icon on a `border.error` hairline. */
|
|
34
|
+
EmptyStateVariant["ERROR"] = "ERROR";
|
|
35
|
+
return EmptyStateVariant;
|
|
36
|
+
}({});
|
|
29
37
|
/** Fills its parent's width and centers its stack. No background, border or radius. */
|
|
30
38
|
var Root = /*#__PURE__*/ styled("div")({
|
|
31
39
|
name: "Root",
|
|
@@ -38,23 +46,37 @@ var Tile = /*#__PURE__*/ styled("div")({
|
|
|
38
46
|
class: "gx-EmptyState-Tile-t2lzt2i",
|
|
39
47
|
propsAsIs: false
|
|
40
48
|
});
|
|
49
|
+
/** The app's own graphic above the header: centered, never wider than the region. */
|
|
50
|
+
var Graphic = /*#__PURE__*/ styled("div")({
|
|
51
|
+
name: "Graphic",
|
|
52
|
+
class: "gx-EmptyState-Graphic-g1cew7lm",
|
|
53
|
+
propsAsIs: false
|
|
54
|
+
});
|
|
55
|
+
var EMPTY_STATE_VARIANT_TO_TILE_CSS_MAP = {
|
|
56
|
+
["SECONDARY"]: "gx-EmptyState-SECONDARY-sz10ltv",
|
|
57
|
+
["ERROR"]: "gx-EmptyState-ERROR-e1ao7sbo"
|
|
58
|
+
};
|
|
59
|
+
var EMPTY_STATE_VARIANT_TO_ICON_VARIANT_MAP = {
|
|
60
|
+
["SECONDARY"]: IconVariant.SECONDARY,
|
|
61
|
+
["ERROR"]: IconVariant.ERROR
|
|
62
|
+
};
|
|
41
63
|
var Copy = /*#__PURE__*/ styled("div")({
|
|
42
64
|
name: "Copy",
|
|
43
|
-
class: "gx-EmptyState-Copy-
|
|
65
|
+
class: "gx-EmptyState-Copy-ca0wxkf",
|
|
44
66
|
propsAsIs: false
|
|
45
67
|
});
|
|
46
68
|
var Actions = /*#__PURE__*/ styled("div")({
|
|
47
69
|
name: "Actions",
|
|
48
|
-
class: "gx-EmptyState-Actions-
|
|
70
|
+
class: "gx-EmptyState-Actions-agybc7l",
|
|
49
71
|
propsAsIs: false
|
|
50
72
|
});
|
|
51
73
|
/** A measure, not a spacing value: two-line descriptions stay two lines at body_md. */
|
|
52
|
-
var DESCRIPTION_CSS = "gx-EmptyState-DESCRIPTION_CSS-
|
|
74
|
+
var DESCRIPTION_CSS = "gx-EmptyState-DESCRIPTION_CSS-d4781xg";
|
|
53
75
|
/** Padding, stack gap and tile size per placement. */
|
|
54
76
|
var EMPTY_STATE_SIZE_TO_CSS_MAP = {
|
|
55
|
-
["SMALL"]: "gx-EmptyState-SMALL-
|
|
56
|
-
["MEDIUM"]: "gx-EmptyState-MEDIUM-
|
|
57
|
-
["LARGE"]: "gx-EmptyState-LARGE-
|
|
77
|
+
["SMALL"]: "gx-EmptyState-SMALL-s15jcumv",
|
|
78
|
+
["MEDIUM"]: "gx-EmptyState-MEDIUM-m1x5idgk",
|
|
79
|
+
["LARGE"]: "gx-EmptyState-LARGE-l1410570"
|
|
58
80
|
};
|
|
59
81
|
/** The tile's icon: the rung pair of its control square (24/14, 32/16, 40/18). */
|
|
60
82
|
var EMPTY_STATE_SIZE_TO_ICON_PX_MAP = {
|
|
@@ -73,17 +95,21 @@ var EMPTY_STATE_SIZE_TO_DESCRIPTION_SIZE_MAP = {
|
|
|
73
95
|
["LARGE"]: TextSize.BODY_MD
|
|
74
96
|
};
|
|
75
97
|
/** A centered icon, header, description and actions for a region with nothing to show. */
|
|
76
|
-
var EmptyState = forwardRef(function EmptyState({ header, description, icon, actions, size = "MEDIUM", className, ...rest }, ref) {
|
|
98
|
+
var EmptyState = forwardRef(function EmptyState({ header, description, icon, graphic, actions, size = "MEDIUM", variant = "SECONDARY", className, ...rest }, ref) {
|
|
77
99
|
return /* @__PURE__ */ jsxs(Root, {
|
|
78
100
|
...rest,
|
|
79
101
|
ref,
|
|
80
102
|
className: cx(EMPTY_STATE_SIZE_TO_CSS_MAP[size], className),
|
|
81
103
|
children: [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
104
|
+
graphic !== void 0 && /* @__PURE__ */ jsx(Graphic, { children: graphic }),
|
|
105
|
+
icon && /* @__PURE__ */ jsx(Tile, {
|
|
106
|
+
className: EMPTY_STATE_VARIANT_TO_TILE_CSS_MAP[variant],
|
|
107
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
108
|
+
component: icon,
|
|
109
|
+
size: EMPTY_STATE_SIZE_TO_ICON_PX_MAP[size],
|
|
110
|
+
variant: EMPTY_STATE_VARIANT_TO_ICON_VARIANT_MAP[variant]
|
|
111
|
+
})
|
|
112
|
+
}),
|
|
87
113
|
/* @__PURE__ */ jsxs(Copy, { children: [/* @__PURE__ */ jsx(Text, {
|
|
88
114
|
as: "p",
|
|
89
115
|
size: EMPTY_STATE_SIZE_TO_HEADER_SIZE_MAP[size],
|
|
@@ -106,4 +132,4 @@ var EmptyState = forwardRef(function EmptyState({ header, description, icon, act
|
|
|
106
132
|
});
|
|
107
133
|
EmptyState.displayName = "EmptyState";
|
|
108
134
|
//#endregion
|
|
109
|
-
export { EmptyStateSize, EmptyState as default };
|
|
135
|
+
export { EmptyStateSize, EmptyStateVariant, EmptyState as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AriaAttributes, type CSSProperties } from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { RoleColor } from "../theme/tokens/types.js";
|
|
3
3
|
/** Canonical rungs; the member names the rung of the text the bar sits with. */
|
|
4
4
|
export declare enum ProgressBarSize {
|
|
5
5
|
/** 2px track, caption label. */
|
|
@@ -54,11 +54,12 @@ interface ProgressBarColorProps {
|
|
|
54
54
|
*/
|
|
55
55
|
variant?: undefined;
|
|
56
56
|
/**
|
|
57
|
-
* Categorical palette family (`"blue"`, `"violet"`, …)
|
|
58
|
-
*
|
|
57
|
+
* Categorical palette family (`"blue"`, `"violet"`, …) or a status role as a string
|
|
58
|
+
* (`"success"`, `"error"`): the fill takes `text.<name>`, the way a status variant renders. For a
|
|
59
|
+
* category's or data-driven color (a source type, a team); a status that is meaning takes
|
|
59
60
|
* `variant`. Not with `variant`.
|
|
60
61
|
*/
|
|
61
|
-
color:
|
|
62
|
+
color: RoleColor;
|
|
62
63
|
}
|
|
63
64
|
/** The passthrough, kept last so `className` and `style` close the props table. */
|
|
64
65
|
interface ProgressBarPassthroughProps {
|
|
@@ -97,31 +97,34 @@ var PROGRESS_BAR_VARIANT_TO_CSS_MAP = {
|
|
|
97
97
|
};
|
|
98
98
|
/** Categorical `color`: `text.<family>` on the root, the way a status variant renders. */
|
|
99
99
|
var PROGRESS_BAR_COLOR_TO_CSS_MAP = {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
100
|
+
success: "gx-ProgressBar-success-seiy0oi",
|
|
101
|
+
warning: "gx-ProgressBar-warning-w1epzlep",
|
|
102
|
+
error: "gx-ProgressBar-error-easg8k0",
|
|
103
|
+
red: "gx-ProgressBar-red-r1kkinrj",
|
|
104
|
+
orange: "gx-ProgressBar-orange-ocvje08",
|
|
105
|
+
amber: "gx-ProgressBar-amber-ab5j54q",
|
|
106
|
+
yellow: "gx-ProgressBar-yellow-ylbvi15",
|
|
107
|
+
lime: "gx-ProgressBar-lime-lwaqggx",
|
|
108
|
+
green: "gx-ProgressBar-green-g6fb74o",
|
|
109
|
+
emerald: "gx-ProgressBar-emerald-e13m8tjk",
|
|
110
|
+
teal: "gx-ProgressBar-teal-t195062s",
|
|
111
|
+
cyan: "gx-ProgressBar-cyan-c1tjg1hb",
|
|
112
|
+
sky: "gx-ProgressBar-sky-s1hc7niq",
|
|
113
|
+
blue: "gx-ProgressBar-blue-b31v6jj",
|
|
114
|
+
indigo: "gx-ProgressBar-indigo-i1idth2y",
|
|
115
|
+
violet: "gx-ProgressBar-violet-vsz64tr",
|
|
116
|
+
purple: "gx-ProgressBar-purple-p121jrhu",
|
|
117
|
+
fuchsia: "gx-ProgressBar-fuchsia-foqk5ch",
|
|
118
|
+
pink: "gx-ProgressBar-pink-p1luqk3n",
|
|
119
|
+
rose: "gx-ProgressBar-rose-r1hbdj3k"
|
|
117
120
|
};
|
|
118
121
|
/** Track thickness and the gap between the label line and the track. */
|
|
119
122
|
var PROGRESS_BAR_SIZE_TO_CSS_MAP = {
|
|
120
|
-
["X_SMALL"]: "gx-ProgressBar-X_SMALL-
|
|
121
|
-
["SMALL"]: "gx-ProgressBar-SMALL-
|
|
122
|
-
["MEDIUM"]: "gx-ProgressBar-MEDIUM-
|
|
123
|
-
["LARGE"]: "gx-ProgressBar-LARGE-
|
|
124
|
-
["X_LARGE"]: "gx-ProgressBar-X_LARGE-
|
|
123
|
+
["X_SMALL"]: "gx-ProgressBar-X_SMALL-x17skgql",
|
|
124
|
+
["SMALL"]: "gx-ProgressBar-SMALL-s1i0eise",
|
|
125
|
+
["MEDIUM"]: "gx-ProgressBar-MEDIUM-mnhve48",
|
|
126
|
+
["LARGE"]: "gx-ProgressBar-LARGE-l1p1szbl",
|
|
127
|
+
["X_LARGE"]: "gx-ProgressBar-X_LARGE-xu0asu0"
|
|
125
128
|
};
|
|
126
129
|
/** The label and value are the rung's text step (the ProgressCircle table). */
|
|
127
130
|
var PROGRESS_BAR_SIZE_TO_TEXT_SIZE_MAP = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AriaAttributes, type CSSProperties } from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { RoleColor } from "../theme/tokens/types.js";
|
|
3
3
|
/** Canonical rungs; the member names the control rung the ring sits in. */
|
|
4
4
|
export declare enum ProgressCircleSize {
|
|
5
5
|
/** 20px rung: 12px ring, caption label. */
|
|
@@ -61,11 +61,12 @@ interface ProgressCircleColorProps {
|
|
|
61
61
|
*/
|
|
62
62
|
variant?: undefined;
|
|
63
63
|
/**
|
|
64
|
-
* Categorical palette family (`"blue"`, `"violet"`, …)
|
|
65
|
-
*
|
|
64
|
+
* Categorical palette family (`"blue"`, `"violet"`, …) or a status role as a string
|
|
65
|
+
* (`"success"`, `"error"`): the arc takes `text.<name>`, the way a status variant renders. For a
|
|
66
|
+
* category's or data-driven color (a source type, a team); a status that is meaning takes
|
|
66
67
|
* `variant`. Not with `variant`.
|
|
67
68
|
*/
|
|
68
|
-
color:
|
|
69
|
+
color: RoleColor;
|
|
69
70
|
}
|
|
70
71
|
/** The passthrough, kept last so `className` and `style` close the props table. */
|
|
71
72
|
interface ProgressCirclePassthroughProps {
|
|
@@ -84,31 +84,34 @@ var PROGRESS_CIRCLE_VARIANT_TO_CSS_MAP = {
|
|
|
84
84
|
};
|
|
85
85
|
/** Categorical `color`: `text.<family>` on the root, the way a status variant renders. */
|
|
86
86
|
var PROGRESS_CIRCLE_COLOR_TO_CSS_MAP = {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
87
|
+
success: "gx-ProgressCircle-success-s5wr4fy",
|
|
88
|
+
warning: "gx-ProgressCircle-warning-w3cpdk8",
|
|
89
|
+
error: "gx-ProgressCircle-error-e3bcytf",
|
|
90
|
+
red: "gx-ProgressCircle-red-r1b1indu",
|
|
91
|
+
orange: "gx-ProgressCircle-orange-os32e8h",
|
|
92
|
+
amber: "gx-ProgressCircle-amber-a1z891t",
|
|
93
|
+
yellow: "gx-ProgressCircle-yellow-y169l71b",
|
|
94
|
+
lime: "gx-ProgressCircle-lime-l7wy6jh",
|
|
95
|
+
green: "gx-ProgressCircle-green-gid9v1r",
|
|
96
|
+
emerald: "gx-ProgressCircle-emerald-ephjv2k",
|
|
97
|
+
teal: "gx-ProgressCircle-teal-t14y8mwv",
|
|
98
|
+
cyan: "gx-ProgressCircle-cyan-c1gpmklw",
|
|
99
|
+
sky: "gx-ProgressCircle-sky-s15o8mw",
|
|
100
|
+
blue: "gx-ProgressCircle-blue-b865hhm",
|
|
101
|
+
indigo: "gx-ProgressCircle-indigo-i1lkh9dd",
|
|
102
|
+
violet: "gx-ProgressCircle-violet-v4a8qsx",
|
|
103
|
+
purple: "gx-ProgressCircle-purple-pzljd4b",
|
|
104
|
+
fuchsia: "gx-ProgressCircle-fuchsia-foz9zwb",
|
|
105
|
+
pink: "gx-ProgressCircle-pink-pi0gudm",
|
|
106
|
+
rose: "gx-ProgressCircle-rose-r1tg3t7s"
|
|
104
107
|
};
|
|
105
108
|
/** Ring box, root height (the rung's text line height) and gap: the Spinner table. */
|
|
106
109
|
var PROGRESS_CIRCLE_SIZE_TO_CSS_MAP = {
|
|
107
|
-
["X_SMALL"]: "gx-ProgressCircle-X_SMALL-
|
|
108
|
-
["SMALL"]: "gx-ProgressCircle-SMALL-
|
|
109
|
-
["MEDIUM"]: "gx-ProgressCircle-MEDIUM-
|
|
110
|
-
["LARGE"]: "gx-ProgressCircle-LARGE-
|
|
111
|
-
["X_LARGE"]: "gx-ProgressCircle-X_LARGE-
|
|
110
|
+
["X_SMALL"]: "gx-ProgressCircle-X_SMALL-x1tizbqg",
|
|
111
|
+
["SMALL"]: "gx-ProgressCircle-SMALL-suuqsnf",
|
|
112
|
+
["MEDIUM"]: "gx-ProgressCircle-MEDIUM-mrsjl86",
|
|
113
|
+
["LARGE"]: "gx-ProgressCircle-LARGE-lzwqtuj",
|
|
114
|
+
["X_LARGE"]: "gx-ProgressCircle-X_LARGE-x1omzhlm"
|
|
112
115
|
};
|
|
113
116
|
/** The label and value are the rung's text step (the ProgressBar table). */
|
|
114
117
|
var PROGRESS_CIRCLE_SIZE_TO_TEXT_SIZE_MAP = {
|
|
@@ -50,8 +50,12 @@ export interface CheckboxGroupProps<TId extends string = string> extends AriaAtt
|
|
|
50
50
|
defaultValue?: TId[];
|
|
51
51
|
/** Called with the new array of checked ids, in `options` order. */
|
|
52
52
|
onChange?: (value: TId[]) => void;
|
|
53
|
-
/** The question, rendered through `Field` above the options. For a
|
|
53
|
+
/** The question, rendered through `Field` above the options. For a horizontal layout or `actions`, wrap the group in `Field`. */
|
|
54
54
|
label?: string;
|
|
55
|
+
/** Hint behind an info icon beside the question, shown in a `Tooltip` (through `Field`). */
|
|
56
|
+
labelTooltip?: string | ReactNode;
|
|
57
|
+
/** Help copy under the question, above the options, through `Field`. Text and inline `Link`s only. */
|
|
58
|
+
description?: ReactNode;
|
|
55
59
|
/** Message from the app, shown under the options through `Field`. It also marks every box invalid. */
|
|
56
60
|
error?: string;
|
|
57
61
|
/**
|
|
@@ -96,7 +96,7 @@ var CHECKBOX_GROUP_SIZE_TO_FIELD_SIZE_MAP = {
|
|
|
96
96
|
var EMPTY_IDS = [];
|
|
97
97
|
/** The group element and its boxes, wired to the nearest Field (the group's own or the app's). */
|
|
98
98
|
function GroupBody({ groupProps, forwardedRef, isRoot }) {
|
|
99
|
-
const { options, value, defaultValue, onChange, label: _label, error, isError = false, isRequired = false, orientation = Orientation.VERTICAL, size = "MEDIUM", variant = "PRIMARY", isGhost = false, isDisabled = false, ariaLabel, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = groupProps;
|
|
99
|
+
const { options, value, defaultValue, onChange, label: _label, labelTooltip: _labelTooltip, description: _description, error, isError = false, isRequired = false, orientation = Orientation.VERTICAL, size = "MEDIUM", variant = "PRIMARY", isGhost = false, isDisabled = false, ariaLabel, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = groupProps;
|
|
100
100
|
const wiring = useFieldWiring({
|
|
101
101
|
id,
|
|
102
102
|
ariaLabel,
|
|
@@ -151,11 +151,13 @@ function GroupBody({ groupProps, forwardedRef, isRoot }) {
|
|
|
151
151
|
/** A set of checkboxes answering one question; the value is the array of checked ids. */
|
|
152
152
|
var CheckboxGroupBase = forwardRef(function CheckboxGroup(props, ref) {
|
|
153
153
|
const { label, error, isRequired = false, size = "MEDIUM" } = props;
|
|
154
|
-
const { id, className, style } = props;
|
|
154
|
+
const { labelTooltip, description, id, className, style } = props;
|
|
155
155
|
const ownField = useOwnField({
|
|
156
156
|
componentName: "CheckboxGroup",
|
|
157
157
|
label,
|
|
158
158
|
error,
|
|
159
|
+
labelTooltip,
|
|
160
|
+
description,
|
|
159
161
|
isRequired,
|
|
160
162
|
size: CHECKBOX_GROUP_SIZE_TO_FIELD_SIZE_MAP[size],
|
|
161
163
|
id,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AriaAttributes, type CSSProperties, type ReactElement } from "react";
|
|
1
|
+
import { type AriaAttributes, type CSSProperties, type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import { type Hex } from "../utils/colors.js";
|
|
3
3
|
/** Canonical rungs; ColorInput supports all five (the Input rung table). */
|
|
4
4
|
export declare enum ColorInputSize {
|
|
@@ -54,8 +54,12 @@ export interface ColorInputProps extends AriaAttributes {
|
|
|
54
54
|
* @default false
|
|
55
55
|
*/
|
|
56
56
|
isGhost?: boolean;
|
|
57
|
-
/** Label above the field, rendered through `Field`. For a
|
|
57
|
+
/** Label above the field, rendered through `Field`. For a horizontal layout or `actions`, wrap the input in `Field`. A custom trigger (`children`) ignores it. */
|
|
58
58
|
label?: string;
|
|
59
|
+
/** Hint behind an info icon beside the label, shown in a `Tooltip` (through `Field`). A custom trigger ignores it. */
|
|
60
|
+
labelTooltip?: string | ReactNode;
|
|
61
|
+
/** Help copy under the label, through `Field`. Text and inline `Link`s only. A custom trigger ignores it. */
|
|
62
|
+
description?: ReactNode;
|
|
59
63
|
/**
|
|
60
64
|
* Shown in the field while there is no value. Never the label.
|
|
61
65
|
* @default Select color…
|
|
@@ -333,7 +333,7 @@ function presetCheckColor(hex) {
|
|
|
333
333
|
}
|
|
334
334
|
/** The field (or the custom trigger), the trailing parts and the picker panel. */
|
|
335
335
|
function ColorInputFrame({ colorProps, forwardedRef, isRoot }) {
|
|
336
|
-
const { value, defaultValue = null, onChange, onPreviewChange, presets, size = "MEDIUM", variant = "PRIMARY", isGhost = false, label, placeholder = "Select color…", error, isError = false, isClearable = false, isDisabled = false, isReadOnly = false, isRequired = false, fillWidth = false, ariaLabel, isOpen, defaultIsOpen = false, onOpenChange, children, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = colorProps;
|
|
336
|
+
const { value, defaultValue = null, onChange, onPreviewChange, presets, size = "MEDIUM", variant = "PRIMARY", isGhost = false, label, labelTooltip: _labelTooltip, description: _description, placeholder = "Select color…", error, isError = false, isClearable = false, isDisabled = false, isReadOnly = false, isRequired = false, fillWidth = false, ariaLabel, isOpen, defaultIsOpen = false, onOpenChange, children, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = colorProps;
|
|
337
337
|
const { field, controlId, describedBy, isInvalid, isRequired: isRequiredState, hasName: hasOwnName } = useFieldWiring({
|
|
338
338
|
id,
|
|
339
339
|
ariaLabel,
|
|
@@ -749,12 +749,14 @@ function ColorInputFrame({ colorProps, forwardedRef, isRoot }) {
|
|
|
749
749
|
}
|
|
750
750
|
/** Choose one solid color as a hex value, in a field (or a custom trigger) that opens a picker. */
|
|
751
751
|
var ColorInput = forwardRef(function ColorInput(props, ref) {
|
|
752
|
-
const { label, error, isRequired = false, size = "MEDIUM", fillWidth = false, children } = props;
|
|
752
|
+
const { label, error, labelTooltip, description, isRequired = false, size = "MEDIUM", fillWidth = false, children } = props;
|
|
753
753
|
const { id, className, style } = props;
|
|
754
754
|
const ownField = useOwnField({
|
|
755
755
|
componentName: "ColorInput",
|
|
756
756
|
label,
|
|
757
757
|
error,
|
|
758
|
+
labelTooltip,
|
|
759
|
+
description,
|
|
758
760
|
isRequired,
|
|
759
761
|
size: COLOR_INPUT_SIZE_TO_FIELD_SIZE_MAP[size],
|
|
760
762
|
id,
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { type AriaAttributes, type CSSProperties } from "react";
|
|
1
|
+
import { type AriaAttributes, type CSSProperties, type ReactNode } from "react";
|
|
2
2
|
import { FontFamily } from "../theme/enums.js";
|
|
3
3
|
import { InputSize, InputVariant } from "./Input.js";
|
|
4
4
|
export interface CopyInputProps extends AriaAttributes {
|
|
5
5
|
/** The text shown in the field and written to the clipboard. It is read-only, so there is no `onChange`. */
|
|
6
6
|
value: string;
|
|
7
|
-
/** Label above the field, rendered through `Field`. It also names the copy button ("Copy Webhook URL"). For a
|
|
7
|
+
/** Label above the field, rendered through `Field`. It also names the copy button ("Copy Webhook URL"). For a horizontal layout or `actions`, wrap the field in `Field`. */
|
|
8
8
|
label?: string;
|
|
9
|
+
/** Hint behind an info icon beside the label, shown in a `Tooltip` (through `Field`). */
|
|
10
|
+
labelTooltip?: string | ReactNode;
|
|
11
|
+
/** Help copy under the label, through `Field`. Text and inline `Link`s only. */
|
|
12
|
+
description?: ReactNode;
|
|
9
13
|
/** Accessible name of the field when there is no visible label (no `label` and no wrapping `Field`). It also names the copy button ("Copy API key"). */
|
|
10
14
|
ariaLabel?: string;
|
|
11
15
|
/**
|
package/dist/inputs/CopyInput.js
CHANGED
|
@@ -23,7 +23,7 @@ import { useMergeRefs } from "@floating-ui/react";
|
|
|
23
23
|
* in-field size in `trailing` (`PasswordInput` owns its trailing slot); an editable value with a
|
|
24
24
|
* copy action is `TextInput` with a `CopyButton` in `trailing`. Replaces 1.x
|
|
25
25
|
* `CopyInput` (the outside button moves inside the field; `width` → `fillWidth`, `isMonospace` →
|
|
26
|
-
* `family
|
|
26
|
+
* `family`; `labelTooltip` and `description` render through the input's own Field since 2.5).
|
|
27
27
|
*/
|
|
28
28
|
/** A read-only field with an in-field copy button: `TextInput isReadOnly` + `CopyButton`. */
|
|
29
29
|
var CopyInput = forwardRef(function CopyInput(props, ref) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AriaAttributes, type CSSProperties } from "react";
|
|
1
|
+
import { type AriaAttributes, type CSSProperties, type ReactNode } from "react";
|
|
2
2
|
/** Canonical rungs; CronInput supports all five (the Input rung table). */
|
|
3
3
|
export declare enum CronInputSize {
|
|
4
4
|
/** 20px field, caption text, 12px icon. */
|
|
@@ -61,8 +61,12 @@ export interface CronInputProps extends AriaAttributes {
|
|
|
61
61
|
* @default false
|
|
62
62
|
*/
|
|
63
63
|
isGhost?: boolean;
|
|
64
|
-
/** Label above the field, rendered through `Field`. For a
|
|
64
|
+
/** Label above the field, rendered through `Field`. For a horizontal layout or `actions`, wrap the input in `Field`. */
|
|
65
65
|
label?: string;
|
|
66
|
+
/** Hint behind an info icon beside the label, shown in a `Tooltip` (through `Field`). */
|
|
67
|
+
labelTooltip?: string | ReactNode;
|
|
68
|
+
/** Help copy under the label, through `Field`. Text and inline `Link`s only. */
|
|
69
|
+
description?: ReactNode;
|
|
66
70
|
/**
|
|
67
71
|
* Shown in the field while the expression is empty. Never the label.
|
|
68
72
|
* @default Select schedule…
|
package/dist/inputs/CronInput.js
CHANGED
|
@@ -535,7 +535,7 @@ var ExpressionSlot = /*#__PURE__*/ styled("div")({
|
|
|
535
535
|
});
|
|
536
536
|
/** The field, the trailing parts and the schedule panel, wired to the nearest Field. */
|
|
537
537
|
function CronInputFrame({ cronProps, forwardedRef, isRoot }) {
|
|
538
|
-
const { value, defaultValue = CRON_INPUT_DEFAULT_VALUE, onChange, presets = CRON_INPUT_DEFAULT_PRESETS, size = "MEDIUM", variant = "PRIMARY", isGhost = false, label: _label, placeholder = "Select schedule…", error, isError = false, isClearable = false, isDisabled = false, isReadOnly = false, isRequired = false, fillWidth = false, ariaLabel, isOpen, defaultIsOpen = false, onOpenChange, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = cronProps;
|
|
538
|
+
const { value, defaultValue = CRON_INPUT_DEFAULT_VALUE, onChange, presets = CRON_INPUT_DEFAULT_PRESETS, size = "MEDIUM", variant = "PRIMARY", isGhost = false, label: _label, labelTooltip: _labelTooltip, description: _description, placeholder = "Select schedule…", error, isError = false, isClearable = false, isDisabled = false, isReadOnly = false, isRequired = false, fillWidth = false, ariaLabel, isOpen, defaultIsOpen = false, onOpenChange, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = cronProps;
|
|
539
539
|
const isBare = useIsBareField();
|
|
540
540
|
const { field, controlId, describedBy, isInvalid, isRequired: isRequiredState, hasName } = useFieldWiring({
|
|
541
541
|
id,
|
|
@@ -878,12 +878,14 @@ function CronInputFrame({ cronProps, forwardedRef, isRoot }) {
|
|
|
878
878
|
}
|
|
879
879
|
/** A five-field cron expression in a field that opens presets and a schedule builder. */
|
|
880
880
|
var CronInput = forwardRef(function CronInput(props, ref) {
|
|
881
|
-
const { label, error, isRequired = false, size = "MEDIUM", fillWidth = false } = props;
|
|
881
|
+
const { label, error, labelTooltip, description, isRequired = false, size = "MEDIUM", fillWidth = false } = props;
|
|
882
882
|
const { id, className, style } = props;
|
|
883
883
|
const ownField = useOwnField({
|
|
884
884
|
componentName: "CronInput",
|
|
885
885
|
label,
|
|
886
886
|
error,
|
|
887
|
+
labelTooltip,
|
|
888
|
+
description,
|
|
887
889
|
isRequired,
|
|
888
890
|
size: CRON_INPUT_SIZE_TO_FIELD_SIZE_MAP[size],
|
|
889
891
|
id,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AriaAttributes, type CSSProperties } from "react";
|
|
1
|
+
import { type AriaAttributes, type CSSProperties, type ReactNode } from "react";
|
|
2
2
|
/** Canonical rungs; DateInput supports all five (the Input rung table). */
|
|
3
3
|
export declare enum DateInputSize {
|
|
4
4
|
/** 20px field, caption text, 12px icon. */
|
|
@@ -74,8 +74,12 @@ interface DateInputBaseProps extends AriaAttributes {
|
|
|
74
74
|
* @default false
|
|
75
75
|
*/
|
|
76
76
|
isGhost?: boolean;
|
|
77
|
-
/** Label above the field, rendered through `Field`. For a
|
|
77
|
+
/** Label above the field, rendered through `Field`. For a horizontal layout or `actions`, wrap the input in `Field`. */
|
|
78
78
|
label?: string;
|
|
79
|
+
/** Hint behind an info icon beside the label, shown in a `Tooltip` (through `Field`). */
|
|
80
|
+
labelTooltip?: string | ReactNode;
|
|
81
|
+
/** Help copy under the label, through `Field`. Text and inline `Link`s only. */
|
|
82
|
+
description?: ReactNode;
|
|
79
83
|
/**
|
|
80
84
|
* Shown in the field while there is no value. Never the label.
|
|
81
85
|
* @default Select date… (Select dates… with isRange)
|
package/dist/inputs/DateInput.js
CHANGED
|
@@ -477,7 +477,7 @@ function monthGrid(view) {
|
|
|
477
477
|
}
|
|
478
478
|
/** The field, the trailing parts and the calendar panel, wired to the nearest Field. */
|
|
479
479
|
function DateInputFrame({ dateProps, forwardedRef, isRoot }) {
|
|
480
|
-
const { isRange = false, value, defaultValue = null, onChange, presets, hasTime = false, min, max, timeZone, format, size = "MEDIUM", variant = "PRIMARY", isGhost = false, label: _label, placeholder, error, isError = false, isClearable = false, isDisabled = false, isReadOnly = false, isRequired = false, fillWidth = false, ariaLabel, isOpen, defaultIsOpen = false, onOpenChange, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = dateProps;
|
|
480
|
+
const { isRange = false, value, defaultValue = null, onChange, presets, hasTime = false, min, max, timeZone, format, size = "MEDIUM", variant = "PRIMARY", isGhost = false, label: _label, labelTooltip: _labelTooltip, description: _description, placeholder, error, isError = false, isClearable = false, isDisabled = false, isReadOnly = false, isRequired = false, fillWidth = false, ariaLabel, isOpen, defaultIsOpen = false, onOpenChange, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = dateProps;
|
|
481
481
|
const isBare = useIsBareField();
|
|
482
482
|
const { field, controlId, describedBy, isInvalid, isRequired: isRequiredState, hasName } = useFieldWiring({
|
|
483
483
|
id,
|
|
@@ -1122,12 +1122,14 @@ var MINUTE_OPTIONS = Array.from({ length: 60 }, (_, minute) => ({
|
|
|
1122
1122
|
}));
|
|
1123
1123
|
/** Choose a date, a date and time, or a range of either, in a field that opens a calendar. */
|
|
1124
1124
|
var DateInput = forwardRef(function DateInput(props, ref) {
|
|
1125
|
-
const { label, error, isRequired = false, size = "MEDIUM", fillWidth = false } = props;
|
|
1125
|
+
const { label, error, labelTooltip, description, isRequired = false, size = "MEDIUM", fillWidth = false } = props;
|
|
1126
1126
|
const { id, className, style } = props;
|
|
1127
1127
|
const ownField = useOwnField({
|
|
1128
1128
|
componentName: "DateInput",
|
|
1129
1129
|
label,
|
|
1130
1130
|
error,
|
|
1131
|
+
labelTooltip,
|
|
1132
|
+
description,
|
|
1131
1133
|
isRequired,
|
|
1132
1134
|
size: DATE_INPUT_SIZE_TO_FIELD_SIZE_MAP[size],
|
|
1133
1135
|
id,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AriaAttributes, type CSSProperties } from "react";
|
|
1
|
+
import { type AriaAttributes, type CSSProperties, type ReactNode } from "react";
|
|
2
2
|
/** Canonical rungs; DurationInput supports all five (the Input rung table). */
|
|
3
3
|
export declare enum DurationInputSize {
|
|
4
4
|
/** 20px field, caption text. */
|
|
@@ -56,8 +56,12 @@ export interface DurationInputProps extends AriaAttributes {
|
|
|
56
56
|
* @default false
|
|
57
57
|
*/
|
|
58
58
|
isGhost?: boolean;
|
|
59
|
-
/** Label above the field, rendered through `Field`. For a
|
|
59
|
+
/** Label above the field, rendered through `Field`. For a horizontal layout or `actions`, wrap the input in `Field`. */
|
|
60
60
|
label?: string;
|
|
61
|
+
/** Hint behind an info icon beside the label, shown in a `Tooltip` (through `Field`). */
|
|
62
|
+
labelTooltip?: string | ReactNode;
|
|
63
|
+
/** Help copy under the label, through `Field`. Text and inline `Link`s only. */
|
|
64
|
+
description?: ReactNode;
|
|
61
65
|
/** Message from the app, shown under the field through `Field`. Also turns the border red and sets `aria-invalid` on each segment. */
|
|
62
66
|
error?: string;
|
|
63
67
|
/**
|
|
@@ -191,7 +191,7 @@ var DISABLED_CSS = "gx-DurationInput-DISABLED_CSS-d1j9h77i";
|
|
|
191
191
|
var FILL_WIDTH_CSS = "gx-DurationInput-FILL_WIDTH_CSS-f4chal5";
|
|
192
192
|
/** The frame and its three segments, wired to the nearest Field (the input's own or the app's). */
|
|
193
193
|
function DurationFrame({ durationProps, forwardedRef, isRoot }) {
|
|
194
|
-
const { value, defaultValue = null, onChange, min = 0, max, size = "MEDIUM", variant = "PRIMARY", isGhost = false, label: _label, error, isError = false, isDisabled = false, isReadOnly = false, isRequired = false, fillWidth = false, ariaLabel, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = durationProps;
|
|
194
|
+
const { value, defaultValue = null, onChange, min = 0, max, size = "MEDIUM", variant = "PRIMARY", isGhost = false, label: _label, labelTooltip: _labelTooltip, description: _description, error, isError = false, isDisabled = false, isReadOnly = false, isRequired = false, fillWidth = false, ariaLabel, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = durationProps;
|
|
195
195
|
const { field, controlId, describedBy, isInvalid, isRequired: isRequiredState, hasName } = useFieldWiring({
|
|
196
196
|
id,
|
|
197
197
|
ariaLabel,
|
|
@@ -409,12 +409,14 @@ function DurationFrame({ durationProps, forwardedRef, isRoot }) {
|
|
|
409
409
|
}
|
|
410
410
|
/** A length of time in hours, minutes and seconds; the value is milliseconds. */
|
|
411
411
|
var DurationInput = forwardRef(function DurationInput(props, ref) {
|
|
412
|
-
const { label, error, isRequired = false, size = "MEDIUM", fillWidth = false } = props;
|
|
412
|
+
const { label, error, labelTooltip, description, isRequired = false, size = "MEDIUM", fillWidth = false } = props;
|
|
413
413
|
const { id, className, style } = props;
|
|
414
414
|
const ownField = useOwnField({
|
|
415
415
|
componentName: "DurationInput",
|
|
416
416
|
label,
|
|
417
417
|
error,
|
|
418
|
+
labelTooltip,
|
|
419
|
+
description,
|
|
418
420
|
isRequired,
|
|
419
421
|
size: DURATION_INPUT_SIZE_TO_FIELD_SIZE_MAP[size],
|
|
420
422
|
id,
|
|
@@ -57,8 +57,12 @@ export interface FileInputProps extends AriaAttributes {
|
|
|
57
57
|
* @default false
|
|
58
58
|
*/
|
|
59
59
|
isGhost?: boolean;
|
|
60
|
-
/** Label above the control, rendered through `Field`. For a
|
|
60
|
+
/** Label above the control, rendered through `Field`. For a horizontal layout or `actions`, wrap it in `Field`. */
|
|
61
61
|
label?: string;
|
|
62
|
+
/** Hint behind an info icon beside the label, shown in a `Tooltip` (through `Field`). */
|
|
63
|
+
labelTooltip?: string | ReactNode;
|
|
64
|
+
/** Help copy under the label (the accepted types and limits), through `Field`. Text and inline `Link`s only. */
|
|
65
|
+
description?: ReactNode;
|
|
62
66
|
/**
|
|
63
67
|
* Text in the drop zone above the button.
|
|
64
68
|
* @default "Drop files here" ("Drop a file here" without isMultiple)
|
package/dist/inputs/FileInput.js
CHANGED
|
@@ -215,7 +215,7 @@ function readDrop(transfer) {
|
|
|
215
215
|
}
|
|
216
216
|
/** The group, the zone and the file list, wired to the nearest Field (the input's own or the app's). */
|
|
217
217
|
function FileGroup({ fileProps, forwardedRef, isRoot }) {
|
|
218
|
-
const { value, defaultValue = [], onChange, onReject, accept, isMultiple = false, renderFileActions, size = "MEDIUM", variant = "PRIMARY", isGhost = false, label: _label, placeholder, error, isError = false, isDisabled = false, isReadOnly = false, isRequired = false, fillWidth = false, ariaLabel, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = fileProps;
|
|
218
|
+
const { value, defaultValue = [], onChange, onReject, accept, isMultiple = false, renderFileActions, size = "MEDIUM", variant = "PRIMARY", isGhost = false, label: _label, labelTooltip: _labelTooltip, description: _description, placeholder, error, isError = false, isDisabled = false, isReadOnly = false, isRequired = false, fillWidth = false, ariaLabel, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = fileProps;
|
|
219
219
|
const { field, controlId: groupId, describedBy: buttonDescribedBy, isInvalid, hasName } = useFieldWiring({
|
|
220
220
|
id,
|
|
221
221
|
ariaLabel,
|
|
@@ -445,11 +445,13 @@ function FileGroup({ fileProps, forwardedRef, isRoot }) {
|
|
|
445
445
|
}
|
|
446
446
|
/** A drop zone and a "Choose files" button over a hidden native file input, with the chosen files listed. */
|
|
447
447
|
var FileInput = forwardRef(function FileInput(props, ref) {
|
|
448
|
-
const { label, error, isRequired = false, size = "MEDIUM", fillWidth = false, id, className, style } = props;
|
|
448
|
+
const { label, error, labelTooltip, description, isRequired = false, size = "MEDIUM", fillWidth = false, id, className, style } = props;
|
|
449
449
|
const ownField = useOwnField({
|
|
450
450
|
componentName: "FileInput",
|
|
451
451
|
label,
|
|
452
452
|
error,
|
|
453
|
+
labelTooltip,
|
|
454
|
+
description,
|
|
453
455
|
isRequired,
|
|
454
456
|
size: FILE_INPUT_SIZE_TO_FIELD_SIZE_MAP[size],
|
|
455
457
|
id,
|
package/dist/inputs/Input.d.ts
CHANGED
|
@@ -60,6 +60,8 @@ interface InputNativeProps {
|
|
|
60
60
|
onBlur?: NativeInputAttributes["onBlur"];
|
|
61
61
|
/** Key-down handler on the `<input>`. Runs before the `onEnter` check; `preventDefault()` skips `onEnter`. */
|
|
62
62
|
onKeyDown?: NativeInputAttributes["onKeyDown"];
|
|
63
|
+
/** Paste handler on the `<input>`. `preventDefault()` keeps the browser from writing the clipboard text, so the app can store it itself (a multi-line secret). */
|
|
64
|
+
onPaste?: NativeInputAttributes["onPaste"];
|
|
63
65
|
}
|
|
64
66
|
export interface InputProps extends AriaAttributes, InputNativeProps {
|
|
65
67
|
/** The native input type. The typed wrappers set it, and apps render a wrapper (`TextInput`). */
|
|
@@ -91,8 +93,12 @@ export interface InputProps extends AriaAttributes, InputNativeProps {
|
|
|
91
93
|
* @default false
|
|
92
94
|
*/
|
|
93
95
|
isGhost?: boolean;
|
|
94
|
-
/** Label above the field, rendered through `Field`. For
|
|
96
|
+
/** Label above the field, rendered through `Field`. For a horizontal layout, a counter or `actions`, wrap the input in `Field`. */
|
|
95
97
|
label?: string;
|
|
98
|
+
/** Hint behind an info icon beside the label, shown in a `Tooltip` (through `Field`). */
|
|
99
|
+
labelTooltip?: string | ReactNode;
|
|
100
|
+
/** Help copy under the label, through `Field`. Text and inline `Link`s only. */
|
|
101
|
+
description?: ReactNode;
|
|
96
102
|
/** Hint shown while the value is empty. It is never the label. */
|
|
97
103
|
placeholder?: string;
|
|
98
104
|
/** Message from the app, shown under the field through `Field`. Also turns the border red and sets `aria-invalid`. */
|
package/dist/inputs/Input.js
CHANGED
|
@@ -32,8 +32,9 @@ import { XIcon } from "@phosphor-icons/react";
|
|
|
32
32
|
*
|
|
33
33
|
* Input never validates, parses, masks or counts: `error` / `isError` come from the app. `type` is
|
|
34
34
|
* required, because apps render a typed wrapper (usually `TextInput`) rather than Input itself.
|
|
35
|
-
* Replaces 1.x `Input` (no longer generic; `parse`, `min`/`max`/`step`, `width`, `
|
|
36
|
-
*
|
|
35
|
+
* Replaces 1.x `Input` (no longer generic; `parse`, `min`/`max`/`step`, `width`, `InputLabel` and
|
|
36
|
+
* the `getInput*` theme helpers are gone; `labelTooltip` and `description` render through the
|
|
37
|
+
* input's own Field since 2.5).
|
|
37
38
|
*/
|
|
38
39
|
/** Canonical rungs; Input supports all five. Shared by the text-like inputs that wrap Input. */
|
|
39
40
|
var InputSize = /* @__PURE__ */ function(InputSize) {
|
|
@@ -233,7 +234,7 @@ var INPUT_SIZE_TO_FIELD_SIZE_MAP = {
|
|
|
233
234
|
};
|
|
234
235
|
/** The frame and the `<input>`, wired to the nearest Field (the Input's own or the app's). */
|
|
235
236
|
function InputFrame({ inputProps, forwardedRef, isRoot }) {
|
|
236
|
-
const { type, value, defaultValue = "", onChange, onEnter, size = "MEDIUM", variant = "PRIMARY", isGhost = false, label: _label, placeholder, error, isError = false, icon, leading, trailing, prefix, suffix, isClearable = false, isDisabled = false, isReadOnly = false, isRequired = false, family = FontFamily.SANS, fillWidth = false, ariaLabel, autoComplete = "off", onKeyDown, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = inputProps;
|
|
237
|
+
const { type, value, defaultValue = "", onChange, onEnter, size = "MEDIUM", variant = "PRIMARY", isGhost = false, label: _label, labelTooltip: _labelTooltip, description: _description, placeholder, error, isError = false, icon, leading, trailing, prefix, suffix, isClearable = false, isDisabled = false, isReadOnly = false, isRequired = false, family = FontFamily.SANS, fillWidth = false, ariaLabel, autoComplete = "off", onKeyDown, id, "aria-describedby": ariaDescribedBy, className, style, ...rest } = inputProps;
|
|
237
238
|
const isBare = useIsBareField();
|
|
238
239
|
const hasPrefix = isFilled(prefix);
|
|
239
240
|
const hasSuffix = isFilled(suffix);
|
|
@@ -350,11 +351,13 @@ function InputFrame({ inputProps, forwardedRef, isRoot }) {
|
|
|
350
351
|
/** The single-line text field frame every text-like input wraps. Apps render `TextInput`. */
|
|
351
352
|
var Input = forwardRef(function Input(props, ref) {
|
|
352
353
|
const { label, error, isRequired = false, size = "MEDIUM", fillWidth = false } = props;
|
|
353
|
-
const { id, className, style } = props;
|
|
354
|
+
const { labelTooltip, description, id, className, style } = props;
|
|
354
355
|
const ownField = useOwnField({
|
|
355
356
|
componentName: "Input",
|
|
356
357
|
label,
|
|
357
358
|
error,
|
|
359
|
+
labelTooltip,
|
|
360
|
+
description,
|
|
358
361
|
isRequired,
|
|
359
362
|
size: INPUT_SIZE_TO_FIELD_SIZE_MAP[size],
|
|
360
363
|
id,
|