@symbo.ls/datepicker 2.11.43 → 2.11.49

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 (2) hide show
  1. package/index.js +53 -93
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -15,7 +15,7 @@ export const DatePickerYears = {
15
15
  position: 'absolute',
16
16
  top: '0',
17
17
  left: '0',
18
- background: 'linear-gradient(to bottom, rgba(20, 20, 22, 1) 0%, rgba(20, 20, 22, 0) 100%)',
18
+ background: 'linear-gradient(to bottom, var(--theme-tertiary-dark-background) 0%, transparent 100%)',
19
19
  zIndex: '10'
20
20
  },
21
21
  ':after': {
@@ -24,7 +24,7 @@ export const DatePickerYears = {
24
24
  position: 'absolute',
25
25
  bottom: '0',
26
26
  left: '0',
27
- background: 'linear-gradient(to top, rgba(20, 20, 22, 1) 0%, rgba(20, 20, 22, 0) 100%)'
27
+ background: 'linear-gradient(to top, var(--theme-tertiary-dark-background) 0%, transparent 100%)'
28
28
  }
29
29
  },
30
30
 
@@ -95,7 +95,7 @@ export const DatePickerYears = {
95
95
  }
96
96
  }
97
97
 
98
- const months = {
98
+ export const DatePickerMonthsSlider = {
99
99
  extend: Flex,
100
100
  props: {
101
101
  position: 'relative',
@@ -108,7 +108,7 @@ const months = {
108
108
  content: '""',
109
109
  position: 'absolute',
110
110
  boxSize: '100% 100px',
111
- background: 'linear-gradient(to right, rgba(20, 20, 22, 1) 0%, rgba(20, 20, 22, 0) 100%)',
111
+ background: 'linear-gradient(to right, var(--theme-tertiary-dark-background) 0%, transparent 100%)',
112
112
  left: '0',
113
113
  top: '0',
114
114
  zIndex: '30',
@@ -118,7 +118,7 @@ const months = {
118
118
  content: '""',
119
119
  position: 'absolute',
120
120
  boxSize: '100% 100px',
121
- background: 'linear-gradient(to left, rgba(20, 20, 22, 1) 0%, rgba(20, 20, 22, 0) 100%)',
121
+ background: 'linear-gradient(to left, var(--theme-tertiary-dark-background) 0%, transparent 100%)',
122
122
  right: '0',
123
123
  top: '0',
124
124
  zIndex: '30',
@@ -195,11 +195,24 @@ const months = {
195
195
  rightButton: { extend: Button, props: { icon: 'arrowRight' } }
196
196
  }
197
197
 
198
- const weekDays = {
198
+ export const DatePickerWeekDays = {
199
199
  extend: Grid,
200
+ props: {
201
+ overflow: 'hidden',
202
+ padding: '- Z Z',
203
+ width: '100%',
204
+ columns: 'repeat(7, 1fr)',
205
+ gap: 'W2'
206
+ },
200
207
  childExtend: {
201
208
  tag: 'span',
202
- extend: Flex
209
+ extend: Flex,
210
+ props: {
211
+ fontSize: 'Y1',
212
+ textTransform: 'capitalize',
213
+ align: 'center center',
214
+ ':nth-child(7n-1), &:nth-child(7n)': { opacity: '.5' },
215
+ }
203
216
  },
204
217
  ...[
205
218
  { text: 'Mo' },
@@ -212,28 +225,31 @@ const weekDays = {
212
225
  ]
213
226
  }
214
227
 
215
- const monthNumbers = {
228
+ export const DatePickerGrid = {
216
229
  extend: Grid,
217
230
  props: {
218
- columns: 'repeat(7, 32px)',
219
- gap: '4px',
220
- boxSizing: 'content-box',
221
- padding: `- ${12 / 16}em`
231
+ columns: 'repeat(7, 1fr)',
232
+ minWidth: '100%',
233
+ gap: 'W2',
234
+ padding: `- Z`
222
235
  },
223
236
  childExtend: {
224
237
  extend: Button,
225
238
  props: ({ state, key }) => ({
226
- color: 'white',
239
+ isActive: state.activeDay === parseInt(key) + 1,
227
240
  textAlign: 'center',
228
- background: 'transparent',
229
241
  fontSize: 'Z1',
230
242
  round: '100%',
231
- height: '32px',
232
- ':hover': { theme: 'secondary' },
233
- ':nth-child(7n-1)': { color: 'rgba(255, 255, 255, .5)' },
234
- ':nth-child(7n)': { color: 'rgba(255, 255, 255, .5)' },
235
- isActive: state.activeDay === parseInt(key) + 1,
236
- '.isActive': { theme: 'secondary' }
243
+ height: 'B1',
244
+ aspectRatio: '1/1',
245
+ lineHeight: '.9',
246
+ background: 'transparent',
247
+ theme: 'secondary @dark .color',
248
+ '.isActive': { theme: 'primary' },
249
+ '!isActive': {
250
+ ':hover': { theme: 'secondary' },
251
+ ':nth-child(7n-1), &:nth-child(7n)': { opacity: '.5' },
252
+ },
237
253
  }),
238
254
  on: {
239
255
  click: (event, element, state) => {
@@ -242,7 +258,7 @@ const monthNumbers = {
242
258
  }
243
259
  }
244
260
  },
245
- $setCollection: (el, s) => {
261
+ $setPropsCollection: (el, s) => {
246
262
  const daysInMonth = new Date(s.activeYear, s.activeMonth, 0).getDate()
247
263
  const days = (new Array(daysInMonth)).fill(undefined)
248
264
  .map((v, k) => ({ text: k + 1 }))
@@ -250,23 +266,6 @@ const monthNumbers = {
250
266
  }
251
267
  }
252
268
 
253
- const confirmButtons = {
254
- extend: Flex,
255
- childExtend: Button,
256
- ...[
257
- {
258
- text: 'cancel',
259
- on: {
260
- click: (event, element, state) => {
261
- }
262
- }
263
- },
264
- {
265
- text: 'ok'
266
- }
267
- ]
268
- }
269
-
270
269
  const monthNumbersContainer = {
271
270
  props: {
272
271
  maxWidth: `${272 / 16}em`,
@@ -275,7 +274,7 @@ const monthNumbersContainer = {
275
274
  content: '""',
276
275
  position: 'absolute',
277
276
  boxSize: '100% 12px',
278
- background: 'linear-gradient(to right, rgba(20, 20, 22, 1) 0%, rgba(20, 20, 22, 0) 100%)',
277
+ background: 'linear-gradient(to right, var(--theme-tertiary-dark-background) 0%, transparent 100%)',
279
278
  left: '0',
280
279
  top: '0',
281
280
  zIndex: '30'
@@ -284,75 +283,36 @@ const monthNumbersContainer = {
284
283
  content: '""',
285
284
  position: 'absolute',
286
285
  boxSize: '100% 12px',
287
- background: 'linear-gradient(to left, rgba(20, 20, 22, 1) 0%, rgba(20, 20, 22, 0) 100%)',
286
+ background: 'linear-gradient(to left, var(--theme-tertiary-dark-background) 0%, transparent 100%)',
288
287
  right: '0',
289
288
  top: '0',
290
289
  zIndex: '30'
291
290
  },
292
291
  content: {
293
- style: { overflowX: 'auto' }
292
+ overflow: 'auto hidden'
294
293
  }
295
294
  },
295
+
296
296
  content: {
297
297
  extend: Flex,
298
- childExtend: monthNumbers,
298
+ childExtend: DatePickerGrid,
299
299
  ...[{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]
300
300
  }
301
301
  }
302
302
 
303
303
  const props = {
304
304
  yearRange: [1993, 2023],
305
+ theme: 'tertiary',
305
306
  round: 'Z2',
306
307
  margin: 'E',
307
308
  overflow: 'hidden',
308
309
  maxHeight: '318px',
309
310
  boxSize: 'fit-content fit-content',
310
- background: '#141416',
311
311
  padding: '- Z - -',
312
312
  style: {
313
313
  button: {
314
314
  padding: '0'
315
315
  }
316
- },
317
-
318
- calendar: {
319
- flow: 'column',
320
- padding: '20px - - -',
321
- position: 'relative',
322
-
323
- weekDaysContainer: {
324
- overflow: 'hidden',
325
- padding: '- - Z1 -',
326
- boxSizing: 'content-box',
327
- maxWidth: `${272 / 16}em`,
328
- childProps: {
329
- maxWidth: 'fit-content',
330
- columns: 'repeat(7, 32px)',
331
- gap: '4px',
332
- boxSizing: 'content-box',
333
- padding: `- ${12 / 16}em`,
334
- childProps: {
335
- fontSize: 'Y1',
336
- textTransform: 'capitalize',
337
- ':nth-child(7n-1)': { color: 'rgba(255, 255, 255, .5)' },
338
- ':nth-child(7n)': { color: 'rgba(255, 255, 255, .5)' },
339
- align: 'center center'
340
- }
341
- }
342
- },
343
-
344
- confirmButtons: {
345
- align: 'center flex-end',
346
- gap: 'A1',
347
- padding: 'A A1 - -',
348
- childProps: {
349
- color: '#0079FD',
350
- fontSize: 'Y',
351
- textTransform: 'uppercase',
352
- background: 'transparent'
353
- }
354
- }
355
-
356
316
  }
357
317
  }
358
318
 
@@ -368,20 +328,20 @@ export const DatePicker = {
368
328
 
369
329
  DatePickerYears: {},
370
330
 
371
- calendar: {
372
- extend: Flex,
373
-
374
- months,
375
-
376
- weekDaysContainer: {
377
- extend: Flex,
378
- childExtend: weekDays,
379
- ...[{}, {}]
331
+ Flex: {
332
+ props: {
333
+ flow: 'column',
334
+ padding: '20px - - -',
335
+ position: 'relative',
380
336
  },
337
+
338
+ DatePickerMonthsSlider: {},
339
+
340
+ DatePickerWeekDays: {},
381
341
 
382
342
  monthNumbersContainer,
383
343
 
384
- confirmButtons
344
+ DialogFooter: {}
385
345
  }
386
346
  }
387
347
 
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/datepicker",
3
- "version": "2.11.43",
3
+ "version": "2.11.49",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "9fc7b25250ed06e3c759f7539edff7855b31ec21",
6
+ "gitHead": "396ff036bf106d7813a1688d842d7a36d407cf31",
7
7
  "dependencies": {
8
8
  "@symbo.ls/block": "latest",
9
9
  "@symbo.ls/icon": "latest",