@rescui/dropdown 0.1.0 → 0.2.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/lib/custom-modifiers.d.ts +2 -2
- package/lib/custom-modifiers.js +6 -6
- package/lib/dropdown.js +1 -2
- package/lib/index.css +34 -34
- package/lib/index.module.pcss.js +11 -11
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Modifier } from
|
|
2
|
-
import { Property } from
|
|
1
|
+
import type { Modifier } from 'react-popper';
|
|
2
|
+
import { Property } from 'csstype';
|
|
3
3
|
export declare type DropdownMaxWidth = 'trigger' | Property.MaxWidth;
|
|
4
4
|
export declare type DropdownMinWidth = 'trigger' | Property.MinWidth;
|
|
5
5
|
export declare const sameWidthModifier: Modifier<'sameWidth', {
|
package/lib/custom-modifiers.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function getMaxWidth(dropdownMaxWidth, referenceWidth) {
|
|
2
|
-
if (dropdownMaxWidth ===
|
|
3
|
-
return referenceWidth
|
|
4
|
-
} else if (typeof dropdownMaxWidth ===
|
|
5
|
-
return dropdownMaxWidth
|
|
2
|
+
if (dropdownMaxWidth === 'trigger') {
|
|
3
|
+
return "".concat(referenceWidth, "px");
|
|
4
|
+
} else if (typeof dropdownMaxWidth === 'number') {
|
|
5
|
+
return "".concat(dropdownMaxWidth, "px");
|
|
6
6
|
} else if (dropdownMaxWidth) {
|
|
7
7
|
return dropdownMaxWidth;
|
|
8
8
|
}
|
|
@@ -12,11 +12,11 @@ function getMaxWidth(dropdownMaxWidth, referenceWidth) {
|
|
|
12
12
|
|
|
13
13
|
function getMinWidth(dropdownMinWidth, referenceWidth) {
|
|
14
14
|
if (dropdownMinWidth === 'trigger') {
|
|
15
|
-
return referenceWidth
|
|
15
|
+
return "".concat(referenceWidth, "px");
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
if (typeof dropdownMinWidth === 'number') {
|
|
19
|
-
return dropdownMinWidth
|
|
19
|
+
return "".concat(dropdownMinWidth, "px");
|
|
20
20
|
} else if (dropdownMinWidth) {
|
|
21
21
|
return dropdownMinWidth;
|
|
22
22
|
}
|
package/lib/dropdown.js
CHANGED
|
@@ -14,7 +14,6 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
|
14
14
|
import _toConsumableArray from "@babel/runtime-corejs3/helpers/esm/toConsumableArray";
|
|
15
15
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
16
16
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
17
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
18
17
|
|
|
19
18
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
20
19
|
|
|
@@ -191,7 +190,7 @@ var DropdownRender = function DropdownRender(_ref4, externalRef) {
|
|
|
191
190
|
}, trigger);
|
|
192
191
|
var dropdownShouldBeRendered = dropdownState !== DROPDOWN_STATES.CLOSE;
|
|
193
192
|
var wrapperShouldBeHidden = dropdownState === DROPDOWN_STATES.CLOSING;
|
|
194
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, triggerRenderer, dropdownShouldBeRendered && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement("div",
|
|
193
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, triggerRenderer, dropdownShouldBeRendered && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement("div", _objectSpread({
|
|
195
194
|
ref: setPopperRef,
|
|
196
195
|
style: _objectSpread(_objectSpread({
|
|
197
196
|
maxHeight: maxHeight
|
package/lib/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@-webkit-keyframes
|
|
1
|
+
@-webkit-keyframes _fadeInTopToBottom_15q2o93_1{
|
|
2
2
|
0%{
|
|
3
3
|
opacity:0;
|
|
4
4
|
-webkit-transform:translateY(-10px);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
transform:none;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
@keyframes
|
|
13
|
+
@keyframes _fadeInTopToBottom_15q2o93_1{
|
|
14
14
|
0%{
|
|
15
15
|
opacity:0;
|
|
16
16
|
-webkit-transform:translateY(-10px);
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
transform:none;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
@-webkit-keyframes
|
|
25
|
+
@-webkit-keyframes _fadeInBottomToTop_15q2o93_1{
|
|
26
26
|
0%{
|
|
27
27
|
opacity:0;
|
|
28
28
|
-webkit-transform:translateY(10px);
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
transform:none;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
@keyframes
|
|
37
|
+
@keyframes _fadeInBottomToTop_15q2o93_1{
|
|
38
38
|
0%{
|
|
39
39
|
opacity:0;
|
|
40
40
|
-webkit-transform:translateY(10px);
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
transform:none;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
@-webkit-keyframes
|
|
49
|
+
@-webkit-keyframes _fadeInLeftToRight_15q2o93_1{
|
|
50
50
|
0%{
|
|
51
51
|
opacity:0;
|
|
52
52
|
-webkit-transform:translateX(-10px);
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
transform:none;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
@keyframes
|
|
61
|
+
@keyframes _fadeInLeftToRight_15q2o93_1{
|
|
62
62
|
0%{
|
|
63
63
|
opacity:0;
|
|
64
64
|
-webkit-transform:translateX(-10px);
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
transform:none;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
@-webkit-keyframes
|
|
73
|
+
@-webkit-keyframes _fadeInRightToLeft_15q2o93_1{
|
|
74
74
|
0%{
|
|
75
75
|
opacity:0;
|
|
76
76
|
-webkit-transform:translateX(10px);
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
transform:none;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
@keyframes
|
|
85
|
+
@keyframes _fadeInRightToLeft_15q2o93_1{
|
|
86
86
|
0%{
|
|
87
87
|
opacity:0;
|
|
88
88
|
-webkit-transform:translateX(10px);
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
transform:none;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
.
|
|
97
|
+
._dropdown_15q2o93_50{
|
|
98
98
|
display:-webkit-box;
|
|
99
99
|
display:-ms-flexbox;
|
|
100
100
|
display:flex;
|
|
@@ -103,10 +103,10 @@
|
|
|
103
103
|
-ms-flex-direction:column;
|
|
104
104
|
flex-direction:column;
|
|
105
105
|
}
|
|
106
|
-
.
|
|
106
|
+
._triggerWrapper_15q2o93_55{
|
|
107
107
|
display:inline-block;
|
|
108
108
|
}
|
|
109
|
-
.
|
|
109
|
+
._contentWrapper_15q2o93_59{
|
|
110
110
|
display:block;
|
|
111
111
|
-webkit-box-sizing:border-box;
|
|
112
112
|
box-sizing:border-box;
|
|
@@ -120,56 +120,56 @@
|
|
|
120
120
|
transition:opacity linear 200ms, transform linear 200ms;
|
|
121
121
|
transition:opacity linear 200ms, transform linear 200ms, -webkit-transform linear 200ms;
|
|
122
122
|
}
|
|
123
|
-
[data-popper-placement^="top" ] .
|
|
124
|
-
-webkit-animation:
|
|
125
|
-
animation:
|
|
123
|
+
[data-popper-placement^="top" ] ._contentWrapper_15q2o93_59{
|
|
124
|
+
-webkit-animation:_fadeInBottomToTop_15q2o93_1 ease 200ms;
|
|
125
|
+
animation:_fadeInBottomToTop_15q2o93_1 ease 200ms;
|
|
126
126
|
}
|
|
127
|
-
[data-popper-placement^="bottom" ] .
|
|
128
|
-
-webkit-animation:
|
|
129
|
-
animation:
|
|
127
|
+
[data-popper-placement^="bottom" ] ._contentWrapper_15q2o93_59{
|
|
128
|
+
-webkit-animation:_fadeInTopToBottom_15q2o93_1 ease 200ms;
|
|
129
|
+
animation:_fadeInTopToBottom_15q2o93_1 ease 200ms;
|
|
130
130
|
}
|
|
131
|
-
[data-popper-placement^="right"] .
|
|
132
|
-
-webkit-animation:
|
|
133
|
-
animation:
|
|
131
|
+
[data-popper-placement^="right"] ._contentWrapper_15q2o93_59{
|
|
132
|
+
-webkit-animation:_fadeInLeftToRight_15q2o93_1 ease 200ms;
|
|
133
|
+
animation:_fadeInLeftToRight_15q2o93_1 ease 200ms;
|
|
134
134
|
}
|
|
135
|
-
[data-popper-placement^="left"] .
|
|
136
|
-
-webkit-animation:
|
|
137
|
-
animation:
|
|
135
|
+
[data-popper-placement^="left"] ._contentWrapper_15q2o93_59{
|
|
136
|
+
-webkit-animation:_fadeInRightToLeft_15q2o93_1 ease 200ms;
|
|
137
|
+
animation:_fadeInRightToLeft_15q2o93_1 ease 200ms;
|
|
138
138
|
}
|
|
139
|
-
.
|
|
139
|
+
._wrapperHidden_15q2o93_86{
|
|
140
140
|
opacity:0;
|
|
141
141
|
}
|
|
142
|
-
[data-popper-placement^="top" ] .
|
|
142
|
+
[data-popper-placement^="top" ] ._wrapperHidden_15q2o93_86{
|
|
143
143
|
-webkit-transform:translateY(10px);
|
|
144
144
|
transform:translateY(10px);
|
|
145
145
|
}
|
|
146
|
-
[data-popper-placement^="bottom" ] .
|
|
146
|
+
[data-popper-placement^="bottom" ] ._wrapperHidden_15q2o93_86{
|
|
147
147
|
-webkit-transform:translateY(-10px);
|
|
148
148
|
transform:translateY(-10px);
|
|
149
149
|
}
|
|
150
|
-
[data-popper-placement^="right"] .
|
|
150
|
+
[data-popper-placement^="right"] ._wrapperHidden_15q2o93_86{
|
|
151
151
|
-webkit-transform:translateX(-10px);
|
|
152
152
|
transform:translateX(-10px);
|
|
153
153
|
}
|
|
154
|
-
[data-popper-placement^="left"] .
|
|
154
|
+
[data-popper-placement^="left"] ._wrapperHidden_15q2o93_86{
|
|
155
155
|
-webkit-transform:translateX(10px);
|
|
156
156
|
transform:translateX(10px);
|
|
157
157
|
}
|
|
158
|
-
.
|
|
158
|
+
._themeLight_15q2o93_106 ._contentWrapper_15q2o93_59{
|
|
159
159
|
background-color:#FFFFFF;
|
|
160
160
|
border-color:rgba(25,25,28,0.2);
|
|
161
161
|
}
|
|
162
|
-
.
|
|
162
|
+
._themeLight_15q2o93_106._modeRock_15q2o93_111 ._contentWrapper_15q2o93_59{
|
|
163
163
|
background-color:#19191C;
|
|
164
164
|
}
|
|
165
|
-
.
|
|
165
|
+
._themeDark_15q2o93_115 ._contentWrapper_15q2o93_59{
|
|
166
166
|
background-color:#303033;
|
|
167
167
|
border-color:rgba(255,255,255,0.2);
|
|
168
168
|
}
|
|
169
|
-
.
|
|
169
|
+
._themeDark_15q2o93_115._modeRock_15q2o93_111 ._contentWrapper_15q2o93_59{
|
|
170
170
|
background-color:#FFFFFF;
|
|
171
171
|
}
|
|
172
|
-
.
|
|
172
|
+
._modeRock_15q2o93_111{
|
|
173
173
|
--rs-parent-color-primary-light-theme:var(--rs-color-primary-light-theme);
|
|
174
174
|
--rs-parent-color-primary-dim-light-theme:var(--rs-color-primary-dim-light-theme);
|
|
175
175
|
--rs-parent-color-primary-fog-light-theme:var(--rs-color-primary-fog-light-theme);
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
--rs-parent-color-primary-t-dim-dark-theme:var(--rs-color-primary-t-dim-dark-theme);
|
|
183
183
|
--rs-parent-color-primary-t-fog-dark-theme:var(--rs-color-primary-t-fog-dark-theme);
|
|
184
184
|
}
|
|
185
|
-
.
|
|
185
|
+
._modeRock_15q2o93_111 > *{
|
|
186
186
|
--rs-color-primary-dark-theme:var(--rs-parent-color-primary-light-theme);
|
|
187
187
|
--rs-color-primary-dim-dark-theme:var(--rs-parent-color-primary-dim-light-theme);
|
|
188
188
|
--rs-color-primary-fog-dark-theme:var(--rs-parent-color-primary-fog-light-theme);
|
package/lib/index.module.pcss.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"dropdown": "
|
|
3
|
-
"triggerWrapper": "
|
|
4
|
-
"contentWrapper": "
|
|
5
|
-
"fadeInBottomToTop": "
|
|
6
|
-
"fadeInTopToBottom": "
|
|
7
|
-
"fadeInLeftToRight": "
|
|
8
|
-
"fadeInRightToLeft": "
|
|
9
|
-
"wrapperHidden": "
|
|
10
|
-
"themeLight": "
|
|
11
|
-
"modeRock": "
|
|
12
|
-
"themeDark": "
|
|
2
|
+
"dropdown": "_dropdown_15q2o93_50",
|
|
3
|
+
"triggerWrapper": "_triggerWrapper_15q2o93_55",
|
|
4
|
+
"contentWrapper": "_contentWrapper_15q2o93_59",
|
|
5
|
+
"fadeInBottomToTop": "_fadeInBottomToTop_15q2o93_1",
|
|
6
|
+
"fadeInTopToBottom": "_fadeInTopToBottom_15q2o93_1",
|
|
7
|
+
"fadeInLeftToRight": "_fadeInLeftToRight_15q2o93_1",
|
|
8
|
+
"fadeInRightToLeft": "_fadeInRightToLeft_15q2o93_1",
|
|
9
|
+
"wrapperHidden": "_wrapperHidden_15q2o93_86",
|
|
10
|
+
"themeLight": "_themeLight_15q2o93_106",
|
|
11
|
+
"modeRock": "_modeRock_15q2o93_111",
|
|
12
|
+
"themeDark": "_themeDark_15q2o93_115"
|
|
13
13
|
};
|
|
14
14
|
export default styles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescui/dropdown",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "JetBrains",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"react-dom": ">=16.8.0 <18"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@rescui/colors": "^0.0.
|
|
32
|
-
"@rescui/scripts": "^0.1.
|
|
33
|
-
"@rescui/typography": "^0.
|
|
31
|
+
"@rescui/colors": "^0.0.6",
|
|
32
|
+
"@rescui/scripts": "^0.1.4",
|
|
33
|
+
"@rescui/typography": "^0.4.0",
|
|
34
34
|
"@rescui/visual-regression": "^0.0.1"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "rescui-scripts build"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "6b1d206de2641861028760d73f33dee214c07911"
|
|
40
40
|
}
|