cx 24.8.6 → 24.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.
@@ -1,119 +1,118 @@
1
- @mixin cx-slider(
2
- $name: "slider",
3
- $state-style-map: $cx-input-state-style-map,
4
- $styles: $cx-slider-handle-styles,
5
- $width: $cx-default-input-width,
6
- $size: $cx-default-slider-handle-size,
7
- $axis-size: $cx-default-slider-axis-size,
8
- $axis-background-color: $cx-default-slider-axis-background-color,
9
- $range-background-color: $cx-default-slider-range-background-color,
10
- $besm: $cx-besm
11
- ) {
12
- $block: map-get($besm, block);
13
- $element: map-get($besm, element);
14
- $state: map-get($besm, state);
15
-
16
- .#{$block}#{$name} {
17
- @include cxb-field($besm, $state-style-map, $input: false, $box: true);
18
-
19
- width: $width;
20
-
21
- &.#{$state}vertical {
22
- width: 28px;
23
- height: $width;
24
- }
25
-
26
- &.#{$state}disabled {
27
- pointer-events: none;
28
- opacity: 0.5;
29
- }
30
-
31
- user-select: none;
32
- }
33
-
34
- .#{$element}#{$name}-axis {
35
- position: absolute;
36
- background-color: $axis-background-color;
37
- border-radius: $size * 0.5;
38
- box-sizing: border-box;
39
-
40
- .#{$block}#{$name}.#{$state}horizontal & {
41
- left: $size * 0.5;
42
- right: $size * 0.5;
43
- top: calc(50% - #{$axis-size * 0.5});
44
- height: $axis-size;
45
- padding: 0 $axis-size * 0.5;
46
- }
47
-
48
- .#{$block}#{$name}.#{$state}vertical & {
49
- top: $size * 0.5;
50
- bottom: $size * 0.5;
51
- width: $axis-size;
52
- left: calc(50% - #{$axis-size * 0.5});
53
- padding: $axis-size * 0.5 0;
54
- }
55
- }
56
-
57
- .#{$element}#{$name}-space {
58
- position: relative;
59
- width: 100%;
60
- height: 100%;
61
- }
62
-
63
- .#{$element}#{$name}-range {
64
- position: absolute;
65
-
66
- background-color: $range-background-color;
67
- border-radius: $axis-size * 0.5;
68
-
69
- .#{$block}#{$name}.#{$state}horizontal & {
70
- height: 100%;
71
- }
72
-
73
- .#{$block}#{$name}.#{$state}vertical & {
74
- width: 100%;
75
- }
76
- }
77
-
78
- .#{$element}#{$name}-handle {
79
- position: absolute;
80
- box-sizing: border-box;
81
- width: $size;
82
- height: $size;
83
- margin-left: -$size * 0.5;
84
- margin-top: -$size * 0.5;
85
- margin-bottom: -$size * 0.5;
86
- touch-action: none;
87
-
88
- .#{$block}#{$name}.#{$state}horizontal & {
89
- left: 0;
90
- top: 50%;
91
- }
92
-
93
- .#{$block}#{$name}.#{$state}vertical & {
94
- left: 50%;
95
- }
96
-
97
- @include cx-add-state-rules($styles, default);
98
-
99
- &:hover {
100
- @include cx-add-state-rules($styles, hover);
101
- }
102
-
103
- &:focus {
104
- @include cx-add-state-rules($styles, focus);
105
- }
106
-
107
- &[disabled] {
108
- @include cx-add-state-rules($styles, disabled);
109
- }
110
-
111
- &:active {
112
- @include cx-add-state-rules($styles, active);
113
- }
114
- }
115
- }
116
-
117
- @if (cx-should-include("cx/widgets/Slider")) {
118
- @include cx-slider();
119
- }
1
+ @mixin cx-slider(
2
+ $name: "slider",
3
+ $state-style-map: $cx-input-state-style-map,
4
+ $styles: $cx-slider-handle-styles,
5
+ $width: $cx-default-input-width,
6
+ $size: $cx-default-slider-handle-size,
7
+ $axis-size: $cx-default-slider-axis-size,
8
+ $axis-background-color: $cx-default-slider-axis-background-color,
9
+ $range-background-color: $cx-default-slider-range-background-color,
10
+ $besm: $cx-besm
11
+ ) {
12
+ $block: map-get($besm, block);
13
+ $element: map-get($besm, element);
14
+ $state: map-get($besm, state);
15
+
16
+ .#{$block}#{$name} {
17
+ width: $width;
18
+ user-select: none;
19
+
20
+ @include cxb-field($besm, $state-style-map, $input: false, $box: true);
21
+
22
+ &.#{$state}vertical {
23
+ width: 28px;
24
+ height: $width;
25
+ }
26
+
27
+ &.#{$state}disabled {
28
+ pointer-events: none;
29
+ opacity: 0.5;
30
+ }
31
+ }
32
+
33
+ .#{$element}#{$name}-axis {
34
+ position: absolute;
35
+ background-color: $axis-background-color;
36
+ border-radius: $size * 0.5;
37
+ box-sizing: border-box;
38
+
39
+ .#{$block}#{$name}.#{$state}horizontal & {
40
+ left: $size * 0.5;
41
+ right: $size * 0.5;
42
+ top: calc(50% - #{$axis-size * 0.5});
43
+ height: $axis-size;
44
+ padding: 0 $axis-size * 0.5;
45
+ }
46
+
47
+ .#{$block}#{$name}.#{$state}vertical & {
48
+ top: $size * 0.5;
49
+ bottom: $size * 0.5;
50
+ width: $axis-size;
51
+ left: calc(50% - #{$axis-size * 0.5});
52
+ padding: $axis-size * 0.5 0;
53
+ }
54
+ }
55
+
56
+ .#{$element}#{$name}-space {
57
+ position: relative;
58
+ width: 100%;
59
+ height: 100%;
60
+ }
61
+
62
+ .#{$element}#{$name}-range {
63
+ position: absolute;
64
+
65
+ background-color: $range-background-color;
66
+ border-radius: $axis-size * 0.5;
67
+
68
+ .#{$block}#{$name}.#{$state}horizontal & {
69
+ height: 100%;
70
+ }
71
+
72
+ .#{$block}#{$name}.#{$state}vertical & {
73
+ width: 100%;
74
+ }
75
+ }
76
+
77
+ .#{$element}#{$name}-handle {
78
+ position: absolute;
79
+ box-sizing: border-box;
80
+ width: $size;
81
+ height: $size;
82
+ margin-left: -$size * 0.5;
83
+ margin-top: -$size * 0.5;
84
+ margin-bottom: -$size * 0.5;
85
+ touch-action: none;
86
+
87
+ @include cx-add-state-rules($styles, default);
88
+
89
+ .#{$block}#{$name}.#{$state}horizontal & {
90
+ left: 0;
91
+ top: 50%;
92
+ }
93
+
94
+ .#{$block}#{$name}.#{$state}vertical & {
95
+ left: 50%;
96
+ }
97
+
98
+ &:hover {
99
+ @include cx-add-state-rules($styles, hover);
100
+ }
101
+
102
+ &:focus {
103
+ @include cx-add-state-rules($styles, focus);
104
+ }
105
+
106
+ &[disabled] {
107
+ @include cx-add-state-rules($styles, disabled);
108
+ }
109
+
110
+ &:active {
111
+ @include cx-add-state-rules($styles, active);
112
+ }
113
+ }
114
+ }
115
+
116
+ @if (cx-should-include("cx/widgets/Slider")) {
117
+ @include cx-slider();
118
+ }
@@ -1,140 +1,140 @@
1
- @mixin cx-switch(
2
- $name: "switch",
3
- $state-style-map: $cx-input-state-style-map,
4
- $styles: $cx-switch-handle-styles,
5
- $width: $cx-default-switch-width,
6
- $handle-size: $cx-default-switch-handle-size,
7
- $axis-size: $cx-default-switch-axis-size,
8
- $axis-background-color: $cx-default-switch-axis-background-color,
9
- $range-background-color: $cx-default-switch-range-background-color,
10
- $empty-text: $cx-empty-text,
11
- $besm: $cx-besm
12
- ) {
13
- $block: map-get($besm, block);
14
- $element: map-get($besm, element);
15
- $state: map-get($besm, state);
16
-
17
- $padding: cx-get-state-rule($state-style-map, default, padding);
18
- $border-width: cx-get-state-rule($state-style-map, default, border-width);
19
-
20
- $outer-styles: cx-deep-map-merge(
21
- $state-style-map,
22
- (
23
- default: (
24
- border-width: cx-top($border-width) 0 cx-bottom($border-width) 0,
25
- padding: cx-top($padding) 0 cx-bottom($padding) 0,
26
- ),
27
- )
28
- );
29
-
30
- .#{$block}#{$name} {
31
- @include cxb-field($besm, $outer-styles, $input: false, $box: true);
32
-
33
- cursor: pointer;
34
- min-width: cx-calc($width, $handle-size);
35
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
36
-
37
- &.#{$state}disabled {
38
- pointer-events: none;
39
- opacity: 0.5;
40
- }
41
-
42
- &:focus {
43
- outline: none;
44
- }
45
- }
46
-
47
- .#{$element}#{$name}-text {
48
- display: inline-block;
49
- margin-left: cx-calc($width, $handle-size);
50
- padding: 0 cx-right($padding) 0 cx-left($padding);
51
- }
52
-
53
- .#{$element}#{$name}-empty-text {
54
- @include cxe-field-empty-text($empty-text);
55
- }
56
-
57
- .#{$element}#{$name}-axis {
58
- user-select: none;
59
- position: absolute;
60
- background-color: $axis-background-color;
61
- border-radius: $axis-size * 0.5;
62
- box-sizing: border-box;
63
- width: $width;
64
-
65
- left: $handle-size * 0.5;
66
- right: $handle-size * 0.5;
67
- top: calc(50% - #{$axis-size * 0.5});
68
- height: $axis-size;
69
- padding: 0 $axis-size * 0.5;
70
- }
71
-
72
- .#{$element}#{$name}-space {
73
- position: relative;
74
- box-sizing: border-box;
75
- width: 100%;
76
- height: 100%;
77
- }
78
-
79
- .#{$element}#{$name}-range {
80
- position: absolute;
81
- background-color: $range-background-color;
82
- border-radius: $axis-size * 0.5;
83
- height: 100%;
84
- left: 0;
85
- width: 0;
86
- opacity: 0;
87
- transform: scale(0);
88
-
89
- transition: all 200ms;
90
-
91
- .#{$state}on & {
92
- width: 100%;
93
- opacity: 1;
94
- transform: none;
95
- }
96
- }
97
-
98
- .#{$element}#{$name}-handle {
99
- position: absolute;
100
- box-sizing: border-box;
101
- width: $handle-size;
102
- height: $handle-size;
103
- margin-left: -$handle-size * 0.5;
104
- margin-top: -$handle-size * 0.5;
105
- left: 0;
106
- top: 50%;
107
- transition: left 200ms;
108
-
109
- .#{$state}on & {
110
- left: 100%;
111
- @include cx-add-state-rules($styles, on);
112
- }
113
-
114
- .#{$state}on:active & {
115
- @include cx-add-state-rules($styles, on-active);
116
- }
117
-
118
- @include cx-add-state-rules($styles, default);
119
-
120
- &:hover {
121
- @include cx-add-state-rules($styles, hover);
122
- }
123
-
124
- .#{$block}#{$name}:focus & {
125
- @include cx-add-state-rules($styles, focus);
126
- }
127
-
128
- .#{$block}#{$name}.#{$state}disabled & {
129
- @include cx-add-state-rules($styles, disabled);
130
- }
131
-
132
- &:active {
133
- @include cx-add-state-rules($styles, active);
134
- }
135
- }
136
- }
137
-
138
- @if (cx-should-include("cx/widgets/Switch")) {
139
- @include cx-switch();
140
- }
1
+ @mixin cx-switch(
2
+ $name: "switch",
3
+ $state-style-map: $cx-input-state-style-map,
4
+ $styles: $cx-switch-handle-styles,
5
+ $width: $cx-default-switch-width,
6
+ $handle-size: $cx-default-switch-handle-size,
7
+ $axis-size: $cx-default-switch-axis-size,
8
+ $axis-background-color: $cx-default-switch-axis-background-color,
9
+ $range-background-color: $cx-default-switch-range-background-color,
10
+ $empty-text: $cx-empty-text,
11
+ $besm: $cx-besm
12
+ ) {
13
+ $block: map-get($besm, block);
14
+ $element: map-get($besm, element);
15
+ $state: map-get($besm, state);
16
+
17
+ $padding: cx-get-state-rule($state-style-map, default, padding);
18
+ $border-width: cx-get-state-rule($state-style-map, default, border-width);
19
+
20
+ $outer-styles: cx-deep-map-merge(
21
+ $state-style-map,
22
+ (
23
+ default: (
24
+ border-width: cx-top($border-width) 0 cx-bottom($border-width) 0,
25
+ padding: cx-top($padding) 0 cx-bottom($padding) 0,
26
+ ),
27
+ )
28
+ );
29
+
30
+ .#{$block}#{$name} {
31
+ cursor: pointer;
32
+ min-width: cx-calc($width, $handle-size);
33
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
34
+
35
+ @include cxb-field($besm, $outer-styles, $input: false, $box: true);
36
+
37
+ &.#{$state}disabled {
38
+ pointer-events: none;
39
+ opacity: 0.5;
40
+ }
41
+
42
+ &:focus {
43
+ outline: none;
44
+ }
45
+ }
46
+
47
+ .#{$element}#{$name}-text {
48
+ display: inline-block;
49
+ margin-left: cx-calc($width, $handle-size);
50
+ padding: 0 cx-right($padding) 0 cx-left($padding);
51
+ }
52
+
53
+ .#{$element}#{$name}-empty-text {
54
+ @include cxe-field-empty-text($empty-text);
55
+ }
56
+
57
+ .#{$element}#{$name}-axis {
58
+ user-select: none;
59
+ position: absolute;
60
+ background-color: $axis-background-color;
61
+ border-radius: $axis-size * 0.5;
62
+ box-sizing: border-box;
63
+ width: $width;
64
+
65
+ left: $handle-size * 0.5;
66
+ right: $handle-size * 0.5;
67
+ top: calc(50% - #{$axis-size * 0.5});
68
+ height: $axis-size;
69
+ padding: 0 $axis-size * 0.5;
70
+ }
71
+
72
+ .#{$element}#{$name}-space {
73
+ position: relative;
74
+ box-sizing: border-box;
75
+ width: 100%;
76
+ height: 100%;
77
+ }
78
+
79
+ .#{$element}#{$name}-range {
80
+ position: absolute;
81
+ background-color: $range-background-color;
82
+ border-radius: $axis-size * 0.5;
83
+ height: 100%;
84
+ left: 0;
85
+ width: 0;
86
+ opacity: 0;
87
+ transform: scale(0);
88
+
89
+ transition: all 200ms;
90
+
91
+ .#{$state}on & {
92
+ width: 100%;
93
+ opacity: 1;
94
+ transform: none;
95
+ }
96
+ }
97
+
98
+ .#{$element}#{$name}-handle {
99
+ position: absolute;
100
+ box-sizing: border-box;
101
+ width: $handle-size;
102
+ height: $handle-size;
103
+ margin-left: -$handle-size * 0.5;
104
+ margin-top: -$handle-size * 0.5;
105
+ left: 0;
106
+ top: 50%;
107
+ transition: left 200ms;
108
+
109
+ @include cx-add-state-rules($styles, default);
110
+
111
+ .#{$state}on & {
112
+ left: 100%;
113
+ @include cx-add-state-rules($styles, on);
114
+ }
115
+
116
+ .#{$state}on:active & {
117
+ @include cx-add-state-rules($styles, on-active);
118
+ }
119
+
120
+ &:hover {
121
+ @include cx-add-state-rules($styles, hover);
122
+ }
123
+
124
+ .#{$block}#{$name}:focus & {
125
+ @include cx-add-state-rules($styles, focus);
126
+ }
127
+
128
+ .#{$block}#{$name}.#{$state}disabled & {
129
+ @include cx-add-state-rules($styles, disabled);
130
+ }
131
+
132
+ &:active {
133
+ @include cx-add-state-rules($styles, active);
134
+ }
135
+ }
136
+ }
137
+
138
+ @if (cx-should-include("cx/widgets/Switch")) {
139
+ @include cx-switch();
140
+ }
@@ -1,60 +1,43 @@
1
-
2
- @mixin cx-textarea(
3
- $name: 'textarea',
4
- $state-style-map: $cx-textarea-state-style-map,
5
- $placeholder: $cx-input-placeholder,
6
- $empty-text: $cx-empty-text,
7
- $tool-state-style-map: $cx-input-right-icon-state-style-map,
8
- $icon-size: $cx-default-input-icon-size,
9
- $width: $cx-default-textarea-width,
10
- $besm: $cx-besm
11
- ) {
12
- $block: map-get($besm, block);
13
- $element: map-get($besm, element);
14
- $state: map-get($besm, state);
15
- $mod: map-get($besm, mod);
16
-
17
-
18
- .#{$block}#{$name} {
19
- @include cxb-field(
20
- $besm,
21
- $state-style-map,
22
- $input: false
23
- );
24
- line-height: 0;
25
- width: $width;
26
- }
27
-
28
- .#{$element}#{$name}-input {
29
- @include cxe-field-input(
30
- $besm,
31
- $state-style-map,
32
- $placeholder: $placeholder,
33
- $input: false
34
- );
35
-
36
- width: 100%;
37
- height: 100%;
38
- }
39
-
40
- .#{$element}#{$name}-tool {
41
- @include cxe-field-button($besm, $tool-state-style-map);
42
- }
43
-
44
- .#{$element}#{$name}-icon {
45
- @include cxe-field-button-icon($besm, $icon-size);
46
- }
47
-
48
- .#{$element}#{$name}-empty-text {
49
- @include cxe-field-empty-text($empty-text);
50
- }
51
- }
52
-
53
- @if (cx-should-include('cx/widgets/TextArea')) {
54
- @include cx-textarea;
55
- }
56
-
57
-
58
-
59
-
60
-
1
+ @mixin cx-textarea(
2
+ $name: "textarea",
3
+ $state-style-map: $cx-textarea-state-style-map,
4
+ $placeholder: $cx-input-placeholder,
5
+ $empty-text: $cx-empty-text,
6
+ $tool-state-style-map: $cx-input-right-icon-state-style-map,
7
+ $icon-size: $cx-default-input-icon-size,
8
+ $width: $cx-default-textarea-width,
9
+ $besm: $cx-besm
10
+ ) {
11
+ $block: map-get($besm, block);
12
+ $element: map-get($besm, element);
13
+ $state: map-get($besm, state);
14
+ $mod: map-get($besm, mod);
15
+
16
+ .#{$block}#{$name} {
17
+ line-height: 0;
18
+ width: $width;
19
+ @include cxb-field($besm, $state-style-map, $input: false);
20
+ }
21
+
22
+ .#{$element}#{$name}-input {
23
+ width: 100%;
24
+ height: 100%;
25
+ @include cxe-field-input($besm, $state-style-map, $placeholder: $placeholder, $input: false);
26
+ }
27
+
28
+ .#{$element}#{$name}-tool {
29
+ @include cxe-field-button($besm, $tool-state-style-map);
30
+ }
31
+
32
+ .#{$element}#{$name}-icon {
33
+ @include cxe-field-button-icon($besm, $icon-size);
34
+ }
35
+
36
+ .#{$element}#{$name}-empty-text {
37
+ @include cxe-field-empty-text($empty-text);
38
+ }
39
+ }
40
+
41
+ @if (cx-should-include("cx/widgets/TextArea")) {
42
+ @include cx-textarea;
43
+ }