@broxus/react-uikit 0.14.1 → 0.15.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.
Files changed (155) hide show
  1. package/dist/cjs/components/Accordion/Accordion.js +1 -2
  2. package/dist/cjs/components/Accordion/Item.js +1 -2
  3. package/dist/cjs/components/Align/Align.js +1 -2
  4. package/dist/cjs/components/Align/Left.js +1 -2
  5. package/dist/cjs/components/Align/Right.js +1 -2
  6. package/dist/cjs/components/Article/Article.js +1 -2
  7. package/dist/cjs/components/Article/Meta.js +1 -2
  8. package/dist/cjs/components/Article/Title.js +1 -2
  9. package/dist/cjs/components/Badge/index.js +1 -2
  10. package/dist/cjs/components/Breadcrumb/Breadcrumb.js +1 -2
  11. package/dist/cjs/components/Breadcrumb/Item.js +1 -2
  12. package/dist/cjs/components/Button/Group.js +1 -2
  13. package/dist/cjs/components/Button/index.scss +42 -0
  14. package/dist/cjs/components/Card/Badge.js +1 -2
  15. package/dist/cjs/components/Card/Body.js +1 -2
  16. package/dist/cjs/components/Card/Card.d.ts +1 -1
  17. package/dist/cjs/components/Card/Card.js +1 -2
  18. package/dist/cjs/components/Card/Footer.js +1 -2
  19. package/dist/cjs/components/Card/Header.js +1 -2
  20. package/dist/cjs/components/Card/Media.js +1 -2
  21. package/dist/cjs/components/Card/Title.js +1 -2
  22. package/dist/cjs/components/Card/index.scss +4 -0
  23. package/dist/cjs/components/Close/index.js +1 -2
  24. package/dist/cjs/components/ConfigProvider/index.d.ts +1 -1
  25. package/dist/cjs/components/ConfigProvider/index.js +3 -3
  26. package/dist/cjs/components/Container/index.d.ts +1 -1
  27. package/dist/cjs/components/Control/Checkbox/CheckboxGroupContext.js +2 -2
  28. package/dist/cjs/components/Control/Checkbox/index.d.ts +2 -2
  29. package/dist/cjs/components/Control/Input/useInput.js +2 -3
  30. package/dist/cjs/components/Control/Radio/RadioGroupContext.js +2 -2
  31. package/dist/cjs/components/Control/Radio/index.d.ts +2 -2
  32. package/dist/cjs/components/Control/Radio/index.scss +1 -1
  33. package/dist/cjs/components/Cover/index.js +1 -2
  34. package/dist/cjs/components/DescriptionList/Description.js +1 -2
  35. package/dist/cjs/components/DescriptionList/DescriptionList.js +1 -2
  36. package/dist/cjs/components/DescriptionList/Term.js +1 -2
  37. package/dist/cjs/components/Divider/index.js +1 -2
  38. package/dist/cjs/components/Divider/index.scss +1 -1
  39. package/dist/cjs/components/Dotnav/Dotnav.js +1 -2
  40. package/dist/cjs/components/Dotnav/Item.js +1 -2
  41. package/dist/cjs/components/Dropdown/index.scss +1 -0
  42. package/dist/cjs/components/Flex/Flex.js +1 -2
  43. package/dist/cjs/components/Flex/Item.js +1 -2
  44. package/dist/cjs/components/Form/Controls.js +1 -2
  45. package/dist/cjs/components/Form/ControlsText.js +1 -2
  46. package/dist/cjs/components/Form/Fieldset.js +1 -2
  47. package/dist/cjs/components/Form/Form.js +1 -2
  48. package/dist/cjs/components/Form/Label.js +1 -2
  49. package/dist/cjs/components/Form/Legend.js +1 -2
  50. package/dist/cjs/components/Grid/index.js +1 -2
  51. package/dist/cjs/components/Heading/index.js +1 -2
  52. package/dist/cjs/components/Icon/Button.js +1 -2
  53. package/dist/cjs/components/Icon/Icon.js +1 -2
  54. package/dist/cjs/components/Icon/Link.js +1 -2
  55. package/dist/cjs/components/Icon/get-size.js +1 -2
  56. package/dist/cjs/components/Iconnav/Iconnav.js +1 -2
  57. package/dist/cjs/components/Iconnav/Item.js +1 -2
  58. package/dist/cjs/components/Inverse/index.d.ts +21 -0
  59. package/dist/cjs/components/Inverse/index.js +78 -0
  60. package/dist/cjs/components/Label/index.js +1 -2
  61. package/dist/cjs/components/List/Item.js +1 -2
  62. package/dist/cjs/components/List/List.js +1 -2
  63. package/dist/cjs/components/Modal/Modal.js +1 -2
  64. package/dist/cjs/components/Nav/Divider.js +1 -2
  65. package/dist/cjs/components/Nav/Group/InternalNavItemGroup.js +1 -2
  66. package/dist/cjs/components/Nav/Header.js +1 -2
  67. package/dist/cjs/components/Nav/Item/InternalNavItem.js +1 -2
  68. package/dist/cjs/components/Nav/Sub/InlineSubNavList.js +1 -2
  69. package/dist/cjs/components/Nav/Sub/PopupTrigger.js +1 -2
  70. package/dist/cjs/components/Nav/Sub/index.js +1 -2
  71. package/dist/cjs/components/Nav/context/IdContext.js +3 -3
  72. package/dist/cjs/components/Nav/context/NavContext.js +2 -2
  73. package/dist/cjs/components/Nav/context/PathContext.js +3 -3
  74. package/dist/cjs/components/Nav/hooks/useAccessibility.js +1 -2
  75. package/dist/cjs/components/Nav/hooks/useActive.js +1 -2
  76. package/dist/cjs/components/Nav/hooks/useDirectionStyle.js +1 -2
  77. package/dist/cjs/components/Nav/hooks/useKeyRecords.js +2 -2
  78. package/dist/cjs/components/Nav/hooks/useMemoCallback.js +1 -2
  79. package/dist/cjs/components/Nav/hooks/useUUID.js +1 -2
  80. package/dist/cjs/components/Nav/utils/alignUtil.js +2 -3
  81. package/dist/cjs/components/Nav/utils/motionUtil.js +1 -2
  82. package/dist/cjs/components/Nav/utils/nodeUtil.js +2 -3
  83. package/dist/cjs/components/Nav/utils/timeUtil.js +1 -2
  84. package/dist/cjs/components/Nav/utils/warnUtil.js +1 -2
  85. package/dist/cjs/components/Navbar/Center.js +1 -2
  86. package/dist/cjs/components/Navbar/Container.js +1 -2
  87. package/dist/cjs/components/Navbar/Item.js +1 -2
  88. package/dist/cjs/components/Navbar/Left.js +1 -2
  89. package/dist/cjs/components/Navbar/Nav.js +1 -2
  90. package/dist/cjs/components/Navbar/Navbar.js +1 -2
  91. package/dist/cjs/components/Navbar/Right.js +1 -2
  92. package/dist/cjs/components/Navbar/Toggle.js +1 -2
  93. package/dist/cjs/components/Navbar/index.scss +1 -0
  94. package/dist/cjs/components/Overlay/index.d.ts +13 -0
  95. package/dist/cjs/components/Overlay/index.js +58 -0
  96. package/dist/cjs/components/Overlay/index.scss +105 -0
  97. package/dist/cjs/components/Progress/index.js +1 -2
  98. package/dist/cjs/components/Section/index.js +1 -2
  99. package/dist/cjs/components/Section/index.scss +29 -0
  100. package/dist/cjs/components/Spinner/index.js +1 -2
  101. package/dist/cjs/components/Subnav/Item.js +1 -2
  102. package/dist/cjs/components/Subnav/Subnav.js +1 -2
  103. package/dist/cjs/components/Tabs/hooks/useAnimateConfig.js +1 -2
  104. package/dist/cjs/components/Tabs/index.js +1 -2
  105. package/dist/cjs/components/Text/index.d.ts +1 -0
  106. package/dist/cjs/components/Text/index.js +2 -2
  107. package/dist/cjs/components/Text/index.scss +2 -0
  108. package/dist/cjs/components/Tile/index.js +1 -2
  109. package/dist/cjs/components/Tile/index.scss +31 -0
  110. package/dist/cjs/components/Width/Width.js +1 -2
  111. package/dist/cjs/components/Width/utils.js +2 -3
  112. package/dist/cjs/hooks/useContext.js +1 -2
  113. package/dist/cjs/hooks/useForceUpdate.js +1 -2
  114. package/dist/cjs/hooks/useMounted.js +1 -2
  115. package/dist/cjs/index.d.ts +2 -0
  116. package/dist/cjs/index.js +2 -0
  117. package/dist/cjs/styles/_import.scss +1 -1
  118. package/dist/cjs/styles/inverse.scss +8 -0
  119. package/dist/cjs/styles/mixins.scss +7 -2
  120. package/dist/cjs/styles/overlay.scss +1 -105
  121. package/dist/cjs/styles/variables.scss +5 -1
  122. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  123. package/dist/cjs/utils/get-breakpoints-config-classes.js +1 -2
  124. package/dist/cjs/utils/modal.js +2 -3
  125. package/dist/cjs/utils/motion.js +3 -4
  126. package/dist/esm/components/Button/index.scss +42 -0
  127. package/dist/esm/components/Card/Card.d.ts +1 -1
  128. package/dist/esm/components/Card/index.scss +4 -0
  129. package/dist/esm/components/ConfigProvider/index.d.ts +1 -1
  130. package/dist/esm/components/Container/index.d.ts +1 -1
  131. package/dist/esm/components/Control/Checkbox/index.d.ts +2 -2
  132. package/dist/esm/components/Control/Radio/index.d.ts +2 -2
  133. package/dist/esm/components/Control/Radio/index.scss +1 -1
  134. package/dist/esm/components/Divider/index.scss +1 -1
  135. package/dist/esm/components/Dropdown/index.scss +1 -0
  136. package/dist/esm/components/Inverse/index.d.ts +21 -0
  137. package/dist/esm/components/Inverse/index.js +51 -0
  138. package/dist/esm/components/Navbar/index.scss +1 -0
  139. package/dist/esm/components/Overlay/index.d.ts +13 -0
  140. package/dist/esm/components/Overlay/index.js +29 -0
  141. package/dist/esm/components/Overlay/index.scss +105 -0
  142. package/dist/esm/components/Section/index.scss +29 -0
  143. package/dist/esm/components/Text/index.d.ts +1 -0
  144. package/dist/esm/components/Text/index.js +1 -0
  145. package/dist/esm/components/Text/index.scss +2 -0
  146. package/dist/esm/components/Tile/index.scss +31 -0
  147. package/dist/esm/index.d.ts +2 -0
  148. package/dist/esm/index.js +2 -0
  149. package/dist/esm/styles/_import.scss +1 -1
  150. package/dist/esm/styles/inverse.scss +8 -0
  151. package/dist/esm/styles/mixins.scss +7 -2
  152. package/dist/esm/styles/overlay.scss +1 -105
  153. package/dist/esm/styles/variables.scss +5 -1
  154. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  155. package/package.json +4 -4
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBreakpointsConfigClasses = void 0;
3
+ exports.getBreakpointsConfigClasses = getBreakpointsConfigClasses;
4
4
  function getBreakpointsConfigClasses(prefixCls, componentCls, config = {}) {
5
5
  return Object.entries(config).map(([key, value]) => (value ? `${prefixCls}-${componentCls}-${value}${key !== 'default' ? `@${key}` : ''}` : '')).join(' ').trim();
6
6
  }
