@shmidko61/lc-ui-kit 0.9.0 → 0.11.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/README.md +33 -0
- package/dist/box/box.d.ts +1 -1
- package/dist/box/box.types.d.ts +14 -1
- package/dist/box.cjs +1 -1
- package/dist/box.js +222 -172
- package/dist/button/button.helpers.d.ts +4 -1
- package/dist/icons/icons.d.ts +6 -0
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +34 -33
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +64 -63
- package/dist/styles.css +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -36,3 +36,36 @@ import { Button, Select } from '@shmidko61/lc-ui-kit';
|
|
|
36
36
|
поэтому может потянуть `createContext`, `useState` или event handlers в RSC-граф.
|
|
37
37
|
|
|
38
38
|
Примеры по компонентам: [docs/component-usage.md](./docs/component-usage.md).
|
|
39
|
+
|
|
40
|
+
## Наведение и адаптивность
|
|
41
|
+
|
|
42
|
+
Общие визуальные свойства доступны в `hover` у Box и компонентов на его основе:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
<Box
|
|
46
|
+
bg="#10183B"
|
|
47
|
+
hover={{ bg: '#273B7D', color: '#F4C542', transform: 'translateY(-4px)' }}
|
|
48
|
+
md={{ hover: { bg: '#294D4B' } }}
|
|
49
|
+
lg={{ hover: null }}
|
|
50
|
+
xl={{ hover: { color: '#89A4D9' } }}
|
|
51
|
+
/>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Hover наследуется base → md (768px) → lg (1024px) → xl (1440px).
|
|
55
|
+
Частичные overrides сохраняют остальные hover-свойства, включая поля рамки.
|
|
56
|
+
`null` сбрасывает всё состояние к обычным стилям текущего диапазона; следующие
|
|
57
|
+
breakpoints могут включить hover заново. Для сброса отдельного эффекта подходят
|
|
58
|
+
обычные CSS-значения: `transform: 'none'`, `boxShadow: 'none'`, `opacity: 1`.
|
|
59
|
+
|
|
60
|
+
Поддерживаются `bg`, `background`, `backgroundColor`, `color`, `border`,
|
|
61
|
+
`boxShadow`, `opacity`, `transform`. Эффекты работают при
|
|
62
|
+
`(hover: hover) and (pointer: fine)` и исключают `:disabled`,
|
|
63
|
+
`aria-disabled="true"` и `data-disabled="true"`.
|
|
64
|
+
Явный inline `style` приоритетнее hover. Плавность настраивается через
|
|
65
|
+
`style.transition` или `className`.
|
|
66
|
+
|
|
67
|
+
`Button.hoverBg` помечен `@deprecated`, но продолжает работать.
|
|
68
|
+
Новый `hover.bg` имеет приоритет. Переход: `hoverBg={color}` →
|
|
69
|
+
`hover={{ bg: color }}`. При использовании нового background в base-hover
|
|
70
|
+
он наследуется на последующие breakpoints поверх старого `hoverBg`.
|
|
71
|
+
Примеры доступны в Storybook: `UI Kit/Box/Hover`.
|
package/dist/box/box.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ type BoxComponentType = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const Box: BoxComponentType;
|
|
11
11
|
export type { BorderRadiusItem, BorderRadiusKeys, BorderRadiusSides, BorderWidthItem, BorderWidthSides, PositionValue, UiKitAnyIndentationMargin, UiKitAnyIndentationPadding, UiKitArrayIndentation, UiKitAspectRatioProps, UiKitAspectRatioValue, UiKitAxisIndentationMargin, UiKitAxisIndentationPadding, UiKitBackgroundProps, UiKitBorderColor, UiKitBorderProps, UiKitBorderRadius, UiKitBorderWidth, UiKitBoxShadowProps, UiKitBoxShadowValue, UiKitColorProps, UiKitColorValue, UiKitCursorProps, UiKitDimensionProps, UiKitDisplayProps, UiKitIndentations, UiKitIndentationsProps, UiKitListStyleProps, UiKitMarginArrayIndentation, UiKitMarginIndentation, UiKitMixedXAxisIndentationMargin, UiKitMixedXAxisIndentationPadding, UiKitMixedYAxisIndentationMargin, UiKitMixedYAxisIndentationPadding, UiKitOpacityProps, UiKitOpacityValue, UiKitOutlineProps, UiKitOverflowProps, UiKitOverflowValue, UiKitPointerEventsProps, UiKitPointerEventsValue, UiKitPositionProps, UiKitTransformOriginValue, UiKitTransformProps, UiKitTransformValue, } from '../types';
|
|
12
|
-
export type { BoxAs, BoxBackgroundValue, BoxBreakpointProps, BoxComponentProps, BoxProps, } from './box.types';
|
|
12
|
+
export type { BoxAs, BoxBackgroundValue, BoxBreakpointProps, BoxComponentProps, BoxProps, HoverStyleProps, } from './box.types';
|
package/dist/box/box.types.d.ts
CHANGED
|
@@ -35,7 +35,20 @@ export type BoxOwnStyleProps = {
|
|
|
35
35
|
/**
|
|
36
36
|
* Набор props для одного responsive-состояния.
|
|
37
37
|
*/
|
|
38
|
-
export type BoxBreakpointProps = BoxStyleProps & BoxOwnStyleProps
|
|
38
|
+
export type BoxBreakpointProps = BoxStyleProps & BoxOwnStyleProps & {
|
|
39
|
+
/**
|
|
40
|
+
* Визуальные свойства при наведении точного указателя. Частичные overrides
|
|
41
|
+
* наследуются base → md → lg → xl. `null` сбрасывает весь унаследованный
|
|
42
|
+
* hover; следующие breakpoint-объекты могут включить его заново.
|
|
43
|
+
*/
|
|
44
|
+
hover?: HoverStyleProps | null;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Визуальные hover-свойства без размеров и вложенных breakpoints.
|
|
48
|
+
* Частичный border сохраняет остальные параметры обычной рамки.
|
|
49
|
+
* Явный element-level `style` приоритетнее hover, disabled не реагирует.
|
|
50
|
+
*/
|
|
51
|
+
export type HoverStyleProps = Pick<BoxStyleProps & BoxOwnStyleProps, 'bg' | 'background' | 'backgroundColor' | 'color' | 'border' | 'boxShadow' | 'opacity' | 'transform'>;
|
|
39
52
|
/**
|
|
40
53
|
* Responsive overrides Box.
|
|
41
54
|
*/
|
package/dist/box.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const eo=require("react/jsx-runtime"),ro=require("react"),D=require("./responsive-style.config-B2m9jVlX.cjs");function no({background:t,backgroundColor:o,bg:i,bgSize:d,bgRepeat:a,bgPosition:u,border:v,boxShadow:f,color:b,cursor:m,opacity:c,overflow:s,overflowX:p,overflowY:x,pointerEvents:R,aspectRatio:g,transform:k,transformOrigin:S,p:G,m:H,outlineColor:z,outlineWidth:W,outlineOffset:C,outlineStyle:T,listStyle:h,display:L,position:n,width:N,maxWidth:V,minWidth:P,height:w,maxHeight:j,minHeight:I}){const e={};return i!==void 0?xo(e,i):t!==void 0&&(e.background=A(t)),o!==void 0&&(e.backgroundColor=A(o)),d!==void 0&&(e.backgroundSize=vo(d)),a!==void 0&&(e.backgroundRepeat=Bo(a)),u!==void 0&&(e.backgroundPosition=yo(u)),bo(e,v),f!==void 0&&(e.boxShadow=l(f)),b!==void 0&&(e.color=l(b)),m!==void 0&&(e.cursor=m),c!==void 0&&(e.opacity=typeof c=="number"?c:l(c)),s!==void 0&&(e.overflowX=s,e.overflowY=s),p!==void 0&&(e.overflowX=p),x!==void 0&&(e.overflowY=x),R!==void 0&&(e.pointerEvents=R),g!==void 0&&(e.aspectRatio=typeof g=="number"?String(g):l(g)),k!==void 0&&(e.transform=l(k)),S!==void 0&&(e.transformOrigin=l(S)),so(e,G),lo(e,H),z!==void 0&&(e.outlineColor=l(z)),W!==void 0&&(e.outlineWidth=W),C!==void 0&&(e.outlineOffset=C),T!==void 0&&(e.outlineStyle=T),h?.position!==void 0&&(e.listStylePosition=h.position),h?.type!==void 0&&(e.listStyleType=h.type),L!==void 0&&(e.display=$o(L)),n?.type!==void 0&&(e.position=n.type),n?.top!==void 0&&(e.top=O(n.top)),n?.left!==void 0&&(e.left=O(n.left)),n?.right!==void 0&&(e.right=O(n.right)),n?.bottom!==void 0&&(e.bottom=O(n.bottom)),n?.zIndex!==void 0&&(e.zIndex=n.zIndex),N!==void 0&&(e.width=$(N)),V!==void 0&&(e.maxWidth=$(V)),P!==void 0&&(e.minWidth=$(P)),w!==void 0&&(e.height=$(w)),j!==void 0&&(e.maxHeight=$(j)),I!==void 0&&(e.minHeight=$(I)),Object.keys(e).length>0?e:void 0}function fo(t){const o=[],i={},d=t.groupParent===!0;Y(t,o,i,"","",d);for(const a of D.responsiveBreakpoints){const u=t[a];u&&Y(u,o,i,`${a}:`,`${a}-`,d)}return{className:o.join(" "),style:Object.keys(i).length>0?i:void 0}}function Y(t,o,i,d="",a="",u=!1){const v=no(t);for(const[f,b]of Object.entries(v??{})){if(b==null)continue;const m=String(b),c=ao(f,m);if(c){o.push(`${d}${c}`);continue}const s=`${a}${co(f)}`,p=uo(f,s);p&&(i[`--${s}`]=m,o.push(`${d}${p}`))}if(t.bgGroup!==void 0){const f=`${a}group-background`;i[`--${f}`]=A(t.bgGroup),o.push(`${d}group-hover:[background:var(--${f})]`),u&&o.push(`${d}hover:[background:var(--${f})]`)}}function ao(t,o){if(t==="display")return o==="none"?"hidden":o;if(t==="position")return o==="inherit"?"[position:inherit]":o;if(t==="cursor")return`cursor-${o}`;if(t==="backgroundRepeat")return{"no-repeat":"bg-no-repeat",repeat:"bg-repeat",round:"bg-repeat-round",space:"bg-repeat-space","repeat-x":"bg-repeat-x","repeat-y":"bg-repeat-y"}[o];if(t==="backgroundSize")return{auto:"bg-auto",contain:"bg-contain",cover:"bg-cover"}[o];if(t==="backgroundPosition")return{bottom:"bg-bottom",center:"bg-center",left:"bg-left","left bottom":"bg-left-bottom","left top":"bg-left-top",right:"bg-right","right bottom":"bg-right-bottom","right top":"bg-right-top",top:"bg-top"}[o];if(t==="borderStyle")return o==="none"?"border-none":`border-${o}`;if(t==="outlineStyle")return o==="none"?"outline-none":`outline-${o}`;if(t==="listStylePosition")return`list-${o}`;if(t==="listStyleType")return`list-${o}`}function uo(t,o){const i=`var(--${o})`;return{background:`[background:${i}]`,backgroundColor:`bg-[${i}]`,backgroundPosition:`bg-[position:${i}]`,backgroundSize:`bg-[length:${i}]`,aspectRatio:`[aspect-ratio:${i}]`,borderBottomLeftRadius:`rounded-bl-[${i}]`,borderBottomRightRadius:`rounded-br-[${i}]`,borderBottomWidth:`border-b-[length:${i}]`,borderColor:`border-[color:${i}]`,borderLeftWidth:`border-l-[length:${i}]`,borderRadius:`rounded-[${i}]`,borderRightWidth:`border-r-[length:${i}]`,borderTopLeftRadius:`rounded-tl-[${i}]`,borderTopRightRadius:`rounded-tr-[${i}]`,borderTopWidth:`border-t-[length:${i}]`,borderWidth:`border-[length:${i}]`,boxShadow:`[box-shadow:${i}]`,bottom:`bottom-[${i}]`,color:`[color:${i}]`,height:`h-[${i}]`,left:`left-[${i}]`,margin:`m-[${i}]`,marginBottom:`mb-[${i}]`,marginLeft:`ml-[${i}]`,marginRight:`mr-[${i}]`,marginTop:`mt-[${i}]`,maxHeight:`max-h-[${i}]`,maxWidth:`max-w-[${i}]`,minHeight:`min-h-[${i}]`,minWidth:`min-w-[${i}]`,outlineColor:`outline-[color:${i}]`,outlineOffset:`outline-offset-[${i}]`,outlineWidth:`outline-[length:${i}]`,opacity:`[opacity:${i}]`,overflowX:`[overflow-x:${i}]`,overflowY:`[overflow-y:${i}]`,padding:`p-[${i}]`,paddingBottom:`pb-[${i}]`,paddingLeft:`pl-[${i}]`,paddingRight:`pr-[${i}]`,paddingTop:`pt-[${i}]`,pointerEvents:`[pointer-events:${i}]`,right:`right-[${i}]`,top:`top-[${i}]`,transform:`[transform:${i}]`,transformOrigin:`[transform-origin:${i}]`,width:`w-[${i}]`,zIndex:`z-[${i}]`}[t]}function co(t){return t.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}function so(t,o){if(o!==void 0){if(Array.isArray(o)){t.padding=o.map(r).join(" ");return}if(typeof o!="object"){t.padding=r(o);return}"px"in o&&o.px!==void 0&&(t.paddingLeft=r(o.px),t.paddingRight=r(o.px)),"py"in o&&o.py!==void 0&&(t.paddingTop=r(o.py),t.paddingBottom=r(o.py)),"pt"in o&&o.pt!==void 0&&(t.paddingTop=r(o.pt)),"pb"in o&&o.pb!==void 0&&(t.paddingBottom=r(o.pb)),"pl"in o&&o.pl!==void 0&&(t.paddingLeft=r(o.pl)),"pr"in o&&o.pr!==void 0&&(t.paddingRight=r(o.pr))}}function lo(t,o){if(o!==void 0){if(Array.isArray(o)){t.margin=o.map(r).join(" ");return}if(typeof o!="object"){t.margin=r(o);return}"mx"in o&&o.mx!==void 0&&(t.marginLeft=r(o.mx),t.marginRight=r(o.mx)),"my"in o&&o.my!==void 0&&(t.marginTop=r(o.my),t.marginBottom=r(o.my)),"mt"in o&&o.mt!==void 0&&(t.marginTop=r(o.mt)),"mb"in o&&o.mb!==void 0&&(t.marginBottom=r(o.mb)),"ml"in o&&o.ml!==void 0&&(t.marginLeft=r(o.ml)),"mr"in o&&o.mr!==void 0&&(t.marginRight=r(o.mr))}}function bo(t,o){o&&(o.radius!==void 0&&mo(t,o.radius),o.color!==void 0&&(t.borderColor=l(o.color)),o.width!==void 0&&po(t,o.width),o.style!==void 0&&(t.borderStyle=o.style))}function mo(t,o){if(go(o)){o.topLeft!==void 0&&(t.borderTopLeftRadius=B(o.topLeft)),o.topRight!==void 0&&(t.borderTopRightRadius=B(o.topRight)),o.bottomLeft!==void 0&&(t.borderBottomLeftRadius=B(o.bottomLeft)),o.bottomRight!==void 0&&(t.borderBottomRightRadius=B(o.bottomRight));return}t.borderRadius=B(o)}function po(t,o){if(ho(o)){o.top!==void 0&&(t.borderTopWidth=y(o.top)),o.bottom!==void 0&&(t.borderBottomWidth=y(o.bottom)),o.left!==void 0&&(t.borderLeftWidth=y(o.left)),o.right!==void 0&&(t.borderRightWidth=y(o.right));return}t.borderWidth=y(o)}function go(t){return typeof t=="object"}function ho(t){return typeof t=="object"}function B(t){return t.startsWith("--")?`var(${t})`:t}function y(t){return t.startsWith("--")?`var(${t})`:t}function $o(t){return t==="hidden"?"none":t}function O(t){return typeof t=="number"?`${t}px`:t}function r(t){return typeof t=="number"?`${t}px`:t}function $(t){return typeof t=="number"?`${t}px`:t}function vo(t){return typeof t=="number"?`${t}px`:t}function Bo(t){return{"no-repeat":"no-repeat",repeat:"repeat","repeat-round":"round","repeat-space":"space","repeat-x":"repeat-x","repeat-y":"repeat-y"}[t]}function yo(t){return t.replace("-"," ")}function A(t){return l(t)}function xo(t,o){const i=A(o);if(Ro(o)){t.background=i;return}t.backgroundColor=i}function Ro(t){const o=t.trim().toLowerCase();return o.includes("url(")||o.includes("gradient(")||o.includes("image-set(")||o.includes("cross-fade(")||o.includes("element(")||o.includes("paint(")}function l(t){return t.startsWith("--")?`var(${t})`:t}function ko(t,o){const{as:i,children:d,className:a,background:u,backgroundColor:v,bg:f,bgSize:b,bgRepeat:m,bgGroup:c,groupParent:s,bgPosition:p,border:x,boxShadow:R,color:g,cursor:k,opacity:S,overflow:G,overflowX:H,overflowY:z,pointerEvents:W,aspectRatio:C,transform:T,transformOrigin:h,p:L,m:n,outlineColor:N,outlineWidth:V,outlineOffset:P,outlineStyle:w,listStyle:j,display:I,position:e,width:E,maxWidth:M,minWidth:K,height:Z,maxHeight:_,minHeight:F,md:J,lg:Q,xl:U,style:X,...oo}=t,to=i??"div",q=fo({background:u,backgroundColor:v,bg:f,bgSize:b,bgRepeat:m,bgGroup:c,groupParent:s,bgPosition:p,border:x,boxShadow:R,color:g,cursor:k,opacity:S,overflow:G,overflowX:H,overflowY:z,pointerEvents:W,aspectRatio:C,transform:T,transformOrigin:h,p:L,m:n,outlineColor:N,outlineWidth:V,outlineOffset:P,outlineStyle:w,listStyle:j,display:I,position:e,width:E,maxWidth:M,minWidth:K,height:Z,maxHeight:_,minHeight:F,md:J,lg:Q,xl:U}),io=q.style||X?{...q.style,...X}:void 0;return eo.jsx(to,{className:D.cn(q.className,s&&"group",a),ref:o,style:io,...oo,children:d})}const So=ro.forwardRef(ko);exports.Box=So;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const so=require("react/jsx-runtime"),fo=require("react"),x=require("./responsive-style.config-B2m9jVlX.cjs");function D({background:t,backgroundColor:o,bg:i,bgSize:d,bgRepeat:a,bgPosition:f,border:c,boxShadow:n,color:r,cursor:g,opacity:u,overflow:b,overflowX:p,overflowY:v,pointerEvents:B,aspectRatio:m,transform:y,transformOrigin:h,p:E,m:G,outlineColor:z,outlineWidth:C,outlineOffset:T,outlineStyle:L,listStyle:k,display:P,position:l,width:w,maxWidth:N,minWidth:V,height:j,maxHeight:I,minHeight:O}){const e={};return i!==void 0?So(e,i):t!==void 0&&(e.background=A(t)),o!==void 0&&(e.backgroundColor=A(o)),d!==void 0&&(e.backgroundSize=ko(d)),a!==void 0&&(e.backgroundRepeat=Ro(a)),f!==void 0&&(e.backgroundPosition=xo(f)),go(e,c),n!==void 0&&(e.boxShadow=$(n)),r!==void 0&&(e.color=$(r)),g!==void 0&&(e.cursor=g),u!==void 0&&(e.opacity=typeof u=="number"?u:$(u)),b!==void 0&&(e.overflowX=b,e.overflowY=b),p!==void 0&&(e.overflowX=p),v!==void 0&&(e.overflowY=v),B!==void 0&&(e.pointerEvents=B),m!==void 0&&(e.aspectRatio=typeof m=="number"?String(m):$(m)),y!==void 0&&(e.transform=$(y)),h!==void 0&&(e.transformOrigin=$(h)),po(e,E),mo(e,G),z!==void 0&&(e.outlineColor=$(z)),C!==void 0&&(e.outlineWidth=C),T!==void 0&&(e.outlineOffset=T),L!==void 0&&(e.outlineStyle=L),k?.position!==void 0&&(e.listStylePosition=k.position),k?.type!==void 0&&(e.listStyleType=k.type),P!==void 0&&(e.display=yo(P)),l?.type!==void 0&&(e.position=l.type),l?.top!==void 0&&(e.top=H(l.top)),l?.left!==void 0&&(e.left=H(l.left)),l?.right!==void 0&&(e.right=H(l.right)),l?.bottom!==void 0&&(e.bottom=H(l.bottom)),l?.zIndex!==void 0&&(e.zIndex=l.zIndex),w!==void 0&&(e.width=R(w)),N!==void 0&&(e.maxWidth=R(N)),V!==void 0&&(e.minWidth=R(V)),j!==void 0&&(e.height=R(j)),I!==void 0&&(e.maxHeight=R(I)),O!==void 0&&(e.minHeight=R(O)),Object.keys(e).length>0?e:void 0}function uo(t){const o=[],i={},d=t.groupParent===!0;_(t,o,i,"","",d);for(const a of x.responsiveBreakpoints){const f=t[a];f&&_(f,o,i,`${a}:`,`${a}-`,d)}return co(t,o,i),{className:o.join(" "),style:Object.keys(i).length>0?i:void 0}}function co(t,o,i){const d=[t,...x.responsiveBreakpoints.map(n=>t[n]??{})],a=new Set;for(const n of d)n.hover===null&&a.add("backgroundColor"),Object.keys(X(n.hover??{})).forEach(r=>a.add(r));if(a.size===0)return;let f={},c={};d.forEach((n,r)=>{f={...f,...X(n)},n.hover===null?c={}:c={...c,...X(n.hover??{})};const g=r===0?"":`${x.responsiveBreakpoints[r-1]}:`;for(const u of a){const b=M(u),p=`--hover-${r}-${b}`,v=u==="color"?"inherit":"initial";let B=`var(--button-bg,${v})`,m=`var(--button-color,${v})`;for(let h=0;h<r;h+=1)B=`var(--${x.responsiveBreakpoints[h]}-button-bg,${B})`,m=`var(--${x.responsiveBreakpoints[h]}-button-color,${m})`;const y=u==="background"||u==="backgroundColor"?B:u==="color"?m:v;i[p]=String(c[u]??f[u]??y),o.push(`${g}[@media(hover:hover)_and_(pointer:fine)]:[&:hover:not(:disabled):not([aria-disabled=true]):not([data-disabled=true])]:[${b}:var(${p})]`)}})}function X(t){const o={...D(t)};if(o.borderWidth!==void 0){const i=String(o.borderWidth).split(/\s+(?![^()]*\))/),d=i[0],a=i[1]??d,f=i[2]??d,c=i[3]??a;Object.assign(o,{borderTopWidth:d,borderRightWidth:a,borderBottomWidth:f,borderLeftWidth:c}),delete o.borderWidth}if(o.borderRadius!==void 0){const[i,d=i]=String(o.borderRadius).split("/"),a=n=>{const r=n.trim().split(/\s+(?![^()]*\))/);return[r[0],r[1]??r[0],r[2]??r[0],r[3]??r[1]??r[0]]},f=a(i),c=a(d);["TopLeft","TopRight","BottomRight","BottomLeft"].forEach((n,r)=>{o[`border${n}Radius`]=`${f[r]} ${c[r]}`}),delete o.borderRadius}return o}function _(t,o,i,d="",a="",f=!1){const c=D(t);for(const[n,r]of Object.entries(c??{})){if(r==null)continue;const g=String(r),u=lo(n,g);if(u){o.push(`${d}${u}`);continue}const b=`${a}${M(n)}`,p=bo(n,b);p&&(i[`--${b}`]=g,o.push(`${d}${p}`))}if(t.bgGroup!==void 0){const n=`${a}group-background`;i[`--${n}`]=A(t.bgGroup),o.push(`${d}group-hover:[background:var(--${n})]`),f&&o.push(`${d}hover:[background:var(--${n})]`)}}function lo(t,o){if(t==="display")return o==="none"?"hidden":o;if(t==="position")return o==="inherit"?"[position:inherit]":o;if(t==="cursor")return`cursor-${o}`;if(t==="backgroundRepeat")return{"no-repeat":"bg-no-repeat",repeat:"bg-repeat",round:"bg-repeat-round",space:"bg-repeat-space","repeat-x":"bg-repeat-x","repeat-y":"bg-repeat-y"}[o];if(t==="backgroundSize")return{auto:"bg-auto",contain:"bg-contain",cover:"bg-cover"}[o];if(t==="backgroundPosition")return{bottom:"bg-bottom",center:"bg-center",left:"bg-left","left bottom":"bg-left-bottom","left top":"bg-left-top",right:"bg-right","right bottom":"bg-right-bottom","right top":"bg-right-top",top:"bg-top"}[o];if(t==="borderStyle")return o==="none"?"border-none":`border-${o}`;if(t==="outlineStyle")return o==="none"?"outline-none":`outline-${o}`;if(t==="listStylePosition")return`list-${o}`;if(t==="listStyleType")return`list-${o}`}function bo(t,o){const i=`var(--${o})`;return{background:`[background:${i}]`,backgroundColor:`bg-[${i}]`,backgroundPosition:`bg-[position:${i}]`,backgroundSize:`bg-[length:${i}]`,aspectRatio:`[aspect-ratio:${i}]`,borderBottomLeftRadius:`rounded-bl-[${i}]`,borderBottomRightRadius:`rounded-br-[${i}]`,borderBottomWidth:`border-b-[length:${i}]`,borderColor:`border-[color:${i}]`,borderLeftWidth:`border-l-[length:${i}]`,borderRadius:`rounded-[${i}]`,borderRightWidth:`border-r-[length:${i}]`,borderTopLeftRadius:`rounded-tl-[${i}]`,borderTopRightRadius:`rounded-tr-[${i}]`,borderTopWidth:`border-t-[length:${i}]`,borderWidth:`border-[length:${i}]`,boxShadow:`[box-shadow:${i}]`,bottom:`bottom-[${i}]`,color:`[color:${i}]`,height:`h-[${i}]`,left:`left-[${i}]`,margin:`m-[${i}]`,marginBottom:`mb-[${i}]`,marginLeft:`ml-[${i}]`,marginRight:`mr-[${i}]`,marginTop:`mt-[${i}]`,maxHeight:`max-h-[${i}]`,maxWidth:`max-w-[${i}]`,minHeight:`min-h-[${i}]`,minWidth:`min-w-[${i}]`,outlineColor:`outline-[color:${i}]`,outlineOffset:`outline-offset-[${i}]`,outlineWidth:`outline-[length:${i}]`,opacity:`[opacity:${i}]`,overflowX:`[overflow-x:${i}]`,overflowY:`[overflow-y:${i}]`,padding:`p-[${i}]`,paddingBottom:`pb-[${i}]`,paddingLeft:`pl-[${i}]`,paddingRight:`pr-[${i}]`,paddingTop:`pt-[${i}]`,pointerEvents:`[pointer-events:${i}]`,right:`right-[${i}]`,top:`top-[${i}]`,transform:`[transform:${i}]`,transformOrigin:`[transform-origin:${i}]`,width:`w-[${i}]`,zIndex:`z-[${i}]`}[t]}function M(t){return t.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}function po(t,o){if(o!==void 0){if(Array.isArray(o)){t.padding=o.map(s).join(" ");return}if(typeof o!="object"){t.padding=s(o);return}"px"in o&&o.px!==void 0&&(t.paddingLeft=s(o.px),t.paddingRight=s(o.px)),"py"in o&&o.py!==void 0&&(t.paddingTop=s(o.py),t.paddingBottom=s(o.py)),"pt"in o&&o.pt!==void 0&&(t.paddingTop=s(o.pt)),"pb"in o&&o.pb!==void 0&&(t.paddingBottom=s(o.pb)),"pl"in o&&o.pl!==void 0&&(t.paddingLeft=s(o.pl)),"pr"in o&&o.pr!==void 0&&(t.paddingRight=s(o.pr))}}function mo(t,o){if(o!==void 0){if(Array.isArray(o)){t.margin=o.map(s).join(" ");return}if(typeof o!="object"){t.margin=s(o);return}"mx"in o&&o.mx!==void 0&&(t.marginLeft=s(o.mx),t.marginRight=s(o.mx)),"my"in o&&o.my!==void 0&&(t.marginTop=s(o.my),t.marginBottom=s(o.my)),"mt"in o&&o.mt!==void 0&&(t.marginTop=s(o.mt)),"mb"in o&&o.mb!==void 0&&(t.marginBottom=s(o.mb)),"ml"in o&&o.ml!==void 0&&(t.marginLeft=s(o.ml)),"mr"in o&&o.mr!==void 0&&(t.marginRight=s(o.mr))}}function go(t,o){o&&(o.radius!==void 0&&ho(t,o.radius),o.color!==void 0&&(t.borderColor=$(o.color)),o.width!==void 0&&$o(t,o.width),o.style!==void 0&&(t.borderStyle=o.style))}function ho(t,o){if(vo(o)){o.topLeft!==void 0&&(t.borderTopLeftRadius=S(o.topLeft)),o.topRight!==void 0&&(t.borderTopRightRadius=S(o.topRight)),o.bottomLeft!==void 0&&(t.borderBottomLeftRadius=S(o.bottomLeft)),o.bottomRight!==void 0&&(t.borderBottomRightRadius=S(o.bottomRight));return}t.borderRadius=S(o)}function $o(t,o){if(Bo(o)){o.top!==void 0&&(t.borderTopWidth=W(o.top)),o.bottom!==void 0&&(t.borderBottomWidth=W(o.bottom)),o.left!==void 0&&(t.borderLeftWidth=W(o.left)),o.right!==void 0&&(t.borderRightWidth=W(o.right));return}t.borderWidth=W(o)}function vo(t){return typeof t=="object"}function Bo(t){return typeof t=="object"}function S(t){return t.startsWith("--")?`var(${t})`:t}function W(t){return t.startsWith("--")?`var(${t})`:t}function yo(t){return t==="hidden"?"none":t}function H(t){return typeof t=="number"?`${t}px`:t}function s(t){return typeof t=="number"?`${t}px`:t}function R(t){return typeof t=="number"?`${t}px`:t}function ko(t){return typeof t=="number"?`${t}px`:t}function Ro(t){return{"no-repeat":"no-repeat",repeat:"repeat","repeat-round":"round","repeat-space":"space","repeat-x":"repeat-x","repeat-y":"repeat-y"}[t]}function xo(t){return t.replace("-"," ")}function A(t){return $(t)}function So(t,o){const i=A(o);if(Wo(o)){t.background=i;return}t.backgroundColor=i}function Wo(t){const o=t.trim().toLowerCase();return o.includes("url(")||o.includes("gradient(")||o.includes("image-set(")||o.includes("cross-fade(")||o.includes("element(")||o.includes("paint(")}function $(t){return t.startsWith("--")?`var(${t})`:t}function zo(t,o){const{as:i,children:d,className:a,background:f,backgroundColor:c,bg:n,bgSize:r,bgRepeat:g,bgGroup:u,groupParent:b,bgPosition:p,border:v,boxShadow:B,color:m,cursor:y,opacity:h,overflow:E,overflowX:G,overflowY:z,pointerEvents:C,aspectRatio:T,transform:L,transformOrigin:k,p:P,m:l,outlineColor:w,outlineWidth:N,outlineOffset:V,outlineStyle:j,listStyle:I,display:O,position:e,width:F,maxWidth:K,minWidth:Z,height:J,hover:Q,maxHeight:U,minHeight:oo,md:to,lg:io,xl:eo,style:Y,...ro}=t,no=i??"div",q=uo({hover:Q,background:f,backgroundColor:c,bg:n,bgSize:r,bgRepeat:g,bgGroup:u,groupParent:b,bgPosition:p,border:v,boxShadow:B,color:m,cursor:y,opacity:h,overflow:E,overflowX:G,overflowY:z,pointerEvents:C,aspectRatio:T,transform:L,transformOrigin:k,p:P,m:l,outlineColor:w,outlineWidth:N,outlineOffset:V,outlineStyle:j,listStyle:I,display:O,position:e,width:F,maxWidth:K,minWidth:Z,height:J,maxHeight:U,minHeight:oo,md:to,lg:io,xl:eo}),ao=q.style||Y?{...q.style,...Y}:void 0;return so.jsx(no,{className:x.cn(q.className,b&&"group",a),ref:o,style:ao,...ro,children:d})}const Co=fo.forwardRef(zo);exports.Box=Co;
|
package/dist/box.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { a as
|
|
4
|
-
function
|
|
1
|
+
import { jsx as fo } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as so } from "react";
|
|
3
|
+
import { a as W, c as uo } from "./responsive-style.config-DFuATrIM.js";
|
|
4
|
+
function F({
|
|
5
5
|
background: t,
|
|
6
6
|
backgroundColor: o,
|
|
7
7
|
bg: i,
|
|
8
8
|
bgSize: d,
|
|
9
9
|
bgRepeat: a,
|
|
10
|
-
bgPosition:
|
|
11
|
-
border:
|
|
12
|
-
boxShadow:
|
|
13
|
-
color:
|
|
14
|
-
cursor:
|
|
15
|
-
opacity:
|
|
16
|
-
overflow:
|
|
17
|
-
overflowX:
|
|
18
|
-
overflowY:
|
|
19
|
-
pointerEvents:
|
|
20
|
-
aspectRatio:
|
|
21
|
-
transform:
|
|
22
|
-
transformOrigin:
|
|
23
|
-
p:
|
|
24
|
-
m:
|
|
10
|
+
bgPosition: s,
|
|
11
|
+
border: c,
|
|
12
|
+
boxShadow: n,
|
|
13
|
+
color: e,
|
|
14
|
+
cursor: g,
|
|
15
|
+
opacity: u,
|
|
16
|
+
overflow: b,
|
|
17
|
+
overflowX: m,
|
|
18
|
+
overflowY: v,
|
|
19
|
+
pointerEvents: B,
|
|
20
|
+
aspectRatio: p,
|
|
21
|
+
transform: y,
|
|
22
|
+
transformOrigin: h,
|
|
23
|
+
p: E,
|
|
24
|
+
m: G,
|
|
25
25
|
outlineColor: z,
|
|
26
|
-
outlineWidth:
|
|
27
|
-
outlineOffset:
|
|
28
|
-
outlineStyle:
|
|
29
|
-
listStyle:
|
|
30
|
-
display:
|
|
31
|
-
position:
|
|
32
|
-
width:
|
|
33
|
-
maxWidth:
|
|
34
|
-
minWidth:
|
|
35
|
-
height:
|
|
26
|
+
outlineWidth: C,
|
|
27
|
+
outlineOffset: T,
|
|
28
|
+
outlineStyle: L,
|
|
29
|
+
listStyle: R,
|
|
30
|
+
display: P,
|
|
31
|
+
position: l,
|
|
32
|
+
width: w,
|
|
33
|
+
maxWidth: N,
|
|
34
|
+
minWidth: V,
|
|
35
|
+
height: j,
|
|
36
36
|
maxHeight: I,
|
|
37
|
-
minHeight:
|
|
37
|
+
minHeight: O
|
|
38
38
|
}) {
|
|
39
|
-
const
|
|
40
|
-
return i !== void 0 ?
|
|
39
|
+
const r = {};
|
|
40
|
+
return i !== void 0 ? Wo(r, i) : t !== void 0 && (r.background = A(t)), o !== void 0 && (r.backgroundColor = A(o)), d !== void 0 && (r.backgroundSize = ko(d)), a !== void 0 && (r.backgroundRepeat = xo(a)), s !== void 0 && (r.backgroundPosition = So(s)), ho(r, c), n !== void 0 && (r.boxShadow = $(n)), e !== void 0 && (r.color = $(e)), g !== void 0 && (r.cursor = g), u !== void 0 && (r.opacity = typeof u == "number" ? u : $(u)), b !== void 0 && (r.overflowX = b, r.overflowY = b), m !== void 0 && (r.overflowX = m), v !== void 0 && (r.overflowY = v), B !== void 0 && (r.pointerEvents = B), p !== void 0 && (r.aspectRatio = typeof p == "number" ? String(p) : $(p)), y !== void 0 && (r.transform = $(y)), h !== void 0 && (r.transformOrigin = $(h)), po(r, E), go(r, G), z !== void 0 && (r.outlineColor = $(z)), C !== void 0 && (r.outlineWidth = C), T !== void 0 && (r.outlineOffset = T), L !== void 0 && (r.outlineStyle = L), R?.position !== void 0 && (r.listStylePosition = R.position), R?.type !== void 0 && (r.listStyleType = R.type), P !== void 0 && (r.display = Ro(P)), l?.type !== void 0 && (r.position = l.type), l?.top !== void 0 && (r.top = H(l.top)), l?.left !== void 0 && (r.left = H(l.left)), l?.right !== void 0 && (r.right = H(l.right)), l?.bottom !== void 0 && (r.bottom = H(l.bottom)), l?.zIndex !== void 0 && (r.zIndex = l.zIndex), w !== void 0 && (r.width = k(w)), N !== void 0 && (r.maxWidth = k(N)), V !== void 0 && (r.minWidth = k(V)), j !== void 0 && (r.height = k(j)), I !== void 0 && (r.maxHeight = k(I)), O !== void 0 && (r.minHeight = k(O)), Object.keys(r).length > 0 ? r : void 0;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function co(t) {
|
|
43
43
|
const o = [], i = {}, d = t.groupParent === !0;
|
|
44
|
-
|
|
45
|
-
for (const a of
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
_(t, o, i, "", "", d);
|
|
45
|
+
for (const a of W) {
|
|
46
|
+
const s = t[a];
|
|
47
|
+
s && _(
|
|
48
|
+
s,
|
|
49
49
|
o,
|
|
50
50
|
i,
|
|
51
51
|
`${a}:`,
|
|
@@ -53,30 +53,78 @@ function ao(t) {
|
|
|
53
53
|
d
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
-
return {
|
|
56
|
+
return lo(t, o, i), {
|
|
57
57
|
className: o.join(" "),
|
|
58
58
|
style: Object.keys(i).length > 0 ? i : void 0
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
const
|
|
63
|
-
for (const
|
|
64
|
-
|
|
61
|
+
function lo(t, o, i) {
|
|
62
|
+
const d = [t, ...W.map((n) => t[n] ?? {})], a = /* @__PURE__ */ new Set();
|
|
63
|
+
for (const n of d)
|
|
64
|
+
n.hover === null && a.add("backgroundColor"), Object.keys(Y(n.hover ?? {})).forEach((e) => a.add(e));
|
|
65
|
+
if (a.size === 0) return;
|
|
66
|
+
let s = {}, c = {};
|
|
67
|
+
d.forEach((n, e) => {
|
|
68
|
+
s = { ...s, ...Y(n) }, n.hover === null ? c = {} : c = { ...c, ...Y(n.hover ?? {}) };
|
|
69
|
+
const g = e === 0 ? "" : `${W[e - 1]}:`;
|
|
70
|
+
for (const u of a) {
|
|
71
|
+
const b = K(u), m = `--hover-${e}-${b}`, v = u === "color" ? "inherit" : "initial";
|
|
72
|
+
let B = `var(--button-bg,${v})`, p = `var(--button-color,${v})`;
|
|
73
|
+
for (let h = 0; h < e; h += 1)
|
|
74
|
+
B = `var(--${W[h]}-button-bg,${B})`, p = `var(--${W[h]}-button-color,${p})`;
|
|
75
|
+
const y = u === "background" || u === "backgroundColor" ? B : u === "color" ? p : v;
|
|
76
|
+
i[m] = String(c[u] ?? s[u] ?? y), o.push(
|
|
77
|
+
`${g}[@media(hover:hover)_and_(pointer:fine)]:[&:hover:not(:disabled):not([aria-disabled=true]):not([data-disabled=true])]:[${b}:var(${m})]`
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function Y(t) {
|
|
83
|
+
const o = { ...F(t) };
|
|
84
|
+
if (o.borderWidth !== void 0) {
|
|
85
|
+
const i = String(o.borderWidth).split(/\s+(?![^()]*\))/), d = i[0], a = i[1] ?? d, s = i[2] ?? d, c = i[3] ?? a;
|
|
86
|
+
Object.assign(o, {
|
|
87
|
+
borderTopWidth: d,
|
|
88
|
+
borderRightWidth: a,
|
|
89
|
+
borderBottomWidth: s,
|
|
90
|
+
borderLeftWidth: c
|
|
91
|
+
}), delete o.borderWidth;
|
|
92
|
+
}
|
|
93
|
+
if (o.borderRadius !== void 0) {
|
|
94
|
+
const [i, d = i] = String(o.borderRadius).split("/"), a = (n) => {
|
|
95
|
+
const e = n.trim().split(/\s+(?![^()]*\))/);
|
|
96
|
+
return [
|
|
97
|
+
e[0],
|
|
98
|
+
e[1] ?? e[0],
|
|
99
|
+
e[2] ?? e[0],
|
|
100
|
+
e[3] ?? e[1] ?? e[0]
|
|
101
|
+
];
|
|
102
|
+
}, s = a(i), c = a(d);
|
|
103
|
+
["TopLeft", "TopRight", "BottomRight", "BottomLeft"].forEach((n, e) => {
|
|
104
|
+
o[`border${n}Radius`] = `${s[e]} ${c[e]}`;
|
|
105
|
+
}), delete o.borderRadius;
|
|
106
|
+
}
|
|
107
|
+
return o;
|
|
108
|
+
}
|
|
109
|
+
function _(t, o, i, d = "", a = "", s = !1) {
|
|
110
|
+
const c = F(t);
|
|
111
|
+
for (const [n, e] of Object.entries(c ?? {})) {
|
|
112
|
+
if (e == null)
|
|
65
113
|
continue;
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
o.push(`${d}${
|
|
114
|
+
const g = String(e), u = bo(n, g);
|
|
115
|
+
if (u) {
|
|
116
|
+
o.push(`${d}${u}`);
|
|
69
117
|
continue;
|
|
70
118
|
}
|
|
71
|
-
const
|
|
72
|
-
|
|
119
|
+
const b = `${a}${K(n)}`, m = mo(n, b);
|
|
120
|
+
m && (i[`--${b}`] = g, o.push(`${d}${m}`));
|
|
73
121
|
}
|
|
74
122
|
if (t.bgGroup !== void 0) {
|
|
75
|
-
const
|
|
76
|
-
i[`--${
|
|
123
|
+
const n = `${a}group-background`;
|
|
124
|
+
i[`--${n}`] = A(t.bgGroup), o.push(`${d}group-hover:[background:var(--${n})]`), s && o.push(`${d}hover:[background:var(--${n})]`);
|
|
77
125
|
}
|
|
78
126
|
}
|
|
79
|
-
function
|
|
127
|
+
function bo(t, o) {
|
|
80
128
|
if (t === "display")
|
|
81
129
|
return o === "none" ? "hidden" : o;
|
|
82
130
|
if (t === "position")
|
|
@@ -119,7 +167,7 @@ function uo(t, o) {
|
|
|
119
167
|
if (t === "listStyleType")
|
|
120
168
|
return `list-${o}`;
|
|
121
169
|
}
|
|
122
|
-
function
|
|
170
|
+
function mo(t, o) {
|
|
123
171
|
const i = `var(--${o})`;
|
|
124
172
|
return {
|
|
125
173
|
background: `[background:${i}]`,
|
|
@@ -172,80 +220,80 @@ function co(t, o) {
|
|
|
172
220
|
zIndex: `z-[${i}]`
|
|
173
221
|
}[t];
|
|
174
222
|
}
|
|
175
|
-
function
|
|
223
|
+
function K(t) {
|
|
176
224
|
return t.replace(/[A-Z]/g, (o) => `-${o.toLowerCase()}`);
|
|
177
225
|
}
|
|
178
|
-
function
|
|
226
|
+
function po(t, o) {
|
|
179
227
|
if (o !== void 0) {
|
|
180
228
|
if (Array.isArray(o)) {
|
|
181
|
-
t.padding = o.map(
|
|
229
|
+
t.padding = o.map(f).join(" ");
|
|
182
230
|
return;
|
|
183
231
|
}
|
|
184
232
|
if (typeof o != "object") {
|
|
185
|
-
t.padding =
|
|
233
|
+
t.padding = f(o);
|
|
186
234
|
return;
|
|
187
235
|
}
|
|
188
|
-
"px" in o && o.px !== void 0 && (t.paddingLeft =
|
|
236
|
+
"px" in o && o.px !== void 0 && (t.paddingLeft = f(o.px), t.paddingRight = f(o.px)), "py" in o && o.py !== void 0 && (t.paddingTop = f(o.py), t.paddingBottom = f(o.py)), "pt" in o && o.pt !== void 0 && (t.paddingTop = f(o.pt)), "pb" in o && o.pb !== void 0 && (t.paddingBottom = f(o.pb)), "pl" in o && o.pl !== void 0 && (t.paddingLeft = f(o.pl)), "pr" in o && o.pr !== void 0 && (t.paddingRight = f(o.pr));
|
|
189
237
|
}
|
|
190
238
|
}
|
|
191
|
-
function
|
|
239
|
+
function go(t, o) {
|
|
192
240
|
if (o !== void 0) {
|
|
193
241
|
if (Array.isArray(o)) {
|
|
194
|
-
t.margin = o.map(
|
|
242
|
+
t.margin = o.map(f).join(" ");
|
|
195
243
|
return;
|
|
196
244
|
}
|
|
197
245
|
if (typeof o != "object") {
|
|
198
|
-
t.margin =
|
|
246
|
+
t.margin = f(o);
|
|
199
247
|
return;
|
|
200
248
|
}
|
|
201
|
-
"mx" in o && o.mx !== void 0 && (t.marginLeft =
|
|
249
|
+
"mx" in o && o.mx !== void 0 && (t.marginLeft = f(o.mx), t.marginRight = f(o.mx)), "my" in o && o.my !== void 0 && (t.marginTop = f(o.my), t.marginBottom = f(o.my)), "mt" in o && o.mt !== void 0 && (t.marginTop = f(o.mt)), "mb" in o && o.mb !== void 0 && (t.marginBottom = f(o.mb)), "ml" in o && o.ml !== void 0 && (t.marginLeft = f(o.ml)), "mr" in o && o.mr !== void 0 && (t.marginRight = f(o.mr));
|
|
202
250
|
}
|
|
203
251
|
}
|
|
204
|
-
function
|
|
205
|
-
o && (o.radius !== void 0 &&
|
|
252
|
+
function ho(t, o) {
|
|
253
|
+
o && (o.radius !== void 0 && $o(t, o.radius), o.color !== void 0 && (t.borderColor = $(o.color)), o.width !== void 0 && vo(t, o.width), o.style !== void 0 && (t.borderStyle = o.style));
|
|
206
254
|
}
|
|
207
|
-
function
|
|
208
|
-
if (
|
|
209
|
-
o.topLeft !== void 0 && (t.borderTopLeftRadius =
|
|
255
|
+
function $o(t, o) {
|
|
256
|
+
if (Bo(o)) {
|
|
257
|
+
o.topLeft !== void 0 && (t.borderTopLeftRadius = x(o.topLeft)), o.topRight !== void 0 && (t.borderTopRightRadius = x(o.topRight)), o.bottomLeft !== void 0 && (t.borderBottomLeftRadius = x(o.bottomLeft)), o.bottomRight !== void 0 && (t.borderBottomRightRadius = x(o.bottomRight));
|
|
210
258
|
return;
|
|
211
259
|
}
|
|
212
|
-
t.borderRadius =
|
|
260
|
+
t.borderRadius = x(o);
|
|
213
261
|
}
|
|
214
|
-
function
|
|
215
|
-
if (
|
|
216
|
-
o.top !== void 0 && (t.borderTopWidth =
|
|
262
|
+
function vo(t, o) {
|
|
263
|
+
if (yo(o)) {
|
|
264
|
+
o.top !== void 0 && (t.borderTopWidth = S(o.top)), o.bottom !== void 0 && (t.borderBottomWidth = S(o.bottom)), o.left !== void 0 && (t.borderLeftWidth = S(o.left)), o.right !== void 0 && (t.borderRightWidth = S(o.right));
|
|
217
265
|
return;
|
|
218
266
|
}
|
|
219
|
-
t.borderWidth =
|
|
267
|
+
t.borderWidth = S(o);
|
|
220
268
|
}
|
|
221
|
-
function
|
|
269
|
+
function Bo(t) {
|
|
222
270
|
return typeof t == "object";
|
|
223
271
|
}
|
|
224
|
-
function
|
|
272
|
+
function yo(t) {
|
|
225
273
|
return typeof t == "object";
|
|
226
274
|
}
|
|
227
|
-
function
|
|
275
|
+
function x(t) {
|
|
228
276
|
return t.startsWith("--") ? `var(${t})` : t;
|
|
229
277
|
}
|
|
230
|
-
function
|
|
278
|
+
function S(t) {
|
|
231
279
|
return t.startsWith("--") ? `var(${t})` : t;
|
|
232
280
|
}
|
|
233
|
-
function
|
|
281
|
+
function Ro(t) {
|
|
234
282
|
return t === "hidden" ? "none" : t;
|
|
235
283
|
}
|
|
236
|
-
function
|
|
284
|
+
function H(t) {
|
|
237
285
|
return typeof t == "number" ? `${t}px` : t;
|
|
238
286
|
}
|
|
239
|
-
function
|
|
287
|
+
function f(t) {
|
|
240
288
|
return typeof t == "number" ? `${t}px` : t;
|
|
241
289
|
}
|
|
242
|
-
function
|
|
290
|
+
function k(t) {
|
|
243
291
|
return typeof t == "number" ? `${t}px` : t;
|
|
244
292
|
}
|
|
245
|
-
function
|
|
293
|
+
function ko(t) {
|
|
246
294
|
return typeof t == "number" ? `${t}px` : t;
|
|
247
295
|
}
|
|
248
|
-
function
|
|
296
|
+
function xo(t) {
|
|
249
297
|
return {
|
|
250
298
|
"no-repeat": "no-repeat",
|
|
251
299
|
repeat: "repeat",
|
|
@@ -255,127 +303,129 @@ function yo(t) {
|
|
|
255
303
|
"repeat-y": "repeat-y"
|
|
256
304
|
}[t];
|
|
257
305
|
}
|
|
258
|
-
function
|
|
306
|
+
function So(t) {
|
|
259
307
|
return t.replace("-", " ");
|
|
260
308
|
}
|
|
261
309
|
function A(t) {
|
|
262
|
-
return
|
|
310
|
+
return $(t);
|
|
263
311
|
}
|
|
264
|
-
function
|
|
312
|
+
function Wo(t, o) {
|
|
265
313
|
const i = A(o);
|
|
266
|
-
if (
|
|
314
|
+
if (zo(o)) {
|
|
267
315
|
t.background = i;
|
|
268
316
|
return;
|
|
269
317
|
}
|
|
270
318
|
t.backgroundColor = i;
|
|
271
319
|
}
|
|
272
|
-
function
|
|
320
|
+
function zo(t) {
|
|
273
321
|
const o = t.trim().toLowerCase();
|
|
274
322
|
return o.includes("url(") || o.includes("gradient(") || o.includes("image-set(") || o.includes("cross-fade(") || o.includes("element(") || o.includes("paint(");
|
|
275
323
|
}
|
|
276
|
-
function
|
|
324
|
+
function $(t) {
|
|
277
325
|
return t.startsWith("--") ? `var(${t})` : t;
|
|
278
326
|
}
|
|
279
|
-
function
|
|
327
|
+
function Co(t, o) {
|
|
280
328
|
const {
|
|
281
329
|
as: i,
|
|
282
330
|
children: d,
|
|
283
331
|
className: a,
|
|
284
|
-
background:
|
|
285
|
-
backgroundColor:
|
|
286
|
-
bg:
|
|
287
|
-
bgSize:
|
|
288
|
-
bgRepeat:
|
|
289
|
-
bgGroup:
|
|
290
|
-
groupParent:
|
|
291
|
-
bgPosition:
|
|
292
|
-
border:
|
|
293
|
-
boxShadow:
|
|
294
|
-
color:
|
|
295
|
-
cursor:
|
|
296
|
-
opacity:
|
|
297
|
-
overflow:
|
|
298
|
-
overflowX:
|
|
332
|
+
background: s,
|
|
333
|
+
backgroundColor: c,
|
|
334
|
+
bg: n,
|
|
335
|
+
bgSize: e,
|
|
336
|
+
bgRepeat: g,
|
|
337
|
+
bgGroup: u,
|
|
338
|
+
groupParent: b,
|
|
339
|
+
bgPosition: m,
|
|
340
|
+
border: v,
|
|
341
|
+
boxShadow: B,
|
|
342
|
+
color: p,
|
|
343
|
+
cursor: y,
|
|
344
|
+
opacity: h,
|
|
345
|
+
overflow: E,
|
|
346
|
+
overflowX: G,
|
|
299
347
|
overflowY: z,
|
|
300
|
-
pointerEvents:
|
|
301
|
-
aspectRatio:
|
|
302
|
-
transform:
|
|
303
|
-
transformOrigin:
|
|
304
|
-
p:
|
|
305
|
-
m:
|
|
306
|
-
outlineColor:
|
|
307
|
-
outlineWidth:
|
|
308
|
-
outlineOffset:
|
|
309
|
-
outlineStyle:
|
|
348
|
+
pointerEvents: C,
|
|
349
|
+
aspectRatio: T,
|
|
350
|
+
transform: L,
|
|
351
|
+
transformOrigin: R,
|
|
352
|
+
p: P,
|
|
353
|
+
m: l,
|
|
354
|
+
outlineColor: w,
|
|
355
|
+
outlineWidth: N,
|
|
356
|
+
outlineOffset: V,
|
|
357
|
+
outlineStyle: j,
|
|
310
358
|
listStyle: I,
|
|
311
|
-
display:
|
|
312
|
-
position:
|
|
313
|
-
width:
|
|
314
|
-
maxWidth:
|
|
315
|
-
minWidth:
|
|
316
|
-
height:
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
359
|
+
display: O,
|
|
360
|
+
position: r,
|
|
361
|
+
width: M,
|
|
362
|
+
maxWidth: Z,
|
|
363
|
+
minWidth: q,
|
|
364
|
+
height: J,
|
|
365
|
+
hover: Q,
|
|
366
|
+
maxHeight: U,
|
|
367
|
+
minHeight: oo,
|
|
368
|
+
md: to,
|
|
369
|
+
lg: io,
|
|
370
|
+
xl: ro,
|
|
371
|
+
style: D,
|
|
372
|
+
...eo
|
|
373
|
+
} = t, no = i ?? "div", X = co({
|
|
374
|
+
hover: Q,
|
|
375
|
+
background: s,
|
|
376
|
+
backgroundColor: c,
|
|
377
|
+
bg: n,
|
|
378
|
+
bgSize: e,
|
|
379
|
+
bgRepeat: g,
|
|
380
|
+
bgGroup: u,
|
|
381
|
+
groupParent: b,
|
|
382
|
+
bgPosition: m,
|
|
383
|
+
border: v,
|
|
384
|
+
boxShadow: B,
|
|
385
|
+
color: p,
|
|
386
|
+
cursor: y,
|
|
387
|
+
opacity: h,
|
|
388
|
+
overflow: E,
|
|
389
|
+
overflowX: G,
|
|
340
390
|
overflowY: z,
|
|
341
|
-
pointerEvents:
|
|
342
|
-
aspectRatio:
|
|
343
|
-
transform:
|
|
344
|
-
transformOrigin:
|
|
345
|
-
p:
|
|
346
|
-
m:
|
|
347
|
-
outlineColor:
|
|
348
|
-
outlineWidth:
|
|
349
|
-
outlineOffset:
|
|
350
|
-
outlineStyle:
|
|
391
|
+
pointerEvents: C,
|
|
392
|
+
aspectRatio: T,
|
|
393
|
+
transform: L,
|
|
394
|
+
transformOrigin: R,
|
|
395
|
+
p: P,
|
|
396
|
+
m: l,
|
|
397
|
+
outlineColor: w,
|
|
398
|
+
outlineWidth: N,
|
|
399
|
+
outlineOffset: V,
|
|
400
|
+
outlineStyle: j,
|
|
351
401
|
listStyle: I,
|
|
352
|
-
display:
|
|
353
|
-
position:
|
|
354
|
-
width:
|
|
355
|
-
maxWidth:
|
|
356
|
-
minWidth:
|
|
357
|
-
height:
|
|
358
|
-
maxHeight:
|
|
359
|
-
minHeight:
|
|
360
|
-
md:
|
|
361
|
-
lg:
|
|
362
|
-
xl:
|
|
363
|
-
}),
|
|
402
|
+
display: O,
|
|
403
|
+
position: r,
|
|
404
|
+
width: M,
|
|
405
|
+
maxWidth: Z,
|
|
406
|
+
minWidth: q,
|
|
407
|
+
height: J,
|
|
408
|
+
maxHeight: U,
|
|
409
|
+
minHeight: oo,
|
|
410
|
+
md: to,
|
|
411
|
+
lg: io,
|
|
412
|
+
xl: ro
|
|
413
|
+
}), ao = X.style || D ? {
|
|
364
414
|
...X.style,
|
|
365
|
-
...
|
|
415
|
+
...D
|
|
366
416
|
} : void 0;
|
|
367
|
-
return /* @__PURE__ */
|
|
368
|
-
|
|
417
|
+
return /* @__PURE__ */ fo(
|
|
418
|
+
no,
|
|
369
419
|
{
|
|
370
|
-
className:
|
|
420
|
+
className: uo(X.className, b && "group", a),
|
|
371
421
|
ref: o,
|
|
372
|
-
style:
|
|
373
|
-
...
|
|
422
|
+
style: ao,
|
|
423
|
+
...eo,
|
|
374
424
|
children: d
|
|
375
425
|
}
|
|
376
426
|
);
|
|
377
427
|
}
|
|
378
|
-
const
|
|
428
|
+
const No = so(Co);
|
|
379
429
|
export {
|
|
380
|
-
|
|
430
|
+
No as Box
|
|
381
431
|
};
|