@vialiq/flux-ui 0.15.0 → 0.17.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.
@@ -0,0 +1,382 @@
1
+ @use './variables' as tokens;
2
+ @use './flatpickr-core';
3
+
4
+ /**
5
+ * Global Flatpickr Theme overrides using flux-ui tokens.
6
+ * This styles both popup calendars (appended to body) and inline calendars
7
+ * (when injected into the Light DOM of vi-date-picker).
8
+ */
9
+
10
+ .flatpickr-calendar {
11
+ background: var(--vi-date-picker-calendar-bg, tokens.$layer-01);
12
+ box-shadow: var(--vi-date-picker-calendar-shadow, tokens.$shadow-lg);
13
+ border-radius: var(--vi-border-radius-lg, tokens.$border-radius-lg);
14
+ border: 1px solid var(--vi-border-03, tokens.$border-03);
15
+ font-family: var(--vi-font-family-base, tokens.$font-family-base);
16
+ color: var(--vi-text-primary, tokens.$text-primary);
17
+ padding: var(--vi-spacing-xs, tokens.$spacing-xs) 0;
18
+ width: max-content;
19
+
20
+ &.arrowTop:before { border-bottom-color: var(--vi-border-03, tokens.$border-03); }
21
+ &.arrowTop:after { border-bottom-color: var(--vi-date-picker-calendar-bg, tokens.$layer-01); }
22
+ &.arrowBottom:before { border-top-color: var(--vi-border-03, tokens.$border-03); }
23
+ &.arrowBottom:after { border-top-color: var(--vi-date-picker-calendar-bg, tokens.$layer-01); }
24
+
25
+ .flatpickr-innerContainer {
26
+ justify-content: center;
27
+ }
28
+ }
29
+
30
+ .flatpickr-months {
31
+ .flatpickr-month {
32
+ color: var(--vi-text-primary, tokens.$text-primary);
33
+ fill: var(--vi-text-primary, tokens.$text-primary);
34
+ }
35
+
36
+ .flatpickr-prev-month,
37
+ .flatpickr-next-month {
38
+ color: var(--vi-text-secondary, tokens.$text-secondary);
39
+ fill: var(--vi-text-secondary, tokens.$text-secondary);
40
+ padding: var(--vi-spacing-xs, tokens.$spacing-xs);
41
+ border-radius: var(--vi-border-radius-md, tokens.$border-radius-md);
42
+ transition: background-color 0.2s ease;
43
+
44
+ &:hover {
45
+ background-color: var(--vi-layer-hover-02, tokens.$layer-hover-02);
46
+ color: var(--vi-text-primary, tokens.$text-primary);
47
+ fill: var(--vi-text-primary, tokens.$text-primary);
48
+ }
49
+ }
50
+ }
51
+
52
+ .flatpickr-current-month {
53
+ font-size: var(--vi-font-size-base, tokens.$font-size-base);
54
+ font-weight: var(--vi-font-weight-semibold, tokens.$font-weight-semibold);
55
+ color: inherit;
56
+
57
+ .flatpickr-monthDropdown-months {
58
+ background: var(--vi-date-picker-calendar-bg, tokens.$layer-01);
59
+ border-radius: var(--vi-border-radius-md, tokens.$border-radius-md);
60
+ padding: 4px;
61
+
62
+ &:hover {
63
+ background-color: var(--vi-layer-hover-02, tokens.$layer-hover-02);
64
+ }
65
+ }
66
+
67
+ input.cur-year {
68
+ font-weight: inherit;
69
+ color: inherit;
70
+
71
+ &:hover {
72
+ background-color: var(--vi-layer-hover-02, tokens.$layer-hover-02);
73
+ }
74
+ }
75
+ }
76
+
77
+ .flatpickr-weekdays {
78
+ .flatpickr-weekdaycontainer {
79
+ display: grid;
80
+ grid-template-columns: repeat(7, var(--vi-date-picker-day-size, 32px));
81
+ justify-items: center;
82
+ width: max-content;
83
+ }
84
+ .flatpickr-weekday {
85
+ color: var(--vi-text-secondary, tokens.$text-secondary);
86
+ font-size: var(--vi-font-size-xs, tokens.$font-size-xs);
87
+ font-weight: var(--vi-font-weight-medium, tokens.$font-weight-medium);
88
+ }
89
+ }
90
+
91
+ .flatpickr-days {
92
+ width: auto;
93
+ }
94
+
95
+ .dayContainer {
96
+ display: grid;
97
+ grid-template-columns: repeat(7, var(--vi-date-picker-day-size, 32px));
98
+ justify-items: center;
99
+ width: max-content;
100
+ min-width: auto;
101
+ max-width: none;
102
+ }
103
+
104
+ .flatpickr-day {
105
+ color: var(--vi-text-primary, tokens.$text-primary);
106
+ border-radius: var(--vi-border-radius-full, tokens.$border-radius-full);
107
+ margin: 0;
108
+ width: var(--vi-date-picker-day-size, 32px);
109
+ max-width: var(--vi-date-picker-day-size, 32px);
110
+ height: var(--vi-date-picker-day-size, 32px);
111
+ line-height: var(--vi-date-picker-day-size, 32px);
112
+ display: flex;
113
+ align-items: center;
114
+ justify-content: center;
115
+ transition: all 0.2s ease;
116
+
117
+ &:hover,
118
+ &:focus {
119
+ background: var(--vi-date-picker-day-hover-bg, tokens.$layer-hover-01);
120
+ border-color: var(--vi-date-picker-day-hover-bg, tokens.$layer-hover-01);
121
+ }
122
+
123
+ &.today {
124
+ border-color: var(--vi-date-picker-day-today-border, tokens.$color-primary);
125
+
126
+ &:hover,
127
+ &:focus {
128
+ border-color: var(--vi-date-picker-day-today-border, tokens.$color-primary);
129
+ background: var(--vi-date-picker-day-hover-bg, tokens.$layer-hover-01);
130
+ }
131
+ }
132
+
133
+ &.selected,
134
+ &.startRange,
135
+ &.endRange,
136
+ &.selected.inRange,
137
+ &.startRange.inRange,
138
+ &.endRange.inRange,
139
+ &.selected:focus,
140
+ &.startRange:focus,
141
+ &.endRange:focus,
142
+ &.selected:hover,
143
+ &.startRange:hover,
144
+ &.endRange:hover,
145
+ &.selected.prevMonthDay,
146
+ &.startRange.prevMonthDay,
147
+ &.endRange.prevMonthDay,
148
+ &.selected.nextMonthDay,
149
+ &.startRange.nextMonthDay,
150
+ &.endRange.nextMonthDay {
151
+ background: var(--vi-date-picker-day-selected-bg, tokens.$color-primary);
152
+ border-color: var(--vi-date-picker-day-selected-bg, tokens.$color-primary);
153
+ color: var(--vi-date-picker-day-selected-color, tokens.$text-primary-inverse);
154
+ }
155
+
156
+ &.inRange,
157
+ &.prevMonthDay.inRange,
158
+ &.nextMonthDay.inRange,
159
+ &.today.inRange,
160
+ &.prevMonthDay.today.inRange,
161
+ &.nextMonthDay.today.inRange,
162
+ &:hover.inRange,
163
+ &.prevMonthDay:hover.inRange,
164
+ &.nextMonthDay:hover.inRange {
165
+ background: var(--vi-color-blue-100, tokens.$color-blue-100);
166
+ border-color: var(--vi-color-blue-100, tokens.$color-blue-100);
167
+ border-radius: 0;
168
+ box-shadow: none;
169
+ color: var(--vi-text-primary, tokens.$text-primary);
170
+ }
171
+
172
+ &.flatpickr-disabled,
173
+ &.flatpickr-disabled:hover,
174
+ &.prevMonthDay,
175
+ &.nextMonthDay,
176
+ &.notAllowed,
177
+ &.notAllowed.prevMonthDay,
178
+ &.notAllowed.nextMonthDay {
179
+ color: var(--vi-text-disabled, tokens.$text-disabled);
180
+ background: transparent;
181
+ border-color: transparent;
182
+ }
183
+
184
+ &.flatpickr-disabled,
185
+ &.flatpickr-disabled:hover {
186
+ cursor: not-allowed;
187
+ }
188
+ }
189
+
190
+ // ----------------------------------------------------------------------------
191
+ // Custom vi-month-year-plugin Styles
192
+ // ----------------------------------------------------------------------------
193
+
194
+ .vi-calendar-header {
195
+ display: flex;
196
+ justify-content: space-between;
197
+ align-items: center;
198
+ padding: 4px var(--vi-spacing-xs, tokens.$spacing-xs);
199
+ border-bottom: 1px solid var(--vi-border-02, tokens.$border-02);
200
+ margin-bottom: var(--vi-spacing-xs, tokens.$spacing-xs);
201
+ }
202
+
203
+ .vi-calendar-selectors {
204
+ display: flex;
205
+ gap: var(--vi-spacing-xs, tokens.$spacing-xs);
206
+ align-items: center;
207
+ }
208
+
209
+ .vi-calendar-month-toggle {
210
+ background: transparent;
211
+ border: 1px solid transparent;
212
+ border-radius: var(--vi-border-radius-md, tokens.$border-radius-md);
213
+ padding: 4px 8px;
214
+ font-family: var(--vi-font-family-base, tokens.$font-family-base);
215
+ font-weight: var(--vi-font-weight-semibold, tokens.$font-weight-semibold);
216
+ font-size: var(--vi-font-size-base, tokens.$font-size-base);
217
+ color: var(--vi-text-primary, tokens.$text-primary);
218
+ cursor: pointer;
219
+ transition: all 0.2s ease;
220
+
221
+ &:hover {
222
+ background: var(--vi-layer-hover-02, tokens.$layer-hover-02);
223
+ }
224
+
225
+ &:focus-visible {
226
+ outline: none;
227
+ background: var(--vi-layer-hover-02, tokens.$layer-hover-02);
228
+ box-shadow: 0 0 0 2px var(--vi-focus, tokens.$focus);
229
+ }
230
+ }
231
+
232
+ .vi-calendar-year-select {
233
+ /* Using standard CSS since it renders in Light DOM, allowing it to look okay even if vi-select isn't loaded */
234
+ min-width: 76px;
235
+ --vi-select-spacing-padding-inline: 4px;
236
+ --vi-select-option-padding-inline: 8px;
237
+ --vi-select-sizing-min-height: 32px;
238
+ }
239
+
240
+ .vi-calendar-nav {
241
+ display: flex;
242
+ gap: 2px;
243
+ }
244
+
245
+ .vi-calendar-nav-btn {
246
+ background: transparent;
247
+ border: none;
248
+ border-radius: var(--vi-border-radius-md, tokens.$border-radius-md);
249
+ width: 28px;
250
+ height: 28px;
251
+ display: inline-flex;
252
+ align-items: center;
253
+ justify-content: center;
254
+ color: var(--vi-text-secondary, tokens.$text-secondary);
255
+ cursor: pointer;
256
+ transition: all 0.2s ease;
257
+
258
+ &:hover {
259
+ background: var(--vi-layer-hover-02, tokens.$layer-hover-02);
260
+ color: var(--vi-text-primary, tokens.$text-primary);
261
+ }
262
+ }
263
+
264
+ .vi-calendar-month-grid {
265
+ position: absolute;
266
+ top: 50px; /* Below the header */
267
+ left: 0;
268
+ right: 0;
269
+ bottom: 0;
270
+ background: var(--vi-date-picker-calendar-bg, tokens.$layer-01);
271
+ z-index: 10;
272
+ display: grid;
273
+ grid-template-columns: repeat(3, 1fr);
274
+ grid-auto-rows: min-content;
275
+ gap: 4px;
276
+ padding: var(--vi-spacing-xs, tokens.$spacing-xs);
277
+ border-radius: 0 0 var(--vi-border-radius-lg, tokens.$border-radius-lg) var(--vi-border-radius-lg, tokens.$border-radius-lg);
278
+
279
+ /* When Days grid is hidden (Month Mode), we don't need position absolute over it */
280
+ .vi-month-mode & {
281
+ position: relative;
282
+ top: 0;
283
+ margin-top: var(--vi-spacing-xs, tokens.$spacing-xs);
284
+ }
285
+ }
286
+
287
+ .vi-calendar-month-btn {
288
+ background: transparent;
289
+ border: 1px solid transparent;
290
+ border-radius: var(--vi-border-radius-full, tokens.$border-radius-full);
291
+ padding: var(--vi-spacing-xs, tokens.$spacing-xs) 0;
292
+ font-family: var(--vi-font-family-base, tokens.$font-family-base);
293
+ font-size: var(--vi-font-size-sm, tokens.$font-size-sm);
294
+ color: var(--vi-text-primary, tokens.$text-primary);
295
+ cursor: pointer;
296
+ transition: all 0.2s ease;
297
+
298
+ &:hover {
299
+ background: var(--vi-layer-hover-01, tokens.$layer-hover-01);
300
+ }
301
+
302
+ &.active {
303
+ background: var(--vi-date-picker-day-selected-bg, tokens.$color-primary);
304
+ color: var(--vi-text-primary-inverse, tokens.$text-primary-inverse);
305
+ }
306
+ }
307
+
308
+ // ----------------------------------------------------------------------------
309
+ // Week Mode Styles
310
+ // ----------------------------------------------------------------------------
311
+
312
+ .flatpickr-day {
313
+ // When hovering over a week, it adds .inRange to all 7 days
314
+ &.inRange,
315
+ &.inRange:hover {
316
+ // Add pill-like rounded corners to the start and end of the week row
317
+ &:nth-child(7n + 1) {
318
+ border-top-left-radius: var(--vi-border-radius-full, tokens.$border-radius-full);
319
+ border-bottom-left-radius: var(--vi-border-radius-full, tokens.$border-radius-full);
320
+ }
321
+ &:nth-child(7n) {
322
+ border-top-right-radius: var(--vi-border-radius-full, tokens.$border-radius-full);
323
+ border-bottom-right-radius: var(--vi-border-radius-full, tokens.$border-radius-full);
324
+ }
325
+ }
326
+
327
+ // When a week is selected, it adds .week.selected to all 7 days
328
+ &.week.selected {
329
+ // Middle days look like .inRange (light blue, no radius)
330
+ background: var(--vi-color-blue-100, tokens.$color-blue-100);
331
+ border-color: var(--vi-color-blue-100, tokens.$color-blue-100);
332
+ color: var(--vi-text-primary, tokens.$text-primary);
333
+ border-radius: 0;
334
+ box-shadow: none;
335
+
336
+ // First day looks like .startRange (dark blue, left rounded)
337
+ &:nth-child(7n + 1) {
338
+ background: var(--vi-date-picker-day-selected-bg, tokens.$color-primary);
339
+ border-color: var(--vi-date-picker-day-selected-bg, tokens.$color-primary);
340
+ color: var(--vi-date-picker-day-selected-color, tokens.$text-primary-inverse);
341
+ border-top-left-radius: var(--vi-border-radius-full, tokens.$border-radius-full);
342
+ border-bottom-left-radius: var(--vi-border-radius-full, tokens.$border-radius-full);
343
+ }
344
+
345
+ // Last day looks like .endRange (dark blue, right rounded)
346
+ &:nth-child(7n) {
347
+ background: var(--vi-date-picker-day-selected-bg, tokens.$color-primary);
348
+ border-color: var(--vi-date-picker-day-selected-bg, tokens.$color-primary);
349
+ color: var(--vi-date-picker-day-selected-color, tokens.$text-primary-inverse);
350
+ border-top-right-radius: var(--vi-border-radius-full, tokens.$border-radius-full);
351
+ border-bottom-right-radius: var(--vi-border-radius-full, tokens.$border-radius-full);
352
+ }
353
+ }
354
+ }
355
+
356
+ // ----------------------------------------------------------------------------
357
+ // Date Mode - Today Button Styles
358
+ // ----------------------------------------------------------------------------
359
+
360
+ .vi-calendar-footer {
361
+ padding: 4px var(--vi-spacing-xs, tokens.$spacing-xs);
362
+ border-top: 1px solid var(--vi-border-02, tokens.$border-02);
363
+ display: flex;
364
+ justify-content: flex-end;
365
+ }
366
+
367
+ .vi-calendar-today-btn {
368
+ background: transparent;
369
+ border: none;
370
+ color: var(--vi-color-primary, tokens.$color-primary);
371
+ font-family: var(--vi-font-family-base, tokens.$font-family-base);
372
+ font-weight: var(--vi-font-weight-medium, tokens.$font-weight-medium);
373
+ font-size: var(--vi-font-size-sm, tokens.$font-size-sm);
374
+ cursor: pointer;
375
+ padding: var(--vi-spacing-xs, tokens.$spacing-xs) var(--vi-spacing-sm, tokens.$spacing-sm);
376
+ border-radius: var(--vi-border-radius-md, tokens.$border-radius-md);
377
+ transition: background-color 0.2s ease;
378
+
379
+ &:hover {
380
+ background: var(--vi-layer-hover-01, tokens.$layer-hover-01);
381
+ }
382
+ }
@@ -6,3 +6,4 @@
6
6
  @forward 'layout';
