@memori.ai/ui 1.0.0-alpha
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/README.md +105 -0
- package/dist/components/Alert/Alert.d.ts +18 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +27 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/ButtonBase/ButtonBase.d.ts +28 -0
- package/dist/components/ButtonBase/index.d.ts +3 -0
- package/dist/components/Card/Card.d.ts +13 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +11 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +12 -0
- package/dist/components/ConfirmDialog/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.d.ts +32 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Dropdown/Dropdown.d.ts +11 -0
- package/dist/components/Dropdown/index.d.ts +2 -0
- package/dist/components/Expandable/Expandable.d.ts +15 -0
- package/dist/components/Expandable/helpers.d.ts +3 -0
- package/dist/components/Expandable/index.d.ts +2 -0
- package/dist/components/InputBase/InputBase.d.ts +49 -0
- package/dist/components/InputBase/index.d.ts +3 -0
- package/dist/components/Modal/Modal.d.ts +16 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +16 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Slider/Slider.d.ts +12 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Spin/Spin.d.ts +9 -0
- package/dist/components/Spin/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +11 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/i18n/I18nWrapper.d.ts +6 -0
- package/dist/icons/AI.d.ts +5 -0
- package/dist/icons/Alert.d.ts +5 -0
- package/dist/icons/ArrowUp.d.ts +5 -0
- package/dist/icons/Bug.d.ts +5 -0
- package/dist/icons/Chat.d.ts +5 -0
- package/dist/icons/ChevronDown.d.ts +5 -0
- package/dist/icons/ChevronLeft.d.ts +5 -0
- package/dist/icons/ChevronRight.d.ts +5 -0
- package/dist/icons/ChevronUp.d.ts +5 -0
- package/dist/icons/Clear.d.ts +5 -0
- package/dist/icons/Close.d.ts +6 -0
- package/dist/icons/Code.d.ts +5 -0
- package/dist/icons/Copy.d.ts +5 -0
- package/dist/icons/DeepThought.d.ts +5 -0
- package/dist/icons/Delete.d.ts +5 -0
- package/dist/icons/Document.d.ts +5 -0
- package/dist/icons/Download.d.ts +5 -0
- package/dist/icons/Edit.d.ts +5 -0
- package/dist/icons/Expand.d.ts +5 -0
- package/dist/icons/Eye.d.ts +5 -0
- package/dist/icons/EyeInvisible.d.ts +5 -0
- package/dist/icons/Facebook.d.ts +5 -0
- package/dist/icons/Feedback.d.ts +5 -0
- package/dist/icons/File.d.ts +5 -0
- package/dist/icons/FileExcel.d.ts +5 -0
- package/dist/icons/FilePdf.d.ts +5 -0
- package/dist/icons/FileWord.d.ts +5 -0
- package/dist/icons/Fullscreen.d.ts +5 -0
- package/dist/icons/FullscreenExit.d.ts +5 -0
- package/dist/icons/Group.d.ts +5 -0
- package/dist/icons/History.d.ts +6 -0
- package/dist/icons/Image.d.ts +4 -0
- package/dist/icons/Info.d.ts +5 -0
- package/dist/icons/Link.d.ts +5 -0
- package/dist/icons/Linkedin.d.ts +5 -0
- package/dist/icons/Loading.d.ts +6 -0
- package/dist/icons/Logout.d.ts +5 -0
- package/dist/icons/Mail.d.ts +5 -0
- package/dist/icons/MapMarker.d.ts +5 -0
- package/dist/icons/MenuHorizontal.d.ts +6 -0
- package/dist/icons/MenuVertical.d.ts +6 -0
- package/dist/icons/Message.d.ts +5 -0
- package/dist/icons/Microphone.d.ts +5 -0
- package/dist/icons/Minus.d.ts +5 -0
- package/dist/icons/MinusCircle.d.ts +5 -0
- package/dist/icons/PaperClip.d.ts +5 -0
- package/dist/icons/Picture.d.ts +5 -0
- package/dist/icons/Plus.d.ts +5 -0
- package/dist/icons/Preview.d.ts +4 -0
- package/dist/icons/Print.d.ts +6 -0
- package/dist/icons/QuestionHelp.d.ts +5 -0
- package/dist/icons/Refresh.d.ts +5 -0
- package/dist/icons/SelectIcon.d.ts +5 -0
- package/dist/icons/Send.d.ts +5 -0
- package/dist/icons/Setting.d.ts +5 -0
- package/dist/icons/Share.d.ts +5 -0
- package/dist/icons/Sound.d.ts +5 -0
- package/dist/icons/SoundDeactivated.d.ts +5 -0
- package/dist/icons/Telegram.d.ts +5 -0
- package/dist/icons/ThumbDown.d.ts +5 -0
- package/dist/icons/ThumbUp.d.ts +5 -0
- package/dist/icons/Translation.d.ts +5 -0
- package/dist/icons/Twitter.d.ts +5 -0
- package/dist/icons/Upload.d.ts +4 -0
- package/dist/icons/User.d.ts +5 -0
- package/dist/icons/Warning.d.ts +5 -0
- package/dist/icons/WhatsApp.d.ts +5 -0
- package/dist/index.d.ts +13 -0
- package/dist/memori-ai-ui.css +2 -0
- package/dist/memori-ai-ui.es.js +6400 -0
- package/dist/memori-ai-ui.umd.js +23 -0
- package/package.json +97 -0
- package/src/components/Alert/Alert.css +95 -0
- package/src/components/Alert/Alert.stories.tsx +156 -0
- package/src/components/Alert/Alert.test.tsx +122 -0
- package/src/components/Alert/Alert.tsx +124 -0
- package/src/components/Alert/__snapshots__/Alert.test.tsx.snap +67 -0
- package/src/components/Alert/index.tsx +2 -0
- package/src/components/Button/Button.css +173 -0
- package/src/components/Button/Button.stories.tsx +173 -0
- package/src/components/Button/Button.test.tsx +80 -0
- package/src/components/Button/Button.tsx +104 -0
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +204 -0
- package/src/components/Button/index.tsx +2 -0
- package/src/components/ButtonBase/ButtonBase.stories.tsx +194 -0
- package/src/components/ButtonBase/ButtonBase.tsx +84 -0
- package/src/components/ButtonBase/index.tsx +3 -0
- package/src/components/ButtonBase/styles.module.css +135 -0
- package/src/components/Card/Card.css +67 -0
- package/src/components/Card/Card.stories.tsx +104 -0
- package/src/components/Card/Card.test.tsx +67 -0
- package/src/components/Card/Card.tsx +58 -0
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +321 -0
- package/src/components/Card/index.tsx +2 -0
- package/src/components/Checkbox/Checkbox.css +114 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +77 -0
- package/src/components/Checkbox/Checkbox.test.tsx +50 -0
- package/src/components/Checkbox/Checkbox.tsx +61 -0
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +131 -0
- package/src/components/Checkbox/index.tsx +2 -0
- package/src/components/ConfirmDialog/ConfirmDialog.css +44 -0
- package/src/components/ConfirmDialog/ConfirmDialog.stories.tsx +235 -0
- package/src/components/ConfirmDialog/ConfirmDialog.test.tsx +129 -0
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +73 -0
- package/src/components/ConfirmDialog/__snapshots__/ConfirmDialog.test.tsx.snap +11 -0
- package/src/components/ConfirmDialog/index.tsx +2 -0
- package/src/components/Details/Details.css +66 -0
- package/src/components/Details/Details.stories.tsx +67 -0
- package/src/components/Drawer/Drawer.css +210 -0
- package/src/components/Drawer/Drawer.stories.tsx +275 -0
- package/src/components/Drawer/Drawer.test.tsx +158 -0
- package/src/components/Drawer/Drawer.tsx +242 -0
- package/src/components/Drawer/__snapshots__/Drawer.test.tsx.snap +21 -0
- package/src/components/Drawer/index.tsx +2 -0
- package/src/components/Dropdown/Dropdown.css +177 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +73 -0
- package/src/components/Dropdown/Dropdown.test.tsx +88 -0
- package/src/components/Dropdown/Dropdown.tsx +88 -0
- package/src/components/Dropdown/__snapshots__/Dropdown.test.tsx.snap +141 -0
- package/src/components/Dropdown/index.tsx +2 -0
- package/src/components/Expandable/Expandable.css +15 -0
- package/src/components/Expandable/Expandable.stories.tsx +196 -0
- package/src/components/Expandable/Expandable.test.tsx +143 -0
- package/src/components/Expandable/Expandable.tsx +122 -0
- package/src/components/Expandable/__snapshots__/Expandable.test.tsx.snap +199 -0
- package/src/components/Expandable/helpers.ts +16 -0
- package/src/components/Expandable/index.tsx +2 -0
- package/src/components/InputBase/InputBase.stories.tsx +237 -0
- package/src/components/InputBase/InputBase.tsx +105 -0
- package/src/components/InputBase/index.tsx +3 -0
- package/src/components/InputBase/styles.module.css +96 -0
- package/src/components/Modal/Modal.css +95 -0
- package/src/components/Modal/Modal.stories.tsx +184 -0
- package/src/components/Modal/Modal.test.tsx +129 -0
- package/src/components/Modal/Modal.tsx +124 -0
- package/src/components/Modal/__snapshots__/Modal.test.tsx.snap +17 -0
- package/src/components/Modal/index.tsx +2 -0
- package/src/components/Select/Select.css +134 -0
- package/src/components/Select/Select.stories.tsx +85 -0
- package/src/components/Select/Select.test.tsx +85 -0
- package/src/components/Select/Select.tsx +84 -0
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +261 -0
- package/src/components/Select/index.tsx +2 -0
- package/src/components/Slider/Slider.css +194 -0
- package/src/components/Slider/Slider.stories.tsx +85 -0
- package/src/components/Slider/Slider.test.tsx +55 -0
- package/src/components/Slider/Slider.tsx +157 -0
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +419 -0
- package/src/components/Slider/index.tsx +2 -0
- package/src/components/Spin/Spin.css +31 -0
- package/src/components/Spin/Spin.stories.tsx +65 -0
- package/src/components/Spin/Spin.test.tsx +47 -0
- package/src/components/Spin/Spin.tsx +34 -0
- package/src/components/Spin/__snapshots__/Spin.test.tsx.snap +193 -0
- package/src/components/Spin/index.tsx +2 -0
- package/src/components/Table/Table.css +130 -0
- package/src/components/Table/Table.stories.tsx +274 -0
- package/src/components/Tooltip/Tooltip.css +160 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +136 -0
- package/src/components/Tooltip/Tooltip.test.tsx +110 -0
- package/src/components/Tooltip/Tooltip.tsx +46 -0
- package/src/components/Tooltip/__snapshots__/Tooltip.test.tsx.snap +163 -0
- package/src/components/Tooltip/index.tsx +2 -0
- package/src/components/definitions.stories.tsx +150 -0
- package/src/i18n/I18nWrapper.tsx +13 -0
- package/src/i18n/i18n.ts +34 -0
- package/src/icons/AI.tsx +38 -0
- package/src/icons/Alert.tsx +31 -0
- package/src/icons/ArrowUp.tsx +28 -0
- package/src/icons/Bug.tsx +81 -0
- package/src/icons/Chat.tsx +30 -0
- package/src/icons/ChevronDown.tsx +26 -0
- package/src/icons/ChevronLeft.tsx +28 -0
- package/src/icons/ChevronRight.tsx +28 -0
- package/src/icons/ChevronUp.tsx +24 -0
- package/src/icons/Clear.tsx +23 -0
- package/src/icons/Close.tsx +30 -0
- package/src/icons/Code.tsx +30 -0
- package/src/icons/Copy.tsx +30 -0
- package/src/icons/DeepThought.tsx +38 -0
- package/src/icons/Delete.tsx +23 -0
- package/src/icons/Document.tsx +52 -0
- package/src/icons/Download.tsx +23 -0
- package/src/icons/Edit.tsx +17 -0
- package/src/icons/Expand.tsx +23 -0
- package/src/icons/Eye.tsx +17 -0
- package/src/icons/EyeInvisible.tsx +24 -0
- package/src/icons/Facebook.tsx +23 -0
- package/src/icons/Feedback.tsx +27 -0
- package/src/icons/File.tsx +17 -0
- package/src/icons/FileExcel.tsx +23 -0
- package/src/icons/FilePdf.tsx +23 -0
- package/src/icons/FileWord.tsx +23 -0
- package/src/icons/Fullscreen.tsx +23 -0
- package/src/icons/FullscreenExit.tsx +23 -0
- package/src/icons/Group.tsx +30 -0
- package/src/icons/History.tsx +33 -0
- package/src/icons/Image.tsx +37 -0
- package/src/icons/Info.tsx +37 -0
- package/src/icons/Link.tsx +17 -0
- package/src/icons/Linkedin.tsx +23 -0
- package/src/icons/Loading.tsx +28 -0
- package/src/icons/Logout.tsx +33 -0
- package/src/icons/Mail.tsx +17 -0
- package/src/icons/MapMarker.tsx +26 -0
- package/src/icons/MenuHorizontal.tsx +29 -0
- package/src/icons/MenuVertical.tsx +29 -0
- package/src/icons/Message.tsx +23 -0
- package/src/icons/Microphone.tsx +23 -0
- package/src/icons/Minus.tsx +23 -0
- package/src/icons/MinusCircle.tsx +24 -0
- package/src/icons/PaperClip.tsx +23 -0
- package/src/icons/Picture.tsx +23 -0
- package/src/icons/Plus.tsx +18 -0
- package/src/icons/Preview.tsx +31 -0
- package/src/icons/Print.tsx +37 -0
- package/src/icons/QuestionHelp.tsx +34 -0
- package/src/icons/Refresh.tsx +30 -0
- package/src/icons/SelectIcon.tsx +28 -0
- package/src/icons/Send.tsx +17 -0
- package/src/icons/Setting.tsx +23 -0
- package/src/icons/Share.tsx +23 -0
- package/src/icons/Sound.tsx +23 -0
- package/src/icons/SoundDeactivated.tsx +27 -0
- package/src/icons/Telegram.tsx +26 -0
- package/src/icons/ThumbDown.tsx +29 -0
- package/src/icons/ThumbUp.tsx +29 -0
- package/src/icons/Translation.tsx +24 -0
- package/src/icons/Twitter.tsx +23 -0
- package/src/icons/Upload.tsx +34 -0
- package/src/icons/User.tsx +17 -0
- package/src/icons/Warning.tsx +27 -0
- package/src/icons/WhatsApp.tsx +24 -0
- package/src/icons/icons.stories.css +5 -0
- package/src/icons/icons.stories.tsx +110 -0
- package/src/icons/loading.css +14 -0
- package/src/index.ts +15 -0
- package/src/styles/utils.css +17 -0
- package/src/styles.css +4 -0
- package/src/theme/variables.css +110 -0
- package/src/vite-env.d.ts +6 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { FC, JSX } from 'react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import cx from 'classnames'
|
|
4
|
+
|
|
5
|
+
import './Tooltip.css'
|
|
6
|
+
|
|
7
|
+
export interface Props {
|
|
8
|
+
content: string | JSX.Element | React.ReactNode
|
|
9
|
+
className?: string
|
|
10
|
+
align?:
|
|
11
|
+
| 'left'
|
|
12
|
+
| 'right'
|
|
13
|
+
| 'topLeft'
|
|
14
|
+
| 'topRight'
|
|
15
|
+
| 'bottomLeft'
|
|
16
|
+
| 'bottomRight'
|
|
17
|
+
disabled?: boolean
|
|
18
|
+
children: React.ReactNode
|
|
19
|
+
visible?: boolean
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const Tooltip: FC<Props> = ({
|
|
23
|
+
content,
|
|
24
|
+
className,
|
|
25
|
+
align = 'right',
|
|
26
|
+
disabled = false,
|
|
27
|
+
visible = false,
|
|
28
|
+
children,
|
|
29
|
+
}) => (
|
|
30
|
+
<div
|
|
31
|
+
className={cx(
|
|
32
|
+
'memori-tooltip',
|
|
33
|
+
`memori-tooltip--align-${align}`,
|
|
34
|
+
className,
|
|
35
|
+
{
|
|
36
|
+
'memori-tooltip--disabled': disabled,
|
|
37
|
+
'memori-tooltip--visible': visible,
|
|
38
|
+
},
|
|
39
|
+
)}
|
|
40
|
+
>
|
|
41
|
+
<div className="memori-tooltip--content">{content}</div>
|
|
42
|
+
<div className="memori-tooltip--trigger">{children}</div>
|
|
43
|
+
</div>
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
export default Tooltip
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`renders Tooltip aligned left unchanged 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="memori-tooltip memori-tooltip--align-left memori-tooltip--visible"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="memori-tooltip--content"
|
|
10
|
+
>
|
|
11
|
+
Here is some tooltip content by default as I am controlled
|
|
12
|
+
</div>
|
|
13
|
+
<div
|
|
14
|
+
class="memori-tooltip--trigger"
|
|
15
|
+
>
|
|
16
|
+
Hover me
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports[`renders Tooltip aligned right unchanged 1`] = `
|
|
23
|
+
<div>
|
|
24
|
+
<div
|
|
25
|
+
class="memori-tooltip memori-tooltip--align-right memori-tooltip--visible"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
class="memori-tooltip--content"
|
|
29
|
+
>
|
|
30
|
+
Here is some tooltip content by default as I am controlled
|
|
31
|
+
</div>
|
|
32
|
+
<div
|
|
33
|
+
class="memori-tooltip--trigger"
|
|
34
|
+
>
|
|
35
|
+
Hover me
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
exports[`renders Tooltip aligned top left unchanged 1`] = `
|
|
42
|
+
<div>
|
|
43
|
+
<div
|
|
44
|
+
class="memori-tooltip memori-tooltip--align-topLeft memori-tooltip--visible"
|
|
45
|
+
>
|
|
46
|
+
<div
|
|
47
|
+
class="memori-tooltip--content"
|
|
48
|
+
>
|
|
49
|
+
Here is some tooltip content by default as I am controlled
|
|
50
|
+
</div>
|
|
51
|
+
<div
|
|
52
|
+
class="memori-tooltip--trigger"
|
|
53
|
+
>
|
|
54
|
+
Hover me
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
exports[`renders Tooltip aligned top right unchanged 1`] = `
|
|
61
|
+
<div>
|
|
62
|
+
<div
|
|
63
|
+
class="memori-tooltip memori-tooltip--align-topRight memori-tooltip--visible"
|
|
64
|
+
>
|
|
65
|
+
<div
|
|
66
|
+
class="memori-tooltip--content"
|
|
67
|
+
>
|
|
68
|
+
Here is some tooltip content by default as I am controlled
|
|
69
|
+
</div>
|
|
70
|
+
<div
|
|
71
|
+
class="memori-tooltip--trigger"
|
|
72
|
+
>
|
|
73
|
+
Hover me
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
exports[`renders Tooltip disabled unchanged 1`] = `
|
|
80
|
+
<div>
|
|
81
|
+
<div
|
|
82
|
+
class="memori-tooltip memori-tooltip--align-right memori-tooltip--disabled"
|
|
83
|
+
>
|
|
84
|
+
<div
|
|
85
|
+
class="memori-tooltip--content"
|
|
86
|
+
>
|
|
87
|
+
Here is some tooltip content but I am disabled
|
|
88
|
+
</div>
|
|
89
|
+
<div
|
|
90
|
+
class="memori-tooltip--trigger"
|
|
91
|
+
>
|
|
92
|
+
Hover me
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
`;
|
|
97
|
+
|
|
98
|
+
exports[`renders Tooltip unchanged 1`] = `
|
|
99
|
+
<div>
|
|
100
|
+
<div
|
|
101
|
+
class="memori-tooltip memori-tooltip--align-right"
|
|
102
|
+
>
|
|
103
|
+
<div
|
|
104
|
+
class="memori-tooltip--content"
|
|
105
|
+
>
|
|
106
|
+
Here is some tooltip content
|
|
107
|
+
</div>
|
|
108
|
+
<div
|
|
109
|
+
class="memori-tooltip--trigger"
|
|
110
|
+
>
|
|
111
|
+
Hover me
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
exports[`renders Tooltip visible unchanged 1`] = `
|
|
118
|
+
<div>
|
|
119
|
+
<div
|
|
120
|
+
class="memori-tooltip memori-tooltip--align-right memori-tooltip--visible"
|
|
121
|
+
>
|
|
122
|
+
<div
|
|
123
|
+
class="memori-tooltip--content"
|
|
124
|
+
>
|
|
125
|
+
Here is some tooltip content by default as I am controlled
|
|
126
|
+
</div>
|
|
127
|
+
<div
|
|
128
|
+
class="memori-tooltip--trigger"
|
|
129
|
+
>
|
|
130
|
+
Hover me
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
exports[`renders Tooltip with jsx content unchanged 1`] = `
|
|
137
|
+
<div>
|
|
138
|
+
<div
|
|
139
|
+
class="memori-tooltip memori-tooltip--align-right"
|
|
140
|
+
>
|
|
141
|
+
<div
|
|
142
|
+
class="memori-tooltip--content"
|
|
143
|
+
>
|
|
144
|
+
<p>
|
|
145
|
+
Here we have some JSX, useful for
|
|
146
|
+
<a
|
|
147
|
+
href="https://memori.ai"
|
|
148
|
+
rel="noopener noreferrer"
|
|
149
|
+
target="_blank"
|
|
150
|
+
>
|
|
151
|
+
links
|
|
152
|
+
</a>
|
|
153
|
+
, for example.
|
|
154
|
+
</p>
|
|
155
|
+
</div>
|
|
156
|
+
<div
|
|
157
|
+
class="memori-tooltip--trigger"
|
|
158
|
+
>
|
|
159
|
+
Hover me
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
`;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import type { StoryObj, Meta } from '@storybook/react-vite'
|
|
3
|
+
|
|
4
|
+
const ColorDisplay = ({ color }: { color: string }) => (
|
|
5
|
+
<div
|
|
6
|
+
style={{
|
|
7
|
+
marginTop: '1rem',
|
|
8
|
+
}}
|
|
9
|
+
>
|
|
10
|
+
<dt style={{ minWidth: 250, fontSize: '12px', marginBottom: '0.5rem' }}>
|
|
11
|
+
--{color}
|
|
12
|
+
</dt>
|
|
13
|
+
<dd>
|
|
14
|
+
<div
|
|
15
|
+
className={`color-${color}`}
|
|
16
|
+
style={{
|
|
17
|
+
width: '100px',
|
|
18
|
+
height: '100px',
|
|
19
|
+
boxShadow: '0 0 0.5rem rgba(0, 0, 0, 0.1)',
|
|
20
|
+
borderRadius: '10px',
|
|
21
|
+
background: `var(--${color})`,
|
|
22
|
+
}}
|
|
23
|
+
title={color}
|
|
24
|
+
/>
|
|
25
|
+
</dd>
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
const colors = [
|
|
30
|
+
'memori-primary',
|
|
31
|
+
'memori-primary-text',
|
|
32
|
+
'memori-inner-bg',
|
|
33
|
+
'memori-chat-bubble-bg',
|
|
34
|
+
'memori-text-color',
|
|
35
|
+
'memori-button-bg',
|
|
36
|
+
'memori-button-text',
|
|
37
|
+
'memori-button-border-color',
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
const variables = [
|
|
41
|
+
'memori-inner-content-pad',
|
|
42
|
+
'memori-button-padding',
|
|
43
|
+
'memori-drawer--width',
|
|
44
|
+
'memori-drawer--width--md',
|
|
45
|
+
'memori-drawer--width--lg',
|
|
46
|
+
'memori-modal--width',
|
|
47
|
+
'memori-modal--width--md',
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
const Definitions = () => (
|
|
51
|
+
<div>
|
|
52
|
+
<h2>Colors</h2>
|
|
53
|
+
<dl>
|
|
54
|
+
{colors.map(color => (
|
|
55
|
+
<ColorDisplay
|
|
56
|
+
key={color}
|
|
57
|
+
color={color}
|
|
58
|
+
/>
|
|
59
|
+
))}
|
|
60
|
+
</dl>
|
|
61
|
+
<h2>Others</h2>
|
|
62
|
+
<dl>
|
|
63
|
+
<div
|
|
64
|
+
style={{
|
|
65
|
+
marginTop: '1rem',
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<dt style={{ minWidth: 250, fontSize: '12px', marginBottom: '0.5rem' }}>
|
|
69
|
+
<p>--memori-button-box-shadow +</p>
|
|
70
|
+
<p>--memori-button-radius</p>
|
|
71
|
+
</dt>
|
|
72
|
+
<dd>
|
|
73
|
+
<div
|
|
74
|
+
style={{
|
|
75
|
+
boxShadow: 'var(--memori-button-box-shadow)',
|
|
76
|
+
border: '1px solid #f3f3f3',
|
|
77
|
+
width: '100px',
|
|
78
|
+
height: '100px',
|
|
79
|
+
borderRadius: 'var(--memori-button-radius)',
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
82
|
+
</dd>
|
|
83
|
+
</div>
|
|
84
|
+
<div
|
|
85
|
+
style={{
|
|
86
|
+
marginTop: '1rem',
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
<dt style={{ minWidth: 250, fontSize: '12px', marginBottom: '0.5rem' }}>
|
|
90
|
+
--memori-blur-background
|
|
91
|
+
</dt>
|
|
92
|
+
<dd>
|
|
93
|
+
<div
|
|
94
|
+
style={{
|
|
95
|
+
backgroundColor: '#eee',
|
|
96
|
+
backgroundPosition: 'center center',
|
|
97
|
+
backgroundRepeat: 'no-repeat',
|
|
98
|
+
backgroundSize: 'cover',
|
|
99
|
+
backgroundImage:
|
|
100
|
+
'url(https://aisuru.com/images/aisuru/og-image.png)',
|
|
101
|
+
filter: 'blur(var(--memori-blur-background, 0))',
|
|
102
|
+
width: '200px',
|
|
103
|
+
height: '100px',
|
|
104
|
+
borderRadius: '10px',
|
|
105
|
+
}}
|
|
106
|
+
/>
|
|
107
|
+
</dd>
|
|
108
|
+
</div>
|
|
109
|
+
</dl>
|
|
110
|
+
<ul
|
|
111
|
+
style={{
|
|
112
|
+
padding: 0,
|
|
113
|
+
margin: 0,
|
|
114
|
+
listStyle: 'none',
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
{variables.map(v => (
|
|
118
|
+
<li
|
|
119
|
+
key={v}
|
|
120
|
+
style={{
|
|
121
|
+
marginTop: '1rem',
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
<p
|
|
125
|
+
style={{ minWidth: 250, fontSize: '12px', marginBottom: '0.5rem' }}
|
|
126
|
+
>
|
|
127
|
+
--{v}
|
|
128
|
+
</p>
|
|
129
|
+
</li>
|
|
130
|
+
))}
|
|
131
|
+
</ul>
|
|
132
|
+
</div>
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
const meta = {
|
|
136
|
+
title: 'Definitions/CSS Variables',
|
|
137
|
+
component: Definitions,
|
|
138
|
+
// tags: ['autodocs'],
|
|
139
|
+
parameters: {
|
|
140
|
+
controls: { expanded: true },
|
|
141
|
+
},
|
|
142
|
+
} satisfies Meta<typeof Definitions>
|
|
143
|
+
|
|
144
|
+
export default meta
|
|
145
|
+
|
|
146
|
+
type Story = StoryObj<typeof meta>
|
|
147
|
+
|
|
148
|
+
export const Default: Story = {
|
|
149
|
+
args: {},
|
|
150
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { I18nextProvider } from 'react-i18next'
|
|
3
|
+
import i18n from './i18n'
|
|
4
|
+
|
|
5
|
+
export interface Props {
|
|
6
|
+
children: React.ReactNode
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const I18nWrapper = ({ children }: Props) => {
|
|
10
|
+
return <I18nextProvider i18n={i18n}>{children}</I18nextProvider>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default I18nWrapper
|
package/src/i18n/i18n.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createInstance } from 'i18next'
|
|
2
|
+
|
|
3
|
+
const resources = {
|
|
4
|
+
en: {
|
|
5
|
+
translation: [],
|
|
6
|
+
},
|
|
7
|
+
it: {
|
|
8
|
+
translation: [],
|
|
9
|
+
},
|
|
10
|
+
es: {
|
|
11
|
+
translation: [],
|
|
12
|
+
},
|
|
13
|
+
fr: {
|
|
14
|
+
translation: [],
|
|
15
|
+
},
|
|
16
|
+
de: {
|
|
17
|
+
translation: [],
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const i18n = createInstance({
|
|
22
|
+
resources,
|
|
23
|
+
lng: 'en',
|
|
24
|
+
fallbackLng: 'it',
|
|
25
|
+
supportedLngs: ['en', 'it', 'fr', 'es', 'de'],
|
|
26
|
+
nonExplicitSupportedLngs: true,
|
|
27
|
+
interpolation: {
|
|
28
|
+
escapeValue: false,
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
i18n.init()
|
|
33
|
+
|
|
34
|
+
export default i18n
|
package/src/icons/AI.tsx
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
const AI = ({ className, title }: { className?: string; title?: string }) => (
|
|
4
|
+
<svg
|
|
5
|
+
{...(!title ? { 'aria-hidden': 'true' } : {})}
|
|
6
|
+
focusable="false"
|
|
7
|
+
role="img"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
fill="none"
|
|
11
|
+
className={className}
|
|
12
|
+
aria-label={title}
|
|
13
|
+
>
|
|
14
|
+
<g
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
fillRule="evenodd"
|
|
17
|
+
clipRule="evenodd"
|
|
18
|
+
>
|
|
19
|
+
<path
|
|
20
|
+
fillRule="evenodd"
|
|
21
|
+
d="M0 4a4 4 0 014-4h16a4 4 0 014 4v16a4 4 0 01-4 4H4a4 4 0 01-4-4zm4-2.4A2.4 2.4 0 001.6 4v16A2.4 2.4 0 004 22.4h16a2.4 2.4 0 002.4-2.4V4A2.4 2.4 0 0020 1.6z"
|
|
22
|
+
clipRule="evenodd"
|
|
23
|
+
></path>
|
|
24
|
+
<path
|
|
25
|
+
fillRule="evenodd"
|
|
26
|
+
d="M9.715 8.442a.798.798 0 00-1.43 0l-3.2 6.4a.799.799 0 101.431.716l.579-1.158h3.811l.578 1.158a.8.8 0 001.431-.716zm.391 4.358L9 10.589 7.894 12.8z"
|
|
27
|
+
clipRule="evenodd"
|
|
28
|
+
></path>
|
|
29
|
+
<path
|
|
30
|
+
fillRule="evenodd"
|
|
31
|
+
d="M17 8c.552 0 1 .358 1 .8v6.4c0 .442-.448.8-1 .8s-1-.358-1-.8V8.8c0-.442.448-.8 1-.8z"
|
|
32
|
+
clipRule="evenodd"
|
|
33
|
+
></path>
|
|
34
|
+
</g>
|
|
35
|
+
</svg>
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
export default AI
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
const Alert = ({
|
|
4
|
+
className,
|
|
5
|
+
title,
|
|
6
|
+
}: {
|
|
7
|
+
className?: string
|
|
8
|
+
title?: string
|
|
9
|
+
}) => (
|
|
10
|
+
<svg
|
|
11
|
+
width="800px"
|
|
12
|
+
height="800px"
|
|
13
|
+
viewBox="0 0 24 24"
|
|
14
|
+
fill="none"
|
|
15
|
+
{...(!title ? { 'aria-hidden': 'true' } : {})}
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
className={className}
|
|
18
|
+
aria-label={title}
|
|
19
|
+
color="currentColor"
|
|
20
|
+
>
|
|
21
|
+
<path
|
|
22
|
+
d="M12 16H12.01M12 8V12M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z"
|
|
23
|
+
stroke="currentColor"
|
|
24
|
+
strokeWidth="2"
|
|
25
|
+
strokeLinecap="round"
|
|
26
|
+
strokeLinejoin="round"
|
|
27
|
+
/>
|
|
28
|
+
</svg>
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
export default Alert
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
const ArrowUp = ({
|
|
4
|
+
className,
|
|
5
|
+
title,
|
|
6
|
+
}: {
|
|
7
|
+
className?: string
|
|
8
|
+
title?: string
|
|
9
|
+
}) => (
|
|
10
|
+
<svg
|
|
11
|
+
{...(!title ? { 'aria-hidden': 'true' } : {})}
|
|
12
|
+
focusable="false"
|
|
13
|
+
role="img"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
|
+
fill="none"
|
|
17
|
+
stroke="currentColor"
|
|
18
|
+
strokeLinecap="round"
|
|
19
|
+
strokeLinejoin="round"
|
|
20
|
+
strokeWidth="2"
|
|
21
|
+
className={className}
|
|
22
|
+
aria-label={title}
|
|
23
|
+
>
|
|
24
|
+
<path d="M12 19V5M5 12l7-7 7 7"></path>
|
|
25
|
+
</svg>
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
export default ArrowUp
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
const Bug = ({ className, title }: { className?: string; title?: string }) => (
|
|
4
|
+
<svg
|
|
5
|
+
width="800px"
|
|
6
|
+
height="800px"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
fill="none"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
className={className}
|
|
11
|
+
aria-label={title}
|
|
12
|
+
color="currentColor"
|
|
13
|
+
>
|
|
14
|
+
<path
|
|
15
|
+
d="M19 15V11.9375C19 9.76288 17.2371 8 15.0625 8H8.9375C6.76288 8 5 9.76288 5 11.9375V15C5 18.866 8.13401 22 12 22C15.866 22 19 18.866 19 15Z"
|
|
16
|
+
stroke="currentColor"
|
|
17
|
+
strokeWidth="1.5"
|
|
18
|
+
/>
|
|
19
|
+
<path
|
|
20
|
+
d="M16.5 8.5V7.5C16.5 5.01472 14.4853 3 12 3C9.51472 3 7.5 5.01472 7.5 7.5V8.5"
|
|
21
|
+
stroke="currentColor"
|
|
22
|
+
strokeWidth="1.5"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
d="M19 14H22"
|
|
26
|
+
stroke="currentColor"
|
|
27
|
+
strokeWidth="1.5"
|
|
28
|
+
strokeLinecap="round"
|
|
29
|
+
/>
|
|
30
|
+
<path
|
|
31
|
+
d="M5 14H2"
|
|
32
|
+
stroke="currentColor"
|
|
33
|
+
strokeWidth="1.5"
|
|
34
|
+
strokeLinecap="round"
|
|
35
|
+
/>
|
|
36
|
+
<path
|
|
37
|
+
d="M14.5 3.5L17 2"
|
|
38
|
+
stroke="currentColor"
|
|
39
|
+
strokeWidth="1.5"
|
|
40
|
+
strokeLinecap="round"
|
|
41
|
+
/>
|
|
42
|
+
<path
|
|
43
|
+
d="M9.5 3.5L7 2"
|
|
44
|
+
stroke="currentColor"
|
|
45
|
+
strokeWidth="1.5"
|
|
46
|
+
strokeLinecap="round"
|
|
47
|
+
/>
|
|
48
|
+
<path
|
|
49
|
+
d="M20.5 20.0002L18.5 19.2002"
|
|
50
|
+
stroke="currentColor"
|
|
51
|
+
strokeWidth="1.5"
|
|
52
|
+
strokeLinecap="round"
|
|
53
|
+
/>
|
|
54
|
+
<path
|
|
55
|
+
d="M20.5 7.9998L18.5 8.7998"
|
|
56
|
+
stroke="currentColor"
|
|
57
|
+
strokeWidth="1.5"
|
|
58
|
+
strokeLinecap="round"
|
|
59
|
+
/>
|
|
60
|
+
<path
|
|
61
|
+
d="M3.5 20.0002L5.5 19.2002"
|
|
62
|
+
stroke="currentColor"
|
|
63
|
+
strokeWidth="1.5"
|
|
64
|
+
strokeLinecap="round"
|
|
65
|
+
/>
|
|
66
|
+
<path
|
|
67
|
+
d="M3.5 7.9998L5.5 8.7998"
|
|
68
|
+
stroke="currentColor"
|
|
69
|
+
strokeWidth="1.5"
|
|
70
|
+
strokeLinecap="round"
|
|
71
|
+
/>
|
|
72
|
+
<path
|
|
73
|
+
d="M12 21.5V15"
|
|
74
|
+
stroke="currentColor"
|
|
75
|
+
strokeWidth="1.5"
|
|
76
|
+
strokeLinecap="round"
|
|
77
|
+
/>
|
|
78
|
+
</svg>
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
export default Bug
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
const ChatRound = ({
|
|
4
|
+
className,
|
|
5
|
+
title,
|
|
6
|
+
}: {
|
|
7
|
+
className?: string
|
|
8
|
+
title?: string
|
|
9
|
+
}) => (
|
|
10
|
+
<svg
|
|
11
|
+
{...(!title ? { 'aria-hidden': 'true' } : {})}
|
|
12
|
+
focusable="false"
|
|
13
|
+
width="24"
|
|
14
|
+
height="24"
|
|
15
|
+
role="img"
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
fill="none"
|
|
19
|
+
className={className}
|
|
20
|
+
aria-label={title}
|
|
21
|
+
>
|
|
22
|
+
<path
|
|
23
|
+
d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 13.5997 2.37562 15.1116 3.04346 16.4525C3.22094 16.8088 3.28001 17.2161 3.17712 17.6006L2.58151 19.8267C2.32295 20.793 3.20701 21.677 4.17335 21.4185L6.39939 20.8229C6.78393 20.72 7.19121 20.7791 7.54753 20.9565C8.88837 21.6244 10.4003 22 12 22Z"
|
|
24
|
+
stroke="currentColor"
|
|
25
|
+
stroke-width="1.5"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
export default ChatRound
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
const ChevronDown = ({
|
|
3
|
+
className,
|
|
4
|
+
title,
|
|
5
|
+
}: {
|
|
6
|
+
className?: string
|
|
7
|
+
title?: string
|
|
8
|
+
}) => (
|
|
9
|
+
<svg
|
|
10
|
+
fill="#000000"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
width="800px"
|
|
13
|
+
height="800px"
|
|
14
|
+
viewBox="0 0 52 52"
|
|
15
|
+
enableBackground="new 0 0 52 52"
|
|
16
|
+
xmlSpace="preserve"
|
|
17
|
+
{...(!title ? { 'aria-hidden': 'true' } : {})}
|
|
18
|
+
focusable="false"
|
|
19
|
+
role="img"
|
|
20
|
+
className={className}
|
|
21
|
+
aria-label={title}
|
|
22
|
+
>
|
|
23
|
+
<path d="M47.6,17.8L27.1,38.5c-0.6,0.6-1.6,0.6-2.2,0L4.4,17.8c-0.6-0.6-0.6-1.6,0-2.2l2.2-2.2 c0.6-0.6,1.6-0.6,2.2,0l16.1,16.3c0.6,0.6,1.6,0.6,2.2,0l16.1-16.2c0.6-0.6,1.6-0.6,2.2,0l2.2,2.2C48.1,16.3,48.1,17.2,47.6,17.8z" />
|
|
24
|
+
</svg>
|
|
25
|
+
)
|
|
26
|
+
export default ChevronDown
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
const ChevronLeft = ({
|
|
4
|
+
className,
|
|
5
|
+
title,
|
|
6
|
+
}: {
|
|
7
|
+
className?: string
|
|
8
|
+
title?: string
|
|
9
|
+
}) => (
|
|
10
|
+
<svg
|
|
11
|
+
{...(!title ? { 'aria-hidden': 'true' } : {})}
|
|
12
|
+
focusable="false"
|
|
13
|
+
role="img"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
|
+
fill="none"
|
|
17
|
+
stroke="currentColor"
|
|
18
|
+
strokeLinecap="round"
|
|
19
|
+
strokeLinejoin="round"
|
|
20
|
+
strokeWidth="2"
|
|
21
|
+
className={className}
|
|
22
|
+
aria-label={title}
|
|
23
|
+
>
|
|
24
|
+
<path d="M15 18L9 12 15 6"></path>
|
|
25
|
+
</svg>
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
export default ChevronLeft
|