@solibo/solibo-ui 2.3.0 → 2.3.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index56.css');const v=require("react/jsx-runtime"),j=require("classix"),s=require("react");function k(t){const[e,r]=s.useState(null),[d,o]=s.useState(),a=!!t&&d!=null,f=s.useCallback(n=>r(n),[]),l=s.useCallback(()=>{if(!e||!t){o(void 0);return}const n=Array.from(e.children).filter(m=>m instanceof HTMLElement&&getComputedStyle(m).display!=="none"),i=t?n[t-1]:void 0,u=t&&n.length>t&&i?i.getBoundingClientRect().bottom-e.getBoundingClientRect().top+e.scrollTop+(parseFloat(getComputedStyle(e).paddingBottom)||0):void 0;o(u)},[e,t]);return s.useLayoutEffect(l),s.useLayoutEffect(()=>{if(!e||!t)return;const n=typeof ResizeObserver>"u"?void 0:new ResizeObserver(l),i=()=>{n==null||n.disconnect(),n==null||n.observe(e),Array.from(e.children).forEach(m=>n==null?void 0:n.observe(m)),l()},u=new MutationObserver(i);return u.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["class","style","hidden"]}),window.addEventListener("resize",l),i(),()=>{n==null||n.disconnect(),u.disconnect(),window.removeEventListener("resize",l)}},[e,t,l]),{ref:f,isOverflowing:a,visibleHeight:d}}function M(t){return s.isValidElement(t)&&t.type===s.Fragment}function F(t,e=[]){return s.Children.forEach(t,r=>{M(r)?F(r.props.children,e):e.push(r)}),e}function N(t,{wrapper:e="li"}={}){return F(t).filter(o=>o!==null).map((o,a)=>{if(s.isValidElement(o)&&o.type===e)return o;const f=s.isValidElement(o)&&o.key!=null?o.key:a;return s.createElement(e,{key:f,"data-component":"wrapchildren"},o)})}const S="_controls_uue68_1",B="_horizontal_uue68_9",z="_list_uue68_20",H="_columns_uue68_61",q="_masonry_uue68_71",T="_scrollable_uue68_81",V="_overflowing_uue68_88",A="_sized_uue68_111",I="_compact_uue68_123",c={controls:S,horizontal:B,list:z,columns:H,masonry:q,scrollable:T,overflowing:V,sized:A,compact:I},L=(t,e)=>{typeof t=="function"?t(e):t&&(t.current=e)};function D({children:t,className:e,columns:r=1,columnWidth:d,compact:o=!1,controls:a,horizontal:f,layout:l="grid",maxVisibleItems:n,ordered:i,ref:u,style:m,..._}){const y=Number.isFinite(r)?Math.max(1,Math.floor(r)):1,g=l==="grid"&&y===1&&!f&&n!=null&&Number.isFinite(n)&&n>=1?Math.floor(n):void 0,{ref:b,isOverflowing:h,visibleHeight:p}=k(g),w=s.useCallback(R=>{b(R),L(u,R)},[b,u]),E=j(e,c.list,l==="masonry"?c.masonry:y>1&&c.columns,!!g&&c.scrollable,h&&c.overflowing,f&&c.horizontal,o&&c.compact,d&&c.sized),x={...m,"--list-columns":y,"--list-column-width":d,"--list-max-height":g&&p!=null?`${p}px`:void 0},C=i?v.jsx("ol",{className:E,ref:w,style:x,..._,"data-layout":l==="masonry"?"masonry":y>1?"columns":void 0,tabIndex:_.tabIndex??(h?0:void 0),"data-component":"list",children:N(t)}):v.jsx("ul",{className:E,ref:w,style:x,..._,"data-layout":l==="masonry"?"masonry":y>1?"columns":void 0,tabIndex:_.tabIndex??(h?0:void 0),"data-component":"list",children:N(t)});return a==null?C:v.jsxs(v.Fragment,{children:[v.jsx("div",{className:c.controls,"data-component":"list",children:a}),C]})}exports.List=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index56.css');const v=require("react/jsx-runtime"),M=require("classix"),s=require("react");function j(t){const[e,r]=s.useState(null),[f,o]=s.useState(),u=!!t&&f!=null,m=s.useCallback(n=>r(n),[]),l=s.useCallback(()=>{if(!e||!t){o(void 0);return}const n=Array.from(e.children).filter(a=>a instanceof HTMLElement&&getComputedStyle(a).display!=="none"),d=t?n[t-1]:void 0,c=t&&n.length>t&&d?d.getBoundingClientRect().bottom-e.getBoundingClientRect().top+e.scrollTop+(parseFloat(getComputedStyle(e).paddingBottom)||0):void 0;o(a=>a!=null&&c!=null&&Math.abs(a-c)<.5?a:c)},[e,t]);return s.useLayoutEffect(l),s.useLayoutEffect(()=>{if(!e||!t)return;const n=typeof ResizeObserver>"u"?void 0:new ResizeObserver(l),d=()=>{n==null||n.disconnect(),n==null||n.observe(e),Array.from(e.children).forEach(a=>n==null?void 0:n.observe(a)),l()},c=new MutationObserver(d);return c.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["class","style","hidden"]}),window.addEventListener("resize",l),d(),()=>{n==null||n.disconnect(),c.disconnect(),window.removeEventListener("resize",l)}},[e,t,l]),{ref:m,isOverflowing:u,visibleHeight:f}}function k(t){return s.isValidElement(t)&&t.type===s.Fragment}function F(t,e=[]){return s.Children.forEach(t,r=>{k(r)?F(r.props.children,e):e.push(r)}),e}function N(t,{wrapper:e="li"}={}){return F(t).filter(o=>o!==null).map((o,u)=>{if(s.isValidElement(o)&&o.type===e)return o;const m=s.isValidElement(o)&&o.key!=null?o.key:u;return s.createElement(e,{key:m,"data-component":"wrapchildren"},o)})}const S="_controls_uue68_1",B="_horizontal_uue68_9",z="_list_uue68_20",H="_columns_uue68_61",q="_masonry_uue68_71",T="_scrollable_uue68_81",V="_overflowing_uue68_88",A="_sized_uue68_111",I="_compact_uue68_123",i={controls:S,horizontal:B,list:z,columns:H,masonry:q,scrollable:T,overflowing:V,sized:A,compact:I},L=(t,e)=>{typeof t=="function"?t(e):t&&(t.current=e)};function D({children:t,className:e,columns:r=1,columnWidth:f,compact:o=!1,controls:u,horizontal:m,layout:l="grid",maxVisibleItems:n,ordered:d,ref:c,style:a,..._}){const y=Number.isFinite(r)?Math.max(1,Math.floor(r)):1,g=l==="grid"&&y===1&&!m&&n!=null&&Number.isFinite(n)&&n>=1?Math.floor(n):void 0,{ref:b,isOverflowing:h,visibleHeight:p}=j(g),w=s.useCallback(R=>{b(R),L(c,R)},[b,c]),E=M(e,i.list,l==="masonry"?i.masonry:y>1&&i.columns,!!g&&i.scrollable,h&&i.overflowing,m&&i.horizontal,o&&i.compact,f&&i.sized),x={...a,"--list-columns":y,"--list-column-width":f,"--list-max-height":g&&p!=null?`${p}px`:void 0},C=d?v.jsx("ol",{className:E,ref:w,style:x,..._,"data-layout":l==="masonry"?"masonry":y>1?"columns":void 0,tabIndex:_.tabIndex??(h?0:void 0),"data-component":"list",children:N(t)}):v.jsx("ul",{className:E,ref:w,style:x,..._,"data-layout":l==="masonry"?"masonry":y>1?"columns":void 0,tabIndex:_.tabIndex??(h?0:void 0),"data-component":"list",children:N(t)});return u==null?C:v.jsxs(v.Fragment,{children:[v.jsx("div",{className:i.controls,"data-component":"list",children:u}),C]})}exports.List=D;
@@ -1,57 +1,57 @@
1
1
  import { jsx as h, jsxs as z, Fragment as H } from "react/jsx-runtime";