7
- exports.getBreakpointsConfigClasses = getBreakpointsConfigClasses;
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.removeModalMode = exports.addModalMode = void 0;
6
+ exports.addModalMode = addModalMode;
7
+ exports.removeModalMode = removeModalMode;
7
8
  const js_utils_1 = require("@broxus/js-utils");
8
9
  const classnames_1 = __importDefault(require("classnames"));
9
10
  function addModalMode(...args) {
@@ -19,7 +20,6 @@ function addModalMode(...args) {
19
20
  }
20
21
  catch { }
21
22
  }
22
- exports.addModalMode = addModalMode;
23
23
  function removeModalMode(...args) {
24
24
  (0, js_utils_1.removeClass)(document?.documentElement, (0, classnames_1.default)(args ?? 'uk-modal-page'));
25
25
  try {
@@ -28,4 +28,3 @@ function removeModalMode(...args) {
28
28
  }
29
29
  catch { }
30
30
  }
31
- exports.removeModalMode = removeModalMode;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mergeDropMaskMotion = exports.getCollapseMotion = exports.getMotionName = void 0;
3
+ exports.getMotionName = getMotionName;
4
+ exports.getCollapseMotion = getCollapseMotion;
5
+ exports.mergeDropMaskMotion = mergeDropMaskMotion;
4
6
  const js_utils_1 = require("@broxus/js-utils");
5
7
  const getCollapsedHeight = () => ({ height: 0, opacity: 0 });
6
8
  const getRealHeight = node => ({ height: node.scrollHeight, opacity: 1 });
@@ -12,7 +14,6 @@ function getMotionName(prefixCls, motion, transitionName) {
12
14
  }
13
15
  return `${prefixCls}-motion-${motion}`;
14
16
  }
