@digitalpromise/design 4.10.0 → 4.12.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.
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/theme.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./icon-r9-powj6.cjs"),e=require("react/jsx-runtime"),j=require("next/navigation"),P=require("react"),z=["default","danger","inverse","emphasize","decolor"],L=["md","sm","xs"],R=["primary","secondary","tertiary","ghost","outline"],F="inline-flex items-center justify-center rounded-lg cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-4 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",q={md:"h-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./icon-r9-powj6.cjs"),e=require("react/jsx-runtime"),j=require("next/navigation"),P=require("react"),z=["default","danger","inverse","emphasize","decolor"],L=["md","sm","xs"],R=["primary","secondary","tertiary","ghost","outline"],F="inline-flex items-center justify-center rounded-lg cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-4 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",q={md:"h-8 w-8 p-0",sm:"h-7 w-7 p-0",xs:"h-6 w-6 p-0"},M={default:"text-gray-5 hover:text-neutral-5 transition-colors",danger:"text-red-4 hover:text-red-5",inverse:"text-white hover:text-gray-1",emphasize:"bg-white text-gray-5 hover:bg-gray-1 hover:text-neutral-5 focus-visible:bg-blue-1 focus-visible:text-blue-4 focus-visible:hover:bg-blue-2 focus-visible:hover:text-blue-5",decolor:"text-gray-5 hover:text-neutral-5 transition-colors"},O={ghost:"",outline:"border-2 border-gray-5"},V={default:"flex items-center gap-2 py-3 text-gray-5",danger:"flex items-center gap-2 py-3 text-red-4 hover:text-red-5",inverse:"flex items-center gap-2 py-3 text-white hover:text-gray-1",emphasize:"flex items-center gap-2 py-3 text-gray-5",decolor:"flex items-center gap-2 py-3 text-gray-5 hover:text-neutral-5"},G="inline-flex items-center justify-center gap-2";function I(n,a){return`${n==="xs"?"block h-5 w-5 shrink-0 leading-none":n==="sm"?"block h-4 w-4 shrink-0 text-base leading-none":"block h-6 w-6 shrink-0 text-2xl leading-none"} ${a??""}`.trim()}function A({className:n,size:a="md",state:t="default",variant:r="ghost"}){if(r==="primary"||r==="secondary"){const i=t==="emphasize"?"default":t;return`${m.getButtonClassName({className:G,variant:r,state:i})} ${n??""}`.trim()}return r==="tertiary"?`${V[t]} ${n??""}`.trim():`${F} ${q[a]} ${M[t]} ${O[r]} ${n??""}`.trim()}function E({children:n,icon:a,iconClassName:t,iconPosition:r="start",size:i="md",textClassName:c,variant:o="ghost"}){const l=a?e.jsx(m.Icon,{name:a,className:o==="ghost"||o==="outline"?I(i,t):o==="tertiary"?`h-5 w-5 shrink-0 ${t??""}`.trim():t}):null;if(o==="tertiary"){const s=n?e.jsx("span",{className:`font-semibold underline ${c??""}`.trim(),children:n}):null;return r==="end"?e.jsxs(e.Fragment,{children:[s,l]}):e.jsxs(e.Fragment,{children:[l,s]})}if(o==="primary"||o==="secondary"){const s=c?e.jsx("span",{className:c,children:n}):n;return l?s?r==="end"?e.jsxs(e.Fragment,{children:[s,l]}):e.jsxs(e.Fragment,{children:[l,s]}):l:s}return e.jsxs(e.Fragment,{children:[l,n]})}function T({children:n,icon:a,iconClassName:t,iconPosition:r="start",label:i,className:c,size:o="md",state:l="default",textClassName:s,type:u="button",variant:b="ghost",...y}){return e.jsx("button",{type:u,className:A({className:c,size:o,state:l,variant:b}),...y,"aria-label":i,children:E({children:n,icon:a,iconClassName:t,iconPosition:r,size:o,textClassName:s,variant:b})})}function D({name:n,size:a="md",className:t}){return e.jsx(m.Icon,{name:n,className:I(a,t)})}const Q=new Map([["black","/primary-badge-engine-logo-black.svg"],["white","/primary-badge-engine-logo-white.svg"],["color","/primary-badge-engine-logo-color.svg"]]);function U({variant:n="color",className:a}){const t=Q.get(n);return t===void 0?null:e.jsx("img",{src:t,width:186,height:36,alt:"Badge Engine",className:a})}function _({count:n,limit:a=10,pageParamKey:t="page"}){const r=j.useSearchParams(),i=j.usePathname(),c=j.useRouter(),o=r.get(t),l=o?Number.parseInt(o,10):Number.NaN,s=Number.isFinite(l)?l:1,u=Math.max(1,Math.ceil(n/a)),b=u<=7?Array.from({length:u},(d,g)=>g+1):s<=4?[1,2,3,4,5,"ellipsis",u]:s>=u-3?[1,"ellipsis",u-4,u-3,u-2,u-1,u]:[1,"ellipsis",s-1,s,s+1,"ellipsis",u],y=s===1,w=s===u,N=d=>{if(y&&d==="prev"||w&&d==="next")return;const g=d==="prev"?s-1:s+1,h=new URLSearchParams(r.toString());h.set(t,String(g)),c.push(`${i}?${h.toString()}`,{scroll:!1})},p=d=>{const g=new URLSearchParams(r.toString());g.set(t,String(d)),c.push(`${i}?${g.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(m.Icon,{name:"ArrowLineLeft"})})}),b.map((d,g)=>{const h=d==="ellipsis",f=h?void 0:d,S=f===s,$=h||S,C=h?"Pagination ellipsis":`Go to page ${f}`;return e.jsx("li",{children:e.jsx("button",{type:"button","aria-label":C,"aria-current":S?"page":void 0,disabled:$,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 ${S?"bg-blue-1 text-blue-4":""} ${$?"cursor-default":"cursor-pointer hover:bg-gray-1"}`.trim(),onClick:!$&&f?()=>p(f):void 0,children:h?"...":f})},`${d}-${g}`)}),e.jsx("li",{className:"ml-2",children:e.jsx("button",{type:"button","aria-label":"Next page",disabled:w,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(m.Icon,{name:"ArrowLineRight"})})})]})}function H({placeholder:n,className:a,inputWidth:t,value:r,onChange:i,syncToUrl:c=!0,id:o="search",paramKey:l="s",firstResultSelector:s,onEnter:u}){const b=j.useSearchParams(),y=j.usePathname(),w=j.useRouter(),N=P.useRef(null),p=r!==void 0,[d,g]=P.useState(p?r:b.get(l)?.toString()??""),h=p?r:d,f=Math.max(n.length,1),S=`calc(${f}ch + 60px)`,$=t===void 0?S:typeof t=="number"?`${t}px`:t;P.useEffect(()=>{!c||p||g(b.get(l)?.toString()??"")},[p,l,b,c]);const C=v=>{if(!c)return;const x=new URLSearchParams(b.toString());v?(x.set(l,v),x.delete("page")):(x.delete(l),x.delete("page"));const k=x.toString();w.replace(k?`${y}?${k}`:y)},B=v=>{if(v.preventDefault(),u?.(h),s&&h.trim()){const x=document.querySelector(s);x&&x.focus()}};return e.jsxs("form",{className:`search-field ${a??""}`.trim(),noValidate:!0,onSubmit:B,children:[e.jsx("label",{className:"sr-only",htmlFor:o,children:"Search"}),e.jsxs("div",{className:"relative max-w-full",style:{width:$},children:[e.jsx(m.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:N,className:"hide-search-clear block w-full max-w-full rounded-sm bg-white py-[11px] pl-[15px] pr-[40px] text-base leading-5 indent-[30px] outline-1 outline-gray-5 transition focus:outline-2 focus:outline-blue-4",style:{color:"#000000",WebkitTextFillColor:"#000000"},size:f,id:o,type:"search",autoComplete:"off",value:h,placeholder:n,onChange:v=>{const x=v.target.value;p||g(x),i?.(x),C(x)}}),h.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:()=>{p||g(""),i?.(""),C(""),N.current?.focus()},children:e.jsx(m.Icon,{name:"Close"})})]})]})}function J({columns:n,rows:a,rowKey:t}){const r=P.useId();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:n.map(i=>e.jsx("th",{id:`${r}-col-${i.key}`,scope:"col",className:`px-3 py-4 text-left leading-[23px] ${i.headerClassName??""}`.trim(),children:i.header},i.key))})}),e.jsx("tbody",{children:a.map((i,c)=>e.jsx("tr",{className:"border-t border-gray-2",children:n.map(o=>e.jsx("td",{headers:`${r}-col-${o.key}`,className:`${o.cellClassName??"px-3 py-4"}`.trim(),children:o.render(i)},o.key))},t(i,c)))})]})}exports.Button=m.Button;exports.Icon=m.Icon;exports.IconButton=T;exports.IconButtonGlyph=D;exports.Logo=U;exports.Pagination=_;exports.Search=H;exports.Table=J;exports.iconButtonSizes=L;exports.iconButtonStates=z;exports.iconButtonVariants=R;
|
package/dist/index.js
CHANGED
|
@@ -17,8 +17,8 @@ const Z = [
|
|
|
17
17
|
"ghost",
|
|
18
18
|
"outline"
|
|
19
19
|
], E = "inline-flex items-center justify-center rounded-lg cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-4 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", G = {
|
|
20
|
-
md: "h-
|
|
21
|
-
sm: "h-
|
|
20
|
+
md: "h-8 w-8 p-0",
|
|
21
|
+
sm: "h-7 w-7 p-0",
|
|
22
22
|
xs: "h-6 w-6 p-0"
|
|
23
23
|
}, q = {
|
|
24
24
|
default: "text-gray-5 hover:text-neutral-5 transition-colors",
|
package/dist/theme.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@theme{--color-*: initial; --text-*: initial; --spacing-*: initial;}@theme{ --color-gray-1: #f4f4f4; --color-gray-2: #e6e6e6; --color-gray-3: #a3a3a3; --color-gray-4: #767676; --color-gray-5: #454545; --color-blue-1: #eaf4fb; --color-blue-2: #d5e8f5; --color-blue-3: #2077be; --color-blue-4: #1166aa; --color-blue-5: #075593; --color-indigo-1: #eef2f9; --color-indigo-2: #d9dff3; --color-indigo-3: #5770be; --color-indigo-4: #465faa; --color-indigo-5: #3a4f92; --color-purple-1: #f1eef6; --color-purple-2: #e4dcf0; --color-purple-3: #8164af; --color-purple-4: #72559f; --color-purple-5: #5e4586; --color-violet-1: #f5eef6; --color-violet-2: #ecddef; --color-violet-3: #9f57af; --color-violet-4: #8a4799; --color-violet-5: #713c7c; --color-magenta-1: #f6eef4; --color-magenta-2: #f0dce9; --color-magenta-3: #aa558e; --color-magenta-4: #8f4777; --color-magenta-5: #7d3c68; --color-red-1: #ffefea; --color-red-2: #fee0d7; --color-red-3: #cc4a22; --color-red-4: #bc3a11; --color-red-5: #a22a06; --color-orange-1: #fcf2e8; --color-orange-2: #fae3cb; --color-orange-3: #d46b00; --color-orange-4: #b55b00; --color-orange-5: #8c4500; --color-green-1: #f5f9eb; --color-green-2: #e6f1cd; --color-green-3: #69930d; --color-green-4: #577d04; --color-green-5: #426001; --color-jade-1: #eef7f1; --color-jade-2: #d4eadd; --color-jade-3: #299a55; --color-jade-4: #14833f; --color-jade-5: #07652c; --color-teal-1: #eaf8fb; --color-teal-2: #caeef4; --color-teal-3: #1692a9; --color-teal-4: #1a7b8d; --color-teal-5: #11606e; --color-neutral-1: #ffffff; --color-neutral-2: rgba(0, 0, 0, .08); --color-neutral-3: rgba(0, 0, 0, .15); --color-neutral-4: rgba(0, 0, 0, .45); --color-neutral-5: #000000; --color-primary: #1166aa; --color-primary-hover: #eaf4fb; --color-danger: #bc3a11; --color-danger-hover: #a22a06; --color-disabled: #a3a3a3; --color-focus: #14833f; --color-focus-outer: #ffffff; --text-small: .875rem; --text-medium: 1rem; --text-medium-large: 1.25rem; --text-large: 1.5rem; --text-x-large: 2rem; --text-xx-large: 3rem; --text-xxx-large: 4rem; --text-base: 1rem; --spacing-0: 0; --spacing-1: .25rem; --spacing-2: .5rem; --spacing-3: .75rem; --spacing-4: 1rem; --spacing-5: 1.5rem; --spacing-6: 2rem; --spacing-7: 3rem; --spacing-8: 4rem; --spacing-9: 5rem; --spacing-10: 6rem; --spacing-11: 15rem; --spacing-12: 22.5rem; }@source "./components";@source "./index.js";@source "./forms.js"
|
|
1
|
+
@theme{--color-*: initial; --text-*: initial; --spacing-*: initial;}@theme{ --color-gray-1: #f4f4f4; --color-gray-2: #e6e6e6; --color-gray-3: #a3a3a3; --color-gray-4: #767676; --color-gray-5: #454545; --color-blue-1: #eaf4fb; --color-blue-2: #d5e8f5; --color-blue-3: #2077be; --color-blue-4: #1166aa; --color-blue-5: #075593; --color-indigo-1: #eef2f9; --color-indigo-2: #d9dff3; --color-indigo-3: #5770be; --color-indigo-4: #465faa; --color-indigo-5: #3a4f92; --color-purple-1: #f1eef6; --color-purple-2: #e4dcf0; --color-purple-3: #8164af; --color-purple-4: #72559f; --color-purple-5: #5e4586; --color-violet-1: #f5eef6; --color-violet-2: #ecddef; --color-violet-3: #9f57af; --color-violet-4: #8a4799; --color-violet-5: #713c7c; --color-magenta-1: #f6eef4; --color-magenta-2: #f0dce9; --color-magenta-3: #aa558e; --color-magenta-4: #8f4777; --color-magenta-5: #7d3c68; --color-red-1: #ffefea; --color-red-2: #fee0d7; --color-red-3: #cc4a22; --color-red-4: #bc3a11; --color-red-5: #a22a06; --color-orange-1: #fcf2e8; --color-orange-2: #fae3cb; --color-orange-3: #d46b00; --color-orange-4: #b55b00; --color-orange-5: #8c4500; --color-green-1: #f5f9eb; --color-green-2: #e6f1cd; --color-green-3: #69930d; --color-green-4: #577d04; --color-green-5: #426001; --color-jade-1: #eef7f1; --color-jade-2: #d4eadd; --color-jade-3: #299a55; --color-jade-4: #14833f; --color-jade-5: #07652c; --color-teal-1: #eaf8fb; --color-teal-2: #caeef4; --color-teal-3: #1692a9; --color-teal-4: #1a7b8d; --color-teal-5: #11606e; --color-neutral-1: #ffffff; --color-neutral-2: rgba(0, 0, 0, .08); --color-neutral-3: rgba(0, 0, 0, .15); --color-neutral-4: rgba(0, 0, 0, .45); --color-neutral-5: #000000; --color-primary: #1166aa; --color-primary-hover: #eaf4fb; --color-danger: #bc3a11; --color-danger-hover: #a22a06; --color-disabled: #a3a3a3; --color-focus: #14833f; --color-focus-outer: #ffffff; --text-small: .875rem; --text-medium: 1rem; --text-medium-large: 1.25rem; --text-large: 1.5rem; --text-x-large: 2rem; --text-xx-large: 3rem; --text-xxx-large: 4rem; --text-base: 1rem; --spacing-0: 0; --spacing-1: .25rem; --spacing-2: .5rem; --spacing-3: .75rem; --spacing-4: 1rem; --spacing-5: 1.5rem; --spacing-6: 2rem; --spacing-7: 3rem; --spacing-8: 4rem; --spacing-9: 5rem; --spacing-10: 6rem; --spacing-11: 15rem; --spacing-12: 22.5rem; }@source "./components";@source "./index.js";@source "./forms.js";@theme{ --color-focus: var(--color-jade-4); }@utility kb-focus{&:focus-visible {outline-width: 2px; outline-offset: 2px; outline-color: var(--color-focus); outline-style: solid;}}@layer components{.btn{@apply transition cursor-pointer font-semibold px-[1.375rem] py-[.625rem] rounded-3xl disabled:opacity-50;}.btn-primary{@apply bg-blue-3 border-2 border-blue-3 leading-5 text-neutral-1 hover:border-blue-4 hover:bg-blue-4 disabled:border-blue-3 disabled:bg-blue-3;}.btn-primary.btn-danger{@apply border-red-3 bg-red-3 text-neutral-1 hover:border-red-4 hover:bg-red-4;}.btn-primary.btn-inverse{@apply bg-neutral-1 text-blue-4 hover:bg-blue-1 hover:border-blue-5 hover:text-blue-5;}.btn-primary.btn-decolor{@apply border-gray-5 bg-gray-5 text-neutral-1 hover:border-neutral-5 hover:bg-neutral-5;}.btn-secondary{@apply bg-neutral-1 border-2 border-blue-3 text-blue-4 hover:border-blue-4 hover:bg-blue-1 hover:text-blue-5;}.btn-secondary.btn-danger{@apply border-red-3 text-red-3 hover:border-red-4 hover:text-red-4 hover:bg-red-1;}.btn-secondary.btn-inverse{@apply border-neutral-1 text-neutral-1 bg-indigo-3 hover:bg-indigo-4;}.btn-secondary.btn-decolor{@apply text-gray-5 border-gray-5 hover:text-neutral-5 hover:border-neutral-5 hover:bg-gray-1;}.btn-tertiary{@apply px-0 py-3 text-blue-4 underline hover:text-blue-5 rounded-none;}.btn-tertiary.btn-danger{@apply text-red-4 hover:text-red-5 rounded-none;}.btn-tertiary.btn-inverse{@apply text-neutral-1 hover:text-gray-1 rounded-none;}.btn-tertiary.btn-decolor{@apply text-gray-5 hover:text-neutral-5 rounded-none;}}@utility hide-search-clear{&::-webkit-search-cancel-button,&::-webkit-search-decoration {-webkit-appearance: none; appearance: none;} &::-ms-clear {display: none;}}.search-field input[type=search]::placeholder{color:#454545;-webkit-text-fill-color:#454545}.search-field>div>svg[aria-hidden=true]{left:15px!important}.search-field>div>input[type=search]{padding-left:47px!important;padding-right:48px!important;text-indent:0!important}.search-field>div>button[aria-label="Clear search"]{cursor:pointer;right:8px!important}button[aria-label="Previous page"]:not(:disabled),button[aria-label="Next page"]:not(:disabled){cursor:pointer}
|