cortena-ui 1.1.0 → 1.1.1

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/index.d.ts CHANGED
@@ -895,7 +895,7 @@ declare function AvatarFallback({ className, ...props }: Avatar$1.Fallback.Props
895
895
  * for cortenaweb call sites.
896
896
  */
897
897
  declare const badgeVariants: (props?: ({
898
- variant?: "default" | "success" | "warn" | "danger" | "info" | "warning" | "destructive" | "neutral" | "secondary" | "outline" | null | undefined;
898
+ variant?: "default" | "success" | "warning" | "warn" | "danger" | "destructive" | "info" | "neutral" | "secondary" | "outline" | null | undefined;
899
899
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
900
900
  interface BadgeProps extends React$1.ComponentProps<"span">, VariantProps<typeof badgeVariants> {}
901
901
  declare function Badge({ className, variant, ...props }: BadgeProps): React$1.JSX.Element;
package/dist/index.js CHANGED
@@ -6004,17 +6004,20 @@ function subscribeTheme(onChange) {
6004
6004
  window.removeEventListener("storage", onChange);
6005
6005
  };
6006
6006
  }
6007
+ function schemeQuery() {
6008
+ return typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia(DARK_QUERY) : null;
6009
+ }
6007
6010
  function subscribeScheme(onChange) {
6008
- const query = window.matchMedia(DARK_QUERY);
6009
- query.addEventListener("change", onChange);
6011
+ const query = schemeQuery();
6012
+ query?.addEventListener("change", onChange);
6010
6013
  const unsubscribeTheme = subscribeTheme(onChange);
6011
6014
  return () => {
6012
- query.removeEventListener("change", onChange);
6015
+ query?.removeEventListener("change", onChange);
6013
6016
  unsubscribeTheme();
6014
6017
  };
6015
6018
  }
6016
6019
  function systemScheme() {
6017
- return window.matchMedia(DARK_QUERY).matches ? "dark" : "light";
6020
+ return schemeQuery()?.matches ? "dark" : "light";
6018
6021
  }
6019
6022
  function useCortenaTheme(options = {}) {
6020
6023
  const { storageKey = DEFAULT_THEME_STORAGE_KEY, allowedOrigins, listen = true } = options;