@shmidko61/lc-ui-kit 0.11.0 → 0.13.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.
Files changed (62) hide show
  1. package/README.md +89 -0
  2. package/dist/alert/alert.d.ts +5 -0
  3. package/dist/alert/helpers/alert.helpers.d.ts +27 -0
  4. package/dist/alert/helpers/index.d.ts +1 -0
  5. package/dist/alert/index.d.ts +2 -0
  6. package/dist/alert/types/alert.types.d.ts +25 -0
  7. package/dist/alert/types/index.d.ts +1 -0
  8. package/dist/alert-CTIWpkmD.js +128 -0
  9. package/dist/alert-DTc0Usg-.cjs +1 -0
  10. package/dist/alert.cjs +1 -0
  11. package/dist/alert.js +4 -0
  12. package/dist/box/box.d.ts +2 -2
  13. package/dist/box/box.types.d.ts +21 -1
  14. package/dist/box/index.d.ts +1 -0
  15. package/dist/box.cjs +1 -1
  16. package/dist/box.js +262 -203
  17. package/dist/button/button.helpers.d.ts +1 -1
  18. package/dist/button/index.d.ts +1 -0
  19. package/dist/button.cjs +1 -1
  20. package/dist/button.js +152 -141
  21. package/dist/flex/flex.d.ts +1 -1
  22. package/dist/flex/flex.types.d.ts +1 -1
  23. package/dist/flex/index.d.ts +1 -0
  24. package/dist/flex.cjs +1 -1
  25. package/dist/flex.js +18 -18
  26. package/dist/grid.cjs +1 -1
  27. package/dist/grid.js +57 -57
  28. package/dist/icons/icons.d.ts +8 -0
  29. package/dist/icons/index.d.ts +1 -0
  30. package/dist/icons.cjs +1 -1
  31. package/dist/icons.js +40 -36
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.d.ts +7 -3
  34. package/dist/index.js +101 -90
  35. package/dist/input/input.types.d.ts +1 -1
  36. package/dist/notification-provider/helpers/index.d.ts +1 -0
  37. package/dist/notification-provider/helpers/notification-provider.helpers.d.ts +8 -0
  38. package/dist/notification-provider/hooks/index.d.ts +1 -0
  39. package/dist/notification-provider/hooks/notification-provider.hooks.d.ts +5 -0
  40. package/dist/notification-provider/index.d.ts +3 -0
  41. package/dist/notification-provider/notification-provider.d.ts +4 -0
  42. package/dist/notification-provider/types/index.d.ts +1 -0
  43. package/dist/notification-provider/types/notification-provider.types.d.ts +61 -0
  44. package/dist/notification-provider-C2ypXy2W.cjs +1 -0
  45. package/dist/notification-provider-WLUaZyMB.js +113 -0
  46. package/dist/notification-provider.cjs +1 -0
  47. package/dist/notification-provider.js +6 -0
  48. package/dist/shared/responsive-style/index.d.ts +1 -0
  49. package/dist/shared/responsive-style/responsive-style.types.d.ts +1 -1
  50. package/dist/styles.css +1 -1
  51. package/dist/toast/index.d.ts +2 -0
  52. package/dist/toast/toast.d.ts +5 -0
  53. package/dist/toast/types/index.d.ts +1 -0
  54. package/dist/toast/types/toast.types.d.ts +10 -0
  55. package/dist/toast-CH8VqvLC.cjs +1 -0
  56. package/dist/toast-DpjugQ8H.js +49 -0
  57. package/dist/toast.cjs +1 -0
  58. package/dist/toast.js +4 -0
  59. package/dist/typography/index.d.ts +1 -0
  60. package/dist/typography/typography.helpers.d.ts +1 -1
  61. package/package.json +35 -4
  62. package/dist/vite.config.d.ts +0 -2
package/README.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  Переиспользуемый React UI kit для LC-приложений.
4
4
 
5
+ ## Проверка перед релизом
6
+
7
+ Из каталога `apps`:
8
+
9
+ ```bash
10
+ corepack pnpm --filter @shmidko61/lc-ui-kit verify:package
11
+ ```
12
+
13
+ Команда последовательно проверяет типы исходников, ESLint (включая Storybook),
14
+ форматирование, production-сборку, публичные типы с `skipLibCheck: false`,
15
+ саму защиту релиза на негативных примерах, ESM/CJS exports, все `.d.ts`,
16
+ production safelist, hover, состав npm tarball и сборку Storybook.
17
+
18
+ `prepublishOnly` запускает тот же `verify:package`. Если любая стадия падает,
19
+ проверка завершается с ненулевым кодом и публикация не продолжается.
20
+ `pack:check` использует локальный `npm pack --dry-run --ignore-scripts`:
21
+ авторизация в registry не требуется, lifecycle не запускается повторно.
22
+
23
+ Отдельные проверки доступны как `typecheck`, `lint`, `format:check`,
24
+ `typecheck:package`, `test:checks`, `test:package`, `test:hover`, `pack:check`
25
+ `test:states` и `storybook:build`. Проверки собранного пакета запускаются после `build`.
26
+ ESLint использует отдельный `tsconfig.eslint.json`; конфигурация source
27
+ typecheck и публичные props компонентов не меняются.
28
+
5
29
  ## Установка
