@phreshos/react-ui 0.1.23 → 0.1.24

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/button.js CHANGED
@@ -19,7 +19,7 @@ export const Button = forwardRef(function Button({ children, color, disabled = f
19
19
  });
20
20
  function buttonStyle({ theme, disabled, isFocusVisible, isHovered, isPressed, pending, size, style }) {
21
21
  const fontSize = controlFontSizes[size];
22
- const { spacing, foreground } = theme;
22
+ const { spacing, focusColor } = theme;
23
23
  const height = Math.max(24, 24 + spacing);
24
24
  const interactive = !disabled && !pending;
25
25
  const paint = buttonPaint(theme, interactive, isHovered, isPressed);
@@ -40,8 +40,8 @@ function buttonStyle({ theme, disabled, isFocusVisible, isHovered, isPressed, pe
40
40
  gap: Math.max(4, spacing / 2),
41
41
  border: "none",
42
42
  borderRadius: theme.radius,
43
- outline: isFocusVisible ? `2px solid ${foreground}` : "none",
44
- outlineOffset: 2,
43
+ outline: isFocusVisible ? `1px solid ${focusColor}` : "none",
44
+ outlineOffset: 1,
45
45
  ...paint,
46
46
  opacity: disabled ? 0.46 : pending ? 0.68 : 1,
47
47
  cursor: disabled ? "not-allowed" : pending ? "progress" : "pointer",
package/dist/control.d.ts CHANGED
@@ -30,6 +30,7 @@ export interface ControlTheme {
30
30
  readonly foreground: string;
31
31
  readonly background: string;
32
32
  readonly tint: string;
33
+ readonly focusColor: string;
33
34
  readonly danger: string;
34
35
  readonly paints: {
35
36
  readonly palette: SolidColors;
package/dist/control.js CHANGED
@@ -4,7 +4,7 @@ import { FieldError, Label, Text } from "react-aria-components";
4
4
  import { useAppearance, useThemedValue } from "./appearance-provider.js";
5
5
  import { resolveRadius } from "./radius.js";
6
6
  import { scale } from "./scale.js";
7
- import { solidColors } from "./color.js";
7
+ import { colorOpacity, solidColors } from "./color.js";
8
8
  import { useResolveSolidColor } from "./color.js";
9
9
  import { useVisualTransition } from "./motion-style.js";
10
10
  export const controlFontSizes = Object.freeze({
@@ -23,6 +23,7 @@ export function useControlTheme({ size = "medium", color, radius = "medium" }) {
23
23
  const background = colors.background;
24
24
  const tint = useResolveSolidColor(color ?? "default:base");
25
25
  const neutral = useResolveSolidColor("default:base");
26
+ const focus = useResolveSolidColor("warning:base");
26
27
  const danger = useResolveSolidColor("danger:base");
27
28
  const paints = useMemo(() => ({
28
29
  palette: solidColors(tint, background, foreground),
@@ -35,6 +36,7 @@ export function useControlTheme({ size = "medium", color, radius = "medium" }) {
35
36
  foreground,
36
37
  background,
37
38
  tint,
39
+ focusColor: colorOpacity(focus, 0.2),
38
40
  danger,
39
41
  paints,
40
42
  radius: resolveRadius(radius, appearance),
@@ -74,8 +76,8 @@ export function controlStyle(theme, focused, invalid, hovered = false, focusVisi
74
76
  paddingInline: Math.max(8, theme.spacing),
75
77
  border: 0,
76
78
  borderRadius: theme.radius,
77
- outline: focusVisible ? `2px solid ${theme.foreground}` : "none",
78
- outlineOffset: 2,
79
+ outline: focusVisible ? `1px solid ${theme.focusColor}` : "none",
80
+ outlineOffset: 1,
79
81
  ...paint,
80
82
  caretColor: paint.color,
81
83
  font: "inherit",
package/dist/select.js CHANGED
@@ -21,7 +21,7 @@ export const Select = forwardRef(function Select({ label, description, errorMess
21
21
  display: "flex", alignItems: "center", justifyContent: "space-between", gap: theme.gap,
22
22
  minHeight: theme.height, paddingInline: Math.max(8, theme.spacing), boxSizing: "border-box",
23
23
  borderRadius: theme.radius,
24
- outline: item.isFocused && !item.isSelected ? `2px solid ${theme.foreground}` : "none", outlineOffset: -2,
24
+ outline: item.isFocused && !item.isSelected ? `1px solid ${theme.focusColor}` : "none", outlineOffset: 1,
25
25
  cursor: item.isDisabled ? "not-allowed" : "pointer",
26
26
  opacity: item.isDisabled ? 0.46 : 1,
27
27
  ...(item.isSelected ? item.isFocused ? theme.paints.palette.hover : theme.paints.palette.rest
package/dist/slider.js CHANGED
@@ -29,7 +29,7 @@ export const Slider = forwardRef(function Slider({ label, description, name, dis
29
29
  } }), _jsx(SliderThumb, { name: name, style: state => ({
30
30
  width: diameter, height: diameter, borderRadius: "50%", boxSizing: "border-box",
31
31
  ...(vertical ? { left: "50%" } : { top: "50%" }),
32
- outline: state.isFocusVisible ? `2px solid ${theme.foreground}` : "none", outlineOffset: 2,
32
+ outline: state.isFocusVisible ? `1px solid ${theme.focusColor}` : "none", outlineOffset: 1,
33
33
  cursor: state.isDisabled ? "not-allowed" : state.isDragging ? "grabbing" : "grab"
34
34
  }), children: state => _jsx(motion.span, { "aria-hidden": "true", initial: false, animate: { scale: !animations || state.isDisabled ? 1 : state.isDragging ? 0.92 : state.isHovered ? 1.08 : 1 }, transition: transition, style: { ...theme.transition, position: "absolute", inset: 0, borderRadius: "inherit", pointerEvents: "none",
35
35
  background: (state.isDragging ? theme.paints.palette.pressed : state.isHovered ? theme.paints.palette.hover : theme.paints.palette.rest).color,
@@ -29,8 +29,8 @@ export function ToggleIndicator({ kind, selected, indeterminate = false, focused
29
29
  height: diameter,
30
30
  borderRadius: radius,
31
31
  border: "none",
32
- outline: focused ? `2px solid ${theme.foreground}` : "none",
33
- outlineOffset: 2,
32
+ outline: focused ? `1px solid ${theme.focusColor}` : "none",
33
+ outlineOffset: 1,
34
34
  }, children: switching ? _jsx(motion.span, { initial: false, animate: { width: thumbWidth, x: (selected ? travel : -travel) * (direction === "rtl" ? -1 : 1) }, transition: transition, style: {
35
35
  ...theme.transition,
36
36
  height: diameter - 6, borderRadius: diameter,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phreshos/react-ui",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "React components for coherent PhreshOS Program interfaces.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@base-ui/react": "^1.7.0",
59
- "@phreshos/core": "^0.1.49",
59
+ "@phreshos/core": "^0.1.51",
60
60
  "colorjs.io": "^0.7.1",
61
61
  "motion": "^13.2.0",
62
62
  "react-aria-components": "^1.20.0"