@mfs-atomic/ui 0.0.0-stage → 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/LICENSE +31 -0
- package/README.md +203 -2
- package/dist/index.d.ts +5281 -0
- package/dist/mfs-theme.css +1 -0
- package/dist/mfs-theme.js +12507 -0
- package/dist/mfs-theme.umd.cjs +33 -0
- package/package.json +56 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MFS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Trademark & Brand Assets Notice
|
|
26
|
+
|
|
27
|
+
The "MFS Atomic Technology" and "MFS Theme" names, logos (including
|
|
28
|
+
`public/logo.svg`), and associated brand assets are proprietary trademarks and
|
|
29
|
+
assets of MFS Atomic Technology. They are NOT open-source, are excluded from the
|
|
30
|
+
MIT License above, and all rights are reserved. They may not be used to imply
|
|
31
|
+
endorsement or as your own brand without prior written permission.
|
package/README.md
CHANGED
|
@@ -1,3 +1,204 @@
|
|
|
1
|
-
#
|
|
1
|
+
# MFS Theme
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Adaptive multi-theme Vue 3 UI component library with runtime theme switching, 20 built-in visual themes, 91+ components, and zero runtime dependencies.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **20 Built-in Themes**: Switch between 20 distinct design systems at runtime (`clay`, `glass`, `neo`, `cyberpunk`, `liquid-glass`, and more).
|
|
8
|
+
- **91+ Vue 3 Components**: Comprehensive component suite covering forms, data display, overlays, navigation, menus, feedback, and charts—plus directives (`v-ripple`, `v-tooltip`, `v-focustrap`, `v-animateonscroll`, `v-styleclass`) and composables (`useTheme`, `useToast`, `useConfirm`).
|
|
9
|
+
- **206 `.mfs-*` Utility Classes**: Theme-aware CSS utility classes for layout, surfaces, elevation, typography, and spacing.
|
|
10
|
+
- **TypeScript Ready**: Full TypeScript declarations (`dist/index.d.ts`) bundled out of the box.
|
|
11
|
+
- **Zero Runtime Dependencies**: Lightweight package requiring only `vue` (`^3.4.0`) as a peer dependency.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @mfs-atomic/ui
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or with Bun:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
bun add @mfs-atomic/ui
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
### 1. Register the Plugin & Import Styles
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
// main.ts
|
|
31
|
+
import { createApp } from 'vue'
|
|
32
|
+
import App from './App.vue'
|
|
33
|
+
import ThemePlugin from '@mfs-atomic/ui'
|
|
34
|
+
import '@mfs-atomic/ui/style.css'
|
|
35
|
+
|
|
36
|
+
const app = createApp(App)
|
|
37
|
+
app.use(ThemePlugin, { defaultTheme: 'clay' })
|
|
38
|
+
app.mount('#app')
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. Use Components & Switch Themes with `useTheme()`
|
|
42
|
+
|
|
43
|
+
```vue
|
|
44
|
+
<script setup lang="ts">
|
|
45
|
+
import { ref } from 'vue'
|
|
46
|
+
import { useTheme } from '@mfs-atomic/ui'
|
|
47
|
+
|
|
48
|
+
const { currentTheme, themeOptions, setTheme } = useTheme()
|
|
49
|
+
const name = ref('')
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<Card title="Welcome" :subtitle="`Active theme: ${currentTheme}`">
|
|
54
|
+
<Input v-model="name" label="Name" placeholder="Enter your name..." />
|
|
55
|
+
|
|
56
|
+
<div class="mfs-flex mfs-gap-2 mfs-mt-4">
|
|
57
|
+
<Button
|
|
58
|
+
v-for="theme in themeOptions.slice(0, 3)"
|
|
59
|
+
:key="theme.id"
|
|
60
|
+
:variant="currentTheme === theme.id ? 'primary' : 'secondary'"
|
|
61
|
+
@click="setTheme(theme.id)"
|
|
62
|
+
>
|
|
63
|
+
{{ theme.name }}
|
|
64
|
+
</Button>
|
|
65
|
+
</div>
|
|
66
|
+
</Card>
|
|
67
|
+
</template>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
> Components can also be imported individually (e.g., `import { Button, Card, Input } from '@mfs-atomic/ui'`).
|
|
71
|
+
|
|
72
|
+
## Highlighted & Newly Added Components
|
|
73
|
+
|
|
74
|
+
| Category | Components |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| **Forms & Validation** | `Form`, `FormField`, `Mentions`, `SignaturePad`, `CodeEditor` |
|
|
77
|
+
| **Overlays & Portals** | `CommandPalette`, `DynamicDialog`, `Portal`, `OverlayBadge` |
|
|
78
|
+
| **Media & Visuals** | `ImageCropper`, `ImageCompare`, `AvatarGroup` |
|
|
79
|
+
| **Data & Lists** | `DataTable`, `InfiniteScroll`, `Select`, `AutoComplete` |
|
|
80
|
+
|
|
81
|
+
## Local Filter vs Remote Search & Server-Side Data
|
|
82
|
+
|
|
83
|
+
Choose the data mode based on dataset size:
|
|
84
|
+
|
|
85
|
+
- **Local filtering (default)**: Best for small, in-memory datasets (< 200 items). Leave `remote` / `lazy` off and pass the full `options`, `items`, or `value` array; the component filters/sorts/paginates on the client.
|
|
86
|
+
- **Remote search (`remote` + `@search` + `loading`)**: Best for large or server-backed lists in `CommandPalette`, `Mentions`, `Select`, and `AutoComplete`. Setting `remote` disables built-in client filtering so your `@search` handler can fetch and update options while `loading` displays a spinner.
|
|
87
|
+
- **Server-side pagination & scrolling (`lazy`)**: Best for unbounded tables and feeds. Use `DataTable` with `lazy` (`@page`, `@sort`, `@filter`) or `InfiniteScroll` (`@load`, `hasMore`, `loading`).
|
|
88
|
+
|
|
89
|
+
```vue
|
|
90
|
+
<!-- Remote Search (CommandPalette / Mentions / Select / AutoComplete) -->
|
|
91
|
+
<CommandPalette
|
|
92
|
+
v-model:open="isOpen"
|
|
93
|
+
:items="remoteItems"
|
|
94
|
+
remote
|
|
95
|
+
:loading="isSearching"
|
|
96
|
+
@search="fetchCommands"
|
|
97
|
+
/>
|
|
98
|
+
|
|
99
|
+
<Mentions
|
|
100
|
+
v-model="comment"
|
|
101
|
+
:options="userSuggestions"
|
|
102
|
+
remote
|
|
103
|
+
:loading="isSearchingUsers"
|
|
104
|
+
@search="({ trigger, query }) => fetchMentions(trigger, query)"
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
<!-- Server-Side DataTable & InfiniteScroll -->
|
|
108
|
+
<DataTable
|
|
109
|
+
:value="rows"
|
|
110
|
+
:columns="columns"
|
|
111
|
+
lazy
|
|
112
|
+
paginator
|
|
113
|
+
:loading="isLoadingTable"
|
|
114
|
+
@page="onPage"
|
|
115
|
+
@sort="onSort"
|
|
116
|
+
@filter="onFilter"
|
|
117
|
+
/>
|
|
118
|
+
|
|
119
|
+
<InfiniteScroll :loading="isLoadingMore" :has-more="hasNextPage" @load="loadNextPage">
|
|
120
|
+
<div v-for="item in feed" :key="item.id">{{ item.title }}</div>
|
|
121
|
+
</InfiniteScroll>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## XSS-Safe `CodeEditor`
|
|
125
|
+
|
|
126
|
+
`CodeEditor` tokenizes source code into plain-text `<span>` elements (`{{ tok.text }}`) rather than `v-html`, preventing XSS injection even when rendering untrusted user input.
|
|
127
|
+
|
|
128
|
+
```vue
|
|
129
|
+
<script setup lang="ts">
|
|
130
|
+
import { ref } from 'vue'
|
|
131
|
+
import { CodeEditor } from '@mfs-atomic/ui'
|
|
132
|
+
|
|
133
|
+
const code = ref(`<script setup>\nconst msg = 'Safe by default'\n<\/script>`)
|
|
134
|
+
</script>
|
|
135
|
+
|
|
136
|
+
<template>
|
|
137
|
+
<CodeEditor
|
|
138
|
+
v-model="code"
|
|
139
|
+
language="vue"
|
|
140
|
+
filename="Example.vue"
|
|
141
|
+
:line-numbers="true"
|
|
142
|
+
:copyable="true"
|
|
143
|
+
/>
|
|
144
|
+
</template>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## `v-animate-on-scroll` Zero-CSS Presets
|
|
148
|
+
|
|
149
|
+
Animate elements on viewport entry without writing custom keyframes. Supports 5 built-in presets (`fade-up`, `fade-down`, `fade-left`, `fade-right`, `zoom-in`), respects `prefers-reduced-motion`, and also accepts custom `enterClass` / `leaveClass` options.
|
|
150
|
+
|
|
151
|
+
```vue
|
|
152
|
+
<script setup lang="ts">
|
|
153
|
+
import { vAnimateOnScroll } from '@mfs-atomic/ui'
|
|
154
|
+
</script>
|
|
155
|
+
|
|
156
|
+
<template>
|
|
157
|
+
<!-- Default preset ('fade-up') -->
|
|
158
|
+
<Card v-animate-on-scroll title="Fade Up" />
|
|
159
|
+
|
|
160
|
+
<!-- Shorthand preset string -->
|
|
161
|
+
<Card v-animate-on-scroll="'fade-left'" title="Slide Left" />
|
|
162
|
+
|
|
163
|
+
<!-- Full options object -->
|
|
164
|
+
<Card
|
|
165
|
+
v-animate-on-scroll="{ animation: 'zoom-in', duration: 600, delay: 150, once: false }"
|
|
166
|
+
title="Zoom In"
|
|
167
|
+
/>
|
|
168
|
+
</template>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
> When registered globally via `ThemePlugin`, the directive is available as `v-animateonscroll`.
|
|
172
|
+
|
|
173
|
+
## Built-in Themes
|
|
174
|
+
|
|
175
|
+
All 20 theme IDs supported by `ThemePlugin` (`defaultTheme`) and `setTheme(id)`:
|
|
176
|
+
|
|
177
|
+
| Theme ID | Description |
|
|
178
|
+
| --- | --- |
|
|
179
|
+
| `clay` | Claymorphism — 3D inflated soft surfaces and tactile curves |
|
|
180
|
+
| `glass` | Glassmorphism — Frosted translucent glass and backdrop blurs |
|
|
181
|
+
| `neo` | Neumorphism — Minimalist soft UI with extruded elevations |
|
|
182
|
+
| `minimalism` | Minimalism — Ultra-clean monochrome surfaces and hairline borders |
|
|
183
|
+
| `brutalism` | Neubrutalism — High-contrast bold borders and hard offset shadows |
|
|
184
|
+
| `bento` | Bento Grid — Modular rounded tiles with crisp spacing |
|
|
185
|
+
| `cyberpunk` | Cyberpunk — Neon-lit dark HUD surfaces and electric glows |
|
|
186
|
+
| `retro` | Retro — Nostalgic warm palettes and classic UI proportions |
|
|
187
|
+
| `swiss` | Swiss — Grid-driven modernist typography and sharp geometry |
|
|
188
|
+
| `skeuomorphism` | Skeuomorphism — Realistic textures, bevels, and tactile depth |
|
|
189
|
+
| `liquid-glass` | Liquid Glass — Fluid specular highlights and refractive depth |
|
|
190
|
+
| `material-you` | Material You — Adaptive tonal surfaces and expressive pills |
|
|
191
|
+
| `terminal` | Terminal — Monospace CLI aesthetics with phosphor accents |
|
|
192
|
+
| `hand-drawn` | Hand-Drawn — Sketchy organic borders and paper-like surfaces |
|
|
193
|
+
| `y2k-chrome` | Y2K Chrome — Metallic gradients, glossy pills, and early-2000s flair |
|
|
194
|
+
| `bauhaus` | Bauhaus — Primary geometric forms and bold color blocks |
|
|
195
|
+
| `pixel-art` | Pixel Art — Crisp stepped borders and 8-bit arcade styling |
|
|
196
|
+
| `aurora-gradient` | Aurora Gradient — Luminous ambient meshes and soft glows |
|
|
197
|
+
| `vaporwave` | Vaporwave — Pastel synth gradients and retro-futuristic contrast |
|
|
198
|
+
| `manga` | Manga — High-contrast ink panels with halftone depth |
|
|
199
|
+
|
|
200
|
+
## License & Trademarks
|
|
201
|
+
|
|
202
|
+
Source code is licensed under the [MIT License](./LICENSE).
|
|
203
|
+
|
|
204
|
+
The **MFS Atomic Technology** and **MFS Theme** names, logos (including `public/logo.svg`), and brand assets are proprietary to **MFS Atomic Technology** (not open-source) and are **excluded from the MIT License** (all rights reserved). They may not be used to imply endorsement or as your own brand without prior written permission.
|