burne-ui 1.7.1 → 1.7.2
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 +17 -0
- package/dist/components/core/TextArea/textAreaStyles.d.ts +2 -2
- package/dist/components/core/ToggleButton/toggleButtonStyles.d.ts +2 -1
- package/dist/components/core/ToggleButton/toggleButtonTypes.d.ts +1 -0
- package/dist/components/core/utils/hoverVariant.d.ts +4 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1942 -1932
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +1 -1
- package/dist/theme/themeDefaults.d.ts +2 -2
- package/dist/{themeRuntimeContext-lrK_tOjm.js → themeRuntimeContext-Bvsrm3yI.js} +410 -397
- package/dist/themeRuntimeContext-DEEtVAx5.cjs +14 -0
- package/dist/tokens/config.d.ts +1 -0
- package/dist/tokens/index.d.ts +1 -1
- package/dist/ui.css +102 -8
- package/package.json +1 -1
- package/dist/themeRuntimeContext-BOseU2z2.cjs +0 -14
package/README.md
CHANGED
|
@@ -224,6 +224,21 @@ import { cn } from "burne-ui";
|
|
|
224
224
|
|
|
225
225
|
Функция реэкспортируется из корня пакета; зависимости уже входят в `burne-ui`, отдельно ставить их не обязательно.
|
|
226
226
|
|
|
227
|
+
## `classNames` и тип `Prettify`
|
|
228
|
+
|
|
229
|
+
Почти у всех компонентов есть проп **`classNames`** — объект слотов стилей (`root`, `icon`, `label`, …; набор зависит от компонента). Имена слотов совпадают с compound-частями (camelCase); корень — всегда `root`.
|
|
230
|
+
|
|
231
|
+
В типах слоты описаны именованным алиасом (`BadgeClassNames`, `ButtonClassNames`, …), а на **пропе** обёрнуты в **`Prettify<…>`**, чтобы IDE при наведении показывала развёрнутый объект слотов, а не только имя алиаса:
|
|
232
|
+
|
|
233
|
+
```ts
|
|
234
|
+
import type { Prettify, BadgeClassNames } from "burne-ui";
|
|
235
|
+
|
|
236
|
+
// Hover на classNames у <Badge> → { root?: string; text?: string; iconOnly?: string; … }
|
|
237
|
+
<Badge classNames={{ root: "rounded-large", text: "bg-primary/10" }}>Label</Badge>
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
`Prettify` экспортируется из корня пакета (`src/utils/prettify.ts`). В коде кита на пропах пишите `classNames?: Prettify<XxxClassNames>` (или `Prettify<Pick<XxxClassNames, …>>`); локальные копии `Expand` / `Prettify` не заводить.
|
|
241
|
+
|
|
227
242
|
## Поля формы: `Field`, `Hint`, dual API
|
|
228
243
|
|
|
229
244
|
### Примитив `Field`
|
|
@@ -274,6 +289,8 @@ bun run lint
|
|
|
274
289
|
bun run storybook
|
|
275
290
|
```
|
|
276
291
|
|
|
292
|
+
Конвенции компонентов (структура папки, `classNames` + `Prettify`, focus ring, dual API) — в `.cursor/rules/ui-kit.mdc` в корне монорепо.
|
|
293
|
+
|
|
277
294
|
## Лицензия
|
|
278
295
|
|
|
279
296
|
Укажите лицензию в `package.json` при публикации в npm.
|
|
@@ -3,8 +3,8 @@ export declare const TEXTAREA_MIN_H: Record<TextAreaSize, string>;
|
|
|
3
3
|
export declare const TEXTAREA_SHELL_LAYOUT_CLASS = "flex flex-col items-stretch";
|
|
4
4
|
export declare const TEXTAREA_CONTROL_BASE_CLASS = "box-border block min-h-0 w-full flex-1 resize-none overflow-auto bg-transparent font-inherit text-foreground outline-none placeholder:text-muted appearance-none [field-sizing:content] field-control-mobile-no-zoom";
|
|
5
5
|
/** Resize grip strokes — micro-geometry for the affordance (not spacing scale). */
|
|
6
|
-
export declare const TEXTAREA_RESIZE_GRIP_LINE_PRIMARY_CLASS = "absolute bottom-[length:calc(var(--border-width)*2)] right-0 block h-[length:var(--border-width)] w-[length:calc(var(--border-width)*9)] origin-bottom-right rotate-[135deg] bg-muted";
|
|
7
|
-
export declare const TEXTAREA_RESIZE_GRIP_LINE_SECONDARY_CLASS = "absolute bottom-[length:calc(var(--border-width)*6)] right-0 block h-[length:var(--border-width)] w-[length:calc(var(--border-width)*6)] origin-bottom-right rotate-[135deg] bg-muted";
|
|
6
|
+
export declare const TEXTAREA_RESIZE_GRIP_LINE_PRIMARY_CLASS = "absolute bottom-[length:calc(var(--border-width)*2)] right-0 block h-[length:var(--border-width)] w-[length:calc(var(--border-width)*9)] origin-bottom-right rotate-[135deg] bg-muted-foreground";
|
|
7
|
+
export declare const TEXTAREA_RESIZE_GRIP_LINE_SECONDARY_CLASS = "absolute bottom-[length:calc(var(--border-width)*6)] right-0 block h-[length:var(--border-width)] w-[length:calc(var(--border-width)*6)] origin-bottom-right rotate-[135deg] bg-muted-foreground";
|
|
8
8
|
export declare const TEXTAREA_RESIZE_GRIP_WRAP_CLASS = "relative block size-[length:var(--size-scale-small)] shrink-0";
|
|
9
9
|
export declare const TEXTAREA_RESIZE_HANDLE_BASE_CLASS = "absolute bottom-0 right-0 z-[2] m-0 flex touch-none select-none appearance-none border-0 bg-transparent items-end justify-end p-xsmall outline-none focus-ring-inset";
|
|
10
10
|
export declare const TEXTAREA_RESIZE_HANDLE_DISABLED_CLASS = "cursor-not-allowed opacity-45";
|
|
@@ -19,9 +19,10 @@ export declare function toggleButtonLabelClass({ slotClass, className, }: {
|
|
|
19
19
|
}): string;
|
|
20
20
|
export declare function toggleButtonTextClass(slotClass?: string, className?: string): string;
|
|
21
21
|
export declare function toggleButtonVariantIdleClass(variant: ToggleButtonVariant): string;
|
|
22
|
-
export declare function toggleButtonFillClass({ fillColor, pressed, roundingClass, slotClass, }: {
|
|
22
|
+
export declare function toggleButtonFillClass({ fillColor, pressed, variant, roundingClass, slotClass, }: {
|
|
23
23
|
fillColor: string;
|
|
24
24
|
pressed: boolean;
|
|
25
|
+
variant: ToggleButtonVariant;
|
|
25
26
|
roundingClass: string;
|
|
26
27
|
slotClass?: string;
|
|
27
28
|
}): string;
|
|
@@ -17,6 +17,7 @@ export type ToggleButtonClassNames = {
|
|
|
17
17
|
};
|
|
18
18
|
export type ToggleButtonContextValue = {
|
|
19
19
|
size: ToggleButtonSize;
|
|
20
|
+
variant: ToggleButtonVariant;
|
|
20
21
|
groupSegment: ButtonGroupSegment | undefined;
|
|
21
22
|
contentMotionRef: RefObject<HTMLSpanElement | null>;
|
|
22
23
|
bindFillRef: (node: HTMLSpanElement | null) => void;
|
|
@@ -2,12 +2,14 @@ export declare const SURFACE_COLOR_TRANSITION = "surface-color-transition motion
|
|
|
2
2
|
export declare const TEXT_COLOR_TRANSITION = "text-color-transition motion-reduce:transition-none";
|
|
3
3
|
/**
|
|
4
4
|
* Hover background for interactive surfaces.
|
|
5
|
-
* - `default`
|
|
5
|
+
* - `default` — foreground wash on surface (menus, default Button).
|
|
6
|
+
* - `transparent-hover` — muted wash on transparent (outline/ghost).
|
|
7
|
+
* - `primary` / `secondary` — brand / secondary fills.
|
|
6
8
|
* - `danger` … `warning` — tint on transparent/neutral background (Dropdown, ListBox).
|
|
7
9
|
* - `danger-tint-hover` … — stronger hover over an existing `bg-surface-tint-*` surface.
|
|
8
10
|
* - `danger-fill` … `warning-fill` — hover over filled status surface (Button danger, etc.).
|
|
9
11
|
*/
|
|
10
|
-
export type HoverVariant = "default" | "primary" | "secondary" | "danger" | "warning" | "info" | "success" | "danger-tint-hover" | "success-tint-hover" | "info-tint-hover" | "warning-tint-hover" | "danger-fill" | "warning-fill" | "info-fill" | "success-fill";
|
|
12
|
+
export type HoverVariant = "default" | "transparent-hover" | "primary" | "secondary" | "danger" | "warning" | "info" | "success" | "danger-tint-hover" | "success-tint-hover" | "info-tint-hover" | "warning-tint-hover" | "danger-fill" | "warning-fill" | "info-fill" | "success-fill";
|
|
11
13
|
type HoverFocusMode = "focus-visible" | "focus-within";
|
|
12
14
|
/** Hover/focus background without transition — for shells with their own `field-shell-transition`. */
|
|
13
15
|
export declare function hoverVariantBg(tone?: HoverVariant, focus?: HoverFocusMode): string;
|