@justanarthur/modo-ui 2.6.0 → 2.6.2

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.
@@ -42,7 +42,10 @@ interface EditableTextProps {
42
42
  * that shows on hover. The text is selected; Enter or leaving the field
43
43
  * commits, Escape puts the old text back. The text and the input share one
44
44
  * box on the field ladder, invisible at rest and lit on hover, so editing
45
- * never moves anything around it. Works controlled (`value` +
45
+ * never moves anything around it. At rest it reads as plain text; while
46
+ * editing the box takes the focused field's fill, with no ring (a text field
47
+ * signals focus by its fill), and the focus ring shows only when the text or
48
+ * the pencil is reached by keyboard. Works controlled (`value` +
46
49
  * `onValueChange`) or uncontrolled (`defaultValue`).
47
50
  *
48
51
  * @example {@include ./examples.mdx}
@@ -103,7 +106,9 @@ function EditableText({
103
106
  {...field.props}
104
107
  className={cn(
105
108
  field.props.className,
106
- 'inline-flex max-w-full min-w-0 items-center has-[:focus-visible]:!ring-focus-ring',
109
+ // The ring marks keyboard focus on the text or the pencil; the input, a text
110
+ // field, signals focus by its fill alone.
111
+ 'inline-flex max-w-full min-w-0 items-center has-[button:focus-visible]:!ring-focus-ring',
107
112
  size.control,
108
113
  size.gap,
109
114
  className,
@@ -12,6 +12,8 @@ import { forwardRef, type HTMLAttributes, useCallback, useEffect, useMemo, useRe
12
12
  import { mergeRefs } from '../../../lib/merge-refs'
13
13
  import { useShape } from '../../../lib/shape-context'
14
14
  import { spring } from '../../../lib/springs'
15
+ import { SURFACE_BG } from '../../../lib/surface-classes'
16
+ import { useSurface } from '../../../lib/surface-context'
15
17
  import { cn } from '../../../lib/utils'
16
18
  import { layoutPos, PIP_SIZE, snapValue, useDelayedFlag } from './geometry'
17
19
  import { ValueBubble } from './value-display'
@@ -69,6 +71,8 @@ const ComfortableSlider = forwardRef<HTMLDivElement, ComfortableSliderProps>(
69
71
  } | null>(null)
70
72
  const showHoverTooltip = useDelayedFlag(isHovered, 100)
71
73
  const shape = useShape()
74
+ // The mask paints the surface the slider sits on: inside a popover that is a lifted level, not the page.
75
+ const substrate = SURFACE_BG[useSurface()]
72
76
 
73
77
  const pipSteps = useMemo(
74
78
  () => Array.from({ length: Math.round((max - min) / step) + 1 }, (_, i) => min + i * step),
@@ -388,9 +392,9 @@ const ComfortableSlider = forwardRef<HTMLDivElement, ComfortableSliderProps>(
388
392
  {/* Masks the pips behind the label and value. */}
389
393
  {variant === 'pips' && (
390
394
  <div className="absolute inset-0 flex items-center px-2 z-[2] pointer-events-none" aria-hidden>
391
- {label && <span className="text-body px-2 bg-background text-transparent select-none">{label}</span>}
395
+ {label && <span className={cn('text-body px-2 text-transparent select-none', substrate)}>{label}</span>}
392
396
  <span
393
- className="text-body tabular-nums ml-auto px-2 bg-background text-transparent select-none"
397
+ className={cn('text-body tabular-nums ml-auto px-2 text-transparent select-none', substrate)}
394
398
  style={{ minWidth: `${String(formatValue(max)).length}ch` }}
395
399
  >
396
400
  {formatValue(value)}
@@ -4,13 +4,13 @@ import {
4
4
  ColorPickerPopover2,
5
5
  ColorPicker2,
6
6
  color_picker_default
7
- } from "../../../shared/components-mzdbtgvz.js";
7
+ } from "../../../shared/components-fnvkq52e.js";
8
8
  import {
9
9
  parseColor2,
10
10
  buildParsed2
11
11
  } from "../../../shared/components-pa2t12j2.js";
12
12
  import"../../../shared/components-7rn454aq.js";
13
- import"../../../shared/components-vx286kq7.js";
13
+ import"../../../shared/components-qqm2y2cx.js";
14
14
  import"../../../shared/components-mse06t0x.js";
15
15
  import"../../../shared/components-nxqrw789.js";
16
16
  import"../../../shared/components-ft5dgjg6.js";
@@ -29,7 +29,10 @@ type Element_12xgc = JSX_1kxb["Element"];
29
29
  * that shows on hover. The text is selected; Enter or leaving the field
30
30
  * commits, Escape puts the old text back. The text and the input share one
31
31
  * box on the field ladder, invisible at rest and lit on hover, so editing
32
- * never moves anything around it. Works controlled (`value` +
32
+ * never moves anything around it. At rest it reads as plain text; while
33
+ * editing the box takes the focused field's fill, with no ring (a text field
34
+ * signals focus by its fill), and the focus ring shows only when the text or
35
+ * the pencil is reached by keyboard. Works controlled (`value` +
33
36
  * `onValueChange`) or uncontrolled (`defaultValue`).
34
37
  *
35
38
  * @example {@include ./examples.mdx}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EditableText2,
3
3
  editable_text_default
4
- } from "../../../shared/components-m3vxpz2z.js";
4
+ } from "../../../shared/components-2e77rzb8.js";
5
5
  import"../../../shared/components-1ztgy933.js";
6
6
  import"../../../shared/components-grxgqa75.js";
7
7
  import"../../../shared/components-jnhpgpfk.js";
@@ -1,12 +1,14 @@
1
1
  import {
2
2
  Slider2,
3
3
  slider_default
4
- } from "../../../shared/components-vx286kq7.js";
4
+ } from "../../../shared/components-qqm2y2cx.js";
5
5
  import"../../../shared/components-bkwjvvkh.js";
6
6
  import"../../../shared/components-45r18egt.js";
7
7
  import"../../../shared/components-wwd093xg.js";
8
8
  import"../../../shared/components-znspksk0.js";
9
9
  import"../../../shared/components-ew4wq7mj.js";
10
+ import"../../../shared/components-ceyn28cf.js";
11
+ import"../../../shared/components-nwa2a9tq.js";
10
12
  import"../../../shared/components-kxpcj2ry.js";
11
13
  import"../../../shared/components-s217vq1n.js";
12
14
  import"../../../shared/components-xnp09586.js";
package/dist/index.d.ts CHANGED
@@ -3341,7 +3341,10 @@ type Element_12xgc27 = JSX_1kxb27["Element"];
3341
3341
  * that shows on hover. The text is selected; Enter or leaving the field
3342
3342
  * commits, Escape puts the old text back. The text and the input share one
3343
3343
  * box on the field ladder, invisible at rest and lit on hover, so editing
3344
- * never moves anything around it. Works controlled (`value` +
3344
+ * never moves anything around it. At rest it reads as plain text; while
3345
+ * editing the box takes the focused field's fill, with no ring (a text field
3346
+ * signals focus by its fill), and the focus ring shows only when the text or
3347
+ * the pencil is reached by keyboard. Works controlled (`value` +
3345
3348
  * `onValueChange`) or uncontrolled (`defaultValue`).
3346
3349
  *
3347
3350
  * @example {@include ./examples.mdx}
package/dist/index.js CHANGED
@@ -298,13 +298,13 @@ import {
298
298
  } from "./shared/components-4m9stj7d.js";
299
299
  import {
300
300
  Slider2
301
- } from "./shared/components-vx286kq7.js";
301
+ } from "./shared/components-qqm2y2cx.js";
302
302
  import {
303
303
  ColorTile2,
304
304
  ColorSwatch2,
305
305
  ColorPickerPopover2,
306
306
  ColorPicker2
307
- } from "./shared/components-mzdbtgvz.js";
307
+ } from "./shared/components-fnvkq52e.js";
308
308
  import {
309
309
  parseColor2,
310
310
  buildParsed2
@@ -354,7 +354,7 @@ import {
354
354
  } from "./shared/components-3qcgeay1.js";
355
355
  import {
356
356
  EditableText2
357
- } from "./shared/components-m3vxpz2z.js";
357
+ } from "./shared/components-2e77rzb8.js";
358
358
  import {
359
359
  FieldLabel2,
360
360
  FieldDescription2,
@@ -69,7 +69,7 @@ function EditableText2({
69
69
  const cell = cn2("col-start-1 row-start-1 min-w-0 truncate whitespace-pre", size.text);
70
70
  return /* @__PURE__ */ jsxs("div", {
71
71
  ...field.props,
72
- className: cn2(field.props.className, "inline-flex max-w-full min-w-0 items-center has-[:focus-visible]:!ring-focus-ring", size.control, size.gap, className),
72
+ className: cn2(field.props.className, "inline-flex max-w-full min-w-0 items-center has-[button:focus-visible]:!ring-focus-ring", size.control, size.gap, className),
73
73
  children: [
74
74
  /* @__PURE__ */ jsx("span", {
75
75
  className: "inline-grid min-w-0 flex-1",
@@ -30,7 +30,7 @@ import {
30
30
  } from "./components-45r18egt.js";
31
31
  import {
32
32
  Slider2
33
- } from "./components-vx286kq7.js";
33
+ } from "./components-qqm2y2cx.js";
34
34
  import {
35
35
  useFluidHover2,
36
36
  useRegisterFluidHoverItem2
@@ -15,6 +15,12 @@ import {
15
15
  import {
16
16
  spring2
17
17
  } from "./components-45r18egt.js";
18
+ import {
19
+ SURFACE_BG2
20
+ } from "./components-ceyn28cf.js";
21
+ import {
22
+ useSurface2
23
+ } from "./components-nwa2a9tq.js";
18
24
  import {
19
25
  cn2
20
26
  } from "./components-xnp09586.js";
@@ -270,6 +276,7 @@ var ComfortableSlider = forwardRef(({
270
276
  const [hoverPreview, setHoverPreview] = useState3(null);
271
277
  const showHoverTooltip = useDelayedFlag(isHovered, 100);
272
278
  const shape = useShape2();
279
+ const substrate = SURFACE_BG2[useSurface2()];
273
280
  const pipSteps = useMemo(() => Array.from({ length: Math.round((max - min) / step) + 1 }, (_, i) => min + i * step), [min, max, step]);
274
281
  const pipCount = pipSteps.length;
275
282
  const fillPercent = useMotionValue(max === min ? 0 : Math.max(0, Math.min(1, (value - min) / (max - min))));
@@ -532,11 +539,11 @@ var ComfortableSlider = forwardRef(({
532
539
  "aria-hidden": true,
533
540
  children: [
534
541
  label && /* @__PURE__ */ jsx2("span", {
535
- className: "text-body px-2 bg-background text-transparent select-none",
542
+ className: cn2("text-body px-2 text-transparent select-none", substrate),
536
543
  children: label
537
544
  }),
538
545
  /* @__PURE__ */ jsx2("span", {
539
- className: "text-body tabular-nums ml-auto px-2 bg-background text-transparent select-none",
546
+ className: cn2("text-body tabular-nums ml-auto px-2 text-transparent select-none", substrate),
540
547
  style: { minWidth: `${String(formatValue(max)).length}ch` },
541
548
  children: formatValue(value)
542
549
  })
package/dist/styles.css CHANGED
@@ -62,7 +62,7 @@
62
62
  }
63
63
  /* layer: theme */
64
64
  @layer theme{
65
- :root, :host { --spacing: 0.25rem; --default-transition-timingFunction: cubic-bezier(0.4, 0, 0.2, 1); --default-transition-duration: 150ms; --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace; --container-sm: 24rem; --ease-out: cubic-bezier(0, 0, 0.2, 1); --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); --radius-xl: 0.75rem; --leading-relaxed: 1.625; --radius-none: 0; --font-sans: 'Inter Variable', ui-sans-serif, system-ui, sans-serif; --radius-md: 0.375rem; --radius-DEFAULT: 0.25rem; --radius-3xl: 1.5rem; --leading-tight: 1.25; --ease-DEFAULT: cubic-bezier(0.4, 0, 0.2, 1); --radius-xs: 0.125rem; --leading-snug: 1.375; --leading-normal: 1.5; --radius-sm: 0.25rem; --radius-2xl: 1rem; --radius-lg: 0.5rem; --leading-none: 1; --container-2xl: 42rem; --default-font-family: var(--font-sans); --default-monoFont-family: var(--font-mono); }
65
+ :root, :host { --spacing: 0.25rem; --default-transition-timingFunction: cubic-bezier(0.4, 0, 0.2, 1); --default-transition-duration: 150ms; --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace; --container-sm: 24rem; --ease-out: cubic-bezier(0, 0, 0.2, 1); --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); --radius-xl: 0.75rem; --leading-relaxed: 1.625; --radius-none: 0; --font-sans: 'Inter Variable', ui-sans-serif, system-ui, sans-serif; --radius-md: 0.375rem; --radius-DEFAULT: 0.25rem; --radius-3xl: 1.5rem; --leading-tight: 1.25; --ease-DEFAULT: cubic-bezier(0.4, 0, 0.2, 1); --radius-2xl: 1rem; --radius-xs: 0.125rem; --leading-snug: 1.375; --leading-normal: 1.5; --radius-sm: 0.25rem; --leading-none: 1; --radius-lg: 0.5rem; --container-2xl: 42rem; --default-font-family: var(--font-sans); --default-monoFont-family: var(--font-mono); }
66
66
  }
67
67
  /* layer: base */
68
68
  @layer base{
@@ -739,7 +739,7 @@
739
739
  .focus-visible\:ring-1:focus-visible{--un-ring-shadow:var(--un-ring-inset,) 0 0 0 calc(1px + var(--un-ring-offset-width)) var(--un-ring-color, currentColor);box-shadow:var(--un-inset-shadow), var(--un-inset-ring-shadow), var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}
740
740
  .group:active .group-active\:ring-0{--un-ring-shadow:var(--un-ring-inset,) 0 0 0 calc(0px + var(--un-ring-offset-width)) var(--un-ring-color, currentColor);box-shadow:var(--un-inset-shadow), var(--un-inset-ring-shadow), var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}
741
741
  .\[\&\:has\(\:focus-visible\)\]\:\!ring-focus-ring:has(:focus-visible),
742
- .has-\[\:focus-visible\]\:\!ring-focus-ring:has(:focus-visible){--un-ring-color:color-mix(in srgb, var(--focus-ring) var(--un-ring-opacity), transparent) !important;}
742
+ .has-\[button\:focus-visible\]\:\!ring-focus-ring:has(button:focus-visible){--un-ring-color:color-mix(in srgb, var(--focus-ring) var(--un-ring-opacity), transparent) !important;}
743
743
  .data-\[active\]\:ring-border[data-active],
744
744
  .data-\[disabled\]\:ring-border[data-disabled],
745
745
  .ring-border{--un-ring-color:color-mix(in srgb, var(--border) var(--un-ring-opacity), transparent);}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justanarthur/modo-ui",
3
3
  "type": "module",
4
- "version": "2.6.0",
4
+ "version": "2.6.2",
5
5
  "description": "Fluid Functionalism (Base UI flavor, MIT © 2026 Micka Touillaud) ported to UnoCSS: motion springs, fluid hover, a two-step size ladder and an eight-level elevated surface system. Documented with modo.",
6
6
  "license": "MIT",
7
7
  "keywords": [