@memobit/libs 1.0.74 → 2.0.1
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 +95 -95
- package/dist/index.d.ts +1 -2
- package/dist/index.esm.js +8026 -21549
- package/dist/version.json +4 -4
- package/package.json +183 -183
package/README.md
CHANGED
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
# @memobit/libs
|
|
2
|
-
|
|
3
|
-
A TypeScript-first React component library — 100+ components,
|
|
4
|
-
|
|
5
|
-
**📚 Live documentation & component playground → [react.memobit.ro](https://react.memobit.ro/)**
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @memobit/libs
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Peer dependencies (you provide these in your own app):
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install react@^19 react-dom@^19
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Quick start
|
|
22
|
-
|
|
23
|
-
```tsx
|
|
24
|
-
import { Button, Card, ToastProvider, useToast } from '@memobit/libs';
|
|
25
|
-
import '@memobit/libs/dist/index.css';
|
|
26
|
-
import '@memobit/libs/dist/styles/themes.scss'; // optional — only if you want the bundled themes
|
|
27
|
-
|
|
28
|
-
function App() {
|
|
29
|
-
return (
|
|
30
|
-
<ToastProvider>
|
|
31
|
-
<Demo />
|
|
32
|
-
</ToastProvider>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function Demo() {
|
|
37
|
-
const { showToast } = useToast();
|
|
38
|
-
return (
|
|
39
|
-
<Card>
|
|
40
|
-
<Button onClick={() => showToast({ type: 'success', message: 'Hello' })}>
|
|
41
|
-
Click me
|
|
42
|
-
</Button>
|
|
43
|
-
</Card>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## What's in the box
|
|
49
|
-
|
|
50
|
-
- **Components** — Buttons, forms (Input/Select/Checkbox/DatePicker/ColorPicker/EmojiPicker/FileDropzone…), navigation (Breadcrumb/AppHeader/ControlPanel/Tabs…), overlays (Drawer/Modal/ConfirmDialog/ContextMenu/Tooltip…), data (DataView/Table/Calendar/CalendarHeatmap/Chart…), feedback (Toast/Banner/Badge/Chip/EmptyState…), and many more.
|
|
51
|
-
- **Icons** — 470+ stroke icons, each tree-shakeable.
|
|
52
|
-
- **Themes** — 70+ ready-made SCSS themes (Arctic Blue, Midnight Atlas, Terracotta Kitchen, Neon Tokyo, …). Theme tokens are pure CSS custom properties, so you can author your own.
|
|
53
|
-
- **Hooks** — `useBreakpoint`, `useBodyScrollLock`, `useComponentEffect`, `useAppPersistence`, `useAuth`.
|
|
54
|
-
- **Helpers** — date formatting, number formatting, string utilities, search/highlight, pagination, URL helpers.
|
|
55
|
-
|
|
56
|
-
See the [component reference](https://react.memobit.ro/) for props, variants, and live examples.
|
|
57
|
-
|
|
58
|
-
## Theming
|
|
59
|
-
|
|
60
|
-
Themes ship as standalone SCSS files. Pick what you need:
|
|
61
|
-
|
|
62
|
-
```scss
|
|
63
|
-
// import everything
|
|
64
|
-
@use '@memobit/libs/dist/styles/themes.scss';
|
|
65
|
-
|
|
66
|
-
// or a single theme
|
|
67
|
-
@use '@memobit/libs/dist/styles/theming/arctic-blue.scss';
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
All tokens — spacing, typography, radii, transitions, colors — are exposed as CSS custom properties (`--spacing-8`, `--card-bg`, `--button-primary-bg`, etc.) so you can override per-component or per-route without forking the library.
|
|
71
|
-
|
|
72
|
-
Token reference:
|
|
73
|
-
|
|
74
|
-
- Sizing / spacing / radii / transitions → `@memobit/libs/dist/styles/variables.scss`
|
|
75
|
-
- Theme colors → `@memobit/libs/dist/styles/theming/*.scss`
|
|
76
|
-
|
|
77
|
-
## Requirements
|
|
78
|
-
|
|
79
|
-
- React **19.2+** and React DOM **19.2+** (peer deps)
|
|
80
|
-
- ESM-only (your bundler must support ESM — Vite, Next.js 13+, Webpack 5, esbuild, Rollup all do)
|
|
81
|
-
- For SCSS imports: a Sass-capable bundler
|
|
82
|
-
|
|
83
|
-
## TypeScript
|
|
84
|
-
|
|
85
|
-
Type definitions are bundled (`dist/index.d.ts`). No `@types/...` package required.
|
|
86
|
-
|
|
87
|
-
## License
|
|
88
|
-
|
|
89
|
-
[Apache 2.0](./LICENSE) © Iulian Cristea
|
|
90
|
-
|
|
91
|
-
## Links
|
|
92
|
-
|
|
93
|
-
- 📚 Docs & playground — https://react.memobit.ro/
|
|
94
|
-
- 🐙 Source — https://github.com/CristeaIulian/memobit-react-library
|
|
95
|
-
- 📦 npm — https://www.npmjs.com/package/@memobit/libs
|
|
1
|
+
# @memobit/libs
|
|
2
|
+
|
|
3
|
+
A TypeScript-first React component library — 100+ components, 70+ themes, plus the hooks and helpers needed to glue them together. Built for, and battle-tested across, the [Memobit](https://memobit.ro) family of apps.
|
|
4
|
+
|
|
5
|
+
**📚 Live documentation & component playground → [react.memobit.ro](https://react.memobit.ro/)**
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @memobit/libs
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Peer dependencies (you provide these in your own app):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install react@^19 react-dom@^19
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick start
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Button, Card, ToastProvider, useToast } from '@memobit/libs';
|
|
25
|
+
import '@memobit/libs/dist/index.css';
|
|
26
|
+
import '@memobit/libs/dist/styles/themes.scss'; // optional — only if you want the bundled themes
|
|
27
|
+
|
|
28
|
+
function App() {
|
|
29
|
+
return (
|
|
30
|
+
<ToastProvider>
|
|
31
|
+
<Demo />
|
|
32
|
+
</ToastProvider>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function Demo() {
|
|
37
|
+
const { showToast } = useToast();
|
|
38
|
+
return (
|
|
39
|
+
<Card>
|
|
40
|
+
<Button onClick={() => showToast({ type: 'success', message: 'Hello' })}>
|
|
41
|
+
Click me
|
|
42
|
+
</Button>
|
|
43
|
+
</Card>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## What's in the box
|
|
49
|
+
|
|
50
|
+
- **Components** — Buttons, forms (Input/Select/Checkbox/DatePicker/ColorPicker/EmojiPicker/FileDropzone…), navigation (Breadcrumb/AppHeader/ControlPanel/Tabs…), overlays (Drawer/Modal/ConfirmDialog/ContextMenu/Tooltip…), data (DataView/Table/Calendar/CalendarHeatmap/Chart…), feedback (Toast/Banner/Badge/Chip/EmptyState…), and many more.
|
|
51
|
+
- **Icons** — 470+ stroke icons, each tree-shakeable.
|
|
52
|
+
- **Themes** — 70+ ready-made SCSS themes (Arctic Blue, Midnight Atlas, Terracotta Kitchen, Neon Tokyo, …). Theme tokens are pure CSS custom properties, so you can author your own.
|
|
53
|
+
- **Hooks** — `useBreakpoint`, `useBodyScrollLock`, `useComponentEffect`, `useAppPersistence`, `useAuth`.
|
|
54
|
+
- **Helpers** — date formatting, number formatting, string utilities, search/highlight, pagination, URL helpers.
|
|
55
|
+
|
|
56
|
+
See the [component reference](https://react.memobit.ro/) for props, variants, and live examples.
|
|
57
|
+
|
|
58
|
+
## Theming
|
|
59
|
+
|
|
60
|
+
Themes ship as standalone SCSS files. Pick what you need:
|
|
61
|
+
|
|
62
|
+
```scss
|
|
63
|
+
// import everything
|
|
64
|
+
@use '@memobit/libs/dist/styles/themes.scss';
|
|
65
|
+
|
|
66
|
+
// or a single theme
|
|
67
|
+
@use '@memobit/libs/dist/styles/theming/arctic-blue.scss';
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
All tokens — spacing, typography, radii, transitions, colors — are exposed as CSS custom properties (`--spacing-8`, `--card-bg`, `--button-primary-bg`, etc.) so you can override per-component or per-route without forking the library.
|
|
71
|
+
|
|
72
|
+
Token reference:
|
|
73
|
+
|
|
74
|
+
- Sizing / spacing / radii / transitions → `@memobit/libs/dist/styles/variables.scss`
|
|
75
|
+
- Theme colors → `@memobit/libs/dist/styles/theming/*.scss`
|
|
76
|
+
|
|
77
|
+
## Requirements
|
|
78
|
+
|
|
79
|
+
- React **19.2+** and React DOM **19.2+** (peer deps)
|
|
80
|
+
- ESM-only (your bundler must support ESM — Vite, Next.js 13+, Webpack 5, esbuild, Rollup all do)
|
|
81
|
+
- For SCSS imports: a Sass-capable bundler
|
|
82
|
+
|
|
83
|
+
## TypeScript
|
|
84
|
+
|
|
85
|
+
Type definitions are bundled (`dist/index.d.ts`). No `@types/...` package required.
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
[Apache 2.0](./LICENSE) © Iulian Cristea
|
|
90
|
+
|
|
91
|
+
## Links
|
|
92
|
+
|
|
93
|
+
- 📚 Docs & playground — https://react.memobit.ro/
|
|
94
|
+
- 🐙 Source — https://github.com/CristeaIulian/memobit-react-library
|
|
95
|
+
- 📦 npm — https://www.npmjs.com/package/@memobit/libs
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { ErrorInfo } from 'react';
|
|
|
6
6
|
import { FC } from 'react';
|
|
7
7
|
import { FocusEvent as FocusEvent_2 } from 'react';
|
|
8
8
|
import { ForwardRefExoticComponent } from 'react';
|
|
9
|
+
import { IconName } from '@memobit/icons';
|
|
9
10
|
import { JSX } from 'react/jsx-runtime';
|
|
10
11
|
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
11
12
|
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
@@ -1711,8 +1712,6 @@ export declare const htmlToPlainText: (html: string | undefined | null) => strin
|
|
|
1711
1712
|
|
|
1712
1713
|
export declare const Icon: default_2.FC<IconProps>;
|
|
1713
1714
|
|
|
1714
|
-
export declare type IconName = 'active' | 'afternoon' | 'air-conditioning' | 'ajax' | 'alarm' | 'analysis' | 'angular' | 'announcement' | 'anomaly' | 'ant' | 'antenna' | 'api' | 'appliances' | 'archive' | 'arrow-bidirectional-horizontal' | 'arrow-bidirectional-vertical' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'arrow-up' | 'atom' | 'avocado' | 'backup' | 'badge' | 'balcony' | 'ball' | 'balloon' | 'banana' | 'bank' | 'basement' | 'bat' | 'bath' | 'battery-charging' | 'battery-empty' | 'battery-full' | 'battery-half' | 'beans' | 'bear' | 'bed' | 'bee' | 'beer' | 'bell' | 'benefit' | 'bill' | 'birthday-cake' | 'blood' | 'blueberries' | 'bones' | 'book' | 'bow' | 'brain' | 'bread' | 'breakfast' | 'briefcase' | 'brightness' | 'broken-heart' | 'broom' | 'bug' | 'building' | 'bullet' | 'bunny' | 'burst' | 'bus' | 'butterfly' | 'button-device' | 'cake' | 'calculator' | 'calendar' | 'calendar-day' | 'calendar-month' | 'calendar-week' | 'calendar-year' | 'calibrate' | 'camera' | 'candy' | 'car' | 'carbs' | 'caret-down' | 'caret-left' | 'caret-right' | 'caret-up' | 'carrot' | 'cat' | 'categories' | 'caterpillar' | 'cd-dvd' | 'certificate' | 'chart' | 'checkmark' | 'cheese' | 'cherries' | 'chestnut' | 'chicken' | 'chocolate' | 'christmas-tree' | 'cigarette' | 'clear' | 'clipboard' | 'closet' | 'cloud' | 'coffee' | 'comment' | 'compass' | 'confetti' | 'connected' | 'context' | 'cook' | 'cookies' | 'cooling' | 'corn' | 'correlation' | 'cow' | 'cpu' | 'credit-card' | 'crystal-globe' | 'cube' | 'cucumber' | 'dashboard' | 'death' | 'defect' | 'delete' | 'dental' | 'deselect-all' | 'dessert' | 'detach' | 'devices' | 'digestive' | 'digital' | 'dinner' | 'dinosaur' | 'dishwasher' | 'dns' | 'doctor' | 'document' | 'documents' | 'dog' | 'dolphin' | 'door' | 'dot' | 'download' | 'dragon' | 'drying-machine' | 'duck' | 'duplicates' | 'ears' | 'earth' | 'edit' | 'egg' | 'eggplant' | 'elephant' | 'empty' | 'endocrine' | 'enlarge' | 'equalizer' | 'evening' | 'expense' | 'export' | 'external-link' | 'fan' | 'favorite' | 'fibers' | 'file' | 'filetype-avi' | 'filetype-bat' | 'filetype-c' | 'filetype-css' | 'filetype-csv' | 'filetype-doc' | 'filetype-docx' | 'filetype-gif' | 'filetype-html' | 'filetype-ico' | 'filetype-ini' | 'filetype-javascript' | 'filetype-jpeg' | 'filetype-jpg' | 'filetype-json' | 'filetype-less' | 'filetype-mp3' | 'filetype-mp4' | 'filetype-mpg' | 'filetype-pdf' | 'filetype-php' | 'filetype-png' | 'filetype-ppt' | 'filetype-psd' | 'filetype-rar' | 'filetype-sass' | 'filetype-sql' | 'filetype-tiff' | 'filetype-txt' | 'filetype-typescript' | 'filetype-wav' | 'filetype-xls' | 'filetype-xlsx' | 'filetype-xml' | 'filetype-zip' | 'filters' | 'fire' | 'firewall' | 'fireworks' | 'fish' | 'fishing-rod' | 'fog' | 'folder' | 'folder-open' | 'fondue' | 'food' | 'french-fries' | 'fridge' | 'fruits' | 'furniture' | 'gallery' | 'gas-detector' | 'gateway' | 'gauge-high' | 'gauge-low' | 'gauge-medium' | 'gift-box' | 'girl' | 'github' | 'glass' | 'gloves' | 'glycemic-index' | 'goat' | 'graduation' | 'grid' | 'group' | 'gun' | 'hammer' | 'handshake' | 'hd' | 'headphones' | 'heart' | 'heating' | 'help' | 'hiking' | 'history' | 'home' | 'hospital' | 'humidity' | 'ice-cream' | 'identity' | 'image' | 'import' | 'inactive' | 'incognito' | 'information' | 'ingredients' | 'ink-cartridge' | 'insurance' | 'ir-emitter' | 'job' | 'joystick' | 'jupiter' | 'key' | 'knife' | 'laboratory' | 'language' | 'lantern' | 'layers' | 'leaf' | 'lemon' | 'light-bulb' | 'light-switch' | 'lightning' | 'link' | 'linkedin' | 'lipids' | 'list' | 'liver' | 'location' | 'lock' | 'lock-open' | 'logout' | 'lollipop' | 'lunch' | 'lungs' | 'magnet' | 'mail' | 'manage' | 'map' | 'mapping' | 'mars' | 'meat' | 'meet' | 'melon' | 'memory' | 'mental' | 'menu-hamburger' | 'mercury' | 'microphone' | 'microscope' | 'microwave' | 'milk' | 'minimum' | 'minus' | 'money' | 'monitor' | 'monkey' | 'moon' | 'morning' | 'motion' | 'mouse' | 'movie' | 'mushroom' | 'musical-note' | 'mute' | 'nas' | 'neptune' | 'nervous' | 'network' | 'next' | 'night' | 'ninja' | 'noon' | 'nose' | 'not-found' | 'notes' | 'notice' | 'offline' | 'old-person' | 'olives' | 'online' | 'optimization' | 'other' | 'outdoor' | 'ownership' | 'paint' | 'pause' | 'pawn' | 'peanut' | 'pear' | 'penguin' | 'pension' | 'pepper' | 'pharmacy' | 'phone' | 'pig' | 'pill' | 'pin' | 'pizza' | 'plane' | 'play' | 'plug' | 'plus' | 'pluto' | 'polenta' | 'police' | 'police-man' | 'popcorn' | 'portions' | 'potato' | 'power' | 'predictions' | 'prescription' | 'previous' | 'printer' | 'proteins' | 'pudding' | 'pumpkin' | 'purifier' | 'puzzle' | 'radio' | 'rain' | 'rainbow' | 'raspberry' | 'reading' | 'referral' | 'reload' | 'repeat' | 'report' | 'reproductive' | 'return' | 'rice' | 'robot' | 'rocket' | 'romania-flag' | 'rooms' | 'router' | 'ruler' | 'running' | 'salad' | 'salt' | 'santa' | 'satellite' | 'saturn' | 'save' | 'scales' | 'scan' | 'school' | 'scissors' | 'score' | 'scss' | 'sd' | 'search' | 'security' | 'seeds' | 'sequence' | 'settings' | 'shield' | 'ship' | 'shopping-cart' | 'shrink' | 'shuffle' | 'signal-full' | 'signal-low' | 'signal-medium' | 'skin' | 'skull' | 'smartphone' | 'smb' | 'smoke-detector' | 'snake' | 'snow' | 'snowman' | 'sofa' | 'soft-drink' | 'soup' | 'sources' | 'sparkle' | 'speaker' | 'speedometer' | 'square' | 'ssl' | 'staple' | 'star' | 'status' | 'stethoscope' | 'stop' | 'stop-sign' | 'storm' | 'strawberry' | 'streaming' | 'strength' | 'sugar' | 'sun' | 'surgery' | 'synchronize' | 'table' | 'target' | 'taxi' | 'technical' | 'teeth' | 'telescope' | 'theater' | 'theme-picker' | 'thermometer' | 'threshold' | 'time' | 'toggle-off' | 'toggle-on' | 'tomato' | 'toolbox' | 'train' | 'transactions' | 'transport-box' | 'tree' | 'trend-down' | 'trend-up' | 'trip' | 'trophy' | 'tune' | 'turkey' | 'turtle' | 'tv' | 'unarchive' | 'unassociated' | 'ungroup' | 'unmute' | 'upload' | 'upnp' | 'uranus' | 'user' | 'users' | 'vacuum' | 'vegetables' | 'venus' | 'vertical-dots' | 'video' | 'view' | 'virus' | 'wait' | 'wan' | 'warning' | 'washing-machine' | 'water-leak' | 'web' | 'website-crawl' | 'wifi' | 'wind' | 'workout' | 'wrench' | 'yoga' | 'youtube';
|
|
1715
|
-
|
|
1716
1715
|
/**
|
|
1717
1716
|
* Search and pick one of the library's icons.
|
|
1718
1717
|
*
|