@atls-ui-parts/datepicker 0.1.1 → 1.0.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 (79) hide show
  1. package/dist/datepicker.component.d.ts +4 -3
  2. package/dist/datepicker.component.d.ts.map +1 -0
  3. package/dist/datepicker.component.js +19 -21
  4. package/dist/datepicker.component.js.map +1 -0
  5. package/dist/datepicker.interface.d.ts +5 -4
  6. package/dist/datepicker.interface.d.ts.map +1 -0
  7. package/dist/datepicker.interface.js +2 -2
  8. package/dist/datepicker.interface.js.map +1 -0
  9. package/dist/datepicker.stories.d.ts +11 -462
  10. package/dist/datepicker.stories.d.ts.map +1 -0
  11. package/dist/datepicker.stories.js +476 -475
  12. package/dist/datepicker.stories.js.map +1 -0
  13. package/dist/index.d.ts +4 -4
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +4 -20
  16. package/dist/index.js.map +1 -0
  17. package/dist/utils/create-appearance-styles/create-appearance-styles.interfaces.d.ts +25 -0
  18. package/dist/utils/create-appearance-styles/create-appearance-styles.interfaces.d.ts.map +1 -0
  19. package/dist/utils/create-appearance-styles/create-appearance-styles.interfaces.js +2 -0
  20. package/dist/utils/create-appearance-styles/create-appearance-styles.interfaces.js.map +1 -0
  21. package/dist/utils/create-appearance-styles/create-appearance-styles.util.d.ts +115 -0
  22. package/dist/utils/create-appearance-styles/create-appearance-styles.util.d.ts.map +1 -0
  23. package/dist/utils/create-appearance-styles/create-appearance-styles.util.js +68 -0
  24. package/dist/utils/create-appearance-styles/create-appearance-styles.util.js.map +1 -0
  25. package/dist/utils/create-appearance-styles/index.d.ts +3 -0
  26. package/dist/utils/create-appearance-styles/index.d.ts.map +1 -0
  27. package/dist/utils/create-appearance-styles/index.js +3 -0
  28. package/dist/utils/create-appearance-styles/index.js.map +1 -0
  29. package/dist/{styles/shape/shape.interfaces.d.ts → utils/create-shape-styles/create-shape-styles.interfaces.d.ts} +5 -3
  30. package/dist/utils/create-shape-styles/create-shape-styles.interfaces.d.ts.map +1 -0
  31. package/dist/utils/create-shape-styles/create-shape-styles.interfaces.js +2 -0
  32. package/dist/utils/create-shape-styles/create-shape-styles.interfaces.js.map +1 -0
  33. package/dist/{styles/shape/shape.styles.d.ts → utils/create-shape-styles/create-shape-styles.util.d.ts} +15 -19
  34. package/dist/utils/create-shape-styles/create-shape-styles.util.d.ts.map +1 -0
  35. package/dist/utils/create-shape-styles/create-shape-styles.util.js +69 -0
  36. package/dist/utils/create-shape-styles/create-shape-styles.util.js.map +1 -0
  37. package/dist/utils/create-shape-styles/index.d.ts +3 -0
  38. package/dist/utils/create-shape-styles/index.d.ts.map +1 -0
  39. package/dist/utils/create-shape-styles/index.js +3 -0
  40. package/dist/utils/create-shape-styles/index.js.map +1 -0
  41. package/dist/utils/index.d.ts +4 -0
  42. package/dist/utils/index.d.ts.map +1 -0
  43. package/dist/utils/index.js +4 -0
  44. package/dist/utils/index.js.map +1 -0
  45. package/dist/utils/register-locales/index.d.ts +2 -0
  46. package/dist/utils/register-locales/index.d.ts.map +1 -0
  47. package/dist/utils/register-locales/index.js +2 -0
  48. package/dist/utils/register-locales/index.js.map +1 -0
  49. package/dist/utils/register-locales/register-locales.util.d.ts +2 -0
  50. package/dist/utils/register-locales/register-locales.util.d.ts.map +1 -0
  51. package/dist/utils/register-locales/register-locales.util.js +8 -0
  52. package/dist/utils/register-locales/register-locales.util.js.map +1 -0
  53. package/package.json +36 -19
  54. package/dist/locales/index.d.ts +0 -2
  55. package/dist/locales/index.js +0 -18
  56. package/dist/locales/locales.d.ts +0 -3
  57. package/dist/locales/locales.js +0 -10
  58. package/dist/locales/register-locales.d.ts +0 -2
  59. package/dist/locales/register-locales.js +0 -11
  60. package/dist/styles/appearance/appearance.interfaces.d.ts +0 -22
  61. package/dist/styles/appearance/appearance.interfaces.js +0 -2
  62. package/dist/styles/appearance/appearance.styles.d.ts +0 -113
  63. package/dist/styles/appearance/appearance.styles.js +0 -76
  64. package/dist/styles/appearance/index.d.ts +0 -2
  65. package/dist/styles/appearance/index.js +0 -18
  66. package/dist/styles/base/base.styles.d.ts +0 -1
  67. package/dist/styles/base/base.styles.js +0 -905
  68. package/dist/styles/base/index.d.ts +0 -1
  69. package/dist/styles/base/index.js +0 -17
  70. package/dist/styles/datepicker-styles.interfaces.d.ts +0 -4
  71. package/dist/styles/datepicker-styles.interfaces.js +0 -2
  72. package/dist/styles/datepicker.styles.d.ts +0 -3
  73. package/dist/styles/datepicker.styles.js +0 -57
  74. package/dist/styles/index.d.ts +0 -5
  75. package/dist/styles/index.js +0 -21
  76. package/dist/styles/shape/index.d.ts +0 -2
  77. package/dist/styles/shape/index.js +0 -18
  78. package/dist/styles/shape/shape.interfaces.js +0 -2
  79. package/dist/styles/shape/shape.styles.js +0 -79