15
- exports.getMotionName = getMotionName;
16
17
  function getCollapseMotion(prefixCls) {
17
18
  return {
18
19
  leavedClassName: `${prefixCls}-hidden`,
@@ -29,7 +30,6 @@ function getCollapseMotion(prefixCls) {
29
30
  onLeaveStart: getCurrentHeight,
30
31
  };
31
32
  }
32
- exports.getCollapseMotion = getCollapseMotion;
33
33
  function mergeDropMaskMotion(prefixCls, motion) {
34
34
  if (motion) {
35
35
  return {
@@ -69,4 +69,3 @@ function mergeDropMaskMotion(prefixCls, motion) {
69
69
  },
70
70
  };
71
71
  }
72
- exports.mergeDropMaskMotion = mergeDropMaskMotion;
@@ -293,6 +293,48 @@
293
293
  }
294
294
  }
295
295
 
296
+ @if $button-disabled-mode == separate {
297
+ .uk-button-default:disabled {
298
+ background-color: var(--button-default-disabled-background);
299
+ color: var(--button-default-disabled-color);
300
+ @if mixin-exists(hook-button-default-disabled) {
301
+ @include hook-button-default-disabled;
302
+ }
303
+ }
304
+
305
+ .uk-button-primary:disabled {
306
+ background-color: var(--button-primary-disabled-background);
307
+ color: var(--button-primary-disabled-color);
308
+ @if mixin-exists(hook-button-primary-disabled) {
309
+ @include hook-button-primary-disabled;
310
+ }
311
+ }
312
+
313
+ .uk-button-secondary:disabled {
314
+ background-color: var(--button-secondary-disabled-background);
315
+ color: var(--button-secondary-disabled-color);
316
+ @if mixin-exists(hook-button-secondary-disabled) {
317
+ @include hook-button-secondary-disabled;
318
+ }
319
+ }
320
+
321
+ .uk-button-tertiary:disabled {
322
+ background-color: var(--button-tertiary-disabled-background);
323
+ color: var(--button-tertiary-disabled-color);
324
+ @if mixin-exists(hook-button-tertiary-disabled) {
325
+ @include hook-button-tertiary-disabled;
326
+ }
327
+ }
328
+
329
+ .uk-button-danger:disabled {
330
+ background-color: var(--button-danger-disabled-background);
331
+ color: var(--button-danger-disabled-color);
332
+ @if mixin-exists(hook-button-danger-disabled) {
333
+ @include hook-button-danger-disabled;
334
+ }
335
+ }
336
+ }
337
+
296
338
  /* Size modifiers
297
339
  ========================================================================== */
