@itcase/ui 1.2.13 → 1.2.14

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 (44) hide show
  1. package/dist/{Group-Buo_BxGT.js → Group-9Mpk5tQD.js} +8 -4
  2. package/dist/{Group-BXfLh7AZ.js → Group-C9TsGwJy.js} +8 -4
  3. package/dist/cjs/components/CookiesWarning.js +1 -1
  4. package/dist/cjs/components/FormField.js +1 -1
  5. package/dist/cjs/components/Group.js +1 -1
  6. package/dist/cjs/components/Notification.js +1 -0
  7. package/dist/cjs/components/Panel.js +1 -1
  8. package/dist/cjs/components/Response.js +1 -1
  9. package/dist/cjs/components/Select.js +1 -1
  10. package/dist/cjs/context/Notifications.js +128 -144
  11. package/dist/cjs/context/UIContext.js +22 -31
  12. package/dist/cjs/hooks/styleAttributes.interface.js +2 -0
  13. package/dist/cjs/hooks/useDeviceTargetClass.js +1 -0
  14. package/dist/cjs/hooks/useStyles.js +1 -0
  15. package/dist/cjs/hooks.js +2 -0
  16. package/dist/components/CookiesWarning.js +1 -1
  17. package/dist/components/FormField.js +1 -1
  18. package/dist/components/Group.js +1 -1
  19. package/dist/components/Notification.js +1 -0
  20. package/dist/components/Panel.js +1 -1
  21. package/dist/components/Response.js +1 -1
  22. package/dist/components/Select.js +1 -1
  23. package/dist/context/Notifications.js +129 -145
  24. package/dist/context/UIContext.js +23 -32
  25. package/dist/css/components/DatePicker/DatePicker.css +26 -32
  26. package/dist/css/components/Group/Group.css +24 -0
  27. package/dist/hooks/styleAttributes.interface.js +1 -0
  28. package/dist/hooks/useDeviceTargetClass.js +1 -0
  29. package/dist/hooks/useStyles.js +1 -0
  30. package/dist/hooks.js +1 -0
  31. package/dist/types/components/Page/index.d.ts +42 -0
  32. package/dist/types/constants/componentProps/align.d.ts +2 -0
  33. package/dist/types/constants/componentProps/alignDirection.d.ts +2 -0
  34. package/dist/types/constants/componentProps/fill.d.ts +2 -0
  35. package/dist/types/constants/componentProps/horizontalResizeMode.d.ts +2 -0
  36. package/dist/types/constants/componentProps/position.d.ts +2 -0
  37. package/dist/types/constants/componentProps/verticalResizeMode.d.ts +2 -0
  38. package/dist/types/context/Notifications.d.ts +14 -11
  39. package/dist/types/context/Notifications.interface.d.ts +25 -0
  40. package/dist/types/context/UIContext.d.ts +5 -4
  41. package/dist/types/context/index.d.ts +2 -0
  42. package/package.json +19 -18
  43. package/dist/cjs/components/Page.js +0 -416
  44. package/dist/components/Page.js +0 -414
