@abrasileirado/dsgovbr-bootstraped 0.8.0 → 0.9.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abrasileirado/dsgovbr-bootstraped",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Camada de compatibilidade visual não oficial entre o Bootstrap 5 e o Design System GOV.BR (DSGovBR)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Kelson da Costa Medeiros",
|
|
@@ -349,3 +349,31 @@ $navbar-dark-brand-hover-color: $govbr-color-dark !default;
|
|
|
349
349
|
// Divider (GOV.BR DS: Divider) — <hr> opaco em --border-color.
|
|
350
350
|
$hr-color: $govbr-gray-20 !default;
|
|
351
351
|
$hr-opacity: 1 !default;
|
|
352
|
+
|
|
353
|
+
// --- Issue #46: switch e select ---
|
|
354
|
+
|
|
355
|
+
// Switch (GOV.BR DS: Switch, tamanho médio): trilho de 52x30px branco com
|
|
356
|
+
// borda --border-color e botão de 22px a 4px da borda, cinza (--off) quando
|
|
357
|
+
// desligado e azul (--on) quando ligado. O trilho não muda de cor ao ligar.
|
|
358
|
+
// Altura, posição do botão e hover ficam em components/_form.scss.
|
|
359
|
+
$form-switch-width: $govbr-switch-width !default;
|
|
360
|
+
$form-switch-padding-start: $govbr-switch-width + 8px !default; // spacing-scale-base
|
|
361
|
+
$form-switch-border-radius: 100em !default;
|
|
362
|
+
$form-switch-transition: background-position 0.3s ease-in-out !default;
|
|
363
|
+
$form-switch-color: $govbr-gray-20 !default;
|
|
364
|
+
$form-switch-bg-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-11 -11 22 22'><circle r='11' fill='#{$form-switch-color}'/></svg>") !default;
|
|
365
|
+
$form-switch-focus-color: $govbr-gray-20 !default;
|
|
366
|
+
$form-switch-focus-bg-image: $form-switch-bg-image !default;
|
|
367
|
+
$form-switch-checked-color: $govbr-switch-on !default;
|
|
368
|
+
$form-switch-checked-bg-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-11 -11 22 22'><circle r='11' fill='#{$form-switch-checked-color}'/></svg>") !default;
|
|
369
|
+
$form-switch-checked-bg-position: right 3px center !default; // 4px da borda externa
|
|
370
|
+
$form-switch-color-dark: $govbr-gray-20 !default;
|
|
371
|
+
$form-switch-bg-image-dark: $form-switch-bg-image !default;
|
|
372
|
+
|
|
373
|
+
// Select (GOV.BR DS: Select = Input + botão circular pequeno com seta na cor
|
|
374
|
+
// interativa, 4px da borda, e 40px de respiro à direita): mesma superfície
|
|
375
|
+
// dos campos de texto, seta na cor interativa centrada nos 32px do botão.
|
|
376
|
+
$form-select-indicator-color: $govbr-interactive !default;
|
|
377
|
+
$form-select-indicator-color-dark: $govbr-interactive-dark !default;
|
|
378
|
+
$form-select-indicator-padding: 2.5rem !default; // 40px = --input-padding-button (spacing-scale-5x); rem porque o Bootstrap soma com $form-select-padding-x
|
|
379
|
+
$form-select-bg-position: right 12px center !default; // 4px + (32px - 16px) / 2
|
package/src/scss/_tokens.scss
CHANGED
|
@@ -139,3 +139,11 @@ $govbr-color-dark: #fff !default; // --color-dark (pure-0)
|
|
|
139
139
|
$govbr-interactive-dark: #c5d4eb !default; // --interactive-dark (blue-warm-20)
|
|
140
140
|
$govbr-focus-dark: #ffbe2e !default; // --focus-color-dark (gold-vivid-20)
|
|
141
141
|
$govbr-gray-2: #f8f8f8 !default; // --menu-background-submenu, fundo do sign-in e da busca
|
|
142
|
+
|
|
143
|
+
// Switch: vendor/govbr-ds-core/src/components/switch/_mixins.scss (switch-tokens,
|
|
144
|
+
// tamanho médio) e --on (blue-warm-vivid-40) em partial/scss/_tokens.scss.
|
|
145
|
+
// O desligado usa --off = gray-20 ($govbr-gray-20).
|
|
146
|
+
$govbr-switch-on: #5992ed !default; // --on (blue-warm-vivid-40)
|
|
147
|
+
$govbr-switch-width: 52px !default; // --switch-width-medium
|
|
148
|
+
$govbr-switch-height: 30px !default; // --switch-height-medium
|
|
149
|
+
$govbr-switch-toggle: 22px !default; // --switch-toggle-medium
|
|
@@ -36,3 +36,54 @@
|
|
|
36
36
|
.form-check-input {
|
|
37
37
|
margin-top: calc((var(--bs-body-line-height) * 1em - #{$form-check-input-width}) / 2);
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
// Switch (GOV.BR DS: Switch): trilho de 30px de altura, botão de 22px
|
|
41
|
+
// (imagem de fundo) a 4px da borda e trilho branco também quando ligado.
|
|
42
|
+
// background-origin é a caixa de padding, então 3px + 1px de borda = 4px.
|
|
43
|
+
.form-switch {
|
|
44
|
+
min-height: $govbr-switch-height;
|
|
45
|
+
|
|
46
|
+
.form-check-input {
|
|
47
|
+
height: $govbr-switch-height;
|
|
48
|
+
margin-top: calc((var(--bs-body-line-height) * 1em - #{$govbr-switch-height}) / 2);
|
|
49
|
+
background-color: $govbr-background;
|
|
50
|
+
background-position: left 3px center;
|
|
51
|
+
background-size: $govbr-switch-toggle $govbr-switch-toggle;
|
|
52
|
+
border-color: $govbr-gray-20;
|
|
53
|
+
|
|
54
|
+
&:checked {
|
|
55
|
+
background-color: $govbr-background;
|
|
56
|
+
border-color: $govbr-gray-20;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Hover e pressionado: camada na cor do botão (--off/--on) sobre o
|
|
60
|
+
// trilho, abaixo do botão (segunda imagem de fundo).
|
|
61
|
+
&:hover:not(:disabled) {
|
|
62
|
+
background-image: var(--#{$prefix}form-switch-bg), linear-gradient(rgba($govbr-gray-20, $govbr-hover-opacity), rgba($govbr-gray-20, $govbr-hover-opacity));
|
|
63
|
+
background-position: left 3px center, 0 0;
|
|
64
|
+
background-size: $govbr-switch-toggle $govbr-switch-toggle, 100% 100%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:checked:hover:not(:disabled) {
|
|
68
|
+
background-image: var(--#{$prefix}form-switch-bg), linear-gradient(rgba($govbr-switch-on, $govbr-hover-opacity), rgba($govbr-switch-on, $govbr-hover-opacity));
|
|
69
|
+
background-position: $form-switch-checked-bg-position, 0 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Foco do GOV.BR DS (focus-soft), como nos campos de texto.
|
|
73
|
+
&:focus-visible {
|
|
74
|
+
border-color: $govbr-focus;
|
|
75
|
+
box-shadow: 0 0 0 $govbr-focus-ring-width $govbr-focus;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&:focus:not(:focus-visible) {
|
|
79
|
+
box-shadow: none;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
[data-bs-theme="dark"] .form-switch .form-check-input {
|
|
85
|
+
&,
|
|
86
|
+
&:checked {
|
|
87
|
+
background-color: $govbr-background;
|
|
88
|
+
}
|
|
89
|
+
}
|