@atom63/ui-react 0.2.0-beta.0 → 0.2.0-beta.10

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.
Files changed (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +54 -50
  3. package/dist/{button-sktq-nvV.d.ts → button-CfLIHg-R.d.ts} +1 -1
  4. package/dist/chunk-GDUMA6FI.js +2678 -0
  5. package/dist/chunk-GDUMA6FI.js.map +1 -0
  6. package/dist/{chunk-STCXERLM.js → chunk-J77BAGTA.js} +8 -148
  7. package/dist/chunk-J77BAGTA.js.map +1 -0
  8. package/dist/chunk-NBHGMMQN.js +135 -0
  9. package/dist/chunk-NBHGMMQN.js.map +1 -0
  10. package/dist/{chunk-7VSPECOH.js → chunk-R67OZVA2.js} +4 -14
  11. package/dist/chunk-R67OZVA2.js.map +1 -0
  12. package/dist/chunk-UPPHQLZ2.js +18 -0
  13. package/dist/chunk-UPPHQLZ2.js.map +1 -0
  14. package/dist/{chunk-MXNO63TC.js → chunk-X5L5DEUZ.js} +597 -290
  15. package/dist/chunk-X5L5DEUZ.js.map +1 -0
  16. package/dist/{destination-link-C9NKeKLe.d.ts → destination-link-DMLeR-oF.d.ts} +1 -1
  17. package/dist/index-BDzW8upQ.d.ts +442 -0
  18. package/dist/index.d.ts +56 -454
  19. package/dist/index.js +402 -2987
  20. package/dist/index.js.map +1 -1
  21. package/dist/layout/index.js +4 -4
  22. package/dist/layout/index.js.map +1 -1
  23. package/dist/media/index.d.ts +15 -4
  24. package/dist/media/index.js +213 -46
  25. package/dist/media/index.js.map +1 -1
  26. package/dist/media/media-lightbox/parts/index.d.ts +23 -15
  27. package/dist/media/media-lightbox/parts/index.js +3 -2
  28. package/dist/preview/index.d.ts +16 -0
  29. package/dist/preview/index.js +6 -0
  30. package/dist/preview/index.js.map +1 -0
  31. package/dist/theme/index.d.ts +2 -2
  32. package/dist/theme/index.js +81 -36
  33. package/dist/theme/index.js.map +1 -1
  34. package/package.json +47 -43
  35. package/src/components/accordion/accordion.css +2 -4
  36. package/src/components/alert-dialog/alert-dialog.css +1 -1
  37. package/src/components/autocomplete/autocomplete.css +3 -7
  38. package/src/components/badge/badge.css +5 -8
  39. package/src/components/breadcrumb/breadcrumb.css +1 -2
  40. package/src/components/button/button.css +8 -6
  41. package/src/components/button-group/button-group.css +17 -1
  42. package/src/components/calendar/calendar.css +5 -8
  43. package/src/components/card/card.css +2 -2
  44. package/src/components/carousel/carousel.css +4 -8
  45. package/src/components/checkbox/checkbox.css +1 -1
  46. package/src/components/command/command.css +8 -0
  47. package/src/components/connected-panel/connected-panel.css +3 -2
  48. package/src/components/dialog/dialog.css +1 -1
  49. package/src/components/drawer/drawer.css +1 -1
  50. package/src/components/empty/empty.css +2 -2
  51. package/src/components/feedback-state/feedback-state.css +1 -1
  52. package/src/components/field/field.css +4 -4
  53. package/src/components/form/form.css +2 -2
  54. package/src/components/input/input.css +2 -6
  55. package/src/components/input-otp/input-otp.css +4 -11
  56. package/src/components/item/item.css +3 -3
  57. package/src/components/menu/menu.css +5 -4
  58. package/src/components/menubar/menubar.css +4 -1
  59. package/src/components/navigation-menu/navigation-menu.css +5 -1
  60. package/src/components/panel-setting-button/panel-setting-button.css +1 -1
  61. package/src/components/radio/radio.css +1 -1
  62. package/src/components/resizable/resizable.css +1 -1
  63. package/src/components/scroll-area/scroll-area.css +1 -2
  64. package/src/components/segmented-control/segmented-control.css +8 -1
  65. package/src/components/select/select.css +2 -6
  66. package/src/components/sidebar/sidebar.css +12 -12
  67. package/src/components/sidebar-nav-tree/sidebar-nav-tree.css +8 -8
  68. package/src/components/slider/slider.css +6 -6
  69. package/src/components/switch/switch.css +3 -3
  70. package/src/components/table/table.css +7 -1
  71. package/src/components/tabs/tabs.css +15 -1
  72. package/src/components/textarea/textarea.css +2 -6
  73. package/src/components/toggle/toggle.css +5 -4
  74. package/src/components/toggle-group/toggle-group.css +4 -4
  75. package/src/media/media-lightbox/media-lightbox.css +15 -5
  76. package/src/styles/index.css +1 -0
  77. package/src/styles/utilities.css +2253 -0
  78. package/dist/chunk-7VSPECOH.js.map +0 -1
  79. package/dist/chunk-MXNO63TC.js.map +0 -1
  80. package/dist/chunk-STCXERLM.js.map +0 -1
@@ -1,8 +1,9 @@
1
1
  import { d as MediaLightboxItem, M as MediaLightboxLabels, c as MediaLightboxAppearance, b as MediaLightboxTransition } from '../../../types-Dxe5IzjE.js';
2
+ export { e as MediaLightboxItemKind, f as MediaLightboxVideoSource, g as MediaLightboxVideoTrack } from '../../../types-Dxe5IzjE.js';
2
3
  import * as React from 'react';
3
4
  import { RefObject, ReactNode } from 'react';
4
5
  import { useRender } from '@base-ui/react/use-render';
5
- import { a as DestinationLink } from '../../../destination-link-C9NKeKLe.js';
6
+ import { D as DestinationLink } from '../../../destination-link-DMLeR-oF.js';
6
7
  import '@atom63/ui-foundation';
7
8
 
8
9
  /**
@@ -109,30 +110,37 @@ type LightboxStatusProps = useRender.ComponentProps<'div'>;
109
110
  declare function LightboxStatus({ className, ref, render, ...props }: LightboxStatusProps): React.ReactElement;
110
111
 
111
112
  type LightboxViewportProps = useRender.ComponentProps<'div'>;
112
- /** The clipping frame the stack sits inside of. */
113
+ /** The frame the track sits inside of. */
113
114
  declare function LightboxViewport({ className, ref, render, ...props }: LightboxViewportProps): React.ReactElement;
114
115
  type LightboxSlidesProps = Omit<useRender.ComponentProps<'div'>, 'children'> & {
115
116
  /** The number and identity of slides comes from `items`, not from markup the caller lays out. */
116
117
  children: (slide: LightboxSlide$1) => ReactNode;
117
118
  };
118
119
  /**
119
- * A stack, not a track: every mounted slide occupies the same box, and a page
120
- * turn is nothing but an index change — `opacity` is what selects which one
121
- * is showing (see `stage-transition.ts`), and there is no position for a
122
- * compositor to re-raster on every frame of a turn.
120
+ * A track, like a native pager: the slides sit side by side in one strip, a gap
121
+ * apart, and a page turn moves that strip. The strip is the only thing that
122
+ * moves, with a single `translate3d`, so a turn costs the compositor one layer
123
+ * and re-rasters nothing on the way. See `useSlideTrack` for the gestures and
124
+ * springs.
123
125
  *
124
- * This gives up what real scroll-snapping used to buy for free — 1:1 finger
125
- * tracking, the platform's own momentum, rubber-banding, mid-fling
126
- * interruption — a trade made deliberately (see
127
- * `docs/superpowers/specs/2026-09-12-lightbox-crossfade-stage.md` §2.4) to
128
- * remove the jank a moving photo cost the compositor, not to optimise it.
126
+ * This element is the clipping frame and the carousel's accessible group; the
127
+ * strip inside it is plain layout. The gap is `--a63-media-lightbox-gap`
128
+ * (`--a63-space-4` by default), and in a right-to-left gallery the strip runs
129
+ * the other way.
130
+ *
131
+ * A turn used to be a crossfade in a stack of slides, chosen when a full-width
132
+ * `backdrop-filter` over the moving photo made sliding judder. That blur is
133
+ * gone, and nothing blurred sits over the strip while it moves: the only
134
+ * blurred surfaces are the small on-media controls, and they drop the blur for
135
+ * as long as the root carries `data-paging`.
129
136
  */
130
137
  declare function LightboxSlides({ children, className, ref, render, ...props }: LightboxSlidesProps): React.ReactElement;
131
138
  type LightboxSlideProps = useRender.ComponentProps<'div'>;
132
139
  /**
133
- * A single slide's wrapper: identity, `inert`, roving `role`/`aria-*`, and
134
- * the crossfade opacity are all derived from `LightboxSlideContext`. What
135
- * goes inside is the caller's.
140
+ * A single slide's wrapper: identity, `inert` and roving `role`/`aria-*` are
141
+ * all derived from `LightboxSlideContext`. It is exactly one slide wide, so the
142
+ * track's position arithmetic can count in slides. What goes inside is the
143
+ * caller's.
136
144
  */
137
145
  declare function LightboxSlide({ children, className, ref, render, ...props }: LightboxSlideProps): React.ReactElement;
138
146
 
@@ -281,4 +289,4 @@ declare const Lightbox: {
281
289
  readonly ZoomOut: typeof LightboxZoomOut;
282
290
  };
283
291
 
284
- export { Lightbox, LightboxAppearanceToggle, type LightboxAppearanceToggleProps, LightboxBackdrop, type LightboxBackdropProps, LightboxCaption, type LightboxCaptionProps, LightboxClose, type LightboxCloseProps, type LightboxConfig, LightboxContent, type LightboxContentProps, LightboxCounter, type LightboxCounterProps, LightboxDestination, type LightboxDestinationProps, LightboxFrame, type LightboxFrameProps, LightboxMedia, LightboxNext, type LightboxNextProps, LightboxPortal, type LightboxPortalProps, LightboxPrevious, type LightboxPreviousProps, type LightboxRefs, LightboxRoot, type LightboxRootProps, LightboxSlide, type LightboxSlideProps, type LightboxSlide$1 as LightboxSlideValue, LightboxSlides, type LightboxSlidesProps, type LightboxState, LightboxStatus, type LightboxStatusProps, LightboxThumbnail, type LightboxThumbnailContextValue, type LightboxThumbnailProps, LightboxThumbnails, type LightboxThumbnailsProps, LightboxViewport, type LightboxViewportProps, LightboxZoom, LightboxZoomIn, type LightboxZoomInProps, LightboxZoomOut, type LightboxZoomOutProps, type LightboxZoomProps, useLightboxConfig, useLightboxRefs, useLightboxSlide, useLightboxState, useOptionalLightboxConfig };
292
+ export { Lightbox, LightboxAppearanceToggle, type LightboxAppearanceToggleProps, LightboxBackdrop, type LightboxBackdropProps, LightboxCaption, type LightboxCaptionProps, LightboxClose, type LightboxCloseProps, type LightboxConfig, LightboxContent, type LightboxContentProps, LightboxCounter, type LightboxCounterProps, LightboxDestination, type LightboxDestinationProps, LightboxFrame, type LightboxFrameProps, LightboxMedia, LightboxNext, type LightboxNextProps, LightboxPortal, type LightboxPortalProps, LightboxPrevious, type LightboxPreviousProps, type LightboxRefs, LightboxRoot, type LightboxRootProps, LightboxSlide, type LightboxSlideProps, type LightboxSlide$1 as LightboxSlideValue, LightboxSlides, type LightboxSlidesProps, type LightboxState, LightboxStatus, type LightboxStatusProps, LightboxThumbnail, type LightboxThumbnailContextValue, type LightboxThumbnailProps, LightboxThumbnails, type LightboxThumbnailsProps, type LightboxTiming, LightboxViewport, type LightboxViewportProps, LightboxZoom, LightboxZoomIn, type LightboxZoomInProps, type LightboxZoomOptions, LightboxZoomOut, type LightboxZoomOutProps, type LightboxZoomProps, MediaLightboxAppearance, MediaLightboxItem, MediaLightboxLabels, MediaLightboxTransition, useLightboxConfig, useLightboxRefs, useLightboxSlide, useLightboxState, useOptionalLightboxConfig };
@@ -1,5 +1,6 @@
1
- export { Lightbox, LightboxAppearanceToggle, LightboxBackdrop, LightboxCaption, LightboxClose, LightboxContent, LightboxCounter, LightboxDestination, LightboxFrame, LightboxMedia, LightboxNext, LightboxPortal, LightboxPrevious, LightboxRoot, LightboxSlide, LightboxSlides, LightboxStatus, LightboxThumbnail, LightboxThumbnails, LightboxViewport, LightboxZoom, LightboxZoomIn, LightboxZoomOut, useLightboxConfig, useLightboxRefs, useLightboxSlide, useLightboxState, useOptionalLightboxConfig } from '../../../chunk-MXNO63TC.js';
2
- import '../../../chunk-7VSPECOH.js';
1
+ export { Lightbox, LightboxAppearanceToggle, LightboxBackdrop, LightboxCaption, LightboxClose, LightboxContent, LightboxCounter, LightboxDestination, LightboxFrame, LightboxMedia, LightboxNext, LightboxPortal, LightboxPrevious, LightboxRoot, LightboxSlide, LightboxSlides, LightboxStatus, LightboxThumbnail, LightboxThumbnails, LightboxViewport, LightboxZoom, LightboxZoomIn, LightboxZoomOut, useLightboxConfig, useLightboxRefs, useLightboxSlide, useLightboxState, useOptionalLightboxConfig } from '../../../chunk-X5L5DEUZ.js';
2
+ import '../../../chunk-R67OZVA2.js';
3
+ import '../../../chunk-UPPHQLZ2.js';
3
4
  import '../../../chunk-AJLHJRK6.js';
4
5
  //# sourceMappingURL=index.js.map
5
6
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,16 @@
1
+ export { A as ATOM63_FLYOUT_TRANSITION, a as ATOM63_FLYOUT_TRANSITION_CSS, b as ATOM63_MOTION_EASE, c as ATOM63_MOTION_EASE_CSS, d as ATOM63_OVERLAY_MOTION_DURATION_CSS, e as ATOM63_OVERLAY_MOTION_DURATION_MS, f as ATOM63_OVERLAY_MOTION_EASE, g as ATOM63_OVERLAY_MOTION_EASE_CSS, n as AlertDialogCreateHandle, B as ButtonGroupProvider, $ as CommandCreateHandle, ak as DialogCreateHandle, aE as ReactRendererConformanceEvidence, aF as ReactVerifiedContractId, aV as TooltipCreateHandle, aZ as cardLinkClassName, a_ as getReactRendererConformance, a$ as navigationMenuTriggerStyle, b0 as reactRendererConformance, b1 as scrollableListControlClassNames, b2 as selectTriggerDefaultClassName, b3 as useButtonGroupContext } from '../index-BDzW8upQ.js';
2
+ export { Autocomplete as AutocompletePrimitive } from '@base-ui/react/autocomplete';
3
+ export { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';
4
+ export { Separator as SeparatorPrimitive } from '@base-ui/react/separator';
5
+ export { Input as InputPrimitive } from '@base-ui/react/input';
6
+ export { Progress as ProgressPrimitive } from '@base-ui/react/progress';
7
+ export { Dialog as DialogPrimitive, Dialog as SheetPrimitive } from '@base-ui/react/dialog';
8
+ export { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
9
+ export { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
10
+ import 'react';
11
+ import '../button-CfLIHg-R.js';
12
+ import '@atom63/ui-foundation';
13
+ import '@base-ui/react/use-render';
14
+ import '@base-ui/react';
15
+ import '@base-ui/react/navigation-menu';
16
+ import '@base-ui/react/select';
@@ -0,0 +1,6 @@
1
+ export { AlertDialogCreateHandle, AlertDialogPrimitive, AutocompletePrimitive, AvatarPrimitive, ButtonGroupProvider, CommandCreateHandle, DialogCreateHandle, DialogPrimitive, InputPrimitive, ProgressPrimitive, SeparatorPrimitive, SheetPrimitive, TooltipCreateHandle, TooltipPrimitive, cardLinkClassName, getReactRendererConformance, navigationMenuTriggerStyle, reactRendererConformance, scrollableListControlClassNames, selectTriggerDefaultClassName, useButtonGroupContext } from '../chunk-GDUMA6FI.js';
2
+ export { ATOM63_FLYOUT_TRANSITION, ATOM63_FLYOUT_TRANSITION_CSS, ATOM63_MOTION_EASE, ATOM63_MOTION_EASE_CSS, ATOM63_OVERLAY_MOTION_DURATION_CSS, ATOM63_OVERLAY_MOTION_DURATION_MS, ATOM63_OVERLAY_MOTION_EASE, ATOM63_OVERLAY_MOTION_EASE_CSS } from '../chunk-NBHGMMQN.js';
3
+ import '../chunk-UPPHQLZ2.js';
4
+ import '../chunk-AJLHJRK6.js';
5
+ //# sourceMappingURL=index.js.map
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ComponentProps, ReactNode } from 'react';
3
- import { a as Button } from '../button-sktq-nvV.js';
3
+ import { B as Button } from '../button-CfLIHg-R.js';
4
4
  import '@atom63/ui-foundation';
5
5
  import '@base-ui/react/use-render';
6
6
 
@@ -347,4 +347,4 @@ interface VisualChoiceControlProps<T extends string> {
347
347
  }
348
348
  declare function VisualChoiceControl<T extends string>({ className, columns, label, onChange, options, value, }: VisualChoiceControlProps<T>): React.ReactElement;
349
349
 
350
- export { AUTO_FALLBACK_COLOR, AUTO_PRIMARY_ID, AppearanceMenu, type AppearanceMenuProps, AppearanceMenuTrigger, AppearancePanel, type AppearancePanelProps, AppearanceSection, type AppearanceSectionId, type AppearanceSectionProps, BRAND_OPTIONS, type BrandId, type ColorMode, type CreateThemeProviderOptions, type ExtractedColor, FONT_OPTIONS, type FontFamily, ICON_THEME_OPTIONS, type IconTheme, MODE_OPTIONS, OS_OPTIONS, type OsSystem, type PersonalizationController, type PersonalizationOption, type PersonalizationState, RADIUS_OPTIONS, type RadiusScale, RangeTokenControl, type RangeTokenControlProps, SURFACE_OPTIONS, SegmentedTokenControl, type SegmentedTokenControlProps, type SurfaceId, SwatchTokenControl, type SwatchTokenControlProps, THEME_OPTIONS, TYPE_SCALE_OPTIONS, type ThemeContextValue, type ThemeId, type ThemeMode, type ThemeModeOption, type TypeScale, VisualChoiceControl, type VisualChoiceControlProps, type VisualChoiceOption, applyAutoColorRamp, applyPersonalization, clearAutoColorRamp, createPersonalizationController, createThemeProvider, extractDominantColor, isAutoPrimary };
350
+ export { AUTO_FALLBACK_COLOR, AUTO_PRIMARY_ID, AppearanceMenu, type AppearanceMenuProps, AppearanceMenuTrigger, type AppearanceMenuTriggerProps, AppearancePanel, type AppearancePanelProps, AppearanceSection, type AppearanceSectionId, type AppearanceSectionProps, BRAND_OPTIONS, type BrandId, type ColorMode, type CreatePersonalizationControllerOptions, type CreateThemeProviderOptions, type ExtractedColor, FONT_OPTIONS, type FontFamily, ICON_THEME_OPTIONS, type IconTheme, MODE_OPTIONS, OS_OPTIONS, type OsSystem, type PersonalizationController, type PersonalizationOption, type PersonalizationState, RADIUS_OPTIONS, type RadiusScale, RangeTokenControl, type RangeTokenControlProps, SURFACE_OPTIONS, SegmentedTokenControl, type SegmentedTokenControlProps, type SurfaceId, SwatchTokenControl, type SwatchTokenControlProps, THEME_OPTIONS, TYPE_SCALE_OPTIONS, type ThemeContextValue, type ThemeId, type ThemeMode, type ThemeModeOption, type TypeScale, VisualChoiceControl, type VisualChoiceControlProps, type VisualChoiceOption, applyAutoColorRamp, applyPersonalization, clearAutoColorRamp, createPersonalizationController, createThemeProvider, extractDominantColor, isAutoPrimary };
@@ -1,4 +1,5 @@
1
- import { Slider, SegmentedControl, ATOM63_FLYOUT_TRANSITION_CSS, Frame, FramePanel, Button, ScrollArea, FrameFooter } from '../chunk-STCXERLM.js';
1
+ import { Slider, SegmentedControl, Frame, FramePanel, FrameFooter } from '../chunk-J77BAGTA.js';
2
+ import { ATOM63_FLYOUT_TRANSITION_CSS, Button, ScrollArea } from '../chunk-NBHGMMQN.js';
2
3
  import { cn } from '../chunk-AJLHJRK6.js';
3
4
  import { useId, useRef, useState, useCallback, useEffect, createContext, useMemo, useContext } from 'react';
4
5
  import { createPortal } from 'react-dom';
@@ -147,7 +148,7 @@ function FontPreview({ font, selected }) {
147
148
  "aria-hidden": "true",
148
149
  className: cn(
149
150
  "flex h-12 w-full items-center justify-center text-2xl leading-none transition-colors",
150
- selected ? "text-[var(--a63-action-primary)]" : "text-[var(--a63-text-primary)]"
151
+ selected ? "text-[var(--a63-text-accent)]" : "text-[var(--a63-text-primary)]"
151
152
  ),
152
153
  "data-slot": "appearance-font-preview",
153
154
  style,
@@ -168,7 +169,7 @@ function TypeScalePreview({ scale, selected }) {
168
169
  "aria-hidden": "true",
169
170
  className: cn(
170
171
  "flex h-12 w-full items-center justify-center gap-1",
171
- selected ? "text-[var(--a63-action-primary)]" : "text-[var(--a63-text-primary)]"
172
+ selected ? "text-[var(--a63-text-accent)]" : "text-[var(--a63-text-primary)]"
172
173
  ),
173
174
  "data-slot": "appearance-type-scale-preview",
174
175
  children: [
@@ -197,7 +198,7 @@ function RadiusPreview({ radius, selected }) {
197
198
  {
198
199
  className: cn(
199
200
  "flex h-12 w-full items-center justify-center",
200
- selected ? "text-[var(--a63-action-primary)]" : "text-[var(--a63-text-primary)]"
201
+ selected ? "text-[var(--a63-text-accent)]" : "text-[var(--a63-text-primary)]"
201
202
  ),
202
203
  "data-slot": "appearance-radius-preview",
203
204
  children: /* @__PURE__ */ jsx("span", { className: "block h-4 w-12", style })
@@ -279,7 +280,7 @@ function RangeTokenControl({
279
280
  return /* @__PURE__ */ jsxs("div", { className: "grid gap-2.5", "data-slot": "range-token-control", children: [
280
281
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
281
282
  /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-[var(--a63-text-primary)]", children: label }),
282
- /* @__PURE__ */ jsx("span", { className: "min-w-10 text-right text-xs font-medium text-[var(--a63-text-secondary)] tabular-nums", children: valueLabel })
283
+ /* @__PURE__ */ jsx("span", { className: "min-w-10 text-end text-xs font-medium text-[var(--a63-text-secondary)] tabular-nums", children: valueLabel })
283
284
  ] }),
284
285
  /* @__PURE__ */ jsx(Slider, { "aria-label": label, max, min, onValueChange: onChange, value })
285
286
  ] });
@@ -340,7 +341,7 @@ function SwatchTokenControl({
340
341
  }
341
342
  );
342
343
  }
343
- var VISUAL_CHOICE_BUTTON_CLASS = "group relative flex min-h-[5.5rem] flex-col items-center justify-center gap-2.5 overflow-hidden rounded-[calc(var(--radius-lg)+2px)] border border-[var(--a63-border-subtle)] bg-[var(--a63-surface-panel)] px-3 py-3 text-center text-[var(--a63-text-secondary)] transition-[background-color,border-color,box-shadow,color,transform] duration-150 ease-out motion-reduce:transition-none hover:-translate-y-px hover:border-[var(--a63-border-control)] hover:text-[var(--a63-text-primary)] hover:shadow-sm motion-reduce:hover:translate-y-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--a63-focus-ring)] active:translate-y-0 active:scale-[0.99] motion-reduce:active:scale-100 data-[state=checked]:border-[var(--a63-action-primary)] data-[state=checked]:bg-[color-mix(in_oklch,var(--a63-action-primary)_8%,transparent)] data-[state=checked]:text-[var(--a63-text-primary)] data-[state=checked]:shadow-[0_0_0_1px_var(--a63-action-primary)]";
344
+ var VISUAL_CHOICE_BUTTON_CLASS = "group relative flex min-h-[5.5rem] flex-col items-center justify-center gap-2.5 overflow-hidden rounded-[calc(var(--radius-lg)+2px)] border border-[var(--a63-border-subtle)] bg-[var(--a63-surface-panel)] px-3 py-3 text-center text-[var(--a63-text-secondary)] transition-[background-color,border-color,box-shadow,color,transform] duration-150 ease-out motion-reduce:transition-none hover:-translate-y-px hover:border-[var(--a63-border-control)] hover:text-[var(--a63-text-primary)] hover:shadow-sm motion-reduce:hover:translate-y-0 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-(--a63-focus-ring) active:translate-y-0 active:scale-[0.99] motion-reduce:active:scale-100 data-[state=checked]:border-[var(--a63-action-primary)] data-[state=checked]:bg-[color-mix(in_oklch,var(--a63-action-primary)_8%,transparent)] data-[state=checked]:text-[var(--a63-text-primary)] data-[state=checked]:shadow-[0_0_0_1px_var(--a63-action-primary)]";
344
345
  var COLUMN_CLASS = {
345
346
  3: "grid-cols-[repeat(auto-fit,minmax(min(4.5rem,100%),1fr))]",
346
347
  4: "grid-cols-[repeat(auto-fit,minmax(min(4.5rem,100%),1fr))]"
@@ -642,11 +643,11 @@ function AppearanceMenu({
642
643
  className: `bg-muted/78 shadow-xl backdrop-blur-2xl ${panelClassName ?? ""}`,
643
644
  style: { maxHeight: "min(86svh, 42rem)" },
644
645
  children: [
645
- /* @__PURE__ */ jsxs(FramePanel, { className: "bg-background/84 flex min-h-0 flex-1 flex-col overflow-hidden p-0 backdrop-blur-xl", children: [
646
- /* @__PURE__ */ jsxs("header", { className: "border-border/80 flex items-start justify-between gap-3 border-b px-4 py-3", children: [
646
+ /* @__PURE__ */ jsxs(FramePanel, { className: "flex min-h-0 flex-1 flex-col overflow-hidden bg-background/84 p-0 backdrop-blur-xl", children: [
647
+ /* @__PURE__ */ jsxs("header", { className: "flex items-start justify-between gap-3 border-b border-border/80 px-4 py-3", children: [
647
648
  /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
648
649
  /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold", id: titleId, children: title }),
649
- description ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-0.5 text-xs", children: description }) : null
650
+ description ? /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description }) : null
650
651
  ] }),
651
652
  /* @__PURE__ */ jsx(
652
653
  Button,
@@ -686,7 +687,7 @@ function AppearanceMenu({
686
687
  )
687
688
  ] }),
688
689
  /* @__PURE__ */ jsxs(FrameFooter, { className: "flex items-center justify-between gap-3 px-4 py-3", children: [
689
- /* @__PURE__ */ jsx("kbd", { className: "border-border/70 bg-background text-muted-foreground rounded border px-1.5 py-0.5 text-[11px] font-medium", children: shortcutLabel }),
690
+ /* @__PURE__ */ jsx("kbd", { className: "rounded border border-border/70 bg-background px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: shortcutLabel }),
690
691
  /* @__PURE__ */ jsx(Button, { onClick: controller.reset, size: "sm", type: "button", variant: "secondary", children: resetLabel })
691
692
  ] })
692
693
  ]
@@ -743,7 +744,7 @@ function AppearanceMenuTrigger({
743
744
  ...props,
744
745
  children: [
745
746
  /* @__PURE__ */ jsx("span", { children: label }),
746
- /* @__PURE__ */ jsx("kbd", { className: "border-border/70 bg-background/70 text-muted-foreground hidden rounded border px-1.5 py-0.5 text-[10px] font-medium sm:inline", children: shortcutLabel })
747
+ /* @__PURE__ */ jsx("kbd", { className: "hidden rounded border border-border/70 bg-background/70 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground sm:inline", children: shortcutLabel })
747
748
  ]
748
749
  }
749
750
  );
@@ -785,7 +786,7 @@ function applyPersonalization(state, root = document.documentElement) {
785
786
  }
786
787
 
787
788
  // src/theme/core/auto-contrast.ts
788
- var AUTO_CONTRAST_WCAG_Y_THRESHOLD = 0.3;
789
+ var AUTO_CONTRAST_WCAG_Y_THRESHOLD = 0.18;
789
790
  function relativeLuminance(r, g, b) {
790
791
  const toLinear = (c) => {
791
792
  const s = c / 255;
@@ -820,10 +821,6 @@ function rgbToHsl(r, g, b) {
820
821
  }
821
822
  function hslToRgb(h, s, l) {
822
823
  h = (h % 360 + 360) % 360 / 360;
823
- if (s === 0) {
824
- const v = Math.round(l * 255);
825
- return [v, v, v];
826
- }
827
824
  const hue2rgb = (p2, q2, t) => {
828
825
  if (t < 0) t += 1;
829
826
  if (t > 1) t -= 1;
@@ -832,7 +829,7 @@ function hslToRgb(h, s, l) {
832
829
  if (t < 2 / 3) return p2 + (q2 - p2) * (2 / 3 - t) * 6;
833
830
  return p2;
834
831
  };
835
- const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
832
+ const q = l + s - l * s;
836
833
  const p = 2 * l - q;
837
834
  return [
838
835
  Math.round(hue2rgb(p, q, h + 1 / 3) * 255),
@@ -841,31 +838,79 @@ function hslToRgb(h, s, l) {
841
838
  ];
842
839
  }
843
840
  var RAMP_STEPS = [
844
- { step: 50, l: 0.97, sFactor: 0.25 },
845
- { step: 100, l: 0.93, sFactor: 0.35 },
846
- { step: 200, l: 0.87, sFactor: 0.5 },
847
- { step: 300, l: 0.78, sFactor: 0.65 },
848
- { step: 400, l: 0.68, sFactor: 0.82 },
849
- { step: 500, l: 0.52, sFactor: 1 },
850
- { step: 600, l: 0.43, sFactor: 0.92 },
851
- { step: 700, l: 0.34, sFactor: 0.8 },
852
- { step: 800, l: 0.24, sFactor: 0.65 },
853
- { step: 900, l: 0.15, sFactor: 0.45 },
854
- { step: 950, l: 0.08, sFactor: 0.25 }
841
+ { step: 50, l: 0.982, c: 0.014 },
842
+ { step: 100, l: 0.96, c: 0.029 },
843
+ { step: 200, l: 0.913, c: 0.053 },
844
+ { step: 300, l: 0.856, c: 0.081 },
845
+ { step: 400, l: 0.782, c: 0.118 },
846
+ { step: 500, l: 0.619, c: 0.207 },
847
+ { step: 600, l: 0.508, c: 0.195 },
848
+ { step: 700, l: 0.388, c: 0.172 },
849
+ { step: 800, l: 0.283, c: 0.144 },
850
+ { step: 900, l: 0.177, c: 0.11 },
851
+ { step: 950, l: 0.106, c: 0.074 }
855
852
  ];
853
+ var REFERENCE_SATURATION = 0.9;
854
+ function linearToSrgb(c) {
855
+ return c <= 31308e-7 ? 12.92 * c : 1.055 * c ** (1 / 2.4) - 0.055;
856
+ }
857
+ function srgbToLinear(c) {
858
+ const s = c / 255;
859
+ return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
860
+ }
861
+ function oklchToLinearRgb(l, c, h) {
862
+ const hr = h * Math.PI / 180;
863
+ const a = c * Math.cos(hr);
864
+ const b = c * Math.sin(hr);
865
+ const l_ = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;
866
+ const m_ = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;
867
+ const s_ = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;
868
+ return [
869
+ 4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_,
870
+ -1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_,
871
+ -0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_
872
+ ];
873
+ }
874
+ function inGamut([r, g, b]) {
875
+ const e = 1e-4;
876
+ return r >= -e && r <= 1 + e && g >= -e && g <= 1 + e && b >= -e && b <= 1 + e;
877
+ }
878
+ function oklchToRgb(l, c, h) {
879
+ let low = 0;
880
+ let high = c;
881
+ if (!inGamut(oklchToLinearRgb(l, c, h))) {
882
+ for (let i = 0; i < 20; i++) {
883
+ const mid = (low + high) / 2;
884
+ if (inGamut(oklchToLinearRgb(l, mid, h))) low = mid;
885
+ else high = mid;
886
+ }
887
+ c = low;
888
+ }
889
+ return oklchToLinearRgb(l, c, h).map(
890
+ (v) => Math.round(Math.min(1, Math.max(0, linearToSrgb(v))) * 255)
891
+ );
892
+ }
893
+ function oklchHue(hslHue) {
894
+ const [r, g, b] = hslToRgb(hslHue, 1, 0.5).map(srgbToLinear);
895
+ const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
896
+ const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
897
+ const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
898
+ const a = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;
899
+ const bb = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;
900
+ return (Math.atan2(bb, a) * 180 / Math.PI + 360) % 360;
901
+ }
856
902
  var AUTO_FALLBACK_COLOR = { hue: 217, saturation: 0.9 };
857
903
  function applyAutoColorRamp(root, color) {
904
+ const hue = oklchHue(color.hue);
905
+ const chromaScale = Math.min(1, color.saturation) / REFERENCE_SATURATION;
858
906
  let primaryRgb = [0, 0, 0];
859
- for (const { step, l, sFactor } of RAMP_STEPS) {
860
- const s = Math.min(1, color.saturation * sFactor);
861
- const rgb = hslToRgb(color.hue, s, l);
907
+ for (const { step, l, c } of RAMP_STEPS) {
908
+ const rgb = oklchToRgb(l, c * chromaScale, hue);
862
909
  root.style.setProperty(`--color-auto-${step}`, `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, 1)`);
863
- if (step === 500) primaryRgb = rgb;
910
+ if (step === 600) primaryRgb = rgb;
864
911
  }
865
- const useLight = shouldUseLightForeground(...primaryRgb);
866
- const fgStep = useLight ? RAMP_STEPS[0] : RAMP_STEPS[RAMP_STEPS.length - 1];
867
- const fgS = Math.min(1, color.saturation * fgStep.sFactor);
868
- const fgRgb = hslToRgb(color.hue, fgS, fgStep.l);
912
+ const fgStep = shouldUseLightForeground(...primaryRgb) ? RAMP_STEPS[0] : RAMP_STEPS[RAMP_STEPS.length - 1];
913
+ const fgRgb = oklchToRgb(fgStep.l, fgStep.c * chromaScale, hue);
869
914
  root.style.setProperty(
870
915
  "--color-auto-foreground",
871
916
  `rgba(${fgRgb[0]}, ${fgRgb[1]}, ${fgRgb[2]}, 1)`