6
30
 
7
31
  ```bash
@@ -69,3 +93,68 @@ breakpoints могут включить hover заново. Для сброса
69
93
  `hover={{ bg: color }}`. При использовании нового background в base-hover
70
94
  он наследуется на последующие breakpoints поверх старого `hoverBg`.
71
95
  Примеры доступны в Storybook: `UI Kit/Box/Hover`.
96
+
97
+ ## Focus, active и disabled
98
+
99
+ Box и компоненты на его основе принимают `focusVisible`, `active` и
100
+ `disabledStyle`. Для них доступны те же визуальные свойства, что для hover,
101
+ а также `outlineColor`, `outlineWidth`, `outlineOffset`, `outlineStyle`.
102
+
103
+ ```tsx
104
+ <Button
105
+ hover={{ bg: '#273B7D' }}
106
+ focusVisible={{
107
+ outlineColor: '#F4C542',
108
+ outlineWidth: '2px',
109
+ outlineOffset: '4px',
110
+ }}
111
+ active={{ bg: '#10183B', transform: 'scale(.98)' }}
112
+ md={{ focusVisible: { outlineColor: '#89A4D9' } }}
113
+ lg={{ active: null }}
114
+ />
115
+
116
+ <Button
117
+ disabled
118
+ disabledStyle={{ bg: '#10183B', color: '#89A4D9', opacity: 0.8 }}
119
+ >
120
+ Недоступно
121
+ </Button>
122
+ ```
123
+
124
+ `disabled` остаётся прежним boolean-пропом. `disabledStyle` только оформляет
125
+ `:disabled`, `aria-disabled="true"` и `data-disabled="true"`; этот prop сам
126
+ по себе не запрещает клики и не меняет фокусируемость. В частности, для
127
+ произвольного Box с aria-disabled управление поведением остаётся у приложения.
128
+
129
+ Свойства наследуются независимо в каждом состоянии: base → md → lg → xl.
130
+ `null` очищает накопленные overrides, после чего работают нижележащие состояния
131
+ или обычные стили текущего диапазона. Следующий breakpoint может включить
132
+ состояние заново. Для disabled сброс возвращает обычное оформление, поэтому
133
+ нужную disabled-прозрачность после reset можно явно задать на следующем breakpoint.
134
+
135
+ При совпадении CSS-свойств приоритет такой:
136
+ `disabledStyle → active → focusVisible → hover → обычные props`.
137
+ Например, focus outline не отключает hover background. Для disabled-элементов
138
+ интерактивные состояния исключены. Hover ограничен устройствами с точным
139
+ указателем; focus-visible и active не ограничиваются pointer media query,
140
+ поэтому работают и при клавиатурной навигации.
141
+
142
+ Если задан `outlineWidth`, используется `outlineStyle: 'solid'`, кроме случая,
143
+ когда стиль передан явно (включая `'none'`). Существующий focus ring Button
144
+ остаётся доступен. Явный `style` имеет приоритет над всеми состояниями.
145
+ Старые `hoverBg` и `activeBg` продолжают работать; новые background overrides
146
+ соответствующего состояния имеют приоритет.
147
+
148
+ Тип `StateStyleProps` экспортирован из корня пакета и `/box`.
149
+ 25 примеров доступны в Storybook: `UI Kit/Box/Interaction states`.
150
+
151
+ ## Уведомления
152
+
153
+ Alert, Toast и вызов через NotificationProvider/useNotifications доступны в новых subpath exports.
154
+
155
+ - [Alert](src/alert/README.md)
156
+ - [Toast](src/toast/README.md)
157
+ - [NotificationProvider](src/notification-provider/README.md)
158
+
159
+ Для сравнения API со старой сборкой: pnpm test:compatibility /path/to/previous/package.
160
+ Браузерные проверки: pnpm test:notifications; необходимы локальный Storybook на 6016 и headless Chrome с remote-debugging-port=9237.
@@ -0,0 +1,5 @@
1
+ import { JSX } from 'react';
2
+ import { AlertProps } from './types/index';
3
+ /** Встраиваемое уведомление. Видимость управляется родителем; children содержит описание. */
4
+ export declare function Alert({ status, variant, title, children, icon, actions, onClose, closeLabel, ...props }: AlertProps): JSX.Element;
5
+ export type { AlertProps, NotificationStatus, NotificationVariant } from './types/index';
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Палитра уведомлений на стандартных токенах ui-kit, реагирующая на смену темы.
3
+ * Мягкие фоны смешивают 10% акцента с фоном темы без добавления новых токенов.
4
+ * bg/color/border потребителя имеют приоритет над палитрой.
5
+ */
6
+ export declare const notificationPalette: {
7
+ readonly warning: {
8
+ readonly accent: "--color-secondary-accent-3";
9
+ readonly soft: "color-mix(in srgb, var(--color-secondary-accent-3) 10%, var(--color-background-default))";
10
+ };
11
+ readonly success: {
12
+ readonly accent: "--color-secondary-accent-1";
13
+ readonly soft: "color-mix(in srgb, var(--color-secondary-accent-1) 10%, var(--color-background-default))";
14
+ };
15
+ readonly error: {
16
+ readonly accent: "--color-secondary-accent-2";
17
+ readonly soft: "color-mix(in srgb, var(--color-secondary-accent-2) 10%, var(--color-background-default))";
18
+ };
19
+ readonly info: {
20
+ readonly accent: "--color-primary-accent";
21
+ readonly soft: "color-mix(in srgb, var(--color-primary-accent) 10%, var(--color-background-default))";
22
+ };
23
+ readonly neutral: {
24
+ readonly accent: "--color-text-primary";
25
+ readonly soft: "--color-background-subtle";
26
+ };
27
+ };
@@ -0,0 +1 @@
1
+ export { notificationPalette } from './alert.helpers';
@@ -0,0 +1,2 @@
1
+ export { Alert } from './alert';
2
+ export type { AlertProps, NotificationStatus, NotificationVariant } from './types/index';
@@ -0,0 +1,25 @@
1
+ import { ReactNode } from 'react';
2
+ import { FlexProps } from '../../flex/index';
3
+ /** Семантический статус уведомления; по умолчанию info. */
4
+ export type NotificationStatus = 'warning' | 'success' | 'error' | 'info' | 'neutral';
5
+ /** Оформление: outlined — белый фон с рамкой, soft — тонированный, plain — без рамки. */
6
+ export type NotificationVariant = 'outlined' | 'soft' | 'plain';
7
+ /** Alert наследует style props Flex, включая md/lg/xl и их reset-значения.
8
+ * Явный style имеет приоритет; className передаётся в Flex.
9
+ */
10
+ export type AlertProps = Omit<FlexProps, 'title'> & {
11
+ /** Статус, по умолчанию info; error получает role=alert, остальные role=status. */
12
+ status?: NotificationStatus;
13
+ /** Вариант оформления, по умолчанию outlined. */
14
+ variant?: NotificationVariant;
15
+ /** Заголовок; без него доступно компактное однострочное представление. */
16
+ title?: ReactNode;
17
+ /** Слот иконки; false скрывает её. По умолчанию используется иконка статуса. */
18
+ icon?: ReactNode;
19
+ /** Произвольные действия, например кнопки или ссылки из ui-kit. */
20
+ actions?: ReactNode;
21
+ /** Обработчик управляемого закрытия; при наличии показывает кнопку. */
22
+ onClose?: () => void;
23
+ /** Доступное имя кнопки закрытия, по умолчанию «Закрыть уведомление». */
24
+ closeLabel?: string;
25
+ };
@@ -0,0 +1 @@
1
+ export type { AlertProps, NotificationStatus, NotificationVariant } from './alert.types';
@@ -0,0 +1,128 @@
1
+ import { jsxs as x, jsx as e } from "react/jsx-runtime";
2
+ import { Flex as c } from "./flex.js";
3
+ import { Typography as g } from "./typography.js";
4
+ import { Button as b } from "./button.js";
5
+ import { XMarkIcon as y, InfoCircleIcon as f, BlockIcon as k, DoubleCheckIcon as v, WarningTriangleIcon as w } from "./icons.js";
6
+ const H = {
7
+ warning: {
8
+ accent: "--color-secondary-accent-3",
9
+ soft: "color-mix(in srgb, var(--color-secondary-accent-3) 10%, var(--color-background-default))"
10
+ },
11
+ success: {
12
+ accent: "--color-secondary-accent-1",
13
+ soft: "color-mix(in srgb, var(--color-secondary-accent-1) 10%, var(--color-background-default))"
14
+ },
15
+ error: {
16
+ accent: "--color-secondary-accent-2",
17
+ soft: "color-mix(in srgb, var(--color-secondary-accent-2) 10%, var(--color-background-default))"
18
+ },
19
+ info: {
20
+ accent: "--color-primary-accent",
21
+ soft: "color-mix(in srgb, var(--color-primary-accent) 10%, var(--color-background-default))"
22
+ },
23
+ neutral: { accent: "--color-text-primary", soft: "--color-background-subtle" }
24
+ };
25
+ function A({
26
+ status: r = "info",
27
+ variant: l = "outlined",
28
+ title: i,
29
+ children: p,
30
+ icon: a,
31
+ actions: n,
32
+ onClose: d,
33
+ closeLabel: s = "Закрыть уведомление",
34
+ ...h
35
+ }) {
36
+ const t = H[r], o = !i && !n, u = {
37
+ warning: w,
38
+ success: v,
39
+ error: k,
40
+ info: f,
41
+ neutral: f
42
+ }[r], m = /* @__PURE__ */ e(u, { width: o ? 16 : 20, height: o ? 16 : 20 });
43
+ return /* @__PURE__ */ x(
44
+ c,
45
+ {
46
+ role: r === "error" ? "alert" : "status",
47
+ align: o || !n ? "center" : "start",
48
+ gap: o ? 8 : 16,
49
+ p: 15,
50
+ position: { type: "relative" },
51
+ width: o ? "fit-content" : 320,
52
+ maxWidth: "100%",
53
+ bg: l === "soft" ? t.soft : "--color-background-default",
54
+ color: "--color-text-primary",
55
+ border: {
56
+ width: "1px",
57
+ style: "solid",
58
+ color: l === "plain" || r === "neutral" ? "transparent" : t.accent,
59
+ radius: o ? "8px" : "12px"
60
+ },
61
+ ...h,
62
+ children: [
63
+ a !== !1 && /* @__PURE__ */ e(
64
+ c,
65
+ {
66
+ "aria-hidden": "true",
67
+ align: "center",
68
+ justify: "center",
69
+ shrink: 0,
70
+ width: o ? 24 : 40,
71
+ height: o ? 24 : 40,
72
+ bg: r === "neutral" ? t.soft : t.accent,
73
+ color: r === "neutral" ? t.accent : "--color-background-default",
74
+ border: { radius: o ? "5px" : "9px" },
75
+ children: a === void 0 ? m : a
76
+ }
77
+ ),
78
+ /* @__PURE__ */ x(c, { flexDirection: "column", gap: 8, grow: 1, minWidth: 0, children: [
79
+ i && /* @__PURE__ */ e(
80
+ g,
81
+ {
82
+ as: "div",
83
+ fontSize: "20px",
84
+ fontWeight: 600,
85
+ lineHeight: "24px",
86
+ md: { fontSize: "20px", lineHeight: "24px" },
87
+ lg: { fontSize: "20px", lineHeight: "24px" },
88
+ xl: { fontSize: "20px", lineHeight: "24px" },
89
+ children: i
90
+ }
91
+ ),
92
+ p && /* @__PURE__ */ e(
93
+ g,
94
+ {
95
+ as: "div",
96
+ fontSize: o ? "14px" : "13px",
97
+ lineHeight: o ? "24px" : "17px",
98
+ md: { fontSize: o ? "14px" : "13px", lineHeight: o ? "24px" : "17px" },
99
+ lg: { fontSize: o ? "14px" : "13px", lineHeight: o ? "24px" : "17px" },
100
+ xl: { fontSize: o ? "14px" : "13px", lineHeight: o ? "24px" : "17px" },
101
+ color: o ? r === "neutral" ? "--color-text-primary" : t.accent : "--color-text-secondary",
102
+ children: p
103
+ }
104
+ ),
105
+ n && /* @__PURE__ */ e(c, { gap: 8, flexWrap: "wrap", m: { mt: 4 }, children: n })
106
+ ] }),
107
+ d && /* @__PURE__ */ e(
108
+ b,
109
+ {
110
+ type: "button",
111
+ "aria-label": s,
112
+ onClick: d,
113
+ bg: "transparent",
114
+ color: "--color-text-primary",
115
+ p: 0,
116
+ minWidth: 24,
117
+ minHeight: 24,
118
+ style: { position: "absolute", top: 3, right: 3 },
119
+ children: /* @__PURE__ */ e(y, { "aria-hidden": "true", width: 16, height: 16 })
120
+ }
121
+ )
122
+ ]
123
+ }
124
+ );
125
+ }
126
+ export {
127
+ A
128
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),i=require("./flex.cjs"),d=require("./typography.cjs"),y=require("./button.cjs"),n=require("./icons.cjs"),b={warning:{accent:"--color-secondary-accent-3",soft:"color-mix(in srgb, var(--color-secondary-accent-3) 10%, var(--color-background-default))"},success:{accent:"--color-secondary-accent-1",soft:"color-mix(in srgb, var(--color-secondary-accent-1) 10%, var(--color-background-default))"},error:{accent:"--color-secondary-accent-2",soft:"color-mix(in srgb, var(--color-secondary-accent-2) 10%, var(--color-background-default))"},info:{accent:"--color-primary-accent",soft:"color-mix(in srgb, var(--color-primary-accent) 10%, var(--color-background-default))"},neutral:{accent:"--color-text-primary",soft:"--color-background-subtle"}};function m({status:o="info",variant:p="outlined",title:a,children:x,icon:l,actions:c,onClose:s,closeLabel:g="Закрыть уведомление",...u}){const t=b[o],r=!a&&!c,f={warning:n.WarningTriangleIcon,success:n.DoubleCheckIcon,error:n.BlockIcon,info:n.InfoCircleIcon,neutral:n.InfoCircleIcon}[o],h=e.jsx(f,{width:r?16:20,height:r?16:20});return e.jsxs(i.Flex,{role:o==="error"?"alert":"status",align:r||!c?"center":"start",gap:r?8:16,p:15,position:{type:"relative"},width:r?"fit-content":320,maxWidth:"100%",bg:p==="soft"?t.soft:"--color-background-default",color:"--color-text-primary",border:{width:"1px",style:"solid",color:p==="plain"||o==="neutral"?"transparent":t.accent,radius:r?"8px":"12px"},...u,children:[l!==!1&&e.jsx(i.Flex,{"aria-hidden":"true",align:"center",justify:"center",shrink:0,width:r?24:40,height:r?24:40,bg:o==="neutral"?t.soft:t.accent,color:o==="neutral"?t.accent:"--color-background-default",border:{radius:r?"5px":"9px"},children:l===void 0?h:l}),e.jsxs(i.Flex,{flexDirection:"column",gap:8,grow:1,minWidth:0,children:[a&&e.jsx(d.Typography,{as:"div",fontSize:"20px",fontWeight:600,lineHeight:"24px",md:{fontSize:"20px",lineHeight:"24px"},lg:{fontSize:"20px",lineHeight:"24px"},xl:{fontSize:"20px",lineHeight:"24px"},children:a}),x&&e.jsx(d.Typography,{as:"div",fontSize:r?"14px":"13px",lineHeight:r?"24px":"17px",md:{fontSize:r?"14px":"13px",lineHeight:r?"24px":"17px"},lg:{fontSize:r?"14px":"13px",lineHeight:r?"24px":"17px"},xl:{fontSize:r?"14px":"13px",lineHeight:r?"24px":"17px"},color:r?o==="neutral"?"--color-text-primary":t.accent:"--color-text-secondary",children:x}),c&&e.jsx(i.Flex,{gap:8,flexWrap:"wrap",m:{mt:4},children:c})]}),s&&e.jsx(y.Button,{type:"button","aria-label":g,onClick:s,bg:"transparent",color:"--color-text-primary",p:0,minWidth:24,minHeight:24,style:{position:"absolute",top:3,right:3},children:e.jsx(n.XMarkIcon,{"aria-hidden":"true",width:16,height:16})})]})}exports.Alert=m;
package/dist/alert.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./alert-DTc0Usg-.cjs");exports.Alert=e.Alert;
package/dist/alert.js ADDED
@@ -0,0 +1,4 @@
1
+ import { A as o } from "./alert-CTIWpkmD.js";
2
+ export {
3
+ o as Alert
4
+ };
package/dist/box/box.d.ts CHANGED
@@ -8,5 +8,5 @@ type BoxComponentType = {
8
8
  displayName?: string;
9
9
  };
10
10
  export declare const Box: BoxComponentType;
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, HoverStyleProps, } from './box.types';
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/index';
12
+ export type { BoxAs, BoxBackgroundValue, BoxBreakpointProps, BoxComponentProps, BoxProps, HoverStyleProps, StateStyleProps, } from './box.types';
@@ -1,6 +1,6 @@
1
1
  import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
2
2
  import { ResponsiveStyleBreakpoint } from '../shared/responsive-style/responsive-style.types';
3
- import { UiKitAspectRatioProps, UiKitBackgroundProps, UiKitBackgroundValue, UiKitBorderProps, UiKitBoxShadowProps, UiKitColorProps, UiKitCursorProps, UiKitDimensionProps, UiKitDisplayProps, UiKitIndentationsProps, UiKitListStyleProps, UiKitOpacityProps, UiKitOutlineProps, UiKitOverflowProps, UiKitPointerEventsProps, UiKitPositionProps, UiKitTransformProps } from '../types';
3
+ import { UiKitAspectRatioProps, UiKitBackgroundProps, UiKitBackgroundValue, UiKitBorderProps, UiKitBoxShadowProps, UiKitColorProps, UiKitCursorProps, UiKitDimensionProps, UiKitDisplayProps, UiKitIndentationsProps, UiKitListStyleProps, UiKitOpacityProps, UiKitOutlineProps, UiKitOverflowProps, UiKitPointerEventsProps, UiKitPositionProps, UiKitTransformProps } from '../types/index';
4
4
  /**
5
5
  * Допустимые HTML-теги для Box.
6
6
  *
@@ -42,6 +42,20 @@ export type BoxBreakpointProps = BoxStyleProps & BoxOwnStyleProps & {
42
42
  * hover; следующие breakpoint-объекты могут включить его заново.
43
43
  */
44
44
  hover?: HoverStyleProps | null;
45
+ /**
46
+ * Оформление :focus-visible для клавиатурной навигации. Наследуется по
47
+ * md/lg/xl; null сбрасывает накопленные overrides. outlineWidth включает
48
+ * solid outline, если outlineStyle явно не передан.
49
+ */
50
+ focusVisible?: StateStyleProps | null;
51
+ /** Оформление :active при нажатии. Наследуется по md/lg/xl; null сбрасывает overrides. */
52
+ active?: StateStyleProps | null;
53
+ /**
54
+ * Оформление :disabled, aria-disabled="true" или data-disabled="true".
55
+ * Не отключает элемент: для Button используйте обычный boolean disabled.
56
+ * Наследуется по md/lg/xl; null сбрасывает визуальные overrides.
57
+ */
58
+ disabledStyle?: StateStyleProps | null;
45
59
  };
46
60
  /**
47
61
  * Визуальные hover-свойства без размеров и вложенных breakpoints.
@@ -49,6 +63,12 @@ export type BoxBreakpointProps = BoxStyleProps & BoxOwnStyleProps & {
49
63
  * Явный element-level `style` приоритетнее hover, disabled не реагирует.
50
64
  */
51
65
  export type HoverStyleProps = Pick<BoxStyleProps & BoxOwnStyleProps, 'bg' | 'background' | 'backgroundColor' | 'color' | 'border' | 'boxShadow' | 'opacity' | 'transform'>;
66
+ /**
67
+ * Визуальные свойства focusVisible/active/disabledStyle без layout и вложенных
68
+ * breakpoints. Явный element-level style приоритетнее. Для совпадающих
69
+ * свойств порядок: disabledStyle → active → focusVisible → hover.
70
+ */
71
+ export type StateStyleProps = HoverStyleProps & Pick<BoxStyleProps, 'outlineColor' | 'outlineWidth' | 'outlineOffset' | 'outlineStyle'>;
52
72
  /**
53
73
  * Responsive overrides Box.
54
74
  */
@@ -0,0 +1 @@
1
+ export * from './box';
package/dist/box.cjs CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const bo=require("react/jsx-runtime"),po=require("react"),L=require("./responsive-style.config-B2m9jVlX.cjs");function K({background:t,backgroundColor:o,bg:e,bgSize:a,bgRepeat:n,bgPosition:s,border:m,boxShadow:c,color:r,cursor:u,opacity:l,overflow:d,overflowX:h,overflowY:y,pointerEvents:B,aspectRatio:v,transform:g,transformOrigin:b,p:S,m:x,outlineColor:k,outlineWidth:R,outlineOffset:W,outlineStyle:P,listStyle:C,display:w,position:p,width:N,maxWidth:j,minWidth:I,height:O,maxHeight:E,minHeight:A}){const i={};return e!==void 0?Lo(i,e):t!==void 0&&(i.background=G(t)),o!==void 0&&(i.backgroundColor=G(o)),a!==void 0&&(i.backgroundSize=zo(a)),n!==void 0&&(i.backgroundRepeat=To(n)),s!==void 0&&(i.backgroundPosition=Vo(s)),ko(i,m),c!==void 0&&(i.boxShadow=$(c)),r!==void 0&&(i.color=$(r)),u!==void 0&&(i.cursor=u),l!==void 0&&(i.opacity=typeof l=="number"?l:$(l)),d!==void 0&&(i.overflowX=d,i.overflowY=d),h!==void 0&&(i.overflowX=h),y!==void 0&&(i.overflowY=y),B!==void 0&&(i.pointerEvents=B),v!==void 0&&(i.aspectRatio=typeof v=="number"?String(v):$(v)),g!==void 0&&(i.transform=$(g)),b!==void 0&&(i.transformOrigin=$(b)),Bo(i,S),yo(i,x),k!==void 0&&(i.outlineColor=$(k)),R!==void 0&&(i.outlineWidth=R),W!==void 0&&(i.outlineOffset=W),P!==void 0&&(i.outlineStyle=P),C?.position!==void 0&&(i.listStylePosition=C.position),C?.type!==void 0&&(i.listStyleType=C.type),w!==void 0&&(i.display=Co(w)),p?.type!==void 0&&(i.position=p.type),p?.top!==void 0&&(i.top=H(p.top)),p?.left!==void 0&&(i.left=H(p.left)),p?.right!==void 0&&(i.right=H(p.right)),p?.bottom!==void 0&&(i.bottom=H(p.bottom)),p?.zIndex!==void 0&&(i.zIndex=p.zIndex),N!==void 0&&(i.width=z(N)),j!==void 0&&(i.maxWidth=z(j)),I!==void 0&&(i.minWidth=z(I)),O!==void 0&&(i.height=z(O)),E!==void 0&&(i.maxHeight=z(E)),A!==void 0&&(i.minHeight=z(A)),Object.keys(i).length>0?i:void 0}function mo(t){const o=[],e={},a=t.groupParent===!0;F(t,o,e,{isGroupParent:a});for(const n of L.responsiveBreakpoints){const s=t[n];s&&F(s,o,e,{classPrefix:`${n}:`,variablePrefix:`${n}-`,isGroupParent:a})}return go(t,o,e),{className:o.join(" "),style:Object.keys(e).length>0?e:void 0}}const q=[{prop:"hover",name:"hover",variant:"[@media(hover:hover)_and_(pointer:fine)]:[&:hover:not(:disabled):not([aria-disabled=true]):not([data-disabled=true])]"},{prop:"focusVisible",name:"focus-visible",variant:"[&:focus-visible:not(:disabled):not([aria-disabled=true]):not([data-disabled=true])]"},{prop:"active",name:"active",variant:"[&:active:not(:disabled):not([aria-disabled=true]):not([data-disabled=true])]"},{prop:"disabledStyle",name:"disabled",variant:"[&:is(:disabled,[aria-disabled=true],[data-disabled=true]):is(:disabled,[aria-disabled=true],[data-disabled=true])]"}];function go(t,o,e){const a=[t,...L.responsiveBreakpoints.map(r=>t[r]??{})],n=new Set;for(const r of q)for(const u of a)Object.keys(D(u,r.prop)).forEach(l=>n.add(l)),r.prop==="hover"&&u.hover===null&&n.add("backgroundColor");if(n.size===0)return;for(const r of n){const u=Y(r);for(const l of q)o.push(`[--ui-state-${l.name}-${u}:initial]`)}let s={};const m=new Map,c=new Map;a.forEach((r,u)=>{s={...s,...X(r)};const l=u===0?"":`${L.responsiveBreakpoints[u-1]}:`;for(const d of q){const h=m.get(d.name)??{},y=D(r,d.prop),B=r[d.prop]===null?{}:{...h,...y},v=c.get(d.name)??new Set;Object.keys(y).forEach(g=>v.add(g)),d.prop==="hover"&&r.hover===null&&v.add("backgroundColor"),m.set(d.name,B),c.set(d.name,v);for(const g of v){const b=Y(g),S=s[g]??vo(g,u),x=`--ui-state-normal-${u}-${b}`;e[x]=String(S);const k=`--${d.name}-${u}-${b}`;e[k]=String(B[g]??S);const R=`--ui-state-value-${d.name}-${u}-${b}`;e[R]=B[g]===void 0?"initial":`var(${k})`;const W=`var(--ui-state-disabled-${b},var(--ui-state-active-${b},var(--ui-state-focus-visible-${b},var(--ui-state-hover-${b},var(${x})))))`;o.push(`${l}${d.variant}:[--ui-state-${d.name}-${b}:var(${R})]`,`${l}${d.variant}:[${b}:${W}]`)}}})}function D(t,o){const e=t[o];return e?o!=="hover"&&"outlineWidth"in e&&e.outlineStyle===void 0?X({...e,outlineStyle:"solid"}):X(e):{}}function vo(t,o){const e=t==="color"?"inherit":"initial";if(t!=="background"&&t!=="backgroundColor"&&t!=="color")return e;const a=t==="color"?"color":"bg";let n=`var(--button-${a},${e})`;for(let s=0;s<o;s+=1)n=`var(--${L.responsiveBreakpoints[s]}-button-${a},${n})`;return n}function X(t){const o={...K(t)};if(o.borderWidth!==void 0){const e=String(o.borderWidth).split(/\s+(?![^()]*\))/),a=e[0],n=e[1]??a,s=e[2]??a,m=e[3]??n;Object.assign(o,{borderTopWidth:a,borderRightWidth:n,borderBottomWidth:s,borderLeftWidth:m}),delete o.borderWidth}if(o.borderRadius!==void 0){const[e,a=e]=String(o.borderRadius).split("/"),n=c=>{const r=c.trim().split(/\s+(?![^()]*\))/);return[r[0],r[1]??r[0],r[2]??r[0],r[3]??r[1]??r[0]]},s=n(e),m=n(a);["TopLeft","TopRight","BottomRight","BottomLeft"].forEach((c,r)=>{o[`border${c}Radius`]=`${s[r]} ${m[r]}`}),delete o.borderRadius}return o}function F(t,o,e,{classPrefix:a="",variablePrefix:n="",isGroupParent:s=!1}={}){const m=K(t);for(const[c,r]of Object.entries(m??{})){if(r==null)continue;const u=String(r),l=ho(c,u);if(l){o.push(`${a}${l}`);continue}const d=`${n}${Y(c)}`,h=$o(c,d);h&&(e[`--${d}`]=u,o.push(`${a}${h}`))}if(t.bgGroup!==void 0){const c=`${n}group-background`;e[`--${c}`]=G(t.bgGroup),o.push(`${a}group-hover:[background:var(--${c})]`),s&&o.push(`${a}hover:[background:var(--${c})]`)}}function ho(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 $o(t,o){const e=`var(--${o})`;return{background:`[background:${e}]`,backgroundColor:`bg-[${e}]`,backgroundPosition:`bg-[position:${e}]`,backgroundSize:`bg-[length:${e}]`,aspectRatio:`[aspect-ratio:${e}]`,borderBottomLeftRadius:`rounded-bl-[${e}]`,borderBottomRightRadius:`rounded-br-[${e}]`,borderBottomWidth:`border-b-[length:${e}]`,borderColor:`border-[color:${e}]`,borderLeftWidth:`border-l-[length:${e}]`,borderRadius:`rounded-[${e}]`,borderRightWidth:`border-r-[length:${e}]`,borderTopLeftRadius:`rounded-tl-[${e}]`,borderTopRightRadius:`rounded-tr-[${e}]`,borderTopWidth:`border-t-[length:${e}]`,borderWidth:`border-[length:${e}]`,boxShadow:`[box-shadow:${e}]`,bottom:`bottom-[${e}]`,color:`[color:${e}]`,height:`h-[${e}]`,left:`left-[${e}]`,margin:`m-[${e}]`,marginBottom:`mb-[${e}]`,marginLeft:`ml-[${e}]`,marginRight:`mr-[${e}]`,marginTop:`mt-[${e}]`,maxHeight:`max-h-[${e}]`,maxWidth:`max-w-[${e}]`,minHeight:`min-h-[${e}]`,minWidth:`min-w-[${e}]`,outlineColor:`outline-[color:${e}]`,outlineOffset:`outline-offset-[${e}]`,outlineWidth:`outline-[length:${e}]`,opacity:`[opacity:${e}]`,overflowX:`[overflow-x:${e}]`,overflowY:`[overflow-y:${e}]`,padding:`p-[${e}]`,paddingBottom:`pb-[${e}]`,paddingLeft:`pl-[${e}]`,paddingRight:`pr-[${e}]`,paddingTop:`pt-[${e}]`,pointerEvents:`[pointer-events:${e}]`,right:`right-[${e}]`,top:`top-[${e}]`,transform:`[transform:${e}]`,transformOrigin:`[transform-origin:${e}]`,width:`w-[${e}]`,zIndex:`z-[${e}]`}[t]}function Y(t){return t.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}function Bo(t,o){if(o!==void 0){if(Array.isArray(o)){t.padding=o.map(f).join(" ");return}if(typeof o!="object"){t.padding=f(o);return}"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))}}function yo(t,o){if(o!==void 0){if(Array.isArray(o)){t.margin=o.map(f).join(" ");return}if(typeof o!="object"){t.margin=f(o);return}"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))}}function ko(t,o){o&&(o.radius!==void 0&&Ro(t,o.radius),o.color!==void 0&&(t.borderColor=$(o.color)),o.width!==void 0&&So(t,o.width),o.style!==void 0&&(t.borderStyle=o.style))}function Ro(t,o){if(xo(o)){o.topLeft!==void 0&&(t.borderTopLeftRadius=T(o.topLeft)),o.topRight!==void 0&&(t.borderTopRightRadius=T(o.topRight)),o.bottomLeft!==void 0&&(t.borderBottomLeftRadius=T(o.bottomLeft)),o.bottomRight!==void 0&&(t.borderBottomRightRadius=T(o.bottomRight));return}t.borderRadius=T(o)}function So(t,o){if(Wo(o)){o.top!==void 0&&(t.borderTopWidth=V(o.top)),o.bottom!==void 0&&(t.borderBottomWidth=V(o.bottom)),o.left!==void 0&&(t.borderLeftWidth=V(o.left)),o.right!==void 0&&(t.borderRightWidth=V(o.right));return}t.borderWidth=V(o)}function xo(t){return typeof t=="object"}function Wo(t){return typeof t=="object"}function T(t){return t.startsWith("--")?`var(${t})`:t}function V(t){return t.startsWith("--")?`var(${t})`:t}function Co(t){return t==="hidden"?"none":t}function H(t){return typeof t=="number"?`${t}px`:t}function f(t){return typeof t=="number"?`${t}px`:t}function z(t){return typeof t=="number"?`${t}px`:t}function zo(t){return typeof t=="number"?`${t}px`:t}function To(t){return{"no-repeat":"no-repeat",repeat:"repeat","repeat-round":"round","repeat-space":"space","repeat-x":"repeat-x","repeat-y":"repeat-y"}[t]}function Vo(t){return t.replace("-"," ")}function G(t){return $(t)}function Lo(t,o){const e=G(o);if(Po(o)){t.background=e;return}t.backgroundColor=e}function Po(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 wo(t,o){const{as:e,children:a,className:n,background:s,backgroundColor:m,bg:c,bgSize:r,bgRepeat:u,bgGroup:l,groupParent:d,bgPosition:h,border:y,boxShadow:B,color:v,cursor:g,opacity:b,overflow:S,overflowX:x,overflowY:k,pointerEvents:R,aspectRatio:W,transform:P,transformOrigin:C,p:w,m:p,outlineColor:N,outlineWidth:j,outlineOffset:I,outlineStyle:O,listStyle:E,display:A,position:i,width:Z,maxWidth:J,minWidth:Q,height:U,hover:oo,focusVisible:to,active:eo,disabledStyle:io,maxHeight:ro,minHeight:no,md:ao,lg:so,xl:fo,style:_,...co}=t,uo=e??"div",M=mo({hover:oo,focusVisible:to,active:eo,disabledStyle:io,background:s,backgroundColor:m,bg:c,bgSize:r,bgRepeat:u,bgGroup:l,groupParent:d,bgPosition:h,border:y,boxShadow:B,color:v,cursor:g,opacity:b,overflow:S,overflowX:x,overflowY:k,pointerEvents:R,aspectRatio:W,transform:P,transformOrigin:C,p:w,m:p,outlineColor:N,outlineWidth:j,outlineOffset:I,outlineStyle:O,listStyle:E,display:A,position:i,width:Z,maxWidth:J,minWidth:Q,height:U,maxHeight:ro,minHeight:no,md:ao,lg:so,xl:fo}),lo=M.style||_?{...M.style,..._}:void 0;return bo.jsx(uo,{className:L.cn(M.className,d&&"group",n),ref:o,style:lo,...co,children:a})}const No=po.forwardRef(wo);exports.Box=No;