@atme-lab/ui-kit 0.1.8 → 0.1.10
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/dist/components/content/ArticlePreview/ArticlePreview.d.ts +13 -0
- package/dist/components/content/ArticlePreview/components/ArticlePreviewContent/ArticlePreviewContent.d.ts +14 -0
- package/dist/components/content/ArticlePreview/components/ArticlePreviewContent/index.d.ts +2 -0
- package/dist/components/content/ArticlePreview/components/index.d.ts +2 -0
- package/dist/components/content/ArticlePreview/index.d.ts +2 -0
- package/dist/components/content/index.d.ts +2 -0
- package/dist/components/index.d.ts +21 -0
- package/dist/components/layout/Grid/Grid.d.ts +21 -0
- package/dist/components/layout/Grid/index.d.ts +2 -0
- package/dist/components/layout/Island/Island.d.ts +13 -0
- package/dist/components/layout/Island/index.d.ts +2 -0
- package/dist/components/layout/Stack/Stack.d.ts +19 -0
- package/dist/components/layout/Stack/index.d.ts +2 -0
- package/dist/components/layout/WindowFrame/WindowFrame.d.ts +8 -0
- package/dist/components/layout/WindowFrame/components/ActionButton/ActionButton.d.ts +7 -0
- package/dist/components/layout/WindowFrame/components/ActionButton/index.d.ts +1 -0
- package/dist/components/layout/WindowFrame/components/TitleBar/TitleBar.d.ts +7 -0
- package/dist/components/layout/WindowFrame/components/TitleBar/index.d.ts +1 -0
- package/dist/components/layout/WindowFrame/components/index.d.ts +2 -0
- package/dist/components/layout/WindowFrame/index.d.ts +1 -0
- package/dist/components/navigation/SideMenu/SideMenu.d.ts +18 -0
- package/dist/components/navigation/SideMenu/SideMenuItem.d.ts +16 -0
- package/dist/components/navigation/SideMenu/index.d.ts +2 -0
- package/dist/components/navigation/index.d.ts +2 -0
- package/dist/components/primitives/Button/Button.d.ts +13 -0
- package/dist/components/primitives/Button/index.d.ts +2 -0
- package/dist/components/primitives/Icon/Icon.d.ts +9 -0
- package/dist/components/primitives/Icon/Icons/CloseIcon.d.ts +3 -0
- package/dist/components/primitives/Icon/Icons/DocumentIcon.d.ts +3 -0
- package/dist/components/primitives/Icon/Icons/FullscreenIcon.d.ts +3 -0
- package/dist/components/primitives/Icon/Icons/HeartIcon.d.ts +7 -0
- package/dist/components/primitives/Icon/Icons/HomeIcon.d.ts +3 -0
- package/dist/components/primitives/Icon/Icons/index.d.ts +6 -0
- package/dist/components/primitives/Icon/index.d.ts +2 -0
- package/dist/components/primitives/LabelMenuItem/LabelMenuItem.d.ts +11 -0
- package/dist/components/primitives/LabelMenuItem/index.d.ts +2 -0
- package/dist/components/primitives/LikeButton/LikeButton.d.ts +10 -0
- package/dist/components/primitives/LikeButton/index.d.ts +2 -0
- package/dist/components/primitives/Spacer/Spacer.d.ts +10 -0
- package/dist/components/primitives/Spacer/index.d.ts +0 -0
- package/dist/components/primitives/Tag/Tag.d.ts +16 -0
- package/dist/components/primitives/Tag/index.d.ts +2 -0
- package/dist/components/primitives/TagGroup/TagGroup.d.ts +15 -0
- package/dist/components/primitives/TagGroup/components/TagGroupItemButton.d.ts +6 -0
- package/dist/components/primitives/TagGroup/components/TagGroupItemView.d.ts +6 -0
- package/dist/components/primitives/TagGroup/components/index.d.ts +4 -0
- package/dist/components/primitives/TagGroup/index.d.ts +2 -0
- package/dist/components/primitives/TagGroup/types.d.ts +9 -0
- package/dist/components/primitives/Typography/Typography.d.ts +12 -0
- package/dist/components/primitives/Typography/index.d.ts +2 -0
- package/dist/components/types.d.ts +4 -0
- package/dist/global.cjs.js +1 -1
- package/dist/global.d.ts +0 -0
- package/dist/global.esm.js +1 -1
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/useExternalLink.d.ts +16 -0
- package/dist/hooks/useMenuItem.d.ts +25 -0
- package/dist/hooks/useMenuNavigation.d.ts +16 -0
- package/dist/hooks/useMouseScale.d.ts +22 -0
- package/dist/hooks/useRovingTabIndex.d.ts +20 -0
- package/dist/hooks/useTheme.d.ts +2 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.esm.js +1 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/styles/functions/spacing.d.ts +1 -0
- package/dist/test/setup.d.ts +0 -0
- package/dist/themes/ThemeProvider.d.ts +12 -0
- package/dist/themes/index.d.ts +3 -0
- package/dist/tokens/generate-css-vars.d.ts +2 -0
- package/dist/tokens/index.d.ts +4 -0
- package/dist/tokens/themes/baseTheme.d.ts +2 -0
- package/dist/tokens/themes/darkTheme.d.ts +57 -0
- package/dist/tokens/themes/index.d.ts +3 -0
- package/dist/tokens/themes/lightTheme.d.ts +53 -0
- package/dist/tokens/types.d.ts +125 -0
- package/dist/tokens/utils.d.ts +3 -0
- package/dist/typings/design.d.ts +1 -0
- package/dist/utils/deepMerge.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/navigation.d.ts +1 -0
- package/package.json +6 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../types';
|
|
3
|
+
export type ArticlePreviewView = 'tile' | 'row';
|
|
4
|
+
export interface ArticlePreviewProps extends BaseComponentProps, Omit<React.AnchorHTMLAttributes<HTMLAnchorElement> & React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
5
|
+
title: string;
|
|
6
|
+
publishedAt: Date | string;
|
|
7
|
+
imageUrl?: string;
|
|
8
|
+
view?: ArticlePreviewView;
|
|
9
|
+
imageAlt?: string;
|
|
10
|
+
href?: string;
|
|
11
|
+
tags?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare const ArticlePreview: React.ForwardRefExoticComponent<ArticlePreviewProps & React.RefAttributes<HTMLAnchorElement | HTMLDivElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ArticlePreviewContentView = 'tile' | 'row';
|
|
3
|
+
export interface ArticlePreviewContentProps {
|
|
4
|
+
title: string;
|
|
5
|
+
imageUrl?: string | undefined;
|
|
6
|
+
imageAlt: string;
|
|
7
|
+
formattedDate: string;
|
|
8
|
+
view: ArticlePreviewContentView;
|
|
9
|
+
tags?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function ArticlePreviewContent({ title, imageUrl, imageAlt, formattedDate, view, tags, }: ArticlePreviewContentProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare namespace ArticlePreviewContent {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type { BaseComponentProps } from './types';
|
|
2
|
+
export { Typography } from './primitives/Typography';
|
|
3
|
+
export type { TypographyProps, TypographyVariant, TypographySize } from './primitives/Typography';
|
|
4
|
+
export { Tag } from './primitives/Tag';
|
|
5
|
+
export type { TagProps, TagVariant, TagSize } from './primitives/Tag';
|
|
6
|
+
export { TagGroup } from './primitives/TagGroup';
|
|
7
|
+
export type { TagGroupProps, TagGroupItem, TagGroupTag } from './primitives/TagGroup';
|
|
8
|
+
export { Button } from './primitives/Button';
|
|
9
|
+
export type { ButtonProps, ButtonVariant, ButtonSize } from './primitives/Button';
|
|
10
|
+
export { Icon } from './primitives/Icon';
|
|
11
|
+
export type { IconProps } from './primitives/Icon';
|
|
12
|
+
export { LabelMenuItem } from './primitives/LabelMenuItem';
|
|
13
|
+
export type { LabelMenuItemProps } from './primitives/LabelMenuItem';
|
|
14
|
+
export { LikeButton } from './primitives/LikeButton';
|
|
15
|
+
export type { LikeButtonProps } from './primitives/LikeButton';
|
|
16
|
+
export { Stack } from './layout/Stack';
|
|
17
|
+
export type { StackProps, StackDirection, StackAlign, StackJustify, StackWrap, StackGap } from './layout/Stack';
|
|
18
|
+
export { Grid } from './layout/Grid';
|
|
19
|
+
export type { GridProps, GridColumns, GridGap } from './layout/Grid';
|
|
20
|
+
export { ArticlePreview } from './content/ArticlePreview';
|
|
21
|
+
export type { ArticlePreviewProps, ArticlePreviewView } from './content/ArticlePreview';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../types';
|
|
3
|
+
export type GridGap = number | string;
|
|
4
|
+
export type GridColumns = number | {
|
|
5
|
+
xs?: number;
|
|
6
|
+
sm?: number;
|
|
7
|
+
md?: number;
|
|
8
|
+
lg?: number;
|
|
9
|
+
xl?: number;
|
|
10
|
+
"2xl"?: number;
|
|
11
|
+
};
|
|
12
|
+
type GridElement = "div" | "section" | "article" | "main" | "header" | "footer" | "aside" | "nav";
|
|
13
|
+
export interface GridProps extends BaseComponentProps, Omit<React.HTMLAttributes<HTMLDivElement>, "ref"> {
|
|
14
|
+
columns?: GridColumns;
|
|
15
|
+
gap?: GridGap;
|
|
16
|
+
minColumnWidth?: string;
|
|
17
|
+
as?: GridElement;
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseComponentProps } from '../../types';
|
|
2
|
+
import { FC, ReactNode } from 'react';
|
|
3
|
+
export type IslandSize = "sm" | "md" | "lg";
|
|
4
|
+
export type IslandVariant = "default" | "paper" | "accent";
|
|
5
|
+
export type IslandElevation = "none" | "sm" | "md" | "lg" | "xl";
|
|
6
|
+
export interface IslandProps extends BaseComponentProps {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
size?: IslandSize;
|
|
9
|
+
variant?: IslandVariant;
|
|
10
|
+
elevation?: IslandElevation;
|
|
11
|
+
bordered?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const Island: FC<IslandProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../types';
|
|
3
|
+
export type StackDirection = "row" | "column" | "row-reverse" | "column-reverse";
|
|
4
|
+
export type StackAlign = "start" | "end" | "center" | "stretch" | "baseline";
|
|
5
|
+
export type StackJustify = "start" | "end" | "center" | "between" | "around" | "evenly";
|
|
6
|
+
export type StackWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
7
|
+
export type StackGap = number | string;
|
|
8
|
+
type StackElement = "div" | "section" | "article" | "main" | "header" | "footer" | "aside" | "nav";
|
|
9
|
+
export interface StackProps extends BaseComponentProps, Omit<React.HTMLAttributes<HTMLDivElement>, "ref"> {
|
|
10
|
+
direction?: StackDirection;
|
|
11
|
+
align?: StackAlign;
|
|
12
|
+
justify?: StackJustify;
|
|
13
|
+
wrap?: StackWrap;
|
|
14
|
+
gap?: StackGap;
|
|
15
|
+
as?: StackElement;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../types';
|
|
3
|
+
export interface WindowFrameProps extends BaseComponentProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
title?: string;
|
|
6
|
+
actions?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const WindowFrame: FC<WindowFrameProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseComponentProps } from '../../../../types';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface ActionButtonProps extends BaseComponentProps, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
hint?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ActionButton: import('react').ForwardRefExoticComponent<ActionButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActionButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TitleBar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WindowFrame } from './WindowFrame';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../types';
|
|
3
|
+
export interface SideMenuItem {
|
|
4
|
+
title: string;
|
|
5
|
+
path: string;
|
|
6
|
+
isOuterLink?: boolean;
|
|
7
|
+
Icon: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
8
|
+
}
|
|
9
|
+
export interface SideMenuProps extends BaseComponentProps {
|
|
10
|
+
items: SideMenuItem[];
|
|
11
|
+
defaultItemSize?: number;
|
|
12
|
+
maxScale?: number;
|
|
13
|
+
showTitles?: boolean;
|
|
14
|
+
orientation?: "horizontal" | "vertical";
|
|
15
|
+
onItemClick?: (item: SideMenuItem, index: number) => void;
|
|
16
|
+
onNavigate?: (url: string) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const SideMenu: React.FC<SideMenuProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SideMenuItem as SideMenuItemType } from './SideMenu';
|
|
3
|
+
export interface SideMenuItemProps {
|
|
4
|
+
item: SideMenuItemType;
|
|
5
|
+
index: number;
|
|
6
|
+
size: number;
|
|
7
|
+
showTitles: boolean;
|
|
8
|
+
orientation: "horizontal" | "vertical";
|
|
9
|
+
onItemClick?: (item: SideMenuItemType, index: number) => void;
|
|
10
|
+
onNavigate?: (url: string) => void;
|
|
11
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLElement>, index: number) => void;
|
|
12
|
+
tabIndex: number;
|
|
13
|
+
itemRef?: (el: HTMLLIElement | null) => void;
|
|
14
|
+
linkRef?: (el: HTMLAnchorElement | HTMLButtonElement | null) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const SideMenuItem: React.ForwardRefExoticComponent<SideMenuItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ButtonVariant = "primary" | "secondary" | "outline" | "ghost";
|
|
3
|
+
export type ButtonSize = "sm" | "md" | "lg";
|
|
4
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
variant?: ButtonVariant;
|
|
6
|
+
size?: ButtonSize;
|
|
7
|
+
startIcon?: React.ReactNode;
|
|
8
|
+
endIcon?: React.ReactNode;
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
3
|
+
color?: string;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
svg?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
decorative?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const Icon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IconProps } from '../Icon';
|
|
3
|
+
export interface HeartIconProps extends Omit<IconProps, 'children' | 'svg'> {
|
|
4
|
+
/** Залитое сердечко (лайк поставлен) */
|
|
5
|
+
filled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const HeartIcon: React.FC<HeartIconProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { DocumentIcon } from './DocumentIcon';
|
|
2
|
+
export { CloseIcon } from './CloseIcon';
|
|
3
|
+
export { HomeIcon } from './HomeIcon';
|
|
4
|
+
export { FullscreenIcon } from './FullscreenIcon';
|
|
5
|
+
export { HeartIcon } from './HeartIcon';
|
|
6
|
+
export type { HeartIconProps } from './HeartIcon';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IconProps } from '../Icon';
|
|
3
|
+
export interface LabelMenuItemProps {
|
|
4
|
+
label: string;
|
|
5
|
+
icon: React.ComponentType<Partial<IconProps>>;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
iconSize?: string | number;
|
|
10
|
+
}
|
|
11
|
+
export declare const LabelMenuItem: React.FC<LabelMenuItemProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../types';
|
|
3
|
+
export interface LikeButtonProps extends BaseComponentProps, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'children'> {
|
|
4
|
+
liked?: boolean;
|
|
5
|
+
defaultLiked?: boolean;
|
|
6
|
+
count?: number;
|
|
7
|
+
onLike?: (liked: boolean) => void;
|
|
8
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const LikeButton: React.ForwardRefExoticComponent<LikeButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseComponentProps } from '../../types';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { SpacingVariant } from '../../../typings/design';
|
|
4
|
+
export interface SpacerProps extends BaseComponentProps {
|
|
5
|
+
size?: SpacingVariant;
|
|
6
|
+
x?: SpacingVariant;
|
|
7
|
+
y?: SpacingVariant;
|
|
8
|
+
axis?: "x" | "y";
|
|
9
|
+
}
|
|
10
|
+
export declare const Spacer: FC<SpacerProps>;
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type TagVariant = "primary" | "secondary" | "success" | "warning" | "error" | "neutral";
|
|
3
|
+
export type TagSize = "sm" | "md" | "lg";
|
|
4
|
+
export interface TagProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
variant?: TagVariant;
|
|
6
|
+
size?: TagSize;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
iconPosition?: "left" | "right";
|
|
9
|
+
closeable?: boolean;
|
|
10
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
href?: string;
|
|
13
|
+
}
|
|
14
|
+
type TagRootElement = HTMLAnchorElement | HTMLSpanElement;
|
|
15
|
+
export declare const Tag: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<TagRootElement>>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TagProps } from '../Tag';
|
|
3
|
+
import { TagGroupTag } from './types';
|
|
4
|
+
export type { TagGroupItem, TagGroupTag } from './types';
|
|
5
|
+
export { isTagGroupItem } from './types';
|
|
6
|
+
export interface TagGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
tags: TagGroupTag[];
|
|
8
|
+
maxVisible?: number;
|
|
9
|
+
overflowTagProps?: Omit<TagProps, "children">;
|
|
10
|
+
collapseTagProps?: Omit<TagProps, "children">;
|
|
11
|
+
collapseText?: string;
|
|
12
|
+
size?: TagProps["size"];
|
|
13
|
+
variant?: TagProps["variant"];
|
|
14
|
+
}
|
|
15
|
+
export declare const TagGroup: React.ForwardRefExoticComponent<TagGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TagGroupItem, TagGroupBaseTagProps } from '../types';
|
|
2
|
+
export interface TagGroupItemButtonProps {
|
|
3
|
+
tag: TagGroupItem;
|
|
4
|
+
baseTagProps: TagGroupBaseTagProps;
|
|
5
|
+
}
|
|
6
|
+
export declare function TagGroupItemButton({ tag, baseTagProps }: TagGroupItemButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TagGroupTag, TagGroupBaseTagProps } from '../types';
|
|
2
|
+
export interface TagGroupItemViewProps {
|
|
3
|
+
tag: TagGroupTag;
|
|
4
|
+
baseTagProps: TagGroupBaseTagProps;
|
|
5
|
+
}
|
|
6
|
+
export declare function TagGroupItemView({ tag, baseTagProps }: TagGroupItemViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TagProps } from '../Tag';
|
|
2
|
+
export interface TagGroupItem {
|
|
3
|
+
label: React.ReactNode;
|
|
4
|
+
href?: string;
|
|
5
|
+
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
6
|
+
}
|
|
7
|
+
export type TagGroupTag = React.ReactNode | TagGroupItem;
|
|
8
|
+
export declare function isTagGroupItem(tag: TagGroupTag): tag is TagGroupItem;
|
|
9
|
+
export type TagGroupBaseTagProps = Partial<Pick<TagProps, "size" | "variant">>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type TypographyVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "body" | "caption" | "overline";
|
|
3
|
+
export type TypographySize = "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
4
|
+
export type TypographyColor = "primary" | "secondary" | "disabled";
|
|
5
|
+
export interface TypographyProps extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
+
variant?: TypographyVariant;
|
|
7
|
+
size?: TypographySize;
|
|
8
|
+
color?: TypographyColor;
|
|
9
|
+
as?: React.ElementType;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const Typography: React.ForwardRefExoticComponent<TypographyProps & React.RefAttributes<HTMLElement>>;
|
package/dist/global.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use client";"use strict";
|
|
2
2
|
//# sourceMappingURL=global.cjs.js.map
|
package/dist/global.d.ts
ADDED
|
File without changes
|
package/dist/global.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
//# sourceMappingURL=global.esm.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { useTheme } from './useTheme';
|
|
2
|
+
export { useMouseScale } from './useMouseScale';
|
|
3
|
+
export { useMenuNavigation } from './useMenuNavigation';
|
|
4
|
+
export { useRovingTabIndex } from './useRovingTabIndex';
|
|
5
|
+
export { useExternalLink } from './useExternalLink';
|
|
6
|
+
export { useMenuItem } from './useMenuItem';
|
|
7
|
+
export type { UseMouseScaleOptions, UseMouseScaleReturn } from './useMouseScale';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface UseExternalLinkOptions {
|
|
2
|
+
onNavigate?: (url: string) => void;
|
|
3
|
+
}
|
|
4
|
+
export interface UseExternalLinkReturn {
|
|
5
|
+
openLink: (url: string) => void;
|
|
6
|
+
shouldUseButton: (isOuterLink?: boolean) => boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Хук для работы с внешними ссылками.
|
|
10
|
+
* Определяет, нужно ли использовать button вместо ссылки,
|
|
11
|
+
* и предоставляет функцию для открытия ссылок.
|
|
12
|
+
*
|
|
13
|
+
* @param options - Опции для настройки работы с ссылками
|
|
14
|
+
* @returns Утилиты для работы с внешними ссылками
|
|
15
|
+
*/
|
|
16
|
+
export declare function useExternalLink({ onNavigate, }?: UseExternalLinkOptions): UseExternalLinkReturn;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SideMenuItem as SideMenuItemType } from '../components/navigation/SideMenu/SideMenu';
|
|
2
|
+
export interface UseMenuItemOptions {
|
|
3
|
+
item: SideMenuItemType;
|
|
4
|
+
index: number;
|
|
5
|
+
onItemClick?: ((item: SideMenuItemType, index: number) => void) | undefined;
|
|
6
|
+
onNavigate?: ((url: string) => void) | undefined;
|
|
7
|
+
}
|
|
8
|
+
export interface UseMenuItemReturn {
|
|
9
|
+
elementType: "button" | "a";
|
|
10
|
+
handleClick: (e: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
11
|
+
handleActivate: () => void;
|
|
12
|
+
linkProps: {
|
|
13
|
+
href?: string;
|
|
14
|
+
target?: string;
|
|
15
|
+
rel?: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Хук для определения логики элемента меню.
|
|
20
|
+
* Определяет тип элемента (button или a) и обрабатывает активацию.
|
|
21
|
+
*
|
|
22
|
+
* @param options - Опции для настройки элемента меню
|
|
23
|
+
* @returns Логика для элемента меню
|
|
24
|
+
*/
|
|
25
|
+
export declare function useMenuItem({ item, index, onItemClick, onNavigate, }: UseMenuItemOptions): UseMenuItemReturn;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface UseMenuNavigationOptions {
|
|
2
|
+
itemsCount: number;
|
|
3
|
+
orientation: "horizontal" | "vertical";
|
|
4
|
+
onNavigate?: (index: number) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface UseMenuNavigationReturn {
|
|
7
|
+
handleNavigationKeyDown: (e: React.KeyboardEvent, currentIndex: number) => number | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Хук для обработки навигации по меню с помощью клавиатуры.
|
|
11
|
+
* Поддерживает стрелки, Home, End с циклической навигацией.
|
|
12
|
+
*
|
|
13
|
+
* @param options - Опции для настройки навигации
|
|
14
|
+
* @returns Обработчик навигации по клавиатуре
|
|
15
|
+
*/
|
|
16
|
+
export declare function useMenuNavigation({ itemsCount, orientation, onNavigate, }: UseMenuNavigationOptions): UseMenuNavigationReturn;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export interface UseMouseScaleOptions {
|
|
3
|
+
itemRefs: RefObject<(HTMLElement | null)[]>;
|
|
4
|
+
containerRef: RefObject<HTMLElement>;
|
|
5
|
+
defaultSize: number;
|
|
6
|
+
maxScale?: number;
|
|
7
|
+
orientation?: "horizontal" | "vertical";
|
|
8
|
+
animationClassName?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface UseMouseScaleReturn {
|
|
11
|
+
handleMouseEnter: () => void;
|
|
12
|
+
handleMouseMove: (e: React.MouseEvent<HTMLElement>) => void;
|
|
13
|
+
handleMouseLeave: () => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Хук для создания интерактивного масштабирования элементов при движении мыши.
|
|
17
|
+
* Элементы увеличиваются пропорционально близости курсора к их центру.
|
|
18
|
+
*
|
|
19
|
+
* @param options - Опции для настройки масштабирования
|
|
20
|
+
* @returns Обработчики событий мыши для привязки к контейнеру
|
|
21
|
+
*/
|
|
22
|
+
export declare function useMouseScale({ itemRefs, containerRef, defaultSize, maxScale, orientation, animationClassName, }: UseMouseScaleOptions): UseMouseScaleReturn;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export interface UseRovingTabIndexOptions {
|
|
3
|
+
itemsCount: number;
|
|
4
|
+
initialFocusedIndex?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface UseRovingTabIndexReturn {
|
|
7
|
+
focusedIndex: number | null;
|
|
8
|
+
setFocusedIndex: (index: number) => void;
|
|
9
|
+
getTabIndex: (index: number) => number;
|
|
10
|
+
focusItem: (index: number, refs: RefObject<(HTMLElement | null)[]>) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Хук для управления roving tabindex паттерном.
|
|
14
|
+
* Обеспечивает, что только один элемент в меню имеет tabIndex={0},
|
|
15
|
+
* остальные имеют tabIndex={-1}.
|
|
16
|
+
*
|
|
17
|
+
* @param options - Опции для настройки roving tabindex
|
|
18
|
+
* @returns Утилиты для управления фокусом
|
|
19
|
+
*/
|
|
20
|
+
export declare function useRovingTabIndex({ initialFocusedIndex, }: UseRovingTabIndexOptions): UseRovingTabIndexReturn;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react");function Ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ot={exports:{}},Z={};/**
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react");function Ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ot={exports:{}},Z={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './components';
|
|
2
|
+
export * from './themes';
|
|
3
|
+
export type { Theme, Palette, Spacing, Typography as TypographyTokens, Shadows, BorderRadius, Transitions, ZIndex, } from './tokens/types';
|
|
4
|
+
export { baseTheme, lightTheme, darkTheme } from './tokens/themes';
|
|
5
|
+
export { mergeTheme } from './tokens/utils';
|
|
6
|
+
export { themeToCssVars } from './tokens/generate-css-vars';
|
package/dist/index.esm.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import U, { forwardRef as F, useCallback as $, useState as ut, useMemo as H, createContext as $e, useEffect as Fe, useContext as Be } from "react";
|
|
2
3
|
function Le(e) {
|
|
3
4
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|