7
7
  @forward 'utilities';
8
8
  @forward 'typography';
9
+ @forward 'flatpickr';
@@ -114,6 +114,12 @@ $color-warning: var(--vi-color-warning, #ffba00); // yellow-500
114
114
  $color-error: var(--vi-color-error, #ef4444); // red-500
115
115
  $color-info: var(--vi-color-info, #3676d0); // blue-700
116
116
 
117
+ // -- Typeahead / search highlight tokens -------------------------------------
118
+ // Used for <mark class="highlight"> inside vi-select-option and vi-combobox-item.
119
+ // Fallbacks use direct hex so nested var() resolution issues in shadow DOM are avoided.
120
+ $typeahead-highlight-bg: var(--vi-typeahead-highlight-bg, #ebf5ff); // blue-100
121
+ $typeahead-highlight-color: var(--vi-typeahead-highlight-color, #3676d0); // primary / blue-700
122
+
117
123
  // -- Functional colors -------------------------------------------------------
118
124
 
119
125
  $color-background: var(--vi-color-background, #ffffff);
@@ -230,6 +236,7 @@ $border-radius-sm: var(--vi-border-radius-sm, 2px);
230
236
  $border-radius-md: var(--vi-border-radius-md, 4px);
231
237
  $border-radius-lg: var(--vi-border-radius-lg, 8px);
232
238
  $border-radius-xl: var(--vi-border-radius-xl, 12px);
239
+ $border-radius-full: var(--vi-border-radius-full, 9999px);
233
240
 
234
241
  // -- Primitive: Border widths ------------------------------------------------
235
242