@memori.ai/ui 1.0.4-alpha → 1.1.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/CHANGELOG.md +54 -1
- package/README.md +82 -6
- package/dist/index.d.ts +895 -11
- package/dist/memori-ai-ui.cjs.js +57 -0
- package/dist/memori-ai-ui.cjs.js.map +1 -0
- package/dist/memori-ai-ui.css +1 -2
- package/dist/memori-ai-ui.es.js +6139 -549
- package/dist/memori-ai-ui.es.js.map +1 -0
- package/package.json +59 -30
- package/dist/components/Alert/Alert.d.ts +0 -18
- package/dist/components/Alert/index.d.ts +0 -2
- package/dist/components/Button/Button.d.ts +0 -63
- package/dist/components/Button/index.d.ts +0 -3
- package/dist/components/Card/Card.d.ts +0 -13
- package/dist/components/Card/index.d.ts +0 -2
- package/dist/components/Checkbox/Checkbox.d.ts +0 -11
- package/dist/components/Checkbox/index.d.ts +0 -2
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +0 -12
- package/dist/components/ConfirmDialog/index.d.ts +0 -2
- package/dist/components/Drawer/Drawer.d.ts +0 -32
- package/dist/components/Drawer/index.d.ts +0 -2
- package/dist/components/Expandable/Expandable.d.ts +0 -15
- package/dist/components/Expandable/helpers.d.ts +0 -3
- package/dist/components/Expandable/index.d.ts +0 -2
- package/dist/components/InputBase/InputBase.d.ts +0 -49
- package/dist/components/InputBase/index.d.ts +0 -3
- package/dist/components/Modal/Modal.d.ts +0 -16
- package/dist/components/Modal/index.d.ts +0 -2
- package/dist/components/Select/Select.d.ts +0 -16
- package/dist/components/Select/index.d.ts +0 -2
- package/dist/components/Slider/Slider.d.ts +0 -12
- package/dist/components/Slider/index.d.ts +0 -2
- package/dist/components/Spin/Spin.d.ts +0 -9
- package/dist/components/Spin/index.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -11
- package/dist/components/Tooltip/index.d.ts +0 -2
- package/dist/i18n/I18nWrapper.d.ts +0 -6
- package/dist/icons/AI.d.ts +0 -5
- package/dist/icons/Alert.d.ts +0 -5
- package/dist/icons/ArrowUp.d.ts +0 -5
- package/dist/icons/Bug.d.ts +0 -5
- package/dist/icons/Chat.d.ts +0 -5
- package/dist/icons/ChevronDown.d.ts +0 -5
- package/dist/icons/ChevronLeft.d.ts +0 -5
- package/dist/icons/ChevronRight.d.ts +0 -5
- package/dist/icons/ChevronUp.d.ts +0 -5
- package/dist/icons/Clear.d.ts +0 -5
- package/dist/icons/Close.d.ts +0 -6
- package/dist/icons/Code.d.ts +0 -5
- package/dist/icons/Copy.d.ts +0 -5
- package/dist/icons/DeepThought.d.ts +0 -5
- package/dist/icons/Delete.d.ts +0 -5
- package/dist/icons/Document.d.ts +0 -5
- package/dist/icons/Download.d.ts +0 -5
- package/dist/icons/Edit.d.ts +0 -5
- package/dist/icons/Expand.d.ts +0 -5
- package/dist/icons/Eye.d.ts +0 -5
- package/dist/icons/EyeInvisible.d.ts +0 -5
- package/dist/icons/Facebook.d.ts +0 -5
- package/dist/icons/Feedback.d.ts +0 -5
- package/dist/icons/File.d.ts +0 -5
- package/dist/icons/FileExcel.d.ts +0 -5
- package/dist/icons/FilePdf.d.ts +0 -5
- package/dist/icons/FileWord.d.ts +0 -5
- package/dist/icons/Fullscreen.d.ts +0 -5
- package/dist/icons/FullscreenExit.d.ts +0 -5
- package/dist/icons/Group.d.ts +0 -5
- package/dist/icons/History.d.ts +0 -6
- package/dist/icons/Image.d.ts +0 -4
- package/dist/icons/Info.d.ts +0 -5
- package/dist/icons/Link.d.ts +0 -5
- package/dist/icons/Linkedin.d.ts +0 -5
- package/dist/icons/Loading.d.ts +0 -6
- package/dist/icons/Logout.d.ts +0 -5
- package/dist/icons/Mail.d.ts +0 -5
- package/dist/icons/MapMarker.d.ts +0 -5
- package/dist/icons/MenuHorizontal.d.ts +0 -6
- package/dist/icons/MenuVertical.d.ts +0 -6
- package/dist/icons/Message.d.ts +0 -5
- package/dist/icons/Microphone.d.ts +0 -5
- package/dist/icons/Minus.d.ts +0 -5
- package/dist/icons/MinusCircle.d.ts +0 -5
- package/dist/icons/PaperClip.d.ts +0 -5
- package/dist/icons/Picture.d.ts +0 -5
- package/dist/icons/Plus.d.ts +0 -5
- package/dist/icons/Preview.d.ts +0 -4
- package/dist/icons/Print.d.ts +0 -6
- package/dist/icons/QuestionHelp.d.ts +0 -5
- package/dist/icons/Refresh.d.ts +0 -5
- package/dist/icons/SelectIcon.d.ts +0 -5
- package/dist/icons/Send.d.ts +0 -5
- package/dist/icons/Setting.d.ts +0 -5
- package/dist/icons/Share.d.ts +0 -5
- package/dist/icons/Sound.d.ts +0 -5
- package/dist/icons/SoundDeactivated.d.ts +0 -5
- package/dist/icons/Telegram.d.ts +0 -5
- package/dist/icons/ThumbDown.d.ts +0 -5
- package/dist/icons/ThumbUp.d.ts +0 -5
- package/dist/icons/Translation.d.ts +0 -5
- package/dist/icons/Twitter.d.ts +0 -5
- package/dist/icons/Upload.d.ts +0 -4
- package/dist/icons/User.d.ts +0 -5
- package/dist/icons/Warning.d.ts +0 -5
- package/dist/icons/WhatsApp.d.ts +0 -5
- package/dist/memori-ai-ui.umd.js +0 -10
- package/src/components/Alert/Alert.css +0 -95
- package/src/components/Alert/Alert.stories.tsx +0 -156
- package/src/components/Alert/Alert.test.tsx +0 -122
- package/src/components/Alert/Alert.tsx +0 -124
- package/src/components/Alert/__snapshots__/Alert.test.tsx.snap +0 -70
- package/src/components/Alert/index.tsx +0 -2
- package/src/components/Button/Button.stories.tsx +0 -629
- package/src/components/Button/Button.tsx +0 -161
- package/src/components/Button/index.tsx +0 -3
- package/src/components/Button/styles.module.css +0 -312
- package/src/components/Card/Card.css +0 -67
- package/src/components/Card/Card.stories.tsx +0 -104
- package/src/components/Card/Card.test.tsx +0 -67
- package/src/components/Card/Card.tsx +0 -58
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +0 -321
- package/src/components/Card/index.tsx +0 -2
- package/src/components/Checkbox/Checkbox.css +0 -114
- package/src/components/Checkbox/Checkbox.stories.tsx +0 -77
- package/src/components/Checkbox/Checkbox.test.tsx +0 -50
- package/src/components/Checkbox/Checkbox.tsx +0 -61
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +0 -131
- package/src/components/Checkbox/index.tsx +0 -2
- package/src/components/ConfirmDialog/ConfirmDialog.css +0 -44
- package/src/components/ConfirmDialog/ConfirmDialog.stories.tsx +0 -235
- package/src/components/ConfirmDialog/ConfirmDialog.test.tsx +0 -129
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +0 -73
- package/src/components/ConfirmDialog/__snapshots__/ConfirmDialog.test.tsx.snap +0 -11
- package/src/components/ConfirmDialog/index.tsx +0 -2
- package/src/components/Details/Details.css +0 -66
- package/src/components/Details/Details.stories.tsx +0 -67
- package/src/components/Drawer/Drawer.css +0 -210
- package/src/components/Drawer/Drawer.stories.tsx +0 -275
- package/src/components/Drawer/Drawer.test.tsx +0 -158
- package/src/components/Drawer/Drawer.tsx +0 -243
- package/src/components/Drawer/__snapshots__/Drawer.test.tsx.snap +0 -21
- package/src/components/Drawer/index.tsx +0 -2
- package/src/components/Expandable/Expandable.css +0 -15
- package/src/components/Expandable/Expandable.stories.tsx +0 -196
- package/src/components/Expandable/Expandable.test.tsx +0 -143
- package/src/components/Expandable/Expandable.tsx +0 -120
- package/src/components/Expandable/__snapshots__/Expandable.test.tsx.snap +0 -199
- package/src/components/Expandable/helpers.ts +0 -16
- package/src/components/Expandable/index.tsx +0 -2
- package/src/components/InputBase/InputBase.stories.tsx +0 -237
- package/src/components/InputBase/InputBase.tsx +0 -107
- package/src/components/InputBase/index.tsx +0 -3
- package/src/components/InputBase/styles.module.css +0 -96
- package/src/components/Modal/Modal.css +0 -95
- package/src/components/Modal/Modal.stories.tsx +0 -184
- package/src/components/Modal/Modal.test.tsx +0 -129
- package/src/components/Modal/Modal.tsx +0 -124
- package/src/components/Modal/__snapshots__/Modal.test.tsx.snap +0 -17
- package/src/components/Modal/index.tsx +0 -2
- package/src/components/Select/Select.css +0 -134
- package/src/components/Select/Select.stories.tsx +0 -85
- package/src/components/Select/Select.test.tsx +0 -85
- package/src/components/Select/Select.tsx +0 -84
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +0 -261
- package/src/components/Select/index.tsx +0 -2
- package/src/components/Slider/Slider.css +0 -194
- package/src/components/Slider/Slider.stories.tsx +0 -85
- package/src/components/Slider/Slider.test.tsx +0 -55
- package/src/components/Slider/Slider.tsx +0 -157
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +0 -419
- package/src/components/Slider/index.tsx +0 -2
- package/src/components/Spin/Spin.css +0 -31
- package/src/components/Spin/Spin.stories.tsx +0 -65
- package/src/components/Spin/Spin.test.tsx +0 -47
- package/src/components/Spin/Spin.tsx +0 -34
- package/src/components/Spin/__snapshots__/Spin.test.tsx.snap +0 -193
- package/src/components/Spin/index.tsx +0 -2
- package/src/components/Table/Table.css +0 -130
- package/src/components/Table/Table.stories.tsx +0 -272
- package/src/components/Tooltip/Tooltip.css +0 -160
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -136
- package/src/components/Tooltip/Tooltip.test.tsx +0 -110
- package/src/components/Tooltip/Tooltip.tsx +0 -46
- package/src/components/Tooltip/__snapshots__/Tooltip.test.tsx.snap +0 -163
- package/src/components/Tooltip/index.tsx +0 -2
- package/src/components/definitions.stories.tsx +0 -150
- package/src/i18n/I18nWrapper.tsx +0 -13
- package/src/i18n/i18n.ts +0 -34
- package/src/icons/AI.tsx +0 -38
- package/src/icons/Alert.tsx +0 -31
- package/src/icons/ArrowUp.tsx +0 -28
- package/src/icons/Bug.tsx +0 -81
- package/src/icons/Chat.tsx +0 -30
- package/src/icons/ChevronDown.tsx +0 -26
- package/src/icons/ChevronLeft.tsx +0 -28
- package/src/icons/ChevronRight.tsx +0 -28
- package/src/icons/ChevronUp.tsx +0 -24
- package/src/icons/Clear.tsx +0 -23
- package/src/icons/Close.tsx +0 -30
- package/src/icons/Code.tsx +0 -30
- package/src/icons/Copy.tsx +0 -30
- package/src/icons/DeepThought.tsx +0 -38
- package/src/icons/Delete.tsx +0 -23
- package/src/icons/Document.tsx +0 -52
- package/src/icons/Download.tsx +0 -23
- package/src/icons/Edit.tsx +0 -17
- package/src/icons/Expand.tsx +0 -23
- package/src/icons/Eye.tsx +0 -17
- package/src/icons/EyeInvisible.tsx +0 -24
- package/src/icons/Facebook.tsx +0 -23
- package/src/icons/Feedback.tsx +0 -27
- package/src/icons/File.tsx +0 -17
- package/src/icons/FileExcel.tsx +0 -23
- package/src/icons/FilePdf.tsx +0 -23
- package/src/icons/FileWord.tsx +0 -23
- package/src/icons/Fullscreen.tsx +0 -23
- package/src/icons/FullscreenExit.tsx +0 -23
- package/src/icons/Group.tsx +0 -30
- package/src/icons/History.tsx +0 -33
- package/src/icons/Image.tsx +0 -37
- package/src/icons/Info.tsx +0 -37
- package/src/icons/Link.tsx +0 -17
- package/src/icons/Linkedin.tsx +0 -23
- package/src/icons/Loading.tsx +0 -28
- package/src/icons/Logout.tsx +0 -33
- package/src/icons/Mail.tsx +0 -17
- package/src/icons/MapMarker.tsx +0 -26
- package/src/icons/MenuHorizontal.tsx +0 -29
- package/src/icons/MenuVertical.tsx +0 -29
- package/src/icons/Message.tsx +0 -23
- package/src/icons/Microphone.tsx +0 -23
- package/src/icons/Minus.tsx +0 -23
- package/src/icons/MinusCircle.tsx +0 -24
- package/src/icons/PaperClip.tsx +0 -23
- package/src/icons/Picture.tsx +0 -23
- package/src/icons/Plus.tsx +0 -18
- package/src/icons/Preview.tsx +0 -31
- package/src/icons/Print.tsx +0 -37
- package/src/icons/QuestionHelp.tsx +0 -34
- package/src/icons/Refresh.tsx +0 -30
- package/src/icons/SelectIcon.tsx +0 -28
- package/src/icons/Send.tsx +0 -17
- package/src/icons/Setting.tsx +0 -23
- package/src/icons/Share.tsx +0 -23
- package/src/icons/Sound.tsx +0 -23
- package/src/icons/SoundDeactivated.tsx +0 -27
- package/src/icons/Telegram.tsx +0 -26
- package/src/icons/ThumbDown.tsx +0 -29
- package/src/icons/ThumbUp.tsx +0 -29
- package/src/icons/Translation.tsx +0 -24
- package/src/icons/Twitter.tsx +0 -23
- package/src/icons/Upload.tsx +0 -34
- package/src/icons/User.tsx +0 -17
- package/src/icons/Warning.tsx +0 -27
- package/src/icons/WhatsApp.tsx +0 -24
- package/src/icons/icons.stories.css +0 -5
- package/src/icons/icons.stories.tsx +0 -110
- package/src/icons/loading.css +0 -14
- package/src/index.ts +0 -13
- package/src/styles/utils.css +0 -17
- package/src/styles.css +0 -4
- package/src/theme/variables.css +0 -110
- package/src/vite-env.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [1.1.0](https://github.com/memori-ai/ui/compare/v1.0.5-alpha...v1.1.0) (2026-02-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add Collapsible component ([58a82f2](https://github.com/memori-ai/ui/commit/58a82f241f2c5c317eb2cbb9a4ac5eea2cbdf509))
|
|
9
|
+
* add ComponentShowcase stories ([2dac871](https://github.com/memori-ai/ui/commit/2dac8715bf14068b047da87c2c0f8da58a1e66be))
|
|
10
|
+
* add dark mode support with theme management hook and update README ([173b387](https://github.com/memori-ai/ui/commit/173b3876311c2957f1cd89db46b27dd3a12ce2bc))
|
|
11
|
+
* added Drawer component to index.ts export ([d8f0f7a](https://github.com/memori-ai/ui/commit/d8f0f7a61c102ccaca6b9db029175ef2409b69f8))
|
|
12
|
+
* enhance theme management with dynamic tenant color settings and update Storybook integration ([e24d2c6](https://github.com/memori-ai/ui/commit/e24d2c6128984f908173bcfe7166ab07bdea3292))
|
|
13
|
+
* implement Alert component with customizable options, improved accessibility, and enhanced styling ([2e0da23](https://github.com/memori-ai/ui/commit/2e0da231797e9326ae9fd1005f93d2c13d47ee81))
|
|
14
|
+
* improved Button component UX and fixed variables.css oklch calculated values ([3e3644a](https://github.com/memori-ai/ui/commit/3e3644a70af893d8264deda9b6ea35700654ee79))
|
|
15
|
+
* improved interaction effects and animations across different components ([4066914](https://github.com/memori-ai/ui/commit/40669144733cb1d0eafce017550bd5d51e439dd7))
|
|
16
|
+
* update component implementations ([de6449e](https://github.com/memori-ai/ui/commit/de6449ed7316e356f774a0a6c1ca6004b03cbf52))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* correct oklch color calculation values in variables.css ([ad1013b](https://github.com/memori-ai/ui/commit/ad1013b47dfe8a493aaf6895524d791e7af5f5ed))
|
|
22
|
+
* enhance plugin filtering in Storybook configuration ([d21e63a](https://github.com/memori-ai/ui/commit/d21e63a88407404bf1743e45827e88797bc77054))
|
|
23
|
+
* linting ([2f01329](https://github.com/memori-ai/ui/commit/2f0132972337ab8293a7d5153d86b827bd65033d))
|
|
24
|
+
* **types:** resolve portability error in generated declarations ([9c73d5e](https://github.com/memori-ai/ui/commit/9c73d5ea76268cb8ea08d6e6fa9805678dd19c26))
|
|
25
|
+
* update plugin filtering in Storybook configuration to correctly exclude vite:dts ([f4622bb](https://github.com/memori-ai/ui/commit/f4622bbab397ab17f3b1b04c4b3c8e67c24a7d7a))
|
|
26
|
+
* update Tooltip story to use new styles file ([9db0a3e](https://github.com/memori-ai/ui/commit/9db0a3eb82118122ac17a2e4a987d90ad75762fe))
|
|
27
|
+
* wrong import ([87cd301](https://github.com/memori-ai/ui/commit/87cd30184511195c52a822873715e179b59dd1f4))
|
|
28
|
+
|
|
29
|
+
## [1.0.5-alpha](https://github.com/memori-ai/ui/compare/v1.0.4-alpha...v1.0.5-alpha) (2026-01-07)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Features
|
|
33
|
+
|
|
34
|
+
* add storybook for theme design ([0409aa9](https://github.com/memori-ai/ui/commit/0409aa92fc5791ea785eec775a15d3d4957c30c0))
|
|
35
|
+
* configure Vitest with a new setup file for testing-library ([efd8c0a](https://github.com/memori-ai/ui/commit/efd8c0a90f830edeb0186551b23fd604dd107ab9))
|
|
36
|
+
* implement Checkbox component with CSS Modules and updated Storybook ([50f02e4](https://github.com/memori-ai/ui/commit/50f02e40f9a93fa2263fe923d3378772c9f3d797))
|
|
37
|
+
* implement Drawer component with CSS Modules and updated Storybook ([f5e9b16](https://github.com/memori-ai/ui/commit/f5e9b167f91fed987bad32302a76df26c1b19d17))
|
|
38
|
+
* integrate loading styles and update icon imports ([0e458ff](https://github.com/memori-ai/ui/commit/0e458ff4d304312c38ef8feb3648243b3ed3450c))
|
|
39
|
+
* update Card, Checkbox, and Alert snapshots ([5ce66be](https://github.com/memori-ai/ui/commit/5ce66be30e25eb410e589d46fd24fa719d6f08e9))
|
|
40
|
+
* update Card, Checkbox, and Alert snapshots ([b1ae385](https://github.com/memori-ai/ui/commit/b1ae385425a2f303eda94d16ac93ea3a4570c6cb))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
44
|
+
|
|
45
|
+
* style linting ([cc66fa7](https://github.com/memori-ai/ui/commit/cc66fa79279ceeafd19c5447608b255294d833d7))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Changes
|
|
49
|
+
|
|
50
|
+
* modal component using base-ui with new props and styles ([8f5a58e](https://github.com/memori-ai/ui/commit/8f5a58e0e48b0e7ad292fce5c6a199f73f0ea3e1))
|
|
51
|
+
* remove conditional Vitest browser testing setup ([b5c88b4](https://github.com/memori-ai/ui/commit/b5c88b49eaa279e535254eb9592bafe8a2ce9e5a))
|
|
52
|
+
* remove old story files for definitions and icons ([1301efd](https://github.com/memori-ai/ui/commit/1301efd0399d4e4b1017bc3c417a696511c604ac))
|
|
53
|
+
* replace Card component styles with CSS modules and enhance props for better customization ([2d87933](https://github.com/memori-ai/ui/commit/2d879331bbb2d838b57c305435389cdb16f67ea3))
|
|
54
|
+
* replace Select component with new SelectBox component ([a735df6](https://github.com/memori-ai/ui/commit/a735df6c7ae4830d645ce85b878a351fb380888c))
|
|
55
|
+
|
|
3
56
|
## [1.0.4-alpha](https://github.com/memori-ai/ui/compare/1.0.1-alpha...v1.0.4-alpha) (2026-01-02)
|
|
4
57
|
|
|
5
58
|
|
|
@@ -66,4 +119,4 @@
|
|
|
66
119
|
* add recommended exts ([c830bee](https://github.com/memori-ai/ui/commit/c830beed074b1dc09aa47199c655b95854af3dab))
|
|
67
120
|
* add storybook, tests, and ci ([6b9763a](https://github.com/memori-ai/ui/commit/6b9763ad12d995cdf0b84070a359c56567ae2017))
|
|
68
121
|
* add vite + css lint + build steps ([b435ce3](https://github.com/memori-ai/ui/commit/b435ce37c90f23e8eb996d62d3503b51311f9267))
|
|
69
|
-
* lint staged css ([522b2ed](https://github.com/memori-ai/ui/commit/522b2edb5307b7ea09beaebc4852d3b296ca359f))
|
|
122
|
+
* lint staged css ([522b2ed](https://github.com/memori-ai/ui/commit/522b2edb5307b7ea09beaebc4852d3b296ca359f))
|
package/README.md
CHANGED
|
@@ -16,17 +16,92 @@ bun add @memori.ai/ui
|
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
### 1. Import Styles (Required)
|
|
20
|
+
|
|
21
|
+
You **must** import the compiled CSS file in your application's entry point (e.g., `main.tsx` or `App.tsx`) to ensure components are styled correctly.
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import '@memori.ai/ui/styles.css'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 2. Import Components
|
|
20
28
|
|
|
21
29
|
```tsx
|
|
22
30
|
import { Button } from '@memori.ai/ui'
|
|
31
|
+
|
|
32
|
+
function App() {
|
|
33
|
+
return <Button variant="primary">Click me</Button>
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Theming & Customization
|
|
38
|
+
|
|
39
|
+
This library uses a **dynamic OKLCH color system**. The entire color palette (shades 100-900) is automatically generated from base primary and secondary colors using CSS Relative Color Syntax.
|
|
40
|
+
|
|
41
|
+
### Overriding Brand Colors
|
|
42
|
+
|
|
43
|
+
To customize the theme, simply set the following CSS variables in your application (e.g., in `:root` or a specific container). You do **not** need to define every shade; the library calculates them for you.
|
|
44
|
+
|
|
45
|
+
```css
|
|
46
|
+
:root {
|
|
47
|
+
/* Override Primary Color (Purple default) */
|
|
48
|
+
--memori-primary-rgb: oklch(0.55 0.22 290); /* or hex, rgb, etc. */
|
|
49
|
+
|
|
50
|
+
/* Override Secondary Color (Cyan default) */
|
|
51
|
+
--memori-secondary-rgb: oklch(0.7 0.15 200);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Dark Mode
|
|
56
|
+
|
|
57
|
+
The library includes built-in dark mode support. All components automatically adapt when dark mode is enabled.
|
|
58
|
+
|
|
59
|
+
#### Using the Theme Hook
|
|
60
|
+
|
|
61
|
+
The easiest way to add theme switching is using the `useTheme` hook:
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
import { useTheme } from '@memori.ai/ui'
|
|
65
|
+
|
|
66
|
+
function App() {
|
|
67
|
+
const { theme, setTheme, toggleTheme } = useTheme()
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<button onClick={toggleTheme}>
|
|
71
|
+
Switch to {theme === 'light' ? 'dark' : 'light'} mode
|
|
72
|
+
</button>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
23
75
|
```
|
|
24
76
|
|
|
25
|
-
|
|
26
|
-
|
|
77
|
+
The hook automatically:
|
|
78
|
+
|
|
79
|
+
- Detects system preference on first load
|
|
80
|
+
- Persists theme choice in localStorage
|
|
81
|
+
- Applies the theme to the document root
|
|
82
|
+
|
|
83
|
+
#### Manual Theme Control
|
|
84
|
+
|
|
85
|
+
You can also control the theme manually by setting a `data-theme` attribute or `dark` class on the document root:
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
// Set dark mode
|
|
89
|
+
document.documentElement.setAttribute('data-theme', 'dark')
|
|
90
|
+
// or
|
|
91
|
+
document.documentElement.classList.add('dark')
|
|
92
|
+
|
|
93
|
+
// Set light mode
|
|
94
|
+
document.documentElement.removeAttribute('data-theme')
|
|
95
|
+
document.documentElement.classList.remove('dark')
|
|
27
96
|
```
|
|
28
97
|
|
|
29
|
-
|
|
98
|
+
### Styling Architecture
|
|
99
|
+
|
|
100
|
+
- **Plain CSS**: We use standard CSS files, not CSS Modules or CSS-in-JS.
|
|
101
|
+
- **Namespace**: All CSS classes and variables are prefixed with `memori-` to avoid conflicts (e.g., `.memori-button`, `--memori-spacing-md`).
|
|
102
|
+
- **BEM Convention**: Classes follow the Block Element Modifier convention (e.g., `.memori-card__header--active`).
|
|
103
|
+
- **Theme**: Is defined inside the '/theme/variables.css' file.
|
|
104
|
+
- **Icons**: We use [Lucide React](https://lucide.dev) for all icons.
|
|
30
105
|
|
|
31
106
|
## Development
|
|
32
107
|
|
|
@@ -46,7 +121,7 @@ To run tests (in watch mode):
|
|
|
46
121
|
|
|
47
122
|
```bash
|
|
48
123
|
bun run test
|
|
49
|
-
# this is not the same as `bun test`
|
|
124
|
+
# this is not the same as `bun test`
|
|
50
125
|
# `bun test` runs the tests using Bun test runner and it's not compatible with our setup
|
|
51
126
|
```
|
|
52
127
|
|
|
@@ -96,10 +171,11 @@ bun run release
|
|
|
96
171
|
|
|
97
172
|
- [Bun](https://bun.com)
|
|
98
173
|
- [React](https://react.dev)
|
|
99
|
-
- [
|
|
174
|
+
- [@base-ui/react](https://github.com/base-ui/react)
|
|
100
175
|
- [Storybook](https://storybook.js.org)
|
|
101
176
|
- [Vite](https://vitejs.dev)
|
|
102
177
|
- [Vitest](https://vitest.dev)
|
|
103
178
|
- [Playwright](https://playwright.dev)
|
|
104
179
|
- [React Testing Library](https://testing-library.com/react)
|
|
105
180
|
- [React I18next](https://react.i18next.com)
|
|
181
|
+
- [Lucide React](https://lucide.dev)
|