@orangecheck/design 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/chrome.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { Boxes, ChevronDown, Check, CornerDownLeft, Plus, Loader2, Copy, X, Menu, Sun, Moon, Monitor } from 'lucide-react';
1
+ import { Boxes, ChevronDown, Check, CornerDownLeft, Plus, Loader2, Copy, X, Menu, Sun, Moon, Monitor, Waves, Pause } from 'lucide-react';
2
2
  import Link5 from 'next/link';
3
3
  import * as React from 'react';
4
4
  import { createContext, useState, useRef, useEffect, useId, useContext } from 'react';
@@ -792,6 +792,10 @@ function useOcSkin() {
792
792
  }
793
793
  return ctx;
794
794
  }
795
+ function useOcMotion() {
796
+ const { motion, setMotion } = useOcSkin();
797
+ return { motion, setMotion };
798
+ }
795
799
  var MODES = [
796
800
  { id: "light", label: "light", Icon: Sun },
797
801
  { id: "dark", label: "dark", Icon: Moon },
@@ -799,10 +803,12 @@ var MODES = [
799
803
  ];
800
804
  function AppearanceControls({ className }) {
801
805
  const { skin, setSkin, themes } = useOcSkin();
806
+ const { motion, setMotion } = useOcMotion();
802
807
  const { theme, setTheme } = useTheme();
803
808
  const [mounted, setMounted] = useState(false);
804
809
  useEffect(() => setMounted(true), []);
805
810
  const activeMode = mounted ? theme ?? "system" : null;
811
+ const activeMotion = mounted ? motion : null;
806
812
  return /* @__PURE__ */ jsxs("div", { className, children: [
807
813
  /* @__PURE__ */ jsx("div", { className: "label-mono text-muted-foreground px-3 pt-3 pb-2", children: "mode" }),
808
814
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-1 px-2 pb-2", children: MODES.map(({ id, label, Icon }) => {
@@ -849,6 +855,32 @@ function AppearanceControls({ className }) {
849
855
  ]
850
856
  }
851
857
  ) }, t.id);
858
+ }) }),
859
+ /* @__PURE__ */ jsx("div", { className: "label-mono text-muted-foreground border-t px-3 pt-3 pb-2", children: "ambient motion" }),
860
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-1 px-2 pb-3", children: [
861
+ { id: "on", label: "on", Icon: Waves },
862
+ { id: "off", label: "off", Icon: Pause }
863
+ ].map(({ id, label, Icon }) => {
864
+ const active = activeMotion === id;
865
+ return /* @__PURE__ */ jsxs(
866
+ "button",
867
+ {
868
+ type: "button",
869
+ role: "menuitemradio",
870
+ "aria-checked": active,
871
+ "aria-label": id === "off" ? "pause ambient motion" : "ambient motion on",
872
+ onClick: () => setMotion(id),
873
+ className: cn(
874
+ "flex flex-col items-center gap-1 rounded-md border py-2 text-[11px] transition-colors",
875
+ active ? "border-primary text-foreground bg-accent" : "border-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground"
876
+ ),
877
+ children: [
878
+ /* @__PURE__ */ jsx(Icon, { className: "size-4", "aria-hidden": true }),
879
+ label
880
+ ]
881
+ },
882
+ id
883
+ );
852
884
  }) })
853
885
  ] });
854
886
  }