298
340
 
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { type PolymorphicProps } from '../../components/Component';
3
- import { type ColorMode } from '../../components/ConfigProvider';
3
+ import { type ColorMode } from '../../components/Inverse';
4
4
  export type CardOwnProps = {
5
5
  asBody?: boolean;
6
6
  colorMode?: ColorMode;
@@ -206,6 +206,7 @@
206
206
  */
207
207
 
208
208
  .uk-card-default {
209
+ --uk-inverse: #{$card-default-color-mode};
209
210
  background: var(--card-default-background);
210
211
  color: var(--card-default-color);
211
212
  @if mixin-exists(hook-card-default) {
@@ -269,6 +270,7 @@
269
270
  */
270
271
 
271
272
  .uk-card-primary {
273
+ --uk-inverse: #{$card-primary-color-mode};
272
274
  background: var(--card-primary-background);
273
275
  color: var(--card-primary-color);
274
276
  @if mixin-exists(hook-card-primary) {
@@ -320,6 +322,7 @@
320
322
  */
321
323
 
322
324
  .uk-card-secondary {
325
+ --uk-inverse: #{$card-secondary-color-mode};
323
326
  background: var(--card-secondary-background);
324
327
  color: var(--card-secondary-color);
325
328
  @if mixin-exists(hook-card-secondary) {
@@ -371,6 +374,7 @@
371
374
  */
372
375
 
373
376
  .uk-card-tertiary {
377
+ --uk-inverse: #{$card-tertiary-color-mode};
374
378
  background: var(--card-tertiary-background);
375
379
  color: var(--card-tertiary-color);
376
380
  @if mixin-exists(hook-card-tertiary) {
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { type ButtonProps } from '../../components/Button';
3
+ import { type ColorMode } from '../../components/Inverse';
3
4
  import { type BreakpointsConfig, type TooltipOptions } from '../../types';
4
- export type ColorMode = 'light' | 'dark';
5
5
  type PropsWithMouseHandler = {
6
6
  onClick: React.HTMLAttributes<HTMLElement>['onClick'];
7
7
  };
@@ -9,4 +9,4 @@ export interface ContainerOwnProps {
9
9
  size?: 'xsmall' | 'small' | 'large' | 'xlarge' | 'expand';
10
10
  }
11
11
  export type ContainerProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<ContainerOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, ContainerOwnProps>;
12
- export declare const Container: React.MemoExoticComponent<(<E extends React.ElementType<any, keyof React.JSX.IntrinsicElements> = "div">(props: ContainerProps<E>) => React.JSX.Element)>;
12
+ export declare const Container: React.MemoExoticComponent<(<E extends React.ElementType = "div">(props: ContainerProps<E>) => React.JSX.Element)>;
@@ -1,9 +1,9 @@
1
1
  import type * as React from 'react';
2
- import { type AbstractCheckboxProps, type CheckboxProps } from '../../../components/Control/Checkbox/Checkbox';
2
+ import { type AbstractCheckboxProps, type CheckboxChangeEvent, type CheckboxProps } from '../../../components/Control/Checkbox/Checkbox';
3
3
  import { type CheckboxGroupConsumer } from '../../../components/Control/Checkbox/CheckboxGroupContext';
4
4
  import { type AbstractCheckboxGroupProps, type CheckboxGroupProps, type CheckboxOptionType, Group } from '../../../components/Control/Checkbox/Group';
5
5
  import './index.scss';
6
- export type { AbstractCheckboxProps, AbstractCheckboxGroupProps, CheckboxGroupConsumer, CheckboxGroupProps, CheckboxOptionType, CheckboxProps, };
6
+ export type { AbstractCheckboxProps, AbstractCheckboxGroupProps, CheckboxChangeEvent, CheckboxGroupConsumer, CheckboxGroupProps, CheckboxOptionType, CheckboxProps, };
7
7
  export interface Checkbox extends React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>> {
8
8
  Group: typeof Group;
9
9
  }
@@ -1,9 +1,9 @@
1
1
  import type * as React from 'react';
2
2
  import { Group, type RadioGroupProps } from '../../../components/Control/Radio/Group';
3
- import { type RadioProps } from '../../../components/Control/Radio/Radio';
3
+ import { type RadioChangeEvent, type RadioProps } from '../../../components/Control/Radio/Radio';
4
4
  import './index.scss';
5
5
  import '../index.scss';
6
- export type { RadioGroupProps, RadioProps };
6
+ export type { RadioChangeEvent, RadioGroupProps, RadioProps };
7
7
  export interface Radio extends React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>> {
8
8
  Group: typeof Group;
9
9
  }
@@ -180,7 +180,7 @@
180
180
 
181
181
  .uk-radio-disabled.uk-radio-checked .uk-radio-inner::after {
182
182
  animation-name: none;
183
- border-color: var(--radio-disabled-icon-color);
183
+ background-color: var(--radio-disabled-icon-color);
184
184
  }
185
185
 
186
186
 
@@ -46,7 +46,7 @@
46
46
  height: var(--divider-icon-height);
47
47
  position: relative;
48
48
  @if mixin-exists(svg-fill) {
49
- @include svg-fill($divider-icon-image-path, '#000', $divider-icon-color);
49
+ @include svg-fill($internal-divider-icon-image, '#000', $divider-icon-color);
50
50
  }
51
51
  @if mixin-exists(hook-divider-icon) {
52
52
  @include hook-divider-icon;
@@ -32,6 +32,7 @@
32
32
  */
33
33
 
34
34
  .uk-dropdown {
35
+ --uk-inverse: #{$dropdown-color-mode};
35
36
  background: var(--dropdown-background); /* 3 */
36
37
  box-sizing: border-box; /* 2 */
37
38
  color: var(--dropdown-color); /* 3 */
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ export declare enum ColorMode {
3
+ Dark = "dark",
4
+ Light = "light"
5
+ }
6
+ export interface InverseConfig {
7
+ colorMode: ColorMode;
8
+ logoColor?: string;
9
+ setColorMode: (value: ColorMode) => void;
10
+ }
11
+ export interface InverseProviderProps {
12
+ globalDarkClassName?: string;
13
+ globalLightClassName?: string;
14
+ primaryColorDark?: string;
15
+ primaryColorLight?: string;
16
+ }
17
+ export declare const lib: Record<ColorMode, () => React.JSX.Element>;
18
+ export declare const InverseContext: React.Context<InverseConfig | null>;
19
+ export declare function useInverse(): InverseConfig;
20
+ export declare const INVERSE_STORAGE_KEY = "colorMode";
21
+ export declare const InverseProvider: React.MemoExoticComponent<({ children, globalDarkClassName, globalLightClassName, primaryColorDark, primaryColorLight, }: React.PropsWithChildren<InverseProviderProps>) => React.JSX.Element>;
@@ -0,0 +1,51 @@
1
+ 'use client';
2
+ import { addClass, removeClass, storage } from '@broxus/js-utils';
3
+ import * as React from 'react';
4
+ import { useContext } from '../../hooks';
5
+ export var ColorMode;
6
+ (function (ColorMode) {
7
+ ColorMode["Dark"] = "dark";
8
+ ColorMode["Light"] = "light";
9
+ })(ColorMode || (ColorMode = {}));
10
+ /* eslint-disable react/no-multi-comp */
11
+ export const lib = {
12
+ [ColorMode.Dark]: () => (React.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
+ React.createElement("path", { d: "M13.1029 7.74566C13.1908 7.74566 13.2468 7.68401 13.2627 7.59923C13.5105 6.31985 13.5025 6.28902 14.8931 6.03468C14.981 6.01156 15.045 5.96532 15.045 5.87283C15.045 5.77264 14.981 5.7264 14.8931 5.71098C13.5025 5.44123 13.5425 5.4104 13.2627 4.13873C13.2468 4.05395 13.1908 4 13.1029 4C13.007 4 12.951 4.05395 12.9351 4.13873C12.6553 5.4104 12.7033 5.44123 11.3047 5.71098C11.2168 5.7264 11.1608 5.77264 11.1608 5.87283C11.1608 5.96532 11.2168 6.01156 11.3047 6.03468C12.7033 6.30443 12.6793 6.31985 12.9351 7.59923C12.951 7.68401 13.007 7.74566 13.1029 7.74566ZM16.9231 12.9557C17.0669 12.9557 17.1708 12.8555 17.1948 12.7091C17.4505 10.6435 17.5624 10.5973 19.7283 10.2582C19.8961 10.2351 20 10.1503 20 9.99615C20 9.84971 19.8961 9.76493 19.7602 9.7341C17.5784 9.33333 17.4505 9.34875 17.1948 7.28324C17.1708 7.1368 17.0669 7.03661 16.9231 7.03661C16.7792 7.03661 16.6673 7.1368 16.6513 7.27553C16.3796 9.36416 16.2997 9.43353 14.0859 9.7341C13.95 9.75723 13.8462 9.84971 13.8462 9.99615C13.8462 10.1426 13.95 10.2351 14.0859 10.2582C16.2997 10.6667 16.3716 10.6667 16.6513 12.7245C16.6673 12.8555 16.7792 12.9557 16.9231 12.9557ZM10.9051 20C13.7902 20 16.1319 18.6127 17.2028 16.2158C17.3227 15.9383 17.3067 15.7071 17.1628 15.5607C17.043 15.4528 16.8272 15.4297 16.5794 15.5222C15.9241 15.7765 15.1648 15.8921 14.2937 15.8921C10.6813 15.8921 8.33966 13.711 8.33966 10.2813C8.33966 9.41041 8.50749 8.43931 8.77922 7.90751C8.92308 7.63006 8.91508 7.39884 8.7952 7.25241C8.65934 7.09827 8.41159 7.07514 8.09191 7.19846C5.63836 8.13873 4 10.6127 4 13.4412C4 17.1869 6.86114 20 10.9051 20Z", fill: "#6C86AD" }))),
14
+ [ColorMode.Light]: () => (React.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
15
+ React.createElement("path", { d: "M12 9C13.65 9 15 10.35 15 12C15 13.65 13.65 15 12 15C10.35 15 9 13.65 9 12C9 10.35 10.35 9 12 9ZM12 7C9.24 7 7 9.24 7 12C7 14.76 9.24 17 12 17C14.76 17 17 14.76 17 12C17 9.24 14.76 7 12 7ZM2 13H4C4.55 13 5 12.55 5 12C5 11.45 4.55 11 4 11H2C1.45 11 1 11.45 1 12C1 12.55 1.45 13 2 13ZM20 13H22C22.55 13 23 12.55 23 12C23 11.45 22.55 11 22 11H20C19.45 11 19 11.45 19 12C19 12.55 19.45 13 20 13ZM11 2V4C11 4.55 11.45 5 12 5C12.55 5 13 4.55 13 4V2C13 1.45 12.55 1 12 1C11.45 1 11 1.45 11 2ZM11 20V22C11 22.55 11.45 23 12 23C12.55 23 13 22.55 13 22V20C13 19.45 12.55 19 12 19C11.45 19 11 19.45 11 20ZM5.99 4.58C5.6 4.19 4.96 4.19 4.58 4.58C4.19 4.97 4.19 5.61 4.58 5.99L5.64 7.05C6.03 7.44 6.67 7.44 7.05 7.05C7.43 6.66 7.44 6.02 7.05 5.64L5.99 4.58ZM18.36 16.95C17.97 16.56 17.33 16.56 16.95 16.95C16.56 17.34 16.56 17.98 16.95 18.36L18.01 19.42C18.4 19.81 19.04 19.81 19.42 19.42C19.81 19.03 19.81 18.39 19.42 18.01L18.36 16.95ZM19.42 5.99C19.81 5.6 19.81 4.96 19.42 4.58C19.03 4.19 18.39 4.19 18.01 4.58L16.95 5.64C16.56 6.03 16.56 6.67 16.95 7.05C17.34 7.43 17.98 7.44 18.36 7.05L19.42 5.99ZM7.05 18.36C7.44 17.97 7.44 17.33 7.05 16.95C6.66 16.56 6.02 16.56 5.64 16.95L4.58 18.01C4.19 18.4 4.19 19.04 4.58 19.42C4.97 19.8 5.61 19.81 5.99 19.42L7.05 18.36Z", fill: "#6C86AD" }))),
16
+ };
17
+ export const InverseContext = React.createContext(null);
18
+ export function useInverse() {
19
+ return useContext(InverseContext);
20
+ }
21
+ export const INVERSE_STORAGE_KEY = 'colorMode';
22
+ export const InverseProvider = React.memo(({ children, globalDarkClassName = 'tm-dark', globalLightClassName = 'tm-light', primaryColorDark, primaryColorLight, }) => {
23
+ const [colorMode, setColorMode] = React.useState(() => {
24
+ const stored = storage.get(INVERSE_STORAGE_KEY);
25
+ return stored ? stored : ColorMode.Dark;
26
+ });
27
+ const context = React.useMemo(() => ({
28
+ colorMode,
29
+ logoColor: colorMode === ColorMode.Dark ? primaryColorLight : primaryColorDark,
30
+ setColorMode: (value) => {
31
+ setColorMode(value);
32
+ storage.set(INVERSE_STORAGE_KEY, value);
33
+ },
34
+ }), [colorMode, primaryColorDark, primaryColorLight]);
35
+ const onChangeStorageValue = React.useCallback((event) => {
36
+ if (event.key === INVERSE_STORAGE_KEY && event.newValue != null) {
37
+ setColorMode(event.newValue);
38
+ }
39
+ }, []);
40
+ React.useEffect(() => {
41
+ removeClass(document.documentElement, globalLightClassName, globalDarkClassName);
42
+ addClass(document.documentElement, colorMode === ColorMode.Dark ? globalLightClassName : globalDarkClassName);
43
+ }, [colorMode, globalDarkClassName, globalLightClassName]);
44
+ React.useEffect(() => {
45
+ window.addEventListener('storage', onChangeStorageValue);
46
+ return () => {
47
+ window.removeEventListener('storage', onChangeStorageValue);
48
+ };
49
+ }, [onChangeStorageValue]);
50
+ return React.createElement(InverseContext.Provider, { value: context }, children);
51
+ });
@@ -49,6 +49,7 @@
49
49
  */
50
50
 
51
51
  .uk-navbar {
52
+ --uk-inverse: #{$navbar-color-mode};
52
53
  display: flex;
53
54
 
54
55
  /* 1 */
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { type PolymorphicProps } from '../../components/Component';
3
+ import './index.scss';
4
+ export interface OverlayOwnProps {
5
+ icon?: boolean;
6
+ overlay?: React.ReactNode;
7
+ position?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center' | 'cover';
8
+ type?: 'default' | 'primary';
9
+ }
10
+ export type OverlayProps<E extends React.ElementType = React.ElementType> = OverlayOwnProps & PolymorphicProps<E> & PolymorphicProps<E, OverlayOwnProps>;
11
+ declare const defaultElement = "div";
12
+ export declare function Overlay<E extends React.ElementType = typeof defaultElement>(props: React.PropsWithChildren<OverlayProps<E>>): React.JSX.Element;
13
+ export {};
@@ -0,0 +1,29 @@
1
+ import classNames from 'classnames';
2
+ import * as React from 'react';
3
+ import { Component } from '../../components/Component';
4
+ import { useConfig } from '../../components/ConfigProvider';
5
+ import './index.scss';
6
+ const defaultElement = 'div';
7
+ const positions = [
8
+ 'top',
9
+ 'bottom',
10
+ 'left',
11
+ 'right',
12
+ 'top-left',
13
+ 'top-right',
14
+ 'bottom-left',
15
+ 'bottom-right',
16
+ 'center',
17
+ 'cover',
18
+ ];
19
+ export function Overlay(props) {
20
+ const config = useConfig();
21
+ const { className, icon, position = 'bottom', prefixCls = config.prefixCls, type = 'default', ...restProps } = props;
22
+ const rootCls = React.useMemo(() => config.getRootPrefixCls(prefixCls || config.prefixCls, 'overlay'), [config, prefixCls]);
23
+ const positionRootCls = React.useMemo(() => config.getRootPrefixCls(prefixCls || config.prefixCls, 'position'), [config, prefixCls]);
24
+ return (React.createElement(Component, { className: classNames(rootCls, {
25
+ [`${rootCls}-${type}`]: type && ['default', 'primary'].includes(type),
26
+ [`${rootCls}-icon`]: icon,
27
+ [`${positionRootCls}-${position}`]: position && positions.includes(position),
28
+ }, className), component: defaultElement, ...restProps }));
29
+ }
@@ -0,0 +1,105 @@
1
+ // Name: Overlay
2
+ // Description: Component to create content areas overlaying an image
3
+ //
4
+ // Component: `uk-overlay`
5
+ //
6
+ // Adopted: `uk-overlay-icon`
7
+ //
8
+ // Modifier: `uk-overlay-default`
9
+ // `uk-overlay-primary`
10
+ //
11
+ // ========================================================================
12
+
13
+
14
+ // Variables
15
+ // ========================================================================
16
+
17
+ @import '../../styles/variables.scss';
18
+
19
+
20
+ /* ========================================================================
21
+ Component: Overlay
22
+ ========================================================================== */
23
+
24
+ .uk-overlay {
25
+ padding: var(--overlay-padding-vertical) var(--overlay-padding-horizontal);
26
+ @if mixin-exists(hook-overlay) {
27
+ @include hook-overlay;
28
+ }
29
+ }
30
+
31
+ /*
32
+ * Remove margin from the last-child
33
+ */
34
+
35
+ .uk-overlay > :last-child {
36
+ margin-bottom: 0;
37
+ }
38
+
39
+
40
+ /* Icon
41
+ ========================================================================== */
42
+
43
+ .uk-overlay-icon {
44
+ @if mixin-exists(hook-overlay-icon) {
45
+ @include hook-overlay-icon;
46
+ }
47
+ }
48
+
49
+
50
+ /* Style modifiers
51
+ ========================================================================== */
52
+
53
+ /*
54
+ * Default
55
+ */
56
+
57
+ .uk-overlay-default {
58
+ background: var(--overlay-default-background);
59
+ @if mixin-exists(hook-overlay-default) {
60
+ @include hook-overlay-default;
61
+ }
62
+ }
63
+
64
+ /*
65
+ * Primary
66
+ */
67
+
68
+ .uk-overlay-primary {
69
+ background: var(--overlay-primary-background);
70
+ @if mixin-exists(hook-overlay-primary) {
71
+ @include hook-overlay-primary;
72
+ }
73
+ }
74
+
75
+ // Color Mode
76
+ @if $overlay-primary-color-mode == light {
77
+ .uk-overlay-primary {
78
+ @extend .uk-light !optional;
79
+ }
80
+ }
81
+
82
+ @if $overlay-primary-color-mode == dark {
83
+ .uk-overlay-primary {
84
+ @extend .uk-dark !optional;
85
+ }
86
+ }
87
+
88
+
89
+ // Hooks
90
+ // ========================================================================
91
+
92
+ @if mixin-exists(hook-overlay-misc) {
93
+ @include hook-overlay-misc;
94
+ }
95
+
96
+
97
+ // Vars
98
+ // ========================================================================
99
+
100
+ :root {
101
+ --overlay-padding-horizontal: var(--global-gutter);
102
+ --overlay-padding-vertical: var(--global-gutter);
103
+ --overlay-default-background: #{$overlay-default-background};
104
+ --overlay-primary-background: #{$overlay-primary-background};
105
+ }
@@ -124,28 +124,55 @@
124
124
  */
125
125
 
126
126
  .uk-section-default {
127
+ --uk-inverse: #{$section-default-color-mode};
127
128
  background: var(--section-default-background);
128
129
  @if mixin-exists(hook-section-default) {
129
130
  @include hook-section-default;
130
131
  }
131
132
  }
132
133
 
134
+ @if $section-default-color-mode == light {
135
+ .uk-section-default:not(.uk-preserve-color) {
136
+ @extend .uk-light !optional;
137
+ }
138
+ }
139
+
140
+ @if $section-default-color-mode == dark {
141
+ .uk-section-default:not(.uk-preserve-color) {
142
+ @extend .uk-dark !optional;
143
+ }
144
+ }
145
+
133
146
  /*
134
147
  * Muted
135
148
  */
136
149
 
137
150
  .uk-section-muted {
151
+ --uk-inverse: #{$section-muted-color-mode};
138
152
  background: var(--section-muted-background);
139
153
  @if mixin-exists(hook-section-muted) {
140
154
  @include hook-section-muted;
141
155
  }
142
156
  }
143
157
 
158
+ @if $section-muted-color-mode == light {
159
+ .uk-section-muted:not(.uk-preserve-color) {
160
+ @extend .uk-light !optional;
161
+ }
162
+ }
163
+
164
+ @if $section-muted-color-mode == dark {
165
+ .uk-section-muted:not(.uk-preserve-color) {
166
+ @extend .uk-dark !optional;
167
+ }
168
+ }
169
+
144
170
  /*
145
171
  * Primary
146
172
  */
147
173
 
148
174
  .uk-section-primary {
175
+ --uk-inverse: #{$section-primary-color-mode};
149
176
  background: var(--section-primary-background);
150
177
  @if mixin-exists(hook-section-primary) {
151
178
  @include hook-section-primary;
@@ -169,6 +196,7 @@
169
196
  */
170
197
 
171
198
  .uk-section-secondary {
199
+ --uk-inverse: #{$section-secondary-color-mode};
172
200
  background: var(--section-secondary-background);
173
201
  @if mixin-exists(hook-section-secondary) {
174
202
  @include hook-section-secondary;
@@ -192,6 +220,7 @@
192
220
  */
193
221
 
194
222
  .uk-section-tertiary {
223
+ --uk-inverse: #{$section-tertiary-color-mode};
195
224
  background: var(--section-tertiary-background);
196
225
  @if mixin-exists(hook-section-tertiary) {
197
226
  @include hook-section-tertiary;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { type PolymorphicProps } from '../../components/Component';
3
3
  import { type BreakpointsConfig } from '../../types';
4
+ import './index.scss';
4
5
  export type TextAlign = 'left' | 'right' | 'center' | 'justify';
5
6
  export type TextOwnProps = {
6
7
  align?: TextAlign | BreakpointsConfig<TextAlign>;
@@ -3,6 +3,7 @@ import * as React from 'react';
3
3
  import { Component } from '../../components/Component';
4
4
  import { useConfig } from '../../components/ConfigProvider';
5
5
  import { getBreakpointsConfigClasses } from '../../utils';
6
+ import './index.scss';
6
7
  const defaultElement = 'span';
7
8
  export function Text(props) {
8
9
  const config = useConfig();
@@ -122,6 +122,7 @@
122
122
  .uk-text-emphasis { color: var(--text-emphasis-color) !important; }
123
123
  .uk-text-primary { color: var(--text-primary-color) !important; }
124
124
  .uk-text-secondary { color: var(--text-secondary-color) !important; }
125
+ .uk-text-tertiary { color: var(--text-tertiary-color) !important; }
125
126
  .uk-text-success { color: var(--text-success-color) !important; }
126
127
  .uk-text-warning { color: var(--text-warning-color) !important; }
127
128
  .uk-text-danger { color: var(--text-danger-color) !important; }
@@ -299,6 +300,7 @@ td.uk-text-break { word-break: break-all; }
299
300
  --text-emphasis-color: var(--global-emphasis-color);
300
301
  --text-primary-color: var(--global-primary-background);
301
302
  --text-secondary-color: var(--global-secondary-background);
303
+ --text-tertiary-color: var(--global-tertiary-background);
302
304
  --text-success-color: var(--global-success-background);
303
305
  --text-warning-color: var(--global-warning-background);
304
306
  --text-danger-color: var(--global-danger-background);
@@ -124,6 +124,7 @@
124
124
  */
125
125
 
126
126
  .uk-tile-default {
127
+ --uk-inverse: #{$tile-default-color-mode};
127
128
  background: var(--tile-default-background);
128
129
  @if mixin-exists(hook-tile-default) {
129
130
  @include hook-tile-default;
@@ -136,11 +137,25 @@
136
137
  }
137
138
  }
138
139
 
140
+ // Color Mode
141
+ @if $tile-default-color-mode == light {
142
+ .uk-tile-primary:not(.uk-preserve-color) {
143
+ @extend .uk-light !optional;
144
+ }
145
+ }
146
+
147
+ @if $tile-default-color-mode == dark {
148
+ .uk-tile-primary:not(.uk-preserve-color) {
149
+ @extend .uk-dark !optional;
150
+ }
151
+ }
152
+
139
153
  /*
140
154
  * Muted
141
155
  */
142
156
 
143
157
  .uk-tile-muted {
158
+ --uk-inverse: #{$tile-muted-color-mode};
144
159
  background: var(--tile-muted-background);
145
160
  @if mixin-exists(hook-tile-muted) {
146
161
  @include hook-tile-muted;
@@ -153,11 +168,25 @@
153
168
  }
154
169
  }
155
170
 
171
+ // Color Mode
172
+ @if $tile-default-color-mode == light {
173
+ .uk-tile-primary:not(.uk-preserve-color) {
174
+ @extend .uk-light !optional;
175
+ }
176
+ }
177
+
178
+ @if $tile-default-color-mode == dark {
179
+ .uk-tile-primary:not(.uk-preserve-color) {
180
+ @extend .uk-dark !optional;
181
+ }
182
+ }
183
+
156
184
  /*
157
185
  * Primary
158
186
  */
159
187
 
160
188
  .uk-tile-primary {
189
+ --uk-inverse: #{$tile-primary-color-mode};
161
190
  background: var(--tile-primary-background);
162
191
  @if mixin-exists(hook-tile-primary) {
163
192
  @include hook-tile-primary;
@@ -188,6 +217,7 @@
188
217
  */
189
218
 
190
219
  .uk-tile-secondary {
220
+ --uk-inverse: #{$tile-secondary-color-mode};
191
221
  background: var(--tile-secondary-background);
192
222
  @if mixin-exists(hook-tile-secondary) {
193
223
  @include hook-tile-secondary;
@@ -218,6 +248,7 @@
218
248
  */
219
249
 
220
250
  .uk-tile-tertiary {
251
+ --uk-inverse: #{$tile-tertiary-color-mode};
221
252
  background: var(--tile-tertiary-background);
222
253
  @if mixin-exists(hook-tile-tertiary) {
223
254
  @include hook-tile-tertiary;
@@ -14,6 +14,7 @@ export * from './components/Spinner';
14
14
  export * from './components/Alert';
15
15
  export * from './components/Badge';
16
16
  export * from './components/Label';
17
+ export * from './components/Overlay';
17
18
  export * from './components/Article';
18
19
  export * from './components/Section';
19
20
  export * from './components/Container';
@@ -34,6 +35,7 @@ export * from './components/Modal';
34
35
  export * from './components/Drawer';
35
36
  export * from './components/Component';
36
37
  export * from './components/ConfigProvider';
38
+ export * from './components/Inverse';
37
39
  export * from './components/Width';
38
40
  export * from './components/Text';
39
41
  export * from './components/Cover';