burne-ui 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.
Files changed (67) hide show
  1. package/README.md +117 -0
  2. package/dist/components/composite/Accordion/Accordion.d.ts +20 -0
  3. package/dist/components/composite/Accordion/index.d.ts +1 -0
  4. package/dist/components/composite/AlertDialog/AlertDialog.d.ts +83 -0
  5. package/dist/components/composite/AlertDialog/index.d.ts +1 -0
  6. package/dist/components/composite/ButtonGroup/ButtonGroup.d.ts +42 -0
  7. package/dist/components/composite/ButtonGroup/index.d.ts +2 -0
  8. package/dist/components/composite/CheckboxGroup/CheckboxGroup.d.ts +49 -0
  9. package/dist/components/composite/CheckboxGroup/index.d.ts +1 -0
  10. package/dist/components/composite/Form/Form.d.ts +4 -0
  11. package/dist/components/composite/Form/index.d.ts +1 -0
  12. package/dist/components/core/Alert/Alert.d.ts +34 -0
  13. package/dist/components/core/Alert/index.d.ts +1 -0
  14. package/dist/components/core/Avatar/Avatar.d.ts +40 -0
  15. package/dist/components/core/Avatar/index.d.ts +1 -0
  16. package/dist/components/core/Badge/Badge.d.ts +77 -0
  17. package/dist/components/core/Badge/index.d.ts +1 -0
  18. package/dist/components/core/Breadcrumbs/Breadcrumbs.d.ts +19 -0
  19. package/dist/components/core/Breadcrumbs/index.d.ts +2 -0
  20. package/dist/components/core/Button/Button.d.ts +86 -0
  21. package/dist/components/core/Button/index.d.ts +1 -0
  22. package/dist/components/core/Card/Card.d.ts +49 -0
  23. package/dist/components/core/Card/index.d.ts +1 -0
  24. package/dist/components/core/Checkbox/Checkbox.d.ts +32 -0
  25. package/dist/components/core/Checkbox/index.d.ts +1 -0
  26. package/dist/components/core/CloseButton/CloseButton.d.ts +10 -0
  27. package/dist/components/core/CloseButton/index.d.ts +1 -0
  28. package/dist/components/core/Dialog/Dialog.d.ts +39 -0
  29. package/dist/components/core/Dialog/index.d.ts +1 -0
  30. package/dist/components/core/Dropdown/Dropdown.d.ts +147 -0
  31. package/dist/components/core/Dropdown/index.d.ts +1 -0
  32. package/dist/components/core/Expandable/Expandable.d.ts +44 -0
  33. package/dist/components/core/Expandable/index.d.ts +1 -0
  34. package/dist/components/core/GlassSurface/GlassBackdrop.d.ts +7 -0
  35. package/dist/components/core/GlassSurface/GlassShaderLayer.d.ts +14 -0
  36. package/dist/components/core/GlassSurface/GlassSurface.d.ts +16 -0
  37. package/dist/components/core/GlassSurface/glassLensOgl.d.ts +11 -0
  38. package/dist/components/core/GlassSurface/index.d.ts +3 -0
  39. package/dist/components/core/Input/Input.d.ts +71 -0
  40. package/dist/components/core/Input/index.d.ts +1 -0
  41. package/dist/components/core/Ripple/Ripple.d.ts +40 -0
  42. package/dist/components/core/Ripple/index.d.ts +1 -0
  43. package/dist/components/core/SearchInput/SearchInput.d.ts +54 -0
  44. package/dist/components/core/SearchInput/index.d.ts +1 -0
  45. package/dist/components/core/Selector/Selector.d.ts +48 -0
  46. package/dist/components/core/Selector/index.d.ts +1 -0
  47. package/dist/components/core/Separator/Separator.d.ts +13 -0
  48. package/dist/components/core/Separator/index.d.ts +1 -0
  49. package/dist/components/core/Text/Text.d.ts +19 -0
  50. package/dist/components/core/Text/index.d.ts +1 -0
  51. package/dist/components/core/Tooltip/Tooltip.d.ts +38 -0
  52. package/dist/components/core/Tooltip/index.d.ts +1 -0
  53. package/dist/components/core/utils/buttonGroupSegment.d.ts +10 -0
  54. package/dist/components/core/utils/hoverInteractiveLift.d.ts +60 -0
  55. package/dist/components/core/utils/motionTokens.d.ts +24 -0
  56. package/dist/components/core/utils/pressRipple.d.ts +19 -0
  57. package/dist/components/core/utils/semanticStatusIcons.d.ts +5 -0
  58. package/dist/components/core/utils/useConvergeRipples.d.ts +13 -0
  59. package/dist/index.cjs +169 -0
  60. package/dist/index.d.ts +31 -0
  61. package/dist/index.js +11863 -0
  62. package/dist/tokens/config.d.ts +70 -0
  63. package/dist/tokens/index.d.ts +12 -0
  64. package/dist/ui.css +3724 -0
  65. package/dist/utils/cn.d.ts +2 -0
  66. package/dist/utils/mockImages.d.ts +5 -0
  67. package/package.json +58 -0
