@jetbrains/kotlin-web-site-ui 4.8.0-alpha.3 → 4.8.0-alpha.5

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.
@@ -2,7 +2,7 @@ import React__default from 'react';
2
2
  import { useTheme } from '@rescui/ui-contexts';
3
3
  import classNames from 'classnames';
4
4
  import styles from './social-item.module.pcss.js';
5
- import { Button } from '@rescui/button';
5
+ import Button from '@rescui/button';
6
6
 
7
7
  const SocialItem = ({
8
8
  socialNetwork
@@ -1,51 +1,2 @@
1
1
  import './index.css';
2
- import React, { createContext, useContext, useRef, useCallback } from 'react';
3
- import cn from 'classnames';
4
- import { RemoveScrollBar } from 'react-remove-scroll-bar';
5
- import { useTheme } from '@rescui/ui-contexts';
6
- import styles from './sidebar.module.css.js';
7
- const SidebarContext = createContext({});
8
-
9
- function useSidebarContext() {
10
- return useContext(SidebarContext);
11
- }
12
-
13
- function Sidebar({
14
- className,
15
- classNameContent,
16
- mode,
17
- children,
18
- isOpen,
19
- onClose
20
- }) {
21
- const ref = useRef(null);
22
- const theme = useTheme();
23
- const onToggleClick = useCallback(e => {
24
- if (e.currentTarget == e.target) onClose();
25
- }, [onClose]);
26
- const classes = cn(className, styles.popup, styles[theme || 'light'], {
27
- [styles.close]: !isOpen,
28
- [styles[`${mode}Mode`]]: Boolean(mode && styles[`${mode}Mode`])
29
- });
30
- const disableProps = {};
31
-
32
- if (!isOpen) {
33
- disableProps.tabIndex = -1;
34
- disableProps.role = 'none';
35
- }
36
-
37
- return React.createElement(SidebarContext.Provider, {
38
- value: {
39
- onClose
40
- }
41
- }, React.createElement("div", {
42
- className: classes,
43
- onClick: onToggleClick,
44
- ...disableProps
45
- }, isOpen && React.createElement(RemoveScrollBar, null), React.createElement("div", {
46
- ref: ref,
47
- className: cn(classNameContent, styles.content)
48
- }, children)));
49
- }
50
-
51
- export { Sidebar, SidebarContext, useSidebarContext };
2
+ export { Sidebar, SidebarContext, useSidebarContext } from './sidebar.js';
@@ -1,10 +1,14 @@
1
- import React, { createContext, useRef, useCallback } from 'react';
1
+ import React, { createContext, useContext, useRef, useCallback } from 'react';
2
2
  import cn from 'classnames';
3
3
  import { RemoveScrollBar } from 'react-remove-scroll-bar';
4
4
  import { useTheme } from '@rescui/ui-contexts';
5
5
  import styles from './sidebar.module.css.js';
6
6
  const SidebarContext = createContext({});
7
7
 
8
+ function useSidebarContext() {
9
+ return useContext(SidebarContext);
10
+ }
11
+
8
12
  function Sidebar({
9
13
  className,
10
14
  classNameContent,
@@ -43,4 +47,4 @@ function Sidebar({
43
47
  }, children)));
44
48
  }
45
49
 
46
- export { Sidebar, SidebarContext };
50
+ export { Sidebar, SidebarContext, useSidebarContext };
@@ -1,112 +1,3 @@
1
- .ktl-sidebar-module_popup_bidR1 {
2
- position: fixed;
3
- top: 0;
4
- left: 0;
5
- right: 0;
6
- bottom: 0;
7
- z-index: 910;
8
-
9
- --ktf-header-animation-timing: 250ms;
10
- --ktf-header-animation-function: cubic-bezier(0.4, 0, 0.2, 1);
11
- }
12
-
13
- .ktl-sidebar-module_popup_bidR1::before {
14
- display: block;
15
- content: '';
16
-
17
- position: absolute;
18
- top: 0;
19
- bottom: 0;
20
- right: 0;
21
- left: 0;
22
-
23
- visibility: visible;
24
- -webkit-backdrop-filter: blur(4px);
25
- backdrop-filter: blur(4px);
26
-
27
- transition: background-color var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
28
- visibility var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
29
- -webkit-backdrop-filter var(--ktf-header-animation-function) var(--ktf-header-animation-timing);
30
-
31
- transition: background-color var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
32
- visibility var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
33
- backdrop-filter var(--ktf-header-animation-function) var(--ktf-header-animation-timing);
34
-
35
- transition: background-color var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
36
- visibility var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
37
- backdrop-filter var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
38
- -webkit-backdrop-filter var(--ktf-header-animation-function) var(--ktf-header-animation-timing);
39
- will-change: background-color, visible;
40
- }
41
-
42
- .ktl-sidebar-module_popup_bidR1.ktl-sidebar-module_tabletMode_vcf0T {
43
- --ktl-sidebar-width: 320px;
44
- }
45
-
46
- .ktl-sidebar-module_popup_bidR1.ktl-sidebar-module_mobileMode_yCmFY {
47
- --ktl-sidebar-width: 100%;
48
- }
49
-
50
- @media (min-width: 473px) {
51
-
52
- .ktl-sidebar-module_popup_bidR1:not(:is(.ktl-sidebar-module_tabletMode_vcf0T, .ktl-sidebar-module_mobileMode_yCmFY)) {
53
- --ktl-sidebar-width: 320px
54
- }
55
- }
56
-
57
- @media (max-width: 472px) {
58
-
59
- .ktl-sidebar-module_popup_bidR1:not(:is(.ktl-sidebar-module_tabletMode_vcf0T, .ktl-sidebar-module_mobileMode_yCmFY)) {
60
- --ktl-sidebar-width: 100%
61
- }
62
- }
63
-
64
- .ktl-sidebar-module_content_SzdiT {
65
- margin-left: auto;
66
- height: 100%;
67
- max-width: 100%;
68
- width: var(--ktl-sidebar-width, auto);
69
- }
70
-
71
- .ktl-sidebar-module_dark_GNaUl::before {
72
- background-color: rgba(0, 0, 0, 0.5);
73
- }
74
-
75
- .ktl-sidebar-module_dark_GNaUl > .ktl-sidebar-module_content_SzdiT {
76
- background-color: var(--ktl-dark-100);
77
- }
78
-
79
- .ktl-sidebar-module_light_OnGcf::before {
80
- background-color: rgba(0, 0, 0, 0.62);
81
- }
82
-
83
- .ktl-sidebar-module_light_OnGcf > .ktl-sidebar-module_content_SzdiT {
84
- background-color: #fff;
85
- }
86
-
87
- .ktl-sidebar-module_popup_bidR1 > .ktl-sidebar-module_content_SzdiT {
88
- transform: translateX(0);
89
-
90
- transition: transform var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
91
- visibility var(--ktf-header-animation-function) var(--ktf-header-animation-timing);
92
- will-change: transform;
93
- }
94
-
95
- .ktl-sidebar-module_close_lN33m {
96
- --ktf-header-animation-timing: 300ms;
97
- pointer-events: none;
98
- }
99
-
100
- .ktl-sidebar-module_close_lN33m::before {
101
- background: rgba(0, 0, 0, 0);
102
- visibility: hidden;
103
- }
104
-
105
- .ktl-sidebar-module_close_lN33m > .ktl-sidebar-module_content_SzdiT {
106
- transform: translateX(100%);
107
- visibility: hidden;
108
- }
109
-
110
1
  .ktl-popup-module_popup_b34tS {
111
2
  display: flex;
112
3
  flex-direction: column;
@@ -0,0 +1,3 @@
1
+ import './index.css';
2
+ export { SidebarMenu } from './sidebar-menu.js';
3
+ export { SidebarMenuHeader } from './menu-header.js';
@@ -2,9 +2,9 @@ import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { useTheme } from '@rescui/ui-contexts';
4
4
  import { CloseIcon } from '@rescui/icons';
5
- import Button from '@rescui/button';
6
- import styles from './menu-header.module.css.js';
5
+ import { Button } from '@rescui/button';
7
6
  import { useSidebarContext } from '@jetbrains/kotlin-web-site-ui/out/components/sidebar';
7
+ import styles from './menu-header.module.css.js';
8
8
 
9
9
  function SidebarMenuHeader({
10
10
  className,
@@ -1,11 +1,12 @@
1
- import './index.css';
2
1
  import React from 'react';
3
2
  import cn from 'classnames';
4
3
  import { Menu } from '@rescui/menu';
5
- import { Sidebar } from '../sidebar/index.js';
4
+ import { Sidebar } from '@jetbrains/kotlin-web-site-ui/out/components/sidebar';
6
5
  import { SidebarMenuItem } from './menu-item.js';
7
6
  import styles from './popup.module.css.js';
8
- export { SidebarMenuHeader } from './menu-header.js';
7
+ import '@rescui/ui-contexts';
8
+ import '@rescui/icons';
9
+ import '@rescui/button';
9
10
 
10
11
  function SidebarMenu({
11
12
  className,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jetbrains/kotlin-web-site-ui",
3
3
  "description": "UI components for Kotlin web sites development",
4
- "version": "4.8.0-alpha.3",
4
+ "version": "4.8.0-alpha.5",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
7
7
  "files": [
@@ -1,10 +0,0 @@
1
- var styles = {
2
- "popup": "ktl-sidebar-module_popup_bidR1",
3
- "tabletMode": "ktl-sidebar-module_tabletMode_vcf0T",
4
- "mobileMode": "ktl-sidebar-module_mobileMode_yCmFY",
5
- "content": "ktl-sidebar-module_content_SzdiT",
6
- "dark": "ktl-sidebar-module_dark_GNaUl",
7
- "light": "ktl-sidebar-module_light_OnGcf",
8
- "close": "ktl-sidebar-module_close_lN33m"
9
- };
10
- export { styles as default };