@broxus/react-uikit 0.5.0 → 0.5.1

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.
@@ -18,4 +18,4 @@ export type TextOwnProps = {
18
18
  wrap?: 'truncate' | 'break' | 'nowrap';
19
19
  };
20
20
  export type TextProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<TextOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, TextOwnProps>;
21
- export declare const Text: React.MemoExoticComponent<(<E extends React.ElementType<any> = "p">(props: TextProps<E>) => React.JSX.Element)>;
21
+ export declare const Text: React.MemoExoticComponent<(<E extends React.ElementType<any> = "span">(props: TextProps<E>) => React.JSX.Element)>;
@@ -32,7 +32,7 @@ const React = __importStar(require("react"));
32
32
  const Component_1 = require("../../components/Component");
33
33
  const ConfigProvider_1 = require("../../components/ConfigProvider");
34
34
  const utils_1 = require("../../utils");
35
- const defaultElement = 'p';
35
+ const defaultElement = 'span';
36
36
  exports.Text = React.memo((props) => {
37
37
  const config = (0, ConfigProvider_1.useConfig)();
38
38
  const { align, className, color, column, decoration, dropcap, italic, prefixCls = config.prefixCls, size, transform, verticalAlign, weight, wrap, ...restProps } = props;
@@ -22,6 +22,7 @@ export * from './components/Tile';
22
22
  export * from './components/Card';
23
23
  export * from './components/Nav';
24
24
  export * from './components/Navbar';
25
+ export * from './components/Subnav';
25
26
  export * from './components/Breadcrumb';
26
27
  export * from './components/Tabs';
27
28
  export * from './components/Dotnav';
package/dist/cjs/index.js CHANGED
@@ -38,6 +38,7 @@ __exportStar(require("./components/Tile"), exports);
38
38
  __exportStar(require("./components/Card"), exports);
39
39
  __exportStar(require("./components/Nav"), exports);
40
40
  __exportStar(require("./components/Navbar"), exports);
41
+ __exportStar(require("./components/Subnav"), exports);
41
42
  __exportStar(require("./components/Breadcrumb"), exports);
42
43
  __exportStar(require("./components/Tabs"), exports);
43
44
  __exportStar(require("./components/Dotnav"), exports);
@@ -43,7 +43,7 @@
43
43
  // Navs
44
44
  @import 'nav.scss';
45
45
  @import 'navbar.scss'; // After: Card, Grid, Nav, Icon, Search
46
- // @import 'subnav.scss';
46
+ @import 'subnav.scss';
47
47
  @import 'breadcrumb.scss';
48
48
 
49
49
  // @import 'pagination.scss';
@@ -59,7 +59,7 @@
59
59
  // Navs
60
60
  @import 'nav.scss';
61
61
  @import 'navbar.scss'; // After: Card, Grid, Nav, Icon, Search
62
- // @import 'subnav.scss';
62
+ @import 'subnav.scss';
63
63
  @import 'breadcrumb.scss';
64
64
 
65
65
  // @import 'pagination.scss';
@@ -1,258 +1 @@
1
- // Name: Subnav
2
- // Description: Component to create a sub navigation
3
- //
4
- // Component: `uk-subnav`
5
- //
6
- // Modifiers: `uk-subnav-divider`
7
- // `uk-subnav-pill`
8
- //
9
- // States: `uk-active`
10
- // `uk-first-column`
11
- //
12
- // ========================================================================
13
-
14
-
15
- // Variables
16
- // ========================================================================
17
-
18
- @import 'variables.scss';
19
-
20
-
21
- /* ========================================================================
22
- Component: Subnav
23
- ========================================================================== */
24
-
25
- /*
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
30
- */
31
-
32
- .uk-subnav {
33
- /* 2 */
34
- align-items: center;
35
- display: flex;
36
-
37
- /* 1 */
38
- flex-wrap: wrap;
39
- list-style: none;
40
-
41
- /* 3 */
42
- margin-left: calc(var(--subnav-margin-horizontal) * -1);
43
-
44
- /* 4 */
45
- padding: 0;
46
- @if mixin-exists(hook-subnav) {
47
- @include hook-subnav;
48
- }
49
- }
50
-
51
- /*
52
- * 1. Space is allocated solely based on content dimensions: 0 0 auto
53
- * 2. Gutter
54
- * 3. Create position context for dropdowns
55
- */
56
-
57
- .uk-subnav > * {
58
- /* 1 */
59
- flex: none;
60
-
61
- /* 2 */
62
- padding-left: var(--subnav-margin-horizontal);
63
-
64
- /* 3 */
65
- position: relative;
66
- }
67
-
68
-
69
- /* Items
70
- ========================================================================== */
71
-
72
- /*
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
78
- */
79
-
80
- .uk-subnav > * > :first-child {
81
- align-items: center;
82
-
83
- /* 3 */
84
- color: var(--subnav-item-color);
85
-
86
- /* 2 */
87
- column-gap: 0.25em;
88
-
89
- /* 1 */
90
- display: flex;
91
- @if mixin-exists(hook-subnav-item) {
92
- @include hook-subnav-item;
93
- }
94
- }
95
-
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
- }
105
- }
106
-
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;
112
- }
113
- }
114
-
115
-
116
- /* Divider modifier
117
- ========================================================================== */
118
-
119
- /*
120
- * Set gutter
121
- */
122
-
123
- .uk-subnav-divider {
124
- margin-left: calc((var(--subnav-divider-margin-horizontal) * 2 + var(--subnav-divider-border-width)) * -1);
125
- }
126
-
127
- /*
128
- * Align items and divider vertically
129
- */
130
-
131
- .uk-subnav-divider > * {
132
- align-items: center;
133
- display: flex;
134
- }
135
-
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);
147
- }
148
-
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
- }
155
- }
156
-
157
-
158
- /* Pill modifier
159
- ========================================================================== */
160
-
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
- }
168
- }
169
-
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
- }
178
- }
179
-
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
- }
187
- }
188
-
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
- }
196
- }
197
-
198
-
199
- /* Disabled
200
- * The same for all style modifiers
201
- ========================================================================== */
202
-
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
- }
208
- }
209
-
210
-
211
- // Hooks
212
- // ========================================================================
213
-
214
- @if mixin-exists(hook-subnav-misc) {
215
- @include hook-subnav-misc;
216
- }
217
-
218
-
219
- // Vars
220
- // ========================================================================
221
-
222
- :root {
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);
243
-
244
- // 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);
258
- }
1
+ @import '../components/Subnav/index.scss';