@shmidko61/lc-ui-kit 0.11.0 → 0.13.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.
Files changed (62) hide show
  1. package/README.md +89 -0
  2. package/dist/alert/alert.d.ts +5 -0
  3. package/dist/alert/helpers/alert.helpers.d.ts +27 -0
  4. package/dist/alert/helpers/index.d.ts +1 -0
  5. package/dist/alert/index.d.ts +2 -0
  6. package/dist/alert/types/alert.types.d.ts +25 -0
  7. package/dist/alert/types/index.d.ts +1 -0
  8. package/dist/alert-CTIWpkmD.js +128 -0
  9. package/dist/alert-DTc0Usg-.cjs +1 -0
  10. package/dist/alert.cjs +1 -0
  11. package/dist/alert.js +4 -0
  12. package/dist/box/box.d.ts +2 -2
  13. package/dist/box/box.types.d.ts +21 -1
  14. package/dist/box/index.d.ts +1 -0
  15. package/dist/box.cjs +1 -1
  16. package/dist/box.js +262 -203
  17. package/dist/button/button.helpers.d.ts +1 -1
  18. package/dist/button/index.d.ts +1 -0
  19. package/dist/button.cjs +1 -1
  20. package/dist/button.js +152 -141
  21. package/dist/flex/flex.d.ts +1 -1
  22. package/dist/flex/flex.types.d.ts +1 -1
  23. package/dist/flex/index.d.ts +1 -0
  24. package/dist/flex.cjs +1 -1
  25. package/dist/flex.js +18 -18
  26. package/dist/grid.cjs +1 -1
  27. package/dist/grid.js +57 -57
  28. package/dist/icons/icons.d.ts +8 -0
  29. package/dist/icons/index.d.ts +1 -0
  30. package/dist/icons.cjs +1 -1
  31. package/dist/icons.js +40 -36
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.d.ts +7 -3
  34. package/dist/index.js +101 -90
  35. package/dist/input/input.types.d.ts +1 -1
  36. package/dist/notification-provider/helpers/index.d.ts +1 -0
  37. package/dist/notification-provider/helpers/notification-provider.helpers.d.ts +8 -0
  38. package/dist/notification-provider/hooks/index.d.ts +1 -0
  39. package/dist/notification-provider/hooks/notification-provider.hooks.d.ts +5 -0
  40. package/dist/notification-provider/index.d.ts +3 -0
  41. package/dist/notification-provider/notification-provider.d.ts +4 -0
  42. package/dist/notification-provider/types/index.d.ts +1 -0
  43. package/dist/notification-provider/types/notification-provider.types.d.ts +61 -0
  44. package/dist/notification-provider-C2ypXy2W.cjs +1 -0
  45. package/dist/notification-provider-WLUaZyMB.js +113 -0
  46. package/dist/notification-provider.cjs +1 -0
  47. package/dist/notification-provider.js +6 -0
  48. package/dist/shared/responsive-style/index.d.ts +1 -0
  49. package/dist/shared/responsive-style/responsive-style.types.d.ts +1 -1
  50. package/dist/styles.css +1 -1
  51. package/dist/toast/index.d.ts +2 -0
  52. package/dist/toast/toast.d.ts +5 -0
  53. package/dist/toast/types/index.d.ts +1 -0
  54. package/dist/toast/types/toast.types.d.ts +10 -0
  55. package/dist/toast-CH8VqvLC.cjs +1 -0
  56. package/dist/toast-DpjugQ8H.js +49 -0
  57. package/dist/toast.cjs +1 -0
  58. package/dist/toast.js +4 -0
  59. package/dist/typography/index.d.ts +1 -0
  60. package/dist/typography/typography.helpers.d.ts +1 -1
  61. package/package.json +35 -4
  62. package/dist/vite.config.d.ts +0 -2
