forstok-ui-lib 8.9.9 → 8.10.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "8.9.9",
3
+ "version": "8.10.0",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -28,34 +28,45 @@ const EmojiComponent = ({
28
28
  return (
29
29
  <EmojiContainer
30
30
  $mode={$mode}
31
+ $isDisabled={isDisabled}
31
32
  {...($emojiStyles && { style: $emojiStyles })}
32
33
  >
33
- <DropDownComponent
34
- $internalWidth="314px"
35
- $bottom="40px"
36
- $openPosition="left"
37
- $placement="top"
38
- >
39
- <div aria-label="control">
40
- <ButtonComponent
41
- $mode="clearL"
42
- title="Choose Emoticon"
43
- disabled={isDisabled}
44
- >
45
- <IconComponent $name="emoji" $width="12px" />
46
- </ButtonComponent>
47
- </div>
48
- <div aria-label="body">
49
- <EmojiPicker.Root onEmojiSelect={onChange}>
50
- <EmojiPicker.Search />
51
- <EmojiPicker.Viewport>
52
- <EmojiPicker.Loading>Loading…</EmojiPicker.Loading>
53
- <EmojiPicker.Empty>No emoji found.</EmojiPicker.Empty>
54
- <EmojiPicker.List />
55
- </EmojiPicker.Viewport>
56
- </EmojiPicker.Root>
57
- </div>
58
- </DropDownComponent>
34
+ {isDisabled ? (
35
+ <section className="_refContainer">
36
+ <section>
37
+ <ButtonComponent
38
+ $mode="clearL"
39
+ title="Choose Emoticon"
40
+ disabled={isDisabled}
41
+ >
42
+ <IconComponent $name="emoji" $width="12px" />
43
+ </ButtonComponent>
44
+ </section>
45
+ </section>
46
+ ) : (
47
+ <DropDownComponent
48
+ $internalWidth="314px"
49
+ $bottom="40px"
50
+ $openPosition="left"
51
+ $placement="top"
52
+ >
53
+ <div aria-label="control">
54
+ <ButtonComponent $mode="clearL" title="Choose Emoticon">
55
+ <IconComponent $name="emoji" $width="12px" />
56
+ </ButtonComponent>
57
+ </div>
58
+ <div aria-label="body">
59
+ <EmojiPicker.Root onEmojiSelect={onChange}>
60
+ <EmojiPicker.Search />
61
+ <EmojiPicker.Viewport>
62
+ <EmojiPicker.Loading>Loading…</EmojiPicker.Loading>
63
+ <EmojiPicker.Empty>No emoji found.</EmojiPicker.Empty>
64
+ <EmojiPicker.List />
65
+ </EmojiPicker.Viewport>
66
+ </EmojiPicker.Root>
67
+ </div>
68
+ </DropDownComponent>
69
+ )}
59
70
  </EmojiContainer>
60
71
  );
61
72
  };
@@ -1,19 +1,28 @@
1
- import styled, { css } from 'styled-components';
1
+ import styled, { css } from "styled-components";
2
2
 
3
3
  const ButtonStyles = css`
4
- background-color: var(--mt-clr-bg__fc);
4
+ background-color: var(--mt-clr-bg__fc);
5
5
  width: 30px;
6
6
  height: 30px;
7
- padding: .5em .675em;
7
+ padding: 0.5em 0.675em;
8
8
  &:hover {
9
9
  background-color: var(--mt-clr-bg);
10
10
  }
11
- `
11
+ &:disabled {
12
+ background-color: rgba(0, 0, 0, 0.17) !important;
13
+ box-shadow: none !important;
14
+ cursor: default;
15
+ color: var(--sec-clr);
16
+ }
17
+ `;
12
18
 
13
- export const EmojiContainer = styled.div<{ $mode?: 'textarea' }>`
19
+ export const EmojiContainer = styled.div<{
20
+ $mode?: "textarea";
21
+ $isDisabled?: boolean;
22
+ }>`
14
23
  cursor: pointer;
15
24
  ._refContainer > section > button {
16
- ${ButtonStyles};
25
+ ${ButtonStyles};
17
26
  }
18
27
  input {
19
28
  padding-left: 10px;
@@ -25,10 +34,17 @@ export const EmojiContainer = styled.div<{ $mode?: 'textarea' }>`
25
34
  padding: 0;
26
35
  }
27
36
  }
28
- ${({ $mode }) => $mode === 'textarea' && css`
29
- position: absolute;
30
- left: .75em;
31
- bottom: .75em;
32
- z-index: 1;
33
- `}
34
- `
37
+ ${({ $isDisabled }) =>
38
+ $isDisabled &&
39
+ css`
40
+ cursor: default;
41
+ `}
42
+ ${({ $mode }) =>
43
+ $mode === "textarea" &&
44
+ css`
45
+ position: absolute;
46
+ left: 0.75em;
47
+ bottom: 0.75em;
48
+ z-index: 1;
49
+ `}
50
+ `;