1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | $css--helpers: true;
|
9 |
|
10 | @import '../../globals/scss/vars';
|
11 | @import '../../globals/scss/helper-mixins';
|
12 | @import '../../globals/scss/typography';
|
13 | @import '../../globals/scss/layout';
|
14 | @import '../../globals/scss/css--helpers';
|
15 | @import '../../globals/scss/vendor/@carbon/elements/scss/import-once/import-once';
|
16 | @import '../select/select';
|
17 | @import '../text-input/text-input';
|
18 |
|
19 | @mixin pagination {
|
20 | .#{$prefix}--data-table-v2-container + .#{$prefix}--pagination {
|
21 | border-top: 0;
|
22 | }
|
23 |
|
24 | .#{$prefix}--pagination {
|
25 | @include reset;
|
26 | @include font-family;
|
27 | width: 100%;
|
28 | background-color: $ui-01;
|
29 | padding: $spacing-xs $spacing-md;
|
30 | display: flex;
|
31 | align-items: center;
|
32 | border: 1px solid $ui-03;
|
33 | height: rem(40px);
|
34 |
|
35 | .#{$prefix}--form-item {
|
36 | flex: auto;
|
37 | }
|
38 | }
|
39 |
|
40 | .#{$prefix}--pagination__left {
|
41 | display: flex;
|
42 | align-items: center;
|
43 | }
|
44 |
|
45 | .#{$prefix}--pagination__right {
|
46 | display: flex;
|
47 | align-items: center;
|
48 | margin-left: auto;
|
49 | }
|
50 |
|
51 | .#{$prefix}--pagination__text {
|
52 | @include typescale('omega');
|
53 | @include type-style('body-short-01');
|
54 | color: $text-01;
|
55 | display: none;
|
56 | padding-right: $spacing-2xs;
|
57 |
|
58 | @include breakpoint('530px') {
|
59 | display: block;
|
60 | }
|
61 | }
|
62 |
|
63 | .#{$prefix}--pagination__button-icon {
|
64 | height: rem(12px);
|
65 | width: rem(12px);
|
66 | fill: $ui-05;
|
67 | pointer-events: none;
|
68 | transition: $transition--base;
|
69 | margin-top: $spacing-3xs;
|
70 | }
|
71 |
|
72 | .#{$prefix}--pagination__button {
|
73 | @include reset;
|
74 | border: none;
|
75 | background: none;
|
76 | cursor: pointer;
|
77 |
|
78 | &:hover {
|
79 | .#{$prefix}--pagination__button-icon {
|
80 | fill: $hover-secondary;
|
81 | }
|
82 | }
|
83 |
|
84 | &:focus {
|
85 | @include focus-outline('border');
|
86 | }
|
87 |
|
88 | &:disabled:hover {
|
89 | cursor: default;
|
90 |
|
91 | .#{$prefix}--pagination__button-icon {
|
92 | fill: $ui-05;
|
93 | }
|
94 | }
|
95 | }
|
96 |
|
97 | .#{$prefix}--pagination__button--backward {
|
98 | margin-left: $spacing-md;
|
99 | margin-right: $spacing-lg;
|
100 | }
|
101 |
|
102 | .#{$prefix}--pagination__button--forward {
|
103 | margin-left: $spacing-lg;
|
104 | }
|
105 |
|
106 | .#{$prefix}--pagination__button--no-index {
|
107 | border-right: 0;
|
108 | margin-right: 1px;
|
109 | }
|
110 |
|
111 | .#{$prefix}--pagination {
|
112 | .#{$prefix}--select {
|
113 | margin-right: $spacing-xs;
|
114 | }
|
115 |
|
116 | .#{$prefix}--select--inline {
|
117 | margin-right: 0;
|
118 | width: auto;
|
119 | display: flex;
|
120 | flex-direction: row;
|
121 | align-items: center;
|
122 | }
|
123 |
|
124 | .#{$prefix}--select-input {
|
125 | height: rem(24px);
|
126 | width: auto;
|
127 | padding: 0 1.25rem 0 0;
|
128 | margin: 0;
|
129 | font-weight: 600;
|
130 | text-align-last: center;
|
131 | box-shadow: none;
|
132 |
|
133 | &:focus {
|
134 | @include focus-outline('border');
|
135 | }
|
136 | }
|
137 |
|
138 | .#{$prefix}--select .#{$prefix}--select-input ~ .#{$prefix}--select__arrow {
|
139 | right: 0.3rem;
|
140 | top: 0.625rem;
|
141 | }
|
142 |
|
143 | .#{$prefix}--text-input {
|
144 | background-color: $field-01;
|
145 | height: rem(24px);
|
146 | min-width: rem(24px);
|
147 | width: rem(24px);
|
148 | padding: 0;
|
149 | margin: 0;
|
150 | font-weight: 600;
|
151 | text-align: center;
|
152 | box-shadow: none;
|
153 | order: 0;
|
154 |
|
155 | &:focus {
|
156 | @include focus-outline('border');
|
157 | }
|
158 | }
|
159 | }
|
160 |
|
161 | .#{$prefix}--pagination--inline {
|
162 | height: 42px;
|
163 | margin-top: -0.5rem;
|
164 | margin-bottom: -0.5rem;
|
165 | margin-right: -1rem;
|
166 |
|
167 | .#{$prefix}--pagination__button {
|
168 | height: rem(40px);
|
169 | border-left: 1px solid $ui-03;
|
170 | border-right: 1px solid $ui-03;
|
171 | margin: 0;
|
172 | }
|
173 |
|
174 | .#{$prefix}--pagination__button--forward {
|
175 | border-right: 0;
|
176 | padding: 0 $spacing-md;
|
177 | margin-left: $spacing-md;
|
178 | }
|
179 |
|
180 | .#{$prefix}--pagination__button--backward {
|
181 | margin: 0 $spacing-md;
|
182 | padding: 0 $spacing-md;
|
183 | }
|
184 |
|
185 | .#{$prefix}--select__arrow {
|
186 | right: 0;
|
187 | top: 0.6rem;
|
188 | }
|
189 | }
|
190 |
|
191 |
|
192 | .#{$prefix}--pagination.#{$prefix}--skeleton .#{$prefix}--skeleton__text {
|
193 | margin-right: 1rem;
|
194 | margin-bottom: 0;
|
195 | }
|
196 | }
|
197 |
|
198 | @mixin pagination--x {
|
199 | .#{$prefix}--data-table-v2-container + .#{$prefix}--pagination {
|
200 | border-top: 0;
|
201 | }
|
202 |
|
203 | .#{$prefix}--pagination {
|
204 | @include reset;
|
205 | @include type-style('body-short-01');
|
206 | width: 100%;
|
207 | background-color: $ui-01;
|
208 | display: flex;
|
209 | align-items: center;
|
210 | justify-content: space-between;
|
211 | border-top: 1px solid $ui-03;
|
212 | height: rem(48px);
|
213 | }
|
214 |
|
215 | .#{$prefix}--pagination .#{$prefix}--select {
|
216 | height: 100%;
|
217 | align-items: center;
|
218 | grid-template-columns: auto 0;
|
219 | }
|
220 |
|
221 | .#{$prefix}--pagination .#{$prefix}--select-input {
|
222 | @include type-style('body-short-01');
|
223 | width: auto;
|
224 | min-width: auto;
|
225 | height: 100%;
|
226 | padding: 0 2.5rem 0 $spacing-md;
|
227 | margin-right: -0.65rem;
|
228 | @include carbon--breakpoint('md') {
|
229 | padding: 0 1.5rem 0 0.5rem;
|
230 | margin-right: 0;
|
231 | }
|
232 | }
|
233 |
|
234 | .#{$prefix}--pagination .#{$prefix}--select-input:hover {
|
235 | background: $hover-ui;
|
236 | }
|
237 |
|
238 | .#{$prefix}--pagination .#{$prefix}--select__arrow {
|
239 | position: relative;
|
240 | top: auto;
|
241 | right: 1.1rem;
|
242 | bottom: auto;
|
243 | }
|
244 |
|
245 | .#{$prefix}--pagination .#{$prefix}--select__item-count .#{$prefix}--select-input {
|
246 | border-right: $spacing-4xs solid $ui-03;
|
247 | @include carbon--breakpoint('md') {
|
248 | padding-right: 2rem;
|
249 | margin-right: -0.65rem;
|
250 | }
|
251 | }
|
252 |
|
253 | .#{$prefix}--pagination .#{$prefix}--select__page-number .#{$prefix}--select-input {
|
254 | border-left: 1px solid $ui-03;
|
255 | @include carbon--breakpoint('md') {
|
256 | padding-left: 1rem;
|
257 | padding-right: 2rem;
|
258 | }
|
259 | }
|
260 |
|
261 | .#{$prefix}--pagination .#{$prefix}--select__page-number .#{$prefix}--select__arrow {
|
262 | @include carbon--breakpoint('md') {
|
263 | right: 1.8rem;
|
264 | }
|
265 | }
|
266 |
|
267 | .#{$prefix}--pagination__left,
|
268 | .#{$prefix}--pagination__right {
|
269 | display: flex;
|
270 | height: 100%;
|
271 | align-items: center;
|
272 | }
|
273 |
|
274 | .#{$prefix}--pagination__left > .#{$prefix}--form-item,
|
275 | .#{$prefix}--pagination__right > .#{$prefix}--form-item {
|
276 | height: 100%;
|
277 | }
|
278 |
|
279 | .#{$prefix}--pagination__left .#{$prefix}--pagination__text {
|
280 | margin-right: rem(1px);
|
281 | }
|
282 |
|
283 | .#{$prefix}--pagination__right .#{$prefix}--pagination__text {
|
284 | margin-right: 1rem;
|
285 | margin-left: rem(1px);
|
286 | }
|
287 |
|
288 | .#{$prefix}--pagination__left {
|
289 | @include carbon--breakpoint('md') {
|
290 | padding: 0 $carbon--spacing-05;
|
291 | }
|
292 | }
|
293 |
|
294 | .#{$prefix}--pagination__text {
|
295 | display: none;
|
296 |
|
297 | @include carbon--breakpoint('md') {
|
298 | display: inline-block;
|
299 | }
|
300 | }
|
301 |
|
302 | span.#{$prefix}--pagination__text {
|
303 | margin-left: $carbon--spacing-05;
|
304 | color: $text-01;
|
305 | }
|
306 |
|
307 | .#{$prefix}--pagination__right span.#{$prefix}--pagination__text {
|
308 | margin-left: -0.5rem;
|
309 | }
|
310 |
|
311 | .#{$prefix}--pagination__button {
|
312 | @include reset;
|
313 | border: none;
|
314 | background: none;
|
315 | cursor: pointer;
|
316 | height: 100%;
|
317 | margin: 0;
|
318 | padding: 0 rem(14px);
|
319 | border-left: 1px solid $ui-03;
|
320 | display: flex;
|
321 | justify-content: center;
|
322 | align-items: center;
|
323 | fill: $ui-05;
|
324 | transition: outline $duration--fast-02 motion(standard, productive);
|
325 | transition: background-color $duration--fast-02 motion(standard, productive);
|
326 | }
|
327 |
|
328 | .#{$prefix}--pagination__button:focus {
|
329 | @include focus-outline('outline');
|
330 | }
|
331 |
|
332 | .#{$prefix}--pagination__button:hover {
|
333 | background: $hover-ui;
|
334 | }
|
335 |
|
336 | .#{$prefix}--pagination__button--no-index {
|
337 | fill: $disabled-02;
|
338 | cursor: not-allowed;
|
339 | }
|
340 |
|
341 | .#{$prefix}--pagination__button:disabled:hover,
|
342 | .#{$prefix}--pagination__button--no-index:hover {
|
343 | cursor: not-allowed;
|
344 | fill: $disabled-02;
|
345 | background: $ui-01;
|
346 | }
|
347 |
|
348 | .#{$prefix}--pagination--inline {
|
349 | height: rem(42px);
|
350 | margin-top: -0.5rem;
|
351 | margin-bottom: -0.5rem;
|
352 | margin-right: -1rem;
|
353 | }
|
354 |
|
355 | .#{$prefix}--pagination--inline .#{$prefix}--pagination__button {
|
356 | height: rem(40px);
|
357 | border-left: 1px solid $ui-03;
|
358 | border-right: 1px solid $ui-03;
|
359 | margin: 0;
|
360 | }
|
361 |
|
362 | .#{$prefix}--pagination--inline .#{$prefix}--pagination__button--forward {
|
363 | border-right: 0;
|
364 | padding: 0 $carbon--spacing-05;
|
365 | margin-left: $carbon--spacing-05;
|
366 | }
|
367 |
|
368 | .#{$prefix}--pagination--inline .#{$prefix}--pagination__button--backward {
|
369 | margin: 0 $carbon--spacing-05;
|
370 | padding: 0 $carbon--spacing-05;
|
371 | }
|
372 |
|
373 |
|
374 | .#{$prefix}--pagination.#{$prefix}--skeleton .#{$prefix}--skeleton__text {
|
375 | margin-right: 1rem;
|
376 | margin-bottom: 0;
|
377 | }
|
378 | }
|
379 |
|
380 | @include exports('pagination') {
|
381 | @if feature-flag-enabled('components-x') {
|
382 | @include pagination--x;
|
383 | } @else {
|
384 | @include pagination;
|
385 | }
|
386 | }
|