wimui 0.21.0 → 0.22.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,2 +1,2 @@
1
1
  "use client";
2
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("./treemap.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s=2,c=8,l=(e,t,n)=>{let r=n-t,i=r===0?1:Math.min(1,Math.max(0,(e-t)/r));return`color-mix(in oklch, var(--wim-color-chart-primary) ${20+Math.round(i*40)}%, var(--wim-color-surface))`},u=(0,i.createContext)({min:0,max:1}),d=({x:e,y:t,width:n,height:r,name:o,value:d,depth:f,children:p})=>{let{min:m,max:h}=(0,i.useContext)(u),[g,_]=(0,i.useState)(!0),v=(0,i.useCallback)(e=>{e&&_(e.getComputedTextLength()+c*2<=n)},[n]);return f===0||Array.isArray(p)&&p.length>0?(0,a.jsx)(`g`,{}):(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`rect`,{x:e+s/2,y:t+s/2,width:Math.max(0,n-s),height:Math.max(0,r-s),style:{fill:l(d,m,h),stroke:`none`}}),n>30&&r>20&&(0,a.jsx)(`text`,{ref:v,x:e+n/2,y:t+r/2,textAnchor:`middle`,dominantBaseline:`central`,style:{fill:`var(--wim-color-text-primary)`,fontSize:`var(--wim-font-size-lg)`,fontWeight:`var(--wim-font-weight-bold)`,stroke:`none`,strokeWidth:0,pointerEvents:`none`,userSelect:`none`,visibility:g?void 0:`hidden`},children:o})]})},f=({data:e,dataKey:s,aspectRatio:c=4/3,height:l=300,width:f=`100%`,title:p})=>{let m=(0,i.useMemo)(()=>{let t=e=>e.flatMap(e=>Array.isArray(e.children)?t(e.children):[e]),n=t(e??[]).map(e=>Number(e[s])||0);return n.length?{min:Math.min(...n),max:Math.max(...n)}:{min:0,max:1}},[e,s]);return!e||e.length===0?null:(0,a.jsx)(u.Provider,{value:m,children:(0,a.jsxs)(`div`,{className:`wim-treemap ${r.default.root} wim-treemap__root`,style:{width:f},children:[p&&(0,a.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:p}),(0,a.jsx)(`div`,{className:`${r.default.container} wim-treemap__container`,style:{height:l,minWidth:0,minHeight:0},children:(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,a.jsx)(o.Treemap,{data:e,dataKey:s,aspectRatio:c,stroke:`none`,content:d,isAnimationActive:!1,children:(0,a.jsx)(o.Tooltip,{contentStyle:n.CHART_THEME.tooltip.contentStyle,formatter:(e,t)=>[e,t]})})})})]})})};exports.Treemap=f;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("./treemap.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s=2,c=8,l=2,u=(e,t,n)=>{let r=n-t,i=r===0?1:Math.min(1,Math.max(0,(e-t)/r));return`color-mix(in oklch, var(--wim-color-chart-primary) ${20+Math.round(i*40)}%, var(--wim-color-surface))`},d=(0,i.createContext)({min:0,max:1}),f=({x:e,y:t,width:n,height:r,name:o,value:f,depth:p,children:m})=>{let{min:h,max:g}=(0,i.useContext)(d),_=o??``,v=(0,i.useCallback)(e=>{if(!e)return;let t=()=>{let t=Math.min(c,n*.12),r=Math.floor(n-t*2),i=()=>Math.ceil(e.getComputedTextLength())<=r;if(e.textContent=_,i()){e.style.visibility=``;return}let a=e.getComputedTextLength()/Math.max(1,_.length),o=Math.min(Math.floor(r/a)-1,_.length-1);for(;o>=l;){if(e.textContent=`${_.slice(0,o).trimEnd()}…`,i()){e.style.visibility=``;return}--o}e.textContent=_,e.style.visibility=`hidden`};t();let r=()=>{e.isConnected&&t()};return document.fonts?.addEventListener?.(`loadingdone`,r),()=>document.fonts?.removeEventListener?.(`loadingdone`,r)},[n,_]);return p===0||Array.isArray(m)&&m.length>0?(0,a.jsx)(`g`,{}):(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`rect`,{x:e+s/2,y:t+s/2,width:Math.max(0,n-s),height:Math.max(0,r-s),style:{fill:u(f,h,g),stroke:`none`}}),n>30&&r>20&&(0,a.jsx)(`text`,{ref:v,x:e+n/2,y:t+r/2,textAnchor:`middle`,dominantBaseline:`central`,style:{fill:`var(--wim-color-text-primary)`,fontSize:`var(--wim-font-size-lg)`,fontWeight:`var(--wim-font-weight-bold)`,stroke:`none`,strokeWidth:0,pointerEvents:`none`,userSelect:`none`},children:_})]})},p=({data:e,dataKey:s,aspectRatio:c=4/3,height:l=300,width:u=`100%`,title:p})=>{let m=(0,i.useMemo)(()=>{let t=e=>e.flatMap(e=>Array.isArray(e.children)?t(e.children):[e]),n=t(e??[]).map(e=>Number(e[s])||0);return n.length?{min:Math.min(...n),max:Math.max(...n)}:{min:0,max:1}},[e,s]);return!e||e.length===0?null:(0,a.jsx)(d.Provider,{value:m,children:(0,a.jsxs)(`div`,{className:`wim-treemap ${r.default.root} wim-treemap__root`,style:{width:u},children:[p&&(0,a.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:p}),(0,a.jsx)(`div`,{className:`${r.default.container} wim-treemap__container`,style:{height:l,minWidth:0,minHeight:0},children:(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,a.jsx)(o.Treemap,{data:e,dataKey:s,aspectRatio:c,stroke:`none`,content:f,isAnimationActive:!1,children:(0,a.jsx)(o.Tooltip,{contentStyle:n.CHART_THEME.tooltip.contentStyle,formatter:(e,t)=>[e,t]})})})})]})})};exports.Treemap=p;
@@ -2,31 +2,52 @@
2
2
  import { Title as e } from "../../typography/Title/Title.js";
