@broxus/react-uikit 0.5.0 → 0.5.2
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/dist/cjs/components/Subnav/index.scss +166 -186
- package/dist/cjs/components/Tab/index.d.ts +0 -0
- package/dist/cjs/components/Tab/index.js +1 -0
- package/dist/cjs/components/Tab/index.scss +216 -0
- package/dist/cjs/components/Text/index.d.ts +1 -1
- package/dist/cjs/components/Text/index.js +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/styles/_import.components.scss +1 -1
- package/dist/cjs/styles/_import.scss +1 -1
- package/dist/cjs/styles/mixins.scss +55 -0
- package/dist/cjs/styles/subnav.scss +1 -258
- package/dist/cjs/styles/variables.scss +20 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/utils/modal.js +15 -0
- package/dist/esm/components/Subnav/index.scss +166 -186
- package/dist/esm/components/Tab/index.d.ts +0 -0
- package/dist/esm/components/Tab/index.js +1 -0
- package/dist/esm/components/Tab/index.scss +216 -0
- package/dist/esm/components/Text/index.d.ts +1 -1
- package/dist/esm/components/Text/index.js +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/styles/_import.components.scss +1 -1
- package/dist/esm/styles/_import.scss +1 -1
- package/dist/esm/styles/mixins.scss +55 -0
- package/dist/esm/styles/subnav.scss +1 -258
- package/dist/esm/styles/variables.scss +20 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/utils/modal.js +16 -1
- package/package.json +1 -1
package/dist/cjs/utils/modal.js
CHANGED
|
@@ -8,9 +8,24 @@ const js_utils_1 = require("@broxus/js-utils");
|
|
|
8
8
|
const classnames_1 = __importDefault(require("classnames"));
|
|
9
9
|
function addModalMode(...args) {
|
|
10
10
|
(0, js_utils_1.addClass)(document?.documentElement, (0, classnames_1.default)(args ?? 'uk-modal-page'));
|
|
11
|
+
try {
|
|
12
|
+
const scrollWidth = (0, js_utils_1.getScrollWidth)();
|
|
13
|
+
if (document.documentElement.dir === 'rtl') {
|
|
14
|
+
document.documentElement.style.paddingLeft = `${scrollWidth}px`;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
document.documentElement.style.paddingRight = `${scrollWidth}px`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch { }
|
|
11
21
|
}
|
|
12
22
|
exports.addModalMode = addModalMode;
|
|
13
23
|
function removeModalMode(...args) {
|
|
14
24
|
(0, js_utils_1.removeClass)(document?.documentElement, (0, classnames_1.default)(args ?? 'uk-modal-page'));
|
|
25
|
+
try {
|
|
26
|
+
document.documentElement.style.paddingLeft = '';
|
|
27
|
+
document.documentElement.style.paddingRight = '';
|
|
28
|
+
}
|
|
29
|
+
catch { }
|
|
15
30
|
}
|
|
16
31
|
exports.removeModalMode = removeModalMode;
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
// Name:
|
|
2
|
-
// Description:
|
|
1
|
+
// Name: Subnav
|
|
2
|
+
// Description: Component to create a sub navigation
|
|
3
3
|
//
|
|
4
|
-
// Component: `uk-
|
|
4
|
+
// Component: `uk-subnav`
|
|
5
5
|
//
|
|
6
|
-
// Modifiers: `uk-
|
|
7
|
-
// `uk-
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
// `uk-
|
|
11
|
-
// `uk-list-muted`
|
|
12
|
-
// `uk-list-emphasis`
|
|
13
|
-
// `uk-list-primary`
|
|
14
|
-
// `uk-list-secondary`
|
|
15
|
-
// `uk-list-bullet`
|
|
16
|
-
// `uk-list-divider`
|
|
17
|
-
// `uk-list-striped`
|
|
18
|
-
// `uk-list-large`
|
|
19
|
-
// `uk-list-collapse`
|
|
6
|
+
// Modifiers: `uk-subnav-divider`
|
|
7
|
+
// `uk-subnav-pill`
|
|
8
|
+
//
|
|
9
|
+
// States: `uk-active`
|
|
10
|
+
// `uk-first-column`
|
|
20
11
|
//
|
|
21
12
|
// ========================================================================
|
|
22
13
|
|
|
@@ -28,219 +19,200 @@
|
|
|
28
19
|
|
|
29
20
|
|
|
30
21
|
/* ========================================================================
|
|
31
|
-
Component:
|
|
22
|
+
Component: Subnav
|
|
32
23
|
========================================================================== */
|
|
33
24
|
|
|
34
|
-
.uk-list {
|
|
35
|
-
list-style: none;
|
|
36
|
-
padding: 0;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/*
|
|
40
|
-
* Remove margin from the last-child
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
.uk-list > * > :last-child {
|
|
44
|
-
margin-bottom: 0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
25
|
/*
|
|
48
|
-
*
|
|
26
|
+
* 1. Allow items to wrap into the next line
|
|
27
|
+
* 2. Center items vertically if they have a different height
|
|
28
|
+
* 3. Gutter
|
|
29
|
+
* 4. Reset list
|
|
49
30
|
*/
|
|
50
31
|
|
|
51
|
-
.uk-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
32
|
+
.uk-subnav {
|
|
33
|
+
/* 2 */
|
|
34
|
+
align-items: center;
|
|
35
|
+
display: flex;
|
|
55
36
|
|
|
37
|
+
/* 1 */
|
|
38
|
+
flex-wrap: wrap;
|
|
39
|
+
list-style: none;
|
|
56
40
|
|
|
57
|
-
/*
|
|
58
|
-
*
|
|
59
|
-
* To style the `::marker` is currently only supported in Firefox and Safari
|
|
60
|
-
========================================================================== */
|
|
41
|
+
/* 3 */
|
|
42
|
+
margin-left: calc(var(--subnav-margin-horizontal) * -1);
|
|
61
43
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
padding-left: var(--list-padding-left);
|
|
44
|
+
/* 4 */
|
|
45
|
+
padding: 0;
|
|
46
|
+
@if mixin-exists(hook-subnav) {
|
|
47
|
+
@include hook-subnav;
|
|
48
|
+
}
|
|
68
49
|
}
|
|
69
50
|
|
|
70
51
|
/*
|
|
71
|
-
*
|
|
52
|
+
* 1. Space is allocated solely based on content dimensions: 0 0 auto
|
|
53
|
+
* 2. Gutter
|
|
54
|
+
* 3. Create position context for dropdowns
|
|
72
55
|
*/
|
|
73
56
|
|
|
74
|
-
.uk-
|
|
75
|
-
|
|
76
|
-
|
|
57
|
+
.uk-subnav > * {
|
|
58
|
+
/* 1 */
|
|
59
|
+
flex: none;
|
|
77
60
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
61
|
+
/* 2 */
|
|
62
|
+
padding-left: var(--subnav-margin-horizontal);
|
|
81
63
|
|
|
82
|
-
|
|
83
|
-
content: '';
|
|
84
|
-
display: list-item;
|
|
85
|
-
height: var(--list-marker-height);
|
|
86
|
-
left: calc(var(--list-padding-left) * -1);
|
|
87
|
-
list-style-position: inside;
|
|
88
|
-
margin-bottom: calc(var(--list-marker-height) * -1);
|
|
64
|
+
/* 3 */
|
|
89
65
|
position: relative;
|
|
90
|
-
text-align: right;
|
|
91
|
-
width: var(--list-padding-left);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.uk-list-disc > ::before {
|
|
95
|
-
list-style-type: disc;
|
|
96
66
|
}
|
|
97
67
|
|
|
98
|
-
.uk-list-circle > ::before {
|
|
99
|
-
list-style-type: circle;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.uk-list-square > ::before {
|
|
103
|
-
list-style-type: square;
|
|
104
|
-
}
|
|
105
68
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.uk-list-hyphen > ::before {
|
|
111
|
-
content: '–\00A0\00A0';
|
|
112
|
-
}
|
|
69
|
+
/* Items
|
|
70
|
+
========================================================================== */
|
|
113
71
|
|
|
114
72
|
/*
|
|
115
|
-
*
|
|
73
|
+
* Items must target `a` elements to exclude other elements (e.g. dropdowns)
|
|
74
|
+
* Using `:first-child` instead of `a` to support `span` elements for text
|
|
75
|
+
* 1. Center content vertically, e.g. an icon
|
|
76
|
+
* 2. Imitate white space gap when using flexbox
|
|
77
|
+
* 3. Style
|
|
116
78
|
*/
|
|
117
79
|
|
|
118
|
-
.uk-
|
|
119
|
-
|
|
120
|
-
}
|
|
80
|
+
.uk-subnav > * > :first-child {
|
|
81
|
+
align-items: center;
|
|
121
82
|
|
|
122
|
-
|
|
123
|
-
color: var(--
|
|
124
|
-
}
|
|
83
|
+
/* 3 */
|
|
84
|
+
color: var(--subnav-item-color);
|
|
125
85
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
86
|
+
/* 2 */
|
|
87
|
+
column-gap: 0.25em;
|
|
129
88
|
|
|
130
|
-
|
|
131
|
-
|
|
89
|
+
/* 1 */
|
|
90
|
+
display: flex;
|
|
91
|
+
@if mixin-exists(hook-subnav-item) {
|
|
92
|
+
@include hook-subnav-item;
|
|
93
|
+
}
|
|
132
94
|
}
|
|
133
95
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
96
|
+
/* Hover + Focus */
|
|
97
|
+
.uk-subnav > * > a:hover,
|
|
98
|
+
.uk-subnav > * > a:focus {
|
|
99
|
+
color: var(--subnav-item-hover-color);
|
|
100
|
+
outline: none;
|
|
101
|
+
text-decoration: var(--subnav-item-hover-text-decoration);
|
|
102
|
+
@if mixin-exists(hook-subnav-item-hover) {
|
|
103
|
+
@include hook-subnav-item-hover;
|
|
104
|
+
}
|
|
140
105
|
}
|
|
141
106
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
left: calc(var(--list-padding-left) * -1);
|
|
148
|
-
margin-bottom: calc(var(--list-marker-height) * -1);
|
|
149
|
-
position: relative;
|
|
150
|
-
width: var(--list-padding-left);
|
|
151
|
-
@if mixin-exists(svg-fill) {
|
|
152
|
-
@include svg-fill($list-bullet-icon-image-path, '#000', $list-bullet-icon-color);
|
|
107
|
+
/* Active */
|
|
108
|
+
.uk-subnav > .uk-active > a {
|
|
109
|
+
color: var(--subnav-item-active-color);
|
|
110
|
+
@if mixin-exists(hook-subnav-item-active) {
|
|
111
|
+
@include hook-subnav-item-active;
|
|
153
112
|
}
|
|
154
113
|
}
|
|
155
114
|
|
|
156
115
|
|
|
157
|
-
/*
|
|
116
|
+
/* Divider modifier
|
|
158
117
|
========================================================================== */
|
|
159
118
|
|
|
160
119
|
/*
|
|
161
|
-
*
|
|
120
|
+
* Set gutter
|
|
162
121
|
*/
|
|
163
122
|
|
|
164
|
-
.uk-
|
|
165
|
-
|
|
166
|
-
margin-top: var(--list-divider-margin-top);
|
|
167
|
-
padding-top: var(--list-divider-margin-top);
|
|
168
|
-
@if mixin-exists(hook-list-divider) {
|
|
169
|
-
@include hook-list-divider;
|
|
170
|
-
}
|
|
123
|
+
.uk-subnav-divider {
|
|
124
|
+
margin-left: calc((var(--subnav-divider-margin-horizontal) * 2 + var(--subnav-divider-border-width)) * -1);
|
|
171
125
|
}
|
|
172
126
|
|
|
173
127
|
/*
|
|
174
|
-
*
|
|
128
|
+
* Align items and divider vertically
|
|
175
129
|
*/
|
|
176
130
|
|
|
177
|
-
.uk-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
@include hook-list-striped;
|
|
181
|
-
}
|
|
131
|
+
.uk-subnav-divider > * {
|
|
132
|
+
align-items: center;
|
|
133
|
+
display: flex;
|
|
182
134
|
}
|
|
183
135
|
|
|
184
|
-
|
|
185
|
-
|
|
136
|
+
/*
|
|
137
|
+
* Divider
|
|
138
|
+
* 1. `nth-child` makes it also work without JS if it's only one row
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
.uk-subnav-divider > ::before {
|
|
142
|
+
border-left: var(--subnav-divider-border-width) solid transparent;
|
|
143
|
+
content: '';
|
|
144
|
+
height: var(--subnav-divider-border-height);
|
|
145
|
+
margin-left: calc(var(--subnav-divider-margin-horizontal) - var(subnav-margin-horizontal));
|
|
146
|
+
margin-right: var(--subnav-divider-margin-horizontal);
|
|
186
147
|
}
|
|
187
148
|
|
|
188
|
-
|
|
189
|
-
|
|
149
|
+
/* 1 */
|
|
150
|
+
.uk-subnav-divider > :nth-child(n+2):not(.uk-first-column)::before {
|
|
151
|
+
border-left-color: var(--subnav-divider-border);
|
|
152
|
+
@if mixin-exists(hook-subnav-divider) {
|
|
153
|
+
@include hook-subnav-divider;
|
|
154
|
+
}
|
|
190
155
|
}
|
|
191
156
|
|
|
192
157
|
|
|
193
|
-
/*
|
|
158
|
+
/* Pill modifier
|
|
194
159
|
========================================================================== */
|
|
195
160
|
|
|
196
|
-
.uk-
|
|
197
|
-
|
|
198
|
-
|
|
161
|
+
.uk-subnav-pill > * > :first-child {
|
|
162
|
+
background: var(--subnav-pill-item-background);
|
|
163
|
+
color: var(--subnav-pill-item-color);
|
|
164
|
+
padding: var(--subnav-pill-item-padding-vertical) var(--subnav-pill-item-padding-horizontal);
|
|
165
|
+
@if mixin-exists(hook-subnav-pill-item) {
|
|
166
|
+
@include hook-subnav-pill-item;
|
|
167
|
+
}
|
|
199
168
|
}
|
|
200
169
|
|
|
201
|
-
|
|
202
|
-
.uk-
|
|
203
|
-
|
|
170
|
+
/* Hover + Focus */
|
|
171
|
+
.uk-subnav-pill > * > a:hover,
|
|
172
|
+
.uk-subnav-pill > * > a:focus {
|
|
173
|
+
background-color: var(--subnav-pill-item-hover-background);
|
|
174
|
+
color: var(--subnav-pill-item-hover-color);
|
|
175
|
+
@if mixin-exists(hook-subnav-pill-item-hover) {
|
|
176
|
+
@include hook-subnav-pill-item-hover;
|
|
177
|
+
}
|
|
204
178
|
}
|
|
205
179
|
|
|
206
|
-
/*
|
|
207
|
-
*
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
180
|
+
/* OnClick */
|
|
181
|
+
.uk-subnav-pill > * > a:active {
|
|
182
|
+
background-color: var(--subnav-pill-item-onclick-background);
|
|
183
|
+
color: var(--subnav-pill-item-onclick-color);
|
|
184
|
+
@if mixin-exists(hook-subnav-pill-item-onclick) {
|
|
185
|
+
@include hook-subnav-pill-item-onclick;
|
|
186
|
+
}
|
|
213
187
|
}
|
|
214
188
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
189
|
+
/* Active */
|
|
190
|
+
.uk-subnav-pill > .uk-active > a {
|
|
191
|
+
background-color: var(--subnav-pill-item-active-background);
|
|
192
|
+
color: var(--subnav-pill-item-active-color);
|
|
193
|
+
@if mixin-exists(hook-subnav-pill-item-active) {
|
|
194
|
+
@include hook-subnav-pill-item-active;
|
|
195
|
+
}
|
|
218
196
|
}
|
|
219
197
|
|
|
220
|
-
/*
|
|
221
|
-
* Striped
|
|
222
|
-
*/
|
|
223
|
-
|
|
224
|
-
.uk-list-large.uk-list-striped > * {
|
|
225
|
-
padding: var(--list-large-striped-padding-vertical) var(--list-large-striped-padding-horizontal);
|
|
226
|
-
}
|
|
227
198
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
199
|
+
/* Disabled
|
|
200
|
+
* The same for all style modifiers
|
|
201
|
+
========================================================================== */
|
|
232
202
|
|
|
233
|
-
.uk-
|
|
234
|
-
|
|
235
|
-
|
|
203
|
+
.uk-subnav > .uk-disabled > a {
|
|
204
|
+
color: var(--subnav-item-disabled-color);
|
|
205
|
+
@if mixin-exists(hook-subnav-item-disabled) {
|
|
206
|
+
@include hook-subnav-item-disabled;
|
|
207
|
+
}
|
|
236
208
|
}
|
|
237
209
|
|
|
238
210
|
|
|
239
211
|
// Hooks
|
|
240
212
|
// ========================================================================
|
|
241
213
|
|
|
242
|
-
@if mixin-exists(hook-
|
|
243
|
-
@include hook-
|
|
214
|
+
@if mixin-exists(hook-subnav-misc) {
|
|
215
|
+
@include hook-subnav-misc;
|
|
244
216
|
}
|
|
245
217
|
|
|
246
218
|
|
|
@@ -248,31 +220,39 @@
|
|
|
248
220
|
// ========================================================================
|
|
249
221
|
|
|
250
222
|
:root {
|
|
251
|
-
--
|
|
252
|
-
--
|
|
253
|
-
--
|
|
254
|
-
--
|
|
255
|
-
--
|
|
256
|
-
--
|
|
257
|
-
--
|
|
258
|
-
--
|
|
259
|
-
--
|
|
260
|
-
--
|
|
261
|
-
--
|
|
262
|
-
--
|
|
263
|
-
--
|
|
264
|
-
--
|
|
265
|
-
--
|
|
266
|
-
--
|
|
267
|
-
--
|
|
268
|
-
--
|
|
223
|
+
--subnav-margin-horizontal: #{$subnav-margin-horizontal};
|
|
224
|
+
--subnav-item-color: var(--global-muted-color);
|
|
225
|
+
--subnav-item-hover-color: var(--global-color);
|
|
226
|
+
--subnav-item-hover-text-decoration: #{$subnav-item-hover-text-decoration};
|
|
227
|
+
--subnav-item-active-color: var(--global-emphasis-color);
|
|
228
|
+
--subnav-divider-margin-horizontal: #{$subnav-margin-horizontal};
|
|
229
|
+
--subnav-divider-border-height: #{$subnav-divider-border-height};
|
|
230
|
+
--subnav-divider-border-width: var(--global-border-width);
|
|
231
|
+
--subnav-divider-border: var(--global-border);
|
|
232
|
+
--subnav-pill-item-padding-vertical: #{$subnav-pill-item-padding-vertical};
|
|
233
|
+
--subnav-pill-item-padding-horizontal: #{$subnav-pill-item-padding-horizontal};
|
|
234
|
+
--subnav-pill-item-background: #{$subnav-pill-item-background};
|
|
235
|
+
--subnav-pill-item-color: #{$subnav-item-color};
|
|
236
|
+
--subnav-pill-item-hover-background: var(--global-muted-background);
|
|
237
|
+
--subnav-pill-item-hover-color: var(--global-color);
|
|
238
|
+
--subnav-pill-item-onclick-background: #{$subnav-pill-item-hover-background};
|
|
239
|
+
--subnav-pill-item-onclick-color: #{$subnav-pill-item-hover-color};
|
|
240
|
+
--subnav-pill-item-active-background: var(--global-primary-background);
|
|
241
|
+
--subnav-pill-item-active-color: var(--global-inverse-color);
|
|
242
|
+
--subnav-item-disabled-color: var(--global-muted-color);
|
|
269
243
|
|
|
270
244
|
// Inverse
|
|
271
|
-
--inverse-
|
|
272
|
-
--inverse-
|
|
273
|
-
--inverse-
|
|
274
|
-
--inverse-
|
|
275
|
-
--inverse-
|
|
276
|
-
--inverse-
|
|
277
|
-
--inverse-
|
|
245
|
+
--inverse-subnav-item-color: var(--inverse-global-muted-color);
|
|
246
|
+
--inverse-subnav-item-hover-color: var(--inverse-global-color);
|
|
247
|
+
--inverse-subnav-item-active-color: var(--inverse-global-emphasis-color);
|
|
248
|
+
--inverse-subnav-divider-border: var(--inverse-global-border);
|
|
249
|
+
--inverse-subnav-pill-item-background: #{$inverse-subnav-pill-item-background};
|
|
250
|
+
--inverse-subnav-pill-item-color: var(--inverse-global-muted-color);
|
|
251
|
+
--inverse-subnav-pill-item-hover-background: var(--inverse-global-muted-background);
|
|
252
|
+
--inverse-subnav-pill-item-hover-color: var(--inverse-global-color);
|
|
253
|
+
--inverse-subnav-pill-item-onclick-background: #{$inverse-subnav-pill-item-hover-background};
|
|
254
|
+
--inverse-subnav-pill-item-onclick-color: #{$inverse-subnav-pill-item-hover-color};
|
|
255
|
+
--inverse-subnav-pill-item-active-background: var(--inverse-global-primary-background);
|
|
256
|
+
--inverse-subnav-pill-item-active-color: var(--inverse-global-inverse-color);
|
|
257
|
+
--inverse-subnav-item-disabled-color: var(--inverse-global-muted-color);
|
|
278
258
|
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|