@shmidko61/lc-ui-kit 0.0.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.
- package/README.md +38 -0
- package/dist/accordion/accordion-context.d.ts +3 -0
- package/dist/accordion/accordion-item.d.ts +48 -0
- package/dist/accordion/accordion-root.d.ts +5 -0
- package/dist/accordion/accordion.d.ts +8 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.js +206 -0
- package/dist/arrow-CS6d64Y4.cjs +1 -0
- package/dist/arrow-DBc2opRL.js +5 -0
- package/dist/box/box.d.ts +7 -0
- package/dist/box/box.helpers.d.ts +11 -0
- package/dist/box/box.types.d.ts +62 -0
- package/dist/box.cjs +1 -0
- package/dist/box.js +342 -0
- package/dist/button/button.d.ts +22 -0
- package/dist/button/button.helpers.d.ts +119 -0
- package/dist/button.cjs +1 -0
- package/dist/button.js +438 -0
- package/dist/design-tokens/color.tokens.d.ts +6 -0
- package/dist/design-tokens/typography.tokens.d.ts +9 -0
- package/dist/drop-down-CdIuWbLC.cjs +1 -0
- package/dist/drop-down-DH2_3qXq.js +5 -0
- package/dist/eye-open-5zYaeyLp.cjs +1 -0
- package/dist/eye-open-CoTSj5cT.js +5 -0
- package/dist/flex/flex.d.ts +5 -0
- package/dist/flex/flex.helpers.d.ts +9 -0
- package/dist/flex/flex.types.d.ts +12 -0
- package/dist/flex.cjs +1 -0
- package/dist/flex.js +128 -0
- package/dist/grid/grid.d.ts +25 -0
- package/dist/grid/grid.helpers.d.ts +13 -0
- package/dist/grid/grid.types.d.ts +49 -0
- package/dist/grid.cjs +1 -0
- package/dist/grid.js +103 -0
- package/dist/icons/icons.d.ts +30 -0
- package/dist/icons.cjs +1 -0
- package/dist/icons.js +38 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +97 -0
- package/dist/input/input.d.ts +49 -0
- package/dist/input/input.helpers.d.ts +9 -0
- package/dist/input.cjs +1 -0
- package/dist/input.js +85 -0
- package/dist/media-card/components/media-card-pick-indicator.d.ts +6 -0
- package/dist/media-card/components/media-card-preview.d.ts +7 -0
- package/dist/media-card/components/media-card-upload-footer.d.ts +7 -0
- package/dist/media-card/components/media-card-upload.d.ts +5 -0
- package/dist/media-card/media-card-pick.d.ts +5 -0
- package/dist/media-card/media-card.d.ts +4 -0
- package/dist/media-card/media-card.types.d.ts +10 -0
- package/dist/media-card.cjs +1 -0
- package/dist/media-card.js +104 -0
- package/dist/media-gallery/media-gallery.d.ts +12 -0
- package/dist/media-gallery/media-gallery.helpers.d.ts +27 -0
- package/dist/media-gallery/media-gallery.types.d.ts +59 -0
- package/dist/media-gallery.cjs +1 -0
- package/dist/media-gallery.js +100 -0
- package/dist/media-picture-BN4saEVT.js +6 -0
- package/dist/media-picture-BmERSmsd.cjs +1 -0
- package/dist/modal/modal.d.ts +50 -0
- package/dist/modal.cjs +1 -0
- package/dist/modal.js +143 -0
- package/dist/pagination/pagination.d.ts +22 -0
- package/dist/pagination.cjs +1 -0
- package/dist/pagination.js +155 -0
- package/dist/picture/picture.d.ts +12 -0
- package/dist/picture/picture.helpers.d.ts +9 -0
- package/dist/picture/picture.types.d.ts +56 -0
- package/dist/picture.cjs +1 -0
- package/dist/picture.js +55 -0
- package/dist/responsive-style.config-B2m9jVlX.cjs +1 -0
- package/dist/responsive-style.config-DFuATrIM.js +19 -0
- package/dist/responsive-style.utils-BdyoDkKg.cjs +1 -0
- package/dist/responsive-style.utils-D10sC561.js +25 -0
- package/dist/select/select.d.ts +55 -0
- package/dist/select/select.helpers.d.ts +14 -0
- package/dist/select/select.types.d.ts +12 -0
- package/dist/select.cjs +1 -0
- package/dist/select.js +179 -0
- package/dist/shared/lib/cn.d.ts +2 -0
- package/dist/shared/responsive-style/responsive-style.config.d.ts +20 -0
- package/dist/shared/responsive-style/responsive-style.types.d.ts +52 -0
- package/dist/shared/responsive-style/responsive-style.utils.d.ts +17 -0
- package/dist/status-badge/status-badge.d.ts +11 -0
- package/dist/status-badge.cjs +1 -0
- package/dist/status-badge.js +39 -0
- package/dist/styles.css +1 -0
- package/dist/switch/switch.d.ts +34 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.js +127 -0
- package/dist/table/data-table.d.ts +3 -0
- package/dist/table/table-container.d.ts +8 -0
- package/dist/table/table-primitives.d.ts +40 -0
- package/dist/table/table-status.d.ts +12 -0
- package/dist/table/table.d.ts +8 -0
- package/dist/table/table.types.d.ts +48 -0
- package/dist/table-container-BsE-uIE1.js +242 -0
- package/dist/table-container-DqqqkChm.cjs +1 -0
- package/dist/table.cjs +1 -0
- package/dist/table.js +16 -0
- package/dist/telephone-DVftjRG9.cjs +1 -0
- package/dist/telephone-DvXakgBQ.js +26 -0
- package/dist/time-clock-DOwPzcx7.cjs +1 -0
- package/dist/time-clock-DjqcZ8tI.js +5 -0
- package/dist/types/flex.types.d.ts +25 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/interaction.types.d.ts +8 -0
- package/dist/types/layout.types.d.ts +52 -0
- package/dist/types/shared.types.d.ts +8 -0
- package/dist/types/spacing.types.d.ts +123 -0
- package/dist/types/typography.types.d.ts +75 -0
- package/dist/types/visual.types.d.ts +82 -0
- package/dist/types.cjs +1 -0
- package/dist/types.js +1 -0
- package/dist/typography/typography.d.ts +39 -0
- package/dist/typography/typography.helpers.d.ts +237 -0
- package/dist/typography.cjs +1 -0
- package/dist/typography.js +469 -0
- package/dist/ui-kit-provider/ui-kit-provider.d.ts +53 -0
- package/dist/ui-kit-provider-C6Mk5g_7.js +167 -0
- package/dist/ui-kit-provider-raEFsUm0.cjs +1 -0
- package/dist/ui-kit-provider.cjs +1 -0
- package/dist/ui-kit-provider.js +8 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/x-mark-DId-ylR6.cjs +1 -0
- package/dist/x-mark-WU1eT82T.js +5 -0
- package/package.json +219 -0
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @shmidko61/lc-ui-kit
|
|
2
|
+
|
|
3
|
+
Переиспользуемый React UI kit для LC-приложений.
|
|
4
|
+
|
|
5
|
+
## Установка
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @shmidko61/lc-ui-kit
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Подключение стилей
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import '@shmidko61/lc-ui-kit/styles.css';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Импорты
|
|
18
|
+
|
|
19
|
+
В React Server Components импортируйте компоненты через subpath exports:
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { Picture } from '@shmidko61/lc-ui-kit/picture';
|
|
23
|
+
import { Typography } from '@shmidko61/lc-ui-kit/typography';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Root import удобен в client-only модулях, Storybook, тестах или приложениях без RSC:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
'use client';
|
|
30
|
+
|
|
31
|
+
import { Button, Select } from '@shmidko61/lc-ui-kit';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
В Next.js App Router не используйте `import { Component } from '@shmidko61/lc-ui-kit'`
|
|
35
|
+
в server component: root export содержит и server-safe, и client-only компоненты,
|
|
36
|
+
поэтому может потянуть `createContext`, `useState` или event handlers в RSC-граф.
|
|
37
|
+
|
|
38
|
+
Примеры по компонентам: [docs/component-usage.md](./docs/component-usage.md).
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ComponentType, JSX, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { BoxProps } from '../box/box';
|
|
3
|
+
type AccordionItemHeaderProps = Omit<Partial<BoxProps<'button'>>, 'as' | 'children' | 'disabled' | 'display' | 'id' | 'role' | 'title' | 'type'>;
|
|
4
|
+
type AccordionItemBoxProps = Omit<Partial<BoxProps>, 'as' | 'children'>;
|
|
5
|
+
type AccordionItemContentProps = Omit<Partial<BoxProps>, 'as' | 'children' | 'id' | 'role'>;
|
|
6
|
+
type AccordionIndicatorProps = Omit<Partial<BoxProps<'span'>>, 'as' | 'children'>;
|
|
7
|
+
export type AccordionItemRenderProps = {
|
|
8
|
+
/** Содержимое заголовка item. */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export type AccordionItemProps = PropsWithChildren<AccordionItemHeaderProps & {
|
|
12
|
+
/** Уникальный id item для controlled-состояния `expandedKeys`. */
|
|
13
|
+
id?: string | number;
|
|
14
|
+
/** Заголовок раскрываемого блока. */
|
|
15
|
+
title: ReactNode;
|
|
16
|
+
/** Дополнительная строка под заголовком. */
|
|
17
|
+
subtitle?: ReactNode;
|
|
18
|
+
/** Контент перед текстом заголовка: иконка, номер, маркер. */
|
|
19
|
+
leading?: ReactNode;
|
|
20
|
+
/** Контент между текстом и indicator: badge, статус, счетчик. */
|
|
21
|
+
trailing?: ReactNode;
|
|
22
|
+
/** Кастомный indicator справа. */
|
|
23
|
+
indicator?: ReactNode;
|
|
24
|
+
/** Props wrapper-а indicator справа: размер, фон, border, className и style. */
|
|
25
|
+
indicatorProps?: AccordionIndicatorProps;
|
|
26
|
+
/** Скрывает indicator, если раскрытие показывается другим элементом. */
|
|
27
|
+
hideIndicator?: boolean;
|
|
28
|
+
/** Отключает конкретный item. */
|
|
29
|
+
isDisabled?: boolean;
|
|
30
|
+
/** Controlled-состояние конкретного item поверх group state. */
|
|
31
|
+
isExpanded?: boolean;
|
|
32
|
+
/** Callback изменения состояния конкретного item. */
|
|
33
|
+
onToggle?: (isExpanded: boolean) => void;
|
|
34
|
+
/** Визуальный вариант заголовка. */
|
|
35
|
+
variant?: 'primary' | 'secondary';
|
|
36
|
+
/** Визуальная поверхность item: card задает общий фон, plain оставляет старый прозрачный контейнер. */
|
|
37
|
+
surface?: 'card' | 'plain';
|
|
38
|
+
/** Длительность анимации panel в ms. */
|
|
39
|
+
duration?: number;
|
|
40
|
+
/** Кастомная раскладка содержимого заголовка. */
|
|
41
|
+
headingWrapper?: ComponentType<AccordionItemRenderProps>;
|
|
42
|
+
/** Props внешнего контейнера item. */
|
|
43
|
+
itemProps?: AccordionItemBoxProps;
|
|
44
|
+
/** Props panel с раскрываемым контентом. */
|
|
45
|
+
contentProps?: AccordionItemContentProps;
|
|
46
|
+
}>;
|
|
47
|
+
export declare function AccordionItem({ children, className, contentProps, duration, headingWrapper: HeadingWrapper, hideIndicator, id, indicator, indicatorProps, isDisabled, isExpanded, itemProps, leading, onToggle, subtitle, surface, title, trailing, variant, ...headerProps }: AccordionItemProps): JSX.Element;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JSX, PropsWithChildren } from 'react';
|
|
2
|
+
import { DisclosureGroupProps } from 'react-stately/useDisclosureGroupState';
|
|
3
|
+
import { FlexProps } from '../flex/flex';
|
|
4
|
+
export type AccordionProps = PropsWithChildren<DisclosureGroupProps & Omit<FlexProps, 'children' | 'defaultValue' | 'onChange'>>;
|
|
5
|
+
export declare function AccordionRoot({ allowsMultipleExpanded, children, defaultExpandedKeys, expandedKeys, isDisabled, onExpandedChange, ...props }: AccordionProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AccordionItem } from './accordion-item';
|
|
2
|
+
import { AccordionRoot } from './accordion-root';
|
|
3
|
+
export declare const Accordion: typeof AccordionRoot & {
|
|
4
|
+
Item: typeof AccordionItem;
|
|
5
|
+
};
|
|
6
|
+
export { AccordionItem, AccordionRoot };
|
|
7
|
+
export type { AccordionItemProps } from './accordion-item';
|
|
8
|
+
export type { AccordionProps } from './accordion-root';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),j=require("react-aria"),P=require("react-stately/useDisclosureState"),n=require("./box.cjs"),l=require("./flex.cjs"),ee=require("./drop-down-CdIuWbLC.cjs"),u=require("./responsive-style.config-B2m9jVlX.cjs"),E=require("./typography.cjs"),te=require("react-stately/useDisclosureGroupState"),R=i.createContext(null);function ne(){const t=i.useContext(R);if(!t)throw new Error("Accordion.Item должен использоваться внутри Accordion.");return t}function se({children:t}){return e.jsx(l.Flex,{align:"center",gap:16,justify:"space-between",width:"100%",children:t})}function k({children:t,className:x,contentProps:a,duration:d=200,headingWrapper:p=se,hideIndicator:g=!1,id:f,indicator:y,indicatorProps:s,isDisabled:I=!1,isExpanded:_,itemProps:r,leading:w,onToggle:F,subtitle:S,surface:m="card",title:W,trailing:D,variant:N="primary",...b}){const G=i.useId(),h=f??G,v=ne(),K=String(h),T=v.expandedKeys.has(h),O=_??T,c=v.isDisabled||I,A=i.useRef(null),B=i.useRef(null),o=P.useDisclosureState({isExpanded:O,onExpandedChange:Z=>{c||(v.toggleKey(h),F?.(Z))}}),{buttonProps:Y,panelProps:q}=j.useDisclosure({isDisabled:c},o,A),{buttonProps:$}=j.useButton(Y,B),z=a?.className,H=a?.style,M=q.style,J=r?.bg??(m==="card"?"--color-background-default":void 0),L=m==="card"?{radius:"16px",style:"none",width:"0",...r?.border}:r?.border,Q=r?.className,U=r?.style,V=b.style,X={...M,height:"var(--disclosure-panel-height)",opacity:o.isExpanded?1:0,transitionDuration:`${d}ms`,...H};return e.jsxs(n.Box,{"data-disabled":c||void 0,"data-state":o.isExpanded?"open":"closed","data-value":K,...r,bg:J,border:L,className:u.cn("grid min-w-0",m==="card"?"gap-0 overflow-hidden":"gap-[24px]",c&&"opacity-50",Q),style:U,children:[e.jsx(n.Box,{...j.mergeProps($,b),as:"button",border:{radius:"16px",style:"none",width:"0",...b.border},className:u.cn("group/accordion-trigger w-full text-left outline-none transition-colors disabled:cursor-not-allowed","focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--color-primary-accent)_35%,transparent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-background-default)]",N==="primary"&&"bg-[var(--color-background-default)]",N==="secondary"&&"bg-transparent",x),cursor:c?"not-allowed":"pointer","data-state":o.isExpanded?"open":"closed",p:24,ref:B,style:V,type:"button",children:e.jsxs(p,{children:[e.jsxs(l.Flex,{align:"center",gap:16,minWidth:0,children:[w?e.jsx(n.Box,{as:"span",className:"flex shrink-0 items-center justify-center text-[var(--color-text-primary)] [&_svg]:size-[20px]",children:w}):null,e.jsxs(l.Flex,{flexDirection:"column",gap:8,minWidth:0,children:[e.jsx(E.Typography,{as:"span",className:"truncate",variant:"h4",children:W}),S?e.jsx(E.Typography,{as:"span",className:"truncate",color:"--color-text-secondary",variant:"b2",children:S}):null]})]}),e.jsxs(l.Flex,{align:"center",gap:12,shrink:0,children:[D?e.jsx(n.Box,{as:"span",children:D}):null,g?null:e.jsx(n.Box,{...s,as:"span",bg:s?.bg??"--color-background-default",border:s?.border??{radius:"8px"},style:s?.style,className:u.cn(s?"flex items-center justify-center":"flex min-h-[41px] min-w-[41px] items-center justify-center text-[var(--color-text-primary)] transition-colors group-hover/accordion-trigger:bg-[color-mix(in_srgb,var(--color-background-default)_90%,#000)]",s?.className),children:y??e.jsx(ee.SvgDropDown,{"aria-hidden":"true",className:"h-[12px] w-[12px] transition-transform",style:{transform:o.isExpanded?"translateY(-2px) rotate(180deg)":"translateY(2px) rotate(0deg)",transitionDuration:`${d}ms`}})})]})]})}),e.jsx(n.Box,{...q,...a,className:u.cn("overflow-hidden text-[var(--color-text-secondary)] transition-[height,opacity]",z),"data-state":o.isExpanded?"open":"closed",ref:A,style:X,children:e.jsx(n.Box,{p:{px:24,pb:24},children:t})})]})}function C({allowsMultipleExpanded:t=!1,children:x,defaultExpandedKeys:a,expandedKeys:d,isDisabled:p=!1,onExpandedChange:g,...f}){const y=te.useDisclosureGroupState({allowsMultipleExpanded:t,defaultExpandedKeys:a,expandedKeys:d,isDisabled:p,onExpandedChange:g});return e.jsx(R.Provider,{value:y,children:e.jsx(l.Flex,{flexDirection:"column",gap:24,width:"100%",...f,children:x})})}const re=Object.assign(C,{Item:k});exports.Accordion=re;exports.AccordionItem=k;exports.AccordionRoot=C;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as X, useContext as Z, useId as P, useRef as k } from "react";
|
|
3
|
+
import { useDisclosure as ee, useButton as te, mergeProps as re } from "react-aria";
|
|
4
|
+
import { useDisclosureState as oe } from "react-stately/useDisclosureState";
|
|
5
|
+
import { Box as r } from "./box.js";
|
|
6
|
+
import { Flex as l } from "./flex.js";
|
|
7
|
+
import { S as ne } from "./drop-down-DH2_3qXq.js";
|
|
8
|
+
import { c as u } from "./responsive-style.config-DFuATrIM.js";
|
|
9
|
+
import { Typography as C } from "./typography.js";
|
|
10
|
+
import { useDisclosureGroupState as se } from "react-stately/useDisclosureGroupState";
|
|
11
|
+
const B = X(null);
|
|
12
|
+
function ae() {
|
|
13
|
+
const t = Z(B);
|
|
14
|
+
if (!t)
|
|
15
|
+
throw new Error("Accordion.Item должен использоваться внутри Accordion.");
|
|
16
|
+
return t;
|
|
17
|
+
}
|
|
18
|
+
function ie({
|
|
19
|
+
children: t
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ e(l, { align: "center", gap: 16, justify: "space-between", width: "100%", children: t });
|
|
22
|
+
}
|
|
23
|
+
function ce({
|
|
24
|
+
children: t,
|
|
25
|
+
className: p,
|
|
26
|
+
contentProps: a,
|
|
27
|
+
duration: d = 200,
|
|
28
|
+
headingWrapper: m = ie,
|
|
29
|
+
hideIndicator: f = !1,
|
|
30
|
+
id: g,
|
|
31
|
+
indicator: x,
|
|
32
|
+
indicatorProps: o,
|
|
33
|
+
isDisabled: I = !1,
|
|
34
|
+
isExpanded: _,
|
|
35
|
+
itemProps: n,
|
|
36
|
+
leading: w,
|
|
37
|
+
onToggle: R,
|
|
38
|
+
subtitle: N,
|
|
39
|
+
surface: y = "card",
|
|
40
|
+
title: W,
|
|
41
|
+
trailing: D,
|
|
42
|
+
variant: S = "primary",
|
|
43
|
+
...b
|
|
44
|
+
}) {
|
|
45
|
+
const K = P(), h = g ?? K, v = ae(), G = String(h), Y = v.expandedKeys.has(h), $ = _ ?? Y, i = v.isDisabled || I, A = k(null), E = k(null), s = oe({
|
|
46
|
+
isExpanded: $,
|
|
47
|
+
onExpandedChange: (V) => {
|
|
48
|
+
i || (v.toggleKey(h), R?.(V));
|
|
49
|
+
}
|
|
50
|
+
}), { buttonProps: z, panelProps: j } = ee(
|
|
51
|
+
{ isDisabled: i },
|
|
52
|
+
s,
|
|
53
|
+
A
|
|
54
|
+
), { buttonProps: F } = te(z, E), H = a?.className, O = a?.style, T = j.style, q = n?.bg ?? (y === "card" ? "--color-background-default" : void 0), J = y === "card" ? {
|
|
55
|
+
radius: "16px",
|
|
56
|
+
style: "none",
|
|
57
|
+
width: "0",
|
|
58
|
+
...n?.border
|
|
59
|
+
} : n?.border, L = n?.className, M = n?.style, Q = b.style, U = {
|
|
60
|
+
...T,
|
|
61
|
+
height: "var(--disclosure-panel-height)",
|
|
62
|
+
opacity: s.isExpanded ? 1 : 0,
|
|
63
|
+
transitionDuration: `${d}ms`,
|
|
64
|
+
...O
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ c(
|
|
67
|
+
r,
|
|
68
|
+
{
|
|
69
|
+
"data-disabled": i || void 0,
|
|
70
|
+
"data-state": s.isExpanded ? "open" : "closed",
|
|
71
|
+
"data-value": G,
|
|
72
|
+
...n,
|
|
73
|
+
bg: q,
|
|
74
|
+
border: J,
|
|
75
|
+
className: u(
|
|
76
|
+
"grid min-w-0",
|
|
77
|
+
y === "card" ? "gap-0 overflow-hidden" : "gap-[24px]",
|
|
78
|
+
i && "opacity-50",
|
|
79
|
+
L
|
|
80
|
+
),
|
|
81
|
+
style: M,
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ e(
|
|
84
|
+
r,
|
|
85
|
+
{
|
|
86
|
+
...re(F, b),
|
|
87
|
+
as: "button",
|
|
88
|
+
border: {
|
|
89
|
+
radius: "16px",
|
|
90
|
+
style: "none",
|
|
91
|
+
width: "0",
|
|
92
|
+
...b.border
|
|
93
|
+
},
|
|
94
|
+
className: u(
|
|
95
|
+
"group/accordion-trigger w-full text-left outline-none transition-colors disabled:cursor-not-allowed",
|
|
96
|
+
"focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--color-primary-accent)_35%,transparent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-background-default)]",
|
|
97
|
+
S === "primary" && "bg-[var(--color-background-default)]",
|
|
98
|
+
S === "secondary" && "bg-transparent",
|
|
99
|
+
p
|
|
100
|
+
),
|
|
101
|
+
cursor: i ? "not-allowed" : "pointer",
|
|
102
|
+
"data-state": s.isExpanded ? "open" : "closed",
|
|
103
|
+
p: 24,
|
|
104
|
+
ref: E,
|
|
105
|
+
style: Q,
|
|
106
|
+
type: "button",
|
|
107
|
+
children: /* @__PURE__ */ c(m, { children: [
|
|
108
|
+
/* @__PURE__ */ c(l, { align: "center", gap: 16, minWidth: 0, children: [
|
|
109
|
+
w ? /* @__PURE__ */ e(
|
|
110
|
+
r,
|
|
111
|
+
{
|
|
112
|
+
as: "span",
|
|
113
|
+
className: "flex shrink-0 items-center justify-center text-[var(--color-text-primary)] [&_svg]:size-[20px]",
|
|
114
|
+
children: w
|
|
115
|
+
}
|
|
116
|
+
) : null,
|
|
117
|
+
/* @__PURE__ */ c(l, { flexDirection: "column", gap: 8, minWidth: 0, children: [
|
|
118
|
+
/* @__PURE__ */ e(C, { as: "span", className: "truncate", variant: "h4", children: W }),
|
|
119
|
+
N ? /* @__PURE__ */ e(
|
|
120
|
+
C,
|
|
121
|
+
{
|
|
122
|
+
as: "span",
|
|
123
|
+
className: "truncate",
|
|
124
|
+
color: "--color-text-secondary",
|
|
125
|
+
variant: "b2",
|
|
126
|
+
children: N
|
|
127
|
+
}
|
|
128
|
+
) : null
|
|
129
|
+
] })
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ c(l, { align: "center", gap: 12, shrink: 0, children: [
|
|
132
|
+
D ? /* @__PURE__ */ e(r, { as: "span", children: D }) : null,
|
|
133
|
+
f ? null : /* @__PURE__ */ e(
|
|
134
|
+
r,
|
|
135
|
+
{
|
|
136
|
+
...o,
|
|
137
|
+
as: "span",
|
|
138
|
+
bg: o?.bg ?? "--color-background-default",
|
|
139
|
+
border: o?.border ?? { radius: "8px" },
|
|
140
|
+
style: o?.style,
|
|
141
|
+
className: u(
|
|
142
|
+
o ? "flex items-center justify-center" : "flex min-h-[41px] min-w-[41px] items-center justify-center text-[var(--color-text-primary)] transition-colors group-hover/accordion-trigger:bg-[color-mix(in_srgb,var(--color-background-default)_90%,#000)]",
|
|
143
|
+
o?.className
|
|
144
|
+
),
|
|
145
|
+
children: x ?? /* @__PURE__ */ e(
|
|
146
|
+
ne,
|
|
147
|
+
{
|
|
148
|
+
"aria-hidden": "true",
|
|
149
|
+
className: "h-[12px] w-[12px] transition-transform",
|
|
150
|
+
style: {
|
|
151
|
+
transform: s.isExpanded ? "translateY(-2px) rotate(180deg)" : "translateY(2px) rotate(0deg)",
|
|
152
|
+
transitionDuration: `${d}ms`
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
] })
|
|
159
|
+
] })
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
/* @__PURE__ */ e(
|
|
163
|
+
r,
|
|
164
|
+
{
|
|
165
|
+
...j,
|
|
166
|
+
...a,
|
|
167
|
+
className: u(
|
|
168
|
+
"overflow-hidden text-[var(--color-text-secondary)] transition-[height,opacity]",
|
|
169
|
+
H
|
|
170
|
+
),
|
|
171
|
+
"data-state": s.isExpanded ? "open" : "closed",
|
|
172
|
+
ref: A,
|
|
173
|
+
style: U,
|
|
174
|
+
children: /* @__PURE__ */ e(r, { p: { px: 24, pb: 24 }, children: t })
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
function le({
|
|
182
|
+
allowsMultipleExpanded: t = !1,
|
|
183
|
+
children: p,
|
|
184
|
+
defaultExpandedKeys: a,
|
|
185
|
+
expandedKeys: d,
|
|
186
|
+
isDisabled: m = !1,
|
|
187
|
+
onExpandedChange: f,
|
|
188
|
+
...g
|
|
189
|
+
}) {
|
|
190
|
+
const x = se({
|
|
191
|
+
allowsMultipleExpanded: t,
|
|
192
|
+
defaultExpandedKeys: a,
|
|
193
|
+
expandedKeys: d,
|
|
194
|
+
isDisabled: m,
|
|
195
|
+
onExpandedChange: f
|
|
196
|
+
});
|
|
197
|
+
return /* @__PURE__ */ e(B.Provider, { value: x, children: /* @__PURE__ */ e(l, { flexDirection: "column", gap: 24, width: "100%", ...g, children: p }) });
|
|
198
|
+
}
|
|
199
|
+
const ve = Object.assign(le, {
|
|
200
|
+
Item: ce
|
|
201
|
+
});
|
|
202
|
+
export {
|
|
203
|
+
ve as Accordion,
|
|
204
|
+
ce as AccordionItem,
|
|
205
|
+
le as AccordionRoot
|
|
206
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("react");function a(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const c=a(o),l=e=>c.createElement("svg",{width:12,height:9,viewBox:"0 0 12 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M1.56962 3.90496L4.45882 1.01583C4.69121 0.783451 4.69121 0.406671 4.45882 0.174287C4.22644 -0.0580963 3.84966 -0.0580963 3.61727 0.174287L0.501241 3.29032C-0.166871 3.95843 -0.16687 5.04157 0.501241 5.70968L3.61727 8.82572C3.84966 9.05809 4.22644 9.05809 4.45882 8.82572C4.69121 8.59334 4.69121 8.21658 4.45882 7.9842L1.56962 5.09504L10.5153 5.09504C10.8439 5.09504 11.1104 4.82862 11.1104 4.5C11.1104 4.17138 10.8439 3.90496 10.5153 3.90496L1.56962 3.90496Z",fill:"#152237"}));exports.SvgArrow=l;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const o = (t) => /* @__PURE__ */ e.createElement("svg", { width: 12, height: 9, viewBox: "0 0 12 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M1.56962 3.90496L4.45882 1.01583C4.69121 0.783451 4.69121 0.406671 4.45882 0.174287C4.22644 -0.0580963 3.84966 -0.0580963 3.61727 0.174287L0.501241 3.29032C-0.166871 3.95843 -0.16687 5.04157 0.501241 5.70968L3.61727 8.82572C3.84966 9.05809 4.22644 9.05809 4.45882 8.82572C4.69121 8.59334 4.69121 8.21658 4.45882 7.9842L1.56962 5.09504L10.5153 5.09504C10.8439 5.09504 11.1104 4.82862 11.1104 4.5C11.1104 4.17138 10.8439 3.90496 10.5153 3.90496L1.56962 3.90496Z", fill: "#152237" }));
|
|
3
|
+
export {
|
|
4
|
+
o as S
|
|
5
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JSX, Ref } from 'react';
|
|
2
|
+
import { BoxAs, BoxProps } from './box.types';
|
|
3
|
+
export declare const Box: <TAs extends BoxAs = "div">(props: BoxProps<TAs> & {
|
|
4
|
+
ref?: Ref<Element>;
|
|
5
|
+
}) => JSX.Element;
|
|
6
|
+
export type { BoxAs, BoxBackgroundValue, BoxBreakpointProps, BoxProps } from './box.types';
|
|
7
|
+
export type { BorderRadiusItem, BorderRadiusKeys, BorderRadiusSides, BorderWidthItem, BorderWidthSides, PositionValue, UiKitAnyIndentationMargin, UiKitAnyIndentationPadding, UiKitArrayIndentation, UiKitAxisIndentationMargin, UiKitAxisIndentationPadding, UiKitDimensionProps, UiKitIndentations, UiKitIndentationsProps, UiKitMarginArrayIndentation, UiKitMarginIndentation, UiKitBackgroundProps, UiKitBorderColor, UiKitBorderProps, UiKitBorderRadius, UiKitBorderWidth, UiKitCursorProps, UiKitDisplayProps, UiKitListStyleProps, UiKitMixedXAxisIndentationMargin, UiKitMixedXAxisIndentationPadding, UiKitMixedYAxisIndentationMargin, UiKitMixedYAxisIndentationPadding, UiKitOutlineProps, UiKitPositionProps, } from '../types';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { ResponsiveStyleBreakpoint } from '../shared/responsive-style/responsive-style.types';
|
|
3
|
+
import { BoxBreakpointProps } from './box.types';
|
|
4
|
+
export type BoxStyleBuildProps = BoxBreakpointProps & Partial<Record<ResponsiveStyleBreakpoint, BoxBreakpointProps>>;
|
|
5
|
+
export type BoxTailwindClassNamePlan = {
|
|
6
|
+
/** Готовая строка Tailwind-классов для style props. */
|
|
7
|
+
className: string;
|
|
8
|
+
/** CSS-переменные, которые читают Tailwind arbitrary utilities. */
|
|
9
|
+
style: CSSProperties | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare function buildBoxTailwindClassNamePlan(props: BoxStyleBuildProps): BoxTailwindClassNamePlan;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
|
|
2
|
+
import { ResponsiveStyleBreakpoint } from '../shared/responsive-style/responsive-style.types';
|
|
3
|
+
import { UiKitBackgroundProps, UiKitBackgroundValue, UiKitBorderProps, UiKitCursorProps, UiKitDimensionProps, UiKitIndentationsProps, UiKitDisplayProps, UiKitListStyleProps, UiKitOutlineProps, UiKitPositionProps } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Допустимые HTML-теги для Box.
|
|
6
|
+
*
|
|
7
|
+
* Box остаётся layout primitive, но `as` может быть как нативным HTML-тегом,
|
|
8
|
+
* так и проектным React-компонентом, например router-aware Link из
|
|
9
|
+
* `UiKitProvider`.
|
|
10
|
+
*/
|
|
11
|
+
export type BoxAs = ElementType;
|
|
12
|
+
/**
|
|
13
|
+
* CSS-значение цвета/фона.
|
|
14
|
+
*
|
|
15
|
+
* Можно передать дизайн-токен цвета (`--color-background-subtle`) или прямое
|
|
16
|
+
* CSS-значение: hex, rgb, rgba, hsl, hsla, `var(...)`, `color-mix(...)`,
|
|
17
|
+
* gradient, `url(...)` или полный background shorthand.
|
|
18
|
+
*/
|
|
19
|
+
export type BoxBackgroundValue = UiKitBackgroundValue;
|
|
20
|
+
/**
|
|
21
|
+
* Стилевые props, общие для base-состояния и responsive overrides.
|
|
22
|
+
*/
|
|
23
|
+
export type BoxStyleProps = UiKitDisplayProps & UiKitPositionProps & UiKitBackgroundProps & UiKitCursorProps & UiKitIndentationsProps & UiKitOutlineProps & UiKitListStyleProps & UiKitDimensionProps;
|
|
24
|
+
/**
|
|
25
|
+
* Собственные стилевые props Box поверх общих контрактов ui-kit.
|
|
26
|
+
*/
|
|
27
|
+
export type BoxOwnStyleProps = {
|
|
28
|
+
/** Border-настройки элемента. */
|
|
29
|
+
border?: UiKitBorderProps;
|
|
30
|
+
/** Background shorthand элемента. */
|
|
31
|
+
background?: BoxBackgroundValue;
|
|
32
|
+
/** Цвет фона элемента. */
|
|
33
|
+
backgroundColor?: BoxBackgroundValue;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Набор props для одного responsive-состояния.
|
|
37
|
+
*/
|
|
38
|
+
export type BoxBreakpointProps = BoxStyleProps & BoxOwnStyleProps;
|
|
39
|
+
/**
|
|
40
|
+
* Responsive overrides Box.
|
|
41
|
+
*/
|
|
42
|
+
type BoxResponsiveProps = Partial<Record<ResponsiveStyleBreakpoint, BoxBreakpointProps>>;
|
|
43
|
+
/**
|
|
44
|
+
* Собственные props Box без нативных HTML-атрибутов.
|
|
45
|
+
*/
|
|
46
|
+
export type BoxOwnProps = BoxBreakpointProps & BoxResponsiveProps & {
|
|
47
|
+
/** HTML-тег, которым будет отрендерен Box. По умолчанию `div`. */
|
|
48
|
+
as?: BoxAs;
|
|
49
|
+
children?: ReactNode;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Props Box.
|
|
53
|
+
*
|
|
54
|
+
* Верхний уровень задаёт base/sm размеры. `md`, `lg`, `xl` задают overrides для
|
|
55
|
+
* соответствующих breakpoint-ов из общего responsive config ui-kit. Тип
|
|
56
|
+
* полиморфен по `as`: для `as="a"` доступны `href`, `target`, `rel`, а для
|
|
57
|
+
* `as="button"` доступны `disabled`, `type`, `form`.
|
|
58
|
+
*/
|
|
59
|
+
export type BoxProps<TAs extends BoxAs = 'div'> = BoxOwnProps & Omit<ComponentPropsWithoutRef<TAs>, keyof BoxOwnProps | 'as' | 'children'> & {
|
|
60
|
+
as?: TAs;
|
|
61
|
+
};
|
|
62
|
+
export {};
|
package/dist/box.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),F=require("react"),j=require("./responsive-style.config-B2m9jVlX.cjs");function J({background:t,backgroundColor:o,bg:i,bgSize:d,bgRepeat:f,bgPosition:a,border:h,cursor:u,p:s,m,outlineColor:l,outlineWidth:c,outlineOffset:b,outlineStyle:v,listStyle:p,display:y,position:r,width:R,maxWidth:x,minWidth:k,height:S,maxHeight:z,minHeight:W}){const e={};return i!==void 0?lo(e,i):t!==void 0&&(e.background=T(t)),o!==void 0&&(e.backgroundColor=T(o)),d!==void 0&&(e.backgroundSize=ao(d)),f!==void 0&&(e.backgroundRepeat=co(f)),a!==void 0&&(e.backgroundPosition=so(a)),io(e,h),u!==void 0&&(e.cursor=u),oo(e,s),to(e,m),l!==void 0&&(e.outlineColor=N(l)),c!==void 0&&(e.outlineWidth=c),b!==void 0&&(e.outlineOffset=b),v!==void 0&&(e.outlineStyle=v),p?.position!==void 0&&(e.listStylePosition=p.position),p?.type!==void 0&&(e.listStyleType=p.type),y!==void 0&&(e.display=fo(y)),r?.type!==void 0&&(e.position=r.type),r?.top!==void 0&&(e.top=C(r.top)),r?.left!==void 0&&(e.left=C(r.left)),r?.right!==void 0&&(e.right=C(r.right)),r?.bottom!==void 0&&(e.bottom=C(r.bottom)),r?.zIndex!==void 0&&(e.zIndex=r.zIndex),R!==void 0&&(e.width=g(R)),x!==void 0&&(e.maxWidth=g(x)),k!==void 0&&(e.minWidth=g(k)),S!==void 0&&(e.height=g(S)),z!==void 0&&(e.maxHeight=g(z)),W!==void 0&&(e.minHeight=g(W)),Object.keys(e).length>0?e:void 0}function Q(t){const o=[],i={},d=t.groupParent===!0;P(t,o,i,"","",d);for(const f of j.responsiveBreakpoints){const a=t[f];a&&P(a,o,i,`${f}:`,`${f}-`,d)}return{className:o.join(" "),style:Object.keys(i).length>0?i:void 0}}function P(t,o,i,d="",f="",a=!1){const h=J(t);for(const[u,s]of Object.entries(h??{})){if(s==null)continue;const m=String(s),l=U(u,m);if(l){o.push(`${d}${l}`);continue}const c=`${f}${Y(u)}`,b=X(u,c);b&&(i[`--${c}`]=m,o.push(`${d}${b}`))}if(t.bgGroup!==void 0){const u=`${f}group-background`;i[`--${u}`]=T(t.bgGroup),o.push(`${d}group-hover:[background:var(--${u})]`),a&&o.push(`${d}hover:[background:var(--${u})]`)}}function U(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 X(t,o){const i=`var(--${o})`;return{background:`[background:${i}]`,backgroundColor:`bg-[${i}]`,backgroundPosition:`bg-[position:${i}]`,backgroundSize:`bg-[length:${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}]`,bottom:`bottom-[${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}]`,padding:`p-[${i}]`,paddingBottom:`pb-[${i}]`,paddingLeft:`pl-[${i}]`,paddingRight:`pr-[${i}]`,paddingTop:`pt-[${i}]`,right:`right-[${i}]`,top:`top-[${i}]`,width:`w-[${i}]`,zIndex:`z-[${i}]`}[t]}function Y(t){return t.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}function oo(t,o){if(o!==void 0){if(Array.isArray(o)){t.padding=o.map(n).join(" ");return}if(typeof o!="object"){t.padding=n(o);return}"px"in o&&o.px!==void 0&&(t.paddingLeft=n(o.px),t.paddingRight=n(o.px)),"py"in o&&o.py!==void 0&&(t.paddingTop=n(o.py),t.paddingBottom=n(o.py)),"pt"in o&&o.pt!==void 0&&(t.paddingTop=n(o.pt)),"pb"in o&&o.pb!==void 0&&(t.paddingBottom=n(o.pb)),"pl"in o&&o.pl!==void 0&&(t.paddingLeft=n(o.pl)),"pr"in o&&o.pr!==void 0&&(t.paddingRight=n(o.pr))}}function to(t,o){if(o!==void 0){if(Array.isArray(o)){t.margin=o.map(n).join(" ");return}if(typeof o!="object"){t.margin=n(o);return}"mx"in o&&o.mx!==void 0&&(t.marginLeft=n(o.mx),t.marginRight=n(o.mx)),"my"in o&&o.my!==void 0&&(t.marginTop=n(o.my),t.marginBottom=n(o.my)),"mt"in o&&o.mt!==void 0&&(t.marginTop=n(o.mt)),"mb"in o&&o.mb!==void 0&&(t.marginBottom=n(o.mb)),"ml"in o&&o.ml!==void 0&&(t.marginLeft=n(o.ml)),"mr"in o&&o.mr!==void 0&&(t.marginRight=n(o.mr))}}function io(t,o){o&&(o.radius!==void 0&&eo(t,o.radius),o.color!==void 0&&(t.borderColor=N(o.color)),o.width!==void 0&&no(t,o.width),o.style!==void 0&&(t.borderStyle=o.style))}function eo(t,o){if(ro(o)){o.topLeft!==void 0&&(t.borderTopLeftRadius=$(o.topLeft)),o.topRight!==void 0&&(t.borderTopRightRadius=$(o.topRight)),o.bottomLeft!==void 0&&(t.borderBottomLeftRadius=$(o.bottomLeft)),o.bottomRight!==void 0&&(t.borderBottomRightRadius=$(o.bottomRight));return}t.borderRadius=$(o)}function no(t,o){if(uo(o)){o.top!==void 0&&(t.borderTopWidth=B(o.top)),o.bottom!==void 0&&(t.borderBottomWidth=B(o.bottom)),o.left!==void 0&&(t.borderLeftWidth=B(o.left)),o.right!==void 0&&(t.borderRightWidth=B(o.right));return}t.borderWidth=B(o)}function ro(t){return typeof t=="object"}function uo(t){return typeof t=="object"}function $(t){return t.startsWith("--")?`var(${t})`:t}function B(t){return t.startsWith("--")?`var(${t})`:t}function fo(t){return t==="hidden"?"none":t}function C(t){return typeof t=="number"?`${t}px`:t}function n(t){return typeof t=="number"?`${t}px`:t}function g(t){return typeof t=="number"?`${t}px`:t}function ao(t){return typeof t=="number"?`${t}px`:t}function co(t){return{"no-repeat":"no-repeat",repeat:"repeat","repeat-round":"round","repeat-space":"space","repeat-x":"repeat-x","repeat-y":"repeat-y"}[t]}function so(t){return t.replace("-"," ")}function T(t){return N(t)}function lo(t,o){const i=T(o);if(bo(o)){t.background=i;return}t.backgroundColor=i}function bo(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 N(t){return t.startsWith("--")?`var(${t})`:t}function mo(t,o){const{as:i,children:d,className:f,background:a,backgroundColor:h,bg:u,bgSize:s,bgRepeat:m,bgGroup:l,groupParent:c,bgPosition:b,border:v,cursor:p,p:y,m:r,outlineColor:R,outlineWidth:x,outlineOffset:k,outlineStyle:S,listStyle:z,display:W,position:e,width:I,maxWidth:w,minWidth:O,height:A,maxHeight:G,minHeight:H,md:q,lg:D,xl:M,style:V,...K}=t,Z=i??"div",L=Q({background:a,backgroundColor:h,bg:u,bgSize:s,bgRepeat:m,bgGroup:l,groupParent:c,bgPosition:b,border:v,cursor:p,p:y,m:r,outlineColor:R,outlineWidth:x,outlineOffset:k,outlineStyle:S,listStyle:z,display:W,position:e,width:I,maxWidth:w,minWidth:O,height:A,maxHeight:G,minHeight:H,md:q,lg:D,xl:M}),_=L.style||V?{...L.style,...V}:void 0;return E.jsx(Z,{className:j.cn(L.className,c&&"group",f),ref:o,style:_,...K,children:d})}const po=F.forwardRef(mo);exports.Box=po;
|