@@ -1,4 +1,5 @@
1
+ import 'react-datepicker/dist/react-datepicker.css';
1
2
  import { FC } from 'react';
2
- import { DatepickerProps } from './datepicker.interface';
3
- declare const Datepicker: FC<DatepickerProps>;
4
- export { Datepicker };
3
+ import { DatepickerProps } from './datepicker.interface.js';
4
+ export declare const Datepicker: FC<DatepickerProps>;
5
+ //# sourceMappingURL=datepicker.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datepicker.component.d.ts","sourceRoot":"","sources":["../src/datepicker.component.tsx"],"names":[],"mappings":"AAAA,OAAO,4CAA4C,CAAA;AAMnD,OAAO,EAAE,EAAE,EAAE,MAA0B,OAAO,CAAA;AAI9C,OAAO,EAAE,eAAe,EAAE,MAAa,2BAA2B,CAAA;AAKlE,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAiB1C,CAAA"}
@@ -1,26 +1,24 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Datepicker = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const react_datepicker_1 = __importDefault(require("react-datepicker"));
9
- const react_2 = require("react");
10
- const react_datepicker_2 = require("react-datepicker");
11
- const locales_1 = require("./locales");
12
- const styles_1 = require("./styles");
13
- const Datepicker = (props) => {
14
- const { withBaseStyle = true, ...restProps } = props;
15
- (0, react_2.useEffect)(() => {
16
- (0, locales_1.registerLocales)();
17
- (0, react_datepicker_2.setDefaultLocale)('ru');
1
+ import 'react-datepicker/dist/react-datepicker.css';
2
+ import { injectGlobal } from '@emotion/css';
3
+ import React from 'react';
4
+ import DatepickerComponent from 'react-datepicker';
5
+ import { useEffect } from 'react';
6
+ import { setDefaultLocale } from 'react-datepicker';
7
+ import { createAppearanceStyles } from './utils/index.js';
8
+ import { createShapeStyles } from './utils/index.js';
9
+ import { registerLocales } from './utils/index.js';
10
+ export const Datepicker = ({ withBaseStyle = true, ...props }) => {
11
+ useEffect(() => {
12
+ registerLocales();
13
+ setDefaultLocale('ru');
18
14
  }, []);
19
- (0, react_2.useEffect)(() => {
15
+ useEffect(() => {
20
16
  if (withBaseStyle) {
21
- (0, styles_1.createAndInjectDatepickerStyles)(props);
17
+ const shapeStyles = createShapeStyles(props);
18
+ const appearanceStyles = createAppearanceStyles(props);
19
+ injectGlobal(shapeStyles, appearanceStyles);
22
20
  }
23
21
  }, [withBaseStyle, props]);
24
- return react_1.default.createElement(react_datepicker_1.default, { ...restProps });
22
+ return React.createElement(DatepickerComponent, { ...props });
25
23
  };
26
- exports.Datepicker = Datepicker;
24
+ //# sourceMappingURL=datepicker.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datepicker.component.js","sourceRoot":"","sources":["../src/datepicker.component.tsx"],"names":[],"mappings":"AAAA,OAAO,4CAA4C,CAAA;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAgB,cAAc,CAAA;AAErD,OAAO,KAAK,MAA2B,OAAO,CAAA;AAC9C,OAAO,mBAAmB,MAAa,kBAAkB,CAAA;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAmB,OAAO,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAY,kBAAkB,CAAA;AAGzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAW,kBAAkB,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAa,kBAAkB,CAAA;AAEzD,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,EAAE,aAAa,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACpF,SAAS,CAAC,GAAG,EAAE;QACb,eAAe,EAAE,CAAA;QACjB,gBAAgB,CAAC,IAAI,CAAC,CAAA;IACxB,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,aAAa,EAAE;YACjB,MAAM,WAAW,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAA;YAC5C,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAA;YAEtD,YAAY,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAA;SAC5C;IACH,CAAC,EAAE,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAA;IAG1B,OAAO,oBAAC,mBAAmB,OAAK,KAAK,GAAI,CAAA;AAC3C,CAAC,CAAA"}
@@ -1,4 +1,5 @@
1
- import { ReactDatePickerProps } from 'react-datepicker';
2
- import { DatepickerStyles } from './styles';
3
- export interface DatepickerProps extends ReactDatePickerProps, DatepickerStyles {
4
- }
1
+ import { DatePickerProps } from 'react-datepicker';
2
+ import { AppearanceStyles } from './utils/index.js';
3
+ import { ShapeStyles } from './utils/index.js';
4
+ export type DatepickerProps = DatePickerProps & AppearanceStyles & ShapeStyles;
5
+ //# sourceMappingURL=datepicker.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datepicker.interface.d.ts","sourceRoot":"","sources":["../src/datepicker.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAO,kBAAkB,CAAA;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAW,kBAAkB,CAAA;AAEnD,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,gBAAgB,GAAG,WAAW,CAAA"}
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=datepicker.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datepicker.interface.js","sourceRoot":"","sources":["../src/datepicker.interface.ts"],"names":[],"mappings":""}
@@ -1,462 +1,11 @@
1
- import React from 'react';
2
- declare const _default: {
3
- title: string;
4
- };
5
- export default _default;
6
- export declare const Datepicker: {
7
- (props: any): React.JSX.Element;
8
- args: {
9
- arrowColor: string;
10
- arrowHoverColor: string;
11
- showPopperArrow: boolean;
12
- cellColor: null;
13
- cellFontColor: string;
14
- cellActiveColor: string;
15
- cellActiveFontColor: string;
16
- cellHoverColor: null;
17
- cellHoverFontColor: null;
18
- cellInRangeBorderRadius: number;
19
- cellInRangeColor: string;
20
- cellInRangeFontColor: string;
21
- cellInRangeHoverColor: string;
22
- cellInRangeHoverFontColor: string;
23
- cellMargin: number;
24
- cellPadding: number;
25
- cellBorderRadius: number;
26
- dividerPosition: string;
27
- dividerWidth: string;
28
- dividerColor: string;
29
- fontFamily: string;
30
- fontStyle: string;
31
- fontWeight: number;
32
- headerBackgroundColor: string;
33
- inputActiveBorderColor: string;
34
- inputBorderColor: string;
35
- inputBorderWidth: number;
36
- inputBorderRadius: number;
37
- inputPadding: string;
38
- currentMonthPadding: number;
39
- currentMonthFontFamily: string;
40
- currentMonthFontStyle: string;
41
- currentMonthFontWeight: number;
42
- currentMonthFontSize: number;
43
- currentMonthFontColor: string;
44
- dayNameFontFamily: string;
45
- dayNameFontStyle: string;
46
- dayNameFontWeight: number;
47
- dayNameFontColor: string;
48
- };
49
- argTypes: {
50
- arrowColor: {
51
- name: string;
52
- description: string;
53
- table: {
54
- category: string;
55
- subcategory: string;
56
- };
57
- control: {
58
- type: string;
59
- };
60
- };
61
- arrowHoverColor: {
62
- name: string;
63
- description: string;
64
- table: {
65
- category: string;
66
- subcategory: string;
67
- };
68
- control: {
69
- type: string;
70
- };
71
- };
72
- showPopperArrow: {
73
- name: string;
74
- description: string;
75
- table: {
76
- category: string;
77
- };
78
- control: {
79
- type: string;
80
- };
81
- };
82
- cellColor: {
83
- name: string;
84
- description: string;
85
- table: {
86
- category: string;
87
- subcategory: string;
88
- };
89
- control: {
90
- type: string;
91
- };
92
- };
93
- cellFontColor: {
94
- name: string;
95
- description: string;
96
- table: {
97
- category: string;
98
- subcategory: string;
99
- };
100
- control: {
101
- type: string;
102
- };
103
- };
104
- cellActiveColor: {
105
- name: string;
106
- description: string;
107
- table: {
108
- category: string;
109
- subcategory: string;
110
- };
111
- control: {
112
- type: string;
113
- };
114
- };
115
- cellActiveFontColor: {
116
- name: string;
117
- description: string;
118
- table: {
119
- category: string;
120
- subcategory: string;
121
- };
122
- control: {
123
- type: string;
124
- };
125
- };
126
- cellHoverColor: {
127
- name: string;
128
- description: string;
129
- table: {
130
- category: string;
131
- subcategory: string;
132
- };
133
- control: {
134
- type: string;
135
- };
136
- };
137
- cellHoverFontColor: {
138
- name: string;
139
- description: string;
140
- table: {
141
- category: string;
142
- subcategory: string;
143
- };
144
- control: {
145
- type: string;
146
- };
147
- };
148
- currentMonthPadding: {
149
- name: string;
150
- description: string;
151
- table: {
152
- category: string;
153
- };
154
- control: {
155
- type: string;
156
- };
157
- };
158
- currentMonthFontFamily: {
159
- name: string;
160
- description: string;
161
- table: {
162
- category: string;
163
- };
164
- control: {
165
- type: string;
166
- };
167
- };
168
- currentMonthFontStyle: {
169
- name: string;
170
- description: string;
171
- table: {
172
- category: string;
173
- };
174
- control: {
175
- type: string;
176
- };
177
- };
178
- currentMonthFontWeight: {
179
- name: string;
180
- description: string;
181
- table: {
182
- category: string;
183
- };
184
- control: {
185
- type: string;
186
- };
187
- };
188
- currentMonthFontSize: {
189
- name: string;
190
- description: string;
191
- table: {
192
- category: string;
193
- };
194
- control: {
195
- type: string;
196
- };
197
- };
198
- currentMonthFontColor: {
199
- name: string;
200
- description: string;
201
- table: {
202
- category: string;
203
- subcategory: string;
204
- };
205
- control: {
206
- type: string;
207
- };
208
- };
209
- dayNameFontFamily: {
210
- name: string;
211
- description: string;
212
- table: {
213
- category: string;
214
- };
215
- control: {
216
- type: string;
217
- };
218
- };
219
- dayNameFontStyle: {
220
- name: string;
221
- description: string;
222
- table: {
223
- category: string;
224
- };
225
- control: {
226
- type: string;
227
- };
228
- };
229
- dayNameFontColor: {
230
- name: string;
231
- description: string;
232
- table: {
233
- category: string;
234
- subcategory: string;
235
- };
236
- control: {
237
- type: string;
238
- };
239
- };
240
- dayNameFontWeight: {
241
- name: string;
242
- description: string;
243
- table: {
244
- category: string;
245
- };
246
- control: {
247
- type: string;
248
- };
249
- };
250
- cellMargin: {
251
- name: string;
252
- description: string;
253
- table: {
254
- category: string;
255
- };
256
- control: {
257
- type: string;
258
- };
259
- };
260
- cellPadding: {
261
- name: string;
262
- description: string;
263
- table: {
264
- category: string;
265
- };
266
- control: {
267
- type: string;
268
- };
269
- };
270
- cellBorderRadius: {
271
- name: string;
272
- description: string;
273
- table: {
274
- category: string;
275
- };
276
- control: {
277
- type: string;
278
- };
279
- };
280
- cellInRangeBorderRadius: {
281
- name: string;
282
- description: string;
283
- table: {
284
- category: string;
285
- };
286
- control: {
287
- type: string;
288
- };
289
- };
290
- cellInRangeColor: {
291
- name: string;
292
- description: string;
293
- table: {
294
- category: string;
295
- subcategory: string;
296
- };
297
- control: {
298
- type: string;
299
- };
300
- };
301
- cellInRangeFontColor: {
302
- name: string;
303
- description: string;
304
- table: {
305
- category: string;
306
- subcategory: string;
307
- };
308
- control: {
309
- type: string;
310
- };
311
- };
312
- cellInRangeHoverColor: {
313
- name: string;
314
- description: string;
315
- table: {
316
- category: string;
317
- subcategory: string;
318
- };
319
- control: {
320
- type: string;
321
- };
322
- };
323
- cellInRangeHoverFontColor: {
324
- name: string;
325
- description: string;
326
- table: {
327
- category: string;
328
- subcategory: string;
329
- };
330
- control: {
331
- type: string;
332
- };
333
- };
334
- headerBackgroundColor: {
335
- name: string;
336
- description: string;
337
- table: {
338
- category: string;
339
- subcategory: string;
340
- };
341
- control: {
342
- type: string;
343
- };
344
- };
345
- inputBorderColor: {
346
- name: string;
347
- description: string;
348
- table: {
349
- category: string;
350
- subcategory: string;
351
- };
352
- control: {
353
- type: string;
354
- };
355
- };
356
- inputActiveBorderColor: {
357
- name: string;
358
- description: string;
359
- table: {
360
- category: string;
361
- subcategory: string;
362
- };
363
- control: {
364
- type: string;
365
- };
366
- };
367
- inputBorderWidth: {
368
- name: string;
369
- description: string;
370
- table: {
371
- category: string;
372
- };
373
- control: {
374
- type: string;
375
- };
376
- };
377
- inputBorderRadius: {
378
- name: string;
379
- description: string;
380
- table: {
381
- category: string;
382
- };
383
- control: {
384
- type: string;
385
- };
386
- };
387
- inputPadding: {
388
- name: string;
389
- description: string;
390
- table: {
391
- category: string;
392
- };
393
- control: {
394
- type: string;
395
- };
396
- };
397
- dividerPosition: {
398
- name: string;
399
- description: string;
400
- table: {
401
- category: string;
402
- };
403
- control: {
404
- type: string;
405
- options: string[];
406
- };
407
- };
408
- dividerWidth: {
409
- name: string;
410
- description: string;
411
- table: {
412
- category: string;
413
- };
414
- control: {
415
- type: string;
416
- };
417
- };
418
- dividerColor: {
419
- name: string;
420
- description: string;
421
- table: {
422
- category: string;
423
- subcategory: string;
424
- };
425
- control: {
426
- type: string;
427
- };
428
- };
429
- fontFamily: {
430
- name: string;
431
- description: string;
432
- table: {
433
- category: string;
434
- };
435
- control: {
436
- type: string;
437
- };
438
- };
439
- fontWeight: {
440
- name: string;
441
- description: string;
442
- table: {
443
- category: string;
444
- };
445
- control: {
446
- type: string;
447
- options: string[];
448
- };
449
- };
450
- fontStyle: {
451
- name: string;
452
- description: string;
453
- table: {
454
- category: string;
455
- };
456
- control: {
457
- type: string;
458
- options: string[];
459
- };
460
- };
461
- };
462
- };
1
+ import { Meta } from '@storybook/react';
2
+ import { StoryObj } from '@storybook/react';
3
+ import { AppearanceStyles } from './utils/index.js';
4
+ import { ShapeStyles } from './utils/index.js';
5
+ interface DatepickerStoryProps extends AppearanceStyles, ShapeStyles {
6
+ showPopperArrow: boolean;
7
+ }
8
+ declare const meta: Meta<DatepickerStoryProps>;
9
+ export default meta;
10
+ export declare const Base: StoryObj<DatepickerStoryProps>;
11
+ //# sourceMappingURL=datepicker.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datepicker.stories.d.ts","sourceRoot":"","sources":["../src/datepicker.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAkB,kBAAkB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAc,kBAAkB,CAAA;AASnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAW,kBAAkB,CAAA;AAEnD,UAAU,oBAAqB,SAAQ,gBAAgB,EAAE,WAAW;IAClE,eAAe,EAAE,OAAO,CAAA;CACzB;AAED,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,oBAAoB,CA2cpC,CAAA;AAED,eAAe,IAAI,CAAA;AAEnB,eAAO,MAAM,IAAI,EAAE,QAAQ,CAAC,oBAAoB,CA2C/C,CAAA"}