wimui 0.23.11 → 0.23.12

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("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../../icon/chevron-left.cjs"),i=require("../../../icon/chevron-right.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("../../form/Button/Button.cjs"),s=require("../../form/Input/Input.cjs"),c=require("../../form/Select/Select.cjs"),l=require("./pagination.module.cjs");let u=require("react");u=e.__toESM(u,1);let d=require("classnames");d=e.__toESM(d,1);let f=require("react/jsx-runtime");var p=u.default.forwardRef(({asChild:e=!1,className:n,children:r,page:i,isActive:a,...o},s)=>(0,f.jsx)(e?t.Root:`button`,{ref:s,type:e?void 0:`button`,className:(0,d.default)(l.default.button,n),"aria-current":a?`page`:void 0,...o,children:e?(0,f.jsx)(t.Slottable,{children:r}):r}));p.displayName=`PaginationPage`;var m=`...`,h=({total:e,pageSize:h=10,current:g=1,onChange:_,onPageSizeChange:v,siblingCount:y=1,className:b,asChild:x=!1,children:S,renderPage:C,hideOnSinglePage:w=!1,simple:T=!1,showSizeChanger:E=!1,pageSizeOptions:ee=[10,20,50,100],showTotal:D,showQuickJumper:O=!1,labels:k={}})=>{let{t:A}=n.useWimTranslation(`common`),{prevPage:j=A(`a11y.go_to_prev_page`),nextPage:M=A(`a11y.go_to_next_page`),pageAriaLabel:N=e=>A(`a11y.go_to_page`,{page:String(e)}),itemsPerPage:P=A(`pagination.items_per_page`),goTo:F=A(`pagination.go_to`),go:I=A(`pagination.go`),pageSizeAriaLabel:L=A(`a11y.items_per_page`),jumpToPageAriaLabel:R=A(`a11y.jump_to_page`),navAriaLabel:z=A(`a11y.pagination_nav`)}=k,[B,V]=(0,u.useState)(h),[H,U]=(0,u.useState)(``),W=B,G=Math.ceil(e/W),K=(0,u.useMemo)(()=>{if(y+5>=G)return Array.from({length:G},(e,t)=>t+1);let e=Math.max(g-y,1),t=Math.min(g+y,G),n=e>2,r=t<G-2,i=G;if(!n&&r){let e=3+2*y;return[...Array.from({length:e},(e,t)=>t+1),m,G]}if(n&&!r){let e=3+2*y;return[1,m,...Array.from({length:e},(t,n)=>G-e+n+1)]}return n&&r?[1,m,...Array.from({length:t-e+1},(t,n)=>e+n),m,i]:[]},[G,y,g]);if(w&&G<=1)return null;let q=e=>{e<1||e>G||e===g||_?.(e,W)},J=e=>{V(e),v?.(e),_?.(1,e)},Y=()=>{let e=parseInt(H);!isNaN(e)&&e>=1&&e<=G&&(q(e),U(``))},X=e=>{e.key===`Enter`&&Y()},Z=(g-1)*W+1,Q=Math.min(g*W,e),$=x?t.Root:`nav`,te=e=>{let t={page:e,isActive:e===g,onClick:()=>q(e),"aria-label":N(e)};return C?C(e,t):(0,f.jsx)(p,{...t,children:e})};return T?(0,f.jsxs)($,{className:(0,d.default)(`wim-pagination`,l.default.root,l.default.simple,b),"aria-label":z,children:[(0,f.jsx)(t.Slottable,{children:S}),(0,f.jsxs)(`ul`,{className:l.default.root,children:[(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,g===1&&l.default.disabled),children:(0,f.jsx)(`button`,{className:l.default.button,onClick:()=>q(g-1),disabled:g===1,"aria-label":j,children:(0,f.jsx)(a.Icon,{component:r.default,size:`sm`})})}),(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,l.default.simplePager),children:(0,f.jsxs)(`span`,{children:[g,` / `,G]})}),(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,g===G&&l.default.disabled),children:(0,f.jsx)(`button`,{className:l.default.button,onClick:()=>q(g+1),disabled:g===G,"aria-label":M,children:(0,f.jsx)(a.Icon,{component:i.default,size:`sm`})})})]})]}):(0,f.jsx)(`div`,{className:l.default.container,children:(0,f.jsxs)(`div`,{className:(0,d.default)(l.default.wrapper,b),children:[D&&(0,f.jsx)(`div`,{className:l.default.total,children:D(e,[Z,Q])}),(0,f.jsxs)($,{className:l.default.root,"aria-label":z,children:[(0,f.jsx)(t.Slottable,{children:S}),(0,f.jsxs)(`ul`,{className:l.default.root,children:[(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,g===1&&l.default.disabled),children:(0,f.jsx)(`button`,{className:l.default.button,onClick:()=>q(g-1),disabled:g===1,"aria-label":j,children:(0,f.jsx)(a.Icon,{component:r.default,size:`sm`})})}),(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,l.default.mobileIndicator),children:(0,f.jsxs)(`span`,{children:[g,` / `,G]})}),K.map((e,t)=>e===m?(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,l.default.ellipsis),"aria-hidden":`true`,children:m},`ellipsis-${t}`):(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,l.default.number,e===g&&l.default.active),children:te(e)},e)),(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,g===G&&l.default.disabled),children:(0,f.jsx)(`button`,{className:l.default.button,onClick:()=>q(g+1),disabled:g===G,"aria-label":M,children:(0,f.jsx)(a.Icon,{component:i.default,size:`sm`})})})]})]}),E&&(0,f.jsx)(`div`,{className:l.default.sizeChanger,children:(0,f.jsx)(c.Select,{value:String(W),onChange:e=>J(Number(e)),options:ee.map(e=>({label:`${e} ${P}`,value:String(e)})),width:`auto`,"aria-label":L})}),O&&(0,f.jsxs)(`div`,{className:l.default.quickJumper,children:[(0,f.jsx)(`span`,{children:F}),(0,f.jsx)(s.Input,{type:`number`,min:1,max:G,value:H,onChange:e=>U(e.target.value),onKeyDown:X,width:`60px`,"aria-label":R}),(0,f.jsx)(o.Button,{size:`sm`,variant:`outline`,onClick:Y,disabled:!H,children:I})]})]})})};exports.Pagination=h,exports.default=h,exports.PaginationPage=p;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../../icon/chevron-left.cjs"),i=require("../../../icon/chevron-right.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("../../form/Button/Button.cjs"),s=require("../../form/Input/Input.cjs"),c=require("../../form/Select/Select.cjs"),l=require("./pagination.module.cjs");let u=require("react");u=e.__toESM(u,1);let d=require("classnames");d=e.__toESM(d,1);let f=require("react/jsx-runtime");var p=u.default.forwardRef(({asChild:e=!1,className:n,children:r,page:i,isActive:a,...o},s)=>(0,f.jsx)(e?t.Root:`button`,{ref:s,type:e?void 0:`button`,className:(0,d.default)(l.default.button,n),"aria-current":a?`page`:void 0,...o,children:e?(0,f.jsx)(t.Slottable,{children:r}):r}));p.displayName=`PaginationPage`;var m=`...`,h=({total:e,pageSize:h=10,current:g=1,onChange:_,onPageSizeChange:v,siblingCount:y=1,className:b,asChild:x=!1,children:S,renderPage:C,hideOnSinglePage:w=!1,simple:T=!1,showSizeChanger:E=!1,pageSizeOptions:ee=[10,20,50,100],showTotal:D,showQuickJumper:O=!1,labels:k={}})=>{let{t:A}=n.useWimTranslation(`common`),{prevPage:j=A(`a11y.go_to_prev_page`),nextPage:M=A(`a11y.go_to_next_page`),pageAriaLabel:N=e=>A(`a11y.go_to_page`,{page:String(e)}),itemsPerPage:P=A(`pagination.items_per_page`),goTo:F=A(`pagination.go_to`),go:I=A(`pagination.go`),pageSizeAriaLabel:L=A(`a11y.items_per_page`),jumpToPageAriaLabel:R=A(`a11y.jump_to_page`),navAriaLabel:z=A(`a11y.pagination_nav`)}=k,[B,V]=(0,u.useState)(h),[H,U]=(0,u.useState)(``),W=B,G=Math.ceil(e/W),K=(0,u.useMemo)(()=>{if(y+5>=G)return Array.from({length:G},(e,t)=>t+1);let e=Math.max(g-y,1),t=Math.min(g+y,G),n=e>2,r=t<G-2,i=G;if(!n&&r){let e=3+2*y;return[...Array.from({length:e},(e,t)=>t+1),m,G]}if(n&&!r){let e=3+2*y;return[1,m,...Array.from({length:e},(t,n)=>G-e+n+1)]}return n&&r?[1,m,...Array.from({length:t-e+1},(t,n)=>e+n),m,i]:[]},[G,y,g]);if(w&&G<=1)return null;let q=e=>{e<1||e>G||e===g||_?.(e,W)},J=e=>{V(e),v?.(e),_?.(1,e)},Y=()=>{let e=parseInt(H);!isNaN(e)&&e>=1&&e<=G&&(q(e),U(``))},X=e=>{e.key===`Enter`&&Y()},Z=(g-1)*W+1,Q=Math.min(g*W,e),$=x?t.Root:`nav`,te=e=>{let t={page:e,isActive:e===g,onClick:()=>q(e),"aria-label":N(e)};return C?C(e,t):(0,f.jsx)(p,{...t,children:e})};return T?(0,f.jsxs)($,{className:(0,d.default)(`wim-pagination`,l.default.root,l.default.simple,b),"aria-label":z,children:[(0,f.jsx)(t.Slottable,{children:S}),(0,f.jsxs)(`ul`,{className:l.default.root,children:[(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,g===1&&l.default.disabled),children:(0,f.jsx)(`button`,{className:l.default.button,onClick:()=>q(g-1),disabled:g===1,"aria-label":j,children:(0,f.jsx)(a.Icon,{component:r.default,size:`sm`})})}),(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,l.default.simplePager),children:(0,f.jsxs)(`span`,{children:[g,` / `,G]})}),(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,g===G&&l.default.disabled),children:(0,f.jsx)(`button`,{className:l.default.button,onClick:()=>q(g+1),disabled:g===G,"aria-label":M,children:(0,f.jsx)(a.Icon,{component:i.default,size:`sm`})})})]})]}):(0,f.jsx)(`div`,{className:(0,d.default)(`wim-pagination`,l.default.container,b),children:(0,f.jsxs)(`div`,{className:l.default.wrapper,children:[D&&(0,f.jsx)(`div`,{className:l.default.total,children:D(e,[Z,Q])}),(0,f.jsxs)($,{className:l.default.root,"aria-label":z,children:[(0,f.jsx)(t.Slottable,{children:S}),(0,f.jsxs)(`ul`,{className:l.default.root,children:[(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,g===1&&l.default.disabled),children:(0,f.jsx)(`button`,{className:l.default.button,onClick:()=>q(g-1),disabled:g===1,"aria-label":j,children:(0,f.jsx)(a.Icon,{component:r.default,size:`sm`})})}),(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,l.default.mobileIndicator),children:(0,f.jsxs)(`span`,{children:[g,` / `,G]})}),K.map((e,t)=>e===m?(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,l.default.ellipsis),"aria-hidden":`true`,children:m},`ellipsis-${t}`):(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,l.default.number,e===g&&l.default.active),children:te(e)},e)),(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,g===G&&l.default.disabled),children:(0,f.jsx)(`button`,{className:l.default.button,onClick:()=>q(g+1),disabled:g===G,"aria-label":M,children:(0,f.jsx)(a.Icon,{component:i.default,size:`sm`})})})]})]}),E&&(0,f.jsx)(`div`,{className:l.default.sizeChanger,children:(0,f.jsx)(c.Select,{value:String(W),onChange:e=>J(Number(e)),options:ee.map(e=>({label:`${e} ${P}`,value:String(e)})),width:`auto`,"aria-label":L})}),O&&(0,f.jsxs)(`div`,{className:l.default.quickJumper,children:[(0,f.jsx)(`span`,{children:F}),(0,f.jsx)(s.Input,{type:`number`,min:1,max:G,value:H,onChange:e=>U(e.target.value),onKeyDown:X,width:`60px`,"aria-label":R}),(0,f.jsx)(o.Button,{size:`sm`,variant:`outline`,onClick:Y,disabled:!H,children:I})]})]})})};exports.Pagination=h,exports.default=h,exports.PaginationPage=p;
@@ -123,9 +123,9 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
123
123
  ]
