@dss-kit/ui-kit 1.0.4 → 1.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 +19 -0
- package/dist/components/builders/Sheet/SheetLayer.js +95 -83
- package/dist/components/builders/Sheet/hooks/index.d.ts +1 -0
- package/dist/components/builders/Sheet/hooks/useMotionValueStyle.d.ts +8 -0
- package/dist/components/builders/Sheet/hooks/useMotionValueStyle.js +14 -0
- package/dist/components/builders/Table/TablePagination/TablePagination.d.ts +10 -4
- package/dist/components/builders/Table/TablePagination/TablePagination.js +230 -177
- package/dist/components/builders/Text/Text.d.ts +4 -1
- package/dist/components/builders/Text/Text.js +78 -76
- package/dist/components/controls/Button/Button.d.ts +1 -1
- package/dist/components/controls/Button/Button.js +47 -46
- package/dist/components/controls/OtpInput/OtpInput.js +121 -143
- package/dist/components/controls/OtpInput/styles.d.ts +1 -0
- package/dist/components/controls/OtpInput/styles.js +9 -3
- package/dist/components/controls/Select/Select.js +72 -70
- package/dist/components/shared/Toast/ToastContainer.d.ts +1 -1
- package/dist/components/shared/Toast/ToastContainer.js +25 -23
- package/dist/fonts/inter-cyrillic-ext-400.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-500.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-600.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-700.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-800.woff2 +0 -0
- package/dist/fonts/inter-latin-cyrillic-400.woff2 +0 -0
- package/dist/fonts/inter-latin-cyrillic-500.woff2 +0 -0
- package/dist/fonts/inter-latin-cyrillic-600.woff2 +0 -0
- package/dist/fonts/inter-latin-cyrillic-700.woff2 +0 -0
- package/dist/fonts/inter-latin-cyrillic-800.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-400.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-500.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-600.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-700.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-800.woff2 +0 -0
- package/dist/index.js +34 -32
- package/dist/providers/MotionProvider/MotionProvider.d.ts +9 -0
- package/dist/providers/MotionProvider/MotionProvider.js +21 -0
- package/dist/providers/MotionProvider/MotionProvider.types.d.ts +12 -0
- package/dist/providers/MotionProvider/features.d.ts +1 -0
- package/dist/providers/MotionProvider/features.js +4 -0
- package/dist/providers/MotionProvider/index.d.ts +2 -0
- package/dist/providers/MotionProvider/loadMotionFeatures.d.ts +13 -0
- package/dist/providers/MotionProvider/loadMotionFeatures.js +9 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/styles/utils/breakpoints.d.ts +12 -0
- package/dist/styles/utils/breakpoints.js +20 -13
- package/dist/styles/utils/breakpoints.ts +32 -0
- package/dist/ui-kit.cjs +8 -8
- package/dist/ui-kit.css +1 -1
- package/package.json +3 -1
- package/dist/fonts/inter-normal-200.woff2 +0 -0
- package/dist/fonts/inter-normal-300.woff2 +0 -0
- package/dist/fonts/inter-normal-400.woff2 +0 -0
- package/dist/fonts/inter-normal-500.woff2 +0 -0
- package/dist/fonts/inter-normal-600.woff2 +0 -0
- package/dist/fonts/inter-normal-700.woff2 +0 -0
- package/dist/fonts/inter-normal-800.woff2 +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export interface IMotionProviderProps extends PropsWithChildren {
|
|
3
|
+
/**
|
|
4
|
+
* Бросать ошибку, если внутри провайдера отрендерен `motion.*` вместо `m.*`
|
|
5
|
+
* (только в dev). `motion.*` тянет все фичи Motion во вход приложения.
|
|
6
|
+
*
|
|
7
|
+
* Строгость распространяется на всё поддерево, включая children,
|
|
8
|
+
* переданные потребителем, поэтому компоненты UI Kit её не включают.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
strict?: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { domMax as default } from 'framer-motion';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FeatureBundle } from 'framer-motion';
|
|
2
|
+
/** Фичи Motion, если чанк уже загружен, иначе `undefined`. */
|
|
3
|
+
export declare const getLoadedMotionFeatures: () => FeatureBundle | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Загружает фичи Motion одним запросом на всё приложение.
|
|
6
|
+
*
|
|
7
|
+
* LazyMotion не обрабатывает ошибку загрузки, поэтому при сбое отдаём пустой
|
|
8
|
+
* бандл: компоненты остаются статичными, а не сыплют необработанным rejection
|
|
9
|
+
* из каждого провайдера. Промис при этом сбрасывается, и следующий
|
|
10
|
+
* смонтированный провайдер попробует ещё раз, если браузер не закэшировал
|
|
11
|
+
* неудачный импорт.
|
|
12
|
+
*/
|
|
13
|
+
export declare const loadMotionFeatures: () => Promise<FeatureBundle>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
let o, t;
|
|
2
|
+
const r = () => o, n = () => (t || (t = import("./features.js").then(
|
|
3
|
+
(e) => (o = e.default, e.default),
|
|
4
|
+
(e) => (t = void 0, console.error("[ui-kit] Не удалось загрузить фичи Motion:", e), {})
|
|
5
|
+
)), t);
|
|
6
|
+
export {
|
|
7
|
+
r as getLoadedMotionFeatures,
|
|
8
|
+
n as loadMotionFeatures
|
|
9
|
+
};
|
|
@@ -11,3 +11,15 @@ export declare const bp: {
|
|
|
11
11
|
readonly bp1440: (direction?: BreakpointDirection) => string;
|
|
12
12
|
readonly bp1920: (direction?: BreakpointDirection) => string;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Брейкпоинты `bp` для контейнерных запросов: ориентир — ширина ближайшего
|
|
16
|
+
* предка с `container-name: <name>`, а не окна. Смысл `direction` тот же:
|
|
17
|
+
* `max` — уже брейкпоинта, `min` — от него и шире.
|
|
18
|
+
*/
|
|
19
|
+
export declare const bpContainer: {
|
|
20
|
+
readonly xs: (name: string, direction?: BreakpointDirection) => string;
|
|
21
|
+
readonly sm: (name: string, direction?: BreakpointDirection) => string;
|
|
22
|
+
readonly md: (name: string, direction?: BreakpointDirection) => string;
|
|
23
|
+
readonly lg: (name: string, direction?: BreakpointDirection) => string;
|
|
24
|
+
readonly xl: (name: string, direction?: BreakpointDirection) => string;
|
|
25
|
+
};
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import { BreakpointsBase as
|
|
2
|
-
const a = (m,
|
|
3
|
-
xs: (m = "max") => a(
|
|
4
|
-
sm: (m = "max") => a(
|
|
5
|
-
md: (m = "max") => a(
|
|
6
|
-
lg: (m = "max") => a(
|
|
7
|
-
xl: (m = "max") => a(
|
|
8
|
-
bp375: (m = "max") => a(
|
|
9
|
-
bp1024: (m = "max") => a(
|
|
10
|
-
bp1280: (m = "max") => a(
|
|
11
|
-
bp1440: (m = "max") => a(
|
|
12
|
-
bp1920: (m = "max") => a(
|
|
1
|
+
import { BreakpointsBase as t, Breakpoints as n } from "../../utils/hooks/breakpoints/useBreakpoint/useBreakpoint.const.js";
|
|
2
|
+
const a = (m, x = "max") => x === "min" ? `@media (min-width: ${m}px)` : `@media (max-width: ${m - 1}px)`, o = {
|
|
3
|
+
xs: (m = "max") => a(n.xs, m),
|
|
4
|
+
sm: (m = "max") => a(n.sm, m),
|
|
5
|
+
md: (m = "max") => a(n.md, m),
|
|
6
|
+
lg: (m = "max") => a(n.lg, m),
|
|
7
|
+
xl: (m = "max") => a(n.xl, m),
|
|
8
|
+
bp375: (m = "max") => a(t._375, m),
|
|
9
|
+
bp1024: (m = "max") => a(t._1024, m),
|
|
10
|
+
bp1280: (m = "max") => a(t._1280, m),
|
|
11
|
+
bp1440: (m = "max") => a(t._1440, m),
|
|
12
|
+
bp1920: (m = "max") => a(t._1920, m)
|
|
13
|
+
}, i = (m, x, r = "max") => r === "min" ? `@container ${m} (width >= ${x}px)` : `@container ${m} (width < ${x}px)`, p = {
|
|
14
|
+
xs: (m, x = "max") => i(m, n.xs, x),
|
|
15
|
+
sm: (m, x = "max") => i(m, n.sm, x),
|
|
16
|
+
md: (m, x = "max") => i(m, n.md, x),
|
|
17
|
+
lg: (m, x = "max") => i(m, n.lg, x),
|
|
18
|
+
xl: (m, x = "max") => i(m, n.xl, x)
|
|
13
19
|
};
|
|
14
20
|
export {
|
|
15
|
-
|
|
21
|
+
o as bp,
|
|
22
|
+
p as bpContainer
|
|
16
23
|
};
|
|
@@ -33,3 +33,35 @@ export const bp = {
|
|
|
33
33
|
bp1920: (direction: BreakpointDirection = "max") =>
|
|
34
34
|
breakpoint(BreakpointsBase._1920, direction),
|
|
35
35
|
} as const;
|
|
36
|
+
|
|
37
|
+
// Ширина контейнера бывает дробной (проценты, flex), и пара max-width: 575px /
|
|
38
|
+
// min-width: 576px оставляет щель, в которую не попадает ни одно правило.
|
|
39
|
+
// Синтаксис диапазонов щели не оставляет, и его понимают все браузеры с @container
|
|
40
|
+
const containerBreakpoint = (
|
|
41
|
+
name: string,
|
|
42
|
+
px: number,
|
|
43
|
+
direction: BreakpointDirection = "max"
|
|
44
|
+
): string => {
|
|
45
|
+
if (direction === "min") {
|
|
46
|
+
return `@container ${name} (width >= ${px}px)`;
|
|
47
|
+
}
|
|
48
|
+
return `@container ${name} (width < ${px}px)`;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Брейкпоинты `bp` для контейнерных запросов: ориентир — ширина ближайшего
|
|
53
|
+
* предка с `container-name: <name>`, а не окна. Смысл `direction` тот же:
|
|
54
|
+
* `max` — уже брейкпоинта, `min` — от него и шире.
|
|
55
|
+
*/
|
|
56
|
+
export const bpContainer = {
|
|
57
|
+
xs: (name: string, direction: BreakpointDirection = "max") =>
|
|
58
|
+
containerBreakpoint(name, Breakpoints.xs, direction),
|
|
59
|
+
sm: (name: string, direction: BreakpointDirection = "max") =>
|
|
60
|
+
containerBreakpoint(name, Breakpoints.sm, direction),
|
|
61
|
+
md: (name: string, direction: BreakpointDirection = "max") =>
|
|
62
|
+
containerBreakpoint(name, Breakpoints.md, direction),
|
|
63
|
+
lg: (name: string, direction: BreakpointDirection = "max") =>
|
|
64
|
+
containerBreakpoint(name, Breakpoints.lg, direction),
|
|
65
|
+
xl: (name: string, direction: BreakpointDirection = "max") =>
|
|
66
|
+
containerBreakpoint(name, Breakpoints.xl, direction),
|
|
67
|
+
} as const;
|