@factor_ec/ui 2.0.2 → 2.1.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,581 @@
1
+ @use "variables.scss";
2
+
3
+ // stylelint-disable declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix
4
+
5
+ // Reboot
6
+ //
7
+ // Normalization of HTML elements, manually forked from Normalize.css to remove
8
+ // styles targeting irrelevant browsers while applying new styles.
9
+ //
10
+ // Normalize is licensed MIT. https://github.com/necolas/normalize.css
11
+
12
+ // Document
13
+ //
14
+ // Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
15
+
16
+ *,
17
+ *::before,
18
+ *::after {
19
+ box-sizing: border-box;
20
+ }
21
+
22
+ // Root
23
+ //
24
+ // Ability to the value of the root font sizes, affecting the value of `rem`.
25
+ // null by default, thus nothing is generated.
26
+ /*
27
+ :root {
28
+ @if $font-size-root != null {
29
+ @include font-size(var(--ft-root-font-size));
30
+ }
31
+
32
+ @if $enable-smooth-scroll {
33
+ @media (prefers-reduced-motion: no-preference) {
34
+ scroll-behavior: smooth;
35
+ }
36
+ }
37
+ }
38
+ */
39
+
40
+ // Body
41
+ //
42
+ // 1. Remove the margin in all browsers.
43
+ // 2. As a best practice, apply a default `background-color`.
44
+ // 3. Prevent adjustments of font size after orientation changes in iOS.
45
+ // 4. Change the default tap highlight to be completely transparent in iOS.
46
+
47
+ // scss-docs-start reboot-body-rules
48
+ body {
49
+ margin: 0; // 1
50
+ font-family: var(--ft-body-font-family);
51
+ // @include font-size(var(--ft-body-font-size));
52
+ font-weight: var(--ft-body-font-weight);
53
+ line-height: var(--ft-body-line-height);
54
+ color: var(--ft-body-color);
55
+ // text-align: var(--ft-body-text-align);
56
+ background-color: var(--ft-body-bg); // 2
57
+ -webkit-text-size-adjust: 100%; // 3
58
+ // -webkit-tap-highlight-color: rgba($black, 0); // 4
59
+ }
60
+ // scss-docs-end reboot-body-rules
61
+
62
+ // Content grouping
63
+ //
64
+ // 1. Reset Firefox's gray color
65
+
66
+ hr {
67
+ // margin: $hr-margin-y 0;
68
+ // color: $hr-color; // 1
69
+ border: 0;
70
+ border-top: 1px solid;
71
+ opacity: 0.25;
72
+ }
73
+
74
+ // Typography
75
+ //
76
+ // 1. Remove top margins from headings
77
+ // By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
78
+ // margin for easier control within type scales as it avoids margin collapsing.
79
+
80
+ %heading {
81
+ margin-top: 0; // 1
82
+ margin-bottom: var(--ft-headings-margin-bottom);
83
+ font-family: var(--ft-headings-font-family);
84
+ // font-style: $headings-font-style;
85
+ font-weight: var(--ft-headings-font-weight);
86
+ line-height: var(--ft-headings-line-height);
87
+ color: var(--ft-heading-color, inherit);
88
+ }
89
+
90
+ h1 {
91
+ @extend %heading;
92
+ // @include font-size($h1-font-size);
93
+ }
94
+
95
+ h2 {
96
+ @extend %heading;
97
+ // @include font-size($h2-font-size);
98
+ }
99
+
100
+ h3 {
101
+ @extend %heading;
102
+ // @include font-size($h3-font-size);
103
+ }
104
+
105
+ h4 {
106
+ @extend %heading;
107
+ // @include font-size($h4-font-size);
108
+ }
109
+
110
+ h5 {
111
+ @extend %heading;
112
+ // @include font-size($h5-font-size);
113
+ }
114
+
115
+ h6 {
116
+ @extend %heading;
117
+ // @include font-size($h6-font-size);
118
+ }
119
+
120
+ // Reset margins on paragraphs
121
+ //
122
+ // Similarly, the top margin on `<p>`s get reset. However, we also reset the
123
+ // bottom margin to use `rem` units instead of `em`.
124
+
125
+ p {
126
+ margin-top: 0;
127
+ margin-bottom: 1rem;
128
+ }
129
+
130
+ // Abbreviations
131
+ //
132
+ // 1. Add the correct text decoration in Chrome, Edge, Opera, and Safari.
133
+ // 2. Add explicit cursor to indicate changed behavior.
134
+ // 3. Prevent the text-decoration to be skipped.
135
+
136
+ abbr[title] {
137
+ text-decoration: underline dotted; // 1
138
+ cursor: help; // 2
139
+ text-decoration-skip-ink: none; // 3
140
+ }
141
+
142
+ // Address
143
+
144
+ address {
145
+ margin-bottom: 1rem;
146
+ font-style: normal;
147
+ line-height: inherit;
148
+ }
149
+
150
+ // Lists
151
+
152
+ ol,
153
+ ul {
154
+ padding-left: 2rem;
155
+ }
156
+
157
+ ol,
158
+ ul,
159
+ dl {
160
+ margin-top: 0;
161
+ margin-bottom: 1rem;
162
+ }
163
+
164
+ ol ol,
165
+ ul ul,
166
+ ol ul,
167
+ ul ol {
168
+ margin-bottom: 0;
169
+ }
170
+ /*
171
+ dt {
172
+ font-weight: $dt-font-weight;
173
+ }
174
+ */
175
+ // 1. Undo browser default
176
+
177
+ dd {
178
+ margin-bottom: 0.5rem;
179
+ margin-left: 0; // 1
180
+ }
181
+
182
+ // Blockquote
183
+
184
+ blockquote {
185
+ margin: 0 0 1rem;
186
+ }
187
+
188
+ // Strong
189
+ //
190
+ // Add the correct font weight in Chrome, Edge, and Safari
191
+
192
+ b,
193
+ strong {
194
+ font-weight: bolder;
195
+ }
196
+
197
+ // Small
198
+ //
199
+ // Add the correct font size in all browsers
200
+ /*
201
+ small {
202
+ @include font-size($small-font-size);
203
+ }
204
+ */
205
+
206
+ // Mark
207
+ /*
208
+ mark {
209
+ padding: $mark-padding;
210
+ background-color: var(--ft-highlight-bg);
211
+ }
212
+ */
213
+
214
+ // Sub and Sup
215
+ //
216
+ // Prevent `sub` and `sup` elements from affecting the line height in
217
+ // all browsers.
218
+ /*
219
+ sub,
220
+ sup {
221
+ position: relative;
222
+ @include font-size($sub-sup-font-size);
223
+ line-height: 0;
224
+ vertical-align: baseline;
225
+ }
226
+
227
+ sub { bottom: -.25em; }
228
+ sup { top: -.5em; }
229
+ */
230
+
231
+ // Links
232
+
233
+ a {
234
+ color: rgba(var(--ft-link-color-rgb), var(--ft-link-opacity, 1));
235
+ // text-decoration: $link-decoration;
236
+
237
+ &:hover {
238
+ --ft-link-color-rgb: var(--ft-link-hover-color-rgb);
239
+ // text-decoration: $link-hover-decoration;
240
+ }
241
+ }
242
+
243
+ // And undo these styles for placeholder links/named anchors (without href).
244
+ // It would be more straightforward to just use a[href] in previous block, but that
245
+ // causes specificity issues in many other styles that are too complex to fix.
246
+ // See https://github.com/twbs/bootstrap/issues/19402
247
+
248
+ a:not([href]):not([class]) {
249
+ &,
250
+ &:hover {
251
+ color: inherit;
252
+ text-decoration: none;
253
+ }
254
+ }
255
+
256
+ // Code
257
+ /*
258
+ pre,
259
+ code,
260
+ kbd,
261
+ samp {
262
+ font-family: $font-family-code;
263
+ @include font-size(1em); // Correct the odd `em` font sizing in all browsers.
264
+ }
265
+
266
+ // 1. Remove browser default top margin
267
+ // 2. Reset browser default of `1em` to use `rem`s
268
+ // 3. Don't allow content to break outside
269
+
270
+ pre {
271
+ display: block;
272
+ margin-top: 0; // 1
273
+ margin-bottom: 1rem; // 2
274
+ overflow: auto; // 3
275
+ @include font-size($code-font-size);
276
+ color: $pre-color;
277
+
278
+ // Account for some code outputs that place code tags in pre tags
279
+ code {
280
+ @include font-size(inherit);
281
+ color: inherit;
282
+ word-break: normal;
283
+ }
284
+ }
285
+
286
+ code {
287
+ @include font-size($code-font-size);
288
+ color: var(--ft-code-color);
289
+ word-wrap: break-word;
290
+
291
+ // Streamline the style when inside anchors to avoid broken underline and more
292
+ a > & {
293
+ color: inherit;
294
+ }
295
+ }
296
+
297
+ kbd {
298
+ padding: $kbd-padding-y $kbd-padding-x;
299
+ @include font-size($kbd-font-size);
300
+ color: $kbd-color;
301
+ background-color: $kbd-bg;
302
+ @include border-radius($border-radius-sm);
303
+
304
+ kbd {
305
+ padding: 0;
306
+ @include font-size(1em);
307
+ font-weight: $nested-kbd-font-weight;
308
+ }
309
+ }
310
+
311
+
312
+ // Figures
313
+ //
314
+ // Apply a consistent margin strategy (matches our type styles).
315
+
316
+ figure {
317
+ margin: 0 0 1rem;
318
+ }
319
+ */
320
+
321
+ // Images and content
322
+
323
+ img,
324
+ svg {
325
+ vertical-align: middle;
326
+ }
327
+
328
+ // Tables
329
+ //
330
+ // Prevent double borders
331
+
332
+ table {
333
+ caption-side: bottom;
334
+ border-collapse: collapse;
335
+ }
336
+ /*
337
+ caption {
338
+ padding-top: $table-cell-padding-y;
339
+ padding-bottom: $table-cell-padding-y;
340
+ color: $table-caption-color;
341
+ text-align: left;
342
+ }
343
+ */
344
+ // 1. Removes font-weight bold by inheriting
345
+ // 2. Matches default `<td>` alignment by inheriting `text-align`.
346
+ // 3. Fix alignment for Safari
347
+ /*
348
+ th {
349
+ font-weight: $table-th-font-weight; // 1
350
+ text-align: inherit; // 2
351
+ text-align: -webkit-match-parent; // 3
352
+ }
353
+
354
+ thead,
355
+ tbody,
356
+ tfoot,
357
+ tr,
358
+ td,
359
+ th {
360
+ border-color: inherit;
361
+ border-style: solid;
362
+ border-width: 0;
363
+ }
364
+
365
+
366
+ // Forms
367
+ //
368
+ // 1. Allow labels to use `margin` for spacing.
369
+
370
+ label {
371
+ display: inline-block; // 1
372
+ }
373
+
374
+ // Remove the default `border-radius` that macOS Chrome adds.
375
+ // See https://github.com/twbs/bootstrap/issues/24093
376
+
377
+ button {
378
+ // stylelint-disable-next-line property-disallowed-list
379
+ border-radius: 0;
380
+ }
381
+
382
+ // Explicitly remove focus outline in Chromium when it shouldn't be
383
+ // visible (e.g. as result of mouse click or touch tap). It already
384
+ // should be doing this automatically, but seems to currently be
385
+ // confused and applies its very visible two-tone outline anyway.
386
+
387
+ button:focus:not(:focus-visible) {
388
+ outline: 0;
389
+ }
390
+
391
+ // 1. Remove the margin in Firefox and Safari
392
+
393
+ input,
394
+ button,
395
+ select,
396
+ optgroup,
397
+ textarea {
398
+ margin: 0; // 1
399
+ font-family: inherit;
400
+ @include font-size(inherit);
401
+ line-height: inherit;
402
+ }
403
+ */
404
+
405
+ // Remove the inheritance of text transform in Firefox
406
+ button,
407
+ select {
408
+ text-transform: none;
409
+ }
410
+ // Set the cursor for non-`<button>` buttons
411
+ //
412
+ // Details at https://github.com/twbs/bootstrap/pull/30562
413
+ [role="button"] {
414
+ cursor: pointer;
415
+ }
416
+
417
+ select {
418
+ // Remove the inheritance of word-wrap in Safari.
419
+ // See https://github.com/twbs/bootstrap/issues/24990
420
+ word-wrap: normal;
421
+
422
+ // Undo the opacity change from Chrome
423
+ &:disabled {
424
+ opacity: 1;
425
+ }
426
+ }
427
+
428
+ // Remove the dropdown arrow only from text type inputs built with datalists in Chrome.
429
+ // See https://stackoverflow.com/a/54997118
430
+
431
+ [list]:not([type="date"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not(
432
+ [type="time"]
433
+ )::-webkit-calendar-picker-indicator {
434
+ display: none !important;
435
+ }
436
+
437
+ // 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
438
+ // controls in Android 4.
439
+ // 2. Correct the inability to style clickable types in iOS and Safari.
440
+ // 3. Opinionated: add "hand" cursor to non-disabled button elements.
441
+
442
+ button,
443
+ [type="button"], // 1
444
+ [type="reset"],
445
+ [type="submit"] {
446
+ -webkit-appearance: button; // 2
447
+ &:not(:disabled) {
448
+ cursor: pointer; // 3
449
+ }
450
+ }
451
+
452
+ // Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
453
+
454
+ ::-moz-focus-inner {
455
+ padding: 0;
456
+ border-style: none;
457
+ }
458
+
459
+ // 1. Textareas should really only resize vertically so they don't break their (horizontal) containers.
460
+
461
+ textarea {
462
+ resize: vertical; // 1
463
+ }
464
+
465
+ // 1. Browsers set a default `min-width: min-content;` on fieldsets,
466
+ // unlike e.g. `<div>`s, which have `min-width: 0;` by default.
467
+ // So we reset that to ensure fieldsets behave more like a standard block element.
468
+ // See https://github.com/twbs/bootstrap/issues/12359
469
+ // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements
470
+ // 2. Reset the default outline behavior of fieldsets so they don't affect page layout.
471
+
472
+ fieldset {
473
+ min-width: 0; // 1
474
+ padding: 0; // 2
475
+ margin: 0; // 2
476
+ border: 0; // 2
477
+ }
478
+
479
+ // 1. By using `float: left`, the legend will behave like a block element.
480
+ // This way the border of a fieldset wraps around the legend if present.
481
+ // 2. Fix wrapping bug.
482
+ // See https://github.com/twbs/bootstrap/issues/29712
483
+
484
+ legend {
485
+ float: left; // 1
486
+ width: 100%;
487
+ padding: 0;
488
+ // margin-bottom: $legend-margin-bottom;
489
+ // @include font-size($legend-font-size);
490
+ // font-weight: $legend-font-weight;
491
+ line-height: inherit;
492
+
493
+ + * {
494
+ clear: left; // 2
495
+ }
496
+ }
497
+
498
+ // Fix height of inputs with a type of datetime-local, date, month, week, or time
499
+ // See https://github.com/twbs/bootstrap/issues/18842
500
+
501
+ ::-webkit-datetime-edit-fields-wrapper,
502
+ ::-webkit-datetime-edit-text,
503
+ ::-webkit-datetime-edit-minute,
504
+ ::-webkit-datetime-edit-hour-field,
505
+ ::-webkit-datetime-edit-day-field,
506
+ ::-webkit-datetime-edit-month-field,
507
+ ::-webkit-datetime-edit-year-field {
508
+ padding: 0;
509
+ }
510
+
511
+ ::-webkit-inner-spin-button {
512
+ height: auto;
513
+ }
514
+
515
+ // 1. Correct the outline style in Safari.
516
+ // 2. This overrides the extra rounded corners on search inputs in iOS so that our
517
+ // `.form-control` class can properly style them. Note that this cannot simply
518
+ // be added to `.form-control` as it's not specific enough. For details, see
519
+ // https://github.com/twbs/bootstrap/issues/11586.
520
+
521
+ [type="search"] {
522
+ outline-offset: -2px; // 1
523
+ -webkit-appearance: textfield; // 2
524
+ }
525
+
526
+ // Remove the inner padding in Chrome and Safari on macOS.
527
+
528
+ ::-webkit-search-decoration {
529
+ -webkit-appearance: none;
530
+ }
531
+
532
+ // Remove padding around color pickers in webkit browsers
533
+
534
+ ::-webkit-color-swatch-wrapper {
535
+ padding: 0;
536
+ }
537
+
538
+ // 1. Inherit font family and line height for file input buttons
539
+ // 2. Correct the inability to style clickable types in iOS and Safari.
540
+
541
+ ::file-selector-button {
542
+ font: inherit; // 1
543
+ -webkit-appearance: button; // 2
544
+ }
545
+
546
+ // Correct element displays
547
+
548
+ output {
549
+ display: inline-block;
550
+ }
551
+
552
+ // Remove border from iframe
553
+
554
+ iframe {
555
+ border: 0;
556
+ }
557
+
558
+ // Summary
559
+ //
560
+ // 1. Add the correct display in all browsers
561
+
562
+ summary {
563
+ display: list-item; // 1
564
+ cursor: pointer;
565
+ }
566
+
567
+ // Progress
568
+ //
569
+ // Add the correct vertical alignment in Chrome, Firefox, and Opera.
570
+
571
+ progress {
572
+ vertical-align: baseline;
573
+ }
574
+
575
+ // Hidden attribute
576
+ //
577
+ // Always hide an element with the `hidden` HTML attribute.
578
+
579
+ [hidden] {
580
+ display: none !important;
581
+ }
package/scss/root.scss ADDED
@@ -0,0 +1,39 @@
1
+ :root {
2
+ --ft-body-font-family: sans-serif;
3
+ --ft-body-font-size: 14px;
4
+ --ft-body-font-size-sm: calc(var(--ft-body-font-size * 0.875));
5
+ --ft-body-font-size-lg: calc(var(--ft-body-font-size * 1.25));
6
+ --ft-body-font-weight: 300;
7
+ --ft-body-font-line-height: normal;
8
+
9
+ --ft-body-bg: #fff;
10
+ --ft-body-color: var(--ft-text-dark-color);
11
+
12
+ --ft-heading-color: var(--ft-text-dark-color);
13
+ --ft-heading-margin-bottom: calc(1rem * 0.5);
14
+ --ft-heading-font-family: var(--ft-body-font-family);
15
+ --ft-heading-font-weight: 500;
16
+ --ft-heading-line-height: 1.2;
17
+
18
+ --ft-text-color: var(--ft-text-dark-color);
19
+
20
+ --ft-link-color: var(--ft-primary-color);
21
+ --ft-link-hover-color: rgb(var(--ft-primary-color-rgb), 0.9);
22
+
23
+ --ft-danger-color: #dc3545;
24
+ --ft-warning-color: #ffc107;
25
+ --ft-success-color: #198754;
26
+ --ft-text-light-color: #fff;
27
+ --ft-text-dark-color: #333;
28
+
29
+ --ft-avatar-size: 2.25rem;
30
+ --ft-avatar-bg: #fff;
31
+
32
+ --ft-button-bg: unset;
33
+ --ft-button-bg-rgb: 0, 0, 0;
34
+ --ft-button-border-color: unset;
35
+ --ft-button-border-radius: 0.5rem;
36
+ --ft-button-color: var(--ft-primary-color);
37
+
38
+ --ft-popup-box-shadow: 0px 24px 38px rgba(0, 0, 0, 0.14), 0px 9px 46px rgba(0, 0, 0, 0.12), 0px 11px 15px rgba(0, 0, 0, 0.2);;
39
+ }
@@ -0,0 +1,41 @@
1
+ $white: #fff !default;
2
+ $gray-100: #f8f9fa !default;
3
+ $gray-200: #e9ecef !default;
4
+ $gray-300: #dee2e6 !default;
5
+ $gray-400: #ced4da !default;
6
+ $gray-500: #adb5bd !default;
7
+ $gray-600: #6c757d !default;
8
+ $gray-700: #495057 !default;
9
+ $gray-800: #343a40 !default;
10
+ $gray-900: #212529 !default;
11
+ $black: #000 !default;
12
+
13
+ $spacer: 1rem !default;
14
+ $spacers: (
15
+ 0: 0,
16
+ 1: $spacer * .25,
17
+ 2: $spacer * .5,
18
+ 3: $spacer,
19
+ 4: $spacer * 1.5,
20
+ 5: $spacer * 3,
21
+ ) !default;
22
+
23
+ $grid-breakpoints: (
24
+ xs: 0,
25
+ sm: 576px,
26
+ md: 768px,
27
+ lg: 992px,
28
+ xl: 1200px,
29
+ xxl: 1400px
30
+ ) !default;
31
+
32
+ $container-max-widths: (
33
+ sm: 540px,
34
+ md: 720px,
35
+ lg: 960px,
36
+ xl: 1140px,
37
+ xxl: 1320px
38
+ ) !default;
39
+
40
+ $headings-margin-bottom: $spacer * .5 !default;
41
+ $paragraph-margin-bottom: 1rem !default;