124
124
  })]
125
125
  }) : /* @__PURE__ */ m("div", {
126
- className: l.container,
126
+ className: p("wim-pagination", l.container, C),
127
127
  children: /* @__PURE__ */ h("div", {
128
- className: p(l.wrapper, C),
128
+ className: l.wrapper,
129
129
  children: [
130
130
  A && /* @__PURE__ */ m("div", {
131
131
  className: l.total,
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var e=`_container_ouufn_4`,t=`_wrapper_ouufn_14`,n=`_root_ouufn_20`,r=`_simple_ouufn_28`,i=`_simplePager_ouufn_28`,a=`_mobileIndicator_ouufn_32`,o=`_item_ouufn_46`,s=`_disabled_ouufn_66`,c=`_active_ouufn_66`,l=`_ellipsis_ouufn_88`,u=`_number_ouufn_96`,d=`_button_ouufn_100`,f=`_total_ouufn_124`,p=`_sizeChanger_ouufn_128`,m=`_quickJumper_ouufn_134`,h={container:e,wrapper:t,root:n,simple:r,simplePager:i,mobileIndicator:a,item:o,disabled:s,active:c,ellipsis:l,number:u,button:d,total:f,sizeChanger:p,quickJumper:m};exports.active=c,exports.button=d,exports.container=e,exports.default=h,exports.disabled=s,exports.ellipsis=l,exports.item=o,exports.mobileIndicator=a,exports.number=u,exports.quickJumper=m,exports.root=n,exports.simple=r,exports.simplePager=i,exports.sizeChanger=p,exports.total=f,exports.wrapper=t;
2
+ var e=`_container_14340_4`,t=`_wrapper_14340_14`,n=`_root_14340_20`,r=`_simple_14340_28`,i=`_simplePager_14340_28`,a=`_item_14340_32`,o=`_disabled_14340_52`,s=`_active_14340_52`,c=`_ellipsis_14340_74`,l=`_mobileIndicator_14340_83`,u=`_number_14340_84`,d=`_button_14340_105`,f=`_total_14340_129`,p=`_sizeChanger_14340_133`,m=`_quickJumper_14340_139`,h={container:e,wrapper:t,root:n,simple:r,simplePager:i,item:a,disabled:o,active:s,ellipsis:c,mobileIndicator:l,number:u,button:d,total:f,sizeChanger:p,quickJumper:m};exports.active=s,exports.button=d,exports.container=e,exports.default=h,exports.disabled=o,exports.ellipsis=c,exports.item=a,exports.mobileIndicator=l,exports.number=u,exports.quickJumper=m,exports.root=n,exports.simple=r,exports.simplePager=i,exports.sizeChanger=p,exports.total=f,exports.wrapper=t;
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  //#region src/components/navigation/Pagination/pagination.module.scss
3
- var e = "_container_ouufn_4", t = "_wrapper_ouufn_14", n = "_root_ouufn_20", r = "_simple_ouufn_28", i = "_simplePager_ouufn_28", a = "_mobileIndicator_ouufn_32", o = "_item_ouufn_46", s = "_disabled_ouufn_66", c = "_active_ouufn_66", l = "_ellipsis_ouufn_88", u = "_number_ouufn_96", d = "_button_ouufn_100", f = "_total_ouufn_124", p = "_sizeChanger_ouufn_128", m = "_quickJumper_ouufn_134", h = {
3
+ var e = "_container_14340_4", t = "_wrapper_14340_14", n = "_root_14340_20", r = "_simple_14340_28", i = "_simplePager_14340_28", a = "_item_14340_32", o = "_disabled_14340_52", s = "_active_14340_52", c = "_ellipsis_14340_74", l = "_mobileIndicator_14340_83", u = "_number_14340_84", d = "_button_14340_105", f = "_total_14340_129", p = "_sizeChanger_14340_133", m = "_quickJumper_14340_139", h = {
4
4
  container: e,
5
5
  wrapper: t,
6
6
  root: n,
7
7
  simple: r,
8
8
  simplePager: i,
9
- mobileIndicator: a,
10
- item: o,
11
- disabled: s,
12
- active: c,
13
- ellipsis: l,
9
+ item: a,
10
+ disabled: o,
11
+ active: s,
12
+ ellipsis: c,
13
+ mobileIndicator: l,
14
14
  number: u,
15
15
  button: d,
16
16
  total: f,
@@ -18,4 +18,4 @@ var e = "_container_ouufn_4", t = "_wrapper_ouufn_14", n = "_root_ouufn_20", r =
18
18
  quickJumper: m
19
19
  };
20
20
  //#endregion
21
- export { c as active, d as button, e as container, h as default, s as disabled, l as ellipsis, o as item, a as mobileIndicator, u as number, m as quickJumper, n as root, r as simple, i as simplePager, p as sizeChanger, f as total, t as wrapper };
21
+ export { s as active, d as button, e as container, h as default, o as disabled, c as ellipsis, a as item, l as mobileIndicator, u as number, m as quickJumper, n as root, r as simple, i as simplePager, p as sizeChanger, f as total, t as wrapper };
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## What this is
6
6
 
7
- **wimui** v0.23.11 — 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.23.12 — 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.23.11 — 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.23.12 — 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