@broxus/react-uikit 0.2.0 → 0.2.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.
Files changed (39) hide show
  1. package/dist/cjs/components/Accordion/Item.js +3 -2
  2. package/dist/cjs/components/Accordion/index.d.ts +2 -2
  3. package/dist/cjs/components/Control/Checkbox/Checkbox.js +4 -2
  4. package/dist/cjs/components/Control/Checkbox/index.scss +8 -6
  5. package/dist/cjs/components/Control/Radio/Radio.js +2 -1
  6. package/dist/cjs/components/Control/Radio/index.d.ts +2 -2
  7. package/dist/cjs/components/Control/Radio/index.scss +8 -5
  8. package/dist/cjs/components/Control/TextArea/index.scss +9 -0
  9. package/dist/cjs/components/Control/index.scss +6 -0
  10. package/dist/cjs/components/Flex/index.d.ts +2 -2
  11. package/dist/cjs/components/Nav/utils/motionUtil.d.ts +4 -1
  12. package/dist/cjs/components/Navbar/Nav.d.ts +0 -1
  13. package/dist/cjs/components/Tabs/index.js +2 -2
  14. package/dist/cjs/components/Tabs/index.scss +4 -0
  15. package/dist/cjs/styles/mixins.scss +17 -9
  16. package/dist/cjs/styles/variables.scss +3 -1
  17. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  18. package/dist/cjs/utils/get-breakpoints-config-classes.d.ts +1 -1
  19. package/dist/cjs/utils/get-breakpoints-config-classes.js +1 -1
  20. package/dist/esm/components/Accordion/Item.js +3 -2
  21. package/dist/esm/components/Accordion/index.d.ts +2 -2
  22. package/dist/esm/components/Control/Checkbox/Checkbox.js +4 -2
  23. package/dist/esm/components/Control/Checkbox/index.scss +8 -6
  24. package/dist/esm/components/Control/Radio/Radio.js +2 -1
  25. package/dist/esm/components/Control/Radio/index.d.ts +2 -2
  26. package/dist/esm/components/Control/Radio/index.scss +8 -5
  27. package/dist/esm/components/Control/TextArea/index.scss +9 -0
  28. package/dist/esm/components/Control/index.scss +6 -0
  29. package/dist/esm/components/Flex/index.d.ts +2 -2
  30. package/dist/esm/components/Nav/utils/motionUtil.d.ts +4 -1
  31. package/dist/esm/components/Navbar/Nav.d.ts +0 -1
  32. package/dist/esm/components/Tabs/index.js +2 -2
  33. package/dist/esm/components/Tabs/index.scss +4 -0
  34. package/dist/esm/styles/mixins.scss +17 -9
  35. package/dist/esm/styles/variables.scss +3 -1
  36. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  37. package/dist/esm/utils/get-breakpoints-config-classes.d.ts +1 -1
  38. package/dist/esm/utils/get-breakpoints-config-classes.js +1 -1
  39. package/package.json +12 -12
@@ -29,8 +29,9 @@ const rc_collapse_1 = require("rc-collapse");
29
29
  const Icon_1 = require("../Icon");
30
30
  exports.Item = React.memo((props) => {
31
31
  const { expandIcon, ...restProps } = props;
32
- const mergedExpandIcon = React.useMemo(() => (expandIcon || (({ isActive }) => (React.createElement(Icon_1.Icon, { icon: isActive ? 'expand_more' : 'chevron_right' })))), [expandIcon]);
33
- return React.createElement(rc_collapse_1.Panel, { expandIcon: mergedExpandIcon, ...restProps });
32
+ const mergedExpandIcon = React.useMemo(() => expandIcon ||
33
+ (({ isActive }) => (React.createElement(Icon_1.Icon, { icon: isActive ? 'expand_more' : 'chevron_right' }))), [expandIcon]);
34
+ return React.createElement(rc_collapse_1.Panel, { expandIcon: mergedExpandIcon, ...restProps, headerClass: "fsds" });
34
35
  });