@@ -0,0 +1,25 @@
1
+ import type { tId } from '@itcase/common';
2
+ interface iNotification {
3
+ id: tId;
4
+ _closeTimeout?: ReturnType<typeof setTimeout>;
5
+ closeByTime: number | false;
6
+ status: 'error' | 'info' | 'success' | 'warning';
7
+ text: string;
8
+ textColor: string;
9
+ title: string;
10
+ onClose?: () => void;
11
+ }
12
+ interface iCreatedNotification {
13
+ id?: iNotification['id'];
14
+ closeByTime?: iNotification['closeByTime'];
15
+ status?: iNotification['status'];
16
+ text?: iNotification['text'];
17
+ textColor?: iNotification['textColor'];
18
+ title?: iNotification['title'];
19
+ onClose?: iNotification['onClose'];
20
+ }
21
+ interface iNotificationsProviderProps {
22
+ children: React.ReactNode;
23
+ initialNotificationsList: iCreatedNotification[];
24
+ }
25
+ export type { iNotification, iCreatedNotification, iNotificationsProviderProps };
@@ -1,11 +1,12 @@
1
- export const UIProvider: React.NamedExoticComponent<object>;
2
- export function useUserDeviceContext(): {
1
+ import React from 'react';
2
+ declare function useUserDeviceContext(): {
3
3
  isMobile: boolean;
4
4
  isTablet: boolean;
5
5
  isDesktop: boolean;
6
6
  };
7
- export function useSiteMenuContext(): {
7
+ declare function useSiteMenuContext(): {
8
8
  isSiteMenuOpen: boolean;
9
9
  setIsSiteMenuOpen: () => void;
10
10
  };
11
- import React from 'react';
11
+ declare const UIProvider: React.NamedExoticComponent<object>;
12
+ export { UIProvider, useUserDeviceContext, useSiteMenuContext };
@@ -0,0 +1,2 @@
1
+ export * from './Notifications';
2
+ export * from './UIContext';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/ui",
3
- "version": "1.2.13",
3
+ "version": "1.2.14",
4
4
  "description": "UI components (Modal, Loader, Popup, etc)",
5
5
  "keywords": [
6
6
  "Modal",
@@ -37,9 +37,9 @@
37
37
  }
38
38
  },
39
39
  "exports": {
40
- "./types/components/Modal/Modal.interface": {
41
- "import": "./dist/types/components/Modal/Modal.interface.d.ts",
42
- "types": "./dist/types/components/Modal/Modal.interface.d.ts"
40
+ "./types/components/*/*.interface": {
41
+ "import": "./dist/types/components/*/*.interface.d.ts",
42
+ "types": "./dist/types/components/*/*.interface.d.ts"
43
43
  },
44
44
  "./components/*": {
45
45
  "import": "./dist/components/*.js",
@@ -90,18 +90,18 @@
90
90
  "registry": "https://registry.npmjs.org/"
91
91
  },
92
92
  "dependencies": {
93
- "@itcase/common": "^1.2.10",
93
+ "@itcase/common": "^1.2.11",
94
94
  "clsx": "^2.1.1",
95
95
  "html5-boilerplate": "^9.0.1",
96
96
  "js-cookie": "^3.0.5",
97
97
  "lodash": "^4.17.21",
98
98
  "luxon": "^3.5.0",
99
99
  "prop-types": "^15.8.1",
100
- "rc-slider": "^11.1.5",
100
+ "rc-slider": "^11.1.6",
101
101
  "react": "^18.3.1",
102
102
  "react-dadata": "^2.23.3",
103
103
  "react-date-range": "^2.0.1",
104
- "react-datepicker": "^7.3.0",
104
+ "react-datepicker": "^7.4.0",
105
105
  "react-dom": "^18.3.1",
106
106
  "react-indiana-drag-scroll": "^3.0.3-alpha",
107
107
  "react-inlinesvg": "^4.1.3",
@@ -111,7 +111,7 @@
111
111
  "react-responsive": "^10.0.0",
112
112
  "react-scroll": "^1.9.0",
113
113
  "react-scrollbars-custom": "^4.1.1",
114
- "react-select": "^5.8.0",
114
+ "react-select": "^5.8.1",
115
115
  "swiper": "^11.1.14",
116
116
  "uuid": "^10.0.0"
117
117
  },
@@ -125,26 +125,27 @@
125
125
  "@commitlint/config-conventional": "^19.5.0",
126
126
  "@itcase/lint": "^1.0.13",
127
127
  "@rollup/plugin-babel": "^6.0.4",
128
- "@rollup/plugin-commonjs": "^26.0.1",
128
+ "@rollup/plugin-commonjs": "^28.0.0",
129
129
  "@rollup/plugin-json": "^6.1.0",
130
- "@rollup/plugin-node-resolve": "^15.2.3",
130
+ "@rollup/plugin-node-resolve": "^15.3.0",
131
131
  "@rollup/plugin-terser": "^0.4.4",
132
- "@rollup/plugin-typescript": "^11.1.6",
132
+ "@rollup/plugin-typescript": "^12.1.0",
133
133
  "@semantic-release/changelog": "^6.0.3",
134
134
  "@semantic-release/git": "^10.0.1",
135
135
  "@semantic-release/release-notes-generator": "14.0.1",
136
136
  "@types/js-cookie": "^3.0.6",
137
- "@types/lodash": "^4.17.7",
137
+ "@types/lodash": "^4.17.9",
138
138
  "@types/react": "^18",
139
139
  "@types/react-datepicker": "^7.0.0",
140
140
  "@types/react-dom": "^18.3.0",
141
141
  "@types/react-scroll": "^1.8.10",
142
+ "@types/uuid": "^10.0.0",
142
143
  "babel-loader": "^9.2.1",
143
144
  "babel-plugin-inline-react-svg": "^2.0.2",
144
145
  "babel-plugin-react-docgen": "^4.2.1",
145
146
  "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
146
147
  "conventional-changelog-conventionalcommits": "^8.0.0",
147
- "eslint": "9.10.0",
148
+ "eslint": "9.11.1",
148
149
  "husky": "^9.1.6",
149
150
  "lint-staged": "^15.2.10",
150
151
  "npm": "^10.8.3",
@@ -161,22 +162,22 @@
161
162
  "postcss-hexrgba": "^2.1.0",
162
163
  "postcss-import": "^16.1.0",
163
164
  "postcss-import-ext-glob": "^2.1.1",
164
- "postcss-mixins": "^11.0.1",
165
+ "postcss-mixins": "^11.0.2",
165
166
  "postcss-nested": "^6.2.0",
166
167
  "postcss-nested-ancestors": "^3.0.0",
167
- "postcss-normalize": "^13.0.0",
168
+ "postcss-normalize": "^13.0.1",
168
169
  "postcss-prepend-imports": "^1.0.1",
169
- "postcss-preset-env": "^10.0.3",
170
+ "postcss-preset-env": "^10.0.5",
170
171
  "postcss-pxtorem": "^6.1.0",
171
172
  "postcss-responsive-type": "github:ITCase/postcss-responsive-type",
172
173
  "postcss-sort-media-queries": "^5.2.0",
173
174
  "prettier": "^3.3.3",
174
- "rollup": "^4.21.3",
175
+ "rollup": "^4.22.5",
175
176
  "rollup-plugin-copy": "^3.5.0",
176
177
  "rollup-plugin-dts": "^6.1.1",
177
178
  "rollup-plugin-peer-deps-external": "^2.2.4",
178
179
  "rollup-preserve-directives": "^1.1.1",
179
- "semantic-release": "^24.1.1",
180
+ "semantic-release": "^24.1.2",
180
181
  "stylelint": "^16.9.0",
181
182
  "typescript": "^5.6.2"
182
183
  }
@@ -1,416 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var PropTypes = require('prop-types');
5
- var clsx = require('clsx');
6
- var alignDirection = require('../constants/componentProps/alignDirection.js');
7
- var align = require('../constants/componentProps/align.js');
8
- var fill = require('../constants/componentProps/fill.js');
9
- var horizontalResizeMode = require('../constants/componentProps/horizontalResizeMode.js');
10
- var position = require('../constants/componentProps/position.js');
11
- var verticalResizeMode = require('../constants/componentProps/verticalResizeMode.js');
12
- var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
13
- var useStyles = require('../hooks/useStyles.js');
14
- require('lodash/castArray');
15
- require('lodash/camelCase');
16
- require('../context/UIContext.js');
17
- require('../hooks/useMediaQueries.js');
18
- require('react-responsive');
19
- require('lodash/maxBy');
20
- require('lodash/upperFirst');
21
- require('../hooks/styleAttributes.js');
22
-
23
- function Page(props) {
24
- const {
25
- after,
26
- before,
27
- children,
28
- className,
29
- id,
30
- tag: Tag,
31
- type
32
- } = props;
33
- const alignDirectionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
34
- prefix: 'align_',
35
- propsKey: 'alignDirection'
36
- });
37
- const alignClass = useDeviceTargetClass.useDeviceTargetClass(props, {
38
- prefix: 'align_',
39
- propsKey: 'align'
40
- });
41
- const resizeHorizontalClass = useDeviceTargetClass.useDeviceTargetClass(props, {
42
- prefix: 'wrapper_resize-horizontal_',
43
- propsKey: 'horizontalResizing'
44
- });
45
- const resizeVerticalClass = useDeviceTargetClass.useDeviceTargetClass(props, {
46
- prefix: 'wrapper_resize-vertical_',
47
- propsKey: 'verticalResizing'
48
- });
49
- const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
50
- prefix: 'fill_',
51
- propsKey: 'fill'
52
- });
53
- const positionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
54
- prefix: 'position_',
55
- propsKey: 'position'
56
- });
57
- const {
58
- styles,
59
- wrapper: wrapperStyles
60
- } = useStyles.useStyles(props);
61
- return /*#__PURE__*/React.createElement("div", {
62
- id: id,
63
- className: clsx('page', className, type && `${className}_type_${type}`, fillClass, resizeHorizontalClass, resizeVerticalClass, positionClass),
64
- style: styles
65
- }, /*#__PURE__*/React.createElement("div", {
66
- className: clsx('page__wrapper', alignDirectionClass, alignClass, 'content'),
67
- style: wrapperStyles
68
- }, before, children, after));
69
- }
70
- Page.propTypes = {
71
- children: PropTypes.any,
72
- className: PropTypes.string,
73
- before: PropTypes.string,
74
- after: PropTypes.string,
75
- id: PropTypes.string,
76
- fill: PropTypes.oneOf(fill.default),
77
- fillMobile: PropTypes.oneOf(fill.default),
78
- fillTablet: PropTypes.oneOf(fill.default),
79
- fillDesktop: PropTypes.oneOf(fill.default),
80
- type: PropTypes.string,
81
- tag: PropTypes.string,
82
- position: PropTypes.oneOf(position.default),
83
- positionMobile: PropTypes.oneOf(position.default),
84
- positionTablet: PropTypes.oneOf(position.default),
85
- positionDesktop: PropTypes.oneOf(position.default),
86
- wrapperPosition: PropTypes.oneOf(position.default),
87
- wrapperPositionMobile: PropTypes.oneOf(position.default),
88
- wrapperPositionTablet: PropTypes.oneOf(position.default),
89
- wrapperPositionDesktop: PropTypes.oneOf(position.default),
90
- horizontalResizing: PropTypes.oneOf(horizontalResizeMode.default),
91
- horizontalResizingMobile: PropTypes.oneOf(horizontalResizeMode.default),
92
- horizontalResizingTablet: PropTypes.oneOf(horizontalResizeMode.default),
93
- horizontalResizingDesktop: PropTypes.oneOf(horizontalResizeMode.default),
94
- verticalResizing: PropTypes.oneOf(verticalResizeMode.default),
95
- verticalResizingMobile: PropTypes.oneOf(verticalResizeMode.default),
96
- verticalResizingTablet: PropTypes.oneOf(verticalResizeMode.default),
97
- verticalResizingDesktop: PropTypes.oneOf(verticalResizeMode.default),
98
- align: PropTypes.oneOf(align.default),
99
- alignMobile: PropTypes.oneOf(align.default),
100
- alignTablet: PropTypes.oneOf(align.default),
101
- alignDesktop: PropTypes.oneOf(align.default),
102
- alignDirection: PropTypes.oneOf(alignDirection.default),
103
- alignDirectionMobile: PropTypes.oneOf(alignDirection.default),
104
- alignDirectionTablet: PropTypes.oneOf(alignDirection.default),
105
- alignDirectionDesktop: PropTypes.oneOf(alignDirection.default)
106
- };
107
- Page.__docgenInfo = {
108
- "description": "",
109
- "methods": [],
110
- "displayName": "Page",
111
- "props": {
112
- "children": {
113
- "description": "",
114
- "type": {
115
- "name": "any"
116
- },
117
- "required": false
118
- },
119
- "className": {
120
- "description": "",
121
- "type": {
122
- "name": "string"
123
- },
124
- "required": false
125
- },
126
- "before": {
127
- "description": "",
128
- "type": {
129
- "name": "string"
130
- },
131
- "required": false
132
- },
133
- "after": {
134
- "description": "",
135
- "type": {
136
- "name": "string"
137
- },
138
- "required": false
139
- },
140
- "id": {
141
- "description": "",
142
- "type": {
143
- "name": "string"
144
- },
145
- "required": false
146
- },
147
- "fill": {
148
- "description": "",
149
- "type": {
150
- "name": "enum",
151
- "computed": true,
152
- "value": "fillProps"
153
- },
154
- "required": false
155
- },
156
- "fillMobile": {
157
- "description": "",
158
- "type": {
159
- "name": "enum",
160
- "computed": true,
161
- "value": "fillProps"
162
- },
163
- "required": false
164
- },
165
- "fillTablet": {
166
- "description": "",
167
- "type": {
168
- "name": "enum",
169
- "computed": true,
170
- "value": "fillProps"
171
- },
172
- "required": false
173
- },
174
- "fillDesktop": {
175
- "description": "",
176
- "type": {
177
- "name": "enum",
178
- "computed": true,
179
- "value": "fillProps"
180
- },
181
- "required": false
182
- },
183
- "type": {
184
- "description": "",
185
- "type": {
186
- "name": "string"
187
- },
188
- "required": false
189
- },
190
- "tag": {
191
- "description": "",
192
- "type": {
193
- "name": "string"
194
- },
195
- "required": false
196
- },
197
- "position": {
198
- "description": "",
199
- "type": {
200
- "name": "enum",
201
- "computed": true,
202
- "value": "positionProps"
203
- },
204
- "required": false
205
- },
206
- "positionMobile": {
207
- "description": "",
208
- "type": {
209
- "name": "enum",
210
- "computed": true,
211
- "value": "positionProps"
212
- },
213
- "required": false
214
- },
215
- "positionTablet": {
216
- "description": "",
217
- "type": {
218
- "name": "enum",
219
- "computed": true,
220
- "value": "positionProps"
221
- },
222
- "required": false
223
- },
224
- "positionDesktop": {
225
- "description": "",
226
- "type": {
227
- "name": "enum",
228
- "computed": true,
229
- "value": "positionProps"
230
- },
231
- "required": false
232
- },
233
- "wrapperPosition": {
234
- "description": "",
235
- "type": {
236
- "name": "enum",
237
- "computed": true,
238
- "value": "positionProps"
239
- },
240
- "required": false
241
- },
242
- "wrapperPositionMobile": {
243
- "description": "",
244
- "type": {
245
- "name": "enum",
246
- "computed": true,
247
- "value": "positionProps"
248
- },
249
- "required": false
250
- },
251
- "wrapperPositionTablet": {
252
- "description": "",
253
- "type": {
254
- "name": "enum",
255
- "computed": true,
256
- "value": "positionProps"
257
- },
258
- "required": false
259
- },
260
- "wrapperPositionDesktop": {
261
- "description": "",
262
- "type": {
263
- "name": "enum",
264
- "computed": true,
265
- "value": "positionProps"
266
- },
267
- "required": false
268
- },
269
- "horizontalResizing": {
270
- "description": "",
271
- "type": {
272
- "name": "enum",
273
- "computed": true,
274
- "value": "horizontalResizeModeProps"
275
- },
276
- "required": false
277
- },
278
- "horizontalResizingMobile": {
279
- "description": "",
280
- "type": {
281
- "name": "enum",
282
- "computed": true,
283
- "value": "horizontalResizeModeProps"
284
- },
285
- "required": false
286
- },
287
- "horizontalResizingTablet": {
288
- "description": "",
289
- "type": {
290
- "name": "enum",
291
- "computed": true,
292
- "value": "horizontalResizeModeProps"
293
- },
294
- "required": false
295
- },
296
- "horizontalResizingDesktop": {
297
- "description": "",
298
- "type": {
299
- "name": "enum",
300
- "computed": true,
301
- "value": "horizontalResizeModeProps"
302
- },
303
- "required": false
304
- },
305
- "verticalResizing": {
306
- "description": "",
307
- "type": {
308
- "name": "enum",
309
- "computed": true,
310
- "value": "verticalResizeModeProps"
311
- },
312
- "required": false
313
- },
314
- "verticalResizingMobile": {
315
- "description": "",
316
- "type": {
317
- "name": "enum",
318
- "computed": true,
319
- "value": "verticalResizeModeProps"
320
- },
321
- "required": false
322
- },
323
- "verticalResizingTablet": {
324
- "description": "",
325
- "type": {
326
- "name": "enum",
327
- "computed": true,
328
- "value": "verticalResizeModeProps"
329
- },
330
- "required": false
331
- },
332
- "verticalResizingDesktop": {
333
- "description": "",
334
- "type": {
335
- "name": "enum",
336
- "computed": true,
337
- "value": "verticalResizeModeProps"
338
- },
339
- "required": false
340
- },
341
- "align": {
342
- "description": "",
343
- "type": {
344
- "name": "enum",
345
- "computed": true,
346
- "value": "alignProps"
347
- },
348
- "required": false
349
- },
350
- "alignMobile": {
351
- "description": "",
352
- "type": {
353
- "name": "enum",
354
- "computed": true,
355
- "value": "alignProps"
356
- },
357
- "required": false
358
- },
359
- "alignTablet": {
360
- "description": "",
361
- "type": {
362
- "name": "enum",
363
- "computed": true,
364
- "value": "alignProps"
365
- },
366
- "required": false
367
- },
368
- "alignDesktop": {
369
- "description": "",
370
- "type": {
371
- "name": "enum",
372
- "computed": true,
373
- "value": "alignProps"
374
- },
375
- "required": false
376
- },
377
- "alignDirection": {
378
- "description": "",
379
- "type": {
380
- "name": "enum",
381
- "computed": true,
382
- "value": "alignDirectionProps"
383
- },
384
- "required": false
385
- },
386
- "alignDirectionMobile": {
387
- "description": "",
388
- "type": {
389
- "name": "enum",
390
- "computed": true,
391
- "value": "alignDirectionProps"
392
- },
393
- "required": false
394
- },
395
- "alignDirectionTablet": {
396
- "description": "",
397
- "type": {
398
- "name": "enum",
399
- "computed": true,
400
- "value": "alignDirectionProps"
401
- },
402
- "required": false
403
- },
404
- "alignDirectionDesktop": {
405
- "description": "",
406
- "type": {
407
- "name": "enum",
408
- "computed": true,
409
- "value": "alignDirectionProps"
410
- },
411
- "required": false
412
- }
413
- }
414
- };
415
-
416
- exports.Page = Page;