@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.
@@ -1,5 +1,5 @@
1
1
  import * as Popover from '@radix-ui/react-popover';
2
- import { ChevronDown, Plus, HelpCircle, X, Check, Boxes, CornerDownLeft, Loader2, Copy, Menu, Sun, Moon, Monitor } from 'lucide-react';
2
+ import { ChevronDown, Plus, HelpCircle, X, Check, Boxes, CornerDownLeft, Loader2, Copy, Menu, Sun, Moon, Monitor, Waves, Pause } from 'lucide-react';
3
3
  import { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
@@ -1675,6 +1675,10 @@ function useOcSkin() {
1675
1675
  }
1676
1676
  return ctx;
1677
1677
  }
1678
+ function useOcMotion() {
1679
+ const { motion, setMotion } = useOcSkin();
1680
+ return { motion, setMotion };
1681
+ }
1678
1682
  var MODES = [
1679
1683
  { id: "light", label: "light", Icon: Sun },
1680
1684
  { id: "dark", label: "dark", Icon: Moon },
@@ -1682,10 +1686,12 @@ var MODES = [
1682
1686
  ];
1683
1687
  function AppearanceControls({ className }) {
1684
1688
  const { skin, setSkin, themes } = useOcSkin();
1689
+ const { motion, setMotion } = useOcMotion();
1685
1690
  const { theme, setTheme } = useTheme();
1686
1691
  const [mounted, setMounted] = useState(false);
1687
1692
  useEffect(() => setMounted(true), []);
1688
1693
  const activeMode = mounted ? theme ?? "system" : null;
1694
+ const activeMotion = mounted ? motion : null;
1689
1695
  return /* @__PURE__ */ jsxs("div", { className, children: [
1690
1696
  /* @__PURE__ */ jsx("div", { className: "label-mono text-muted-foreground px-3 pt-3 pb-2", children: "mode" }),
1691
1697
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-1 px-2 pb-2", children: MODES.map(({ id, label, Icon: Icon2 }) => {
@@ -1732,6 +1738,32 @@ function AppearanceControls({ className }) {
1732
1738
  ]
1733
1739
  }
1734
1740
  ) }, t.id);
1741
+ }) }),
1742
+ /* @__PURE__ */ jsx("div", { className: "label-mono text-muted-foreground border-t px-3 pt-3 pb-2", children: "ambient motion" }),
1743
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-1 px-2 pb-3", children: [
1744
+ { id: "on", label: "on", Icon: Waves },
1745
+ { id: "off", label: "off", Icon: Pause }
1746
+ ].map(({ id, label, Icon: Icon2 }) => {
1747
+ const active = activeMotion === id;
1748
+ return /* @__PURE__ */ jsxs(
1749
+ "button",
1750
+ {
1751
+ type: "button",
1752
+ role: "menuitemradio",
1753
+ "aria-checked": active,
1754
+ "aria-label": id === "off" ? "pause ambient motion" : "ambient motion on",
1755
+ onClick: () => setMotion(id),
1756
+ className: cn(
1757
+ "flex flex-col items-center gap-1 rounded-md border py-2 text-[11px] transition-colors",
1758
+ active ? "border-primary text-foreground bg-accent" : "border-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground"
1759
+ ),
1760
+ children: [
1761
+ /* @__PURE__ */ jsx(Icon2, { className: "size-4", "aria-hidden": true }),
1762
+ label
1763
+ ]
1764
+ },
1765
+ id
1766
+ );
1735
1767
  }) })
1736
1768
  ] });
1737
1769
  }