@namroodinc/liquid-editorial 0.12.0 → 0.13.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/README.md +17 -7
- package/UPGRADING.md +70 -0
- package/dist/chunks/{Avatar-DPnrvkwd.cjs → Avatar-BY0dAItT.cjs} +2 -2
- package/dist/chunks/{Avatar-DPnrvkwd.cjs.map → Avatar-BY0dAItT.cjs.map} +1 -1
- package/dist/chunks/{Avatar-BK8IdL5W.js → Avatar-UjhjcHh5.js} +2 -2
- package/dist/chunks/{Avatar-BK8IdL5W.js.map → Avatar-UjhjcHh5.js.map} +1 -1
- package/dist/chunks/{CollectionView-DrszOUOt.cjs → CollectionView-CIJdNwcq.cjs} +2 -2
- package/dist/chunks/{CollectionView-DrszOUOt.cjs.map → CollectionView-CIJdNwcq.cjs.map} +1 -1
- package/dist/chunks/{CollectionView-B0ZJxkNK.js → CollectionView-JRNdXHti.js} +2 -2
- package/dist/chunks/{CollectionView-B0ZJxkNK.js.map → CollectionView-JRNdXHti.js.map} +1 -1
- package/dist/chunks/{ColourField-C39pcjkG.js → ColourField-BTj9NHgI.js} +146 -152
- package/dist/chunks/ColourField-BTj9NHgI.js.map +1 -0
- package/dist/chunks/ColourField-DuoVeXjG.cjs +2 -0
- package/dist/chunks/ColourField-DuoVeXjG.cjs.map +1 -0
- package/dist/chunks/{DatePicker-Dpvfomrm.cjs → DatePicker-BYpGsfL4.cjs} +2 -2
- package/dist/chunks/{DatePicker-Dpvfomrm.cjs.map → DatePicker-BYpGsfL4.cjs.map} +1 -1
- package/dist/chunks/{DatePicker-DDc1nDTb.js → DatePicker-Cb5WspIC.js} +21 -21
- package/dist/chunks/{DatePicker-DDc1nDTb.js.map → DatePicker-Cb5WspIC.js.map} +1 -1
- package/dist/chunks/{Drawer-C3mWT9Kh.js → Drawer-Ck5XKT_V.js} +3 -3
- package/dist/chunks/{Drawer-C3mWT9Kh.js.map → Drawer-Ck5XKT_V.js.map} +1 -1
- package/dist/chunks/{Drawer-DTKZptua.cjs → Drawer-DdIH9jpe.cjs} +2 -2
- package/dist/chunks/{Drawer-DTKZptua.cjs.map → Drawer-DdIH9jpe.cjs.map} +1 -1
- package/dist/chunks/{EntryPicker-CgWbgWnc.cjs → EntryPicker-CCCoJxbd.cjs} +2 -2
- package/dist/chunks/{EntryPicker-CgWbgWnc.cjs.map → EntryPicker-CCCoJxbd.cjs.map} +1 -1
- package/dist/chunks/{EntryPicker-DlEsVCvA.js → EntryPicker-DLCP4S-q.js} +3 -3
- package/dist/chunks/{EntryPicker-DlEsVCvA.js.map → EntryPicker-DLCP4S-q.js.map} +1 -1
- package/dist/chunks/{FormEditor-iACd0El-.cjs → FormEditor-ArvjKtJJ.cjs} +2 -2
- package/dist/chunks/{FormEditor-iACd0El-.cjs.map → FormEditor-ArvjKtJJ.cjs.map} +1 -1
- package/dist/chunks/{FormEditor-CLLOHKiO.js → FormEditor-DnNBv9Xf.js} +16 -16
- package/dist/chunks/{FormEditor-CLLOHKiO.js.map → FormEditor-DnNBv9Xf.js.map} +1 -1
- package/dist/chunks/{Message-CyLq9ef-.js → Message-C73sJfdo.js} +4 -8
- package/dist/chunks/{Message-CyLq9ef-.js.map → Message-C73sJfdo.js.map} +1 -1
- package/dist/chunks/{Message-D3b8HDhm.cjs → Message-CIKSTXp8.cjs} +2 -2
- package/dist/chunks/{Message-D3b8HDhm.cjs.map → Message-CIKSTXp8.cjs.map} +1 -1
- package/dist/chunks/RichTextEditor--kMao88d.cjs +2 -0
- package/dist/chunks/RichTextEditor--kMao88d.cjs.map +1 -0
- package/dist/chunks/{RichTextEditor-B0P53GFt.js → RichTextEditor-CvbboqJY.js} +391 -374
- package/dist/chunks/RichTextEditor-CvbboqJY.js.map +1 -0
- package/dist/chunks/{dialogLabel-D18maX-p.js → dialogLabel-DT7rCr3_.js} +19 -19
- package/dist/chunks/{dialogLabel-D18maX-p.js.map → dialogLabel-DT7rCr3_.js.map} +1 -1
- package/dist/chunks/{dialogLabel-2HRYMHbF.cjs → dialogLabel-_-MTckE_.cjs} +2 -2
- package/dist/chunks/{dialogLabel-2HRYMHbF.cjs.map → dialogLabel-_-MTckE_.cjs.map} +1 -1
- package/dist/chunks/overlayLayer-iGhuAByk.cjs +2 -0
- package/dist/chunks/overlayLayer-iGhuAByk.cjs.map +1 -0
- package/dist/chunks/{overlayLayer-IuoPVwTO.js → overlayLayer-lU4iWSjO.js} +32 -28
- package/dist/chunks/overlayLayer-lU4iWSjO.js.map +1 -0
- package/dist/chunks/{group-7Z_xRlQx.js → style-7Z_xRlQx.js} +1 -1
- package/dist/chunks/{group-7Z_xRlQx.js.map → style-7Z_xRlQx.js.map} +1 -1
- package/dist/chunks/{group-nulIa2_8.cjs → style-nulIa2_8.cjs} +1 -1
- package/dist/chunks/{group-nulIa2_8.cjs.map → style-nulIa2_8.cjs.map} +1 -1
- package/dist/chunks/{use-picker-session-DbfOJstX.cjs → use-picker-session-Bue5MJHQ.cjs} +2 -2
- package/dist/chunks/{use-picker-session-DbfOJstX.cjs.map → use-picker-session-Bue5MJHQ.cjs.map} +1 -1
- package/dist/chunks/{use-picker-session-BnMxbGAZ.js → use-picker-session-DUO4G8Cs.js} +2 -2
- package/dist/chunks/{use-picker-session-BnMxbGAZ.js.map → use-picker-session-DUO4G8Cs.js.map} +1 -1
- package/dist/chunks/{useTooltip-BXAvQwt4.cjs → useTooltip-C7ON4nkV.cjs} +2 -2
- package/dist/chunks/{useTooltip-BXAvQwt4.cjs.map → useTooltip-C7ON4nkV.cjs.map} +1 -1
- package/dist/chunks/{useTooltip-BrC7FdeH.js → useTooltip-DnJEFBLg.js} +2 -2
- package/dist/chunks/{useTooltip-BrC7FdeH.js.map → useTooltip-DnJEFBLg.js.map} +1 -1
- package/dist/components/AppShell/index.cjs +1 -1
- package/dist/components/AppShell/index.js +1 -1
- package/dist/components/Avatar/index.cjs +1 -1
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Badge/style.css +9 -9
- package/dist/components/Banner/index.cjs +1 -1
- package/dist/components/Banner/index.js +1 -1
- package/dist/components/Board/style.css +3 -3
- package/dist/components/Button/style.css +4 -8
- package/dist/components/Choice/index.cjs +1 -1
- package/dist/components/Choice/index.cjs.map +1 -1
- package/dist/components/Choice/index.js +3 -3
- package/dist/components/Choice/index.js.map +1 -1
- package/dist/components/Choice/style.css +29 -18
- package/dist/components/CollectionView/index.cjs +1 -1
- package/dist/components/CollectionView/index.js +1 -1
- package/dist/components/ColourField/index.cjs +1 -1
- package/dist/components/ColourField/index.d.cts.map +1 -1
- package/dist/components/ColourField/index.d.ts.map +1 -1
- package/dist/components/ColourField/index.js +1 -1
- package/dist/components/ColourField/style.css +4 -4
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/Drawer/style.css +2 -4
- package/dist/components/EditLayout/index.cjs +1 -1
- package/dist/components/EditLayout/index.js +3 -3
- package/dist/components/EditLayout/style.css +1 -7
- package/dist/components/EntryPicker/index.cjs +1 -1
- package/dist/components/EntryPicker/index.js +1 -1
- package/dist/components/EntryPicker/style.css +3 -1
- package/dist/components/Field/style.css +1 -1
- package/dist/components/FormEditor/README.md +26 -33
- package/dist/components/FormEditor/index.cjs +1 -1
- package/dist/components/FormEditor/index.js +1 -1
- package/dist/components/FormEditor/style.css +1 -0
- package/dist/components/LimitReading/style.css +1 -1
- package/dist/components/Menu/index.cjs +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Menu/style.css +3 -2
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/Modal/style.css +1 -3
- package/dist/components/Popover/index.cjs +1 -1
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.cts.map +1 -1
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +58 -55
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.d.cts.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RichTextEditor/storyblock-view.d.cts.map +1 -1
- package/dist/components/RichTextEditor/storyblock-view.d.ts.map +1 -1
- package/dist/components/RichTextEditor/style.css +91 -60
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SelectionCard/index.cjs +1 -1
- package/dist/components/SelectionCard/index.cjs.map +1 -1
- package/dist/components/SelectionCard/index.d.cts.map +1 -1
- package/dist/components/SelectionCard/index.d.ts.map +1 -1
- package/dist/components/SelectionCard/index.js +2 -2
- package/dist/components/SelectionCard/index.js.map +1 -1
- package/dist/components/SelectionCard/style.css +20 -65
- package/dist/components/Skeleton/style.css +1 -1
- package/dist/components/Slider/style.css +12 -23
- package/dist/components/Switch/index.cjs +1 -1
- package/dist/components/Switch/index.cjs.map +1 -1
- package/dist/components/Switch/index.d.cts.map +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Switch/index.js +2 -1
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Switch/style.css +14 -2
- package/dist/components/TagsInput/style.css +3 -21
- package/dist/components/Time/index.cjs +1 -1
- package/dist/components/Time/index.js +1 -1
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/elements.css +2 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +29 -29
- package/dist/internal/dialogFocus.d.cts +2 -0
- package/dist/internal/dialogFocus.d.cts.map +1 -1
- package/dist/internal/dialogFocus.d.ts +2 -0
- package/dist/internal/dialogFocus.d.ts.map +1 -1
- package/dist/message.css +5 -3
- package/dist/tokens.css +83 -309
- package/package.json +1 -1
- package/dist/chunks/ColourField-BdobU76j.cjs +0 -2
- package/dist/chunks/ColourField-BdobU76j.cjs.map +0 -1
- package/dist/chunks/ColourField-C39pcjkG.js.map +0 -1
- package/dist/chunks/RichTextEditor-B0P53GFt.js.map +0 -1
- package/dist/chunks/RichTextEditor-Wu_yjvD7.cjs +0 -2
- package/dist/chunks/RichTextEditor-Wu_yjvD7.cjs.map +0 -1
- package/dist/chunks/overlayLayer-IuoPVwTO.js.map +0 -1
- package/dist/chunks/overlayLayer-seJG-EFn.cjs +0 -2
- package/dist/chunks/overlayLayer-seJG-EFn.cjs.map +0 -1
- package/dist/components/ColourField/focus.d.cts +0 -3
- package/dist/components/ColourField/focus.d.cts.map +0 -1
- package/dist/components/ColourField/focus.d.ts +0 -3
- package/dist/components/ColourField/focus.d.ts.map +0 -1
package/dist/tokens.css
CHANGED
|
@@ -151,217 +151,98 @@
|
|
|
151
151
|
--duration-panel: 280ms;
|
|
152
152
|
--ease-standard: ease;
|
|
153
153
|
--ease-panel: cubic-bezier(0.22, 1, 0.36, 1);
|
|
154
|
-
|
|
155
|
-
/* Fill steps. Theme-independent percentages that the derived field and
|
|
156
|
-
* soft ladders below mix against each theme's colours. */
|
|
157
|
-
--tint-rest: 7%;
|
|
158
|
-
--tint-hover: 10%;
|
|
159
|
-
--tint-focus: 14%;
|
|
160
|
-
--tint-pressed: 18%;
|
|
161
|
-
--soft-step-hover: 10%;
|
|
162
|
-
--soft-step-pressed: 18%;
|
|
163
154
|
}
|
|
164
155
|
|
|
165
|
-
/*
|
|
166
|
-
* Theme-derived tokens. A custom property resolves where it is declared and
|
|
167
|
-
* descendants inherit the result, so anything computed from theme colours is
|
|
168
|
-
* declared on every theme scope, not only :root. A subtree or overlay that
|
|
169
|
-
* carries its own data-theme then derives these from its own colours. The
|
|
170
|
-
* theme blocks below still override single results, e.g. --color-accent-text.
|
|
171
|
-
* ───────────────────────────────────────────────────────────────────────── */
|
|
156
|
+
/* ── Theme-derived (:root, [data-theme]) ─────────────────────────────── */
|
|
172
157
|
:root,
|
|
173
158
|
[data-theme] {
|
|
174
|
-
/* The ground fields sit on.
|
|
175
|
-
* overrides --field-bg locally and carries .ds-field-surface (see below). */
|
|
159
|
+
/* The ground fields sit on. Body, Drawer and Modal all paint canvas. */
|
|
176
160
|
--field-bg: var(--color-canvas);
|
|
177
161
|
|
|
178
|
-
/*
|
|
179
|
-
--
|
|
162
|
+
/* Cards and list items rest one step off the ground. */
|
|
163
|
+
--fill-card: var(--color-surface);
|
|
180
164
|
|
|
181
|
-
/*
|
|
182
|
-
* from
|
|
183
|
-
|
|
165
|
+
/* Bands (lanes, rails, toolbars, footers) step once more off the surface,
|
|
166
|
+
* so they separate from the canvas, from the surface they sit in and from
|
|
167
|
+
* the surface cards they hold. A theme colour, not a ground step: band
|
|
168
|
+
* hosts set --field-bg from it, so it cannot derive from --field-bg. */
|
|
169
|
+
--fill-band: color-mix(in srgb, var(--color-text) var(--tint-rest), var(--color-surface));
|
|
184
170
|
|
|
185
|
-
/*
|
|
186
|
-
*
|
|
187
|
-
|
|
188
|
-
--fill-card: var(--color-surface);
|
|
171
|
+
/* The header steps from the sidebar surface, so it separates from both
|
|
172
|
+
* the white page and the grey sidebar. Dark overrides it below. */
|
|
173
|
+
--color-header: color-mix(in srgb, var(--color-text) 6%, var(--color-surface));
|
|
189
174
|
|
|
190
|
-
/*
|
|
191
|
-
*
|
|
192
|
-
* Two kinds of ladder, and a component uses one or the other, never both:
|
|
193
|
-
*
|
|
194
|
-
* SOLID --color-<tone> rest
|
|
195
|
-
* --color-<tone>-hover hover hand-picked per theme, because
|
|
196
|
-
* --color-<tone>-pressed pressed a dark theme lightens where a
|
|
197
|
-
* light theme darkens
|
|
198
|
-
*
|
|
199
|
-
* SOFT --color-<tone>-soft rest derived — one rule, every tone,
|
|
200
|
-
* --color-<tone>-soft-hover hover every theme, nothing to hand-pick
|
|
201
|
-
* --color-<tone>-soft-pressed press and nothing to get wrong
|
|
202
|
-
*
|
|
203
|
-
* Text on a soft fill is the tone itself, except where that fails 4.5:1 —
|
|
204
|
-
* those get a --color-<tone>-text override in their theme block, and the
|
|
205
|
-
* override is the exception that proves the rule rather than a habit.
|
|
206
|
-
*
|
|
207
|
-
* Solid ladders exist only for the three tones that are ever a button fill:
|
|
208
|
-
* primary, danger, accent. Success, warning and review are tones, not
|
|
209
|
-
* actions — if one of them ever needs a solid ladder, that is a decision
|
|
210
|
-
* record, not a token. */
|
|
175
|
+
/* Only primary has an interactive soft ladder. Add another tone's ladder
|
|
176
|
+
* when a component needs one, with a decision record. */
|
|
211
177
|
--color-primary-soft-hover: color-mix(
|
|
212
178
|
in srgb,
|
|
213
|
-
var(--color-primary) var(--
|
|
179
|
+
var(--color-primary) var(--tint-hover),
|
|
214
180
|
var(--color-primary-soft)
|
|
215
181
|
);
|
|
216
182
|
--color-primary-soft-pressed: color-mix(
|
|
217
183
|
in srgb,
|
|
218
|
-
var(--color-primary) var(--
|
|
184
|
+
var(--color-primary) var(--tint-pressed),
|
|
219
185
|
var(--color-primary-soft)
|
|
220
186
|
);
|
|
221
|
-
--color-accent-soft-hover: color-mix(
|
|
222
|
-
in srgb,
|
|
223
|
-
var(--color-accent) var(--soft-step-hover),
|
|
224
|
-
var(--color-accent-soft)
|
|
225
|
-
);
|
|
226
|
-
--color-accent-soft-pressed: color-mix(
|
|
227
|
-
in srgb,
|
|
228
|
-
var(--color-accent) var(--soft-step-pressed),
|
|
229
|
-
var(--color-accent-soft)
|
|
230
|
-
);
|
|
231
|
-
--color-success-soft-hover: color-mix(
|
|
232
|
-
in srgb,
|
|
233
|
-
var(--color-success) var(--soft-step-hover),
|
|
234
|
-
var(--color-success-soft)
|
|
235
|
-
);
|
|
236
|
-
--color-success-soft-pressed: color-mix(
|
|
237
|
-
in srgb,
|
|
238
|
-
var(--color-success) var(--soft-step-pressed),
|
|
239
|
-
var(--color-success-soft)
|
|
240
|
-
);
|
|
241
|
-
--color-warning-soft-hover: color-mix(
|
|
242
|
-
in srgb,
|
|
243
|
-
var(--color-warning) var(--soft-step-hover),
|
|
244
|
-
var(--color-warning-soft)
|
|
245
|
-
);
|
|
246
|
-
--color-warning-soft-pressed: color-mix(
|
|
247
|
-
in srgb,
|
|
248
|
-
var(--color-warning) var(--soft-step-pressed),
|
|
249
|
-
var(--color-warning-soft)
|
|
250
|
-
);
|
|
251
|
-
--color-danger-soft-hover: color-mix(
|
|
252
|
-
in srgb,
|
|
253
|
-
var(--color-danger) var(--soft-step-hover),
|
|
254
|
-
var(--color-danger-soft)
|
|
255
|
-
);
|
|
256
|
-
--color-danger-soft-pressed: color-mix(
|
|
257
|
-
in srgb,
|
|
258
|
-
var(--color-danger) var(--soft-step-pressed),
|
|
259
|
-
var(--color-danger-soft)
|
|
260
|
-
);
|
|
261
|
-
--color-review-soft-hover: color-mix(
|
|
262
|
-
in srgb,
|
|
263
|
-
var(--color-review) var(--soft-step-hover),
|
|
264
|
-
var(--color-review-soft)
|
|
265
|
-
);
|
|
266
|
-
--color-review-soft-pressed: color-mix(
|
|
267
|
-
in srgb,
|
|
268
|
-
var(--color-review) var(--soft-step-pressed),
|
|
269
|
-
var(--color-review-soft)
|
|
270
|
-
);
|
|
271
187
|
|
|
272
|
-
/*
|
|
188
|
+
/* A theme can tune ink independently of its solid and soft fills. */
|
|
273
189
|
--color-primary-text: var(--color-primary);
|
|
274
|
-
--color-accent-text: var(--color-accent);
|
|
275
190
|
--color-success-text: var(--color-success);
|
|
276
191
|
--color-warning-text: var(--color-warning);
|
|
277
192
|
--color-danger-text: var(--color-danger);
|
|
278
193
|
--color-review-text: var(--color-review);
|
|
279
194
|
|
|
280
|
-
/*
|
|
281
|
-
|
|
282
|
-
--status-draft: var(--color-border-strong);
|
|
283
|
-
|
|
284
|
-
/* Draft and archived badges step from the ground they sit on, hovered
|
|
285
|
-
* rows included, so their inks hold 4.5:1 on any neutral step. */
|
|
286
|
-
--status-draft-text: color-mix(in srgb, var(--color-text) 50%, var(--color-text-muted));
|
|
287
|
-
--status-draft-soft: var(--color-surface-subtle);
|
|
288
|
-
--status-scheduled: var(--color-primary);
|
|
289
|
-
--status-scheduled-soft: var(--color-primary-soft);
|
|
290
|
-
--status-published: var(--color-success);
|
|
291
|
-
--status-published-soft: var(--color-success-soft);
|
|
292
|
-
--status-changed: var(--color-warning);
|
|
293
|
-
--status-changed-soft: var(--color-warning-soft);
|
|
294
|
-
--status-unpublished: var(--color-danger);
|
|
295
|
-
--status-unpublished-soft: var(--color-danger-soft);
|
|
296
|
-
--status-archived: var(--color-border);
|
|
297
|
-
--status-archived-text: color-mix(in srgb, var(--color-text) 50%, var(--color-text-muted));
|
|
298
|
-
--status-archived-soft: transparent;
|
|
299
|
-
|
|
300
|
-
/* Status tabs are interactive, so each soft needs its two further steps.
|
|
301
|
-
* Four inherit their tone's ladder; draft and archived have no tone of
|
|
302
|
-
* their own and fall back to the neutral field ladder. */
|
|
303
|
-
--status-draft-soft-hover: var(--field-hover);
|
|
304
|
-
--status-draft-soft-pressed: var(--field-pressed);
|
|
305
|
-
--status-scheduled-soft-hover: var(--color-primary-soft-hover);
|
|
306
|
-
--status-scheduled-soft-pressed: var(--color-primary-soft-pressed);
|
|
307
|
-
--status-published-soft-hover: var(--color-success-soft-hover);
|
|
308
|
-
--status-published-soft-pressed: var(--color-success-soft-pressed);
|
|
309
|
-
--status-changed-soft-hover: var(--color-warning-soft-hover);
|
|
310
|
-
--status-changed-soft-pressed: var(--color-warning-soft-pressed);
|
|
311
|
-
--status-unpublished-soft-hover: var(--color-danger-soft-hover);
|
|
312
|
-
--status-unpublished-soft-pressed: var(--color-danger-soft-pressed);
|
|
313
|
-
--status-archived-soft-hover: var(--field-hover);
|
|
314
|
-
--status-archived-soft-pressed: var(--field-pressed);
|
|
195
|
+
/* Draft and archived badge ink. */
|
|
196
|
+
--color-text-subtle: color-mix(in srgb, var(--color-text) 50%, var(--color-text-muted));
|
|
315
197
|
}
|
|
316
198
|
|
|
317
|
-
/*
|
|
318
|
-
* theme redefines, against the nearest --field-bg. It is re-derived wherever
|
|
319
|
-
* that ground can change: the root, each theme scope, and every container
|
|
320
|
-
* carrying .ds-field-surface. A container that overrides --field-bg must carry
|
|
321
|
-
* the class as well, or its fields, sliders and buttons rest, hover, focus and
|
|
322
|
-
* press against the fill of the scope above it. */
|
|
199
|
+
/* ── Ground ladder (:root, [data-theme], .ds-field-surface) ───────────── */
|
|
323
200
|
:root,
|
|
324
201
|
[data-theme],
|
|
325
202
|
.ds-field-surface {
|
|
326
203
|
--button-active-bg: var(--color-primary-soft);
|
|
327
|
-
|
|
328
|
-
/* A container that paints a hover or active fill over its ground names it
|
|
329
|
-
* in --field-paint, so neutral controls, badges and avatars inside step
|
|
330
|
-
* from the fill they sit on. It is reset on every surface, so a nested
|
|
331
|
-
* surface steps from its own ground. */
|
|
332
204
|
--field-paint: initial;
|
|
333
|
-
|
|
334
|
-
|
|
205
|
+
|
|
206
|
+
/* One input fill. Every input rests, hovers and presses on these. */
|
|
207
|
+
--field-rest: color-mix(in srgb, var(--color-text) var(--tint-rest), var(--field-bg));
|
|
208
|
+
--field-hover: color-mix(in srgb, var(--color-text) var(--tint-hover), var(--field-bg));
|
|
209
|
+
--field-focus: var(--field-hover); /* focus = hover fill + the focus ring */
|
|
210
|
+
--field-pressed: color-mix(in srgb, var(--color-text) var(--tint-pressed), var(--field-bg));
|
|
211
|
+
--field-invalid: color-mix(in srgb, var(--color-danger) var(--tint-hover), var(--field-bg));
|
|
212
|
+
--field-invalid-focus: color-mix(
|
|
335
213
|
in srgb,
|
|
336
|
-
var(--color-
|
|
337
|
-
var(--field-
|
|
214
|
+
var(--color-danger) var(--tint-pressed),
|
|
215
|
+
var(--field-bg)
|
|
338
216
|
);
|
|
339
|
-
|
|
217
|
+
|
|
218
|
+
/* Neutral controls (buttons, avatars, badges) rest on the hover step.
|
|
219
|
+
* Hover and press add 4% to the hover and pressed steps, so press stays
|
|
220
|
+
* above hover in both themes. */
|
|
221
|
+
--fill-control: color-mix(
|
|
340
222
|
in srgb,
|
|
341
|
-
var(--color-text)
|
|
223
|
+
var(--color-text) var(--tint-hover),
|
|
342
224
|
var(--field-paint, var(--field-bg))
|
|
343
225
|
);
|
|
344
|
-
|
|
345
|
-
/* Softer unchecked fills retain 3:1 on the built-in theme grounds. */
|
|
346
|
-
--fill-indicator: color-mix(in srgb, var(--color-text) var(--indicator-tint), var(--field-bg));
|
|
347
|
-
--fill-indicator-hover: color-mix(
|
|
226
|
+
--fill-control-hover: color-mix(
|
|
348
227
|
in srgb,
|
|
349
|
-
var(--color-text) calc(var(--
|
|
350
|
-
var(--field-bg)
|
|
228
|
+
var(--color-text) calc(var(--tint-hover) + 4%),
|
|
229
|
+
var(--field-paint, var(--field-bg))
|
|
351
230
|
);
|
|
352
|
-
--fill-
|
|
231
|
+
--fill-control-pressed: color-mix(
|
|
353
232
|
in srgb,
|
|
354
|
-
var(--color-text) calc(var(--
|
|
355
|
-
var(--field-bg)
|
|
233
|
+
var(--color-text) calc(var(--tint-pressed) + 4%),
|
|
234
|
+
var(--field-paint, var(--field-bg))
|
|
356
235
|
);
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
--
|
|
360
|
-
--
|
|
361
|
-
--
|
|
362
|
-
--
|
|
363
|
-
|
|
364
|
-
|
|
236
|
+
|
|
237
|
+
/* Unchecked checkbox, radio and switch share the input fill. */
|
|
238
|
+
--fill-indicator: var(--field-rest);
|
|
239
|
+
--fill-indicator-hover: var(--field-hover);
|
|
240
|
+
--fill-indicator-pressed: var(--field-pressed);
|
|
241
|
+
--fill-row-alt: color-mix(in srgb, var(--color-text) 3%, var(--field-bg));
|
|
242
|
+
|
|
243
|
+
/* Every rule and separator: hr, FormEditor divider, Wizard rule, menu and
|
|
244
|
+
* popover separators (1px), and rules typed in the editor (2px). */
|
|
245
|
+
--color-rule: color-mix(in srgb, var(--color-text) 20%, var(--field-bg));
|
|
365
246
|
}
|
|
366
247
|
|
|
367
248
|
/* A logical start rail follows inherited direction, including nested dir scopes. */
|
|
@@ -376,42 +257,40 @@
|
|
|
376
257
|
}
|
|
377
258
|
|
|
378
259
|
/* ── Theme: light (default) ───────────────────────────────────────────── */
|
|
379
|
-
|
|
380
|
-
|
|
260
|
+
:root,
|
|
261
|
+
[data-theme="light"] {
|
|
381
262
|
color-scheme: light;
|
|
382
263
|
|
|
383
|
-
--color-canvas: #
|
|
384
|
-
--color-surface: #
|
|
385
|
-
--color-surface-raised: #
|
|
386
|
-
|
|
387
|
-
/* A step below the canvas, so bands, lanes and neutral banners separate
|
|
388
|
-
* from the page as well as from surfaces. */
|
|
389
|
-
--color-surface-subtle: #e9edf3;
|
|
390
|
-
--color-border: #d5dce7;
|
|
391
|
-
--color-border-muted: #e1e8f0;
|
|
264
|
+
--color-canvas: #fff; /* the ground: body, Drawer, Modal */
|
|
265
|
+
--color-surface: #f4f6f9; /* cards, sidebar; bands step off it */
|
|
266
|
+
--color-surface-raised: #fff; /* menus, popovers, calendar */
|
|
392
267
|
--color-border-strong: #b8c4d6;
|
|
393
268
|
--color-text: #0f1728;
|
|
394
|
-
--color-text-muted: #
|
|
269
|
+
--color-text-muted: #4e5e78;
|
|
395
270
|
--color-text-on-solid: #fff;
|
|
396
271
|
--color-primary: #0052cc;
|
|
397
272
|
--color-primary-hover: #003f9e;
|
|
398
273
|
--color-primary-pressed: #00337f;
|
|
399
274
|
--color-primary-soft: #dbe8ff;
|
|
275
|
+
--color-danger: #a72020;
|
|
276
|
+
--color-danger-hover: #8a1a1a; /* new: danger Button had no hover */
|
|
277
|
+
--color-danger-pressed: #6f1515; /* new */
|
|
278
|
+
--color-danger-soft: #fee7e7;
|
|
400
279
|
--color-success: #136c3f;
|
|
401
280
|
--color-success-soft: #daf4e6;
|
|
402
281
|
--color-warning: #8a5800;
|
|
403
282
|
--color-warning-soft: #fff0c9;
|
|
404
|
-
--color-danger: #a72020;
|
|
405
|
-
--color-danger-soft: #fee7e7;
|
|
406
283
|
--color-review: #7c53d6;
|
|
407
284
|
--color-review-soft: #efe9fb;
|
|
408
|
-
--color-focus: #3a74ff
|
|
409
|
-
--
|
|
410
|
-
--
|
|
411
|
-
--
|
|
412
|
-
--
|
|
413
|
-
|
|
414
|
-
|
|
285
|
+
--color-focus: var(--color-primary); /* was #3a74ff, 3.8:1 */
|
|
286
|
+
--tint-rest: 5%;
|
|
287
|
+
--tint-hover: 8%;
|
|
288
|
+
--tint-pressed: 12%;
|
|
289
|
+
--indicator-edge: none; /* opt-in: inset 0 0 0 1.5px color-mix(in srgb, var(--color-text) 50%, var(--field-bg)) */
|
|
290
|
+
|
|
291
|
+
/* Keep small text readable on pressed active fills and the review fill. */
|
|
292
|
+
--color-primary-text: color-mix(in srgb, var(--color-text) 14%, var(--color-primary));
|
|
293
|
+
--color-review-text: color-mix(in srgb, var(--color-text) 4%, var(--color-review));
|
|
415
294
|
--shadow-md: 0 2px 4px -2px rgb(16 24 40 / 8%), 0 6px 12px -3px rgb(16 24 40 / 10%);
|
|
416
295
|
--shadow-lg: 0 8px 16px -6px rgb(16 24 40 / 12%), 0 18px 40px -12px rgb(16 24 40 / 16%);
|
|
417
296
|
}
|
|
@@ -423,140 +302,35 @@
|
|
|
423
302
|
--color-canvas: #0d1117;
|
|
424
303
|
--color-surface: #161b22;
|
|
425
304
|
--color-surface-raised: #1c2230;
|
|
426
|
-
--color-surface-subtle: #21262d;
|
|
427
|
-
--color-border: #30363d;
|
|
428
|
-
--color-border-muted: #21262d;
|
|
429
305
|
--color-border-strong: #484f58;
|
|
430
306
|
--color-text: #e6edf3;
|
|
431
|
-
--color-text-muted: #
|
|
307
|
+
--color-text-muted: #adb6bf;
|
|
432
308
|
--color-text-on-solid: #0d1117;
|
|
433
309
|
--color-primary: #388bfd;
|
|
434
310
|
--color-primary-hover: #58a6ff;
|
|
435
311
|
--color-primary-pressed: #79b8ff;
|
|
436
312
|
--color-primary-soft: #1a2e4a;
|
|
437
|
-
--color-success: #3fb950;
|
|
438
|
-
--color-success-soft: #122a1d;
|
|
439
|
-
--color-warning: #d29922;
|
|
440
|
-
--color-warning-soft: #2d2208;
|
|
441
313
|
--color-danger: #f85149;
|
|
442
314
|
--color-danger-hover: #ff6b63;
|
|
443
315
|
--color-danger-pressed: #ff8a84;
|
|
444
316
|
--color-danger-soft: #3a1515;
|
|
317
|
+
--color-success: #3fb950;
|
|
318
|
+
--color-success-soft: #122a1d;
|
|
319
|
+
--color-warning: #d29922;
|
|
320
|
+
--color-warning-soft: #2d2208;
|
|
445
321
|
--color-review: #a78bfa;
|
|
446
322
|
--color-review-soft: #2d1f4a;
|
|
447
323
|
--color-focus: #58a6ff;
|
|
448
|
-
--
|
|
449
|
-
--
|
|
450
|
-
--
|
|
451
|
-
--
|
|
452
|
-
--color-text-on-accent: #0d1117;
|
|
453
|
-
--shadow-sm: 0 1px 2px rgb(0 0 0 / 30%), 0 1px 3px rgb(0 0 0 / 40%);
|
|
324
|
+
--tint-rest: 7%;
|
|
325
|
+
--tint-hover: 10%;
|
|
326
|
+
--tint-pressed: 18%;
|
|
327
|
+
--indicator-edge: none;
|
|
454
328
|
--shadow-md: 0 4px 10px -3px rgb(0 0 0 / 45%);
|
|
455
329
|
--shadow-lg: 0 12px 32px -8px rgb(0 0 0 / 55%);
|
|
456
|
-
--color-primary-text: color-mix(in srgb, var(--color-text) 20%, var(--color-primary));
|
|
457
|
-
--indicator-tint: 45%;
|
|
458
|
-
--color-header: color-mix(in srgb, rgb(0 0 0) 85%, var(--color-canvas));
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
/* ── Theme: cherry-glaze ──────────────────────────────────────────────── */
|
|
462
|
-
[data-theme="cherry-glaze"] {
|
|
463
|
-
color-scheme: light;
|
|
464
|
-
|
|
465
|
-
--color-canvas: #e7d8cd;
|
|
466
|
-
--color-surface: #f5f2ea;
|
|
467
|
-
--color-surface-raised: #efe4dc;
|
|
468
|
-
--color-surface-subtle: #ece3da;
|
|
469
|
-
--color-border: #d7a3be;
|
|
470
|
-
--color-border-muted: #e7d8cd;
|
|
471
|
-
--color-border-strong: #b86b9c;
|
|
472
|
-
--color-text: #2f1d28;
|
|
473
|
-
--color-text-muted: #7c6470;
|
|
474
|
-
--color-text-on-solid: #f5f2ea;
|
|
475
|
-
--color-primary: #496f24;
|
|
476
|
-
--color-primary-hover: #3a5a1c;
|
|
477
|
-
--color-primary-pressed: #2d4615;
|
|
478
|
-
--color-primary-soft: #b7c991;
|
|
479
|
-
--color-success: #496f24;
|
|
480
|
-
--color-success-soft: #b7c991;
|
|
481
|
-
--color-warning: #6f4f24;
|
|
482
|
-
--color-warning-soft: #efdcb4;
|
|
483
|
-
--color-danger: #8f3e6e;
|
|
484
|
-
--color-danger-hover: #743158;
|
|
485
|
-
--color-danger-pressed: #5c2746;
|
|
486
|
-
--color-danger-soft: #d7a3be;
|
|
487
|
-
--color-review: #7c53d6;
|
|
488
|
-
--color-review-soft: #e8e0f8;
|
|
489
|
-
--color-focus: #7fa34c;
|
|
490
|
-
--color-accent: #b86b9c;
|
|
491
|
-
--color-accent-hover: #a55b8a;
|
|
492
|
-
--color-accent-pressed: #8f4c76;
|
|
493
|
-
--color-accent-soft: #e8c2d3;
|
|
494
|
-
|
|
495
|
-
/* Cherry Glaze is one of the two overrides: the accent pink lands at 2.9:1
|
|
496
|
-
* on its own soft fill, so text on it goes darker than the accent itself. */
|
|
497
|
-
--color-accent-text: #66304f;
|
|
498
|
-
--color-text-on-accent: #201018;
|
|
499
|
-
--shadow-sm: 0 1px 2px rgb(73 111 36 / 8%), 0 1px 3px rgb(73 111 36 / 12%);
|
|
500
|
-
--shadow-md: 0 2px 4px -2px rgb(73 111 36 / 10%), 0 6px 12px -3px rgb(73 111 36 / 12%);
|
|
501
|
-
--shadow-lg: 0 8px 16px -6px rgb(73 111 36 / 14%), 0 18px 40px -12px rgb(73 111 36 / 18%);
|
|
502
|
-
|
|
503
|
-
/* Accessible ink on the borderless soft status fills. */
|
|
504
|
-
--color-success-text: color-mix(in srgb, var(--color-text) 40%, var(--color-success));
|
|
505
|
-
--color-danger-text: color-mix(in srgb, var(--color-text) 40%, var(--color-danger));
|
|
506
|
-
--color-primary-text: color-mix(in srgb, var(--color-text) 40%, var(--color-primary));
|
|
507
|
-
--status-draft-text: color-mix(in srgb, var(--color-text) 60%, var(--color-text-muted));
|
|
508
|
-
--status-archived-text: color-mix(in srgb, var(--color-text) 60%, var(--color-text-muted));
|
|
509
|
-
--indicator-tint: 59%;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
/* ── Theme: black-hawaii ──────────────────────────────────────────────── */
|
|
513
|
-
[data-theme="black-hawaii"] {
|
|
514
|
-
color-scheme: dark;
|
|
515
330
|
|
|
516
|
-
|
|
517
|
-
--color-
|
|
518
|
-
--color-
|
|
519
|
-
--color-surface-subtle: #2f2d2a;
|
|
520
|
-
--color-border: #6e6a63;
|
|
521
|
-
--color-border-muted: #3a2a22;
|
|
522
|
-
--color-border-strong: #c99a5f;
|
|
523
|
-
--color-text: #f1e6d6;
|
|
524
|
-
--color-text-muted: #c99a5f;
|
|
525
|
-
--color-text-on-solid: #101010;
|
|
526
|
-
--color-primary: #d66a3a;
|
|
527
|
-
--color-primary-hover: #e0854f;
|
|
528
|
-
--color-primary-pressed: #ea9f73;
|
|
529
|
-
--color-primary-soft: #3a2a22;
|
|
530
|
-
--color-success: #4e8f8a;
|
|
531
|
-
--color-success-soft: #1d3331;
|
|
532
|
-
--color-warning: #c99a5f;
|
|
533
|
-
--color-warning-soft: #3b3222;
|
|
534
|
-
|
|
535
|
-
/* Lifted from #c44040, which sat at 3.8:1 against --color-text-on-solid. */
|
|
536
|
-
--color-danger: #d45454;
|
|
537
|
-
--color-danger-hover: #df6868;
|
|
538
|
-
--color-danger-pressed: #e98282;
|
|
539
|
-
--color-danger-soft: #421f1f;
|
|
540
|
-
--color-review: #9b7fe8;
|
|
541
|
-
--color-review-soft: #2a2040;
|
|
542
|
-
--color-focus: #e0854f;
|
|
543
|
-
--color-accent: #d66a3a;
|
|
544
|
-
--color-accent-hover: #e0854f;
|
|
545
|
-
--color-accent-pressed: #ea9f73;
|
|
546
|
-
--color-accent-soft: #3a2a22;
|
|
547
|
-
|
|
548
|
-
/* The second override: the accent orange is 3.9:1 on its own soft fill. */
|
|
549
|
-
--color-accent-text: #e0854f;
|
|
550
|
-
--color-text-on-accent: #101010;
|
|
551
|
-
--shadow-sm: 0 1px 2px rgb(0 0 0 / 40%), 0 1px 3px rgb(0 0 0 / 50%);
|
|
552
|
-
--shadow-md: 0 4px 10px -3px rgb(0 0 0 / 55%);
|
|
553
|
-
--shadow-lg: 0 12px 32px -8px rgb(0 0 0 / 62%);
|
|
554
|
-
|
|
555
|
-
/* Accessible ink on the borderless soft status fills. */
|
|
556
|
-
--color-primary-text: color-mix(in srgb, var(--color-text) 25%, var(--color-primary));
|
|
557
|
-
--color-success-text: color-mix(in srgb, var(--color-text) 25%, var(--color-success));
|
|
558
|
-
--color-danger-text: color-mix(in srgb, var(--color-text) 25%, var(--color-danger));
|
|
559
|
-
--indicator-tint: 45%;
|
|
331
|
+
/* Keep text readable on pressed active and destructive actions. */
|
|
332
|
+
--color-primary-text: color-mix(in srgb, var(--color-text) 54%, var(--color-primary));
|
|
333
|
+
--color-danger-text: color-mix(in srgb, var(--color-text) 52%, var(--color-danger));
|
|
560
334
|
--color-header: color-mix(in srgb, rgb(0 0 0) 85%, var(--color-canvas));
|
|
561
335
|
}
|
|
562
336
|
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./colour-BmtxDlWF.cjs"),t=require("./Icon-CD3oeiNA.cjs"),n=require("../components/Button/index.cjs"),r=require("./mergeRefs-CZ-SArlE.cjs"),i=require("./overlayLayer-seJG-EFn.cjs"),a=require("../components/TextField/index.cjs"),o=require("../components/FieldAffix/index.cjs"),s=require("../components/Popover/index.cjs"),c=require("./Slider-BfvNPjRJ.cjs");let l=require("react"),u=require("react/jsx-runtime");function d(e){let t=e.closest(`[aria-modal='true']`)??document.body,n=i.h(t).filter(e=>!e.closest(`.ds-popover`));(n[n.map(t=>e.contains(t)).lastIndexOf(!0)+1]??n[0])?.focus({preventScroll:!0})}function f(e){return Math.max(0,Math.min(100,e))}function p({colour:e,isDisabled:t,onChange:n}){let r=(0,l.useRef)(null),i=t=>{let r=t.currentTarget.getBoundingClientRect();r.width&&r.height&&n({...e,s:f((t.clientX-r.left)/r.width*100),v:f((1-(t.clientY-r.top)/r.height)*100)})};return(0,u.jsx)(`div`,{className:`ds-colour-panel__square`,role:`slider`,tabIndex:t?-1:0,"aria-label":`Saturation and brightness`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.s),"aria-valuetext":`Saturation ${Math.round(e.s)}%, brightness ${Math.round(e.v)}%`,"aria-disabled":t||void 0,onKeyDown:r=>{if(t)return;let i=r.shiftKey?10:1,a={ArrowLeft:{s:f(e.s-i)},ArrowRight:{s:f(e.s+i)},ArrowDown:{v:f(e.v-i)},ArrowUp:{v:f(e.v+i)},Home:{s:0},End:{s:100}}[r.key];a&&(r.preventDefault(),n({...e,...a}))},onPointerDown:e=>{t||e.button!==0||(e.preventDefault(),e.currentTarget.focus(),r.current=e.pointerId,e.currentTarget.setPointerCapture(e.pointerId),i(e))},onPointerMove:e=>{!t&&r.current===e.pointerId&&i(e)},onPointerUp:e=>{r.current===e.pointerId&&(r.current=null,e.currentTarget.releasePointerCapture(e.pointerId))},onPointerCancel:()=>{r.current=null},onLostPointerCapture:()=>{r.current=null},children:(0,u.jsx)(`span`,{className:`ds-colour-panel__thumb`,style:{left:`${e.s}%`,top:`${100-e.v}%`}})})}function m({value:t,defaultValue:n=``,onValueChange:r}){let[i,a]=(0,l.useState)(n),o=t??i,[s,c]=(0,l.useState)(()=>({source:o,colour:e.n(o)})),u=s.colour;return s.source!==o&&(u=e.n(o,u),c({source:o,colour:u})),{current:o,colour:u,commit:n=>{let i=typeof n==`string`?e.r(n):e.t(n);c({source:i,colour:typeof n==`string`?e.n(n,u):n}),t===void 0&&a(i),r?.(i)}}}function h(t,n){let[r,i]=(0,l.useState)(null);return r&&r.source!==t&&r.text===t&&i({source:t,text:t}),{text:r?.source===t?r.text:n||t,type:(n,r)=>i({source:r?e.r(n):t,text:n}),discard:()=>i(null)}}function g(){return window.EyeDropper}var _=()=>()=>{},v=[],y=8;function b(e,t,n){let r=t%y,i=r+Math.floor((n-1-r)/y)*y;switch(e){case`Home`:return 0;case`End`:return n-1;case`ArrowRight`:return(t+1)%n;case`ArrowLeft`:return(t-1+n)%n;case`ArrowDown`:return t+y<n?t+y:r;case`ArrowUp`:return t>=y?t-y:i;default:return}}var x=(0,l.forwardRef)(function({value:e,defaultValue:t,onValueChange:n,...r},i){let{current:a,colour:o,commit:s}=m({value:e,defaultValue:t,onValueChange:n});return(0,u.jsx)(S,{...r,ref:i,colour:o,current:a,onColourChange:s})}),S=(0,l.forwardRef)(function({colour:r,current:i,onColourChange:a,presets:o=v,showPresets:s=!0,picker:d=`custom`,isDisabled:f=!1,className:m,style:h,...x},S){let C=(0,l.useRef)(null),w=(0,l.useRef)(!0),T=(0,l.useRef)(f),[E,D]=(0,l.useState)(!1),[O,k]=(0,l.useState)(``),A=(0,l.useSyncExternalStore)(_,()=>!!g(),()=>!1),j=(0,l.useId)(),M=e.r(i),N=e.t({...r,a:1}),P=(0,l.useMemo)(()=>{let t=new Map;for(let n of o){let r=e.r(n);r&&!t.has(r)&&t.set(r,n)}return[...t].map(([e,t])=>({normalised:e,preset:t}))},[o]),F=P.findIndex(e=>e.normalised===M);(0,l.useEffect)(()=>{T.current=f},[f]),(0,l.useEffect)(()=>(w.current=!0,()=>{w.current=!1}),[]);let I=async()=>{let t=g();if(!(!t||f||E)){D(!0),k(``);try{let n=await new t().open();w.current&&!T.current&&e.i(n.sRGBHex)&&a({...e.n(n.sRGBHex,r),a:r.a})}catch(e){w.current&&!(e instanceof DOMException&&e.name===`AbortError`)&&k(`Unable to pick a colour from the screen. Try again.`)}finally{w.current&&D(!1)}}};return(0,u.jsxs)(`div`,{...x,ref:S,className:[`ds-colour-panel`,`ds-field-surface`,m].filter(Boolean).join(` `),"data-disabled":f||void 0,style:{...h,"--colour-hue":`hsl(${r.h} 100% 50%)`,"--colour-rgb":N,"--colour-rgba":e.t(r)},children:[(0,u.jsxs)(`div`,{className:`ds-colour-panel__head ds-field-surface`,children:[(0,u.jsx)(`span`,{children:`Colour`}),(0,u.jsx)(`span`,{className:`ds-colour-panel__value`,children:M||`No colour`})]}),d===`custom`?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(p,{colour:r,isDisabled:f,onChange:a}),(0,u.jsxs)(`div`,{className:`ds-colour-panel__hue-row`,children:[A&&(0,u.jsx)(n.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`pipette`,"aria-label":`Pick from screen`,isDisabled:f,"aria-busy":E||void 0,onClick:()=>void I()}),(0,u.jsx)(c.n,{className:`ds-colour-panel__hue`,value:r.h,min:0,max:360,step:1,hasValueLabel:!1,"aria-label":`Hue`,"aria-valuetext":`${Math.round(r.h)} degrees`,isDisabled:f,onValueChange:e=>a({...r,h:e}),onKeyDown:e=>{if(!e.shiftKey||![`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(e.key))return;e.preventDefault();let t=e.key===`ArrowRight`||e.key===`ArrowUp`?15:-15;a({...r,h:Math.max(0,Math.min(360,r.h+t))})}})]})]}):(0,u.jsxs)(`div`,{className:`ds-colour-panel__native`,children:[(0,u.jsx)(`input`,{ref:C,type:`color`,value:N,tabIndex:-1,"aria-hidden":`true`,disabled:f,onChange:t=>{e.i(t.target.value)&&a({...e.n(t.target.value,r),a:r.a})}}),(0,u.jsx)(n.Button,{variant:`neutral`,size:`sm`,iconStart:`pipette`,isDisabled:f,onClick:()=>{let e=C.current;if(e)try{e.showPicker?e.showPicker():e.click()}catch{e.click()}},children:`Custom colour…`})]}),(0,u.jsxs)(`div`,{className:`ds-colour-panel__opacity`,children:[(0,u.jsx)(`label`,{htmlFor:`${j}-opacity`,children:`Opacity`}),(0,u.jsx)(c.n,{id:`${j}-opacity`,className:`ds-colour-panel__alpha`,value:Math.round(r.a*100),min:0,max:100,step:1,suffix:`%`,isDisabled:f,onValueChange:e=>a({...r,a:e/100})})]}),s&&P.length>0&&(0,u.jsxs)(`div`,{className:`ds-colour-panel__presets`,children:[(0,u.jsx)(`span`,{id:j,className:`ds-colour-panel__presets-label`,children:`Presets`}),(0,u.jsx)(`div`,{className:`ds-colour-panel__grid`,role:`radiogroup`,"aria-labelledby":j,style:{"--colour-preset-columns":y},onKeyDown:e=>{let t=Array.from(e.currentTarget.querySelectorAll(`[role='radio']`)),n=t.indexOf(e.target),r=n<0?void 0:b(e.key,n,t.length);r!==void 0&&(e.preventDefault(),t[r]?.focus(),t[r]?.click())},children:P.map(({normalised:e,preset:r},i)=>{let o=i===F;return(0,u.jsx)(n.Button,{variant:`simple`,size:`xs`,isIconOnly:!0,role:`radio`,"aria-checked":o,"aria-label":r,title:r,tabIndex:i===Math.max(0,F)?0:-1,isDisabled:f,className:`ds-colour-panel__preset`,onClick:()=>a(r),children:(0,u.jsx)(`span`,{className:`ds-colour-swatch`,style:{"--colour-swatch":e},children:o&&(0,u.jsx)(t.t,{name:`check`,size:16,strokeWidth:3})})},e)})})]}),O&&(0,u.jsx)(`span`,{className:`ds-colour-panel__error`,role:`status`,children:O})]})}),C=(0,l.forwardRef)(function({value:t,defaultValue:c,onValueChange:f,onValidityChange:p,presets:g,showPresets:_,picker:v,placement:y,isDisabled:b=!1,disabled:x,readOnly:C,isInvalid:w,"aria-invalid":T,id:E,className:D,onBlur:O,onKeyDown:k,...A},j){let{current:M,colour:N,commit:P}=m({value:t,defaultValue:c,onValueChange:f}),[F,I]=(0,l.useState)(!1),L=i.o(F),R=(0,l.useRef)(null),z=(0,l.useRef)(null),B=(0,l.useRef)(null),V=(0,l.useRef)(null),H=(0,l.useId)(),U=E??`${H}-input`,W=e.r(M),{text:G,type:K,discard:q}=h(M,W),J=!(!G.trim()||e.i(G)),Y=b||x;L&&(Y||C)&&I(!1);let X=L&&!Y&&!C;(0,l.useEffect)(()=>{p?.(!J),z.current?.setCustomValidity(J?`Enter a colour, such as #0052CC or rebeccapurple.`:``)},[J,p]),(0,l.useEffect)(()=>{if(!X)return;V.current&&i.h(V.current)[0]?.focus({preventScroll:!0});let e=e=>{let t=e.target;t&&!R.current?.contains(t)&&!V.current?.contains(t)&&I(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[X]);let Z=e=>{B.current=e,I(!X)},Q=()=>{I(!1),B.current?.focus({preventScroll:!0})},$={"aria-label":X?`Close colour picker`:`Open colour picker`,"aria-haspopup":`dialog`,"aria-expanded":X,"aria-controls":X?H:void 0,isDisabled:Y||C};return(0,u.jsxs)(`div`,{className:`ds-colour-field`,ref:R,onBlur:e=>{let t=e.relatedTarget;t&&!R.current?.contains(t)&&!V.current?.contains(t)&&I(!1)},onKeyDown:e=>{if(X&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Q()),!X||e.key!==`Tab`||!V.current?.contains(e.target))return;let t=i.h(V.current);(e.shiftKey?e.target===t[0]:e.target===t.at(-1))&&(e.preventDefault(),e.stopPropagation(),I(!1),e.shiftKey?B.current?.focus({preventScroll:!0}):R.current&&d(R.current))},children:[(0,u.jsx)(o.FieldAffix,{isLeadInteractive:!0,isTrailInteractive:!0,lead:(0,u.jsx)(n.Button,{"aria-hidden":`true`,tabIndex:-1,isDisabled:$.isDisabled,variant:`simple`,size:`xs`,isIconOnly:!0,onMouseDown:e=>e.preventDefault(),onClick:()=>{B.current=z.current,X?Q():I(!0)},children:(0,u.jsx)(`span`,{className:`ds-colour-swatch ds-colour-field__swatch`,style:{"--colour-swatch":W||`transparent`}})}),trail:(0,u.jsx)(n.Button,{...$,variant:`simple`,size:`xs`,isIconOnly:!0,iconStart:`chevron-down`,onClick:e=>Z(e.currentTarget)}),children:(0,u.jsx)(a.TextField,{...A,ref:r.t(z,j),id:U,disabled:Y,readOnly:C,spellCheck:!1,autoComplete:`off`,value:G,"aria-invalid":J||w||T||void 0,"aria-haspopup":`dialog`,"aria-controls":X?H:void 0,className:[`ds-colour-field__input`,D].filter(Boolean).join(` `),onChange:t=>{let n=t.target.value,r=!n.trim()||!!e.i(n);K(n,r),r&&P(n)},onBlur:e=>{J||q(),O?.(e)},onKeyDown:e=>{k?.(e),!e.defaultPrevented&&(e.key===`Enter`&&!J&&(e.preventDefault(),q()),e.key===`ArrowDown`&&!Y&&!C&&(e.preventDefault(),B.current=e.currentTarget,I(!0)))}})}),(0,u.jsx)(s.Popover,{anchorRef:z,anchorId:U,isOpen:X,align:`start`,placement:y,panelRef:V,id:H,role:`dialog`,"aria-label":`Choose a colour`,tabIndex:-1,className:`ds-colour-field__popover`,children:(0,u.jsx)(S,{colour:N,current:W,presets:g,showPresets:_,picker:v,onColourChange:e=>{q(),P(e)}})})]})});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return C}});
|
|
2
|
-
//# sourceMappingURL=ColourField-BdobU76j.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColourField-BdobU76j.cjs","names":["tabbableControls","useRef","useState","colourState","normaliseColour","colourHex","forwardRef","useRef","useState","useSyncExternalStore","useId","normaliseColour","colourHex","useMemo","parseColour","colourState","_Fragment","Button","Slider","Icon","forwardRef","useState","useOverlayOpen","useRef","useId","normaliseColour","parseColour","tabbableControls","FieldAffix","Button","TextField","mergeRefs","Popover","require_colour","require_Icon","require_components_Button_index","require_mergeRefs","require_overlayLayer","require_components_TextField_index","require_components_FieldAffix_index","require_components_Popover_index","require_Slider","react","react_jsx_runtime","focusAfterField","boundary","root","controls","element","clamp","value","ColourSquare","dragging","update","rect","event","onChange","colour","isDisabled","step","change","useColourValue","internal","setInternal","defaultValue","current","selection","setSelection","hex","next","onValueChange","useColourDraft","draft","setDraft","isValid","eyeDropperConstructor","subscribe","noPresets","presetColumns","presetTarget","column","index","lastInColumn","count","key","ColourPanel","rest","ColourPanelContent","commit","inputRef","active","disabledRef","isPicking","setPicking","pickerError","setPickerError","hasEyeDropper","presetsId","rgb","swatches","unique","preset","presets","normalised","selectedIndex","swatch","pickFromScreen","EyeDropper","result","onColourChange","error","className","style","picker","delta","input","a","showPresets","radios","selected","ColourField","ariaInvalid","open","setOpen","isOpen","rootRef","openerRef","panelRef","panelId","fieldId","id","invalid","text","effectiveDisabled","disabled","readOnly","visible","onValidityChange","outside","target","toggle","opener","close","triggerProps","ref","isInvalid","valid","type","discard","onBlur","onKeyDown"],"sources":["../../src/components/ColourField/focus.ts","../../src/components/ColourField/square.tsx","../../src/components/ColourField/value.ts","../../src/components/ColourField/panel.tsx","../../src/components/ColourField/index.tsx"],"sourcesContent":["import { tabbableControls } from \"../../internal/dialogFocus\";\n\n/** Continue after the composed field, respecting an enclosing modal's focus boundary. */\nexport function focusAfterField(root: HTMLElement) {\n const boundary = root.closest<HTMLElement>(\"[aria-modal='true']\") ?? document.body;\n const controls = tabbableControls(boundary).filter((element) => !element.closest(\".ds-popover\"));\n const last = controls.map((element) => root.contains(element)).lastIndexOf(true);\n const next = controls[last + 1] ?? controls[0];\n next?.focus({ preventScroll: true });\n}\n","import { useRef, type KeyboardEvent, type PointerEvent } from \"react\";\nimport type { Colour } from \"./colour\";\n\ninterface ColourSquareProps {\n colour: Colour;\n isDisabled: boolean;\n onChange: (colour: Colour) => void;\n}\n\nfunction clamp(value: number) {\n return Math.max(0, Math.min(100, value));\n}\n\nexport function ColourSquare({ colour, isDisabled, onChange }: ColourSquareProps) {\n const dragging = useRef<number | null>(null);\n const update = (event: PointerEvent<HTMLDivElement>) => {\n const rect = event.currentTarget.getBoundingClientRect();\n if (!rect.width || !rect.height) {\n return;\n }\n onChange({\n ...colour,\n s: clamp(((event.clientX - rect.left) / rect.width) * 100),\n v: clamp((1 - (event.clientY - rect.top) / rect.height) * 100),\n });\n };\n const handleKey = (event: KeyboardEvent) => {\n if (isDisabled) {\n return;\n }\n const step = event.shiftKey ? 10 : 1;\n const changes: Record<string, Partial<Colour>> = {\n ArrowLeft: { s: clamp(colour.s - step) },\n ArrowRight: { s: clamp(colour.s + step) },\n ArrowDown: { v: clamp(colour.v - step) },\n ArrowUp: { v: clamp(colour.v + step) },\n Home: { s: 0 },\n End: { s: 100 },\n };\n const change = changes[event.key];\n if (!change) {\n return;\n }\n event.preventDefault();\n onChange({ ...colour, ...change });\n };\n return (\n <div\n className=\"ds-colour-panel__square\"\n role=\"slider\"\n tabIndex={isDisabled ? -1 : 0}\n aria-label=\"Saturation and brightness\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(colour.s)}\n aria-valuetext={`Saturation ${Math.round(colour.s)}%, brightness ${Math.round(colour.v)}%`}\n aria-disabled={isDisabled || undefined}\n onKeyDown={handleKey}\n onPointerDown={(event) => {\n if (isDisabled || event.button !== 0) {\n return;\n }\n event.preventDefault();\n event.currentTarget.focus();\n dragging.current = event.pointerId;\n event.currentTarget.setPointerCapture(event.pointerId);\n update(event);\n }}\n onPointerMove={(event) => {\n if (!isDisabled && dragging.current === event.pointerId) {\n update(event);\n }\n }}\n onPointerUp={(event) => {\n if (dragging.current !== event.pointerId) {\n return;\n }\n dragging.current = null;\n event.currentTarget.releasePointerCapture(event.pointerId);\n }}\n onPointerCancel={() => {\n dragging.current = null;\n }}\n onLostPointerCapture={() => {\n dragging.current = null;\n }}\n >\n <span\n className=\"ds-colour-panel__thumb\"\n style={{ left: `${colour.s}%`, top: `${100 - colour.v}%` }}\n />\n </div>\n );\n}\n","import { useState } from \"react\";\nimport { colourHex, colourState, normaliseColour, type Colour } from \"./colour\";\n\nexport interface ColourValueProps {\n value?: string;\n defaultValue?: string;\n /** Uppercase hex (including alpha when needed), or an empty string when cleared. */\n onValueChange?: (value: string) => void;\n}\n\nexport function useColourValue({ value, defaultValue = \"\", onValueChange }: ColourValueProps) {\n const [internal, setInternal] = useState(defaultValue);\n const current = value ?? internal;\n const [selection, setSelection] = useState(() => ({\n source: current,\n colour: colourState(current),\n }));\n let colour = selection.colour;\n if (selection.source !== current) {\n colour = colourState(current, colour);\n setSelection({ source: current, colour });\n }\n\n const commit = (next: string | Colour) => {\n const hex = typeof next === \"string\" ? normaliseColour(next) : colourHex(next);\n setSelection({\n source: hex,\n colour: typeof next === \"string\" ? colourState(next, colour) : next,\n });\n if (value === undefined) {\n setInternal(hex);\n }\n onValueChange?.(hex);\n };\n\n return { current, colour, commit };\n}\n\n/** Typed text the field shows until it is committed, blurred, or replaced. */\nexport function useColourDraft(current: string, hex: string) {\n const [draft, setDraft] = useState<{ source: string; text: string } | null>(null);\n // A draft belongs to the value it was typed over. A parent that stores the invalid\n // text (FormEditor does) takes it over, so restoring the earlier value then wins.\n if (draft && draft.source !== current && draft.text === current) {\n setDraft({ source: current, text: current });\n }\n const text = draft?.source === current ? draft.text : hex || current;\n /** Valid text becomes the committed hex; invalid text stays over the current value. */\n const type = (next: string, isValid: boolean) =>\n setDraft({ source: isValid ? normaliseColour(next) : current, text: next });\n return { text, type, discard: () => setDraft(null) };\n}\n","import {\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { Slider } from \"../Slider\";\nimport { colourHex, colourState, normaliseColour, parseColour, type Colour } from \"./colour\";\nimport { ColourSquare } from \"./square\";\nimport { useColourValue, type ColourValueProps } from \"./value\";\nimport \"./style.css\";\n\nexport interface ColourPickerOptions {\n presets?: string[];\n showPresets?: boolean;\n picker?: \"custom\" | \"native\";\n isDisabled?: boolean;\n}\n\nexport interface ColourPanelProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, \"defaultValue\" | \"onChange\">,\n ColourValueProps,\n ColourPickerOptions {}\n\ninterface EyeDropperInstance {\n open: () => Promise<{ sRGBHex: string }>;\n}\nfunction eyeDropperConstructor() {\n return (window as Window & { EyeDropper?: new () => EyeDropperInstance }).EyeDropper;\n}\nconst subscribe = () => () => {};\nconst noPresets: string[] = [];\nconst presetColumns = 8;\n\n/** Where a key moves within the preset grid; rows wrap within their column. */\nfunction presetTarget(key: string, index: number, count: number) {\n const column = index % presetColumns;\n const lastInColumn = column + Math.floor((count - 1 - column) / presetColumns) * presetColumns;\n switch (key) {\n case \"Home\":\n return 0;\n case \"End\":\n return count - 1;\n case \"ArrowRight\":\n return (index + 1) % count;\n case \"ArrowLeft\":\n return (index - 1 + count) % count;\n case \"ArrowDown\":\n return index + presetColumns < count ? index + presetColumns : column;\n case \"ArrowUp\":\n return index >= presetColumns ? index - presetColumns : lastInColumn;\n default:\n return undefined;\n }\n}\n\n/** A standalone colour selection surface, also composed by ColourField. */\nexport const ColourPanel = forwardRef<HTMLDivElement, ColourPanelProps>(function ColourPanel(\n { value, defaultValue, onValueChange, ...rest },\n ref,\n) {\n const { current, colour, commit } = useColourValue({ value, defaultValue, onValueChange });\n return (\n <ColourPanelContent\n {...rest}\n ref={ref}\n colour={colour}\n current={current}\n onColourChange={commit}\n />\n );\n});\n\ninterface ColourPanelContentProps extends Omit<\n ColourPanelProps,\n \"value\" | \"defaultValue\" | \"onValueChange\"\n> {\n colour: Colour;\n current: string;\n onColourChange: (colour: Colour | string) => void;\n}\n\nexport const ColourPanelContent = forwardRef<HTMLDivElement, ColourPanelContentProps>(\n function ColourPanelContent(\n {\n colour,\n current,\n onColourChange,\n presets = noPresets,\n showPresets = true,\n picker = \"custom\",\n isDisabled = false,\n className,\n style,\n ...rest\n },\n ref,\n ) {\n const inputRef = useRef<HTMLInputElement>(null);\n const active = useRef(true);\n const disabledRef = useRef(isDisabled);\n const [isPicking, setPicking] = useState(false);\n const [pickerError, setPickerError] = useState(\"\");\n const hasEyeDropper = useSyncExternalStore(\n subscribe,\n () => Boolean(eyeDropperConstructor()),\n () => false,\n );\n const presetsId = useId();\n const hex = normaliseColour(current);\n const rgb = colourHex({ ...colour, a: 1 });\n // Equivalent spellings collapse onto the first; each preset is parsed once.\n const swatches = useMemo(() => {\n const unique = new Map<string, string>();\n for (const preset of presets) {\n const normalised = normaliseColour(preset);\n if (normalised && !unique.has(normalised)) {\n unique.set(normalised, preset);\n }\n }\n return [...unique].map(([normalised, preset]) => ({ normalised, preset }));\n }, [presets]);\n const selectedIndex = swatches.findIndex((swatch) => swatch.normalised === hex);\n useEffect(() => {\n disabledRef.current = isDisabled;\n }, [isDisabled]);\n useEffect(() => {\n active.current = true;\n return () => {\n active.current = false;\n };\n }, []);\n\n const pickFromScreen = async () => {\n const EyeDropper = eyeDropperConstructor();\n if (!EyeDropper || isDisabled || isPicking) {\n return;\n }\n setPicking(true);\n setPickerError(\"\");\n try {\n const result = await new EyeDropper().open();\n if (active.current && !disabledRef.current) {\n if (parseColour(result.sRGBHex)) {\n onColourChange({ ...colourState(result.sRGBHex, colour), a: colour.a });\n }\n }\n } catch (error) {\n if (active.current && !(error instanceof DOMException && error.name === \"AbortError\")) {\n setPickerError(\"Unable to pick a colour from the screen. Try again.\");\n }\n } finally {\n if (active.current) {\n setPicking(false);\n }\n }\n };\n\n return (\n <div\n {...rest}\n ref={ref}\n className={[\"ds-colour-panel\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n data-disabled={isDisabled || undefined}\n style={\n {\n ...style,\n \"--colour-hue\": `hsl(${colour.h} 100% 50%)`,\n \"--colour-rgb\": rgb,\n \"--colour-rgba\": colourHex(colour),\n } as CSSProperties\n }\n >\n <div className=\"ds-colour-panel__head ds-field-surface\">\n <span>Colour</span>\n <span className=\"ds-colour-panel__value\">{hex || \"No colour\"}</span>\n </div>\n {picker === \"custom\" ? (\n <>\n <ColourSquare\n colour={colour}\n isDisabled={isDisabled}\n onChange={onColourChange}\n />\n <div className=\"ds-colour-panel__hue-row\">\n {hasEyeDropper && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"pipette\"\n aria-label=\"Pick from screen\"\n isDisabled={isDisabled}\n // Busy, not pending: a pending Button disables itself and drops focus.\n aria-busy={isPicking || undefined}\n onClick={() => void pickFromScreen()}\n />\n )}\n <Slider\n className=\"ds-colour-panel__hue\"\n value={colour.h}\n min={0}\n max={360}\n step={1}\n hasValueLabel={false}\n aria-label=\"Hue\"\n aria-valuetext={`${Math.round(colour.h)} degrees`}\n isDisabled={isDisabled}\n onValueChange={(h) => onColourChange({ ...colour, h })}\n onKeyDown={(event) => {\n if (\n !event.shiftKey ||\n ![\"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\"].includes(event.key)\n ) {\n return;\n }\n event.preventDefault();\n const delta = event.key === \"ArrowRight\" || event.key === \"ArrowUp\" ? 15 : -15;\n onColourChange({ ...colour, h: Math.max(0, Math.min(360, colour.h + delta)) });\n }}\n />\n </div>\n </>\n ) : (\n <div className=\"ds-colour-panel__native\">\n <input\n ref={inputRef}\n type=\"color\"\n value={rgb}\n tabIndex={-1}\n aria-hidden=\"true\"\n disabled={isDisabled}\n onChange={(event) => {\n if (parseColour(event.target.value)) {\n onColourChange({ ...colourState(event.target.value, colour), a: colour.a });\n }\n }}\n />\n <Button\n variant=\"neutral\"\n size=\"sm\"\n iconStart=\"pipette\"\n isDisabled={isDisabled}\n onClick={() => {\n const input = inputRef.current;\n if (!input) {\n return;\n }\n try {\n if (input.showPicker) {\n input.showPicker();\n } else {\n input.click();\n }\n } catch {\n input.click();\n }\n }}\n >\n Custom colour…\n </Button>\n </div>\n )}\n <div className=\"ds-colour-panel__opacity\">\n <label htmlFor={`${presetsId}-opacity`}>Opacity</label>\n <Slider\n id={`${presetsId}-opacity`}\n className=\"ds-colour-panel__alpha\"\n value={Math.round(colour.a * 100)}\n min={0}\n max={100}\n step={1}\n suffix=\"%\"\n isDisabled={isDisabled}\n onValueChange={(a) => onColourChange({ ...colour, a: a / 100 })}\n />\n </div>\n {showPresets && swatches.length > 0 && (\n <div className=\"ds-colour-panel__presets\">\n <span\n id={presetsId}\n className=\"ds-colour-panel__presets-label\"\n >\n Presets\n </span>\n <div\n className=\"ds-colour-panel__grid\"\n role=\"radiogroup\"\n aria-labelledby={presetsId}\n style={{ \"--colour-preset-columns\": presetColumns } as CSSProperties}\n onKeyDown={(event) => {\n const radios = Array.from(\n event.currentTarget.querySelectorAll<HTMLButtonElement>(\"[role='radio']\"),\n );\n const index = radios.indexOf(event.target as HTMLButtonElement);\n const next = index < 0 ? undefined : presetTarget(event.key, index, radios.length);\n if (next === undefined) {\n return;\n }\n event.preventDefault();\n radios[next]?.focus();\n radios[next]?.click();\n }}\n >\n {swatches.map(({ normalised, preset }, index) => {\n const selected = index === selectedIndex;\n return (\n <Button\n key={normalised}\n variant=\"simple\"\n size=\"xs\"\n isIconOnly\n role=\"radio\"\n aria-checked={selected}\n aria-label={preset}\n title={preset}\n tabIndex={index === Math.max(0, selectedIndex) ? 0 : -1}\n isDisabled={isDisabled}\n className=\"ds-colour-panel__preset\"\n onClick={() => onColourChange(preset)}\n >\n <span\n className=\"ds-colour-swatch\"\n style={{ \"--colour-swatch\": normalised } as CSSProperties}\n >\n {selected && (\n <Icon\n name=\"check\"\n size={16}\n strokeWidth={3}\n />\n )}\n </span>\n </Button>\n );\n })}\n </div>\n </div>\n )}\n {pickerError && (\n <span\n className=\"ds-colour-panel__error\"\n role=\"status\"\n >\n {pickerError}\n </span>\n )}\n </div>\n );\n },\n);\n","import { useOverlayOpen } from \"../../internal/overlayLayer\";\nimport { forwardRef, useEffect, useId, useRef, useState, type CSSProperties } from \"react\";\nimport { Button } from \"../Button\";\nimport { FieldAffix } from \"../FieldAffix\";\nimport { Popover, type PopoverPlacement } from \"../Popover\";\nimport { TextField, type TextFieldProps } from \"../TextField\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { normaliseColour, parseColour } from \"./colour\";\nimport { tabbableControls } from \"../../internal/dialogFocus\";\nimport { focusAfterField } from \"./focus\";\nimport { ColourPanelContent, type ColourPickerOptions } from \"./panel\";\nimport { useColourDraft, useColourValue, type ColourValueProps } from \"./value\";\nimport \"./style.css\";\n\nexport { ColourPanel } from \"./panel\";\nexport type { ColourPanelProps } from \"./panel\";\n\nexport interface ColourFieldProps\n extends\n Omit<TextFieldProps, \"value\" | \"defaultValue\" | \"onChange\" | \"type\" | \"children\">,\n ColourValueProps,\n ColourPickerOptions {\n isInvalid?: boolean;\n placement?: PopoverPlacement;\n /** Parsing validity; an empty value is valid and native required validation remains separate. */\n onValidityChange?: (isValid: boolean) => void;\n}\n\n/** A typed colour value and a visual picker, bound to the shared Field frame. */\nexport const ColourField = forwardRef<HTMLInputElement, ColourFieldProps>(function ColourField(\n {\n value,\n defaultValue,\n onValueChange,\n onValidityChange,\n presets,\n showPresets,\n picker,\n placement,\n isDisabled = false,\n disabled,\n readOnly,\n isInvalid,\n \"aria-invalid\": ariaInvalid,\n id,\n className,\n onBlur,\n onKeyDown,\n ...rest\n },\n ref,\n) {\n const { current, colour, commit } = useColourValue({ value, defaultValue, onValueChange });\n const [open, setOpen] = useState(false);\n const isOpen = useOverlayOpen(open);\n const rootRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const openerRef = useRef<HTMLElement | null>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const panelId = useId();\n const fieldId = id ?? `${panelId}-input`;\n const hex = normaliseColour(current);\n const { text, type, discard } = useColourDraft(current, hex);\n const invalid = Boolean(text.trim() && !parseColour(text));\n const effectiveDisabled = isDisabled || disabled;\n if (isOpen && (effectiveDisabled || readOnly)) {\n setOpen(false);\n }\n const visible = isOpen && !effectiveDisabled && !readOnly;\n\n useEffect(() => {\n onValidityChange?.(!invalid);\n inputRef.current?.setCustomValidity(\n invalid ? \"Enter a colour, such as #0052CC or rebeccapurple.\" : \"\",\n );\n }, [invalid, onValidityChange]);\n\n useEffect(() => {\n if (!visible) {\n return;\n }\n if (panelRef.current) {\n tabbableControls(panelRef.current)[0]?.focus({ preventScroll: true });\n }\n const outside = (event: MouseEvent) => {\n const target = event.target as Node;\n if (target && !rootRef.current?.contains(target) && !panelRef.current?.contains(target)) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", outside);\n return () => document.removeEventListener(\"mousedown\", outside);\n }, [visible]);\n\n const toggle = (opener: HTMLElement) => {\n openerRef.current = opener;\n setOpen(!visible);\n };\n const close = () => {\n setOpen(false);\n openerRef.current?.focus({ preventScroll: true });\n };\n const triggerProps = {\n \"aria-label\": visible ? \"Close colour picker\" : \"Open colour picker\",\n \"aria-haspopup\": \"dialog\" as const,\n \"aria-expanded\": visible,\n \"aria-controls\": visible ? panelId : undefined,\n isDisabled: effectiveDisabled || readOnly,\n };\n\n return (\n <div\n className=\"ds-colour-field\"\n ref={rootRef}\n onBlur={(event) => {\n const target = event.relatedTarget as Node | null;\n if (target && !rootRef.current?.contains(target) && !panelRef.current?.contains(target)) {\n setOpen(false);\n }\n }}\n onKeyDown={(event) => {\n if (visible && event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n close();\n }\n if (!visible || event.key !== \"Tab\" || !panelRef.current?.contains(event.target as Node)) {\n return;\n }\n const controls = tabbableControls(panelRef.current);\n const atBoundary = event.shiftKey\n ? event.target === controls[0]\n : event.target === controls.at(-1);\n if (!atBoundary) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n setOpen(false);\n if (event.shiftKey) {\n openerRef.current?.focus({ preventScroll: true });\n } else if (rootRef.current) {\n focusAfterField(rootRef.current);\n }\n }}\n >\n <FieldAffix\n isLeadInteractive\n isTrailInteractive\n lead={\n // A pointer shortcut only: the chevron is the one keyboard and screen\n // reader trigger. The swatch never takes focus; the input gets it back.\n <Button\n aria-hidden=\"true\"\n tabIndex={-1}\n isDisabled={triggerProps.isDisabled}\n variant=\"simple\"\n size=\"xs\"\n isIconOnly\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n openerRef.current = inputRef.current;\n if (visible) {\n close();\n } else {\n setOpen(true);\n }\n }}\n >\n <span\n className=\"ds-colour-swatch ds-colour-field__swatch\"\n style={{ \"--colour-swatch\": hex || \"transparent\" } as CSSProperties}\n />\n </Button>\n }\n trail={\n <Button\n {...triggerProps}\n variant=\"simple\"\n size=\"xs\"\n isIconOnly\n iconStart=\"chevron-down\"\n onClick={(event) => toggle(event.currentTarget)}\n />\n }\n >\n <TextField\n {...rest}\n ref={mergeRefs(inputRef, ref)}\n id={fieldId}\n disabled={effectiveDisabled}\n readOnly={readOnly}\n spellCheck={false}\n autoComplete=\"off\"\n value={text}\n aria-invalid={invalid || isInvalid || ariaInvalid || undefined}\n aria-haspopup=\"dialog\"\n aria-controls={visible ? panelId : undefined}\n className={[\"ds-colour-field__input\", className].filter(Boolean).join(\" \")}\n onChange={(event) => {\n const next = event.target.value;\n const valid = !next.trim() || Boolean(parseColour(next));\n type(next, valid);\n if (valid) {\n commit(next);\n }\n }}\n onBlur={(event) => {\n if (!invalid) {\n discard();\n }\n onBlur?.(event);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) {\n return;\n }\n if (event.key === \"Enter\" && !invalid) {\n event.preventDefault();\n discard();\n }\n if (event.key === \"ArrowDown\" && !effectiveDisabled && !readOnly) {\n event.preventDefault();\n openerRef.current = event.currentTarget;\n setOpen(true);\n }\n }}\n />\n </FieldAffix>\n <Popover\n anchorRef={inputRef}\n anchorId={fieldId}\n isOpen={visible}\n align=\"start\"\n placement={placement}\n panelRef={panelRef}\n id={panelId}\n role=\"dialog\"\n aria-label=\"Choose a colour\"\n // A click on the padding or a label focuses the dialog rather than the page,\n // so the field's own Escape handler still runs before an enclosing Modal's.\n tabIndex={-1}\n className=\"ds-colour-field__popover\"\n >\n <ColourPanelContent\n colour={colour}\n current={hex}\n presets={presets}\n showPresets={showPresets}\n picker={picker}\n onColourChange={(next) => {\n discard();\n commit(next);\n }}\n />\n </Popover>\n </div>\n );\n});\n"],"mappings":"A,0aAGA,SAAgB4C,EAAgB,EAAmB,CACjD,IAAMC,EAAWC,EAAK,QAAqB,qBAAqB,GAAK,SAAS,KACxEC,EAAW/C,EAAAA,EAAiB6C,CAAQ,CAAC,CAAC,OAAQ,GAAY,CAACG,EAAQ,QAAQ,aAAa,CAAC,GAEl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