2
2
  import S from "classix";
3
- import m, { useState as F, useCallback as p, useLayoutEffect as B } from "react";
3
+ import m, { useState as F, useCallback as p, useLayoutEffect as M } from "react";
4
4
  import '../../assets/index56.css';function V(t) {
5
- const [n, l] = F(null), [u, o] = F(), c = !!t && u != null, d = p((e) => l(e), []), s = p(() => {
5
+ const [n, r] = F(null), [d, o] = F(), i = !!t && d != null, f = p((e) => r(e), []), s = p(() => {
6
6
  if (!n || !t) {
7
7
  o(void 0);
8
8
  return;
9
9
  }
10
- const e = Array.from(n.children).filter((f) => f instanceof HTMLElement && getComputedStyle(f).display !== "none"), a = t ? e[t - 1] : void 0, i = t && e.length > t && a ? a.getBoundingClientRect().bottom - n.getBoundingClientRect().top + n.scrollTop + (parseFloat(getComputedStyle(n).paddingBottom) || 0) : void 0;
11
- o(i);
10
+ const e = Array.from(n.children).filter((l) => l instanceof HTMLElement && getComputedStyle(l).display !== "none"), u = t ? e[t - 1] : void 0, a = t && e.length > t && u ? u.getBoundingClientRect().bottom - n.getBoundingClientRect().top + n.scrollTop + (parseFloat(getComputedStyle(n).paddingBottom) || 0) : void 0;
11
+ o((l) => l != null && a != null && Math.abs(l - a) < 0.5 ? l : a);
12
12
  }, [n, t]);
13
- return B(s), B(() => {
13
+ return M(s), M(() => {
14
14
  if (!n || !t) return;
15
- const e = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(s), a = () => {
16
- e == null || e.disconnect(), e == null || e.observe(n), Array.from(n.children).forEach((f) => e == null ? void 0 : e.observe(f)), s();
17
- }, i = new MutationObserver(a);
18
- return i.observe(n, {
15
+ const e = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(s), u = () => {
16
+ e == null || e.disconnect(), e == null || e.observe(n), Array.from(n.children).forEach((l) => e == null ? void 0 : e.observe(l)), s();
17
+ }, a = new MutationObserver(u);
18
+ return a.observe(n, {
19
19
  childList: !0,
20
20
  subtree: !0,
21
21
  characterData: !0,
22
22
  attributes: !0,
23
23
  attributeFilter: ["class", "style", "hidden"]
24
- }), window.addEventListener("resize", s), a(), () => {
25
- e == null || e.disconnect(), i.disconnect(), window.removeEventListener("resize", s);
24
+ }), window.addEventListener("resize", s), u(), () => {
25
+ e == null || e.disconnect(), a.disconnect(), window.removeEventListener("resize", s);
26
26
  };
27
27
  }, [n, t, s]), {
28
- ref: d,
29
- isOverflowing: c,
30
- visibleHeight: u
28
+ ref: f,
29
+ isOverflowing: i,
30
+ visibleHeight: d
31
31
  };
32
32
  }
33
33
  function j(t) {
34
34
  return m.isValidElement(t) && t.type === m.Fragment;
35
35
  }
36
36
  function k(t, n = []) {
37
- return m.Children.forEach(t, (l) => {
38
- j(l) ? k(l.props.children, n) : n.push(l);
37
+ return m.Children.forEach(t, (r) => {
38
+ j(r) ? k(r.props.children, n) : n.push(r);
39
39
  }), n;
40
40
  }
41
- function M(t, {
41
+ function B(t, {
42
42
  wrapper: n = "li"
43
43
  } = {}) {
44
- return k(t).filter((o) => o !== null).map((o, c) => {
44
+ return k(t).filter((o) => o !== null).map((o, i) => {
45
45
  if (m.isValidElement(o) && o.type === n)
46
46
  return o;
47
- const d = m.isValidElement(o) && o.key != null ? o.key : c;
47
+ const f = m.isValidElement(o) && o.key != null ? o.key : i;
48
48
  return m.createElement(n, {
49
- key: d,
49
+ key: f,
50
50
  "data-component": "wrapchildren"
51
51
  }, o);
52
52
  });
53
53
  }
54
- const A = "_controls_uue68_1", I = "_horizontal_uue68_9", T = "_list_uue68_20", D = "_columns_uue68_61", $ = "_masonry_uue68_71", q = "_scrollable_uue68_81", G = "_overflowing_uue68_88", J = "_sized_uue68_111", K = "_compact_uue68_123", r = {
54
+ const A = "_controls_uue68_1", I = "_horizontal_uue68_9", T = "_list_uue68_20", D = "_columns_uue68_61", $ = "_masonry_uue68_71", q = "_scrollable_uue68_81", G = "_overflowing_uue68_88", J = "_sized_uue68_111", K = "_compact_uue68_123", c = {
55
55
  controls: A,
56
56
  horizontal: I,
57
57
  list: T,
@@ -67,32 +67,32 @@ const A = "_controls_uue68_1", I = "_horizontal_uue68_9", T = "_list_uue68_20",
67
67
  function U({
68
68
  children: t,
69
69
  className: n,
70
- columns: l = 1,
71
- columnWidth: u,
70
+ columns: r = 1,
71
+ columnWidth: d,
72
72
  compact: o = !1,
73
- controls: c,
74
- horizontal: d,
73
+ controls: i,
74
+ horizontal: f,
75
75
  layout: s = "grid",
76
76
  maxVisibleItems: e,
77
- ordered: a,
78
- ref: i,
79
- style: f,
77
+ ordered: u,
78
+ ref: a,
79
+ style: l,
80
80
  ...v
81
81
  }) {
82
- const _ = Number.isFinite(l) ? Math.max(1, Math.floor(l)) : 1, y = s === "grid" && _ === 1 && !d && e != null && Number.isFinite(e) && e >= 1 ? Math.floor(e) : void 0, {
82
+ const _ = Number.isFinite(r) ? Math.max(1, Math.floor(r)) : 1, y = s === "grid" && _ === 1 && !f && e != null && Number.isFinite(e) && e >= 1 ? Math.floor(e) : void 0, {
83
83
  ref: b,
84
84
  isOverflowing: g,
85
85
  visibleHeight: w
86
86
  } = V(y), E = p((R) => {
87
- b(R), L(i, R);
88
- }, [b, i]), x = S(n, r.list, s === "masonry" ? r.masonry : _ > 1 && r.columns, !!y && r.scrollable, g && r.overflowing, d && r.horizontal, o && r.compact, u && r.sized), C = {
89
- ...f,
87
+ b(R), L(a, R);
88
+ }, [b, a]), x = S(n, c.list, s === "masonry" ? c.masonry : _ > 1 && c.columns, !!y && c.scrollable, g && c.overflowing, f && c.horizontal, o && c.compact, d && c.sized), C = {
89
+ ...l,
90
90
  "--list-columns": _,
91
- "--list-column-width": u,
91
+ "--list-column-width": d,
92
92
  "--list-max-height": y && w != null ? `${w}px` : void 0
93
- }, N = a ? /* @__PURE__ */ h("ol", { className: x, ref: E, style: C, ...v, "data-layout": s === "masonry" ? "masonry" : _ > 1 ? "columns" : void 0, tabIndex: v.tabIndex ?? (g ? 0 : void 0), "data-component": "list", children: M(t) }) : /* @__PURE__ */ h("ul", { className: x, ref: E, style: C, ...v, "data-layout": s === "masonry" ? "masonry" : _ > 1 ? "columns" : void 0, tabIndex: v.tabIndex ?? (g ? 0 : void 0), "data-component": "list", children: M(t) });
94
- return c == null ? N : /* @__PURE__ */ z(H, { children: [
95
- /* @__PURE__ */ h("div", { className: r.controls, "data-component": "list", children: c }),
93
+ }, N = u ? /* @__PURE__ */ h("ol", { className: x, ref: E, style: C, ...v, "data-layout": s === "masonry" ? "masonry" : _ > 1 ? "columns" : void 0, tabIndex: v.tabIndex ?? (g ? 0 : void 0), "data-component": "list", children: B(t) }) : /* @__PURE__ */ h("ul", { className: x, ref: E, style: C, ...v, "data-layout": s === "masonry" ? "masonry" : _ > 1 ? "columns" : void 0, tabIndex: v.tabIndex ?? (g ? 0 : void 0), "data-component": "list", children: B(t) });
94
+ return i == null ? N : /* @__PURE__ */ z(H, { children: [
95
+ /* @__PURE__ */ h("div", { className: c.controls, "data-component": "list", children: i }),
96
96
  N
97
97
  ] });
98
98
  }
package/dist/tokens.json CHANGED
@@ -375,7 +375,7 @@
375
375
  },
376
376
  "com.solibo": {
377
377
  "packageName": "@solibo/solibo-ui",
378
- "packageVersion": "2.3.0"
378
+ "packageVersion": "2.3.1"
379
379
  }
380
380
  },
381
381
  "$name": "SUI: Design Tokens",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solibo/solibo-ui",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "./dist/index.js",