-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy path_timepicker.scss
More file actions
165 lines (143 loc) · 3.87 KB
/
_timepicker.scss
File metadata and controls
165 lines (143 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/* Patterns - Interaction - TimePicker */
////
/// @group Patterns-TimePicker
/// Patterns - Interaction - TimePicker
/// Import Flatpickr library styles
@import '../../../../../Providers/OSUI/Timepicker/Flatpickr/scss/_flatpickr.scss';
///
.osui-timepicker {
input {
// Hack used to disable dateTime input pseudoElements (browser native placeholders)
&[type='time'] {
&::-webkit-inner-spin-button,
&::-webkit-calendar-picker-indicator,
&::-webkit-datetime-edit-year-field,
&::-webkit-datetime-edit-month-field,
&::-webkit-datetime-edit-day-field,
&::-webkit-datetime-edit-fields-wrapper {
display: none;
-moz-appearance: none;
}
}
// Disable states for Datepicker
&.flatpickr-input[disabled] + input {
background-color: get-background-color('neutral-2');
border: var(--border-size-s) solid get-border-color('neutral-4');
color: get-text-color('neutral-6');
pointer-events: none;
}
// Hide the platform input which is set as hidden by the library and we're change it into the expected type, however we do not want it visible since library will add a clone to better deal with the selected dates.
// We cannot use the provider class since the provider class will not be taken into consideration on the input widget react lifecycle
&[type='time']:first-of-type {
display: none;
// Make the platform input visible in Service Studio
& {
-servicestudio-display: inline-flex !important;
}
}
}
// Service Studio Preview Container Styles
&__dropdown-ss-preview {
display: none;
-servicestudio-display: none;
// Service Studio Preview
& {
-servicestudio-background-color: var(--color-neutral-0);
-servicestudio-border-radius: var(--border-radius-soft);
-servicestudio-display: flex;
-servicestudio-justify-content: space-evenly;
-servicestudio-line-height: var(--space-xl);
-servicestudio-margin-top: 2px;
-servicestudio-max-width: 320px;
-servicestudio-position: relative;
-servicestudio-text-align: center;
-servicestudio-z-index: var(--layer-local-tier-1);
&.time12h{
padding-right: var(--space-xxl);
&:after{
background-color: var(--color-neutral-7);
border-radius: var(--border-radius-rounded);
color: var(--color-neutral-0);
content:"am";
font-size: var(--font-size-xs);
font-weight: var(--font-semi-bold);
height: var(--space-m);
line-height: var(--space-m);
position: absolute;
right: var(--space-s);
top: 50%;
transform: translateY(-50%);
width: var(--space-xl);
text-transform: uppercase;
}
}
& + .placeholder-ss-preview {
-servicestudio-opacity: 0;
-servicestudio-overflow: hidden;
-servicestudio-width: 100%;
}
}
}
.not-valid + .input,
.not-valid + .flatpickr-mobile {
border-color: get-border-color('error');
}
.flatpickr-mobile ~ span.validation-message {
bottom: -40px;
}
}
///
.form {
// Service Studio Preview
.osui-timepicker__dropdown-ss-preview {
-servicestudio-margin-top: -22px;
}
}
.osui-timepicker__dropdown {
&.hasTime.noCalendar {
.flatpickr-time {
padding: 0;
height: var(--space-xl);
&.time24hr:after {
display: none;
}
.numInputWrapper {
height: var(--space-xl);
flex-grow: 1;
}
.flatpickr-am-pm {
position: relative;
margin-left: var(--space-s);
margin-right: var(--space-s);
}
}
&.dropdown--is-large {
.flatpickr-time {
height: var(--space-xxl);
max-height: var(--space-xxl);
.numInputWrapper {
height: var(--space-xxl);
}
.flatpickr-time-separator {
line-height: var(--space-xxl);
}
}
}
&.dropdown--is-small {
.flatpickr-time {
height: var(--space-l);
max-height: var(--space-l);
.numInputWrapper {
height: var(--space-l);
}
.flatpickr-time-separator {
line-height: var(--space-l);
}
}
}
}
&:before,
&:after {
display: none;
}
}