@lanaco/lnc-react-ui 4.0.8 → 4.0.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.
package/dist/Popover.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const s=require("react/jsx-runtime");require("react");const e=require("./index-BIlhCoy2.cjs"),i=require("./PopoverContext.cjs"),u=require("./usePopover.cjs");function o({children:t,modal:r=!1,...p}){const n=u({modal:r,...p});return s.jsx(i.Provider,{value:n,children:t})}o.propTypes={initialOpen:e.PropTypes.bool,placement:e.PropTypes.oneOf(["center","top","right","bottom","left","top-start","top-end","right-start","right-end","bottom-start","bottom-end","left-start","left-end"]),modal:e.PropTypes.bool,offsetValue:e.PropTypes.number,open:e.PropTypes.bool,onOpenChange:e.PropTypes.func};module.exports=o;
1
+ "use strict";const s=require("react/jsx-runtime"),e=require("./index-BIlhCoy2.cjs"),i=require("./PopoverContext.cjs"),u=require("./usePopover.cjs");function o({children:t,modal:r=!1,...p}){const n=u({modal:r,...p});return s.jsx(i.Provider,{value:n,children:t})}o.propTypes={initialOpen:e.PropTypes.bool,placement:e.PropTypes.oneOf(["center","top","right","bottom","left","top-start","top-end","right-start","right-end","bottom-start","bottom-end","left-start","left-end"]),modal:e.PropTypes.bool,offsetValue:e.PropTypes.number,open:e.PropTypes.bool,onOpenChange:e.PropTypes.func};module.exports=o;
package/dist/Popover.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import "react";
3
2
  import { P as o } from "./index-BYnWp42a.js";
