@canonical/react-ds-global-form 0.31.0 → 0.32.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/esm/density.css +199 -76
- package/dist/esm/index.css +59 -21
- package/dist/esm/lib/common/Wrapper/ToggleWrapper.css +33 -4
- package/dist/esm/lib/common/Wrapper/ToggleWrapper.js +2 -2
- package/dist/esm/lib/common/Wrapper/ToggleWrapper.js.map +1 -1
- package/dist/esm/lib/common/Wrapper/styles.css +13 -1
- package/dist/esm/lib/common/Wrapper/withToggleWrapper.js +11 -1
- package/dist/esm/lib/common/Wrapper/withToggleWrapper.js.map +1 -1
- package/dist/esm/lib/component/SwitchField/SwitchField.js +6 -1
- package/dist/esm/lib/component/SwitchField/SwitchField.js.map +1 -1
- package/dist/esm/lib/subcomponent/SelectInput/styles.css +32 -4
- package/dist/types/lib/common/Wrapper/ToggleWrapper.d.ts +1 -1
- package/dist/types/lib/common/Wrapper/ToggleWrapper.d.ts.map +1 -1
- package/dist/types/lib/common/Wrapper/withToggleWrapper.d.ts +4 -1
- package/dist/types/lib/common/Wrapper/withToggleWrapper.d.ts.map +1 -1
- package/dist/types/lib/common/Wrapper/withWrapper.d.ts +1 -1
- package/dist/types/lib/common/Wrapper/withWrapper.d.ts.map +1 -1
- package/dist/types/lib/common/types.d.ts +1 -0
- package/dist/types/lib/common/types.d.ts.map +1 -1
- package/dist/types/lib/component/ChoicesField/ChoicesField.d.ts +1 -0
- package/dist/types/lib/component/ChoicesField/ChoicesField.d.ts.map +1 -1
- package/dist/types/lib/component/ColorField/ColorField.d.ts +1 -0
- package/dist/types/lib/component/ColorField/ColorField.d.ts.map +1 -1
- package/dist/types/lib/component/ComboboxField/ComboboxField.d.ts +1 -0
- package/dist/types/lib/component/ComboboxField/ComboboxField.d.ts.map +1 -1
- package/dist/types/lib/component/DateField/DateField.d.ts +1 -0
- package/dist/types/lib/component/DateField/DateField.d.ts.map +1 -1
- package/dist/types/lib/component/DateTimeField/DateTimeField.d.ts +1 -0
- package/dist/types/lib/component/DateTimeField/DateTimeField.d.ts.map +1 -1
- package/dist/types/lib/component/FileUploadField/FileUploadField.d.ts +1 -0
- package/dist/types/lib/component/FileUploadField/FileUploadField.d.ts.map +1 -1
- package/dist/types/lib/component/HiddenField/HiddenField.d.ts +1 -0
- package/dist/types/lib/component/HiddenField/HiddenField.d.ts.map +1 -1
- package/dist/types/lib/component/NumberField/NumberField.d.ts +1 -0
- package/dist/types/lib/component/NumberField/NumberField.d.ts.map +1 -1
- package/dist/types/lib/component/PasswordField/PasswordField.d.ts +1 -0
- package/dist/types/lib/component/PasswordField/PasswordField.d.ts.map +1 -1
- package/dist/types/lib/component/PhoneField/PhoneField.d.ts +1 -0
- package/dist/types/lib/component/PhoneField/PhoneField.d.ts.map +1 -1
- package/dist/types/lib/component/RangeField/RangeField.d.ts +1 -0
- package/dist/types/lib/component/RangeField/RangeField.d.ts.map +1 -1
- package/dist/types/lib/component/RatingField/RatingField.d.ts +1 -0
- package/dist/types/lib/component/RatingField/RatingField.d.ts.map +1 -1
- package/dist/types/lib/component/RichChoicesField/RichChoicesField.d.ts +1 -0
- package/dist/types/lib/component/RichChoicesField/RichChoicesField.d.ts.map +1 -1
- package/dist/types/lib/component/SelectField/SelectField.d.ts +1 -0
- package/dist/types/lib/component/SelectField/SelectField.d.ts.map +1 -1
- package/dist/types/lib/component/SwitchField/SwitchField.d.ts +5 -0
- package/dist/types/lib/component/SwitchField/SwitchField.d.ts.map +1 -1
- package/dist/types/lib/component/TextField/TextField.d.ts +1 -0
- package/dist/types/lib/component/TextField/TextField.d.ts.map +1 -1
- package/dist/types/lib/component/TextareaField/TextareaField.d.ts +1 -0
- package/dist/types/lib/component/TextareaField/TextareaField.d.ts.map +1 -1
- package/dist/types/lib/component/TimeField/TimeField.d.ts +1 -0
- package/dist/types/lib/component/TimeField/TimeField.d.ts.map +1 -1
- package/package.json +14 -14
package/dist/esm/density.css
CHANGED
|
@@ -17,22 +17,25 @@
|
|
|
17
17
|
* (Button/styles.css), reading the same shared --density-* primitives — an app
|
|
18
18
|
* that ships ds-global without the form package still gets a seated button.
|
|
19
19
|
*
|
|
20
|
-
* Text baseline sits round(
|
|
21
|
-
* one baseline.
|
|
20
|
+
* Text baseline sits on the density target — round(nearest, height × 2/3) — so
|
|
21
|
+
* every control shares one baseline index. Controls use the INTRINSIC seat from
|
|
22
|
+
* @canonical/styles (--control-seat-line/-basis): no fixed heights; border +
|
|
23
|
+
* seat pads + line-height add up to the density cell. Zero-JS (cap-unit
|
|
24
|
+
* approximation); holds to the cap tolerance.
|
|
22
25
|
*/
|
|
23
26
|
|
|
24
|
-
/* ──
|
|
25
|
-
*
|
|
26
|
-
* absorbed into
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
/* ── TRANSITIONAL: the fixed-height box (direct date/time chromes only) ──────
|
|
28
|
+
* The ORIGINAL density box: a FIXED grid-multiple height with border-box so the
|
|
29
|
+
* border is absorbed into the height. The composite text family, the select and
|
|
30
|
+
* the textarea have all moved OFF this rule onto the intrinsic seat (their
|
|
31
|
+
* equal-specificity rules further down override it); it still governs the
|
|
32
|
+
* remaining direct chromes — date, time, datetime — whose multi-part UA
|
|
33
|
+
* internals need their own measured pass before they join.
|
|
29
34
|
*
|
|
30
35
|
* Controls no longer carry `.p` — the density system supplies the body font tier
|
|
31
|
-
* (font-size / weight / family) here
|
|
32
|
-
/* NB `.ds.input.textarea` is EXCLUDED:
|
|
33
|
-
*
|
|
34
|
-
* single-line crush below would flatten it. It gets its own placement further
|
|
35
|
-
* down (grid-multiple line-height so every row sits on the grid). */
|
|
36
|
+
* (font-size / weight / family) here. */
|
|
37
|
+
/* NB `.ds.input.textarea` is EXCLUDED: the textarea seats intrinsically (its own
|
|
38
|
+
* rule below) and must keep its multi-row min-height. */
|
|
36
39
|
:is(.comfortable, .dense, .app, .site, .docs) .ds.input:not(.textarea) {
|
|
37
40
|
box-sizing: border-box;
|
|
38
41
|
/* Same effective line-height the target-baseline uses (single source of the
|
|
@@ -107,7 +110,6 @@
|
|
|
107
110
|
font-family: var(--typography-text-primary-font-family);
|
|
108
111
|
}
|
|
109
112
|
|
|
110
|
-
:is(.comfortable, .dense, .app, .site, .docs) .ds.input > input,
|
|
111
113
|
:is(.comfortable, .dense, .app, .site, .docs)
|
|
112
114
|
:is(.ds.field-label, .ds.field-description, .ds.field-error) {
|
|
113
115
|
line-height: 1;
|
|
@@ -127,60 +129,191 @@
|
|
|
127
129
|
padding-block-end: 0;
|
|
128
130
|
}
|
|
129
131
|
|
|
130
|
-
/* ──
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* (
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
:is(.comfortable, .dense, .app, .site, .docs)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
132
|
+
/* ── Intrinsic control seat: the composite text-input family ─────────────────
|
|
133
|
+
* The single-line <input> no longer uses the line-height:1 crush + space-before
|
|
134
|
+
* padding above (that rule is now labels-only). Instead it consumes the SHARED
|
|
135
|
+
* control seat from @canonical/styles (modifiers.density.css): the input's own
|
|
136
|
+
* line box (cell − 2 baselines) is the control interior, `--control-seat-before`
|
|
137
|
+
* seats its baseline on the density target, and the CHROME closes the box with
|
|
138
|
+
* `--control-seat-after` — so the chrome's height is INTRINSIC (no fixed
|
|
139
|
+
* block-size) yet lands exactly on the density cell, both edges on the grid.
|
|
140
|
+
*
|
|
141
|
+
* Placed AFTER the fixed-height box rule above so this (equal-specificity)
|
|
142
|
+
* rule wins for the text family. Direct chromes (select/date/time) and the
|
|
143
|
+
* textarea keep the previous model until their own cutover pass. */
|
|
144
|
+
:is(.comfortable, .dense, .app, .site, .docs)
|
|
145
|
+
.ds.input:is(.text, .number, .password, .phone) {
|
|
146
|
+
/* The COMPOSITE chrome family — every wrapper with an inner <input> leaf
|
|
147
|
+
(text, number, password, phone). One selector, one seat: the wrapper is
|
|
148
|
+
the box, the leaf carries the line. */
|
|
149
|
+
|
|
150
|
+
/* NO drift term here — deliberately. The old ~2px "native input renders low"
|
|
151
|
+
compensation was an artifact of the line-height:1 crush structure: give the
|
|
152
|
+
<input> a real line box (--control-seat-line below) and it renders its text
|
|
153
|
+
exactly like a <span> (measured; see the drift note at the end of this
|
|
154
|
+
file). Subtracting the stale 2px lifted the text 2px too high. */
|
|
155
|
+
|
|
156
|
+
/* The UA enforces a line-height FLOOR of `normal` (1.2em for Ubuntu) on a
|
|
157
|
+
single-line <input> — a specified line-height below it is silently clamped
|
|
158
|
+
(measured: dense's 16px line rendered 16.8px tall, pushing the chrome to
|
|
159
|
+
24.8). So the seat computes with the FLOORED line the UA will actually
|
|
160
|
+
use; the box then closes to the cell exactly in every density cell. */
|
|
161
|
+
--seat-line-floored: max(var(--control-seat-line), 1.2em);
|
|
162
|
+
|
|
163
|
+
/* The chrome's border folds in HERE (a var() inside a custom property
|
|
164
|
+
substitutes at its declaring element, so the shared layer cannot read it).
|
|
165
|
+
Derived from the target directly — not --control-seat-basis — because the
|
|
166
|
+
basis assumes the unfloored line. Both the leaf's top pad and the chrome's
|
|
167
|
+
closing pad read this SAME `--seat-before`, keeping the complement
|
|
168
|
+
consistent. Rounded to ¼px so the pad is exactly representable in 1/64px
|
|
169
|
+
layout units (the fractional 1cap term otherwise leaves ~1/60px residues
|
|
170
|
+
on the box height). */
|
|
171
|
+
--seat-before: round(
|
|
172
|
+
nearest,
|
|
173
|
+
max(
|
|
174
|
+
0px,
|
|
175
|
+
calc(
|
|
176
|
+
var(--density-target-baseline-px, 0px) -
|
|
177
|
+
(var(--seat-line-floored) + 1cap) /
|
|
178
|
+
2 -
|
|
179
|
+
var(--form-input-border-width, 0px)
|
|
180
|
+
)
|
|
181
|
+
),
|
|
182
|
+
0.25px
|
|
183
|
+
);
|
|
184
|
+
--seat-after: max(
|
|
185
|
+
0px,
|
|
186
|
+
calc(
|
|
187
|
+
var(--density-line-height-effective) -
|
|
188
|
+
var(--seat-line-floored) -
|
|
189
|
+
var(--seat-before) -
|
|
190
|
+
2 *
|
|
191
|
+
var(--form-input-border-width, 0px)
|
|
192
|
+
)
|
|
146
193
|
);
|
|
147
|
-
|
|
194
|
+
|
|
195
|
+
block-size: auto;
|
|
196
|
+
min-block-size: 0;
|
|
197
|
+
padding-block-end: var(--seat-after);
|
|
198
|
+
/* Stretch (not the box rule's flex-start): a prefix/suffix — the password's
|
|
199
|
+
reveal-toggle, the number's unit affix — spans the leaf's column and its
|
|
200
|
+
own `align-items: center` centres its icon on the TEXT, which is the
|
|
201
|
+
optical pairing (centring on the box would float it into the asymmetric
|
|
202
|
+
closing pad). The old fixed-height model needed flex-start to top-pin the
|
|
203
|
+
crushed leaf; the intrinsic leaf seats itself, so stretch is safe again. */
|
|
204
|
+
align-items: stretch;
|
|
205
|
+
}
|
|
206
|
+
:is(.comfortable, .dense, .app, .site, .docs)
|
|
207
|
+
.ds.input:is(.text, .number, .password, .phone)
|
|
208
|
+
> input {
|
|
209
|
+
line-height: var(--seat-line-floored);
|
|
210
|
+
padding-block-start: var(--seat-before);
|
|
211
|
+
padding-block-end: 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* ── Textarea: many rows of the SAME intrinsic seat ──────────────────────────
|
|
215
|
+
* The textarea is a single element (it carries the chrome itself), so it seats
|
|
216
|
+
* like the button: the interior line box is `--control-seat-line` — which is a
|
|
217
|
+
* WHOLE baseline multiple in every cell (cell − 2 bU) — so EVERY row advances
|
|
218
|
+
* one grid interval, not just the first. The complement pad closes the box so
|
|
219
|
+
* border + seat-before + N·line + seat-after + border ends on a grid line for
|
|
220
|
+
* ANY row count N: the N-independent part equals (cell − line) ≡ 0 (mod 1 bU).
|
|
221
|
+
* One seat, no multi-line special case.
|
|
222
|
+
*
|
|
223
|
+
* Two deliberate differences from the single-line input:
|
|
224
|
+
* · NO line-height floor — the UA's `normal` clamp is specific to single-line
|
|
225
|
+
* <input>; a textarea honours its specified line-height, and a floored
|
|
226
|
+
* 16.8px line would knock every dense row off the grid.
|
|
227
|
+
* · NO drift term — like the single-line input, the old ~2px knob was an
|
|
228
|
+
* artifact of the crush-era structure (see the drift note below).
|
|
229
|
+
*
|
|
230
|
+
* The previous revision seated the first row via --td-space-before ON TOP of
|
|
231
|
+
* the chrome's 8px block padding, targeting the OLD round(up) table; under the
|
|
232
|
+
* round(nearest) targets that formula clamps to zero in every cell (the full
|
|
233
|
+
* cell line-height puts the natural baseline below the target), which left the
|
|
234
|
+
* textarea unseated entirely. The interior line box makes the target reachable
|
|
235
|
+
* again. */
|
|
236
|
+
:is(.comfortable, .dense, .app, .site, .docs) .ds.input.textarea {
|
|
237
|
+
line-height: var(--control-seat-line);
|
|
148
238
|
font-size: var(--typography-text-primary-font-size);
|
|
149
239
|
font-family: var(--typography-text-primary-font-family);
|
|
150
240
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
wrapper), the textarea IS the chrome: it carries `.ds.input.chrome`, whose
|
|
159
|
-
top border-width occupies layout space above the text even when the top
|
|
160
|
-
border colour is transparent. So subtract that top border — exactly as the
|
|
161
|
-
button subtracts its own — or the first row seats ~1px low versus the
|
|
162
|
-
button/input target. */
|
|
163
|
-
--td-border-top: var(
|
|
164
|
-
--form-input-border-width-top,
|
|
165
|
-
var(--form-input-border-width, 0px)
|
|
241
|
+
--seat-before: round(
|
|
242
|
+
nearest,
|
|
243
|
+
max(
|
|
244
|
+
0px,
|
|
245
|
+
calc(var(--control-seat-basis) - var(--form-input-border-width, 0px))
|
|
246
|
+
),
|
|
247
|
+
0.25px
|
|
166
248
|
);
|
|
167
|
-
--
|
|
249
|
+
--seat-after: max(
|
|
168
250
|
0px,
|
|
169
251
|
calc(
|
|
170
|
-
var(--density-
|
|
171
|
-
var(--
|
|
172
|
-
var(--
|
|
173
|
-
|
|
252
|
+
var(--density-line-height-effective) -
|
|
253
|
+
var(--control-seat-line) -
|
|
254
|
+
var(--seat-before) -
|
|
255
|
+
2 *
|
|
256
|
+
var(--form-input-border-width, 0px)
|
|
174
257
|
)
|
|
175
258
|
);
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
padding-block
|
|
179
|
-
|
|
180
|
-
|
|
259
|
+
|
|
260
|
+
block-size: auto;
|
|
261
|
+
padding-block: var(--seat-before) var(--seat-after);
|
|
262
|
+
/* Five whole rows + the closing geometry (border-box), so the default box
|
|
263
|
+
ends on-grid with the last row fully visible: 4·line + cell. */
|
|
264
|
+
min-block-size: calc(
|
|
265
|
+
4 *
|
|
266
|
+
var(--control-seat-line) +
|
|
267
|
+
var(--density-line-height-effective)
|
|
181
268
|
);
|
|
182
269
|
}
|
|
183
270
|
|
|
271
|
+
/* ── Select: a single-element direct chrome on the intrinsic seat ────────────
|
|
272
|
+
* The <select> IS the chrome (border and text on one element), so it seats
|
|
273
|
+
* like the button: interior line box + seat pads, height emerging as exactly
|
|
274
|
+
* the density cell. Replaces the old fixed-height + 8px-block-padding path,
|
|
275
|
+
* which never seated the option text at all and CLIPPED it in apps/dense
|
|
276
|
+
* (24px fixed box − 8px pad left too little room for the line).
|
|
277
|
+
* The line is floored like the single-line input's: a <select> shows one line,
|
|
278
|
+
* so if the UA imposes a `normal` floor the formula already matches it, and if
|
|
279
|
+
* it does not the specified floor is simply what renders — correct either way
|
|
280
|
+
* (unlike the textarea, where flooring would break the multi-row rhythm).
|
|
281
|
+
* Remaining direct chromes (date/time/datetime) stay on the previous model
|
|
282
|
+
* until their own pass — their multi-part UA internals need their own
|
|
283
|
+
* measurement. */
|
|
284
|
+
:is(.comfortable, .dense, .app, .site, .docs) .ds.input.select {
|
|
285
|
+
--seat-line-floored: max(var(--control-seat-line), 1.2em);
|
|
286
|
+
line-height: var(--seat-line-floored);
|
|
287
|
+
|
|
288
|
+
--seat-before: round(
|
|
289
|
+
nearest,
|
|
290
|
+
max(
|
|
291
|
+
0px,
|
|
292
|
+
calc(
|
|
293
|
+
var(--density-target-baseline-px, 0px) -
|
|
294
|
+
(var(--seat-line-floored) + 1cap) /
|
|
295
|
+
2 -
|
|
296
|
+
var(--form-input-border-width, 0px)
|
|
297
|
+
)
|
|
298
|
+
),
|
|
299
|
+
0.25px
|
|
300
|
+
);
|
|
301
|
+
--seat-after: max(
|
|
302
|
+
0px,
|
|
303
|
+
calc(
|
|
304
|
+
var(--density-line-height-effective) -
|
|
305
|
+
var(--seat-line-floored) -
|
|
306
|
+
var(--seat-before) -
|
|
307
|
+
2 *
|
|
308
|
+
var(--form-input-border-width, 0px)
|
|
309
|
+
)
|
|
310
|
+
);
|
|
311
|
+
|
|
312
|
+
block-size: auto;
|
|
313
|
+
min-block-size: 0;
|
|
314
|
+
padding-block: var(--seat-before) var(--seat-after);
|
|
315
|
+
}
|
|
316
|
+
|
|
184
317
|
/* ── Bottom rhythm: density-seated flow text only (NOT prose) ─────────────────
|
|
185
318
|
* A BORDERED control (button, input wrapper) has a fixed `block-size` that is
|
|
186
319
|
* already a whole baseline multiple, so its bottom rhythm is the box height —
|
|
@@ -211,24 +344,14 @@
|
|
|
211
344
|
);
|
|
212
345
|
}
|
|
213
346
|
|
|
214
|
-
/* ──
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
* It feeds the SAME `--border-top-width` term the shared placement formula reads
|
|
227
|
-
* (a larger subtraction ⇒ less space-before ⇒ text lifts UP). Doing it this way —
|
|
228
|
-
* rather than adding a separate term to the shared formula — keeps the BUTTON's
|
|
229
|
-
* placement byte-identical to its known-good state: the button never sets this
|
|
230
|
-
* knob, so its `--border-top-width` stays the pure border calc above. */
|
|
231
|
-
:where(.comfortable, .dense, .app, .site, .docs) .ds.input > input {
|
|
232
|
-
--control-text-drift-AVOID-USAGE: 2px;
|
|
233
|
-
--border-top-width: var(--control-text-drift-AVOID-USAGE);
|
|
234
|
-
}
|
|
347
|
+
/* ── The native-control text drift — RESOLVED for single-line inputs ──────────
|
|
348
|
+
* The old ~2px "native <input> renders its text lower than a <span> at
|
|
349
|
+
* byte-identical CSS" compensation (--control-text-drift-AVOID-USAGE) turned
|
|
350
|
+
* out to be an artifact of the line-height:1 crush structure, NOT an inherent
|
|
351
|
+
* UA quirk: with a real line box (line-height: --control-seat-line, the
|
|
352
|
+
* intrinsic seat above) the <input> positions its text exactly like a <span>
|
|
353
|
+
* (measured: input baseline == label baseline to 0.01px with no drift term).
|
|
354
|
+
* That answers TODO(#15)'s "find the structural cause and delete it": the
|
|
355
|
+
* intrinsic seat carries NO drift anywhere — the textarea's local copy went
|
|
356
|
+
* with its old parallel seat when it joined the intrinsic model. The knob no
|
|
357
|
+
* longer exists in this file. */
|
package/dist/esm/index.css
CHANGED
|
@@ -39,12 +39,19 @@
|
|
|
39
39
|
then tune each axis independently, and the names stay honest):
|
|
40
40
|
BLOCK (vertical): field-block-gap · field-label-gap · group-gap
|
|
41
41
|
INLINE (horizontal): field-inline-gap */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
/* No-density-class defaults — mirror the density matrix's app/comfortable cell
|
|
43
|
+
(F-O4, 15/07 review). The density-scoped block further down re-derives these
|
|
44
|
+
per cell when a context/density class is present. */
|
|
45
|
+
--form-field-block-gap: calc(
|
|
46
|
+
var(--baseline-height) *
|
|
47
|
+
10
|
|
48
|
+
); /* 40px — block: gap BETWEEN fields */
|
|
45
49
|
--form-field-label-gap: var(
|
|
46
|
-
--
|
|
47
|
-
); /*
|
|
50
|
+
--space-100
|
|
51
|
+
); /* 8px — block: gap from a field's LABEL down to its control */
|
|
52
|
+
--form-field-label-description-gap: var(
|
|
53
|
+
--space-050
|
|
54
|
+
); /* 4px — block: gap from a LABEL down to a leading description */
|
|
48
55
|
--form-group-gap: var(
|
|
49
56
|
--space-100
|
|
50
57
|
); /* 8px — block: gap from desc/error to the input */
|
|
@@ -123,7 +130,10 @@
|
|
|
123
130
|
|
|
124
131
|
/* ── Description ────────────────────────────────────────────────── */
|
|
125
132
|
|
|
126
|
-
|
|
133
|
+
/* Description reads the SECONDARY type ramp (design review): it is subordinate
|
|
134
|
+
supporting text, so it takes the smaller secondary size, not the primary
|
|
135
|
+
body size. Colour is already the muted token. */
|
|
136
|
+
--form-description-font-size: var(--typography-text-secondary-font-size);
|
|
127
137
|
--form-description-color: var(--color-text-muted);
|
|
128
138
|
|
|
129
139
|
/* ── Error ──────────────────────────────────────────────────────── */
|
|
@@ -137,7 +147,10 @@
|
|
|
137
147
|
--form-input-border-color-error: var(--color-border-error);
|
|
138
148
|
--form-input-background-disabled: var(--color-foreground-input-disabled);
|
|
139
149
|
--form-input-color-disabled: var(--disabled--color-text);
|
|
140
|
-
|
|
150
|
+
/* Design review (15/07): a disabled control shows no border. Default the
|
|
151
|
+
* disabled border to transparent; a theme wanting a visible disabled border
|
|
152
|
+
* can still override this token (e.g. back to `--disabled--color-border`). */
|
|
153
|
+
--form-input-border-color-disabled: transparent;
|
|
141
154
|
|
|
142
155
|
/* ── Focus ring ─────────────────────────────────────────────────── */
|
|
143
156
|
|
|
@@ -160,22 +173,30 @@
|
|
|
160
173
|
* INLINE (horizontal): control padding + label↔input / prefix-suffix gap
|
|
161
174
|
* → --density-padding-inline
|
|
162
175
|
* BLOCK (vertical), by magnitude:
|
|
163
|
-
* between-fields
|
|
164
|
-
* label → control
|
|
165
|
-
* desc/error → input → --density-space-sm
|
|
166
|
-
*
|
|
176
|
+
* between-fields → --density-space-lg (widest structural gap, 40px app)
|
|
177
|
+
* label → control → --density-space-md (label to its own control, 8px app)
|
|
178
|
+
* desc/error → input → --density-space-sm (tight annotation gap, 8px)
|
|
179
|
+
* label → description → --density-space-xs (tightest, 4px)
|
|
180
|
+
* All rungs are whole baseline multiples, so vertical rhythm holds.
|
|
181
|
+
* (space-md/-lg were retuned + space-xs added per the 15/07 review — F-O4;
|
|
182
|
+
* the density matrix now carries Diana's numbers directly, so the form maps
|
|
183
|
+
* straight onto the rungs rather than pinning literals.) */
|
|
167
184
|
:where(.comfortable, .dense, .app, .site, .docs) {
|
|
168
185
|
--form-input-padding-inline: var(--density-padding-inline, var(--space-200));
|
|
169
186
|
--form-field-inline-gap: var(--density-padding-inline, var(--space-200));
|
|
170
187
|
--form-field-block-gap: var(
|
|
171
188
|
--density-space-lg,
|
|
172
|
-
calc(var(--baseline-height) *
|
|
189
|
+
calc(var(--baseline-height) * 10)
|
|
173
190
|
);
|
|
174
191
|
--form-field-label-gap: var(
|
|
175
192
|
--density-space-md,
|
|
176
|
-
calc(var(--baseline-height) *
|
|
193
|
+
calc(var(--baseline-height) * 2)
|
|
177
194
|
);
|
|
178
195
|
--form-group-gap: var(--density-space-sm, calc(var(--baseline-height) * 2));
|
|
196
|
+
--form-field-label-description-gap: var(
|
|
197
|
+
--density-space-xs,
|
|
198
|
+
calc(var(--baseline-height) * 1)
|
|
199
|
+
);
|
|
179
200
|
}
|
|
180
201
|
|
|
181
202
|
/* ── .ds.input.chrome — shared input chrome ─────────────────────────
|
|
@@ -266,11 +287,18 @@
|
|
|
266
287
|
box-shadow: 0 0 0 1px var(--form-focus-ring-color);
|
|
267
288
|
}
|
|
268
289
|
|
|
290
|
+
/* Disabled — per design review (15/07): a disabled control needs no border.
|
|
291
|
+
* The border BOX is kept (transparent) so the border-box height is unchanged
|
|
292
|
+
* and a disabled control lines up with an enabled one; only the paint is
|
|
293
|
+
* dropped. `--form-input-border-color-disabled` defaults to transparent (see
|
|
294
|
+
* :root) but stays a themeable override point. The background + muted text
|
|
295
|
+
* carry the disabled affordance instead. */
|
|
269
296
|
&:disabled,
|
|
270
297
|
&:has(input:disabled) {
|
|
271
298
|
border-color: var(--form-input-border-color-disabled);
|
|
272
299
|
border-top-color: var(--form-input-border-color-disabled);
|
|
273
300
|
border-right-color: var(--form-input-border-color-disabled);
|
|
301
|
+
border-bottom-color: var(--form-input-border-color-disabled);
|
|
274
302
|
border-left-color: var(--form-input-border-color-disabled);
|
|
275
303
|
background-color: var(--form-input-background-disabled);
|
|
276
304
|
color: var(--form-input-color-disabled);
|
|
@@ -279,12 +307,19 @@
|
|
|
279
307
|
}
|
|
280
308
|
|
|
281
309
|
/* ── Danger ──────────────────────────────────────────────────────────
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
|
|
310
|
+
* Per design review (15/07): a validation colour change must be confined to the
|
|
311
|
+
* validation MESSAGE and the input's BOTTOM border — it must not repaint the
|
|
312
|
+
* label or the full box outline. So the general label recolour is gone; the
|
|
313
|
+
* error signal on a normal bordered input is carried by its bottom border alone
|
|
314
|
+
* (below), and the FieldError message carries the error colour in its own text.
|
|
315
|
+
*
|
|
316
|
+
* EXCEPTION — the borderless choices fieldset. A choices group (radios/checkboxes)
|
|
317
|
+
* has no single input border to paint (each option is its own borderless control),
|
|
318
|
+
* so its `<legend>` (a `.ds.field-label`) is the ONLY place an error can be shown
|
|
319
|
+
* without lighting up every option box. Such a group renders its Wrapper label as
|
|
320
|
+
* a `<legend>` (the `mockLabel` path), so the recolour is SCOPED to a legend
|
|
321
|
+
* label — a normal field's `<label>` is untouched. */
|
|
322
|
+
.danger > legend.ds.field-label {
|
|
288
323
|
color: var(--form-error-color);
|
|
289
324
|
|
|
290
325
|
/* The required "*" marker recolours WITH the label (it pins its own colour to
|
|
@@ -296,9 +331,12 @@
|
|
|
296
331
|
}
|
|
297
332
|
}
|
|
298
333
|
|
|
299
|
-
/* Input chrome: bottom border
|
|
334
|
+
/* Input chrome: recolour ONLY the bottom border (the base theme keeps the other
|
|
335
|
+
* three sides transparent). Setting the bottom-border override token — not the
|
|
336
|
+
* four-side `border-color` shorthand — means the error signal cannot bleed onto
|
|
337
|
+
* the top/right/left sides. Focus still lights all four (below). */
|
|
300
338
|
.danger > .payload .ds.input.chrome {
|
|
301
|
-
border-color: var(--form-input-border-color-error);
|
|
339
|
+
--form-input-border-color-bottom: var(--form-input-border-color-error);
|
|
302
340
|
}
|
|
303
341
|
|
|
304
342
|
.danger > .payload .ds.input.chrome:focus-visible,
|
|
@@ -11,15 +11,36 @@
|
|
|
11
11
|
padding: 0;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
/* Control row: the
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
/* Control row: the control centres on the label's FIRST line, and a multi-line
|
|
15
|
+
(sentence) label wraps below — never centring the box on the whole paragraph
|
|
16
|
+
(AV-325). `align-items: start` tops the row so wrapped lines flow under the
|
|
17
|
+
first; the control is then nudged down half a line-box to sit centred on the
|
|
18
|
+
first line (see the control rule below). The first-line box is one density
|
|
19
|
+
line-height (`--density-line-height-effective`, set on the density scope;
|
|
20
|
+
falls back to `1lh` outside a density context). */
|
|
17
21
|
& > .field-toggle-control {
|
|
22
|
+
--toggle-control-line: var(--density-line-height-effective, 1lh);
|
|
23
|
+
|
|
18
24
|
display: flex;
|
|
19
25
|
flex-direction: row;
|
|
20
|
-
align-items:
|
|
26
|
+
align-items: start;
|
|
21
27
|
column-gap: var(--form-field-inline-gap);
|
|
22
28
|
|
|
29
|
+
/* Every direct child that ISN'T the label is the control (checkbox / switch
|
|
30
|
+
input): a fixed 16px-tall box (--dimension-200 — checkbox 16×16, switch
|
|
31
|
+
track 16 high). Centre it on the first line by pushing it down half the
|
|
32
|
+
leftover between the line-box and the control's own height. The control
|
|
33
|
+
keeps its intrinsic size — only its vertical offset changes, so the click
|
|
34
|
+
target is untouched. */
|
|
35
|
+
& > :not(.ds.field-label) {
|
|
36
|
+
--toggle-control-size: var(--dimension-200);
|
|
37
|
+
align-self: start;
|
|
38
|
+
margin-block-start: max(
|
|
39
|
+
0px,
|
|
40
|
+
calc((var(--toggle-control-line) - var(--toggle-control-size)) / 2)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
23
44
|
/* The control label is often a full clickable sentence, so it reads as
|
|
24
45
|
regular body prose (not the bold heading weight the field label uses by
|
|
25
46
|
default): normal weight, left-aligned, pointer cursor, and it takes the
|
|
@@ -31,5 +52,13 @@
|
|
|
31
52
|
text-align: start;
|
|
32
53
|
cursor: pointer;
|
|
33
54
|
}
|
|
55
|
+
|
|
56
|
+
/* Label BEFORE the control (switch convention): the DOM stays
|
|
57
|
+
control-then-label for accessibility, so `row-reverse` moves the control
|
|
58
|
+
to the trailing (right) edge and the label to the leading (left) edge.
|
|
59
|
+
Logical `row-reverse` mirrors correctly in RTL. */
|
|
60
|
+
&.label-before {
|
|
61
|
+
flex-direction: row-reverse;
|
|
62
|
+
}
|
|
34
63
|
}
|
|
35
64
|
}
|
|
@@ -22,7 +22,7 @@ const componentCssClassName = "ds field field-toggle";
|
|
|
22
22
|
*
|
|
23
23
|
* `import { ToggleWrapper } from "@canonical/react-ds-global-form";`
|
|
24
24
|
*/
|
|
25
|
-
const ToggleWrapper = ({ id, className, style, name, Component, description, label, controlLabel, isOptional, requiredIndicator, registerProps: userRegisterProps, nestedRegisterProps, unregisterOnUnmount, ...otherProps }) => {
|
|
25
|
+
const ToggleWrapper = ({ id, className, style, name, Component, description, label, controlLabel, labelPosition = "after", isOptional, requiredIndicator, registerProps: userRegisterProps, nestedRegisterProps, unregisterOnUnmount, ...otherProps }) => {
|
|
26
26
|
// The inline label (beside the control) always carries the htmlFor binding;
|
|
27
27
|
// the heading only appears when a distinct controlLabel was supplied. At
|
|
28
28
|
// least one of `label`/`controlLabel` is guaranteed by the type of the toggle
|
|
@@ -46,7 +46,7 @@ const ToggleWrapper = ({ id, className, style, name, Component, description, lab
|
|
|
46
46
|
};
|
|
47
47
|
return (_jsxs("div", { id: id, style: style, className: [componentCssClassName, className, isError && states.Danger]
|
|
48
48
|
.filter(Boolean)
|
|
49
|
-
.join(" "), children: [headingLabel && (_jsx(Label, { name: name, tag: "legend", className: "field-toggle-heading", children: headingLabel })), _jsxs("div", { className: "field-toggle-control", children: [_jsx(Component, { ...componentProps }), _jsx(Label, { name: name, isOptional: isOptional, requiredIndicator: requiredIndicator, ...ariaProps.label, children: inlineLabel })] }), description && (_jsx(Description, { ...ariaProps.description, children: description })), isError && (_jsx(FieldError, { ...ariaProps.error, children: fieldError?.message?.toString() }))] }));
|
|
49
|
+
.join(" "), children: [headingLabel && (_jsx(Label, { name: name, tag: "legend", className: "field-toggle-heading", children: headingLabel })), _jsxs("div", { className: ["field-toggle-control", `label-${labelPosition}`].join(" "), children: [_jsx(Component, { ...componentProps }), _jsx(Label, { name: name, isOptional: isOptional, requiredIndicator: requiredIndicator, ...ariaProps.label, children: inlineLabel })] }), description && (_jsx(Description, { ...ariaProps.description, children: description })), isError && (_jsx(FieldError, { ...ariaProps.error, children: fieldError?.message?.toString() }))] }));
|
|
50
50
|
};
|
|
51
51
|
export default ToggleWrapper;
|
|
52
52
|
//# sourceMappingURL=ToggleWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleWrapper.js","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/ToggleWrapper.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EACL,WAAW,EACX,KAAK,IAAI,UAAU,EACnB,KAAK,GACN,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,cAAc,CAAC;AACtB,OAAO,qBAAqB,CAAC;AAE7B,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAEtD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,aAAa,GAAG,CAAwC,EAC5D,EAAE,EACF,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,SAAS,EACT,WAAW,EACX,KAAK,EACL,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,aAAa,EAAE,iBAAiB,EAChC,mBAAmB,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,YAC7D,YAAY,GACP,CACT,EAOD,eACE,SAAS,EAAE,CAAC,sBAAsB,EAAE,SAAS,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAEvE,KAAC,SAAS,OAAK,cAAc,GAAI,EACjC,KAAC,KAAK,IACJ,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,KAChC,SAAS,CAAC,KAAK,YAElB,WAAW,GACN,IACJ,EAGL,WAAW,IAAI,CACd,KAAC,WAAW,OAAK,SAAS,CAAC,WAAW,YAAG,WAAW,GAAe,CACpE,EAEA,OAAO,IAAI,CACV,KAAC,UAAU,OAAK,SAAS,CAAC,KAAK,YAC5B,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,GACrB,CACd,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -3,10 +3,22 @@
|
|
|
3
3
|
grid-template-columns: subgrid;
|
|
4
4
|
grid-column: var(--form-field-columns, 1 / -1);
|
|
5
5
|
/* Vertical gap from the label row down to the payload row. Uses the block-axis
|
|
6
|
-
label-gap token — NOT --form-field-inline-gap (that is horizontal-only now).
|
|
6
|
+
label-gap token — NOT --form-field-inline-gap (that is horizontal-only now).
|
|
7
|
+
Default is the label→control gap (--form-field-label-gap, 8px); when a
|
|
8
|
+
description LEADS the payload the row below tightens it to the label→
|
|
9
|
+
description gap (--form-field-label-description-gap, 4px), per the 15/07
|
|
10
|
+
review's field-spacing spec. */
|
|
7
11
|
row-gap: var(--form-field-label-gap);
|
|
8
12
|
align-items: baseline;
|
|
9
13
|
|
|
14
|
+
/* Label sits closer to a leading description than to a bare control. */
|
|
15
|
+
&:has(> .payload > .ds.field-description:first-child) {
|
|
16
|
+
row-gap: var(
|
|
17
|
+
--form-field-label-description-gap,
|
|
18
|
+
var(--form-field-label-gap)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
10
22
|
& > .ds.field-label {
|
|
11
23
|
grid-column: var(--form-label-columns, 1 / -1);
|
|
12
24
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import ToggleWrapper from "./ToggleWrapper.js";
|
|
2
3
|
import withWrapper from "./withWrapper.js";
|
|
3
4
|
/**
|
|
@@ -7,8 +8,17 @@ import withWrapper from "./withWrapper.js";
|
|
|
7
8
|
* here — in the HOC's return type — keeps it out of the shared `withWrapper`
|
|
8
9
|
* generics, which would otherwise widen the union back to all-optional.
|
|
9
10
|
*
|
|
11
|
+
* `defaults` are per-field defaults (e.g. SwitchField's `labelPosition: "before"`).
|
|
12
|
+
* They are spread UNDER the caller's props, so a consumer can still override them.
|
|
13
|
+
*
|
|
10
14
|
* `import { withToggleWrapper } from "@canonical/react-ds-global-form";`
|
|
11
15
|
*/
|
|
12
|
-
const withToggleWrapper = (Component) =>
|
|
16
|
+
const withToggleWrapper = (Component, defaults) => {
|
|
17
|
+
const Wrapped = withWrapper(Component, undefined, ToggleWrapper);
|
|
18
|
+
if (!defaults)
|
|
19
|
+
return Wrapped;
|
|
20
|
+
const WithDefaults = (props) => (_jsx(Wrapped, { ...defaults, ...props }));
|
|
21
|
+
return WithDefaults;
|
|
22
|
+
};
|
|
13
23
|
export default withToggleWrapper;
|
|
14
24
|
//# sourceMappingURL=withToggleWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withToggleWrapper.js","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/withToggleWrapper.
|
|
1
|
+
{"version":3,"file":"withToggleWrapper.js","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/withToggleWrapper.tsx"],"names":[],"mappings":";AAMA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAa3C;;;;;;;;;;;GAWG;AACH,MAAM,iBAAiB,GAAG,CACxB,SAAwC,EACxC,QAAsD,EACd,EAAE;IAC1C,MAAM,OAAO,GAAG,WAAW,CACzB,SAAS,EACT,SAAS,EACT,aAAa,CAC4B,CAAC;IAC5C,IAAI,CAAC,QAAQ;QAAE,OAAO,OAAO,CAAC;IAC9B,MAAM,YAAY,GAA2C,CAAC,KAAK,EAAE,EAAE,CAAC,CACtE,KAAC,OAAO,OAAK,QAAQ,KAAM,KAAK,GAAI,CACrC,CAAC;IACF,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -7,7 +7,12 @@ import { SwitchInput } from "../../subcomponent/SwitchInput/index.js";
|
|
|
7
7
|
* middleware/conditional-display support. Requires at least one of
|
|
8
8
|
* `label`/`controlLabel`.
|
|
9
9
|
*
|
|
10
|
+
* The label defaults to the LEFT of the switch (`labelPosition: "before"`): a
|
|
11
|
+
* label before a switch names its purpose, which is the switch convention (a
|
|
12
|
+
* label after would read as the switch's state). Callers can override with
|
|
13
|
+
* `labelPosition="after"`.
|
|
14
|
+
*
|
|
10
15
|
* `import { SwitchField } from "@canonical/react-ds-global-form";`
|
|
11
16
|
*/
|
|
12
|
-
export default withToggleWrapper(bindField(SwitchInput, "native"));
|
|
17
|
+
export default withToggleWrapper(bindField(SwitchInput, "native"), { labelPosition: "before" });
|
|
13
18
|
//# sourceMappingURL=SwitchField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchField.js","sourceRoot":"","sources":["../../../../../src/lib/component/SwitchField/SwitchField.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iCAAiC,CAAC;AAExD,OAAO,iBAAiB,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAItE
|
|
1
|
+
{"version":3,"file":"SwitchField.js","sourceRoot":"","sources":["../../../../../src/lib/component/SwitchField/SwitchField.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iCAAiC,CAAC;AAExD,OAAO,iBAAiB,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAItE;;;;;;;;;;;;GAYG;AACH,eAAe,iBAAiB,CAC9B,SAAS,CAAwB,WAAW,EAAE,QAAQ,CAAC,EACvD,EAAE,aAAa,EAAE,QAAQ,EAAE,CAC5B,CAAC"}
|
|
@@ -1,10 +1,38 @@
|
|
|
1
|
-
/* Chevron indicator
|
|
1
|
+
/* Chevron indicator, painted with CSS gradients so it takes the theme colour.
|
|
2
|
+
* A `background-image` SVG cannot be recoloured by CSS (no inheritance into
|
|
3
|
+
* the image document), which left the caret black on dark themes — the same
|
|
4
|
+
* reason the checkbox/accordion glyphs are masks. A <select> is a replaced
|
|
5
|
+
* element with no ::before/::after to mask, so the chevron is drawn instead:
|
|
6
|
+
* two diagonally-striped gradient squares butted together form a down-chevron
|
|
7
|
+
* STROKE (transparent → colour → transparent along each diagonal), coloured by
|
|
8
|
+
* --color-icon like every other control glyph. */
|
|
2
9
|
.ds.input.select {
|
|
3
10
|
appearance: none;
|
|
4
|
-
|
|
11
|
+
--select-caret-color: var(--color-icon, currentColor);
|
|
12
|
+
--select-caret-half: 0.4em; /* each square; the chevron is two halves wide */
|
|
13
|
+
/* left half: rising stroke ╱ */
|
|
14
|
+
background-image:
|
|
15
|
+
linear-gradient(
|
|
16
|
+
45deg,
|
|
17
|
+
transparent 42%,
|
|
18
|
+
var(--select-caret-color) 42%,
|
|
19
|
+
var(--select-caret-color) 58%,
|
|
20
|
+
transparent 58%
|
|
21
|
+
),
|
|
22
|
+
/* right half: falling stroke ╲ */
|
|
23
|
+
linear-gradient(
|
|
24
|
+
135deg,
|
|
25
|
+
transparent 42%,
|
|
26
|
+
var(--select-caret-color) 42%,
|
|
27
|
+
var(--select-caret-color) 58%,
|
|
28
|
+
transparent 58%
|
|
29
|
+
);
|
|
5
30
|
background-repeat: no-repeat;
|
|
6
|
-
background-position:
|
|
7
|
-
|
|
31
|
+
background-position:
|
|
32
|
+
right calc(var(--form-input-padding-inline) + var(--select-caret-half))
|
|
33
|
+
center,
|
|
34
|
+
right var(--form-input-padding-inline) center;
|
|
35
|
+
background-size: var(--select-caret-half) var(--select-caret-half);
|
|
8
36
|
/* This element IS the text-bearing leaf, so it carries the inline padding
|
|
9
37
|
* (`.ds.input.chrome` provides only the block padding). The end side leaves
|
|
10
38
|
* room for the chevron. */
|
|
@@ -19,6 +19,6 @@ import "./ToggleWrapper.css";
|
|
|
19
19
|
*
|
|
20
20
|
* `import { ToggleWrapper } from "@canonical/react-ds-global-form";`
|
|
21
21
|
*/
|
|
22
|
-
declare const ToggleWrapper: <ComponentProps extends BaseInputProps>({ id, className, style, name, Component, description, label, controlLabel, isOptional, requiredIndicator, registerProps: userRegisterProps, nestedRegisterProps, unregisterOnUnmount, ...otherProps }: WrapperProps<ComponentProps>) => React.ReactElement;
|
|
22
|
+
declare const ToggleWrapper: <ComponentProps extends BaseInputProps>({ id, className, style, name, Component, description, label, controlLabel, labelPosition, isOptional, requiredIndicator, registerProps: userRegisterProps, nestedRegisterProps, unregisterOnUnmount, ...otherProps }: WrapperProps<ComponentProps>) => React.ReactElement;
|
|
23
23
|
export default ToggleWrapper;
|
|
24
24
|
//# sourceMappingURL=ToggleWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/ToggleWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,cAAc,CAAC;AACtB,OAAO,qBAAqB,CAAC;AAI7B;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,aAAa,GAAI,cAAc,SAAS,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"ToggleWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/ToggleWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,cAAc,CAAC;AACtB,OAAO,qBAAqB,CAAC;AAI7B;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,aAAa,GAAI,cAAc,SAAS,cAAc,EAAE,sNAkB3D,YAAY,CAAC,cAAc,CAAC,KAAG,KAAK,CAAC,YA0EvC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -13,8 +13,11 @@ type ToggleWrapperProps<ComponentProps extends BaseInputProps> = Omit<WrapperPro
|
|
|
13
13
|
* here — in the HOC's return type — keeps it out of the shared `withWrapper`
|
|
14
14
|
* generics, which would otherwise widen the union back to all-optional.
|
|
15
15
|
*
|
|
16
|
+
* `defaults` are per-field defaults (e.g. SwitchField's `labelPosition: "before"`).
|
|
17
|
+
* They are spread UNDER the caller's props, so a consumer can still override them.
|
|
18
|
+
*
|
|
16
19
|
* `import { withToggleWrapper } from "@canonical/react-ds-global-form";`
|
|
17
20
|
*/
|
|
18
|
-
declare const withToggleWrapper: <ComponentProps extends BaseInputProps>(Component: ComponentType<ComponentProps
|
|
21
|
+
declare const withToggleWrapper: <ComponentProps extends BaseInputProps>(Component: ComponentType<ComponentProps>, defaults?: Partial<ToggleWrapperProps<ComponentProps>>) => FC<ToggleWrapperProps<ComponentProps>>;
|
|
19
22
|
export default withToggleWrapper;
|
|
20
23
|
//# sourceMappingURL=withToggleWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withToggleWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/withToggleWrapper.
|
|
1
|
+
{"version":3,"file":"withToggleWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/withToggleWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACb,MAAM,aAAa,CAAC;AAIrB;;;;GAIG;AACH,KAAK,kBAAkB,CAAC,cAAc,SAAS,cAAc,IAAI,IAAI,CACnE,YAAY,CAAC,cAAc,CAAC,EAC5B,WAAW,GAAG,OAAO,GAAG,cAAc,CACvC,GACC,gBAAgB,CAAC;AAEnB;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,iBAAiB,GAAI,cAAc,SAAS,cAAc,EAC9D,WAAW,aAAa,CAAC,cAAc,CAAC,EACxC,WAAW,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC,KACrD,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAWvC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -3,6 +3,6 @@ import type { BaseInputProps, BaseWrapperProps, Condition, WrappedComponentProps
|
|
|
3
3
|
type WrappedComponentPropsInternal<ComponentProps extends BaseInputProps> = Omit<WrappedComponentProps<ComponentProps>, "Component"> & {
|
|
4
4
|
condition?: Condition;
|
|
5
5
|
};
|
|
6
|
-
declare const withWrapper: <ComponentProps extends BaseInputProps, ComponentWrapperProps extends BaseWrapperProps<ComponentProps> = WrapperProps<ComponentProps>>(Component: React.ComponentType<ComponentProps>, options?: Partial<ComponentWrapperProps>, Wrapper?: React.ComponentType<WrapperProps<ComponentProps>>) => (props: "id" | "label" | "style" | "className" | "description" | "isOptional" | "requiredIndicator" | "nestedRegisterProps" | "unregisterOnUnmount" | "controlLabel" | "mockLabel" | "middleware" | "WrapperComponent" | "condition" | Exclude<Exclude<keyof ComponentProps, "Component">, "Component"> extends infer T extends keyof WrappedComponentProps<WrappedComponentPropsInternal<ComponentProps>> ? { [P in T]: WrappedComponentProps<WrappedComponentPropsInternal<ComponentProps>>[P]; } : never) => React.ReactElement<WrappedComponentPropsInternal<ComponentProps>, string | React.JSXElementConstructor<any>> | null;
|
|
6
|
+
declare const withWrapper: <ComponentProps extends BaseInputProps, ComponentWrapperProps extends BaseWrapperProps<ComponentProps> = WrapperProps<ComponentProps>>(Component: React.ComponentType<ComponentProps>, options?: Partial<ComponentWrapperProps>, Wrapper?: React.ComponentType<WrapperProps<ComponentProps>>) => (props: "id" | "label" | "style" | "className" | "description" | "isOptional" | "requiredIndicator" | "nestedRegisterProps" | "unregisterOnUnmount" | "controlLabel" | "labelPosition" | "mockLabel" | "middleware" | "WrapperComponent" | "condition" | Exclude<Exclude<keyof ComponentProps, "Component">, "Component"> extends infer T extends keyof WrappedComponentProps<WrappedComponentPropsInternal<ComponentProps>> ? { [P in T]: WrappedComponentProps<WrappedComponentPropsInternal<ComponentProps>>[P]; } : never) => React.ReactElement<WrappedComponentPropsInternal<ComponentProps>, string | React.JSXElementConstructor<any>> | null;
|
|
7
7
|
export default withWrapper;
|
|
8
8
|
//# sourceMappingURL=withWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/withWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,qBAAqB,EACrB,YAAY,EACb,MAAM,aAAa,CAAC;AAIrB,KAAK,6BAA6B,CAAC,cAAc,SAAS,cAAc,IACtE,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC,GAAG;IACzD,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEJ,QAAA,MAAM,WAAW,GACf,cAAc,SAAS,cAAc,EACrC,qBAAqB,SACnB,gBAAgB,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC,cAAc,CAAC,EAEjE,WAAW,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,EAC9C,UAAU,OAAO,CAAC,qBAAqB,CAAC,EACxC,UAAS,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,cAAc,CAAC,CAAkB,
|
|
1
|
+
{"version":3,"file":"withWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/withWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,qBAAqB,EACrB,YAAY,EACb,MAAM,aAAa,CAAC;AAIrB,KAAK,6BAA6B,CAAC,cAAc,SAAS,cAAc,IACtE,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC,GAAG;IACzD,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEJ,QAAA,MAAM,WAAW,GACf,cAAc,SAAS,cAAc,EACrC,qBAAqB,SACnB,gBAAgB,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC,cAAc,CAAC,EAEjE,WAAW,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,EAC9C,UAAU,OAAO,CAAC,qBAAqB,CAAC,EACxC,UAAS,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,cAAc,CAAC,CAAkB,0nBA0C5E,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -39,6 +39,7 @@ export type WrapperProps<ComponentProps> = BaseWrapperProps<ComponentProps> & {
|
|
|
39
39
|
description?: string;
|
|
40
40
|
label?: string;
|
|
41
41
|
controlLabel?: string;
|
|
42
|
+
labelPosition?: "before" | "after";
|
|
42
43
|
isOptional?: boolean;
|
|
43
44
|
requiredIndicator?: RequiredIndicator;
|
|
44
45
|
nestedRegisterProps?: RegisterOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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/D,qBAAqB,GACvB,yBAAyB,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC"}
|
|
@@ -29,6 +29,7 @@ declare const _default: (props: {
|
|
|
29
29
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
30
30
|
unregisterOnUnmount?: boolean | undefined;
|
|
31
31
|
controlLabel?: string | undefined;
|
|
32
|
+
labelPosition?: "before" | "after" | undefined;
|
|
32
33
|
mockLabel?: boolean | undefined;
|
|
33
34
|
middleware?: (import("../../index.js").Middleware<ChoicesFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<ChoicesFieldProps>, "Component"> & {
|
|
34
35
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoicesField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/ChoicesField/ChoicesField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"ChoicesField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/ChoicesField/ChoicesField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAGE"}
|
|
@@ -24,6 +24,7 @@ declare const _default: (props: {
|
|
|
24
24
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
25
25
|
unregisterOnUnmount?: boolean | undefined;
|
|
26
26
|
controlLabel?: string | undefined;
|
|
27
|
+
labelPosition?: "before" | "after" | undefined;
|
|
27
28
|
mockLabel?: boolean | undefined;
|
|
28
29
|
middleware?: (import("../../index.js").Middleware<ColorFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<ColorFieldProps>, "Component"> & {
|
|
29
30
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/ColorField/ColorField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;GAIG
|
|
1
|
+
{"version":3,"file":"ColorField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/ColorField/ColorField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAIE"}
|
|
@@ -29,6 +29,7 @@ declare const _default: (props: {
|
|
|
29
29
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
30
30
|
unregisterOnUnmount?: boolean | undefined;
|
|
31
31
|
controlLabel?: string | undefined;
|
|
32
|
+
labelPosition?: "before" | "after" | undefined;
|
|
32
33
|
mockLabel?: boolean | undefined;
|
|
33
34
|
middleware?: (import("../../index.js").Middleware<ComboboxFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<ComboboxFieldProps>, "Component"> & {
|
|
34
35
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/ComboboxField/ComboboxField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"ComboboxField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/ComboboxField/ComboboxField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAEE"}
|
|
@@ -325,6 +325,7 @@ declare const _default: (props: {
|
|
|
325
325
|
nestedRegisterProps?: RegisterOptions | undefined;
|
|
326
326
|
unregisterOnUnmount?: boolean | undefined;
|
|
327
327
|
controlLabel?: string | undefined;
|
|
328
|
+
labelPosition?: "before" | "after" | undefined;
|
|
328
329
|
mockLabel?: boolean | undefined;
|
|
329
330
|
middleware?: (import("../../index.js").Middleware<DateFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<DateFieldProps>, "Component"> & {
|
|
330
331
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/DateField/DateField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAsBjD;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"DateField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/DateField/DateField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAsBjD;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAIE"}
|
|
@@ -324,6 +324,7 @@ declare const _default: (props: {
|
|
|
324
324
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
325
325
|
unregisterOnUnmount?: boolean | undefined;
|
|
326
326
|
controlLabel?: string | undefined;
|
|
327
|
+
labelPosition?: "before" | "after" | undefined;
|
|
327
328
|
mockLabel?: boolean | undefined;
|
|
328
329
|
middleware?: (import("../../index.js").Middleware<DateTimeFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<DateTimeFieldProps>, "Component"> & {
|
|
329
330
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/DateTimeField/DateTimeField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"DateTimeField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/DateTimeField/DateTimeField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAEE"}
|
|
@@ -31,6 +31,7 @@ declare const _default: (props: {
|
|
|
31
31
|
nestedRegisterProps?: RegisterOptions | undefined;
|
|
32
32
|
unregisterOnUnmount?: boolean | undefined;
|
|
33
33
|
controlLabel?: string | undefined;
|
|
34
|
+
labelPosition?: "before" | "after" | undefined;
|
|
34
35
|
mockLabel?: boolean | undefined;
|
|
35
36
|
middleware?: (import("../../index.js").Middleware<FileUploadFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<FileUploadFieldProps>, "Component"> & {
|
|
36
37
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploadField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/FileUploadField/FileUploadField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAyCvD;;;;;;;;GAQG
|
|
1
|
+
{"version":3,"file":"FileUploadField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/FileUploadField/FileUploadField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAyCvD;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAKE"}
|
|
@@ -324,6 +324,7 @@ declare const _default: (props: {
|
|
|
324
324
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
325
325
|
unregisterOnUnmount?: boolean | undefined;
|
|
326
326
|
controlLabel?: string | undefined;
|
|
327
|
+
labelPosition?: "before" | "after" | undefined;
|
|
327
328
|
mockLabel?: boolean | undefined;
|
|
328
329
|
middleware?: (import("../../index.js").Middleware<HiddenFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<HiddenFieldProps>, "Component"> & {
|
|
329
330
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiddenField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/HiddenField/HiddenField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"HiddenField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/HiddenField/HiddenField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAIE"}
|
|
@@ -324,6 +324,7 @@ declare const _default: (props: {
|
|
|
324
324
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
325
325
|
unregisterOnUnmount?: boolean | undefined;
|
|
326
326
|
controlLabel?: string | undefined;
|
|
327
|
+
labelPosition?: "before" | "after" | undefined;
|
|
327
328
|
mockLabel?: boolean | undefined;
|
|
328
329
|
middleware?: (import("../../index.js").Middleware<NumberFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<NumberFieldProps>, "Component"> & {
|
|
329
330
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/NumberField/NumberField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/NumberField/NumberField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAME"}
|
|
@@ -323,6 +323,7 @@ declare const _default: (props: {
|
|
|
323
323
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
324
324
|
unregisterOnUnmount?: boolean | undefined;
|
|
325
325
|
controlLabel?: string | undefined;
|
|
326
|
+
labelPosition?: "before" | "after" | undefined;
|
|
326
327
|
mockLabel?: boolean | undefined;
|
|
327
328
|
middleware?: (import("../../index.js").Middleware<PasswordFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<PasswordFieldProps>, "Component"> & {
|
|
328
329
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/PasswordField/PasswordField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"PasswordField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/PasswordField/PasswordField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAEE"}
|
|
@@ -32,6 +32,7 @@ declare const _default: (props: {
|
|
|
32
32
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
33
33
|
unregisterOnUnmount?: boolean | undefined;
|
|
34
34
|
controlLabel?: string | undefined;
|
|
35
|
+
labelPosition?: "before" | "after" | undefined;
|
|
35
36
|
mockLabel?: boolean | undefined;
|
|
36
37
|
middleware?: (import("../../index.js").Middleware<PhoneFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<PhoneFieldProps>, "Component"> & {
|
|
37
38
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/PhoneField/PhoneField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;;GAWG
|
|
1
|
+
{"version":3,"file":"PhoneField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/PhoneField/PhoneField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAEE"}
|
|
@@ -330,6 +330,7 @@ declare const _default: (props: {
|
|
|
330
330
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
331
331
|
unregisterOnUnmount?: boolean | undefined;
|
|
332
332
|
controlLabel?: string | undefined;
|
|
333
|
+
labelPosition?: "before" | "after" | undefined;
|
|
333
334
|
mockLabel?: boolean | undefined;
|
|
334
335
|
middleware?: (import("../../index.js").Middleware<RangeFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<RangeFieldProps>, "Component"> & {
|
|
335
336
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/RangeField/RangeField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;;GAWG
|
|
1
|
+
{"version":3,"file":"RangeField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/RangeField/RangeField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAIE"}
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: {
|
|
|
28
28
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
29
29
|
unregisterOnUnmount?: boolean | undefined;
|
|
30
30
|
controlLabel?: string | undefined;
|
|
31
|
+
labelPosition?: "before" | "after" | undefined;
|
|
31
32
|
mockLabel?: boolean | undefined;
|
|
32
33
|
middleware?: (import("../../index.js").Middleware<RatingFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<RatingFieldProps>, "Component"> & {
|
|
33
34
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RatingField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/RatingField/RatingField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"RatingField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/RatingField/RatingField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAEE"}
|
|
@@ -27,6 +27,7 @@ declare const _default: (props: {
|
|
|
27
27
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
28
28
|
unregisterOnUnmount?: boolean | undefined;
|
|
29
29
|
controlLabel?: string | undefined;
|
|
30
|
+
labelPosition?: "before" | "after" | undefined;
|
|
30
31
|
mockLabel?: boolean | undefined;
|
|
31
32
|
middleware?: (import("../../index.js").Middleware<RichChoicesFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<RichChoicesFieldProps>, "Component"> & {
|
|
32
33
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichChoicesField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/RichChoicesField/RichChoicesField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"RichChoicesField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/RichChoicesField/RichChoicesField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAGE"}
|
|
@@ -303,6 +303,7 @@ declare const _default: (props: {
|
|
|
303
303
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
304
304
|
unregisterOnUnmount?: boolean | undefined;
|
|
305
305
|
controlLabel?: string | undefined;
|
|
306
|
+
labelPosition?: "before" | "after" | undefined;
|
|
306
307
|
mockLabel?: boolean | undefined;
|
|
307
308
|
middleware?: (import("../../index.js").Middleware<SelectFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<SelectFieldProps>, "Component"> & {
|
|
308
309
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/SelectField/SelectField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/SelectField/SelectField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAEE"}
|
|
@@ -7,6 +7,11 @@ type SwitchInputFieldProps = InputProps<SwitchInputProps>;
|
|
|
7
7
|
* middleware/conditional-display support. Requires at least one of
|
|
8
8
|
* `label`/`controlLabel`.
|
|
9
9
|
*
|
|
10
|
+
* The label defaults to the LEFT of the switch (`labelPosition: "before"`): a
|
|
11
|
+
* label before a switch names its purpose, which is the switch convention (a
|
|
12
|
+
* label after would read as the switch's state). Callers can override with
|
|
13
|
+
* `labelPosition="after"`.
|
|
14
|
+
*
|
|
10
15
|
* `import { SwitchField } from "@canonical/react-ds-global-form";`
|
|
11
16
|
*/
|
|
12
17
|
declare const _default: import("react").FC<Omit<import("../../common/types.js").WrapperProps<SwitchInputFieldProps>, "label" | "Component" | "controlLabel"> & import("../../common/types.js").ToggleLabelProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/SwitchField/SwitchField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAGhF,KAAK,qBAAqB,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"SwitchField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/SwitchField/SwitchField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAGhF,KAAK,qBAAqB,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;;;;;;GAYG;;AACH,wBAGE"}
|
|
@@ -325,6 +325,7 @@ declare const _default: (props: {
|
|
|
325
325
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
326
326
|
unregisterOnUnmount?: boolean | undefined;
|
|
327
327
|
controlLabel?: string | undefined;
|
|
328
|
+
labelPosition?: "before" | "after" | undefined;
|
|
328
329
|
mockLabel?: boolean | undefined;
|
|
329
330
|
middleware?: (import("../../index.js").Middleware<TextFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<TextFieldProps>, "Component"> & {
|
|
330
331
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/TextField/TextField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/TextField/TextField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAEE"}
|
|
@@ -308,6 +308,7 @@ declare const _default: (props: {
|
|
|
308
308
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
309
309
|
unregisterOnUnmount?: boolean | undefined;
|
|
310
310
|
controlLabel?: string | undefined;
|
|
311
|
+
labelPosition?: "before" | "after" | undefined;
|
|
311
312
|
mockLabel?: boolean | undefined;
|
|
312
313
|
middleware?: (import("../../index.js").Middleware<TextareaFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<TextareaFieldProps>, "Component"> & {
|
|
313
314
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextareaField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/TextareaField/TextareaField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"TextareaField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/TextareaField/TextareaField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAEE"}
|
|
@@ -324,6 +324,7 @@ declare const _default: (props: {
|
|
|
324
324
|
nestedRegisterProps?: import("react-hook-form").RegisterOptions | undefined;
|
|
325
325
|
unregisterOnUnmount?: boolean | undefined;
|
|
326
326
|
controlLabel?: string | undefined;
|
|
327
|
+
labelPosition?: "before" | "after" | undefined;
|
|
327
328
|
mockLabel?: boolean | undefined;
|
|
328
329
|
middleware?: (import("../../index.js").Middleware<TimeFieldProps>[] & import("../../index.js").Middleware<Omit<import("../../index.js").WrappedComponentProps<TimeFieldProps>, "Component"> & {
|
|
329
330
|
condition?: import("../../index.js").Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/TimeField/TimeField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"TimeField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/TimeField/TimeField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAEE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonical/react-ds-global-form",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"test:vitest:watch": "vitest"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@canonical/react-ds-global": "^0.
|
|
47
|
-
"@canonical/storybook-config": "^0.
|
|
48
|
-
"@canonical/styles": "^0.
|
|
49
|
-
"@canonical/utils": "^0.
|
|
46
|
+
"@canonical/react-ds-global": "^0.32.0",
|
|
47
|
+
"@canonical/storybook-config": "^0.32.0",
|
|
48
|
+
"@canonical/styles": "^0.32.0",
|
|
49
|
+
"@canonical/utils": "^0.32.0",
|
|
50
50
|
"downshift": "^9.3.2",
|
|
51
51
|
"react": "^19.2.4",
|
|
52
52
|
"react-dom": "^19.2.4",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@biomejs/biome": "2.4.9",
|
|
57
|
-
"@canonical/biome-config": "^0.
|
|
58
|
-
"@canonical/design-tokens": "0.
|
|
59
|
-
"@canonical/storybook-addon-form-state": "^0.
|
|
60
|
-
"@canonical/storybook-addon-msw": "^0.
|
|
61
|
-
"@canonical/storybook-helpers": "^0.
|
|
62
|
-
"@canonical/typescript-config-react": "^0.
|
|
63
|
-
"@canonical/vitest-config-react": "^0.
|
|
64
|
-
"@canonical/webarchitect": "^0.
|
|
57
|
+
"@canonical/biome-config": "^0.32.0",
|
|
58
|
+
"@canonical/design-tokens": "0.8.1",
|
|
59
|
+
"@canonical/storybook-addon-form-state": "^0.32.0",
|
|
60
|
+
"@canonical/storybook-addon-msw": "^0.32.0",
|
|
61
|
+
"@canonical/storybook-helpers": "^0.32.0",
|
|
62
|
+
"@canonical/typescript-config-react": "^0.32.0",
|
|
63
|
+
"@canonical/vitest-config-react": "^0.32.0",
|
|
64
|
+
"@canonical/webarchitect": "^0.32.0",
|
|
65
65
|
"@chromatic-com/storybook": "^5.0.1",
|
|
66
66
|
"@storybook/addon-docs": "^10.3.1",
|
|
67
67
|
"@storybook/react-vite": "^10.3.1",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"vite": "^8.0.1",
|
|
82
82
|
"vitest": "^4.0.18"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "5b279d8150e3988c68c6c2a741046bcd425624ca"
|
|
85
85
|
}
|