@lazar-ui/kit 0.1.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.
- package/README.md +182 -0
- package/dist/Overlay-RmiBtqDR.mjs +1011 -0
- package/dist/accordion.css +1 -0
- package/dist/accordion.d.ts +53 -0
- package/dist/accordion.js +48 -0
- package/dist/alert.css +1 -0
- package/dist/alert.d.ts +33 -0
- package/dist/alert.js +20 -0
- package/dist/avatar.css +1 -0
- package/dist/avatar.d.ts +34 -0
- package/dist/avatar.js +41 -0
- package/dist/badge.css +1 -0
- package/dist/badge.d.ts +33 -0
- package/dist/badge.js +23 -0
- package/dist/breadcrumbs.css +1 -0
- package/dist/breadcrumbs.d.ts +80 -0
- package/dist/breadcrumbs.js +63 -0
- package/dist/button.css +1 -0
- package/dist/button.d.ts +66 -0
- package/dist/button.js +46 -0
- package/dist/camelCase-PtIYufW8.mjs +528 -0
- package/dist/card.css +1 -0
- package/dist/card.d.ts +42 -0
- package/dist/card.js +24 -0
- package/dist/checkbox.css +1 -0
- package/dist/checkbox.d.ts +41 -0
- package/dist/checkbox.js +42 -0
- package/dist/clsx-OuTLNxxd.mjs +16 -0
- package/dist/config-provider.d.ts +78 -0
- package/dist/config-provider.js +14 -0
- package/dist/css/palettes/indigo.css +104 -0
- package/dist/css/palettes/monochrome.css +104 -0
- package/dist/css/semantic.css +113 -0
- package/dist/dialog.css +1 -0
- package/dist/dialog.d.ts +91 -0
- package/dist/dialog.js +75 -0
- package/dist/drawer.css +1 -0
- package/dist/drawer.d.ts +128 -0
- package/dist/drawer.js +106 -0
- package/dist/empty-state.css +1 -0
- package/dist/empty-state.d.ts +33 -0
- package/dist/empty-state.js +52 -0
- package/dist/error-boundary.css +1 -0
- package/dist/error-boundary.d.ts +55 -0
- package/dist/error-boundary.js +37 -0
- package/dist/flex.css +1 -0
- package/dist/flex.d.ts +68 -0
- package/dist/flex.js +73 -0
- package/dist/form-field.css +1 -0
- package/dist/form-field.d.ts +27 -0
- package/dist/form-field.js +22 -0
- package/dist/getComponentSlots-DwAYUFNk.mjs +16 -0
- package/dist/getVariantClassName-D7Nhpuec.mjs +8 -0
- package/dist/input.css +1 -0
- package/dist/input.d.ts +39 -0
- package/dist/input.js +146 -0
- package/dist/isValidReactNode-CmYwTWCE.mjs +18 -0
- package/dist/menu.css +1 -0
- package/dist/menu.d.ts +94 -0
- package/dist/menu.js +135 -0
- package/dist/pagination.css +1 -0
- package/dist/pagination.d.ts +40 -0
- package/dist/pagination.js +74 -0
- package/dist/popover.css +1 -0
- package/dist/popover.d.ts +54 -0
- package/dist/popover.js +65 -0
- package/dist/select.css +1 -0
- package/dist/select.d.ts +64 -0
- package/dist/select.js +170 -0
- package/dist/separator.css +1 -0
- package/dist/separator.d.ts +25 -0
- package/dist/separator.js +24 -0
- package/dist/skeleton.css +1 -0
- package/dist/skeleton.d.ts +38 -0
- package/dist/skeleton.js +27 -0
- package/dist/spinner.css +1 -0
- package/dist/spinner.d.ts +31 -0
- package/dist/spinner.js +29 -0
- package/dist/switch.css +1 -0
- package/dist/switch.d.ts +44 -0
- package/dist/switch.js +37 -0
- package/dist/table.css +1 -0
- package/dist/table.d.ts +60 -0
- package/dist/table.js +40 -0
- package/dist/tabs.css +1 -0
- package/dist/tabs.d.ts +69 -0
- package/dist/tabs.js +79 -0
- package/dist/textarea.css +1 -0
- package/dist/textarea.d.ts +53 -0
- package/dist/textarea.js +46 -0
- package/dist/tooltip.css +1 -0
- package/dist/tooltip.d.ts +38 -0
- package/dist/tooltip.js +99 -0
- package/dist/useLocale-D2Z0JH0l.mjs +70 -0
- package/dist/useModalOverlay-D5Bs9FCB.mjs +486 -0
- package/dist/useOverlayPosition-DVu1Qziq.mjs +451 -0
- package/dist/useOverlayTriggerState-BIo1Jcba.mjs +221 -0
- package/dist/utils.d.ts +58 -0
- package/dist/utils.js +18 -0
- package/package.json +76 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Root provider that sets color scheme and locale for all UI Kit components.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { ConfigProvider } from '@lazar-ui/kit';
|
|
9
|
+
* import '@lazar-ui/kit/css/palettes/indigo.css';
|
|
10
|
+
* import '@lazar-ui/kit/css/semantic.css';
|
|
11
|
+
*
|
|
12
|
+
* function App() {
|
|
13
|
+
* return (
|
|
14
|
+
* <ConfigProvider theme="light" locale="en">
|
|
15
|
+
* <YourApp />
|
|
16
|
+
* </ConfigProvider>
|
|
17
|
+
* );
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* // With custom locale and theme target
|
|
24
|
+
* <ConfigProvider
|
|
25
|
+
* theme="dark"
|
|
26
|
+
* locale={{ dialog: { close: 'Закрыть' } }}
|
|
27
|
+
* themeTarget={document.getElementById('root')}
|
|
28
|
+
* >
|
|
29
|
+
* <YourApp />
|
|
30
|
+
* </ConfigProvider>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const ConfigProvider: default_2.FC<IProps>;
|
|
34
|
+
|
|
35
|
+
export declare interface IConfigContext {
|
|
36
|
+
theme: TTheme;
|
|
37
|
+
locale: ILocaleMessages;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export declare interface ILocaleMessages {
|
|
41
|
+
dialog: {
|
|
42
|
+
close: string;
|
|
43
|
+
};
|
|
44
|
+
input: {
|
|
45
|
+
passwordHide: string;
|
|
46
|
+
passwordShow: string;
|
|
47
|
+
};
|
|
48
|
+
pagination: {
|
|
49
|
+
next: string;
|
|
50
|
+
page: string;
|
|
51
|
+
pagination: string;
|
|
52
|
+
prev: string;
|
|
53
|
+
};
|
|
54
|
+
select: {
|
|
55
|
+
clear: string;
|
|
56
|
+
noOptions: string;
|
|
57
|
+
placeholder: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare interface IProps extends default_2.PropsWithChildren {
|
|
62
|
+
/** Color scheme: 'light' | 'dark' | 'contrast'. Default: 'light'. */
|
|
63
|
+
theme?: TTheme;
|
|
64
|
+
/** DOM node to receive `data-theme` attribute. Default: `document.documentElement`. */
|
|
65
|
+
themeTarget?: HTMLElement | null;
|
|
66
|
+
/** Locale: built-in ('en' | 'ru') or custom `Partial<ILocaleMessages>`. Default: 'en'. */
|
|
67
|
+
locale?: TLocale;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export declare type TLocale = Partial<ILocaleMessages> | 'en' | 'ru';
|
|
71
|
+
|
|
72
|
+
export declare type TTheme = 'light' | 'dark' | 'contrast';
|
|
73
|
+
|
|
74
|
+
export declare const useConfigContext: () => IConfigContext;
|
|
75
|
+
|
|
76
|
+
export declare const useLocale: () => ILocaleMessages;
|
|
77
|
+
|
|
78
|
+
export { }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { C as t } from "./useLocale-D2Z0JH0l.mjs";
|
|
2
|
+
import { a as f, u } from "./useLocale-D2Z0JH0l.mjs";
|
|
3
|
+
import { useContext as e } from "react";
|
|
4
|
+
const i = () => {
|
|
5
|
+
const o = e(t);
|
|
6
|
+
if (!o)
|
|
7
|
+
throw new Error("useConfigContext must be used within a ConfigProvider");
|
|
8
|
+
return o;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
f as ConfigProvider,
|
|
12
|
+
i as useConfigContext,
|
|
13
|
+
u as useLocale
|
|
14
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Brand */
|
|
3
|
+
--palette-brand: #6366f3;
|
|
4
|
+
--palette-brand-hover: #5558e6;
|
|
5
|
+
--palette-brand-secondary: #eef2ff;
|
|
6
|
+
|
|
7
|
+
/* Gray scale */
|
|
8
|
+
--palette-gray-25: #fcfcfd;
|
|
9
|
+
--palette-gray-50: #f9fafb;
|
|
10
|
+
--palette-gray-100: #f2f4f7;
|
|
11
|
+
--palette-gray-200: #e4e7ec;
|
|
12
|
+
--palette-gray-300: #d0d5dd;
|
|
13
|
+
--palette-gray-400: #98a2b3;
|
|
14
|
+
--palette-gray-500: #667085;
|
|
15
|
+
--palette-gray-600: #475467;
|
|
16
|
+
--palette-gray-700: #344054;
|
|
17
|
+
--palette-gray-800: #1d2939;
|
|
18
|
+
--palette-gray-900: #101828;
|
|
19
|
+
|
|
20
|
+
/* Colors */
|
|
21
|
+
--palette-red-500: #d92d20;
|
|
22
|
+
--palette-red-600: #b42318;
|
|
23
|
+
--palette-orange-500: #b54708;
|
|
24
|
+
--palette-orange-600: #93370d;
|
|
25
|
+
--palette-green-500: #079455;
|
|
26
|
+
--palette-green-600: #067647;
|
|
27
|
+
--palette-blue-500: #175cd3;
|
|
28
|
+
--palette-blue-600: #1250b3;
|
|
29
|
+
|
|
30
|
+
/* Neutral */
|
|
31
|
+
--palette-white: #fff;
|
|
32
|
+
--palette-black: #000;
|
|
33
|
+
--palette-overlay: rgb(0, 0, 0 / 0.4);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[data-theme="dark"] {
|
|
37
|
+
/* Brand */
|
|
38
|
+
--palette-brand: #818cf8;
|
|
39
|
+
--palette-brand-hover: #6366f3;
|
|
40
|
+
--palette-brand-secondary: #1e1b4b;
|
|
41
|
+
|
|
42
|
+
/* Gray scale */
|
|
43
|
+
--palette-gray-25: #0a0a0b;
|
|
44
|
+
--palette-gray-50: #141416;
|
|
45
|
+
--palette-gray-100: #1c1c1f;
|
|
46
|
+
--palette-gray-200: #26262b;
|
|
47
|
+
--palette-gray-300: #3a3a42;
|
|
48
|
+
--palette-gray-400: #5c5c66;
|
|
49
|
+
--palette-gray-500: #7a7a85;
|
|
50
|
+
--palette-gray-600: #9d9da8;
|
|
51
|
+
--palette-gray-700: #bebec9;
|
|
52
|
+
--palette-gray-800: #dedee6;
|
|
53
|
+
--palette-gray-900: #f2f2f7;
|
|
54
|
+
|
|
55
|
+
/* Colors */
|
|
56
|
+
--palette-red-500: #f97066;
|
|
57
|
+
--palette-red-600: #f04438;
|
|
58
|
+
--palette-orange-500: #fdb022;
|
|
59
|
+
--palette-orange-600: #f79009;
|
|
60
|
+
--palette-green-500: #47cd89;
|
|
61
|
+
--palette-green-600: #2ed477;
|
|
62
|
+
--palette-blue-500: #53b1fd;
|
|
63
|
+
--palette-blue-600: #2e90fa;
|
|
64
|
+
|
|
65
|
+
/* Neutral */
|
|
66
|
+
--palette-white: #141416;
|
|
67
|
+
--palette-black: #fff;
|
|
68
|
+
--palette-overlay: rgb(0, 0, 0 / 0.6);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-theme="contrast"] {
|
|
72
|
+
/* Brand */
|
|
73
|
+
--palette-brand: #00f;
|
|
74
|
+
--palette-brand-hover: #00c;
|
|
75
|
+
--palette-brand-secondary: #e6e6ff;
|
|
76
|
+
|
|
77
|
+
/* Gray scale */
|
|
78
|
+
--palette-gray-25: #fff;
|
|
79
|
+
--palette-gray-50: #f0f0f0;
|
|
80
|
+
--palette-gray-100: #e0e0e0;
|
|
81
|
+
--palette-gray-200: #c0c0c0;
|
|
82
|
+
--palette-gray-300: #808080;
|
|
83
|
+
--palette-gray-400: #606060;
|
|
84
|
+
--palette-gray-500: #404040;
|
|
85
|
+
--palette-gray-600: #202020;
|
|
86
|
+
--palette-gray-700: #101010;
|
|
87
|
+
--palette-gray-800: #080808;
|
|
88
|
+
--palette-gray-900: #000;
|
|
89
|
+
|
|
90
|
+
/* Colors */
|
|
91
|
+
--palette-red-500: #c00;
|
|
92
|
+
--palette-red-600: #900;
|
|
93
|
+
--palette-orange-500: #c60;
|
|
94
|
+
--palette-orange-600: #994d00;
|
|
95
|
+
--palette-green-500: #060;
|
|
96
|
+
--palette-green-600: #004d00;
|
|
97
|
+
--palette-blue-500: #04c;
|
|
98
|
+
--palette-blue-600: #039;
|
|
99
|
+
|
|
100
|
+
/* Neutral */
|
|
101
|
+
--palette-white: #fff;
|
|
102
|
+
--palette-black: #000;
|
|
103
|
+
--palette-overlay: rgb(0, 0, 0 / 0.7);
|
|
104
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Brand */
|
|
3
|
+
--palette-brand: #44403c;
|
|
4
|
+
--palette-brand-hover: #292524;
|
|
5
|
+
--palette-brand-secondary: #f5f5f4;
|
|
6
|
+
|
|
7
|
+
/* Gray scale (warm) */
|
|
8
|
+
--palette-gray-25: #fcfcf9;
|
|
9
|
+
--palette-gray-50: #fafaf9;
|
|
10
|
+
--palette-gray-100: #f5f5f4;
|
|
11
|
+
--palette-gray-200: #e7e5e4;
|
|
12
|
+
--palette-gray-300: #d6d3d1;
|
|
13
|
+
--palette-gray-400: #a8a29e;
|
|
14
|
+
--palette-gray-500: #78716c;
|
|
15
|
+
--palette-gray-600: #57534e;
|
|
16
|
+
--palette-gray-700: #44403c;
|
|
17
|
+
--palette-gray-800: #292524;
|
|
18
|
+
--palette-gray-900: #1c1917;
|
|
19
|
+
|
|
20
|
+
/* Colors (same as indigo) */
|
|
21
|
+
--palette-red-500: #d92d20;
|
|
22
|
+
--palette-red-600: #b42318;
|
|
23
|
+
--palette-orange-500: #b54708;
|
|
24
|
+
--palette-orange-600: #93370d;
|
|
25
|
+
--palette-green-500: #079455;
|
|
26
|
+
--palette-green-600: #067647;
|
|
27
|
+
--palette-blue-500: #175cd3;
|
|
28
|
+
--palette-blue-600: #1250b3;
|
|
29
|
+
|
|
30
|
+
/* Neutral */
|
|
31
|
+
--palette-white: #fff;
|
|
32
|
+
--palette-black: #000;
|
|
33
|
+
--palette-overlay: rgb(0, 0, 0 / 0.4);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[data-theme="dark"] {
|
|
37
|
+
/* Brand */
|
|
38
|
+
--palette-brand: #d6d3d1;
|
|
39
|
+
--palette-brand-hover: #e7e5e4;
|
|
40
|
+
--palette-brand-secondary: #292524;
|
|
41
|
+
|
|
42
|
+
/* Gray scale (warm, inverted) */
|
|
43
|
+
--palette-gray-25: #0c0a09;
|
|
44
|
+
--palette-gray-50: #141211;
|
|
45
|
+
--palette-gray-100: #1c1917;
|
|
46
|
+
--palette-gray-200: #292524;
|
|
47
|
+
--palette-gray-300: #44403c;
|
|
48
|
+
--palette-gray-400: #57534e;
|
|
49
|
+
--palette-gray-500: #78716c;
|
|
50
|
+
--palette-gray-600: #a8a29e;
|
|
51
|
+
--palette-gray-700: #d6d3d1;
|
|
52
|
+
--palette-gray-800: #e7e5e4;
|
|
53
|
+
--palette-gray-900: #f5f5f4;
|
|
54
|
+
|
|
55
|
+
/* Colors (same as indigo) */
|
|
56
|
+
--palette-red-500: #f97066;
|
|
57
|
+
--palette-red-600: #f04438;
|
|
58
|
+
--palette-orange-500: #fdb022;
|
|
59
|
+
--palette-orange-600: #f79009;
|
|
60
|
+
--palette-green-500: #47cd89;
|
|
61
|
+
--palette-green-600: #2ed477;
|
|
62
|
+
--palette-blue-500: #53b1fd;
|
|
63
|
+
--palette-blue-600: #2e90fa;
|
|
64
|
+
|
|
65
|
+
/* Neutral */
|
|
66
|
+
--palette-white: #141211;
|
|
67
|
+
--palette-black: #fff;
|
|
68
|
+
--palette-overlay: rgb(0, 0, 0 / 0.6);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-theme="contrast"] {
|
|
72
|
+
/* Brand */
|
|
73
|
+
--palette-brand: #000;
|
|
74
|
+
--palette-brand-hover: #333;
|
|
75
|
+
--palette-brand-secondary: #fff;
|
|
76
|
+
|
|
77
|
+
/* Gray scale (pure b/w) */
|
|
78
|
+
--palette-gray-25: #fff;
|
|
79
|
+
--palette-gray-50: #f0f0f0;
|
|
80
|
+
--palette-gray-100: #e0e0e0;
|
|
81
|
+
--palette-gray-200: #c0c0c0;
|
|
82
|
+
--palette-gray-300: #808080;
|
|
83
|
+
--palette-gray-400: #606060;
|
|
84
|
+
--palette-gray-500: #404040;
|
|
85
|
+
--palette-gray-600: #202020;
|
|
86
|
+
--palette-gray-700: #101010;
|
|
87
|
+
--palette-gray-800: #080808;
|
|
88
|
+
--palette-gray-900: #000;
|
|
89
|
+
|
|
90
|
+
/* Colors (same as indigo) */
|
|
91
|
+
--palette-red-500: #c00;
|
|
92
|
+
--palette-red-600: #900;
|
|
93
|
+
--palette-orange-500: #c60;
|
|
94
|
+
--palette-orange-600: #994d00;
|
|
95
|
+
--palette-green-500: #060;
|
|
96
|
+
--palette-green-600: #004d00;
|
|
97
|
+
--palette-blue-500: #04c;
|
|
98
|
+
--palette-blue-600: #039;
|
|
99
|
+
|
|
100
|
+
/* Neutral */
|
|
101
|
+
--palette-white: #fff;
|
|
102
|
+
--palette-black: #000;
|
|
103
|
+
--palette-overlay: rgb(0, 0, 0 / 0.7);
|
|
104
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* ═══════════════════════════════════════════════════
|
|
3
|
+
Color
|
|
4
|
+
═══════════════════════════════════════════════════ */
|
|
5
|
+
|
|
6
|
+
/* Background */
|
|
7
|
+
--color-background-brand: var(--palette-brand);
|
|
8
|
+
--color-background-brand-hover: var(--palette-brand-hover);
|
|
9
|
+
--color-background-brand-secondary: var(--palette-brand-secondary);
|
|
10
|
+
--color-background-primary: var(--palette-white);
|
|
11
|
+
--color-background-secondary: var(--palette-gray-50);
|
|
12
|
+
--color-background-tertiary: var(--palette-gray-100);
|
|
13
|
+
--color-background-disabled: var(--palette-gray-100);
|
|
14
|
+
--color-background-error: var(--palette-red-500);
|
|
15
|
+
--color-background-error-hover: var(--palette-red-600);
|
|
16
|
+
--color-background-overlay: var(--palette-overlay);
|
|
17
|
+
|
|
18
|
+
/* Text */
|
|
19
|
+
--color-text-primary: var(--palette-gray-900);
|
|
20
|
+
--color-text-secondary: var(--palette-gray-600);
|
|
21
|
+
--color-text-tertiary: var(--palette-gray-500);
|
|
22
|
+
--color-text-quaternary: var(--palette-gray-300);
|
|
23
|
+
--color-text-disabled: var(--palette-gray-300);
|
|
24
|
+
--color-text-on-brand: var(--palette-white);
|
|
25
|
+
--color-text-on-dark: var(--palette-white);
|
|
26
|
+
--color-text-link: var(--palette-blue-500);
|
|
27
|
+
--color-text-link-hover: var(--palette-blue-600);
|
|
28
|
+
--color-text-error: var(--palette-red-500);
|
|
29
|
+
--color-text-error-hover: var(--palette-red-600);
|
|
30
|
+
--color-text-success: var(--palette-green-600);
|
|
31
|
+
--color-text-success-hover: var(--palette-green-600);
|
|
32
|
+
--color-text-warning: var(--palette-orange-500);
|
|
33
|
+
--color-text-warning-hover: var(--palette-orange-600);
|
|
34
|
+
|
|
35
|
+
/* Border */
|
|
36
|
+
--color-border-primary: var(--palette-gray-200);
|
|
37
|
+
--color-border-secondary: var(--palette-gray-100);
|
|
38
|
+
--color-border-disabled: var(--palette-gray-200);
|
|
39
|
+
--color-border-disabled-subtle: var(--palette-gray-200);
|
|
40
|
+
--color-border-focus: var(--palette-brand);
|
|
41
|
+
--color-border-focus-error: var(--palette-red-500);
|
|
42
|
+
|
|
43
|
+
/* ═══════════════════════════════════════════════════
|
|
44
|
+
Space (base: 4px)
|
|
45
|
+
═══════════════════════════════════════════════════ */
|
|
46
|
+
|
|
47
|
+
--space-1: 4px;
|
|
48
|
+
--space-2: 8px;
|
|
49
|
+
--space-3: 12px;
|
|
50
|
+
--space-4: 16px;
|
|
51
|
+
--space-5: 20px;
|
|
52
|
+
--space-6: 24px;
|
|
53
|
+
--space-7: 28px;
|
|
54
|
+
--space-8: 32px;
|
|
55
|
+
--space-10: 40px;
|
|
56
|
+
--space-12: 48px;
|
|
57
|
+
--space-14: 56px;
|
|
58
|
+
--space-16: 64px;
|
|
59
|
+
|
|
60
|
+
/* ═══════════════════════════════════════════════════
|
|
61
|
+
Radius
|
|
62
|
+
═══════════════════════════════════════════════════ */
|
|
63
|
+
|
|
64
|
+
--radius-1: 4px;
|
|
65
|
+
--radius-2: 8px;
|
|
66
|
+
--radius-3: 12px;
|
|
67
|
+
--radius-4: 16px;
|
|
68
|
+
--radius-full: 9999px;
|
|
69
|
+
|
|
70
|
+
/* ═══════════════════════════════════════════════════
|
|
71
|
+
Font
|
|
72
|
+
═══════════════════════════════════════════════════ */
|
|
73
|
+
|
|
74
|
+
--font-family-body: "Inter", "Arial", "Helvetica", sans-serif;
|
|
75
|
+
|
|
76
|
+
/* Font Sizes. */
|
|
77
|
+
--font-size-xs: 12px;
|
|
78
|
+
--font-size-sm: 13px;
|
|
79
|
+
--font-size-md: 14px;
|
|
80
|
+
--font-size-lg: 16px;
|
|
81
|
+
--font-size-xl: 20px;
|
|
82
|
+
--font-size-2xl: 24px;
|
|
83
|
+
|
|
84
|
+
/* Font Weights. */
|
|
85
|
+
--font-weight-normal: 400;
|
|
86
|
+
--font-weight-medium: 500;
|
|
87
|
+
--font-weight-semibold: 600;
|
|
88
|
+
--font-weight-bold: 700;
|
|
89
|
+
|
|
90
|
+
/* Line-height на сетке 4px */
|
|
91
|
+
--line-height-xs: 16px;
|
|
92
|
+
--line-height-sm: 20px;
|
|
93
|
+
--line-height-md: 20px;
|
|
94
|
+
--line-height-lg: 24px;
|
|
95
|
+
--line-height-xl: 28px;
|
|
96
|
+
--line-height-2xl: 32px;
|
|
97
|
+
|
|
98
|
+
/* ═══════════════════════════════════════════════════
|
|
99
|
+
Shadow
|
|
100
|
+
═══════════════════════════════════════════════════ */
|
|
101
|
+
|
|
102
|
+
--shadow-xs: 0 1px 2px 0 rgb(0, 0, 0 / 0.05);
|
|
103
|
+
--shadow-sm: 0 1px 3px 0 rgb(0, 0, 0 / 0.1), 0 1px 2px -1px rgb(0, 0, 0 / 0.1);
|
|
104
|
+
--shadow-md: 0 4px 6px -1px rgb(0, 0, 0 / 0.1), 0 2px 4px -2px rgb(0, 0, 0 / 0.1);
|
|
105
|
+
--shadow-lg: 0 10px 15px -3px rgb(0, 0, 0 / 0.1), 0 4px 6px -4px rgb(0, 0, 0 / 0.1);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
[data-theme="dark"] {
|
|
109
|
+
--color-border-primary: var(--palette-gray-700);
|
|
110
|
+
--color-border-secondary: var(--palette-gray-600);
|
|
111
|
+
--color-border-disabled: var(--palette-gray-600);
|
|
112
|
+
--color-border-disabled-subtle: var(--palette-gray-500);
|
|
113
|
+
}
|
package/dist/dialog.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._root_1fxwu_1{display:flex;gap:var(--dialog-actions-gap)}._root_jagsa_1{max-height:100%;overflow-y:auto}:root{--dialog-underlay: var(--color-background-overlay);--dialog-bg: var(--color-background-primary);--dialog-radius: var(--radius-3);--dialog-shadow: 0 20px 24px -4px rgb(16 24 40 / .08), 0 8px 8px -4px rgb(16 24 40 / .03);--dialog-padding: var(--space-8);--dialog-gap: var(--space-6);--dialog-header-gap: var(--space-6);--dialog-header-min-height: calc(24px + var(--space-6));--dialog-close-color: var(--palette-gray-400);--dialog-close-padding: var(--space-3);--dialog-actions-padding-top: var(--space-10);--dialog-width-xs: 384px;--dialog-width-sm: 480px;--dialog-width-md: 560px;--dialog-width-lg: 640px;--dialog-title-font-size: var(--font-size-md);--dialog-title-weight: var(--font-weight-semibold);--dialog-title-color: var(--color-text-primary);--dialog-title-font-family: var(--font-family-body);--dialog-title-line-height: var(--line-height-md);--dialog-actions-gap: var(--space-4)}._underlay_8hbwf_25{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:var(--dialog-underlay);inset:0;padding:var(--space-4);position:fixed;z-index:1000}._modal_8hbwf_34{align-items:center;display:flex;height:100%;justify-content:center}._dialog_8hbwf_41{background:var(--dialog-bg);border-radius:var(--dialog-radius);box-shadow:var(--dialog-shadow);display:flex;flex-direction:column;gap:var(--dialog-gap);padding:var(--dialog-padding);position:relative}._dialog_8hbwf_41._sizeXs_8hbwf_51{width:var(--dialog-width-xs)}._dialog_8hbwf_41._sizeSm_8hbwf_54{width:var(--dialog-width-sm)}._dialog_8hbwf_41._sizeMd_8hbwf_57{width:var(--dialog-width-md)}._dialog_8hbwf_41._sizeLg_8hbwf_60{width:var(--dialog-width-lg)}._header_8hbwf_64{align-items:center;display:flex;gap:var(--dialog-header-gap);min-height:var(--dialog-header-min-height)}._close_8hbwf_71{color:var(--dialog-close-color);padding:var(--dialog-close-padding);position:absolute;right:var(--space-4);top:var(--space-4)}._actions_8hbwf_79{padding-top:var(--dialog-actions-padding-top)}._root_1ae0y_1{color:var(--dialog-title-color);font-family:var(--dialog-title-font-family);font-size:var(--dialog-title-font-size);font-style:normal;font-weight:var(--dialog-title-weight);line-height:var(--dialog-title-line-height);max-height:100%}
|
package/dist/dialog.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { AriaDialogProps } from 'react-aria';
|
|
2
|
+
import { default as default_2 } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Dialog Actions sub component.
|
|
6
|
+
*
|
|
7
|
+
* Used to render the actions of the dialog.
|
|
8
|
+
*/
|
|
9
|
+
declare const Actions: default_2.FC<IActionsProps>;
|
|
10
|
+
|
|
11
|
+
declare const Content: default_2.FC<IContentProps>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Dialog component.
|
|
15
|
+
*/
|
|
16
|
+
declare const Dialog_2: default_2.FC<IDialogProps>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Dialog component.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Dialog>
|
|
24
|
+
* <Dialog.Content>
|
|
25
|
+
* <div>Content</div>
|
|
26
|
+
* </Dialog.Content>
|
|
27
|
+
* <Dialog.Actions>
|
|
28
|
+
* <Button>Close dialog</Button>
|
|
29
|
+
* </Dialog.Actions>
|
|
30
|
+
* </Dialog>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare const DialogCompoundComponent: TDialogCompoundComponent;
|
|
34
|
+
export { DialogCompoundComponent as Dialog }
|
|
35
|
+
export default DialogCompoundComponent;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Enumerates sizes of elements.
|
|
39
|
+
*/
|
|
40
|
+
declare enum EElementSize {
|
|
41
|
+
XS = "xs",
|
|
42
|
+
SM = "sm",
|
|
43
|
+
MD = "md",
|
|
44
|
+
LG = "lg",
|
|
45
|
+
XL = "xl"
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export declare interface IActionsProps extends default_2.PropsWithChildren {
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export declare interface IContentProps extends default_2.PropsWithChildren {
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export declare interface IDialogProps extends default_2.PropsWithChildren, AriaDialogProps {
|
|
55
|
+
/** Close the dialog when the escape key is pressed. */
|
|
56
|
+
closeOnEscape?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The container element in which the overlay portal will be placed.
|
|
59
|
+
* @default document.body
|
|
60
|
+
*/
|
|
61
|
+
container?: HTMLElement;
|
|
62
|
+
/** Callback that is called when the dialog is opened or closed. */
|
|
63
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the dialog is modal.
|
|
66
|
+
* Modal dialog is not dismissable by clicking outside or pressing the Escape key.
|
|
67
|
+
*/
|
|
68
|
+
modal?: boolean;
|
|
69
|
+
/** Whether the dialog is open. */
|
|
70
|
+
open?: boolean;
|
|
71
|
+
/** Size of the dialog. */
|
|
72
|
+
size?: TDialogSize;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export declare interface ITitleProps extends default_2.PropsWithChildren {
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare type TDialogCompoundComponent = typeof Dialog_2 & {
|
|
79
|
+
Actions: typeof Actions;
|
|
80
|
+
Content: typeof Content;
|
|
81
|
+
Title: typeof Title;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Dialog sizes.
|
|
86
|
+
*/
|
|
87
|
+
declare type TDialogSize = `${EElementSize.XS | EElementSize.SM | EElementSize.MD | EElementSize.LG}`;
|
|
88
|
+
|
|
89
|
+
declare const Title: default_2.FC<ITitleProps>;
|
|
90
|
+
|
|
91
|
+
export { }
|
package/dist/dialog.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as e, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as _, useMemo as I } from "react";
|
|
3
|
+
import { c as S } from "./clsx-OuTLNxxd.mjs";
|
|
4
|
+
import { $ as x, a as A } from "./useModalOverlay-D5Bs9FCB.mjs";
|
|
5
|
+
import { r as E } from "./Overlay-RmiBtqDR.mjs";
|
|
6
|
+
import { a as M } from "./useOverlayTriggerState-BIo1Jcba.mjs";
|
|
7
|
+
import { u as P } from "./useLocale-D2Z0JH0l.mjs";
|
|
8
|
+
import { g as X } from "./getComponentSlots-DwAYUFNk.mjs";
|
|
9
|
+
import { g as j } from "./getVariantClassName-D7Nhpuec.mjs";
|
|
10
|
+
import './dialog.css';var s = /* @__PURE__ */ ((o) => (o.ACTIONS = "Dialog.Actions", o.CONTENT = "Dialog.Content", o.TITLE = "Dialog.Title", o))(s || {});
|
|
11
|
+
const R = "_root_1fxwu_1", k = {
|
|
12
|
+
root: R
|
|
13
|
+
}, h = (o) => {
|
|
14
|
+
const { children: t } = o;
|
|
15
|
+
return /* @__PURE__ */ e("div", { className: k.root, children: t });
|
|
16
|
+
};
|
|
17
|
+
h.displayName = s.ACTIONS;
|
|
18
|
+
const K = "_root_jagsa_1", V = {
|
|
19
|
+
root: K
|
|
20
|
+
}, N = (o) => {
|
|
21
|
+
const { children: t } = o;
|
|
22
|
+
return /* @__PURE__ */ e("div", { className: V.root, children: t });
|
|
23
|
+
};
|
|
24
|
+
N.displayName = s.CONTENT;
|
|
25
|
+
const Y = "Dialog", q = [s.ACTIONS, s.CONTENT, s.TITLE], B = "_underlay_8hbwf_25", F = "_modal_8hbwf_34", G = "_dialog_8hbwf_41", H = "_sizeXs_8hbwf_51", J = "_sizeSm_8hbwf_54", Q = "_sizeMd_8hbwf_57", U = "_sizeLg_8hbwf_60", W = "_header_8hbwf_64", Z = "_close_8hbwf_71", oo = "_actions_8hbwf_79", a = {
|
|
26
|
+
underlay: B,
|
|
27
|
+
modal: F,
|
|
28
|
+
dialog: G,
|
|
29
|
+
sizeXs: H,
|
|
30
|
+
sizeSm: J,
|
|
31
|
+
sizeMd: Q,
|
|
32
|
+
sizeLg: U,
|
|
33
|
+
header: W,
|
|
34
|
+
close: Z,
|
|
35
|
+
actions: oo
|
|
36
|
+
}, b = (o) => {
|
|
37
|
+
const { children: t, container: T, open: l, modal: g = !0, onOpenChange: u, size: C = "md" } = o, $ = P(), i = _(null), c = _(null), { dialogProps: y } = x(o, i), r = M({ isOpen: l, onOpenChange: u }), { modalProps: z, underlayProps: D } = A(
|
|
38
|
+
{ isDismissable: !g, isKeyboardDismissDisabled: !1 },
|
|
39
|
+
r,
|
|
40
|
+
c
|
|
41
|
+
), {
|
|
42
|
+
[s.ACTIONS]: d,
|
|
43
|
+
[s.CONTENT]: m,
|
|
44
|
+
[s.TITLE]: v
|
|
45
|
+
} = I(() => X(t, q), [t]), w = (O) => {
|
|
46
|
+
O.preventDefault(), r.close();
|
|
47
|
+
};
|
|
48
|
+
if (!l)
|
|
49
|
+
return null;
|
|
50
|
+
const L = S(a.dialog, j("size", C, a));
|
|
51
|
+
return /* @__PURE__ */ e(E, { portalContainer: T, children: /* @__PURE__ */ e("div", { className: a.underlay, ...D, children: /* @__PURE__ */ e("div", { className: a.modal, ...z, ref: c, children: /* @__PURE__ */ f("div", { className: L, ...y, ref: i, children: [
|
|
52
|
+
/* @__PURE__ */ f("div", { className: a.header, children: [
|
|
53
|
+
v,
|
|
54
|
+
/* @__PURE__ */ e("button", { "aria-label": $.dialog.close, className: a.close, onClick: w, children: "X" })
|
|
55
|
+
] }),
|
|
56
|
+
m && /* @__PURE__ */ e("div", { children: m }),
|
|
57
|
+
d && /* @__PURE__ */ e("div", { className: a.actions, children: d })
|
|
58
|
+
] }) }) }) });
|
|
59
|
+
};
|
|
60
|
+
b.displayName = Y;
|
|
61
|
+
const so = "_root_1ae0y_1", eo = {
|
|
62
|
+
root: so
|
|
63
|
+
}, p = (o) => {
|
|
64
|
+
const { children: t } = o;
|
|
65
|
+
return /* @__PURE__ */ e("div", { className: eo.root, children: t });
|
|
66
|
+
};
|
|
67
|
+
p.displayName = s.TITLE;
|
|
68
|
+
const n = b;
|
|
69
|
+
n.Actions = h;
|
|
70
|
+
n.Content = N;
|
|
71
|
+
n.Title = p;
|
|
72
|
+
export {
|
|
73
|
+
n as Dialog,
|
|
74
|
+
n as default
|
|
75
|
+
};
|
package/dist/drawer.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._root_jagsa_1{max-height:100%;overflow-y:auto}:root{--drawer-underlay: var(--color-background-overlay);--drawer-bg: var(--color-background-primary);--drawer-shadow: 0 20px 24px -4px rgb(16 24 40 / .08), 0 8px 8px -4px rgb(16 24 40 / .03);--drawer-padding: var(--space-8);--drawer-gap: var(--space-6);--drawer-header-gap: var(--space-6);--drawer-header-min-height: calc(24px + var(--space-6));--drawer-close-color: var(--palette-gray-400);--drawer-close-padding: var(--space-3);--drawer-width-sm: 384px;--drawer-width-md: 480px;--drawer-width-lg: 640px;--drawer-height-sm: 320px;--drawer-height-md: 480px;--drawer-height-lg: 640px;--drawer-title-font-size: var(--font-size-md);--drawer-title-weight: var(--font-weight-semibold);--drawer-title-color: var(--color-text-primary);--drawer-title-font-family: var(--font-family-body);--drawer-title-line-height: var(--line-height-md)}._underlay_7b6q3_24{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:var(--drawer-underlay);inset:0;position:fixed;z-index:1000}._modal_7b6q3_32{display:flex;height:100%}._drawer_7b6q3_37{background:var(--drawer-bg);box-shadow:var(--drawer-shadow);display:flex;flex-direction:column;gap:var(--drawer-gap);padding:var(--drawer-padding);position:fixed;transition:transform .3s ease}._drawer_7b6q3_37._placementLeft_7b6q3_47{bottom:0;left:0;top:0;transform:translate(-100%)}._drawer_7b6q3_37._placementLeft_7b6q3_47._entered_7b6q3_53{transform:translate(0)}._drawer_7b6q3_37._placementRight_7b6q3_56{bottom:0;right:0;top:0;transform:translate(100%)}._drawer_7b6q3_37._placementRight_7b6q3_56._entered_7b6q3_53{transform:translate(0)}._drawer_7b6q3_37._placementTop_7b6q3_65{left:0;right:0;top:0;transform:translateY(-100%)}._drawer_7b6q3_37._placementTop_7b6q3_65._entered_7b6q3_53{transform:translateY(0)}._drawer_7b6q3_37._placementBottom_7b6q3_74{bottom:0;left:0;right:0;transform:translateY(100%)}._drawer_7b6q3_37._placementBottom_7b6q3_74._entered_7b6q3_53{transform:translateY(0)}._drawer_7b6q3_37._sizeSm_7b6q3_83{width:var(--drawer-width-sm)}._drawer_7b6q3_37._sizeSm_7b6q3_83._placementTop_7b6q3_65,._drawer_7b6q3_37._sizeSm_7b6q3_83._placementBottom_7b6q3_74{height:var(--drawer-height-sm);width:100%}._drawer_7b6q3_37._sizeMd_7b6q3_90{width:var(--drawer-width-md)}._drawer_7b6q3_37._sizeMd_7b6q3_90._placementTop_7b6q3_65,._drawer_7b6q3_37._sizeMd_7b6q3_90._placementBottom_7b6q3_74{height:var(--drawer-height-md);width:100%}._drawer_7b6q3_37._sizeLg_7b6q3_97{width:var(--drawer-width-lg)}._drawer_7b6q3_37._sizeLg_7b6q3_97._placementTop_7b6q3_65,._drawer_7b6q3_37._sizeLg_7b6q3_97._placementBottom_7b6q3_74{height:var(--drawer-height-lg);width:100%}._content_7b6q3_105{flex:1;overflow-y:auto}:root{--drawer-header-gap: var(--space-6);--drawer-header-min-height: calc(24px + var(--space-6));--drawer-close-color: var(--palette-gray-400);--drawer-close-padding: var(--space-3);--drawer-title-font-size: var(--font-size-md);--drawer-title-weight: var(--font-weight-semibold);--drawer-title-color: var(--color-text-primary);--drawer-title-font-family: var(--font-family-body);--drawer-title-line-height: var(--line-height-md)}._root_1fwv3_13{align-items:center;display:flex;gap:var(--drawer-header-gap);min-height:var(--drawer-header-min-height);position:relative}._title_1fwv3_21{color:var(--drawer-title-color);flex:1;font-family:var(--drawer-title-font-family);font-size:var(--drawer-title-font-size);font-style:normal;font-weight:var(--drawer-title-weight);line-height:var(--drawer-title-line-height)}._close_1fwv3_31{color:var(--drawer-close-color);padding:var(--drawer-close-padding);position:absolute;right:0;top:50%;transform:translateY(-50%)}
|