4
- import m from "./PopoverContext.js";
5
- import a from "./usePopover.js";
6
- function f({ children: t, modal: e = !1, ...r }) {
7
- const p = a({ modal: e, ...r });
8
- return /* @__PURE__ */ n(m.Provider, { value: p, children: t });
3
+ import a from "./PopoverContext.js";
4
+ import f from "./usePopover.js";
5
+ function m({ children: t, modal: e = !1, ...r }) {
6
+ const p = f({ modal: e, ...r });
7
+ return /* @__PURE__ */ n(a.Provider, { value: p, children: t });
9
8
  }
10
- f.propTypes = {
9
+ m.propTypes = {
11
10
  initialOpen: o.bool,
12
11
  placement: o.oneOf([
13
12
  "center",
@@ -32,5 +31,5 @@ f.propTypes = {
32
31
  onOpenChange: o.func
33
32
  };
34
33
  export {
35
- f as default
34
+ m as default
36
35
  };
@@ -1 +1 @@
1
- "use strict";const s=require("react/jsx-runtime"),c=require("react"),u=require("./PopoverContext.cjs"),p=()=>{const e=c.useContext(u);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e},i=React.forwardRef(function({children:o,...t},r){const n=p();return s.jsx("div",{...t,ref:r,onClick:()=>n.setOpen(!1),children:o})});module.exports=i;
1
+ "use strict";const c=require("react/jsx-runtime"),o=require("react"),u=require("./PopoverContext.cjs"),p=()=>{const e=o.useContext(u);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e},i=o.forwardRef(function({children:t,...r},n){const s=p();return c.jsx("div",{...r,ref:n,onClick:()=>s.setOpen(!1),children:t})});module.exports=i;
@@ -1,15 +1,15 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { useContext as p } from "react";
2
+ import { forwardRef as p, useContext as f } from "react";
3
3
  import c from "./PopoverContext.js";
4
- const f = () => {
5
- const o = p(c);
4
+ const i = () => {
5
+ const o = f(c);
6
6
  if (o == null)
7
7
  throw new Error("Popover components must be wrapped in <Popover />");
8
8
  return o;
9
- }, u = React.forwardRef(function({ children: e, ...t }, r) {
10
- const n = f();
9
+ }, l = p(function({ children: e, ...t }, r) {
10
+ const n = i();
11
11
  return /* @__PURE__ */ s("div", { ...t, ref: r, onClick: () => n.setOpen(!1), children: e });
12
12
  });
13
13
  export {
14
- u as default
14
+ l as default
15
15
  };
@@ -1 +1 @@
1
- "use strict";const i=require("react/jsx-runtime"),u=require("./floating-ui.react.esm-C4vrBVJU.cjs"),r=require("react"),p=require("./PopoverContext.cjs"),a=()=>{const e=r.useContext(p);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e},f=forwardRef(function({children:n,...s},c){const{setDescriptionId:o}=a(),t=u.useId();return r.useLayoutEffect(()=>(o(t),()=>o(void 0)),[t,o]),i.jsx("p",{...s,ref:c,id:t,children:n})});module.exports=f;
1
+ "use strict";const i=require("react/jsx-runtime"),u=require("./floating-ui.react.esm-C4vrBVJU.cjs"),r=require("react"),p=require("./PopoverContext.cjs"),a=()=>{const e=r.useContext(p);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e},f=r.forwardRef(function({children:n,...s},c){const{setDescriptionId:o}=a(),t=u.useId();return r.useLayoutEffect(()=>(o(t),()=>o(void 0)),[t,o]),i.jsx("p",{...s,ref:c,id:t,children:n})});module.exports=f;
@@ -1,16 +1,16 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
2
  import { u as i } from "./floating-ui.react.esm-72DKnou_.js";
3
- import { useLayoutEffect as u, useContext as c } from "react";
4
- import f from "./PopoverContext.js";
5
- const m = () => {
6
- const o = c(f);
3
+ import { forwardRef as u, useLayoutEffect as c, useContext as f } from "react";
4
+ import m from "./PopoverContext.js";
5
+ const a = () => {
6
+ const o = f(m);
7
7
  if (o == null)
8
8
  throw new Error("Popover components must be wrapped in <Popover />");
9
9
  return o;
10
- }, x = forwardRef(function({ children: e, ...n }, p) {
11
- const { setDescriptionId: t } = m(), r = i();
12
- return u(() => (t(r), () => t(void 0)), [r, t]), /* @__PURE__ */ s("p", { ...n, ref: p, id: r, children: e });
10
+ }, w = u(function({ children: e, ...n }, p) {
11
+ const { setDescriptionId: t } = a(), r = i();
12
+ return c(() => (t(r), () => t(void 0)), [r, t]), /* @__PURE__ */ s("p", { ...n, ref: p, id: r, children: e });
13
13
  });
14
14
  export {
15
- x as default
15
+ w as default
16
16
  };
@@ -1 +1 @@
1
- "use strict";const c=require("react/jsx-runtime"),r=require("react"),i=require("./floating-ui.react.esm-C4vrBVJU.cjs"),a=require("./PopoverContext.cjs"),p=()=>{const e=useContext(a);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e},d=r.forwardRef(function({children:n,...s},u){const{setLabelId:o}=p(),t=i.useId();return r.useLayoutEffect(()=>(o(t),()=>o(void 0)),[t,o]),c.jsx("h2",{...s,ref:u,id:t,children:n})});module.exports=d;
1
+ "use strict";const c=require("react/jsx-runtime"),r=require("react"),i=require("./floating-ui.react.esm-C4vrBVJU.cjs"),a=require("./PopoverContext.cjs"),p=()=>{const e=r.useContext(a);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e},d=r.forwardRef(function({children:n,...s},u){const{setLabelId:o}=p(),t=i.useId();return r.useLayoutEffect(()=>(o(t),()=>o(void 0)),[t,o]),c.jsx("h2",{...s,ref:u,id:t,children:n})});module.exports=d;
@@ -1,16 +1,16 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
- import { forwardRef as u, useLayoutEffect as f } from "react";
3
- import { u as i } from "./floating-ui.react.esm-72DKnou_.js";
4
- import a from "./PopoverContext.js";
5
- const m = () => {
6
- const o = useContext(a);
2
+ import { forwardRef as u, useLayoutEffect as f, useContext as i } from "react";
3
+ import { u as a } from "./floating-ui.react.esm-72DKnou_.js";
4
+ import m from "./PopoverContext.js";
5
+ const c = () => {
6
+ const o = i(m);
7
7
  if (o == null)
8
8
  throw new Error("Popover components must be wrapped in <Popover />");
9
9
  return o;
10
- }, x = u(function({ children: r, ...n }, s) {
11
- const { setLabelId: e } = m(), t = i();
10
+ }, l = u(function({ children: r, ...n }, s) {
11
+ const { setLabelId: e } = c(), t = a();
12
12
  return f(() => (e(t), () => e(void 0)), [t, e]), /* @__PURE__ */ p("h2", { ...n, ref: s, id: t, children: r });
13
13
  });
14
14
  export {
15
- x as default
15
+ l as default
16
16
  };
@@ -1 +1 @@
1
- "use strict";const u=require("react/jsx-runtime"),r=require("react"),f=require("./floating-ui.react.esm-C4vrBVJU.cjs"),l=require("./index-BIlhCoy2.cjs"),P=require("./PopoverContext.cjs"),d=()=>{const o=useContext(P);if(o==null)throw new Error("Popover components must be wrapped in <Popover />");return o},c=r.forwardRef(function({children:e,asChild:p,...n},i){const t=d(),a=e.ref,s=f.useMergeRefs([t.reference,i,a]);return p&&r.isValidElement(e)?r.cloneElement(e,t.getReferenceProps({ref:s,...n,...e.props,"data-state":t.open?"open":"closed"})):u.jsx("div",{ref:s,"data-state":t.open?"open":"closed",style:{width:"max-content"},...t.getReferenceProps(n),children:e})});c.propTypes={asChild:l.PropTypes.bool};module.exports=c;
1
+ "use strict";const u=require("react/jsx-runtime"),o=require("react"),f=require("./floating-ui.react.esm-C4vrBVJU.cjs"),l=require("./index-BIlhCoy2.cjs"),P=require("./PopoverContext.cjs"),d=()=>{const r=o.useContext(P);if(r==null)throw new Error("Popover components must be wrapped in <Popover />");return r},c=o.forwardRef(function({children:e,asChild:p,...n},i){const t=d(),a=e.ref,s=f.useMergeRefs([t.reference,i,a]);return p&&o.isValidElement(e)?o.cloneElement(e,t.getReferenceProps({ref:s,...n,...e.props,"data-state":t.open?"open":"closed"})):u.jsx("div",{ref:s,"data-state":t.open?"open":"closed",style:{width:"max-content"},...t.getReferenceProps(n),children:e})});c.propTypes={asChild:l.PropTypes.bool};module.exports=c;
@@ -1,15 +1,15 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
- import { forwardRef as m, isValidElement as c, cloneElement as i } from "react";
3
- import { a as u } from "./floating-ui.react.esm-72DKnou_.js";
4
- import { P } from "./index-BYnWp42a.js";
5
- import l from "./PopoverContext.js";
6
- const d = () => {
7
- const t = useContext(l);
2
+ import { forwardRef as m, isValidElement as c, cloneElement as i, useContext as u } from "react";
3
+ import { a as P } from "./floating-ui.react.esm-72DKnou_.js";
4
+ import { P as l } from "./index-BYnWp42a.js";
5
+ import d from "./PopoverContext.js";
6
+ const g = () => {
7
+ const t = u(d);
8
8
  if (t == null)
9
9
  throw new Error("Popover components must be wrapped in <Popover />");
10
10
  return t;
11
- }, g = m(function({ children: e, asChild: s, ...r }, p) {
12
- const o = d(), a = e.ref, n = u([o.reference, p, a]);
11
+ }, v = m(function({ children: e, asChild: s, ...r }, p) {
12
+ const o = g(), a = e.ref, n = P([o.reference, p, a]);
13
13
  return s && c(e) ? i(
14
14
  e,
15
15
  o.getReferenceProps({
@@ -29,10 +29,10 @@ const d = () => {
29
29
  }
30
30
  );
31
31
  });
32
- g.propTypes = {
32
+ v.propTypes = {
33
33
  /** Allows the user to pass any element as the anchor */
34
- asChild: P.bool
34
+ asChild: l.bool
35
35
  };
36
36
  export {
37
- g as default
37
+ v as default
38
38
  };
@@ -1 +1 @@
1
- "use strict";const c=require("react"),e=require("./floating-ui.react.esm-C4vrBVJU.cjs"),t=require("./floating-ui.dom-1F2mTXOe.cjs");function k({initialOpen:p=!1,placement:f,offsetValue:g,modal:a=!0,open:l,onOpenChange:m}){const[I,b]=c.useState(p),[r,h]=c.useState(void 0),[u,x]=c.useState(void 0),n=l??I,s=m??b,o=e.useFloating({placement:f,open:n,onOpenChange:s,whileElementsMounted:t.autoUpdate,middleware:[t.offset(g),t.flip({fallbackAxisSideDirection:"end"}),t.shift({padding:5})]}),i=o.context,O=e.useClick(i,{enabled:l==null}),S=e.useDismiss(i),U=e.useRole(i),d=e.useInteractions([O,S,U]);return React.useMemo(()=>({open:n,setOpen:s,...d,...o,modal:a,labelId:r,descriptionId:u,setLabelId:h,setDescriptionId:x}),[n,s,d,o,a,r,u])}module.exports=k;
1
+ "use strict";const t=require("react"),e=require("./floating-ui.react.esm-C4vrBVJU.cjs"),n=require("./floating-ui.dom-1F2mTXOe.cjs");function k({initialOpen:p=!1,placement:f,offsetValue:g,modal:a=!0,open:l,onOpenChange:m}){const[I,b]=t.useState(p),[r,h]=t.useState(void 0),[u,x]=t.useState(void 0),s=l??I,o=m??b,i=e.useFloating({placement:f,open:s,onOpenChange:o,whileElementsMounted:n.autoUpdate,middleware:[n.offset(g),n.flip({fallbackAxisSideDirection:"end"}),n.shift({padding:5})]}),c=i.context,O=e.useClick(c,{enabled:l==null}),S=e.useDismiss(c),U=e.useRole(c),d=e.useInteractions([O,S,U]);return t.useMemo(()=>({open:s,setOpen:o,...d,...i,modal:a,labelId:r,descriptionId:u,setLabelId:h,setDescriptionId:x}),[s,o,d,i,a,r,u])}module.exports=k;
@@ -1,7 +1,7 @@
1
- import { useState as o } from "react";
2
- import { c as k, d as v, e as C, f as D, g as w } from "./floating-ui.react.esm-72DKnou_.js";
3
- import { a as M, o as R, f as S, s as U } from "./floating-ui.dom-BdUovkEr.js";
4
- function L({
1
+ import { useState as o, useMemo as k } from "react";
2
+ import { c as v, d as C, e as D, f as w, g as M } from "./floating-ui.react.esm-72DKnou_.js";
3
+ import { a as S, o as U, f as A, s as E } from "./floating-ui.dom-BdUovkEr.js";
4
+ function R({
5
5
  initialOpen: r = !1,
6
6
  placement: p,
7
7
  offsetValue: u,
@@ -9,22 +9,22 @@ function L({
9
9
  open: i,
10
10
  onOpenChange: f
11
11
  }) {
12
- const [m, g] = o(r), [c, I] = o(void 0), [d, b] = o(void 0), e = i ?? m, s = f ?? g, t = k({
12
+ const [m, g] = o(r), [c, I] = o(void 0), [d, b] = o(void 0), e = i ?? m, s = f ?? g, t = v({
13
13
  placement: p,
14
14
  open: e,
15
15
  onOpenChange: s,
16
- whileElementsMounted: M,
16
+ whileElementsMounted: S,
17
17
  middleware: [
18
- R(u),
19
- S({
18
+ U(u),
19
+ A({
20
20
  fallbackAxisSideDirection: "end"
21
21
  }),
22
- U({ padding: 5 })
22
+ E({ padding: 5 })
23
23
  ]
24
- }), n = t.context, h = v(n, {
24
+ }), n = t.context, h = C(n, {
25
25
  enabled: i == null
26
- }), x = C(n), O = D(n), l = w([h, x, O]);
27
- return React.useMemo(
26
+ }), x = D(n), O = w(n), l = M([h, x, O]);
27
+ return k(
28
28
  () => ({
29
29
  open: e,
30
30
  setOpen: s,
@@ -40,5 +40,5 @@ function L({
40
40
  );
41
41
  }
42
42
  export {
43
- L as default
43
+ R as default
44
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanaco/lnc-react-ui",
3
- "version": "4.0.8",
3
+ "version": "4.0.10",
4
4
  "description": "React component library",
5
5
  "type": "module",
6
6
  "keywords": [