3
3
  import { CHART_THEME as t } from "../../helpers.js";
4
4
  import n from "./treemap.module.js";
5
- import { createContext as r, useCallback as i, useContext as a, useMemo as o, useState as s } from "react";
6
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
- import { ResponsiveContainer as u, Tooltip as d, Treemap as f } from "recharts";
5
+ import { createContext as r, useCallback as i, useContext as a, useMemo as o } from "react";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ import { ResponsiveContainer as l, Tooltip as u, Treemap as d } from "recharts";
8
8
  //#region src/components/charts/Treemap/Treemap.tsx
9
- var p = 2, m = 8, h = (e, t, n) => {
9
+ var f = 2, p = 8, m = 2, h = (e, t, n) => {
10
10
  let r = n - t, i = r === 0 ? 1 : Math.min(1, Math.max(0, (e - t) / r));
11
11
  return `color-mix(in oklch, var(--wim-color-chart-primary) ${20 + Math.round(i * 40)}%, var(--wim-color-surface))`;
12
12
  }, g = r({
13
13
  min: 0,
14
14
  max: 1
15
- }), _ = ({ x: e, y: t, width: n, height: r, name: o, value: u, depth: d, children: f }) => {
16
- let { min: _, max: v } = a(g), [y, b] = s(!0), x = i((e) => {
17
- e && b(e.getComputedTextLength() + m * 2 <= n);
18
- }, [n]);
19
- return d === 0 || Array.isArray(f) && f.length > 0 ? /* @__PURE__ */ c("g", {}) : /* @__PURE__ */ l("g", { children: [/* @__PURE__ */ c("rect", {
20
- x: e + p / 2,
21
- y: t + p / 2,
22
- width: Math.max(0, n - p),
23
- height: Math.max(0, r - p),
15
+ }), _ = ({ x: e, y: t, width: n, height: r, name: o, value: l, depth: u, children: d }) => {
16
+ let { min: _, max: v } = a(g), y = o ?? "", b = i((e) => {
17
+ if (!e) return;
18
+ let t = () => {
19
+ let t = Math.min(p, n * .12), r = Math.floor(n - t * 2), i = () => Math.ceil(e.getComputedTextLength()) <= r;
20
+ if (e.textContent = y, i()) {
21
+ e.style.visibility = "";
22
+ return;
23
+ }
24
+ let a = e.getComputedTextLength() / Math.max(1, y.length), o = Math.min(Math.floor(r / a) - 1, y.length - 1);
25
+ for (; o >= m;) {
26
+ if (e.textContent = `${y.slice(0, o).trimEnd()}…`, i()) {
27
+ e.style.visibility = "";
28
+ return;
29
+ }
30
+ --o;
31
+ }
32
+ e.textContent = y, e.style.visibility = "hidden";
33
+ };
34
+ t();
35
+ let r = () => {
36
+ e.isConnected && t();
37
+ };
38
+ return document.fonts?.addEventListener?.("loadingdone", r), () => document.fonts?.removeEventListener?.("loadingdone", r);
39
+ }, [n, y]);
40
+ return u === 0 || Array.isArray(d) && d.length > 0 ? /* @__PURE__ */ s("g", {}) : /* @__PURE__ */ c("g", { children: [/* @__PURE__ */ s("rect", {
41
+ x: e + f / 2,
42
+ y: t + f / 2,
43
+ width: Math.max(0, n - f),
44
+ height: Math.max(0, r - f),
24
45
  style: {
25
- fill: h(u, _, v),
46
+ fill: h(l, _, v),
26
47
  stroke: "none"
27
48
  }
28
- }), n > 30 && r > 20 && /* @__PURE__ */ c("text", {
29
- ref: x,
49
+ }), n > 30 && r > 20 && /* @__PURE__ */ s("text", {
50
+ ref: b,
30
51
  x: e + n / 2,
31
52
  y: t + r / 2,
32
53
  textAnchor: "middle",
@@ -38,12 +59,11 @@ var p = 2, m = 8, h = (e, t, n) => {
38
59
  stroke: "none",
39
60
  strokeWidth: 0,
40
61
  pointerEvents: "none",
41
- userSelect: "none",
42
- visibility: y ? void 0 : "hidden"
62
+ userSelect: "none"
43
63
  },
44
- children: o
64
+ children: y
45
65
  })] });
46
- }, v = ({ data: r, dataKey: i, aspectRatio: a = 4 / 3, height: s = 300, width: p = "100%", title: m }) => {
66
+ }, v = ({ data: r, dataKey: i, aspectRatio: a = 4 / 3, height: f = 300, width: p = "100%", title: m }) => {
47
67
  let h = o(() => {
48
68
  let e = (t) => t.flatMap((t) => Array.isArray(t.children) ? e(t.children) : [t]), t = e(r ?? []).map((e) => Number(e[i]) || 0);
49
69
  return t.length ? {
@@ -54,34 +74,34 @@ var p = 2, m = 8, h = (e, t, n) => {
54
74
  max: 1
55
75
  };
56
76
  }, [r, i]);
57
- return !r || r.length === 0 ? null : /* @__PURE__ */ c(g.Provider, {
77
+ return !r || r.length === 0 ? null : /* @__PURE__ */ s(g.Provider, {
58
78
  value: h,
59
- children: /* @__PURE__ */ l("div", {
79
+ children: /* @__PURE__ */ c("div", {
60
80
  className: `wim-treemap ${n.root} wim-treemap__root`,
61
81
  style: { width: p },
62
- children: [m && /* @__PURE__ */ c(e, {
82
+ children: [m && /* @__PURE__ */ s(e, {
63
83
  tag: "h3",
64
84
  size: "md",
65
85
  style: { marginBottom: "var(--wim-spacing-md)" },
66
86
  children: m
67
- }), /* @__PURE__ */ c("div", {
87
+ }), /* @__PURE__ */ s("div", {
68
88
  className: `${n.container} wim-treemap__container`,
69
89
  style: {
70
- height: s,
90
+ height: f,
71
91
  minWidth: 0,
72
92
  minHeight: 0
73
93
  },
74
- children: /* @__PURE__ */ c(u, {
94
+ children: /* @__PURE__ */ s(l, {
75
95
  width: "100%",
76
96
  height: "100%",
77
- children: /* @__PURE__ */ c(f, {
97
+ children: /* @__PURE__ */ s(d, {
78
98
  data: r,
79
99
  dataKey: i,
80
100
  aspectRatio: a,
81
101
  stroke: "none",
82
102
  content: _,
83
103
  isAnimationActive: !1,
84
- children: /* @__PURE__ */ c(d, {
104
+ children: /* @__PURE__ */ s(u, {
85
105
  contentStyle: t.tooltip.contentStyle,
86
106
  formatter: (e, t) => [e, t]
87
107
  })
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var e=`_root_bt6fn_3`,t=`_sm_bt6fn_12`,n=`_md_bt6fn_16`,r=`_lg_bt6fn_20`,i=`_disabled_bt6fn_24`,a=`_star_bt6fn_27`,o=`_foreground_bt6fn_30`,s=`_full_bt6fn_50`,c=`_half_bt6fn_53`,l=`_background_bt6fn_56`,u=`_icon_bt6fn_59`,d={root:e,sm:t,md:n,lg:r,disabled:i,star:a,foreground:o,full:s,half:c,background:l,icon:u};exports.background=l,exports.default=d,exports.disabled=i,exports.foreground=o,exports.full=s,exports.half=c,exports.icon=u,exports.lg=r,exports.md=n,exports.root=e,exports.sm=t,exports.star=a;
2
+ var e=`_root_1acjf_3`,t=`_sm_1acjf_17`,n=`_md_1acjf_21`,r=`_lg_1acjf_25`,i=`_disabled_1acjf_29`,a=`_star_1acjf_32`,o=`_foreground_1acjf_35`,s=`_full_1acjf_55`,c=`_half_1acjf_58`,l=`_background_1acjf_61`,u=`_icon_1acjf_64`,d={root:e,sm:t,md:n,lg:r,disabled:i,star:a,foreground:o,full:s,half:c,background:l,icon:u};exports.background=l,exports.default=d,exports.disabled=i,exports.foreground=o,exports.full=s,exports.half=c,exports.icon=u,exports.lg=r,exports.md=n,exports.root=e,exports.sm=t,exports.star=a;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  //#region src/components/form/Rating/rating.module.scss
3
- var e = "_root_bt6fn_3", t = "_sm_bt6fn_12", n = "_md_bt6fn_16", r = "_lg_bt6fn_20", i = "_disabled_bt6fn_24", a = "_star_bt6fn_27", o = "_foreground_bt6fn_30", s = "_full_bt6fn_50", c = "_half_bt6fn_53", l = "_background_bt6fn_56", u = "_icon_bt6fn_59", d = {
3
+ var e = "_root_1acjf_3", t = "_sm_1acjf_17", n = "_md_1acjf_21", r = "_lg_1acjf_25", i = "_disabled_1acjf_29", a = "_star_1acjf_32", o = "_foreground_1acjf_35", s = "_full_1acjf_55", c = "_half_1acjf_58", l = "_background_1acjf_61", u = "_icon_1acjf_64", d = {
4
4
  root: e,
5
5
  sm: t,
6
6
  md: n,
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var e=`_root_1u1o9_295`,t=`_disabled_1u1o9_303`,n=`_canvasContainer_1u1o9_307`,r=`_danger_1u1o9_286`,i=`_canvas_1u1o9_307`,a=`_footer_1u1o9_331`,o={"wim-docs-container":`_wim-docs-container_1u1o9_87`,"wim-t":`_wim-t_1u1o9_250`,"react-flow":`_react-flow_1u1o9_273`,"react-flow__edges":`_react-flow__edges_1u1o9_274`,"react-flow__connectionline":`_react-flow__connectionline_1u1o9_275`,root:e,disabled:t,canvasContainer:n,danger:r,canvas:i,footer:a};exports.canvas=i,exports.canvasContainer=n,exports.danger=r,exports.default=o,exports.disabled=t,exports.footer=a,exports.root=e;
2
+ var e=`_root_1hhrf_295`,t=`_disabled_1hhrf_313`,n=`_canvasContainer_1hhrf_317`,r=`_danger_1hhrf_286`,i=`_canvas_1hhrf_317`,a=`_footer_1hhrf_341`,o={"wim-docs-container":`_wim-docs-container_1hhrf_87`,"wim-t":`_wim-t_1hhrf_250`,"react-flow":`_react-flow_1hhrf_273`,"react-flow__edges":`_react-flow__edges_1hhrf_274`,"react-flow__connectionline":`_react-flow__connectionline_1hhrf_275`,root:e,disabled:t,canvasContainer:n,danger:r,canvas:i,footer:a};exports.canvas=i,exports.canvasContainer=n,exports.danger=r,exports.default=o,exports.disabled=t,exports.footer=a,exports.root=e;
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  //#region src/components/form/SignaturePad/signature-pad.module.scss
3
- var e = "_root_1u1o9_295", t = "_disabled_1u1o9_303", n = "_canvasContainer_1u1o9_307", r = "_danger_1u1o9_286", i = "_canvas_1u1o9_307", a = "_footer_1u1o9_331", o = {
4
- "wim-docs-container": "_wim-docs-container_1u1o9_87",
5
- "wim-t": "_wim-t_1u1o9_250",
6
- "react-flow": "_react-flow_1u1o9_273",
7
- "react-flow__edges": "_react-flow__edges_1u1o9_274",
8
- "react-flow__connectionline": "_react-flow__connectionline_1u1o9_275",
3
+ var e = "_root_1hhrf_295", t = "_disabled_1hhrf_313", n = "_canvasContainer_1hhrf_317", r = "_danger_1hhrf_286", i = "_canvas_1hhrf_317", a = "_footer_1hhrf_341", o = {
4
+ "wim-docs-container": "_wim-docs-container_1hhrf_87",
5
+ "wim-t": "_wim-t_1hhrf_250",
6
+ "react-flow": "_react-flow_1hhrf_273",
7
+ "react-flow__edges": "_react-flow__edges_1hhrf_274",
8
+ "react-flow__connectionline": "_react-flow__connectionline_1hhrf_275",
9
9
  root: e,
10
10
  disabled: t,
11
11
  canvasContainer: n,
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## What this is
6
6
 
7
- **wimui** v0.21.0 — a React 19 component library: 218 documented components across 10 categories, with design tokens, dark mode, i18n (en/ja/pt-BR) and WAI-ARIA compliant a11y. Peer deps: react ^19, react-dom ^19 (plus optional peers for specific components — see package.json).
7
+ **wimui** v0.22.0 — a React 19 component library: 218 documented components across 10 categories, with design tokens, dark mode, i18n (en/ja/pt-BR) and WAI-ARIA compliant a11y. Peer deps: react ^19, react-dom ^19 (plus optional peers for specific components — see package.json).
8
8
 
9
9
  ## Install & required setup
10
10
 
package/dist/llms.txt CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## What this is
6
6
 
7
- **wimui** v0.21.0 — a React 19 component library: 218 documented components across 10 categories, with design tokens, dark mode, i18n (en/ja/pt-BR) and WAI-ARIA compliant a11y. Peer deps: react ^19, react-dom ^19 (plus optional peers for specific components — see package.json).
7
+ **wimui** v0.22.0 — a React 19 component library: 218 documented components across 10 categories, with design tokens, dark mode, i18n (en/ja/pt-BR) and WAI-ARIA compliant a11y. Peer deps: react ^19, react-dom ^19 (plus optional peers for specific components — see package.json).
8
8
 
9
9
  ## Install & required setup
10
10