@plyaz/ui 0.6.8 → 0.6.10
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/client.cjs.js +51 -1
- package/dist/client.es.js +3823 -2324
- package/dist/constant-B-tpIxtm.cjs +31 -0
- package/dist/{utils-BlazSa45.js → constant-BgZiatEy.js} +561 -400
- package/dist/index.cjs.js +8 -38
- package/dist/index.es.js +227 -378
- package/dist/types/components/AlertDialog/AlertDialog.d.ts +15 -0
- package/dist/types/components/AlertDialog/AlertDialog.d.ts.map +1 -0
- package/dist/types/components/AlertDialog/AlertDialog.stories.d.ts +23 -0
- package/dist/types/components/AlertDialog/AlertDialog.stories.d.ts.map +1 -0
- package/dist/types/components/client.d.ts +1 -0
- package/dist/types/components/client.d.ts.map +1 -1
- package/dist/ui.css +1 -1
- package/package.json +3 -2
- package/dist/utils-D4NY0-fZ.cjs +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
bg-primary text-primary-foreground shadow-xs
|
|
3
|
-
hover:bg-primary/90
|
|
4
|
-
`,destructive:`
|
|
5
|
-
bg-destructive text-white shadow-xs
|
|
6
|
-
hover:bg-destructive/90
|
|
7
|
-
focus-visible:ring-destructive/20
|
|
8
|
-
dark:bg-destructive/60 dark:focus-visible:ring-destructive/40
|
|
9
|
-
`,outline:`
|
|
10
|
-
border bg-background shadow-xs
|
|
11
|
-
hover:bg-accent hover:text-accent-foreground
|
|
12
|
-
dark:border-input dark:bg-input/30 dark:hover:bg-input/50
|
|
13
|
-
`,secondary:`
|
|
14
|
-
bg-secondary text-secondary-foreground shadow-xs
|
|
15
|
-
hover:bg-secondary/80
|
|
16
|
-
`,ghost:`
|
|
17
|
-
hover:bg-accent hover:text-accent-foreground
|
|
18
|
-
dark:hover:bg-accent/50
|
|
19
|
-
`,link:`
|
|
20
|
-
text-primary underline-offset-4
|
|
21
|
-
hover:underline
|
|
22
|
-
`},size:{default:`
|
|
23
|
-
h-9 px-4 py-2
|
|
24
|
-
has-[>svg]:px-3
|
|
25
|
-
`,sm:`
|
|
26
|
-
h-8 gap-1.5 rounded-md px-3
|
|
27
|
-
has-[>svg]:px-2.5
|
|
28
|
-
`,lg:`
|
|
29
|
-
h-10 rounded-md px-6
|
|
30
|
-
has-[>svg]:px-4
|
|
31
|
-
`,icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),be={row:"flex-row",col:"flex-col",row_reverse:"flex-row-reverse",col_reverse:"flex-col-reverse"},ve={wrap:"flex-wrap",nowrap:"flex-nowrap",wrap_reverse:"flex-wrap-reverse"},he=({children:t,gap:e,direction:a,justify:r,align:n,wrap:s,className:o="",element:u,...x})=>l.jsx(h,{element:u,className:i.cn("flex",a&&be[a],r&&C[r],n&&M[n],s&&ve[s],e&&V[e],o),...x,children:t}),ye=({children:t,className:e,cols:a,rows:r,gap:n,justify:s,align:o,element:u,...x})=>l.jsx(h,{element:u,className:i.cn("grid",a&&xe[a],r&&me[r],n&&V[n],s&&C[s],o&&M[o],e),...x,children:t}),we={xs:"xs",sm:"sm",base:"base",lg:"lg",xl:"xl","2xl":"2xl","3xl":"3xl","4xl":"4xl"},je=({children:t,element:e,className:a,size:r,...n})=>l.jsx(y,{className:a,element:e,size:we[r],variant:"heading",weight:"medium",...n,children:t}),Ne=({children:t,className:e,href:a,...r})=>l.jsx("a",{"data-testid":"link",href:a,rel:"noopener noreferrer",target:"_blank",className:i.cn("focus:outline-none text-blue-600 active:text-blue-900 visited:text-purple-600 hover:underline",e),...r,children:t}),Se={xs:"xs",sm:"sm",base:"base",lg:"lg"},ke=({children:t,className:e,size:a,...r})=>l.jsx(y,{className:e,element:"p",size:Se[a],variant:"body",weight:"normal",...r,children:t}),Le=({className:t="",children:e,...a})=>l.jsx(h,{element:"section",className:t,...a,children:e}),Pe=({children:t,direction:e="horizontal",spacing:a="space-x-2",element:r,className:n,...s})=>{const o=e==="vertical"?"flex-col":"flex-row";return l.jsx(h,{className:i.cn("flex",o,a,n),element:r,...s,children:t})},y=({className:t,children:e,element:a,weight:r,variant:n,size:s,...o})=>{const u=a;return l.jsx(u,{"data-testid":"text",className:i.cn("font-normal text-base",s&&ge[s],r&&fe[r],n&&de[n],t),...o,children:e})};function _e({className:t,variant:e,size:a,asChild:r=!1,...n}){const s=r?le.Slot:"button";return l.jsx(s,{"data-slot":"button",className:i.cn(pe({variant:e,size:a,className:t})),...n,"data-testid":"button"})}function Te({className:t,type:e,...a}){return l.jsx("input",{type:e,"data-slot":"input",className:i.cn(`
|
|
1
|
+
"use strict";var V=Object.defineProperty;var K=(t,e,a)=>e in t?V(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var h=(t,e,a)=>K(t,typeof e!="symbol"?e+"":e,a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./constant-B-tpIxtm.cjs");require("clsx");const H=require("@radix-ui/react-slot"),k=require("react"),W=require("@radix-ui/react-select"),j=require("lucide-react"),I=require("next-intl");function J(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,r.get?r:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const u=J(W),x=({children:t,element:e="div",className:a="",...r})=>{const n=e;return s.jsx(n,{className:a,...r,"data-testid":"box",children:t})},Q=({className:t="",children:e,element:a,...r})=>s.jsx(x,{element:a,className:o.cn("mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl",t),...r,children:e}),Z={row:"flex-row",col:"flex-col",row_reverse:"flex-row-reverse",col_reverse:"flex-col-reverse"},X={wrap:"flex-wrap",nowrap:"flex-nowrap",wrap_reverse:"flex-wrap-reverse"},Y=({children:t,gap:e,direction:a,justify:r,align:n,wrap:l,className:c="",element:d,...m})=>s.jsx(x,{element:d,className:o.cn("flex",a&&Z[a],r&&o.JUASTIFY_MAPPER[r],n&&o.ALIGN_MAPPER[n],l&&X[l],e&&o.GAP[e],c),...m,children:t}),ee=({children:t,className:e,cols:a,rows:r,gap:n,justify:l,align:c,element:d,...m})=>s.jsx(x,{element:d,className:o.cn("grid",a&&o.COLUMN_NUMBER[a],r&&o.ROW_NUMBER[r],n&&o.GAP[n],l&&o.JUASTIFY_MAPPER[l],c&&o.ALIGN_MAPPER[c],e),...m,children:t}),te={xs:"xs",sm:"sm",base:"base",lg:"lg",xl:"xl","2xl":"2xl","3xl":"3xl","4xl":"4xl"},ae=({children:t,element:e,className:a,size:r,...n})=>s.jsx(b,{className:a,element:e,size:te[r],variant:"heading",weight:"medium",...n,children:t}),re=({children:t,className:e,href:a,...r})=>s.jsx("a",{"data-testid":"link",href:a,rel:"noopener noreferrer",target:"_blank",className:o.cn("focus:outline-none text-blue-600 active:text-blue-900 visited:text-purple-600 hover:underline",e),...r,children:t}),ne={xs:"xs",sm:"sm",base:"base",lg:"lg"},se=({children:t,className:e,size:a,...r})=>s.jsx(b,{className:e,element:"p",size:ne[a],variant:"body",weight:"normal",...r,children:t}),le=({className:t="",children:e,...a})=>s.jsx(x,{element:"section",className:t,...a,children:e}),oe=({children:t,direction:e="horizontal",spacing:a="space-x-2",element:r,className:n,...l})=>{const c=e==="vertical"?"flex-col":"flex-row";return s.jsx(x,{className:o.cn("flex",c,a,n),element:r,...l,children:t})},b=({className:t,children:e,element:a,weight:r,variant:n,size:l,...c})=>{const d=a;return s.jsx(d,{"data-testid":"text",className:o.cn("font-normal text-base",l&&o.SIZES_MAPPER[l],r&&o.TEXT_WEIGHT_MAPPER[r],n&&o.VARIANT_MAPPER[n],t),...c,children:e})};function ce({className:t,variant:e,size:a,asChild:r=!1,...n}){const l=r?H.Slot:"button";return s.jsx(l,{"data-slot":"button",className:o.cn(o.buttonVariants({variant:e,size:a,className:t})),...n,"data-testid":"button"})}function ie({className:t,type:e,...a}){return s.jsx("input",{type:e,"data-slot":"input",className:o.cn(`
|
|
32
2
|
flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent
|
|
33
3
|
px-3 py-1 text-base shadow-xs transition-[color,box-shadow]
|
|
34
4
|
outline-none
|
|
@@ -46,13 +16,13 @@
|
|
|
46
16
|
`,`
|
|
47
17
|
aria-invalid:border-destructive aria-invalid:ring-destructive/20
|
|
48
18
|
dark:aria-invalid:ring-destructive/40
|
|
49
|
-
`,t),...a,"data-testid":"input"})}const
|
|
19
|
+
`,t),...a,"data-testid":"input"})}const T=k.memo(({children:t,className:e="",colors:a=["#FF0080","#7928CA","#0070F3","#38bdf8"],speed:r=1})=>{const n={backgroundImage:`linear-gradient(135deg, ${a.join(", ")}, ${a[0]})`,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",animationDuration:`${10/r}s`};return s.jsxs("span",{className:`
|
|
50
20
|
relative inline-block
|
|
51
21
|
${e}
|
|
52
|
-
`,"data-testid":"auroraText",children:[
|
|
22
|
+
`,"data-testid":"auroraText",children:[s.jsx("span",{className:"sr-only",children:t}),s.jsx("span",{className:`
|
|
53
23
|
relative animate-aurora bg-clip-text text-transparent
|
|
54
24
|
bg-[length:200%_auto]
|
|
55
|
-
`,style:n,"aria-hidden":"true",children:t})]})});
|
|
25
|
+
`,style:n,"aria-hidden":"true",children:t})]})});T.displayName="AuroraText";function _({...t}){return s.jsx(u.Root,{"data-slot":"select",...t})}function ue({...t}){return s.jsx(u.Group,{"data-slot":"select-group",...t})}function R({...t}){return s.jsx(u.Value,{"data-slot":"select-value",...t})}function A({className:t,size:e="default",children:a,...r}){return s.jsxs(u.Trigger,{"data-slot":"select-trigger","data-size":e,className:o.cn(`
|
|
56
26
|
flex w-fit items-center justify-between gap-2 rounded-md border
|
|
57
27
|
border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap
|
|
58
28
|
shadow-xs transition-[color,box-shadow] outline-none
|
|
@@ -72,7 +42,7 @@
|
|
|
72
42
|
[&_svg]:pointer-events-none [&_svg]:shrink-0
|
|
73
43
|
[&_svg:not([class*='size-'])]:size-4
|
|
74
44
|
[&_svg:not([class*='text-'])]:text-muted-foreground
|
|
75
|
-
`,t),...r,children:[a,
|
|
45
|
+
`,t),...r,children:[a,s.jsx(u.Icon,{asChild:!0,children:s.jsx(j.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function E({className:t,children:e,position:a="popper",...r}){return s.jsx(u.Portal,{"data-testid":"select",children:s.jsxs(u.Content,{"data-slot":"select-content",className:o.cn(`
|
|
76
46
|
relative z-50 max-h-(--radix-select-content-available-height)
|
|
77
47
|
min-w-[8rem] origin-(--radix-select-content-transform-origin)
|
|
78
48
|
overflow-x-hidden overflow-y-auto rounded-md border bg-popover
|
|
@@ -90,10 +60,10 @@
|
|
|
90
60
|
data-[side=left]:-translate-x-1
|
|
91
61
|
data-[side=right]:translate-x-1
|
|
92
62
|
data-[side=top]:-translate-y-1
|
|
93
|
-
`,t),position:a,...r,children:[
|
|
63
|
+
`,t),position:a,...r,children:[s.jsx(M,{}),s.jsx(u.Viewport,{className:o.cn("p-1",a==="popper"&&`
|
|
94
64
|
h-[var(--radix-select-trigger-height)] w-full
|
|
95
65
|
min-w-[var(--radix-select-trigger-width)] scroll-my-1
|
|
96
|
-
`),children:e}),
|
|
66
|
+
`),children:e}),s.jsx(z,{})]})})}function de({className:t,...e}){return s.jsx(u.Label,{"data-slot":"select-label",className:o.cn("px-2 py-1.5 text-xs text-muted-foreground",t),...e})}function F({className:t,children:e,...a}){return s.jsxs(u.Item,{"data-slot":"select-item",className:o.cn(`
|
|
97
67
|
relative flex w-full cursor-default items-center gap-2 rounded-sm
|
|
98
68
|
py-1.5 pr-8 pl-2 text-sm outline-hidden select-none
|
|
99
69
|
focus:bg-accent focus:text-accent-foreground
|
|
@@ -102,4 +72,4 @@
|
|
|
102
72
|
[&_svg:not([class*='size-'])]:size-4
|
|
103
73
|
[&_svg:not([class*='text-'])]:text-muted-foreground
|
|
104
74
|
*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2
|
|
105
|
-
`,t),...a,children:[
|
|
75
|
+
`,t),...a,children:[s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:s.jsx(u.ItemIndicator,{children:s.jsx(j.CheckIcon,{className:"size-4"})})}),s.jsx(u.ItemText,{children:e})]})}function pe({className:t,...e}){return s.jsx(u.Separator,{"data-slot":"select-separator",className:o.cn("pointer-events-none -mx-1 my-1 h-px bg-border",t),...e})}function M({className:t,...e}){return s.jsx(u.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:o.cn("flex cursor-default items-center justify-center py-1",t),...e,children:s.jsx(j.ChevronUpIcon,{className:"size-4"})})}function z({className:t,...e}){return s.jsx(u.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:o.cn("flex cursor-default items-center justify-center py-1",t),...e,children:s.jsx(j.ChevronDownIcon,{className:"size-4"})})}const fe=({translationKey:t,translationOptions:e,namespace:a,...r})=>{const l=I.useTranslations(a)(t,e==null?void 0:e.args);return s.jsx(b,{...r,children:l})},me=({translationKey:t,translationOptions:e,namespace:a,className:r,tag:n="div"})=>{const c=I.useTranslations(a)(t,e==null?void 0:e.args);return k.createElement(n,{className:r,"data-testid":"translated-html"},c)};var ge=Object.defineProperty,i=(t,e)=>ge(t,"name",{value:e,configurable:!0}),N=new Map,S=new Map;function P(t,e){return`${t}:${JSON.stringify(e??{})}`}i(P,"getFormatterKey");function D(t){const e=typeof t=="string"||typeof t=="number"?new Date(t):t;return e instanceof Date&&!Number.isNaN(e.getTime())?e:null}i(D,"parseDate");function C(t,e="en",a){var l;const r=D(t);if(!r)return"";const n=P(e,a);return N.has(n)||N.set(n,new Intl.DateTimeFormat(e,a)),((l=N.get(n))==null?void 0:l.format(r))??""}i(C,"formatDate");function q(t,e="en",a){var n;if(typeof t!="number"||Number.isNaN(t))return"";const r=P(e,a);return S.has(r)||S.set(r,new Intl.NumberFormat(e,a)),((n=S.get(r))==null?void 0:n.format(t))??""}i(q,"formatNumber");var w={defaultLocale:"en",supportedLocales:["en","es","fr","it","pt-BR","pt-PT"],fallbackLocale:"en"};function xe(){return w.supportedLocales}i(xe,"getSupportedLanguages");function be(){return w.defaultLocale}i(be,"getDefaultLanguage");function he(){return w.fallbackLocale}i(he,"getFallbackLanguage");function ve(t){return w.supportedLocales.includes(t)}i(ve,"isSupportedLanguage");var f=new Map;function je({value:t,forms:e,lang:a,type:r="cardinal"}){if(!G(t,e))return"";if(t===0&&e.zero)return y(e.zero,t);const l=$(a,r).select(t),c=B(e,l)??e.other??Object.values(e)[0];return c?y(c,t):""}i(je,"pluralize");function L(t,e){return`${t}:${e}`}i(L,"getPluralRulesKey");var we=/{count}|#/g;function B(t,e){switch(e){case"zero":return t.zero;case"one":return t.one;case"two":return t.two;case"few":return t.few;case"many":return t.many;case"other":return t.other;default:return}}i(B,"selectTemplate");function G(t,e){return typeof t=="number"&&e&&typeof e=="object"}i(G,"isValidInput");function y(t,e){return t.replaceAll(we,e.toString())}i(y,"replacePlaceholders");function $(t,e){const a=L(t,e);if(!f.has(a))try{f.set(a,new Intl.PluralRules(t,{type:e}))}catch{return v(a,e)}return f.get(a)??v(a,e)}i($,"getPluralRules");function v(t,e){const a=L("en",e);f.has(a)||f.set(a,new Intl.PluralRules("en",{type:e}));const r=f.get(a)??v(a,e);return f.set(t,r),r}i(v,"getFallbackPluralRules");var p;p=class{constructor(){h(this,"fallbackLocale");this.fallbackLocale="en"}static getInstance(){return p.instance||(p.instance=new p),p.instance}detectLocale(e){return e?this.detectFromRequest(e):this.fallbackLocale}detectFromRequest(e){var l,c,d;const a=(l=e.url.split("?")[1])==null?void 0:l.split("=")[1],r=e.headers.get("accept-language"),n=(d=(c=e.headers.get("cookie"))==null?void 0:c.split("; ").find(m=>m.startsWith("locale=")))==null?void 0:d.split("=")[1];return a??n??this.parseAcceptLanguage(r??"")??this.fallbackLocale}parseAcceptLanguage(e){if(!e)return null;let a=null,r=0;for(const n of e.split(",")){const{lang:l,q:c}=this.parseLangAndQ(n.trim());if(c>r&&(r=c,a=l,c===1))break}return a}parseLangAndQ(e){const a=e.indexOf(";"),r=a===-1?e:e.slice(0,Math.max(0,a));let n=1;if(a!==-1){const l=/q=(?<q>[\d.]+)/.exec(e.slice(a+1));n=l!=null&&l.groups?Number.parseFloat(l.groups.q)||0:1}return{lang:r,q:n}}setFallbackLocale(e){this.fallbackLocale=e}},i(p,"LocaleDetector"),h(p,"instance");var g;g=class{constructor(e){h(this,"namespaces");this.namespaces=e?new Map(e):new Map}addNamespace(e,a){if(!O(e))throw new Error("Invalid namespace name");this.namespaces.set(e,a)}getNamespace(e){return this.namespaces.get(e)}getAllNamespaces(){return[...this.namespaces.keys()]}mergeNamespaces(e,a){const r=this.namespaces.get(e)??{},n=this.namespaces.get(a)??{};this.namespaces.set(e,{...r,...n})}validateNamespace(e,a){const r=this.namespaces.get(e);return r?a?Object.entries(a).every(([n,l])=>{var d;const c=(d=Object.getOwnPropertyDescriptor(r,n))==null?void 0:d.value;return c!==void 0&&typeof c===l}):!0:!1}},i(g,"NamespaceManager");function O(t){return/^\w+$/.test(t)}i(O,"isSafeKey");const Ne=({date:t,formatOptions:e,locale:a,...r})=>{const n=C(t,a,e);return s.jsx(b,{...r,children:n})},Se=({value:t,formatOptions:e,locale:a,...r})=>{const n=q(t,a,e);return s.jsx(b,{...r,children:n})};function ye({locale:t,locales:e,onChange:a,getLabel:r,disabled:n}){return s.jsxs(_,{value:t,onValueChange:a,disabled:n,children:[s.jsx(A,{children:s.jsx(R,{placeholder:r(t)})}),s.jsx(E,{children:e.map(l=>s.jsx(F,{value:l,children:r(l)},l))})]})}function Pe({className:t,reverse:e=!1,pauseOnHover:a=!1,paused:r=!1,children:n,vertical:l=!1,repeat:c=4,...d}){return s.jsx("div",{...d,className:o.cn("group flex overflow-hidden p-2 [--duration:40s] [--gap:1rem] [gap:var(--gap)]",{"flex-row":!l,"flex-col":l},t),children:Array(c).fill(0).map((m,U)=>s.jsx("div",{className:o.cn("flex shrink-0 justify-around [gap:var(--gap)]",{"animate-marquee flex-row":!l,"animate-marquee-vertical flex-col":l,"group-hover:[animation-play-state:paused]":a,"[animation-direction:reverse]":e,"[animation-play-state:paused]":r}),children:n},U))})}exports.AuroraText=T;exports.Box=x;exports.Button=ce;exports.Container=Q;exports.ExternalLink=re;exports.Flex=Y;exports.FormattedDate=Ne;exports.FormattedNumber=Se;exports.Grid=ee;exports.Heading=ae;exports.Input=ie;exports.LanguageSelector=ye;exports.Marquee=Pe;exports.Paragraph=se;exports.Section=le;exports.Select=_;exports.SelectContent=E;exports.SelectGroup=ue;exports.SelectItem=F;exports.SelectLabel=de;exports.SelectScrollDownButton=z;exports.SelectScrollUpButton=M;exports.SelectSeparator=pe;exports.SelectTrigger=A;exports.SelectValue=R;exports.Stack=oe;exports.Text=b;exports.TranslatedHtml=me;exports.TranslatedText=fe;
|