@jetbrains/kotlin-web-site-ui 4.1.0-alpha.1 → 4.1.0-alpha.10

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.
@@ -32,7 +32,10 @@ const Chapters = ({
32
32
  }, React__default.createElement("h4", {
33
33
  className: classNames(textCn('rs-h4'), styles.headliner)
34
34
  }, React__default.createElement("a", {
35
- className: classNames(styles.chapterTitle, textCn('rs-link')),
35
+ className: classNames(styles.chapterTitle, textCn('rs-link', {
36
+ mode: 'clear',
37
+ hardness: 'hard'
38
+ })),
36
39
  href: url,
37
40
  id: chapterId,
38
41
  dangerouslySetInnerHTML: {
@@ -1,17 +1,20 @@
1
- import React__default, { useState, useContext, useCallback } from 'react';
1
+ import React__default, { useState, useContext, useRef, useCallback, useLayoutEffect } from 'react';
2
+ import useScrollbarSize from 'react-scrollbar-size';
2
3
  import { ThemeProvider } from '@rescui/ui-contexts';
3
4
  import Input from '@rescui/input';
5
+ import Button from '@rescui/button';
4
6
  import Switcher from '@rescui/switcher';
5
7
  import { CloseIcon, ErrorIcon } from '@rescui/icons';
6
- import styles from './full-search.module.pcss.js';
7
8
  import { useSearch } from '../search-wrapper/use-search.js';
8
9
  import { ResultsList } from './results-list/results-list.js';
9
10
  import SearchContext from '../search-wrapper/search-context.js';
11
+ import styles from './full-search.module.pcss.js';
10
12
 
11
13
  const FullSearch = ({
12
14
  searchString,
13
15
  killSearch
14
16
  }) => {
17
+ const [isScrollbarCompensated, setIsScrollbarCompensated] = useState(false);
15
18
  const [inputValue, setInputValue] = useState(searchString);
16
19
  const {
17
20
  hits,
@@ -22,37 +25,68 @@ const FullSearch = ({
22
25
  matchingOptions,
23
26
  setMatching
24
27
  } = useContext(SearchContext);
25
- const clearSearch = useCallback(() => {
26
- setInputValue('');
27
- }, []);
28
+ const ref = useRef(null);
29
+ const headerRef = useRef(null);
30
+ const listRef = useRef(null);
31
+ const isResultsVisible = hits.length > 0 && inputValue;
28
32
  const handleSwitcherChange = useCallback(value => {
29
33
  setMatching(value);
30
34
  }, []);
35
+ const clearSearch = useCallback(() => {
36
+ setInputValue('');
37
+ }, []);
31
38
  const handleInputChange = useCallback(e => {
32
39
  setInputValue(e.target.value);
33
- }, [inputValue]);
40
+ }, [inputValue]); // Scrollbar compensation
41
+
42
+ const {
43
+ width
44
+ } = useScrollbarSize();
45
+ useLayoutEffect(() => {
46
+ if (headerRef.current && listRef.current) {
47
+ const countedHeight = headerRef.current.offsetHeight + listRef.current.offsetHeight;
48
+
49
+ if (isResultsVisible) {
50
+ setIsScrollbarCompensated(countedHeight < window.innerWidth);
51
+ } else {
52
+ setIsScrollbarCompensated(true);
53
+ }
54
+ }
55
+ }, [hits, inputValue]);
34
56
  return React__default.createElement(ThemeProvider, {
35
57
  theme: 'light'
36
58
  }, React__default.createElement("div", {
37
- className: styles.fullSearch
59
+ className: styles.fullSearch,
60
+ style: {
61
+ paddingRight: isScrollbarCompensated ? `${width}px` : 0
62
+ },
63
+ tabIndex: 1000,
64
+ ref: ref
65
+ }, React__default.createElement("div", {
66
+ className: styles.header,
67
+ ref: headerRef
38
68
  }, React__default.createElement("div", {
39
- className: styles.header
40
- }, React__default.createElement("button", {
41
- className: styles.closeSearch,
69
+ className: styles.closeSearch
70
+ }, React__default.createElement(Button, {
71
+ mode: 'clear',
72
+ size: 'l',
73
+ icon: React__default.createElement(CloseIcon, null),
42
74
  onClick: killSearch
43
- }, React__default.createElement(CloseIcon, {
44
- size: 'l'
45
75
  })), React__default.createElement("div", {
46
76
  className: styles.wrapper
47
77
  }, React__default.createElement(Input, {
48
78
  placeholder: 'Search',
49
79
  value: inputValue,
50
- onClear: clearSearch,
51
80
  onChange: handleInputChange,
52
- clearIcon: React__default.createElement(ErrorIcon, null),
81
+ onClear: clearSearch,
82
+ clearIcon: React__default.createElement("button", {
83
+ className: styles.fullSearchClearButton
84
+ }, React__default.createElement(ErrorIcon, {
85
+ size: 'l'
86
+ })),
53
87
  size: 'l',
54
88
  autoFocus: true
55
- }), React__default.createElement("div", {
89
+ }), isResultsVisible && React__default.createElement("div", {
56
90
  className: styles.switcher
57
91
  }, React__default.createElement(Switcher, {
58
92
  value: matching,
@@ -60,7 +94,8 @@ const FullSearch = ({
60
94
  options: matchingOptions,
61
95
  size: 'xs'
62
96
  })))), React__default.createElement("div", {
63
- className: styles.wrapper
97
+ className: styles.wrapper,
98
+ ref: listRef
64
99
  }, inputValue && React__default.createElement(ResultsList, {
65
100
  placeholder: placeholder,
66
101
  hits: hits
@@ -1,9 +1,10 @@
1
1
  var styles = {
2
2
  "fullSearch": "ktl-full-search-module_fullSearch_MTU8t",
3
3
  "closeSearch": "ktl-full-search-module_closeSearch_5vYDG",
4
+ "fullSearchClearButton": "ktl-full-search-module_fullSearchClearButton_DGS6T",
4
5
  "wrapper": "ktl-full-search-module_wrapper_9rxXb",
5
6
  "header": "ktl-full-search-module_header_Wltw0",
6
- "switcher": "ktl-full-search-module_switcher_o1RgM",
7
- "results": "ktl-full-search-module_results_svcSE"
7
+ "results": "ktl-full-search-module_results_svcSE",
8
+ "switcher": "ktl-full-search-module_switcher_o1RgM"
8
9
  };
9
10
  export { styles as default };
@@ -1,8 +1,8 @@
1
1
  import React__default from 'react';
2
+ import classNames from 'classnames';
2
3
  import { useTextStyles } from '@rescui/typography';
3
- import getExtendedHits from '../result/get-extended-hits.js';
4
+ import getExtendedHits from './get-extended-hits.js';
4
5
  import { Chapters } from '../chapters/chapters.js';
5
- import classNames from 'classnames';
6
6
  import styles from './hit-list.module.pcss.js';
7
7
 
8
8
  const HitList = ({
@@ -24,7 +24,10 @@ const HitList = ({
24
24
  }, React__default.createElement("h3", {
25
25
  className: textCn('rs-h3')
26
26
  }, React__default.createElement("a", {
27
- className: classNames(styles.titleLink, textCn('rs-link')),
27
+ className: classNames(styles.titleLink, textCn('rs-link', {
28
+ mode: 'clear',
29
+ hardness: 'hard'
30
+ })),
28
31
  href: url,
29
32
  dangerouslySetInnerHTML: {
30
33
  __html: title
@@ -5,7 +5,9 @@ import styles from './loading.module.pcss.js';
5
5
  const FullSearchLoader = () => {
6
6
  return React__default.createElement("div", {
7
7
  className: styles.loader
8
- }, React__default.createElement(LoadingIcon, null));
8
+ }, React__default.createElement(LoadingIcon, {
9
+ size: 'l'
10
+ }));
9
11
  };
10
12
 
11
13
  export { FullSearchLoader };
@@ -1,5 +1,6 @@
1
1
  import React__default, { forwardRef, useState, useMemo, useRef, useImperativeHandle, useLayoutEffect, useCallback, useEffect } from 'react';
2
2
  import { ThemeProvider } from '@rescui/ui-contexts';
3
+ import FocusManager from '@rescui/focus-manager';
3
4
  import useResizeObserver from '@react-hook/resize-observer';
4
5
  import OutsideClickHandler from 'react-outside-click-handler';
5
6
  import { LogoLarge } from './logo-large/logo-large.js';
@@ -26,7 +27,8 @@ const Header = forwardRef(({
26
27
  linkHandler,
27
28
  isPlayground,
28
29
  isUrlActive,
29
- searchConfig
30
+ searchConfig,
31
+ noScrollClassName
30
32
  }, forwardedRef) => {
31
33
  const [menuPopupExpanded, setMenuPopupExpanded] = useState(false);
32
34
  const [isMenuPopupVisible, setIsMenuPopupVisible] = useState(false);
@@ -60,11 +62,22 @@ const Header = forwardRef(({
60
62
  useEffect(() => {
61
63
  if (typeof document !== `undefined`) {
62
64
  document.addEventListener('keydown', fullSearchKeyHandler);
65
+ const focusManager = new FocusManager();
63
66
  return () => {
64
67
  document.removeEventListener('keydown', fullSearchKeyHandler);
68
+ focusManager.destroy();
65
69
  };
66
70
  }
67
71
  }, [fullSearchKeyHandler]);
72
+ useEffect(() => {
73
+ if (typeof document !== `undefined` && noScrollClassName) {
74
+ if (fullSearchActive) {
75
+ document.body.classList.add(noScrollClassName);
76
+ } else {
77
+ document.body.classList.remove(noScrollClassName);
78
+ }
79
+ }
80
+ }, [fullSearchActive]);
68
81
  return React__default.createElement(ThemeProvider, {
69
82
  theme: 'dark'
70
83
  }, React__default.createElement(SearchWrapper, {
@@ -275,11 +275,12 @@
275
275
  .ktl-result-module_result_EKhUw {
276
276
  box-sizing: border-box;
277
277
  display: block;
278
- padding: 16px 32px;
278
+ padding: 16px;
279
279
  text-decoration: none;
280
280
  }
281
281
  .ktl-result-module_result_EKhUw:hover {
282
282
  background: rgba(255, 255, 255, 0.1);
283
+ text-decoration: none;
283
284
  }
284
285
  .ktl-result-module_result_EKhUw:focus {
285
286
  outline: none;
@@ -292,6 +293,7 @@
292
293
 
293
294
  .ktl-result-module_resultTitle_DSpAT {
294
295
  margin-bottom: 6px;
296
+ overflow-wrap: break-word;
295
297
  }
296
298
 
297
299
  .ktl-result-module_text_fWBKG {
@@ -300,6 +302,12 @@
300
302
  -webkit-box-orient: vertical;
301
303
  overflow: hidden;
302
304
  }
305
+
306
+ @media (min-width: 768px) {
307
+ .ktl-result-module_result_EKhUw {
308
+ padding: 16px 32px;
309
+ }
310
+ }
303
311
  .ktl-list-module_results_LlxqY {
304
312
  box-sizing: border-box;
305
313
  max-height: 305px;
@@ -321,6 +329,7 @@
321
329
  border-radius: 24px;
322
330
  cursor: pointer;
323
331
  flex-shrink: 0;
332
+ transform: translateY(-6px);
324
333
  }
325
334
 
326
335
  .ktl-list-module_advancedSearch_XNy88:hover {
@@ -332,22 +341,49 @@
332
341
  box-shadow: rgba(107, 87, 255, 0.8) 0 0 0 4px;
333
342
  }
334
343
 
344
+ .ktl-list-module_searchString_rJnxa {
345
+ height: 40px;
346
+ display: -webkit-box;
347
+ -webkit-line-clamp: 2;
348
+ -webkit-box-orient: vertical;
349
+ overflow: hidden;
350
+ }
351
+
335
352
  @media (min-width: 768px) {
336
353
  .ktl-list-module_results_LlxqY {
337
354
  max-height: 434px;
338
355
  }
356
+
339
357
  .ktl-list-module_topBar_OO0XT {
340
358
  display: flex;
341
- align-items: center;
359
+ align-items: flex-start;
342
360
  justify-content: space-between;
343
- padding: 34px 32px 14px 32px;
361
+ padding: 34px 32px 4px 32px;
344
362
  }
345
363
  }
346
364
  .ktl-empty-module_empty_xh1i- {
347
365
  box-sizing: border-box;
348
366
  border: 1px solid rgba(255, 255, 255, 0.2);
349
367
  background: #323236;
350
- padding: 32px;
368
+ padding: 16px;
369
+ }
370
+
371
+ .ktl-empty-module_resultString_-8dzl {
372
+ display: -webkit-box;
373
+ -webkit-line-clamp: 3;
374
+ -webkit-box-orient: vertical;
375
+ overflow: hidden;
376
+ overflow-wrap: break-word;
377
+ }
378
+
379
+ @media (min-width: 768px) {
380
+ .ktl-empty-module_empty_xh1i- {
381
+ padding: 32px;
382
+ }
383
+
384
+ .ktl-empty-module_resultString_-8dzl {
385
+ -webkit-line-clamp: 2;
386
+ }
351
387
  }
352
388
  .ktl-loading-module_loading_CtOhW {
353
389
  box-sizing: border-box;
@@ -371,74 +407,27 @@
371
407
  transform: translateY(100%);
372
408
  }
373
409
 
374
- @media (min-width: 768px) {
410
+ @media (min-width: 640px) and (max-width: 768px) {
375
411
  .ktl-quick-search-module_wrapper_kkbQQ {
376
- left: 0;
377
- right: 0;
412
+ bottom: 12px;
378
413
  }
379
414
  }
380
- .ktl-full-search-module_fullSearch_MTU8t {
381
- display: none;
382
- box-sizing: border-box;
383
- position: fixed;
384
- width: 100%;
385
- height: 100%;
386
- top: 0;
387
- left: 0;
388
- background: #ffffff;
389
- overflow: scroll;
390
- }
391
-
392
- .ktl-full-search-module_closeSearch_5vYDG {
393
- padding: 0;
394
- margin: 0;
395
- border: 0;
396
- background: none;
397
- cursor: pointer;
398
- position: absolute;
399
- top: 40px;
400
- right: 40px;
401
- }
402
-
403
- .ktl-full-search-module_wrapper_9rxXb {
404
- max-width: 704px;
405
- margin: 0 auto;
406
- }
407
-
408
- .ktl-full-search-module_header_Wltw0 {
409
- width: 100%;
410
- padding-top: 120px;
411
- padding-bottom: 24px;
412
- position: sticky;
413
- top: 0;
414
- left: 0;
415
- background: #ffffff;
416
- z-index: 10;
417
- }
418
-
419
- .ktl-full-search-module_switcher_o1RgM {
420
- margin-top: 14px;
421
- display: flex;
422
- justify-content: flex-end;
423
- }
424
-
425
- .ktl-full-search-module_results_svcSE {
426
- margin-top: 14px;
427
- }
428
415
 
429
416
  @media (min-width: 768px) {
430
- .ktl-full-search-module_fullSearch_MTU8t {
431
- display: block;
417
+ .ktl-quick-search-module_wrapper_kkbQQ {
418
+ left: 0;
419
+ right: 0;
432
420
  }
433
421
  }
434
422
  .ktl-loading-module_loader_B2IQl {
435
- margin: 24px 0;
423
+ margin-top: 4px;
436
424
  }
437
425
  .ktl-loading-module_loader_B2IQl > svg {
438
426
  fill: #6B57FF;
439
427
  }
440
428
  .ktl-empty-module_wrapper_cNB8Y {
441
429
  display: block;
430
+ margin-top: 30px;
442
431
  }
443
432
 
444
433
  .ktl-empty-module_title_p2FMj {
@@ -457,9 +446,13 @@
457
446
  }
458
447
 
459
448
  .ktl-chapters-module_chapterTitle_b6Rdz {
460
- border-bottom-color: transparent;
449
+ //border-bottom-color: transparent;
461
450
  }
462
451
 
452
+ .ktl-chapters-module_chapterTitle_b6Rdz:hover {
453
+ //border-bottom-color: #19191C;
454
+ }
455
+
463
456
  .ktl-chapters-module_chapterTitle_b6Rdz em {
464
457
  background: rgba(127, 82, 255, 0.2);
465
458
  font-style: normal;
@@ -495,11 +488,7 @@
495
488
  margin-top: 12px;
496
489
  }
497
490
  .ktl-hit-list-module_hitList_1MP6m {
498
- margin: 24px 0;
499
- }
500
-
501
- .ktl-hit-list-module_titleLink_rdJ6u {
502
- border-bottom-color: transparent;
491
+ margin: 40px 0 50px 0;
503
492
  }
504
493
 
505
494
  .ktl-hit-list-module_titleLink_rdJ6u em {
@@ -507,11 +496,144 @@
507
496
  font-style: normal;
508
497
  }
509
498
 
499
+ .ktl-full-search-module_fullSearch_MTU8t {
500
+ display: none;
501
+ box-sizing: border-box;
502
+ position: fixed;
503
+ width: 100%;
504
+ height: 100%;
505
+ top: 0;
506
+ left: 0;
507
+ background: #ffffff;
508
+ overflow-y: auto;
509
+ }
510
+
511
+ .ktl-full-search-module_closeSearch_5vYDG {
512
+ position: absolute;
513
+ top: 40px;
514
+ right: 40px;
515
+ display: flex;
516
+ }
517
+
518
+ .ktl-full-search-module_fullSearchClearButton_DGS6T {
519
+ margin: 0;
520
+ padding: 0;
521
+ border: 0;
522
+ background: none;
523
+ display: flex;
524
+ cursor: pointer;
525
+
526
+ }
527
+
528
+ .ktl-full-search-module_fullSearchClearButton_DGS6T > svg {
529
+ opacity: 0.7;
530
+ }
531
+
532
+ .ktl-full-search-module_fullSearchClearButton_DGS6T:hover > svg {
533
+ opacity: 1;
534
+ }
535
+
536
+ .ktl-full-search-module_fullSearchClearButton_DGS6T:focus {
537
+ outline: none;
538
+ box-shadow: rgba(107, 87, 255, 0.8) 0 0 0 4px;
539
+ border-radius: 100%;
540
+ }
541
+
542
+ .ktl-full-search-module_fullSearchClearButton_DGS6T:focus > svg {
543
+ opacity: 1;
544
+ }
545
+
546
+ .ktl-full-search-module_wrapper_9rxXb {
547
+ max-width: 704px;
548
+ margin: 0 auto;
549
+ }
550
+
551
+ .ktl-full-search-module_header_Wltw0 {
552
+ width: 100%;
553
+ padding-top: 120px;
554
+ padding-bottom: 10px;
555
+ position: sticky;
556
+ top: 0;
557
+ left: 0;
558
+ background: #ffffff;
559
+ z-index: 10;
560
+ }
561
+
562
+ .ktl-full-search-module_results_svcSE {
563
+ margin-top: 14px;
564
+ }
565
+
566
+ .ktl-full-search-module_switcher_o1RgM {
567
+ display: flex;
568
+ justify-content: flex-end;
569
+ margin-top: 14px;
570
+ }
571
+
572
+ @media (min-width: 768px) {
573
+ .ktl-full-search-module_fullSearch_MTU8t {
574
+ display: block;
575
+ }
576
+ }
577
+
510
578
  .ktl-search-box-module_searchBox_0SgE9 {
511
579
  position: relative;
512
580
  width: 408px;
513
581
  }
514
582
 
583
+ .ktl-search-box-module_searchInput_ba2QS {
584
+ display: flex;
585
+ flex-direction: column;
586
+ width: 100%;
587
+ position: relative;
588
+ }
589
+
590
+ .ktl-search-box-module_searchMobileClose_fBF7e {
591
+ margin: 0;
592
+ padding: 0 8px;
593
+ border: 0;
594
+ background: none;
595
+ cursor: pointer;
596
+ position: absolute;
597
+ right: 0;
598
+ top: 0;
599
+ height: 100%;
600
+ display: flex;
601
+ align-items: center;
602
+ justify-content: center;
603
+ }
604
+
605
+ .ktl-search-box-module_searchMobileClose_fBF7e > svg {
606
+ fill: #ffffff;
607
+ }
608
+
609
+ .ktl-search-box-module_customClearButton_yecGK {
610
+ margin: 0;
611
+ padding: 0;
612
+ border: 0;
613
+ background: none;
614
+ display: flex;
615
+ cursor: pointer;
616
+ }
617
+
618
+ .ktl-search-box-module_customClearButton_yecGK > svg {
619
+ fill: #ffffff;
620
+ opacity: 0.7;
621
+ }
622
+
623
+ .ktl-search-box-module_customClearButton_yecGK:hover > svg {
624
+ opacity: 1;
625
+ }
626
+
627
+ .ktl-search-box-module_customClearButton_yecGK:focus {
628
+ outline: none;
629
+ box-shadow: rgba(107, 87, 255, 0.8) 0 0 0 4px;
630
+ border-radius: 100%;
631
+ }
632
+
633
+ .ktl-search-box-module_customClearButton_yecGK:focus > svg {
634
+ opacity: 1;
635
+ }
636
+
515
637
  @media (max-width: 767px) {
516
638
  .ktl-search-box-module_searchBox_0SgE9 {
517
639
  background: var(--ktl-dark-100);
@@ -525,6 +647,12 @@
525
647
  }
526
648
  }
527
649
 
650
+ @media (min-width: 768px) {
651
+ .ktl-search-box-module_searchMobileClose_fBF7e {
652
+ display: none;
653
+ }
654
+ }
655
+
528
656
  :root {
529
657
  --ktl-light-grey: #f4f4f4;
530
658
  --ktl-dark-100: rgba(39, 40, 44, 1);
@@ -1,5 +1,6 @@
1
1
  import React__default from 'react';
2
2
  import { useTextStyles } from '@rescui/typography';
3
+ import classNames from 'classnames';
3
4
  import styles from './empty.module.pcss.js';
4
5
 
5
6
  const EmptyResult = ({
@@ -9,7 +10,7 @@ const EmptyResult = ({
9
10
  return React__default.createElement("div", {
10
11
  className: styles.empty
11
12
  }, React__default.createElement("div", {
12
- className: textCn('rs-h4')
13
+ className: classNames(textCn('rs-h4'), styles.resultString)
13
14
  }, placeholder));
14
15
  };
15
16
 
@@ -1,4 +1,5 @@
1
1
  var styles = {
2
- "empty": "ktl-empty-module_empty_xh1i-"
2
+ "empty": "ktl-empty-module_empty_xh1i-",
3
+ "resultString": "ktl-empty-module_resultString_-8dzl"
3
4
  };
4
5
  export { styles as default };
@@ -1,6 +1,7 @@
1
- import React__default, { useMemo } from 'react';
1
+ import React__default from 'react';
2
2
  import { Result } from '../result/result.js';
3
3
  import { useTextStyles } from '@rescui/typography';
4
+ import classNames from 'classnames';
4
5
  import { isMacOs } from '../../is-macos.js';
5
6
  import styles from './list.module.pcss.js';
6
7
 
@@ -10,18 +11,19 @@ const ResultsList = ({
10
11
  toggleFullSearch
11
12
  }) => {
12
13
  const textCn = useTextStyles();
13
- const controlledSearchString = useMemo(() => searchString.length > 5 ? `${searchString.substring(0, 5)}...` : searchString, [searchString]);
14
14
  return React__default.createElement("div", {
15
15
  className: styles.results
16
16
  }, results.length ? React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
17
17
  className: styles.topBar
18
18
  }, React__default.createElement("div", {
19
- className: textCn('rs-text-3')
20
- }, "Showing results for \u00AB", controlledSearchString, "\u00BB"), React__default.createElement("button", {
19
+ className: classNames(textCn('rs-text-3'), styles.searchString)
20
+ }, "Showing results for \u00AB", searchString, "\u00BB"), React__default.createElement("button", {
21
21
  className: styles.advancedSearch,
22
22
  onClick: toggleFullSearch
23
23
  }, React__default.createElement("div", {
24
- className: textCn('rs-text-3')
24
+ className: classNames(textCn('rs-text-3', {
25
+ hardness: 'hard'
26
+ }))
25
27
  }, "Advanced search ", isMacOs() ? '⌘K' : 'Ctrl+K'))), results.map((searchResult, index) => React__default.createElement(Result, {
26
28
  key: index,
27
29
  hit: searchResult
@@ -1,6 +1,7 @@
1
1
  var styles = {
2
2
  "results": "ktl-list-module_results_LlxqY",
3
3
  "topBar": "ktl-list-module_topBar_OO0XT",
4
- "advancedSearch": "ktl-list-module_advancedSearch_XNy88"
4
+ "advancedSearch": "ktl-list-module_advancedSearch_XNy88",
5
+ "searchString": "ktl-list-module_searchString_rJnxa"
5
6
  };
6
7
  export { styles as default };
@@ -5,7 +5,6 @@ import { QuickSearch } from '../quick-search/quick-search.js';
5
5
  import { FullSearch } from '../full-search/full-search.js';
6
6
  import styles from './search-box.module.pcss.js';
7
7
  import { useSearch } from '../search-wrapper/use-search.js';
8
- import { isMacOs } from '../is-macos.js';
9
8
  import { ESC_CODE } from '../key-codes.js';
10
9
 
11
10
  const SearchBox = ({
@@ -41,19 +40,24 @@ const SearchBox = ({
41
40
  };
42
41
  }
43
42
  }, [escHandler]);
44
- const QuickSearchPlaceholder = isMobile ? 'Search' : `${isMacOs() ? '⌘K' : 'Ctrl+K'} for advanced search`;
45
43
  return React__default.createElement("div", {
46
44
  className: styles.searchBox
45
+ }, React__default.createElement("div", {
46
+ className: styles.searchInput
47
47
  }, React__default.createElement(Input, {
48
- placeholder: QuickSearchPlaceholder,
49
48
  iconType: 'left',
50
49
  value: searchInput,
51
50
  onChange: handleInput,
52
51
  onClear: isMobile ? closeHandler : handleClear,
53
52
  icon: React__default.createElement(SearchIcon, null),
54
- clearIcon: isMobile ? React__default.createElement(CloseIcon, null) : React__default.createElement(ErrorIcon, null),
53
+ clearIcon: isMobile ? React__default.createElement(CloseIcon, null) : React__default.createElement("button", {
54
+ className: styles.customClearButton
55
+ }, React__default.createElement(ErrorIcon, null)),
55
56
  autoFocus: true
56
- }), searchInput && React__default.createElement(QuickSearch, {
57
+ }), isMobile && React__default.createElement("button", {
58
+ className: styles.searchMobileClose,
59
+ onClick: closeHandler
60
+ }, React__default.createElement(CloseIcon, null))), searchInput && React__default.createElement(QuickSearch, {
57
61
  results: hits,
58
62
  searchString: searchInput,
59
63
  toggleFullSearch: toggleFullSearch,
@@ -1,4 +1,7 @@
1
1
  var styles = {
2
- "searchBox": "ktl-search-box-module_searchBox_0SgE9"
2
+ "searchBox": "ktl-search-box-module_searchBox_0SgE9",
3
+ "searchInput": "ktl-search-box-module_searchInput_ba2QS",
4
+ "searchMobileClose": "ktl-search-box-module_searchMobileClose_fBF7e",
5
+ "customClearButton": "ktl-search-box-module_customClearButton_yecGK"
3
6
  };
4
7
  export { styles as default };
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.1.0-alpha.1",
4
+ "version": "4.1.0-alpha.10",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
7
7
  "files": [
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@rescui/checkbox": "0.x",
27
+ "@rescui/focus-manager": "0.x",
27
28
  "@rescui/icons": "0.x",
28
29
  "@rescui/input": "0.x",
29
30
  "@rescui/tooltip": "0.x",
@@ -33,7 +34,8 @@
33
34
  "formik": "2.x",
34
35
  "react": ">= 16.8.6 < 18",
35
36
  "react-dom": ">= 16.8.6 < 18",
36
- "react-outside-click-handler": "^1.3.0",
37
+ "react-outside-click-handler": "1.x",
38
+ "react-scrollbar-size": "5.x",
37
39
  "react-swipeable-views": "0.x",
38
40
  "sha.js": "2.x"
39
41
  },
@@ -47,8 +49,9 @@
47
49
  "@react-hook/resize-observer": "^1.2.5",
48
50
  "@rescui/button": "^0.2.1",
49
51
  "@rescui/checkbox": "^0.1.0",
50
- "@rescui/icons": "^0.2.0",
51
- "@rescui/input": "^0.1.2",
52
+ "@rescui/focus-manager": "^0.1.1",
53
+ "@rescui/icons": "^0.8.2",
54
+ "@rescui/input": "^0.4.6",
52
55
  "@rescui/switcher": "^0.2.2",
53
56
  "@rescui/tooltip": "^0.1.2",
54
57
  "@rescui/typography": "^0.7.3",
@@ -110,6 +113,7 @@
110
113
  "react-modal": "^3.14.4",
111
114
  "react-outside-click-handler": "^1.3.0",
112
115
  "react-remove-scroll-bar": "^2.2.0",
116
+ "react-scrollbar-size": "^5.0.0",
113
117
  "react-swipeable-views": "^0.14.0",
114
118
  "rollup": "^2.70.1",
115
119
  "rollup-plugin-node-externals": "^4.0.0",