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/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/emoji/index.tsx +37 -26
- package/src/components/emoji/styles.ts +29 -13
package/package.json
CHANGED
|
@@ -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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
</
|
|
56
|
-
</
|
|
57
|
-
|
|
58
|
-
|
|
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
|
|
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<{
|
|
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
|
-
${({ $
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
+
`;
|