@mrktg-common/internal-ui 0.0.0-stage → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -2
- package/dist/Alert.d.ts +18 -0
- package/dist/Alert.js +12 -0
- package/dist/Badge.d.ts +28 -0
- package/dist/Badge.js +23 -0
- package/dist/Banner.d.ts +16 -0
- package/dist/Banner.js +6 -0
- package/dist/BrandName.d.ts +9 -0
- package/dist/BrandName.js +10 -0
- package/dist/Breadcrumbs.d.ts +20 -0
- package/dist/Breadcrumbs.js +9 -0
- package/dist/Button.d.ts +25 -0
- package/dist/Button.js +25 -0
- package/dist/Card.d.ts +22 -0
- package/dist/Card.js +10 -0
- package/dist/CenteredCard.d.ts +12 -0
- package/dist/CenteredCard.js +6 -0
- package/dist/ChangeBlock.d.ts +16 -0
- package/dist/ChangeBlock.js +8 -0
- package/dist/CopyField.d.ts +16 -0
- package/dist/CopyField.js +20 -0
- package/dist/Dropzone.d.ts +31 -0
- package/dist/Dropzone.js +66 -0
- package/dist/EmptyState.d.ts +13 -0
- package/dist/EmptyState.js +5 -0
- package/dist/EnvTag.d.ts +18 -0
- package/dist/EnvTag.js +11 -0
- package/dist/Field.d.ts +52 -0
- package/dist/Field.js +47 -0
- package/dist/FileRow.d.ts +29 -0
- package/dist/FileRow.js +9 -0
- package/dist/Header.d.ts +46 -0
- package/dist/Header.js +11 -0
- package/dist/Menu.d.ts +36 -0
- package/dist/Menu.js +47 -0
- package/dist/Modal.d.ts +26 -0
- package/dist/Modal.js +66 -0
- package/dist/MultiSelectMenu.d.ts +32 -0
- package/dist/MultiSelectMenu.js +17 -0
- package/dist/Popover.d.ts +26 -0
- package/dist/Popover.js +42 -0
- package/dist/Progress.d.ts +26 -0
- package/dist/Progress.js +39 -0
- package/dist/ResultReport.d.ts +30 -0
- package/dist/ResultReport.js +13 -0
- package/dist/Search.d.ts +12 -0
- package/dist/Search.js +32 -0
- package/dist/Segmented.d.ts +27 -0
- package/dist/Segmented.js +17 -0
- package/dist/SelectMenu.d.ts +52 -0
- package/dist/SelectMenu.js +154 -0
- package/dist/Skeleton.d.ts +12 -0
- package/dist/Skeleton.js +6 -0
- package/dist/Spinner.d.ts +12 -0
- package/dist/Spinner.js +10 -0
- package/dist/Steps.d.ts +21 -0
- package/dist/Steps.js +11 -0
- package/dist/Switch.d.ts +11 -0
- package/dist/Switch.js +14 -0
- package/dist/Table.d.ts +59 -0
- package/dist/Table.js +39 -0
- package/dist/Tabs.d.ts +20 -0
- package/dist/Tabs.js +25 -0
- package/dist/Toast.d.ts +38 -0
- package/dist/Toast.js +79 -0
- package/dist/Tooltip.d.ts +18 -0
- package/dist/Tooltip.js +58 -0
- package/dist/UserMenu.d.ts +27 -0
- package/dist/UserMenu.js +28 -0
- package/dist/components.css +527 -0
- package/dist/cx.d.ts +2 -0
- package/dist/cx.js +4 -0
- package/dist/files.d.ts +4 -0
- package/dist/files.js +28 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.js +39 -0
- package/dist/portal.d.ts +8 -0
- package/dist/portal.js +12 -0
- package/dist/theme.d.ts +25 -0
- package/dist/theme.js +68 -0
- package/dist/themeScript.d.ts +9 -0
- package/dist/themeScript.js +13 -0
- package/dist/tokens.css +118 -0
- package/package.json +67 -4
- package/tokens/tokens.json +589 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export { cx } from './cx.ts';
|
|
2
|
+
export { FixedPortal } from './portal.tsx';
|
|
3
|
+
export { ThemeProvider, useTheme, localThemeStorage, resolveTheme } from './theme.tsx';
|
|
4
|
+
export { themeScript, isThemeChoice, THEME_STORAGE_KEY } from './themeScript.ts';
|
|
5
|
+
export type { TThemeChoice, TResolvedTheme, IThemeStorage, TThemeApi } from './theme.tsx';
|
|
6
|
+
export { Header, HeaderNav } from './Header.tsx';
|
|
7
|
+
export type { IHeaderProps, TLinkProps, TLinkComponent, TNavItem } from './Header.tsx';
|
|
8
|
+
export { Breadcrumbs } from './Breadcrumbs.tsx';
|
|
9
|
+
export type { IBreadcrumbsProps, TCrumb } from './Breadcrumbs.tsx';
|
|
10
|
+
export { UserMenu, initials } from './UserMenu.tsx';
|
|
11
|
+
export type { IUserMenuProps, TUserRole } from './UserMenu.tsx';
|
|
12
|
+
export { Button, buttonClass } from './Button.tsx';
|
|
13
|
+
export type { IButtonProps, IButtonStyle, TButtonVariant, TButtonSize } from './Button.tsx';
|
|
14
|
+
export { Field, TextField, Input, Textarea, Checkbox, controlClass } from './Field.tsx';
|
|
15
|
+
export type { IFieldProps, ITextFieldProps, TInputProps, TTextareaProps, ICheckboxProps, IControlStyle, TControlSize } from './Field.tsx';
|
|
16
|
+
export { Search } from './Search.tsx';
|
|
17
|
+
export type { ISearchProps } from './Search.tsx';
|
|
18
|
+
export { Switch } from './Switch.tsx';
|
|
19
|
+
export type { ISwitchProps } from './Switch.tsx';
|
|
20
|
+
export { Segmented } from './Segmented.tsx';
|
|
21
|
+
export type { ISegmentedProps, TSegment } from './Segmented.tsx';
|
|
22
|
+
export { Popover, MENU_ITEMS } from './Popover.tsx';
|
|
23
|
+
export type { IPopoverProps } from './Popover.tsx';
|
|
24
|
+
export { Menu, MenuItem, MenuSeparator, MenuLabel, moveMenuFocus } from './Menu.tsx';
|
|
25
|
+
export type { IMenuProps, IMenuItemProps } from './Menu.tsx';
|
|
26
|
+
export { SelectMenu } from './SelectMenu.tsx';
|
|
27
|
+
export type { ISelectMenuProps, TSelectMenuItem, TSelectMenuGroup } from './SelectMenu.tsx';
|
|
28
|
+
export { MultiSelectMenu } from './MultiSelectMenu.tsx';
|
|
29
|
+
export type { IMultiSelectMenuProps, TMultiSelectOption, TMultiSelectGroup } from './MultiSelectMenu.tsx';
|
|
30
|
+
export { Badge, StatusBadge } from './Badge.tsx';
|
|
31
|
+
export type { IBadgeProps, IStatusBadgeProps, TBadgeTone, TBadgeMark, TStatus } from './Badge.tsx';
|
|
32
|
+
export { EnvPill, EnvChip } from './EnvTag.tsx';
|
|
33
|
+
export type { IEnvPillProps } from './EnvTag.tsx';
|
|
34
|
+
export { BrandName } from './BrandName.tsx';
|
|
35
|
+
export type { IBrandNameProps } from './BrandName.tsx';
|
|
36
|
+
export { Alert } from './Alert.tsx';
|
|
37
|
+
export type { IAlertProps, TAlertTone } from './Alert.tsx';
|
|
38
|
+
export { Banner } from './Banner.tsx';
|
|
39
|
+
export type { IBannerProps, TBannerTone } from './Banner.tsx';
|
|
40
|
+
export { ToastProvider, useToast, toastDuration, TOAST_MS, TOAST_UNDO_MS, MAX_TOASTS } from './Toast.tsx';
|
|
41
|
+
export type { TToast, TToastApi, TToastTone, TToastAction } from './Toast.tsx';
|
|
42
|
+
export { Tooltip, TOOLTIP_DELAY_MS } from './Tooltip.tsx';
|
|
43
|
+
export type { ITooltipProps } from './Tooltip.tsx';
|
|
44
|
+
export { Skeleton } from './Skeleton.tsx';
|
|
45
|
+
export type { ISkeletonProps } from './Skeleton.tsx';
|
|
46
|
+
export { EmptyState } from './EmptyState.tsx';
|
|
47
|
+
export type { IEmptyStateProps } from './EmptyState.tsx';
|
|
48
|
+
export { Spinner, Loading } from './Spinner.tsx';
|
|
49
|
+
export type { ISpinnerProps } from './Spinner.tsx';
|
|
50
|
+
export { CenteredCard } from './CenteredCard.tsx';
|
|
51
|
+
export type { ICenteredCardProps } from './CenteredCard.tsx';
|
|
52
|
+
export { Card, Facts } from './Card.tsx';
|
|
53
|
+
export type { ICardProps, TFact } from './Card.tsx';
|
|
54
|
+
export { Tabs } from './Tabs.tsx';
|
|
55
|
+
export type { ITabsProps, TTab } from './Tabs.tsx';
|
|
56
|
+
export { CopyField, COPIED_MS } from './CopyField.tsx';
|
|
57
|
+
export type { ICopyFieldProps } from './CopyField.tsx';
|
|
58
|
+
export { Modal } from './Modal.tsx';
|
|
59
|
+
export type { IModalProps, TModalSize } from './Modal.tsx';
|
|
60
|
+
export { ChangeBlock } from './ChangeBlock.tsx';
|
|
61
|
+
export type { IChangeBlockProps, TChangeSide } from './ChangeBlock.tsx';
|
|
62
|
+
export { Table, TableCell } from './Table.tsx';
|
|
63
|
+
export type { ITableProps, TTableColumn, TTableGroup, TTableSort, TSortDirection } from './Table.tsx';
|
|
64
|
+
export { Dropzone } from './Dropzone.tsx';
|
|
65
|
+
export type { IDropzoneProps } from './Dropzone.tsx';
|
|
66
|
+
export { FileRow } from './FileRow.tsx';
|
|
67
|
+
export type { IFileRowProps, TFileUpload } from './FileRow.tsx';
|
|
68
|
+
export { Progress, ProgressLabel, Countdown } from './Progress.tsx';
|
|
69
|
+
export type { IProgressProps, ICountdownProps } from './Progress.tsx';
|
|
70
|
+
export { ResultReport, ReportRow } from './ResultReport.tsx';
|
|
71
|
+
export type { IResultReportProps, IReportRowProps, TReportTone, TReportPath } from './ResultReport.tsx';
|
|
72
|
+
export { Steps, Step } from './Steps.tsx';
|
|
73
|
+
export type { IStepProps, TStepState } from './Steps.tsx';
|
|
74
|
+
export { formatBytes, matchesAccept } from './files.ts';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { cx } from './cx.js';
|
|
2
|
+
export { FixedPortal } from './portal.js';
|
|
3
|
+
export { ThemeProvider, useTheme, localThemeStorage, resolveTheme } from './theme.js';
|
|
4
|
+
export { themeScript, isThemeChoice, THEME_STORAGE_KEY } from './themeScript.js';
|
|
5
|
+
export { Header, HeaderNav } from './Header.js';
|
|
6
|
+
export { Breadcrumbs } from './Breadcrumbs.js';
|
|
7
|
+
export { UserMenu, initials } from './UserMenu.js';
|
|
8
|
+
export { Button, buttonClass } from './Button.js';
|
|
9
|
+
export { Field, TextField, Input, Textarea, Checkbox, controlClass } from './Field.js';
|
|
10
|
+
export { Search } from './Search.js';
|
|
11
|
+
export { Switch } from './Switch.js';
|
|
12
|
+
export { Segmented } from './Segmented.js';
|
|
13
|
+
export { Popover, MENU_ITEMS } from './Popover.js';
|
|
14
|
+
export { Menu, MenuItem, MenuSeparator, MenuLabel, moveMenuFocus } from './Menu.js';
|
|
15
|
+
export { SelectMenu } from './SelectMenu.js';
|
|
16
|
+
export { MultiSelectMenu } from './MultiSelectMenu.js';
|
|
17
|
+
export { Badge, StatusBadge } from './Badge.js';
|
|
18
|
+
export { EnvPill, EnvChip } from './EnvTag.js';
|
|
19
|
+
export { BrandName } from './BrandName.js';
|
|
20
|
+
export { Alert } from './Alert.js';
|
|
21
|
+
export { Banner } from './Banner.js';
|
|
22
|
+
export { ToastProvider, useToast, toastDuration, TOAST_MS, TOAST_UNDO_MS, MAX_TOASTS } from './Toast.js';
|
|
23
|
+
export { Tooltip, TOOLTIP_DELAY_MS } from './Tooltip.js';
|
|
24
|
+
export { Skeleton } from './Skeleton.js';
|
|
25
|
+
export { EmptyState } from './EmptyState.js';
|
|
26
|
+
export { Spinner, Loading } from './Spinner.js';
|
|
27
|
+
export { CenteredCard } from './CenteredCard.js';
|
|
28
|
+
export { Card, Facts } from './Card.js';
|
|
29
|
+
export { Tabs } from './Tabs.js';
|
|
30
|
+
export { CopyField, COPIED_MS } from './CopyField.js';
|
|
31
|
+
export { Modal } from './Modal.js';
|
|
32
|
+
export { ChangeBlock } from './ChangeBlock.js';
|
|
33
|
+
export { Table, TableCell } from './Table.js';
|
|
34
|
+
export { Dropzone } from './Dropzone.js';
|
|
35
|
+
export { FileRow } from './FileRow.js';
|
|
36
|
+
export { Progress, ProgressLabel, Countdown } from './Progress.js';
|
|
37
|
+
export { ResultReport, ReportRow } from './ResultReport.js';
|
|
38
|
+
export { Steps, Step } from './Steps.js';
|
|
39
|
+
export { formatBytes, matchesAccept } from './files.js';
|
package/dist/portal.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Оверлеи и стопка тостов живут в портале в body. Базовые правила системы (box-sizing, ссылки, шрифт)
|
|
4
|
+
* заданы внутри .app, поэтому портал оборачивается в .app без собственного бокса.
|
|
5
|
+
*/
|
|
6
|
+
export declare function FixedPortal({ children }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}): import("react").ReactPortal | null;
|
package/dist/portal.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
/**
|
|
5
|
+
* Оверлеи и стопка тостов живут в портале в body. Базовые правила системы (box-sizing, ссылки, шрифт)
|
|
6
|
+
* заданы внутри .app, поэтому портал оборачивается в .app без собственного бокса.
|
|
7
|
+
*/
|
|
8
|
+
export function FixedPortal({ children }) {
|
|
9
|
+
if (typeof document === 'undefined')
|
|
10
|
+
return null;
|
|
11
|
+
return createPortal(_jsx("div", { className: "app", style: { display: 'contents' }, children: children }), document.body);
|
|
12
|
+
}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type TThemeChoice } from './themeScript.ts';
|
|
3
|
+
export type { TThemeChoice } from './themeScript.ts';
|
|
4
|
+
export type TResolvedTheme = 'light' | 'dark';
|
|
5
|
+
/** Где помнить выбор темы. По умолчанию localStorage; продукт может хранить, например, в cookie. */
|
|
6
|
+
export interface IThemeStorage {
|
|
7
|
+
read: () => TThemeChoice | null;
|
|
8
|
+
write: (choice: TThemeChoice) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function localThemeStorage(key?: string): IThemeStorage;
|
|
11
|
+
export declare function resolveTheme(choice: TThemeChoice, systemDark: boolean): TResolvedTheme;
|
|
12
|
+
export type TThemeApi = {
|
|
13
|
+
choice: TThemeChoice;
|
|
14
|
+
resolved: TResolvedTheme;
|
|
15
|
+
setChoice: (choice: TThemeChoice) => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Тема всего приложения: оборачивает корень, ставит data-theme на <html>, помнит выбор,
|
|
19
|
+
* в режиме System следит за prefers-color-scheme на лету.
|
|
20
|
+
*/
|
|
21
|
+
export declare function ThemeProvider({ storage, children }: {
|
|
22
|
+
storage?: IThemeStorage;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}): import("react").JSX.Element;
|
|
25
|
+
export declare function useTheme(): TThemeApi;
|
package/dist/theme.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
4
|
+
import { DARK_QUERY, isThemeChoice, THEME_STORAGE_KEY } from './themeScript.js';
|
|
5
|
+
export function localThemeStorage(key = THEME_STORAGE_KEY) {
|
|
6
|
+
return {
|
|
7
|
+
read: () => {
|
|
8
|
+
try {
|
|
9
|
+
const value = localStorage.getItem(key);
|
|
10
|
+
return isThemeChoice(value) ? value : null;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
write: (choice) => {
|
|
17
|
+
try {
|
|
18
|
+
localStorage.setItem(key, choice);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// Не запомнилось — тема просто вернётся к системной
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function resolveTheme(choice, systemDark) {
|
|
27
|
+
if (choice === 'system')
|
|
28
|
+
return systemDark ? 'dark' : 'light';
|
|
29
|
+
return choice;
|
|
30
|
+
}
|
|
31
|
+
const defaultStorage = localThemeStorage();
|
|
32
|
+
function systemDark() {
|
|
33
|
+
return typeof window !== 'undefined' && window.matchMedia(DARK_QUERY).matches;
|
|
34
|
+
}
|
|
35
|
+
function useThemeState(storage) {
|
|
36
|
+
const [choice, setChoiceState] = useState(() => (typeof window === 'undefined' ? 'system' : (storage.read() ?? 'system')));
|
|
37
|
+
const [dark, setDark] = useState(systemDark);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
const query = window.matchMedia(DARK_QUERY);
|
|
40
|
+
const onChange = () => setDark(query.matches);
|
|
41
|
+
query.addEventListener('change', onChange);
|
|
42
|
+
return () => query.removeEventListener('change', onChange);
|
|
43
|
+
}, []);
|
|
44
|
+
const resolved = resolveTheme(choice, dark);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
document.documentElement.dataset.theme = resolved;
|
|
47
|
+
}, [resolved]);
|
|
48
|
+
const setChoice = useCallback((next) => {
|
|
49
|
+
storage.write(next);
|
|
50
|
+
setChoiceState(next);
|
|
51
|
+
}, [storage]);
|
|
52
|
+
return useMemo(() => ({ choice, resolved, setChoice }), [choice, resolved, setChoice]);
|
|
53
|
+
}
|
|
54
|
+
const ThemeContext = createContext(null);
|
|
55
|
+
/**
|
|
56
|
+
* Тема всего приложения: оборачивает корень, ставит data-theme на <html>, помнит выбор,
|
|
57
|
+
* в режиме System следит за prefers-color-scheme на лету.
|
|
58
|
+
*/
|
|
59
|
+
export function ThemeProvider({ storage = defaultStorage, children }) {
|
|
60
|
+
const api = useThemeState(storage);
|
|
61
|
+
return _jsx(ThemeContext.Provider, { value: api, children: children });
|
|
62
|
+
}
|
|
63
|
+
export function useTheme() {
|
|
64
|
+
const api = useContext(ThemeContext);
|
|
65
|
+
if (api === null)
|
|
66
|
+
throw new Error('useTheme must be used inside ThemeProvider');
|
|
67
|
+
return api;
|
|
68
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type TThemeChoice = 'system' | 'light' | 'dark';
|
|
2
|
+
export declare const THEME_STORAGE_KEY = "internal-ui:theme";
|
|
3
|
+
export declare const DARK_QUERY = "(prefers-color-scheme: dark)";
|
|
4
|
+
export declare function isThemeChoice(value: unknown): value is TThemeChoice;
|
|
5
|
+
/**
|
|
6
|
+
* Скрипт для <head> до отрисовки: ставит data-theme по сохранённому выбору, чтобы не мигало.
|
|
7
|
+
* Ключ тот же, что у localThemeStorage.
|
|
8
|
+
*/
|
|
9
|
+
export declare function themeScript(key?: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Без 'use client': скрипт темы собирается и в серверном layout (Next).
|
|
2
|
+
export const THEME_STORAGE_KEY = 'internal-ui:theme';
|
|
3
|
+
export const DARK_QUERY = '(prefers-color-scheme: dark)';
|
|
4
|
+
export function isThemeChoice(value) {
|
|
5
|
+
return value === 'system' || value === 'light' || value === 'dark';
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Скрипт для <head> до отрисовки: ставит data-theme по сохранённому выбору, чтобы не мигало.
|
|
9
|
+
* Ключ тот же, что у localThemeStorage.
|
|
10
|
+
*/
|
|
11
|
+
export function themeScript(key = THEME_STORAGE_KEY) {
|
|
12
|
+
return `(function(){var c;try{c=localStorage.getItem(${JSON.stringify(key)})}catch(e){}var d=c==='dark'||(c!=='light'&&matchMedia('${DARK_QUERY}').matches);document.documentElement.dataset.theme=d?'dark':'light'})();`;
|
|
13
|
+
}
|
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* Internal ui — generated from tokens.json */
|
|
2
|
+
:root, [data-theme="light"] {
|
|
3
|
+
--bg: #f5f6f8;
|
|
4
|
+
--bg-subtle: #eceef2;
|
|
5
|
+
--surface: #ffffff;
|
|
6
|
+
--surface-hover: #f5f6f8;
|
|
7
|
+
--border: #e3e6eb;
|
|
8
|
+
--border-strong: #cfd4dc;
|
|
9
|
+
--text: #1a1f2b;
|
|
10
|
+
--text-muted: #5b6472;
|
|
11
|
+
--text-faint: #6b7482;
|
|
12
|
+
--text-inverse: #ffffff;
|
|
13
|
+
--accent: #2f6fed;
|
|
14
|
+
--accent-hover: #245cd1;
|
|
15
|
+
--accent-soft: #e8effd;
|
|
16
|
+
--accent-text: #1f4fb8;
|
|
17
|
+
--accent-contrast: #ffffff;
|
|
18
|
+
--success: #1f9d55;
|
|
19
|
+
--success-soft: #e6f6ec;
|
|
20
|
+
--success-text: #187a43;
|
|
21
|
+
--warning: #d97706;
|
|
22
|
+
--warning-soft: #fef3e2;
|
|
23
|
+
--warning-text: #9a5a06;
|
|
24
|
+
--danger: #d64545;
|
|
25
|
+
--danger-soft: #fdecec;
|
|
26
|
+
--danger-text: #b53030;
|
|
27
|
+
--overlay: rgba(16, 24, 40, 0.5);
|
|
28
|
+
--overlay-soft: rgba(245, 246, 248, 0.85);
|
|
29
|
+
--accent-border: rgba(47, 111, 237, 0.25);
|
|
30
|
+
--success-border: rgba(31, 157, 85, 0.3);
|
|
31
|
+
--warning-border: rgba(217, 119, 6, 0.3);
|
|
32
|
+
--danger-border: rgba(214, 69, 69, 0.3);
|
|
33
|
+
--shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
|
|
34
|
+
--shadow-md: 0 4px 14px rgba(16, 24, 40, 0.1);
|
|
35
|
+
--shadow-lg: 0 16px 48px rgba(16, 24, 40, 0.18);
|
|
36
|
+
--focus-ring: 0 0 0 3px rgba(47, 111, 237, 0.25);
|
|
37
|
+
--focus-ring-danger: 0 0 0 3px rgba(214, 69, 69, 0.2);
|
|
38
|
+
}
|
|
39
|
+
[data-theme="dark"] {
|
|
40
|
+
--bg: #14171c;
|
|
41
|
+
--bg-subtle: #1a1e25;
|
|
42
|
+
--surface: #1e232b;
|
|
43
|
+
--surface-hover: #262c36;
|
|
44
|
+
--border: #2e3541;
|
|
45
|
+
--border-strong: #3b4452;
|
|
46
|
+
--text: #e6e9ee;
|
|
47
|
+
--text-muted: #9aa3b0;
|
|
48
|
+
--text-faint: #858e9c;
|
|
49
|
+
--accent: #5b8dff;
|
|
50
|
+
--accent-hover: #7aa2ff;
|
|
51
|
+
--accent-soft: rgba(91, 141, 255, 0.16);
|
|
52
|
+
--accent-text: #9dbcff;
|
|
53
|
+
--accent-contrast: #0f1420;
|
|
54
|
+
--success: #34c073;
|
|
55
|
+
--success-soft: rgba(52, 192, 115, 0.16);
|
|
56
|
+
--success-text: #7ad9a3;
|
|
57
|
+
--warning: #f0a030;
|
|
58
|
+
--warning-soft: rgba(240, 160, 48, 0.16);
|
|
59
|
+
--warning-text: #f5bd6b;
|
|
60
|
+
--danger: #f06868;
|
|
61
|
+
--danger-soft: rgba(240, 104, 104, 0.16);
|
|
62
|
+
--danger-text: #f59a9a;
|
|
63
|
+
--overlay: rgba(0, 0, 0, 0.6);
|
|
64
|
+
--overlay-soft: rgba(20, 23, 28, 0.85);
|
|
65
|
+
--accent-border: rgba(91, 141, 255, 0.25);
|
|
66
|
+
--success-border: rgba(52, 192, 115, 0.3);
|
|
67
|
+
--warning-border: rgba(240, 160, 48, 0.3);
|
|
68
|
+
--danger-border: rgba(240, 104, 104, 0.3);
|
|
69
|
+
--shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
|
|
70
|
+
--shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
|
|
71
|
+
--focus-ring: 0 0 0 3px rgba(91, 141, 255, 0.35);
|
|
72
|
+
--focus-ring-danger: 0 0 0 3px rgba(240, 104, 104, 0.35);
|
|
73
|
+
}
|
|
74
|
+
:root {
|
|
75
|
+
--space-1: 4px;
|
|
76
|
+
--space-2: 8px;
|
|
77
|
+
--space-3: 12px;
|
|
78
|
+
--space-4: 16px;
|
|
79
|
+
--space-5: 20px;
|
|
80
|
+
--space-6: 24px;
|
|
81
|
+
--space-8: 32px;
|
|
82
|
+
--space-10: 40px;
|
|
83
|
+
--radius-sm: 4px;
|
|
84
|
+
--radius-md: 6px;
|
|
85
|
+
--radius-lg: 10px;
|
|
86
|
+
--radius-full: 999px;
|
|
87
|
+
--text-xs: 11px;
|
|
88
|
+
--text-sm: 12px;
|
|
89
|
+
--text-base: 13px;
|
|
90
|
+
--text-md: 14px;
|
|
91
|
+
--text-lg: 16px;
|
|
92
|
+
--text-xl: 18px;
|
|
93
|
+
--text-2xl: 22px;
|
|
94
|
+
--leading-tight: 1.25;
|
|
95
|
+
--leading-normal: 1.5;
|
|
96
|
+
--control-height-sm: 28px;
|
|
97
|
+
--control-height-md: 34px;
|
|
98
|
+
--header-height: 56px;
|
|
99
|
+
--toolbar-height: 44px;
|
|
100
|
+
--table-head-height: 36px;
|
|
101
|
+
--table-row-height: 52px;
|
|
102
|
+
--z-dropdown: 1000;
|
|
103
|
+
--z-sticky: 1100;
|
|
104
|
+
--z-modal: 2000;
|
|
105
|
+
--z-toast: 3000;
|
|
106
|
+
--duration-fast: 120ms;
|
|
107
|
+
--duration-base: 200ms;
|
|
108
|
+
--font-ui: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
109
|
+
--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
110
|
+
}
|
|
111
|
+
.type-page { font-family: var(--font-ui); font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
|
|
112
|
+
.type-heading { font-family: var(--font-ui); font-size: 18px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
|
|
113
|
+
.type-dialog { font-family: var(--font-ui); font-size: 16px; line-height: 1.5; font-weight: 600; }
|
|
114
|
+
.type-control { font-family: var(--font-ui); font-size: 14px; line-height: 1.4; font-weight: 500; }
|
|
115
|
+
.type-body { font-family: var(--font-ui); font-size: 13px; line-height: 1.5; font-weight: 400; }
|
|
116
|
+
.type-caption { font-family: var(--font-ui); font-size: 12px; line-height: 1.5; font-weight: 400; }
|
|
117
|
+
.type-badge { font-family: var(--font-ui); font-size: 11px; line-height: 1.4; font-weight: 500; }
|
|
118
|
+
.type-code { font-family: var(--font-mono); font-size: 13px; line-height: 1.5; font-weight: 400; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,69 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrktg-common/internal-ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Общий интерфейс внутренних инструментов маркетинга (Landings Admin, LP Constructor): токены, классы компонентов и тонкие React-обёртки над ними.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"*.css"
|
|
9
|
+
],
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./tokens.css": "./dist/tokens.css",
|
|
18
|
+
"./components.css": "./dist/components.css",
|
|
19
|
+
"./tokens.json": "./tokens/tokens.json"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"tokens/tokens.json",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && node scripts/build-css.mjs",
|
|
31
|
+
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.test.json",
|
|
32
|
+
"lint": "eslint .",
|
|
33
|
+
"test": "vitest --run",
|
|
34
|
+
"prepublishOnly": "npm run lint && npm run typecheck && npm test && npm run build",
|
|
35
|
+
"design": "node scripts/build-design.mjs && node scripts/build-site.mjs"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=22.18"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+ssh://git@gitlab.srv.team/marketing-common/internal-ui.git"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"lucide-react": "^1",
|
|
46
|
+
"react": "^19",
|
|
47
|
+
"react-dom": "^19"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@eslint/js": "^9.39.5",
|
|
51
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
52
|
+
"@testing-library/react": "^16.3.3",
|
|
53
|
+
"@types/node": "^24.19.2",
|
|
54
|
+
"@types/react": "^19.3.0",
|
|
55
|
+
"@types/react-dom": "^19.3.0",
|
|
56
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
57
|
+
"eslint": "^9.39.5",
|
|
58
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
59
|
+
"globals": "^16.5.0",
|
|
60
|
+
"jsdom": "^28.1.0",
|
|
61
|
+
"lucide-react": "^1.44.0",
|
|
62
|
+
"marked": "^15.0.12",
|
|
63
|
+
"react": "^19.3.0",
|
|
64
|
+
"react-dom": "^19.3.0",
|
|
65
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
66
|
+
"typescript-eslint": "^8.70.0",
|
|
67
|
+
"vitest": "^4.1.11"
|
|
68
|
+
}
|
|
69
|
+
}
|