@muraldevkit/ui-toolkit 2.46.0 → 2.47.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,9 @@
1
+ @use '../../label/MrlLabel/MrlLabel.module.scss';
2
+ .MrlSwitch {
3
+ align-items: center;
4
+ display: flex;
5
+ justify-content: space-between;
6
+ }
7
+ .MrlSwitch-disabled {
8
+ color: rgba(var(--mrl-gray-40), 1);
9
+ }
@@ -0,0 +1,81 @@
1
+ @use '@muraldevkit/ds-foundation/src/styles/_mixins' as *;
2
+ .MrlSwitchStandalone {
3
+ height: 100%;
4
+ position: relative;
5
+ }
6
+ .MrlSwitchStandalone-switch {
7
+ background-color: rgba(var(--mrl-gray-80), 1);
8
+ border-radius: 0.625rem;
9
+ cursor: pointer;
10
+ display: block;
11
+ height: var(--mrl-spacing-06);
12
+ width: calc(var(--mrl-spacing-08) + var(--mrl-spacing-02));
13
+ @media (prefers-reduced-motion: no-preference) {
14
+ transition: var(--mrl-duration-02);
15
+ }
16
+ }
17
+ .MrlSwitchStandalone-switch-indicator {
18
+ align-content: center;
19
+ background-color: var(--mrl-color-background);
20
+ border-radius: 0.375rem;
21
+ bottom: calc(var(--mrl-spacing-03) - var(--mrl-spacing-02));
22
+ color: var(--mrl-color-background-secondary);
23
+ display: flex;
24
+ height: var(--mrl-spacing-04);
25
+ left: var(--mrl-spacing-02);
26
+ pointer-events: none;
27
+ position: absolute;
28
+ width: var(--mrl-spacing-04);
29
+ @media (prefers-reduced-motion: no-preference) {
30
+ transition: var(--mrl-duration-02) var(--mrl-timing-m1);
31
+ }
32
+ .mrl-svg {
33
+ height: var(--mrl-spacing-04);
34
+ pointer-events: none;
35
+ width: var(--mrl-spacing-04);
36
+ }
37
+ }
38
+ .MrlSwitchStandalone-checkbox {
39
+ height: var(--mrl-spacing-06);
40
+ opacity: 0;
41
+ position: absolute;
42
+ width: calc(var(--mrl-spacing-08) + var(--mrl-spacing-02));
43
+ &:hover + .MrlSwitchStandalone-switch {
44
+ background-color: rgba(var(--mrl-gray-90), 1);
45
+ }
46
+ &:active + .MrlSwitchStandalone-switch {
47
+ background-color: rgba(var(--mrl-gray-100), 1);
48
+ }
49
+ &:disabled {
50
+ + .MrlSwitchStandalone-switch,
51
+ &:hover + .MrlSwitchStandalone-switch {
52
+ background-color: rgba(var(--mrl-gray-40), 1);
53
+ }
54
+ ~ .MrlSwitchStandalone-switch-indicator {
55
+ color: rgba(var(--mrl-gray-40), 1);
56
+ }
57
+ }
58
+ &:focus-visible + .MrlSwitchStandalone-switch::after {
59
+ @include mrl-focus-pseudo-element;
60
+ }
61
+ }
62
+ .MrlSwitchStandalone-checkbox:checked {
63
+ + .MrlSwitchStandalone-switch {
64
+ background-color: rgba(var(--mrl-blue-70), 1);
65
+ }
66
+ ~ .MrlSwitchStandalone-switch-indicator {
67
+ $switch-knob-on-position: calc(var(--mrl-spacing-08) - var(--mrl-spacing-05));
68
+ color: rgba(var(--mrl-blue-70), 1);
69
+ transform: translateX($switch-knob-on-position);
70
+ }
71
+ &:hover + .MrlSwitchStandalone-switch {
72
+ background-color: rgba(var(--mrl-blue-80), 1);
73
+ }
74
+ &:active + .MrlSwitchStandalone-switch {
75
+ background-color: rgba(var(--mrl-blue-90), 1);
76
+ }
77
+ &:disabled + .MrlSwitchStandalone-switch,
78
+ &:disabled:hover + .MrlSwitchStandalone-switch {
79
+ background-color: rgba(var(--mrl-gray-40), 1);
80
+ }
81
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muraldevkit/ui-toolkit",
3
- "version": "2.46.0",
3
+ "version": "2.47.0",
4
4
  "description": "Mural's UI Toolkit",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",