quirk-ui 0.0.401 → 0.0.403

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e({}){return"hello"}exports.Navbar=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),e=require("react");function h({}){const[d,a]=e.useState(0),[l,t]=e.useState(null),[f,v]=e.useState(!1),i=e.useRef(null),s=e.useRef(null),o=e.useCallback(n=>{i.current&&!i.current.contains(n.target)&&t(null)},[]),u=e.useCallback(()=>{c(),typeof window<"u"&&window.innerWidth>768&&(v(!1),t(null),typeof document<"u"&&(document.body.style.overflow=""))},[]),c=e.useCallback(()=>{if(s.current){const n=s.current.getBoundingClientRect().width;a(n)}},[]);return e.useEffect(()=>{const n=typeof window<"u",r=typeof document<"u";return n&&window.addEventListener("resize",u),r&&document.addEventListener("click",o),c(),()=>{n&&window.removeEventListener("resize",u),r&&document.removeEventListener("click",o)}},[]),w.jsxs("p",{children:["Nav: ",d," ",l," ",f]})}exports.Navbar=h;
@@ -1,6 +1,30 @@
1
- function r({}) {
2
- return "hello";
1
+ import { jsxs as h } from "react/jsx-runtime";
2
+ import { useState as n, useRef as f, useCallback as t, useEffect as p } from "react";
3
+ function N({}) {
4
+ const [a, l] = n(0), [m, i] = n(null), [v, w] = n(!1), o = f(null), s = f(null), d = t((e) => {
5
+ o.current && !o.current.contains(e.target) && i(null);
6
+ }, []), r = t(() => {
7
+ c(), typeof window < "u" && window.innerWidth > 768 && (w(!1), i(null), typeof document < "u" && (document.body.style.overflow = ""));
8
+ }, []), c = t(() => {
9
+ if (s.current) {
10
+ const e = s.current.getBoundingClientRect().width;
11
+ l(e);
12
+ }
13
+ }, []);
14
+ return p(() => {
15
+ const e = typeof window < "u", u = typeof document < "u";
16
+ return e && window.addEventListener("resize", r), u && document.addEventListener("click", d), c(), () => {
17
+ e && window.removeEventListener("resize", r), u && document.removeEventListener("click", d);
18
+ };
19
+ }, []), /* @__PURE__ */ h("p", { children: [
20
+ "Nav: ",
21
+ a,
22
+ " ",
23
+ m,
24
+ " ",
25
+ v
26
+ ] });
3
27
  }
4
28
  export {
5
- r as Navbar
29
+ N as Navbar
6
30
  };
package/dist/core.d.ts CHANGED
@@ -856,11 +856,11 @@ declare type MultiSelectProps = {
856
856
  className?: string;
857
857
  };
858
858
 
859
- export declare function Navbar({}: NavbarProps): string;
859
+ export declare function Navbar({}: NavbarProps): JSX.Element;
860
860
 
861
861
  declare type NavbarProps = {
862
862
  title?: string;
863
- logo?: React.ReactNode;
863
+ logo?: default_2.ReactNode;
864
864
  items?: NavItem[];
865
865
  groups?: NavGroup[];
866
866
  utilityItems?: UtilityItem[];
@@ -871,8 +871,8 @@ declare type NavbarProps = {
871
871
  alignment: Alignment_3;
872
872
  className?: string;
873
873
  navigationType: "default" | "advanced";
874
- searchComponent?: React.ReactNode;
875
- localeSelectComponent?: React.ReactNode;
874
+ searchComponent?: default_2.ReactNode;
875
+ localeSelectComponent?: default_2.ReactNode;
876
876
  };
877
877
 
878
878
  export declare type NavGroup = {
@@ -880,14 +880,14 @@ export declare type NavGroup = {
880
880
  title: string;
881
881
  primaryItems?: NavItem[];
882
882
  secondaryItems?: NavItem[];
883
- spotlight?: React.ReactNode;
883
+ spotlight?: default_2.ReactNode;
884
884
  };
885
885
 
886
886
  export declare type NavItem = {
887
887
  _key?: string;
888
888
  label: string;
889
889
  subtitle?: string;
890
- description?: React.ReactNode;
890
+ description?: default_2.ReactNode;
891
891
  href?: string;
892
892
  sublinks?: NavItem[];
893
893
  isExternal?: boolean;
package/dist/main.d.ts CHANGED
@@ -1251,11 +1251,11 @@ declare type MultiSelectProps = {
1251
1251
  className?: string;
1252
1252
  };
1253
1253
 
1254
- export declare function Navbar({}: NavbarProps): string;
1254
+ export declare function Navbar({}: NavbarProps): JSX.Element;
1255
1255
 
1256
1256
  declare type NavbarProps = {
1257
1257
  title?: string;
1258
- logo?: React.ReactNode;
1258
+ logo?: default_2.ReactNode;
1259
1259
  items?: NavItem[];
1260
1260
  groups?: NavGroup[];
1261
1261
  utilityItems?: UtilityItem[];
@@ -1266,8 +1266,8 @@ declare type NavbarProps = {
1266
1266
  alignment: Alignment_3;
1267
1267
  className?: string;
1268
1268
  navigationType: "default" | "advanced";
1269
- searchComponent?: React.ReactNode;
1270
- localeSelectComponent?: React.ReactNode;
1269
+ searchComponent?: default_2.ReactNode;
1270
+ localeSelectComponent?: default_2.ReactNode;
1271
1271
  };
1272
1272
 
1273
1273
  export declare type NavGroup = {
@@ -1275,7 +1275,7 @@ export declare type NavGroup = {
1275
1275
  title: string;
1276
1276
  primaryItems?: NavItem[];
1277
1277
  secondaryItems?: NavItem[];
1278
- spotlight?: React.ReactNode;
1278
+ spotlight?: default_2.ReactNode;
1279
1279
  };
1280
1280
 
1281
1281
  export declare interface NavigationData {
@@ -1307,7 +1307,7 @@ export declare type NavItem = {
1307
1307
  _key?: string;
1308
1308
  label: string;
1309
1309
  subtitle?: string;
1310
- description?: React.ReactNode;
1310
+ description?: default_2.ReactNode;
1311
1311
  href?: string;
1312
1312
  sublinks?: NavItem[];
1313
1313
  isExternal?: boolean;
package/dist/next.d.ts CHANGED
@@ -401,7 +401,7 @@ declare type NavGroup = {
401
401
  title: string;
402
402
  primaryItems?: NavItem[];
403
403
  secondaryItems?: NavItem[];
404
- spotlight?: React.ReactNode;
404
+ spotlight?: default_2.ReactNode;
405
405
  };
406
406
 
407
407
  export declare interface NavigationData {
@@ -433,7 +433,7 @@ declare type NavItem = {
433
433
  _key?: string;
434
434
  label: string;
435
435
  subtitle?: string;
436
- description?: React.ReactNode;
436
+ description?: default_2.ReactNode;
437
437
  href?: string;
438
438
  sublinks?: NavItem[];
439
439
  isExternal?: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.401",
4
+ "version": "0.0.403",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {