@digitalpromise/design 4.5.0 → 4.5.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
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":"AAIA,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,KAAK,EACL,YAAqB,GACtB,EAAE,eAAe,2CAoHjB"}
1
+ {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":"AAKA,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,KAAK,EACL,YAAqB,GACtB,EAAE,eAAe,2CA+GjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/components/search.tsx"],"names":[],"mappings":"AAMA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,WAAW,EACX,SAAS,EACT,UAAU,EACV,KAAK,EACL,QAAQ,EACR,SAAgB,EAChB,EAAa,EACb,QAAc,GACf,EAAE,WAAW,2CA+Fb"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/components/search.tsx"],"names":[],"mappings":"AAMA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,WAAW,EACX,SAAS,EACT,UAAU,EACV,KAAK,EACL,QAAQ,EACR,SAAgB,EAChB,EAAa,EACb,QAAc,GACf,EAAE,WAAW,2CA4Fb"}
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./icon-DjGt_3uE.cjs"),e=require("react/jsx-runtime"),m=require("next/navigation"),S=require("react"),k=new Map([["black","/primary-badge-engine-logo-black.svg"],["white","/primary-badge-engine-logo-white.svg"],["color","/primary-badge-engine-logo-color.svg"]]);function C({variant:c="color",className:b}){const r=k.get(c);return r===void 0?null:e.jsx("img",{src:r,width:186,height:36,alt:"Badge Engine",className:b})}function R({count:c,limit:b,pageParamKey:r="page"}){const s=m.useSearchParams(),x=m.usePathname(),o=m.useRouter(),v=s.get(r),d=v?Number.parseInt(v,10):Number.NaN,t=Number.isFinite(d)?d:1,n=Math.max(1,Math.ceil(c/b)),w=n<=7?Array.from({length:n},(a,i)=>i+1):t<=4?[1,2,3,4,5,"ellipsis",n]:t>=n-3?[1,"ellipsis",n-4,n-3,n-2,n-1,n]:[1,"ellipsis",t-1,t,t+1,"ellipsis",n],y=t===1,u=t===n,N=a=>{if(y&&a==="prev"||u&&a==="next")return;const i=a==="prev"?t-1:t+1,g=new URLSearchParams(s.toString());g.set(r,String(i)),o.push(`${x}?${g.toString()}`,{scroll:!1})},j=a=>{const i=new URLSearchParams(s.toString());i.set(r,String(a)),o.push(`${x}?${i.toString()}`,{scroll:!1})};return e.jsxs("ul",{className:"flex items-center justify-center gap-4 font-medium",children:[e.jsx("li",{className:"mr-2",children:e.jsx("button",{type:"button","aria-label":"Previous page",disabled:y,className:"inline-flex h-[42px] w-[42px] items-center justify-center rounded-[4px] bg-transparent p-[9px] text-gray-5 transition hover:bg-transparent hover:text-neutral-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-4 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>N("prev"),children:e.jsx("span",{"aria-hidden":!0,className:"font-icon dpg-icons-arrow-line-left inline-block h-[24px] w-[24px] text-[24px] leading-[24px]"})})}),w.map((a,i)=>{const g=a==="ellipsis",h=g?void 0:a,f=h===t,p=g||f,l=g?"Pagination ellipsis":`Go to page ${h}`;return e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":l,"aria-current":f?"page":void 0,disabled:p,className:`flex h-[36px] w-[36px] items-center justify-center rounded-[4px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-4 ${f?"bg-blue-1 text-blue-4":""} ${p?"cursor-default":"cursor-pointer hover:bg-gray-1"}`.trim(),onClick:!p&&h?()=>j(h):void 0,children:g?"...":h})},`${a}-${i}`)}),e.jsx("li",{className:"ml-2",children:e.jsx("button",{type:"button","aria-label":"Next page",disabled:u,className:"inline-flex h-[42px] w-[42px] items-center justify-center rounded-[4px] bg-transparent p-[9px] text-gray-5 transition hover:bg-transparent hover:text-neutral-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-4 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>N("next"),children:e.jsx("span",{"aria-hidden":!0,className:"font-icon dpg-icons-arrow-line-right inline-block h-[24px] w-[24px] text-[24px] leading-[24px]"})})})]})}function L({placeholder:c,className:b,inputWidth:r,value:s,onChange:x,syncToUrl:o=!0,id:v="search",paramKey:d="s"}){const t=m.useSearchParams(),n=m.usePathname(),w=m.useRouter(),y=S.useRef(null),u=s!==void 0,[N,j]=S.useState(u?s:t.get(d)?.toString()??""),a=u?s:N,i=Math.max(c.length,1),g=`calc(${i}ch + 60px)`,h=r===void 0?g:typeof r=="number"?`${r}px`:r;S.useEffect(()=>{!o||u||j(t.get(d)?.toString()??"")},[u,d,t,o]);const f=p=>{if(!o)return;const l=new URLSearchParams(t.toString());p?(l.set(d,p),l.delete("page")):(l.delete(d),l.delete("page"));const P=l.toString();w.replace(P?`${n}?${P}`:n)};return e.jsxs("form",{className:b??"",noValidate:!0,children:[e.jsx("label",{className:"sr-only",htmlFor:v,children:"Search"}),e.jsxs("div",{className:"relative max-w-full",style:{width:h},children:[e.jsx($.Icon,{name:"Magnifier","aria-hidden":!0,className:"absolute left-[15px] top-1/2 z-10 -translate-y-1/2 text-large leading-5 text-gray-5"}),e.jsx("input",{ref:y,className:"hide-search-clear block w-full max-w-full rounded-sm bg-white py-[11px] pl-[15px] pr-[40px] text-base leading-6 indent-[30px] outline-1 outline-gray-5 transition focus:outline-2 focus:outline-blue-4",style:{color:"#000000",WebkitTextFillColor:"#000000"},size:i,id:v,type:"search",autoComplete:"off",value:a,placeholder:c,onChange:p=>{const l=p.target.value;u||j(l),x?.(l),f(l)}}),a.length>0&&e.jsx("button",{type:"button","aria-label":"Clear search",className:"absolute right-1 top-1/2 z-10 inline-flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-lg p-2 text-gray-5 hover:text-neutral-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-4",onClick:()=>{u||j(""),x?.(""),f(""),y.current?.focus()},children:e.jsx("span",{"aria-hidden":!0,className:"font-icon dpg-icons-close inline-block h-4 w-4 text-[16px] leading-4 text-gray-5"})})]})]})}function M({columns:c,rows:b,rowKey:r}){return e.jsxs("table",{className:"w-full table-auto border-y border-gray-2 text-gray-5",children:[e.jsx("thead",{className:"font-bold",children:e.jsx("tr",{children:c.map(s=>e.jsx("td",{className:`px-3 py-4 ${s.headerClassName??""}`.trim(),children:s.header},s.key))})}),e.jsx("tbody",{children:b.map((s,x)=>e.jsx("tr",{className:"border-t border-gray-2",children:c.map(o=>e.jsx("td",{className:`${o.cellClassName??"px-3 py-4"}`.trim(),children:o.render(s)},o.key))},r(s,x)))})]})}exports.Button=$.Button;exports.Logo=C;exports.Pagination=R;exports.Search=L;exports.Table=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./icon-DjGt_3uE.cjs"),e=require("react/jsx-runtime"),m=require("next/navigation"),w=require("react"),C=new Map([["black","/primary-badge-engine-logo-black.svg"],["white","/primary-badge-engine-logo-white.svg"],["color","/primary-badge-engine-logo-color.svg"]]);function k({variant:c="color",className:b}){const r=C.get(c);return r===void 0?null:e.jsx("img",{src:r,width:186,height:36,alt:"Badge Engine",className:b})}function L({count:c,limit:b,pageParamKey:r="page"}){const s=m.useSearchParams(),h=m.usePathname(),o=m.useRouter(),v=s.get(r),d=v?Number.parseInt(v,10):Number.NaN,t=Number.isFinite(d)?d:1,n=Math.max(1,Math.ceil(c/b)),P=n<=7?Array.from({length:n},(a,i)=>i+1):t<=4?[1,2,3,4,5,"ellipsis",n]:t>=n-3?[1,"ellipsis",n-4,n-3,n-2,n-1,n]:[1,"ellipsis",t-1,t,t+1,"ellipsis",n],y=t===1,u=t===n,S=a=>{if(y&&a==="prev"||u&&a==="next")return;const i=a==="prev"?t-1:t+1,g=new URLSearchParams(s.toString());g.set(r,String(i)),o.push(`${h}?${g.toString()}`,{scroll:!1})},j=a=>{const i=new URLSearchParams(s.toString());i.set(r,String(a)),o.push(`${h}?${i.toString()}`,{scroll:!1})};return e.jsxs("ul",{className:"flex items-center justify-center gap-4 font-medium",children:[e.jsx("li",{className:"mr-2",children:e.jsx("button",{type:"button","aria-label":"Previous page",disabled:y,className:"inline-flex h-[42px] w-[42px] items-center justify-center rounded-[4px] bg-transparent p-[9px] text-gray-5 transition hover:bg-transparent hover:text-neutral-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-4 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>S("prev"),children:e.jsx(N.Icon,{name:"ArrowLineLeft"})})}),P.map((a,i)=>{const g=a==="ellipsis",x=g?void 0:a,f=x===t,p=g||f,l=g?"Pagination ellipsis":`Go to page ${x}`;return e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":l,"aria-current":f?"page":void 0,disabled:p,className:`flex h-[36px] w-[36px] items-center justify-center rounded-[4px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-4 ${f?"bg-blue-1 text-blue-4":""} ${p?"cursor-default":"cursor-pointer hover:bg-gray-1"}`.trim(),onClick:!p&&x?()=>j(x):void 0,children:g?"...":x})},`${a}-${i}`)}),e.jsx("li",{className:"ml-2",children:e.jsx("button",{type:"button","aria-label":"Next page",disabled:u,className:"inline-flex h-[42px] w-[42px] items-center justify-center rounded-[4px] bg-transparent p-[9px] text-gray-5 transition hover:bg-transparent hover:text-neutral-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-4 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>S("next"),children:e.jsx(N.Icon,{name:"ArrowLineRight"})})})]})}function R({placeholder:c,className:b,inputWidth:r,value:s,onChange:h,syncToUrl:o=!0,id:v="search",paramKey:d="s"}){const t=m.useSearchParams(),n=m.usePathname(),P=m.useRouter(),y=w.useRef(null),u=s!==void 0,[S,j]=w.useState(u?s:t.get(d)?.toString()??""),a=u?s:S,i=Math.max(c.length,1),g=`calc(${i}ch + 60px)`,x=r===void 0?g:typeof r=="number"?`${r}px`:r;w.useEffect(()=>{!o||u||j(t.get(d)?.toString()??"")},[u,d,t,o]);const f=p=>{if(!o)return;const l=new URLSearchParams(t.toString());p?(l.set(d,p),l.delete("page")):(l.delete(d),l.delete("page"));const $=l.toString();P.replace($?`${n}?${$}`:n)};return e.jsxs("form",{className:b??"",noValidate:!0,children:[e.jsx("label",{className:"sr-only",htmlFor:v,children:"Search"}),e.jsxs("div",{className:"relative max-w-full",style:{width:x},children:[e.jsx(N.Icon,{name:"Magnifier","aria-hidden":!0,className:"absolute left-[15px] top-1/2 z-10 -translate-y-1/2 text-large leading-5 text-gray-5"}),e.jsx("input",{ref:y,className:"hide-search-clear block w-full max-w-full rounded-sm bg-white py-[11px] pl-[15px] pr-[40px] text-base leading-6 indent-[30px] outline-1 outline-gray-5 transition focus:outline-2 focus:outline-blue-4",style:{color:"#000000",WebkitTextFillColor:"#000000"},size:i,id:v,type:"search",autoComplete:"off",value:a,placeholder:c,onChange:p=>{const l=p.target.value;u||j(l),h?.(l),f(l)}}),a.length>0&&e.jsx("button",{type:"button","aria-label":"Clear search",className:"absolute right-1 top-1/2 z-10 inline-flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-lg p-2 text-gray-5 hover:text-neutral-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-4",onClick:()=>{u||j(""),h?.(""),f(""),y.current?.focus()},children:e.jsx(N.Icon,{name:"Close"})})]})]})}function I({columns:c,rows:b,rowKey:r}){return e.jsxs("table",{className:"w-full table-auto border-y border-gray-2 text-gray-5",children:[e.jsx("thead",{className:"font-bold",children:e.jsx("tr",{children:c.map(s=>e.jsx("td",{className:`px-3 py-4 ${s.headerClassName??""}`.trim(),children:s.header},s.key))})}),e.jsx("tbody",{children:b.map((s,h)=>e.jsx("tr",{className:"border-t border-gray-2",children:c.map(o=>e.jsx("td",{className:`${o.cellClassName??"px-3 py-4"}`.trim(),children:o.render(s)},o.key))},r(s,h)))})]})}exports.Button=N.Button;exports.Logo=k;exports.Pagination=L;exports.Search=R;exports.Table=I;
package/dist/index.js CHANGED
@@ -1,22 +1,22 @@
1
- import { I as j } from "./icon-BR2zaZo5.js";
1
+ import { I as w } from "./icon-BR2zaZo5.js";
2
2
  import { B as T } from "./icon-BR2zaZo5.js";
3
- import { jsx as e, jsxs as w } from "react/jsx-runtime";
4
- import { useSearchParams as $, usePathname as k, useRouter as C } from "next/navigation";
5
- import { useRef as L, useState as R, useEffect as M } from "react";
3
+ import { jsx as e, jsxs as S } from "react/jsx-runtime";
4
+ import { useSearchParams as C, usePathname as k, useRouter as L } from "next/navigation";
5
+ import { useRef as j, useState as R, useEffect as M } from "react";
6
6
  const z = /* @__PURE__ */ new Map([
7
7
  ["black", "/primary-badge-engine-logo-black.svg"],
8
8
  ["white", "/primary-badge-engine-logo-white.svg"],
9
9
  ["color", "/primary-badge-engine-logo-color.svg"]
10
10
  ]);
11
- function V({
11
+ function E({
12
12
  variant: c = "color",
13
13
  className: b
14
14
  }) {
15
- const i = z.get(c);
16
- return i === void 0 ? null : /* @__PURE__ */ e(
15
+ const s = z.get(c);
16
+ return s === void 0 ? null : /* @__PURE__ */ e(
17
17
  "img",
18
18
  {
19
- src: i,
19
+ src: s,
20
20
  width: 186,
21
21
  height: 36,
22
22
  alt: "Badge Engine",
@@ -24,29 +24,29 @@ function V({
24
24
  }
25
25
  );
26
26
  }
27
- function q({
27
+ function V({
28
28
  count: c,
29
29
  limit: b,
30
- pageParamKey: i = "page"
30
+ pageParamKey: s = "page"
31
31
  }) {
32
- const n = $(), f = k(), o = C(), x = n.get(i), d = x ? Number.parseInt(x, 10) : Number.NaN, t = Number.isFinite(d) ? d : 1, r = Math.max(1, Math.ceil(c / b)), S = r <= 7 ? Array.from({ length: r }, (a, s) => s + 1) : t <= 4 ? [1, 2, 3, 4, 5, "ellipsis", r] : t >= r - 3 ? [1, "ellipsis", r - 4, r - 3, r - 2, r - 1, r] : [
32
+ const r = C(), f = k(), o = L(), x = r.get(s), d = x ? Number.parseInt(x, 10) : Number.NaN, t = Number.isFinite(d) ? d : 1, n = Math.max(1, Math.ceil(c / b)), P = n <= 7 ? Array.from({ length: n }, (a, i) => i + 1) : t <= 4 ? [1, 2, 3, 4, 5, "ellipsis", n] : t >= n - 3 ? [1, "ellipsis", n - 4, n - 3, n - 2, n - 1, n] : [
33
33
  1,
34
34
  "ellipsis",
35
35
  t - 1,
36
36
  t,
37
37
  t + 1,
38
38
  "ellipsis",
39
- r
40
- ], v = t === 1, u = t === r, N = (a) => {
39
+ n
40
+ ], v = t === 1, u = t === n, N = (a) => {
41
41
  if (v && a === "prev" || u && a === "next")
42
42
  return;
43
- const s = a === "prev" ? t - 1 : t + 1, p = new URLSearchParams(n.toString());
44
- p.set(i, String(s)), o.push(`${f}?${p.toString()}`, { scroll: !1 });
43
+ const i = a === "prev" ? t - 1 : t + 1, g = new URLSearchParams(r.toString());
44
+ g.set(s, String(i)), o.push(`${f}?${g.toString()}`, { scroll: !1 });
45
45
  }, y = (a) => {
46
- const s = new URLSearchParams(n.toString());
47
- s.set(i, String(a)), o.push(`${f}?${s.toString()}`, { scroll: !1 });
46
+ const i = new URLSearchParams(r.toString());
47
+ i.set(s, String(a)), o.push(`${f}?${i.toString()}`, { scroll: !1 });
48
48
  };
49
- return /* @__PURE__ */ w("ul", { className: "flex items-center justify-center gap-4 font-medium", children: [
49
+ return /* @__PURE__ */ S("ul", { className: "flex items-center justify-center gap-4 font-medium", children: [
50
50
  /* @__PURE__ */ e("li", { className: "mr-2", children: /* @__PURE__ */ e(
51
51
  "button",
52
52
  {
@@ -55,29 +55,23 @@ function q({
55
55
  disabled: v,
56
56
  className: "inline-flex h-[42px] w-[42px] items-center justify-center rounded-[4px] bg-transparent p-[9px] text-gray-5 transition hover:bg-transparent hover:text-neutral-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-4 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
57
57
  onClick: () => N("prev"),
58
- children: /* @__PURE__ */ e(
59
- "span",
60
- {
61
- "aria-hidden": !0,
62
- className: "font-icon dpg-icons-arrow-line-left inline-block h-[24px] w-[24px] text-[24px] leading-[24px]"
63
- }
64
- )
58
+ children: /* @__PURE__ */ e(w, { name: "ArrowLineLeft" })
65
59
  }
66
60
  ) }),
67
- S.map((a, s) => {
68
- const p = a === "ellipsis", h = p ? void 0 : a, m = h === t, g = p || m, l = p ? "Pagination ellipsis" : `Go to page ${h}`;
61
+ P.map((a, i) => {
62
+ const g = a === "ellipsis", h = g ? void 0 : a, m = h === t, p = g || m, l = g ? "Pagination ellipsis" : `Go to page ${h}`;
69
63
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
70
64
  "button",
71
65
  {
72
66
  type: "button",
73
67
  "aria-label": l,
74
68
  "aria-current": m ? "page" : void 0,
75
- disabled: g,
76
- className: `flex h-[36px] w-[36px] items-center justify-center rounded-[4px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-4 ${m ? "bg-blue-1 text-blue-4" : ""} ${g ? "cursor-default" : "cursor-pointer hover:bg-gray-1"}`.trim(),
77
- onClick: !g && h ? () => y(h) : void 0,
78
- children: p ? "..." : h
69
+ disabled: p,
70
+ className: `flex h-[36px] w-[36px] items-center justify-center rounded-[4px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-4 ${m ? "bg-blue-1 text-blue-4" : ""} ${p ? "cursor-default" : "cursor-pointer hover:bg-gray-1"}`.trim(),
71
+ onClick: !p && h ? () => y(h) : void 0,
72
+ children: g ? "..." : h
79
73
  }
80
- ) }, `${a}-${s}`);
74
+ ) }, `${a}-${i}`);
81
75
  }),
82
76
  /* @__PURE__ */ e("li", { className: "ml-2", children: /* @__PURE__ */ e(
83
77
  "button",
@@ -87,45 +81,39 @@ function q({
87
81
  disabled: u,
88
82
  className: "inline-flex h-[42px] w-[42px] items-center justify-center rounded-[4px] bg-transparent p-[9px] text-gray-5 transition hover:bg-transparent hover:text-neutral-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-4 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
89
83
  onClick: () => N("next"),
90
- children: /* @__PURE__ */ e(
91
- "span",
92
- {
93
- "aria-hidden": !0,
94
- className: "font-icon dpg-icons-arrow-line-right inline-block h-[24px] w-[24px] text-[24px] leading-[24px]"
95
- }
96
- )
84
+ children: /* @__PURE__ */ e(w, { name: "ArrowLineRight" })
97
85
  }
98
86
  ) })
99
87
  ] });
100
88
  }
101
- function A({
89
+ function q({
102
90
  placeholder: c,
103
91
  className: b,
104
- inputWidth: i,
105
- value: n,
92
+ inputWidth: s,
93
+ value: r,
106
94
  onChange: f,
107
95
  syncToUrl: o = !0,
108
96
  id: x = "search",
109
97
  paramKey: d = "s"
110
98
  }) {
111
- const t = $(), r = k(), S = C(), v = L(null), u = n !== void 0, [N, y] = R(
112
- u ? n : t.get(d)?.toString() ?? ""
113
- ), a = u ? n : N, s = Math.max(c.length, 1), p = `calc(${s}ch + 60px)`, h = i === void 0 ? p : typeof i == "number" ? `${i}px` : i;
99
+ const t = C(), n = k(), P = L(), v = j(null), u = r !== void 0, [N, y] = R(
100
+ u ? r : t.get(d)?.toString() ?? ""
101
+ ), a = u ? r : N, i = Math.max(c.length, 1), g = `calc(${i}ch + 60px)`, h = s === void 0 ? g : typeof s == "number" ? `${s}px` : s;
114
102
  M(() => {
115
103
  !o || u || y(t.get(d)?.toString() ?? "");
116
104
  }, [u, d, t, o]);
117
- const m = (g) => {
105
+ const m = (p) => {
118
106
  if (!o) return;
119
107
  const l = new URLSearchParams(t.toString());
120
- g ? (l.set(d, g), l.delete("page")) : (l.delete(d), l.delete("page"));
121
- const P = l.toString();
122
- S.replace(P ? `${r}?${P}` : r);
108
+ p ? (l.set(d, p), l.delete("page")) : (l.delete(d), l.delete("page"));
109
+ const $ = l.toString();
110
+ P.replace($ ? `${n}?${$}` : n);
123
111
  };
124
- return /* @__PURE__ */ w("form", { className: b ?? "", noValidate: !0, children: [
112
+ return /* @__PURE__ */ S("form", { className: b ?? "", noValidate: !0, children: [
125
113
  /* @__PURE__ */ e("label", { className: "sr-only", htmlFor: x, children: "Search" }),
126
- /* @__PURE__ */ w("div", { className: "relative max-w-full", style: { width: h }, children: [
114
+ /* @__PURE__ */ S("div", { className: "relative max-w-full", style: { width: h }, children: [
127
115
  /* @__PURE__ */ e(
128
- j,
116
+ w,
129
117
  {
130
118
  name: "Magnifier",
131
119
  "aria-hidden": !0,
@@ -141,14 +129,14 @@ function A({
141
129
  color: "#000000",
142
130
  WebkitTextFillColor: "#000000"
143
131
  },
144
- size: s,
132
+ size: i,
145
133
  id: x,
146
134
  type: "search",
147
135
  autoComplete: "off",
148
136
  value: a,
149
137
  placeholder: c,
150
- onChange: (g) => {
151
- const l = g.target.value;
138
+ onChange: (p) => {
139
+ const l = p.target.value;
152
140
  u || y(l), f?.(l), m(l);
153
141
  }
154
142
  }
@@ -162,42 +150,36 @@ function A({
162
150
  onClick: () => {
163
151
  u || y(""), f?.(""), m(""), v.current?.focus();
164
152
  },
165
- children: /* @__PURE__ */ e(
166
- "span",
167
- {
168
- "aria-hidden": !0,
169
- className: "font-icon dpg-icons-close inline-block h-4 w-4 text-[16px] leading-4 text-gray-5"
170
- }
171
- )
153
+ children: /* @__PURE__ */ e(w, { name: "Close" })
172
154
  }
173
155
  )
174
156
  ] })
175
157
  ] });
176
158
  }
177
- function D({ columns: c, rows: b, rowKey: i }) {
178
- return /* @__PURE__ */ w("table", { className: "w-full table-auto border-y border-gray-2 text-gray-5", children: [
179
- /* @__PURE__ */ e("thead", { className: "font-bold", children: /* @__PURE__ */ e("tr", { children: c.map((n) => /* @__PURE__ */ e(
159
+ function D({ columns: c, rows: b, rowKey: s }) {
160
+ return /* @__PURE__ */ S("table", { className: "w-full table-auto border-y border-gray-2 text-gray-5", children: [
161
+ /* @__PURE__ */ e("thead", { className: "font-bold", children: /* @__PURE__ */ e("tr", { children: c.map((r) => /* @__PURE__ */ e(
180
162
  "td",
181
163
  {
182
- className: `px-3 py-4 ${n.headerClassName ?? ""}`.trim(),
183
- children: n.header
164
+ className: `px-3 py-4 ${r.headerClassName ?? ""}`.trim(),
165
+ children: r.header
184
166
  },
185
- n.key
167
+ r.key
186
168
  )) }) }),
187
- /* @__PURE__ */ e("tbody", { children: b.map((n, f) => /* @__PURE__ */ e("tr", { className: "border-t border-gray-2", children: c.map((o) => /* @__PURE__ */ e(
169
+ /* @__PURE__ */ e("tbody", { children: b.map((r, f) => /* @__PURE__ */ e("tr", { className: "border-t border-gray-2", children: c.map((o) => /* @__PURE__ */ e(
188
170
  "td",
189
171
  {
190
172
  className: `${o.cellClassName ?? "px-3 py-4"}`.trim(),
191
- children: o.render(n)
173
+ children: o.render(r)
192
174
  },
193
175
  o.key
194
- )) }, i(n, f))) })
176
+ )) }, s(r, f))) })
195
177
  ] });
196
178
  }
197
179
  export {
198
180
  T as Button,
199
- V as Logo,
200
- q as Pagination,
201
- A as Search,
181
+ E as Logo,
182
+ V as Pagination,
183
+ q as Search,
202
184
  D as Table
203
185
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@digitalpromise/design",
3
3
  "private": false,
4
- "version": "4.5.0",
4
+ "version": "4.5.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "exports": {