35
36
  if (process.env.NODE_ENV !== 'production') {
36
37
  exports.Item.displayName = 'Accordion.Item';
@@ -1,8 +1,8 @@
1
1
  import type * as React from 'react';
2
2
  import { type AccordionProps } from '../Accordion/Accordion';
3
- import { Item } from '../Accordion/Item';
3
+ import { Item, type AccordionItemProps } from '../Accordion/Item';
4
4
  import './index.scss';
5
- export type { AccordionProps };
5
+ export type { AccordionProps, AccordionItemProps };
6
6
  export interface Accordion extends React.MemoExoticComponent<React.FunctionComponent<AccordionProps>> {
7
7
  Item: typeof Item;
8
8
  }
@@ -91,7 +91,8 @@ const ForwardedCheckbox = React.forwardRef((props, ref) => {
91
91
  const globalAttributes = React.useMemo(() => (0, js_utils_1.retrieveGlobalAttributes)(restProps), [restProps]);
92
92
  React.useEffect(() => {
93
93
  checkboxGroup?.registerValue(restProps.value);
94
- }, [checkboxGroup, restProps.value]);
94
+ // eslint-disable-next-line react-hooks/exhaustive-deps
95
+ }, [restProps.value]);
95
96
  React.useEffect(() => {
96
97
  if (skipGroup) {
97
98
  return;
@@ -102,7 +103,8 @@ const ForwardedCheckbox = React.forwardRef((props, ref) => {
102
103
  }
103
104
  // eslint-disable-next-line consistent-return
104
105
  return () => checkboxGroup?.cancelValue(restProps.value);
105
- }, [checkboxGroup, restProps.value, skipGroup]);
106
+ // eslint-disable-next-line react-hooks/exhaustive-deps
107
+ }, [restProps.value, skipGroup]);
106
108
  React.useEffect(() => {
107
109
  setInternalChecked(restProps.checked || restProps.defaultChecked);
108
110
  }, [restProps.checked, restProps.defaultChecked]);
@@ -21,6 +21,11 @@
21
21
  display: flex;
22
22
  line-height: unset;
23
23
  user-select: none;
24
+
25
+ &.uk-control {
26
+ background-color: var(--checkbox-control-background);
27
+ }
28
+
24
29
  @if mixin-exists(hook-checkbox-wrapper) {
25
30
  @include hook-checkbox-wrapper;
26
31
  }
@@ -28,7 +33,6 @@
28
33
 
29
34
  .uk-checkbox-wrapper .uk-checkbox {
30
35
  border: 0;
31
- border-radius: var(--checkbox-border-radius);
32
36
  display: inline-block;
33
37
  height: var(--checkbox-size);
34
38
  line-height: 1;
@@ -48,16 +52,13 @@
48
52
  -webkit-appearance: none;
49
53
  -moz-appearance: none;
50
54
  appearance: none;
51
- bottom: 0;
52
55
  cursor: pointer;
53
56
  height: 100%;
54
- left: 0;
57
+ inset: 0;
55
58
  margin: 0;
56
59
  opacity: 0;
57
60
  outline: none;
58
61
  position: absolute;
59
- right: 0;
60
- top: 0;
61
62
  width: 100%;
62
63
  z-index: 1;
63
64
  @if mixin-exists(hook-checkbox-input) {
@@ -66,7 +67,7 @@
66
67
  }
67
68
 
68
69
  .uk-checkbox-wrapper .uk-checkbox-inner {
69
- background-color: transparent;
70
+ background-color: var(--checkbox-background);
70
71
  border: var(--checkbox-border-width) solid var(--checkbox-border);
71
72
  border-collapse: separate;
72
73
  border-radius: var(--checkbox-border-radius);
@@ -310,6 +311,7 @@
310
311
  --checkbox-checked-background: var(--global-primary-background);
311
312
  --checkbox-checked-border: var(--global-primary-border);
312
313
  --checkbox-checked-icon-color: var(--global-inverse-color);
314
+ --checkbox-control-background: #{$checkbox-control-background};
313
315
  --checkbox-checked-control-background: #{$checkbox-checked-control-background};
314
316
  --checkbox-checked-control-color: #{$checkbox-checked-control-color};
315
317
  --checkbox-checked-control-padding: #{$checkbox-checked-control-padding};
@@ -88,7 +88,8 @@ const ForwardedRadio = React.forwardRef((props, ref) => {
88
88
  setInternalChecked(restProps.checked ??
89
89
  restProps.defaultChecked ??
90
90
  ('value' in restProps && restProps.value === radioGroup?.value));
91
- }, [restProps.checked, restProps.defaultChecked, radioGroup?.value, restProps]);
91
+ // eslint-disable-next-line react-hooks/exhaustive-deps
92
+ }, [restProps.checked, restProps.defaultChecked, radioGroup?.value]);
92
93
  return (React.createElement("label", { className: wrapperClasses, htmlFor: id, style: style, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave },
93
94
  React.createElement("span", { className: (0, classnames_1.default)(radioClasses) },
94
95
  React.createElement("input", { className: `${rootCls}-input`, ref: ref, ...radioProps, type: "radio", ...globalAttributes }),
@@ -1,8 +1,8 @@
1
1
  import type * as React from 'react';
2
- import { Group } from '../../Control/Radio/Group';
2
+ import { Group, type RadioGroupProps } from '../../Control/Radio/Group';
3
3
  import { type RadioProps } from '../../Control/Radio/Radio';
4
4
  import './index.scss';
5
- export type { RadioProps };
5
+ export type { RadioGroupProps, RadioProps };
6
6
  export interface Radio extends React.MemoExoticComponent<React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>> {
7
7
  Group: typeof Group;
8
8
  }
@@ -21,6 +21,11 @@
21
21
  display: flex;
22
22
  line-height: unset;
23
23
  user-select: none;
24
+
25
+ &.uk-control {
26
+ background-color: var(--radio-control-background);
27
+ }
28
+
24
29
  @if mixin-exists(hook-radio-wrapper) {
25
30
  @include hook-radio-wrapper;
26
31
  }
@@ -44,15 +49,12 @@
44
49
  }
45
50
 
46
51
  .uk-radio-wrapper .uk-radio-input {
47
- bottom: 0;
48
52
  cursor: pointer;
49
53
  height: 100%;
50
- left: 0;
54
+ inset: 0;
51
55
  margin: 0;
52
56
  opacity: 0;
53
57
  position: absolute;
54
- right: 0;
55
- top: 0;
56
58
  width: 100%;
57
59
  z-index: 1;
58
60
  @if mixin-exists(hook-radio-input) {
@@ -61,7 +63,7 @@
61
63
  }
62
64
 
63
65
  .uk-radio-wrapper .uk-radio-inner {
64
- background-color: transparent;
66
+ background-color: var(--radio-background);
65
67
  border: var(--radio-border-width) solid var(--radio-border);
66
68
  border-radius: 50%;
67
69
  box-sizing: border-box;
@@ -256,6 +258,7 @@
256
258
  --radio-checked-background: #{$radio-checked-background};
257
259
  --radio-checked-border: var(--global-primary-border);
258
260
  --radio-checked-icon-color: var(--global-primary-background);
261
+ --radio-control-background: #{$radio-control-background};
259
262
  --radio-checked-control-background: #{$radio-checked-control-background};
260
263
  --radio-checked-control-color: #{$radio-checked-control-color};
261
264
  --radio-disabled-background: var(--control-disabled-background);
@@ -27,6 +27,9 @@
27
27
  height: auto;
28
28
  max-width: 100%;
29
29
  padding: 0;
30
+ @if mixin-exists(hook-control-textarea) {
31
+ @include hook-control-textarea;
32
+ }
30
33
  }
31
34
 
32
35
  .uk-control-textarea-show-count::after {
@@ -41,6 +44,9 @@
41
44
  position: absolute;
42
45
  right: 5px;
43
46
  white-space: nowrap;
47
+ @if mixin-exists(hook-control-textarea-counter) {
48
+ @include hook-control-textarea-counter;
49
+ }
44
50
  }
45
51
 
46
52
 
@@ -59,6 +65,9 @@
59
65
  padding: var(--textarea-padding-vertical) var(--textarea-padding-horizontal);
60
66
  resize: none;
61
67
  vertical-align: bottom;
68
+ @if mixin-exists(hook-control-textarea-input) {
69
+ @include hook-control-textarea-input;
70
+ }
62
71
  }
63
72
 
64
73
  /* Hover + Focus states */
@@ -239,6 +239,12 @@
239
239
  }
240
240
  }
241
241
 
242
+ .uk-control-suffix {
243
+ @if mixin-exists(hook-control-suffix) {
244
+ @include hook-control-suffix;
245
+ }
246
+ }
247
+
242
248
  .uk-control-clearfix {
243
249
  cursor: pointer;
244
250
  opacity: 0.8;
@@ -17,9 +17,9 @@ export type FlexBreakpoint = {
17
17
  justifyContent?: FlexJustifyContent;
18
18
  };
19
19
  export type FlexBreakpointsConfig = BreakpointsConfig<FlexBreakpoint>;
20
- export type FlexOwnProps = FlexBreakpoint & FlexBreakpointsConfig & {
20
+ export type FlexOwnProps = {
21
21
  inline?: boolean;
22
22
  prefixCls?: string;
23
- };
23
+ } & FlexBreakpoint & FlexBreakpointsConfig;
24
24
  export type FlexProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<FlexOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, FlexOwnProps>;
25
25
  export declare const Flex: React.MemoExoticComponent<(<E extends React.ElementType<any> = "div">(props: FlexProps<E>) => JSX.Element)>;
@@ -1,2 +1,5 @@
1
1
  import { type CSSMotionProps } from 'rc-motion';
2
- export declare function getMotion(mode: string, motion?: CSSMotionProps, defaultMotions?: Record<string, CSSMotionProps>): CSSMotionProps | undefined;
2
+ import { type NavMode } from '../../Nav/types';
3
+ export declare function getMotion(mode: NavMode | 'other', motion?: CSSMotionProps, defaultMotions?: Partial<{
4
+ [key in NavMode | 'other']: CSSMotionProps;
5
+ }>): CSSMotionProps | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type NavProps } from '../Nav';
3
2
  export declare function Nav(props: NavProps): JSX.Element;
4
3
  export declare namespace Nav {
@@ -38,7 +38,7 @@ exports.Tabs = React.memo((props) => {
38
38
  const config = (0, ConfrigProvider_1.useConfig)();
39
39
  const { addIcon, centered, className, direction, hideAdd, moreIcon = React.createElement(Icon_1.Icon, { icon: "more_horizontal" }), prefixCls = config.prefixCls, size, type, onEdit, ...restProps } = props;
40
40
  const rootCls = React.useMemo(() => config.getRootPrefixCls(prefixCls || config.prefixCls, 'tabs'), [config, prefixCls]);
41
- const editable = React.useMemo(() => type === 'editable-card'
41
+ const editable = React.useMemo(() => (type === 'editable-card'
42
42
  ? {
43
43
  addIcon: addIcon || React.createElement(Icon_1.Icon, { icon: "add" }),
44
44
  removeIcon: React.createElement(Icon_1.Icon, { icon: "close" }),
@@ -49,7 +49,7 @@ exports.Tabs = React.memo((props) => {
49
49
  onEdit?.(editType === 'add' ? event : key, editType);
50
50
  },
51
51
  }
52
- : undefined, [addIcon, hideAdd, onEdit, type]);
52
+ : undefined), [addIcon, hideAdd, onEdit, type]);
53
53
  return (React.createElement(rc_tabs_1.default, { direction: direction, moreTransitionName: (0, utils_1.getMotionName)(prefixCls || config.prefixCls, 'slide-bottom-small'), ...restProps, className: (0, classnames_1.default)({
54
54
  [`${rootCls}-${size}`]: size,
55
55
  [`${rootCls}-card`]: ['card', 'editable-card'].includes(type),
@@ -92,6 +92,7 @@
92
92
 
93
93
  background: transparent;
94
94
  border: 0;
95
+ color: var(--tabs-tab-color);
95
96
  font-size: var(--tabs-nav-more-font-size);
96
97
  padding: var(--tabs-tab-padding-vertical) var(--tabs-tab-padding-horizontal);
97
98
  position: relative;
@@ -587,6 +588,9 @@
587
588
  overflow-y: auto;
588
589
  padding: 0;
589
590
  text-align: left;
591
+ @if mixin-exists(hook-tabs-dropdown-menu) {
592
+ @include hook-tabs-dropdown-menu;
593
+ }
590
594
  }
591
595
 
592
596
  .uk-tabs-dropdown-menu-item {
@@ -40,8 +40,8 @@
40
40
 
41
41
  @mixin hook-alert() {
42
42
  a:not([class]) {
43
- text-decoration: underline;
44
43
  color: inherit;
44
+ text-decoration: underline;
45
45
  }
46
46
  }
47
47
  @mixin hook-alert-close() {}
@@ -63,13 +63,13 @@
63
63
  .uk-alert h6 { color: inherit; }
64
64
 
65
65
  .uk-alert a:not([class]) {
66
- text-decoration: underline;
67
66
  color: inherit;
67
+ text-decoration: underline;
68
68
  }
69
69
 
70
70
  .uk-alert a:not([class]):hover {
71
- text-decoration: underline;
72
71
  color: inherit;
72
+ text-decoration: underline;
73
73
  }
74
74
 
75
75
  }
@@ -386,14 +386,14 @@
386
386
  .uk-button-group {
387
387
  .uk-button-circle:not(:last-child),
388
388
  .uk-button-round:not(:last-child) {
389
- border-top-right-radius: 0;
390
389
  border-bottom-right-radius: 0;
390
+ border-top-right-radius: 0;
391
391
  }
392
392
 
393
393
  .uk-button-circle:not(:first-child),
394
394
  .uk-button-round:not(:first-child) {
395
- border-top-left-radius: 0;
396
395
  border-bottom-left-radius: 0;
396
+ border-top-left-radius: 0;
397
397
  }
398
398
  }
399
399
  }
@@ -959,6 +959,7 @@
959
959
  }
960
960
  }
961
961
 
962
+
962
963
  @mixin hook-control() {}
963
964
  @mixin hook-control-hover() {}
964
965
  @mixin hook-control-focus() {}
@@ -973,6 +974,8 @@
973
974
  @mixin hook-control-blank-focus() {}
974
975
  @mixin hook-control-input() {}
975
976
  @mixin hook-control-prefix() {}
977
+ @mixin hook-control-suffix() {}
978
+
976
979
  @mixin hook-inverse-control() {}
977
980
  @mixin hook-inverse-control-hover() {}
978
981
  @mixin hook-inverse-control-focus() {}
@@ -983,8 +986,8 @@
983
986
  @mixin hook-inverse-control-blank-focus() {}
984
987
  @mixin hook-inverse-component-control() {
985
988
  .uk-control {
986
- border-color: var(--inverse-control-border);
987
989
  background-color: var(--inverse-control-background);
990
+ border-color: var(--inverse-control-border);
988
991
  color: var(--inverse-control-color);
989
992
  @if mixin-exists(hook-inverse-control) {
990
993
  @include hook-inverse-control;
@@ -993,8 +996,8 @@
993
996
 
994
997
  // Hover state (unused for disabled state)
995
998
  .uk-control:hover {
996
- border-color: var(--inverse-control-hover-border);
997
999
  background-color: var(--inverse-control-hover-background);
1000
+ border-color: var(--inverse-control-hover-border);
998
1001
  color: var(--inverse-control-hover-color);
999
1002
  @if mixin-exists(hook-inverse-control-hover) {
1000
1003
  @include hook-inverse-control-hover;
@@ -1003,8 +1006,8 @@
1003
1006
 
1004
1007
  // Focus state (unused for disabled state)
1005
1008
  .uk-control:focus-within {
1006
- border-color: var(--inverse-control-focus-border);
1007
1009
  background-color: var(--inverse-control-focus-background);
1010
+ border-color: var(--inverse-control-focus-border);
1008
1011
  color: var(--inverse-control-focus-color);
1009
1012
  @if mixin-exists(hook-inverse-control-focus) {
1010
1013
  @include hook-inverse-control-focus;
@@ -1013,8 +1016,8 @@
1013
1016
 
1014
1017
  // Disabled state
1015
1018
  .uk-control.uk-disabled {
1016
- border-color: var(--inverse-control-disabled-border);
1017
1019
  background-color: var(--inverse-ontrol-disabled-background);
1020
+ border-color: var(--inverse-control-disabled-border);
1018
1021
  color: var(--inverse-control-disabled-color);
1019
1022
  @if mixin-exists(hook-inverse-control-disabled) {
1020
1023
  @include hook-inverse-control-disabled;
@@ -1108,6 +1111,10 @@
1108
1111
  @mixin hook-select-clear() {}
1109
1112
  @mixin hook-select-dropdown() {}
1110
1113
 
1114
+ @mixin hook-control-textarea() {}
1115
+ @mixin hook-control-textarea-counter() {}
1116
+ @mixin hook-control-textarea-input() {}
1117
+
1111
1118
  @mixin hook-grid-divider-horizontal() {}
1112
1119
  @mixin hook-grid-divider-vertical() {}
1113
1120
  @mixin hook-grid-misc() {}
@@ -1883,6 +1890,7 @@
1883
1890
  @mixin hook-tabs-left-tab() {}
1884
1891
  @mixin hook-tabs-right() {}
1885
1892
  @mixin hook-tabs-right-tab() {}
1893
+ @mixin hook-tabs-dropdown-menu() {}
1886
1894
  @mixin hook-tabs-misc() {}
1887
1895
  @mixin hook-inverse-tabs() {}
1888
1896
  @mixin hook-inverse-tabs-tab() {}
@@ -86,7 +86,7 @@ $global-danger-background: #f5604b !default;
86
86
 
87
87
  $global-border-width: 1px !default;
88
88
  $global-border-style: solid !default;
89
- $global-border: $global-default-background !default;
89
+ $global-border: darken($global-default-background, 3%) !default;
90
90
  $global-muted-border: $global-muted-background !default;
91
91
  $global-primary-border: $global-primary-background !default;
92
92
  $global-secondary-border: $global-secondary-background !default;
@@ -857,6 +857,7 @@ $checkbox-focus-border: $global-primary-border !default;
857
857
  $checkbox-checked-background: $global-primary-background !default;
858
858
  $checkbox-checked-border: $global-primary-border !default;
859
859
  $checkbox-checked-icon-color: $global-inverse-color !default;
860
+ $checkbox-control-background: rgba($control-background, 45%) !default;
860
861
  $checkbox-checked-control-background: rgba($checkbox-checked-background, 15%) !default;
861
862
  $checkbox-checked-control-color: $global-primary-background !default;
862
863
  $checkbox-checked-control-padding: 10px !default;
@@ -879,6 +880,7 @@ $radio-focus-border: $control-focus-border !default;
879
880
  $radio-checked-background: transparent !default;
880
881
  $radio-checked-border: $global-primary-border !default;
881
882
  $radio-checked-icon-color: $global-primary-background !default;
883
+ $radio-control-background: rgba($control-background, 45%) !default;
882
884
  $radio-checked-control-background: rgba($radio-checked-icon-color, 15%) !default;
883
885
  $radio-checked-control-color: $global-primary-background !default;
884
886
  $radio-disabled-background: $control-disabled-background !default;