@@ -0,0 +1,48 @@
1
+ import { ReactNode } from 'react';
2
+ import { InputSize, InputStatus, InputVariant } from '../Input';
3
+ export type SelectorOption = {
4
+ value: string;
5
+ /** В триггере после выбора и первая строка в списке. */
6
+ label: ReactNode;
7
+ /** Только в списке под подписью. */
8
+ description?: ReactNode;
9
+ /** Справа в строке списка. */
10
+ icon?: ReactNode;
11
+ disabled?: boolean;
12
+ /**
13
+ * Строка для поиска при `label` не из plain text.
14
+ * Если не задано — в фильтр попадают `value` и текстовые части `label` / `description`.
15
+ */
16
+ filterText?: string;
17
+ };
18
+ export type SelectorProps = {
19
+ /** Варианты списка. */
20
+ options: SelectorOption[];
21
+ /** Управляемое значение (`value` пункта). */
22
+ value?: string;
23
+ /** Неконтролируемое начальное значение. */
24
+ defaultValue?: string;
25
+ onValueChange?: (value: string) => void;
26
+ /** Визуал оболочки как у `Input`. */
27
+ variant?: InputVariant;
28
+ size?: InputSize;
29
+ status?: InputStatus;
30
+ disabled?: boolean;
31
+ /** Подпись над полем. */
32
+ label?: string;
33
+ isRequired?: boolean;
34
+ /** Текст при отсутствии выбора и подсказка в поле при открытом списке. */
35
+ placeholder?: string;
36
+ /** Примечание под полем. */
37
+ hint?: string;
38
+ /**
39
+ * Максимальная высота области прокрутки списка (CSS `max-height`).
40
+ * По умолчанию как у `Dropdown.Content`: `min(24rem, 70vh)`.
41
+ */
42
+ menuMaxHeight?: string;
43
+ className?: string;
44
+ id?: string;
45
+ /** `id` списка для `aria-controls` (иначе генерируется). */
46
+ listId?: string;
47
+ };
48
+ export declare const Selector: import('react').ForwardRefExoticComponent<SelectorProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export { Selector, type SelectorProps, type SelectorOption, } from './Selector';
@@ -0,0 +1,13 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export type SeparatorOrientation = "horizontal" | "vertical";
3
+ export type SeparatorProps = Omit<HTMLAttributes<HTMLDivElement>, "role"> & {
4
+ /** Линия или столбец. По умолчанию горизонтальная линия во всю ширину. */
5
+ orientation?: SeparatorOrientation;
6
+ };
7
+ /**
8
+ * Разделитель списков и блоков — по теме (`border-base`).
9
+ */
10
+ export declare const Separator: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "role"> & {
11
+ /** Линия или столбец. По умолчанию горизонтальная линия во всю ширину. */
12
+ orientation?: SeparatorOrientation;
13
+ } & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export { Separator, type SeparatorProps, type SeparatorOrientation, } from './Separator';
@@ -0,0 +1,19 @@
1
+ import { ElementType, HTMLAttributes } from 'react';
2
+ /** Роли типографики из `@utility` / темы (см. Foundations/Typography). */
3
+ export type TextVariant = "accent-header" | "header-1" | "header-2" | "large" | "mid" | "base" | "small" | "tools";
4
+ export type TextProps = Omit<HTMLAttributes<HTMLElement>, "className"> & {
5
+ variant: TextVariant;
6
+ /** HTML-тег или компонент. По умолчанию зависит от `variant`. */
7
+ as?: ElementType;
8
+ /** Без `text-foreground` — цвет наследуется от родителя (например, `Button`). */
9
+ inheritColor?: boolean;
10
+ className?: string;
11
+ };
12
+ export declare const Text: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "className"> & {
13
+ variant: TextVariant;
14
+ /** HTML-тег или компонент. По умолчанию зависит от `variant`. */
15
+ as?: ElementType;
16
+ /** Без `text-foreground` — цвет наследуется от родителя (например, `Button`). */
17
+ inheritColor?: boolean;
18
+ className?: string;
19
+ } & import('react').RefAttributes<HTMLElement>>;
@@ -0,0 +1 @@
1
+ export { Text, type TextProps, type TextVariant } from './Text';
@@ -0,0 +1,38 @@
1
+ import { AlertStatus } from '../Alert';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+ /** Варианты заливки — как у `Alert`; `outline` → утилита `surface-outline`. */
4
+ export type TooltipVariant = AlertStatus;
5
+ export type TooltipSize = "small" | "base" | "large";
6
+ /** Сторона триггера, с которой показывается подсказка. */
7
+ export type TooltipSide = "top" | "bottom";
8
+ export type TooltipRootProps = {
9
+ children?: ReactNode;
10
+ /** Размер отступов и типографики. По умолчанию `small`. */
11
+ size?: TooltipSize;
12
+ /** Семантика фона как у Alert. По умолчанию `default`. */
13
+ variant?: TooltipVariant;
14
+ /** Задержка перед показом, мс. */
15
+ delayShowMs?: number;
16
+ /** Позиция относительно триггера. По умолчанию `bottom`. */
17
+ side?: TooltipSide;
18
+ /**
19
+ * Иконка слева от текста. Для вариантов `warning`, `danger`, `success`, `info` при отсутствии
20
+ * `icon` используется иконка статуса из `semanticStatusIcons`.
21
+ */
22
+ icon?: ReactNode;
23
+ /**
24
+ * Показать иконку слева. Для semantic-вариантов по умолчанию `true`, для `default` / `outline` — `false`.
25
+ * Явный `false` скрывает и кастомную `icon`, и семантическую.
26
+ */
27
+ showIcon?: boolean;
28
+ };
29
+ export type TooltipTriggerProps = HTMLAttributes<HTMLSpanElement>;
30
+ export type TooltipContentProps = HTMLAttributes<HTMLDivElement>;
31
+ declare function TooltipRoot({ children, size, variant, delayShowMs, side, icon, showIcon, }: TooltipRootProps): import("react/jsx-runtime").JSX.Element;
32
+ declare function TooltipFloater({ className, children, ...rest }: TooltipContentProps): import('react').ReactPortal | null;
33
+ /** Всплывающая подсказка по hover; паттерны фона совпадают с `Alert`. */
34
+ export declare const Tooltip: typeof TooltipRoot & {
35
+ Trigger: import('react').ForwardRefExoticComponent<TooltipTriggerProps & import('react').RefAttributes<HTMLSpanElement>>;
36
+ Content: typeof TooltipFloater;
37
+ };
38
+ export {};
@@ -0,0 +1 @@
1
+ export { Tooltip, type TooltipVariant, type TooltipSize, type TooltipSide, type TooltipRootProps, type TooltipTriggerProps, type TooltipContentProps, } from './Tooltip';
@@ -0,0 +1,10 @@
1
+ /** Положение сегмента в склеенной группе (`Button`, `ButtonGroup.Text`, смежные элементы формы в тулбарах). */
2
+ export type ButtonGroupSegment = Readonly<{
3
+ orientation: "horizontal" | "vertical";
4
+ position: "first" | "middle" | "last" | "only";
5
+ }>;
6
+ /** Радиус обрезки Ripple / overflow — совпадает с краем кнопки. */
7
+ export declare function buttonGroupRoundingClasses(seg: ButtonGroupSegment | undefined): string;
8
+ /** Убираем сдвоенную линию у внутренних стыков. */
9
+ export declare function buttonGroupOverlapBorderClasses(seg: ButtonGroupSegment | undefined): string;
10
+ export declare function buttonGroupTextSurfaceClasses(seg: ButtonGroupSegment | undefined): string;
@@ -0,0 +1,60 @@
1
+ import { MutableRefObject, RefObject, PointerEvent as ReactPointerEvent } from 'react';
2
+ /**
3
+ * Значения `box-shadow` для анимации при hover.
4
+ * `null` означает «не анимировать тень» (для outline / ghost вариантов).
5
+ * Берём из CSS-переменных (поддерживают тему), но anime.js требует конкретную строку —
6
+ * поэтому передаём их явно через `getComputedStyle` при вызове.
7
+ */
8
+ export interface HoverShadowConfig {
9
+ /**
10
+ * box-shadow в покое (второй уровень — sm; hover-only — см. `SHADOW_NONE`).
11
+ * Если undefined — используется `SHADOW_NONE()` (не `none`: иначе transition не работает).
12
+ */
13
+ idle?: string;
14
+ /** box-shadow при hover. */
15
+ hover: string;
16
+ }
17
+ /** «Пустая» тень: визуально как без тени, но интерполируется с `--shadow-sm`. */
18
+ export declare const SHADOW_NONE: () => string;
19
+ export declare const SHADOW_SM: () => string;
20
+ export declare const SHADOW_MD: () => string;
21
+ export declare const SHADOW_LG: () => string;
22
+ /**
23
+ * Выставляет начальное значение `--el-shadow` на элементе.
24
+ * Вызывайте после маунта для компонентов с постоянной тенью (Alert, Badge, Tooltip).
25
+ * Класс `animate-shadow` (или свой `transition` с `box-shadow`, см. `button-idle-surface-transition`) — плавная смена тени.
26
+ */
27
+ export declare function initElementShadow(element: HTMLElement | null, shadow: string): void;
28
+ /** @deprecated Используйте `MOTION_INTERACTIVE_MS` из `motionTokens` */
29
+ export declare const INTERACTIVE_HOVER_LIFT_MS = 280;
30
+ /** @deprecated Используйте `MOTION_INTERACTIVE_EASE` */
31
+ export declare const INTERACTIVE_HOVER_LIFT_EASE: "out(2)";
32
+ /** @deprecated Используйте `MOTION_HOVER_LIFT_SCALE` */
33
+ export declare const INTERACTIVE_HOVER_LIFT_SCALE = 1.015;
34
+ export declare function prefersReducedInteractiveHoverLift(): boolean;
35
+ /**
36
+ * `remove(target)` затем плавное масштабирование только по scale (без смещения).
37
+ * Для более крупного подъёма (напр. бейдж на якоре) передайте `liftScale` без изменения дефолта кнопок.
38
+ * Опционально: `shadow` — конфиг для плавного изменения `box-shadow` вместе со scale.
39
+ */
40
+ export declare function animateInteractiveHoverLift(element: HTMLElement, lifted: boolean, liftScale?: number, shadow?: HoverShadowConfig): void;
41
+ /**
42
+ * Короткий «сжимающий» импульс при pointer down (`MOTION_PRESS_SQUEEZE_SCALE`).
43
+ * Возвращает промис окончания анимации.
44
+ */
45
+ export declare function animateInteractivePressSqueeze(element: HTMLElement): import('animejs').JSAnimation;
46
+ /** Возвращённые обработчики вешайте на тот же корень, где был бы `pointer` у Button (`currentTarget`). */
47
+ export declare function useInteractiveHoverLiftContainerHandlers<Element extends HTMLElement = HTMLElement>(liftedRef: RefObject<HTMLElement | null>, enabled: boolean, pointerInsideRef?: MutableRefObject<boolean>,
48
+ /** По умолчанию `MOTION_HOVER_LIFT_SCALE` из `motionTokens`. */
49
+ liftScale?: number, shadow?: HoverShadowConfig): {
50
+ onPointerOver: (e: ReactPointerEvent<Element>) => void;
51
+ onPointerOut: (e: ReactPointerEvent<Element>) => void;
52
+ };
53
+ /**
54
+ * @deprecated Первый аргумент не используйте — оставлен для совместимости. Спредьте результат на корень: `{...handlers}`.
55
+ * Раньше слушатель вешался в `useEffect`; теперь те же правила что у `Button` (`onPointerOver` / `onPointerOut` на элементе).
56
+ */
57
+ export declare function useInteractiveHoverLiftOnContainer(containerRef: RefObject<HTMLElement | null>, liftedRef: RefObject<HTMLElement | null>, enabled: boolean, pointerInsideRef?: MutableRefObject<boolean>, liftScale?: number): {
58
+ onPointerOver: (e: ReactPointerEvent<HTMLElement>) => void;
59
+ onPointerOut: (e: ReactPointerEvent<HTMLElement>) => void;
60
+ };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Общие параметры анимаций (anime.js + согласованные CSS-где нужно).
3
+ */
4
+ export declare const MOTION_INTERACTIVE_MS = 280;
5
+ export declare const MOTION_INTERACTIVE_EASE: "out(2)";
6
+ /** Fade появление / скрытие Tooltip (portal). */
7
+ export declare const MOTION_TOOLTIP_MS = 200;
8
+ export declare const MOTION_HOVER_LIFT_SCALE = 1.015;
9
+ /** Hover-lift прямого `Badge` внутри `Badge.Anchor` — чуть сильнее, чем у кнопок/карт. */
10
+ export declare const MOTION_BADGE_ANCHOR_HOVER_LIFT_SCALE = 1.052;
11
+ /** Ключевые кадры squeeze: покой → сжатие → покой */
12
+ export declare const MOTION_PRESS_SQUEEZE_SCALE: readonly [1, 0.98, 1];
13
+ /** Нижняя граница масштаба: круг не сходится в математическую точку, остаётся мягкое «ядро». */
14
+ export declare const MOTION_RIPPLE_MIN_SCALE = 0.12;
15
+ export declare const MOTION_RIPPLE_DEFAULT_DURATION_MS = 540;
16
+ export declare const MOTION_RIPPLE_DEFAULT_OPACITY_FROM = 0.42;
17
+ /** Слегка длиннее/мягче для широкого тригера (Expandable) */
18
+ export declare const MOTION_RIPPLE_EXPANDABLE_DURATION_MS = 700;
19
+ export declare const MOTION_RIPPLE_EXPANDABLE_OPACITY_FROM = 0.34;
20
+ /** Easing точки сходимости — тот же профиль, что в CSS keyframes async-ripple у Button */
21
+ export declare const MOTION_RIPPLE_EASE_CSS = "cubic-bezier(0.25, 0.55, 0.35, 0.95)";
22
+ export declare const MOTION_RIPPLE_EASE: import('animejs').EasingFunction;
23
+ /** Круг разлёта success/error после async (чистый CSS в Button) */
24
+ export declare const MOTION_FEEDBACK_EXPAND_MS = 720;
@@ -0,0 +1,19 @@
1
+ import { PointerEvent } from 'react';
2
+ export type RippleDirection = "in" | "out";
3
+ export type ConvergeRipple = {
4
+ id: number;
5
+ x: number;
6
+ y: number;
7
+ size: number;
8
+ };
9
+ export declare function createConvergeRippleAtPointer(target: HTMLElement, clientX: number, clientY: number, id: number): ConvergeRipple;
10
+ /** Только в синхронной фазе обработчика: позже `e.currentTarget` у React может стать `null`. */
11
+ export declare function createConvergeRippleFromPointer(e: PointerEvent<HTMLElement>, id: number): ConvergeRipple | null;
12
+ export declare function ConvergeRippleLayer({ ripples, tone, onDone, durationMs, opacityFrom, direction, }: {
13
+ ripples: ConvergeRipple[];
14
+ tone: string;
15
+ onDone: (id: number) => void;
16
+ durationMs?: number;
17
+ opacityFrom?: number;
18
+ direction?: RippleDirection;
19
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { IconType } from 'react-icons';
2
+ /** Семантические статусы с собственной иконкой и цветом (размер задаётся в компоненте через `className`). */
3
+ export type SemanticStatus = "danger" | "success" | "info" | "warning";
4
+ export declare const SEMANTIC_STATUS_ICONS: Record<SemanticStatus, IconType>;
5
+ export declare const SEMANTIC_STATUS_ICON_TEXT_CLASS: Record<SemanticStatus, string>;
@@ -0,0 +1,13 @@
1
+ import { PointerEvent } from 'react';
2
+ import { ConvergeRipple } from './pressRipple';
3
+ /**
4
+ * Состояние и пуш новых рипплов от pointer; геометрию читаем **синхронно** в обработчике —
5
+ * в deferred-апдейтере `setState` у React `e.currentTarget` уже может быть `null`.
6
+ */
7
+ export declare function useConvergeRipples(): {
8
+ ripples: ConvergeRipple[];
9
+ pushFromPointer: (e: PointerEvent<HTMLElement>) => void;
10
+ /** Геометрия относительно `target` (обычно корень интерактива: кнопка, карточка). */
11
+ pushAtClientCoords: (target: HTMLElement, clientX: number, clientY: number) => void;
12
+ dismiss: (id: number) => void;
13
+ };