@@ -0,0 +1,2 @@
1
+ export { Toast } from './toast';
2
+ export type { ToastProps } from './types/index';
@@ -0,0 +1,5 @@
1
+ import { JSX } from 'react';
2
+ import { ToastProps } from './types/index';
3
+ /** Управляемый тост без портала: расположение и очередь задаёт приложение. */
4
+ export declare function Toast({ open, duration, onClose, onMouseEnter, onMouseLeave, onFocus, onBlur, ...props }: ToastProps): JSX.Element | null;
5
+ export type { ToastProps } from './types/index';
@@ -0,0 +1 @@
1
+ export type { ToastProps } from './toast.types';
@@ -0,0 +1,10 @@
1
+ import { AlertProps } from '../../alert/index';
2
+ /** Toast наследует все слоты и responsive style props Alert. */
3
+ export type ToastProps = AlertProps & {
4
+ /** Видимость, по умолчанию true. Закрытие управляется родителем через onClose. */
5
+ open?: boolean;
6
+ /** Автозакрытие в мс; 0 (по умолчанию) отключает таймер.
7
+ * Наведение и фокус приостанавливают отсчёт с сохранением остатка.
8
+ */
9
+ duration?: number;
10
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";const q=require("react/jsx-runtime"),t=require("react"),x=require("./alert-DTc0Usg-.cjs");function M({open:u=!0,duration:s=0,onClose:r,onMouseEnter:l,onMouseLeave:m,onFocus:T,onBlur:E,...R}){const[n,a]=t.useState(!1),[f,i]=t.useState(!1),c=t.useRef(s),o=t.useRef(r);return t.useEffect(()=>{o.current=r},[r]),t.useEffect(()=>{c.current=s},[s,u]),t.useEffect(()=>{if(!u||s<=0||!r||n||f)return;const e=Date.now(),g=setTimeout(()=>o.current?.(),c.current);return()=>{clearTimeout(g),c.current=Math.max(0,c.current-(Date.now()-e))}},[u,s,r,n,f]),u?q.jsx(x.Alert,{variant:"soft",...R,onClose:r,onMouseEnter:e=>{a(!0),l?.(e)},onMouseLeave:e=>{a(!1),m?.(e)},onFocus:e=>{i(!0),T?.(e)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||i(!1),E?.(e)}}):null}exports.Toast=M;
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { jsx as v } from "react/jsx-runtime";
3
+ import { useState as m, useRef as l, useEffect as c } from "react";
4
+ import { A as w } from "./alert-CTIWpkmD.js";
5
+ function F({
6
+ open: s = !0,
7
+ duration: r = 0,
8
+ onClose: t,
9
+ onMouseEnter: T,
10
+ onMouseLeave: g,
11
+ onFocus: x,
12
+ onBlur: M,
13
+ ...d
14
+ }) {
15
+ const [n, a] = m(!1), [f, o] = m(!1), u = l(r), i = l(t);
16
+ return c(() => {
17
+ i.current = t;
18
+ }, [t]), c(() => {
19
+ u.current = r;
20
+ }, [r, s]), c(() => {
21
+ if (!s || r <= 0 || !t || n || f) return;
22
+ const e = Date.now(), h = setTimeout(() => i.current?.(), u.current);
23
+ return () => {
24
+ clearTimeout(h), u.current = Math.max(0, u.current - (Date.now() - e));
25
+ };
26
+ }, [s, r, t, n, f]), s ? /* @__PURE__ */ v(
27
+ w,
28
+ {
29
+ variant: "soft",
30
+ ...d,
31
+ onClose: t,
32
+ onMouseEnter: (e) => {
33
+ a(!0), T?.(e);
34
+ },
35
+ onMouseLeave: (e) => {
36
+ a(!1), g?.(e);
37
+ },
38
+ onFocus: (e) => {
39
+ o(!0), x?.(e);
40
+ },
41
+ onBlur: (e) => {
42
+ e.currentTarget.contains(e.relatedTarget) || o(!1), M?.(e);
43
+ }
44
+ }
45
+ ) : null;
46
+ }
47
+ export {
48
+ F as T
49
+ };
package/dist/toast.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./toast-CH8VqvLC.cjs");exports.Toast=t.Toast;
package/dist/toast.js ADDED
@@ -0,0 +1,4 @@
1
+ import { T as r } from "./toast-DpjugQ8H.js";
2
+ export {
3
+ r as Toast
4
+ };
@@ -0,0 +1 @@
1
+ export * from './typography';
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { UiKitTypographyToken } from '../design-tokens/typography.tokens';
3
3
  import { CssVariableMap, ResponsiveStyleBreakpoint, ResponsiveUiKitStyleProps } from '../shared/responsive-style/responsive-style.types';
4
- import { UiKitTypographyProps } from '../types';
4
+ import { UiKitTypographyProps } from '../types/index';
5
5
  /**
6
6
  * Токены размера шрифта, которые Typography может подключить к внутренним CSS-переменным.
7
7
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shmidko61/lc-ui-kit",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -69,6 +69,15 @@
69
69
  ],
70
70
  "ui-kit-provider": [
71
71
  "dist/ui-kit-provider/ui-kit-provider.d.ts"
72
+ ],
73
+ "alert": [
74
+ "dist/alert/index.d.ts"
75
+ ],
76
+ "toast": [
77
+ "dist/toast/index.d.ts"
78
+ ],
79
+ "notification-provider": [
80
+ "dist/notification-provider/index.d.ts"
72
81
  ]
73
82
  }
74
83
  },
@@ -173,6 +182,21 @@
173
182
  "types": "./dist/ui-kit-provider/ui-kit-provider.d.ts",
174
183
  "import": "./dist/ui-kit-provider.js",
175
184
  "require": "./dist/ui-kit-provider.cjs"
185
+ },
186
+ "./alert": {
187
+ "types": "./dist/alert/index.d.ts",
188
+ "import": "./dist/alert.js",
189
+ "require": "./dist/alert.cjs"
190
+ },
191
+ "./toast": {
192
+ "types": "./dist/toast/index.d.ts",
193
+ "import": "./dist/toast.js",
194
+ "require": "./dist/toast.cjs"
195
+ },
196
+ "./notification-provider": {
197
+ "types": "./dist/notification-provider/index.d.ts",
198
+ "import": "./dist/notification-provider.js",
199
+ "require": "./dist/notification-provider.cjs"
176
200
  }
177
201
  },
178
202
  "sideEffects": [
@@ -207,15 +231,22 @@
207
231
  "vite-plugin-svgr": "^5.2.0"
208
232
  },
209
233
  "scripts": {
234
+ "verify:package": "pnpm typecheck && pnpm lint && pnpm format:check && pnpm build && pnpm typecheck:package && pnpm test:checks && pnpm test:package && pnpm test:hover && pnpm test:states && pnpm pack:check && pnpm storybook:build",
210
235
  "build": "vite build && tailwindcss -i src/styles.css -o dist/styles.css --minify",
211
236
  "lint": "eslint src .storybook vite.config.ts --max-warnings=0",
212
237
  "lint:fix": "eslint src .storybook vite.config.ts --fix",
213
- "format": "prettier src .storybook postcss.config.cjs tailwind.config.cjs tsconfig.json vite.config.ts package.json --write",
214
- "format:check": "prettier src .storybook postcss.config.cjs tailwind.config.cjs tsconfig.json vite.config.ts package.json --check",
238
+ "format": "prettier src .storybook scripts type-tests README.md CHANGELOG.md postcss.config.cjs tailwind.config.cjs tsconfig*.json vite.config.ts package.json --write",
239
+ "format:check": "prettier src .storybook scripts type-tests README.md CHANGELOG.md postcss.config.cjs tailwind.config.cjs tsconfig*.json vite.config.ts package.json --check",
215
240
  "storybook": "storybook dev -p 6006 --host 127.0.0.1",
216
241
  "storybook:build": "storybook build",
217
242
  "typecheck": "tsc --noEmit",
218
243
  "test:hover": "node scripts/check-hover.mjs",
219
- "typecheck:package": "tsc -p tsconfig.package-test.json"
244
+ "test:states": "node scripts/check-states.mjs",
245
+ "test:package": "node scripts/check-package.mjs",
246
+ "test:checks": "node --test scripts/package-checks.test.mjs",
247
+ "pack:check": "node scripts/check-tarball.mjs",
248
+ "typecheck:package": "tsc -p tsconfig.package-test.json",
249
+ "test:notifications": "node scripts/check-notifications-browser.mjs",
250
+ "test:compatibility": "node scripts/check-compatibility.mjs"
220
251
  }
221
252
  }
@@ -1,2 +0,0 @@
1
- declare const _default: import('vite').UserConfig;
2
- export default _default;