@appsbd/vue3-appsbd-ui 1.0.3 → 1.0.5
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/.ai/ai_ref_AbAvatar.md +41 -51
- package/.ai/ai_ref_AbBadge.md +36 -45
- package/.ai/ai_ref_AbButton.md +52 -70
- package/.ai/ai_ref_AbCard.md +51 -70
- package/.ai/ai_ref_AbCarousel.md +36 -47
- package/.ai/ai_ref_AbChart.md +46 -87
- package/.ai/ai_ref_AbColorPicker.md +42 -55
- package/.ai/ai_ref_AbConfirmPopover.md +54 -59
- package/.ai/ai_ref_AbCustomField.md +66 -74
- package/.ai/ai_ref_AbDarkModeToggler.md +33 -42
- package/.ai/ai_ref_AbDateTimePicker.md +74 -108
- package/.ai/ai_ref_AbEasyModal.md +56 -62
- package/.ai/ai_ref_AbField.md +88 -96
- package/.ai/ai_ref_AbFileUploader.md +47 -63
- package/.ai/ai_ref_AbFilterPanel.md +67 -71
- package/.ai/ai_ref_AbFormCheck.md +58 -75
- package/.ai/ai_ref_AbImageRadioInput.md +55 -63
- package/.ai/ai_ref_AbInputField.md +66 -74
- package/.ai/ai_ref_AbInputTag.md +56 -76
- package/.ai/ai_ref_AbKbd.md +23 -35
- package/.ai/ai_ref_AbKbdGroup.md +21 -33
- package/.ai/ai_ref_AbMainLayout.md +106 -0
- package/.ai/ai_ref_AbModal.md +98 -103
- package/.ai/ai_ref_AbMultiSelect.md +78 -112
- package/.ai/ai_ref_AbNumberField.md +59 -84
- package/.ai/ai_ref_AbPinInput.md +33 -45
- package/.ai/ai_ref_AbPopover.md +54 -64
- package/.ai/ai_ref_AbPricingCard.md +56 -64
- package/.ai/ai_ref_AbPricingContainer.md +41 -49
- package/.ai/ai_ref_AbPricingTable.md +56 -72
- package/.ai/ai_ref_AbProgressbar.md +34 -44
- package/.ai/ai_ref_AbScrollbar.md +38 -48
- package/.ai/ai_ref_AbSettingsForm.md +46 -54
- package/.ai/ai_ref_AbSideMenuItem.md +47 -58
- package/.ai/ai_ref_AbSidebar.md +62 -70
- package/.ai/ai_ref_AbSkeleton.md +23 -41
- package/.ai/ai_ref_AbSlider.md +52 -71
- package/.ai/ai_ref_AbTab.md +30 -38
- package/.ai/ai_ref_AbTable.md +49 -59
- package/.ai/ai_ref_AbTabs.md +37 -47
- package/.ai/ai_ref_AbToggle.md +46 -65
- package/.ai/ai_ref_AbTooltip.md +39 -53
- package/.ai/ai_ref_AbWizard.md +64 -77
- package/.ai/ai_ref_AbWizardStep.md +36 -48
- package/.ai/ai_ref_abEventBus.md +9 -37
- package/.ai/ai_ref_abRequestParam.md +2 -17
- package/.ai/ai_ref_abTranslate.md +30 -15
- package/.ai/ai_ref_abVeeRules.md +2 -11
- package/.ai/ai_ref_global_config.md +57 -66
- package/.ai/ai_ref_useAlert.md +7 -20
- package/.ai/ai_ref_useFileValidator.md +3 -18
- package/.ai/ai_ref_useResponsive.md +6 -20
- package/.ai/ai_ref_useTheme.md +4 -15
- package/.ai/ai_ref_useToast.md +5 -17
- package/AI_REF.md +114 -0
- package/AI_REFERENCE.md +87 -1157
- package/design-system.md +403 -403
- package/dist/skins/black.css +1 -1
- package/dist/skins/black.scss +3 -3
- package/dist/skins/cyan.css +1 -1
- package/dist/skins/cyan.scss +3 -3
- package/dist/skins/default.css +1 -1
- package/dist/skins/default.scss +5 -5
- package/dist/skins/gray.css +1 -1
- package/dist/skins/gray.scss +3 -3
- package/dist/skins/green.css +1 -1
- package/dist/skins/green.scss +5 -5
- package/dist/skins/orange.css +1 -1
- package/dist/skins/orange.scss +3 -3
- package/dist/skins/pink.css +1 -1
- package/dist/skins/pink.scss +3 -3
- package/dist/skins/purple.css +1 -1
- package/dist/skins/purple.scss +3 -3
- package/dist/skins/red.css +1 -1
- package/dist/skins/red.scss +3 -3
- package/dist/skins/themes/_black.scss +18 -6
- package/dist/skins/themes/_blue.scss +18 -43
- package/dist/skins/themes/_common_variable.scss +695 -590
- package/dist/skins/themes/_cyan.scss +18 -6
- package/dist/skins/themes/_gray.scss +18 -6
- package/dist/skins/themes/_green.scss +18 -6
- package/dist/skins/themes/_grid.scss +32 -27
- package/dist/skins/themes/_orange.scss +18 -6
- package/dist/skins/themes/_pink.scss +18 -6
- package/dist/skins/themes/_purple.scss +18 -6
- package/dist/skins/themes/_red.scss +18 -6
- package/dist/skins/themes/_violet.scss +18 -6
- package/dist/skins/violet.css +1 -1
- package/dist/skins/violet.scss +3 -3
- package/dist/style.css +1 -1
- package/dist/vue3-appsbd-ui.cjs.js +145 -125
- package/dist/vue3-appsbd-ui.es.js +27822 -16778
- package/package.json +72 -66
- package/readme.md +194 -136
- package/scripts/postinstall.js +55 -0
- package/scripts/setup.js +16 -0
- package/scripts/skill-groups.js +38 -0
- package/skills/commands/generate-module.md +76 -0
- package/skills/commands/settings-form.md +175 -0
- package/skills/commands/use-appsbd-ui.md +40 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Generate a full CRUD module (List + Form + Composable) using @appsbd/vue3-appsbd-ui components
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Generate Module
|
|
6
|
+
|
|
7
|
+
## Before anything else
|
|
8
|
+
|
|
9
|
+
Invoke `/use-appsbd-ui` to load the component reference. Use only props/events/slots documented there.
|
|
10
|
+
|
|
11
|
+
## What to generate
|
|
12
|
+
|
|
13
|
+
Given a module name and field definitions, scaffold three files:
|
|
14
|
+
|
|
15
|
+
### 1. `[Name]List.vue` — List/Table view
|
|
16
|
+
|
|
17
|
+
- Use `AbTable` for the data grid
|
|
18
|
+
- `AbButton` (primary) to open the create form
|
|
19
|
+
- `AbConfirmPopover` on each row's delete action
|
|
20
|
+
- `AbSkeleton` while data is loading
|
|
21
|
+
- `AbBadge` for status/boolean columns
|
|
22
|
+
- Call `useToast` on successful delete
|
|
23
|
+
|
|
24
|
+
### 2. `[Name]Form.vue` — Create / Edit form
|
|
25
|
+
|
|
26
|
+
- Wrap everything in `AbModal` with `v-model:is-modal-visible`
|
|
27
|
+
- Map each field to the correct Ab* input:
|
|
28
|
+
| Field type | Component |
|
|
29
|
+
|----------------|-------------------|
|
|
30
|
+
| text / email | `AbInputField` |
|
|
31
|
+
| number | `AbNumberField` |
|
|
32
|
+
| select (single)| `AbMultiSelect` mode="single" |
|
|
33
|
+
| select (multi) | `AbMultiSelect` mode="multiple" |
|
|
34
|
+
| boolean/switch | `AbToggle` |
|
|
35
|
+
| date / range | `AbDateTimePicker`|
|
|
36
|
+
| radio group | `AbFormCheck` |
|
|
37
|
+
| textarea | `AbInputField` type="textarea" |
|
|
38
|
+
| file | `AbFileUploader` |
|
|
39
|
+
- Add VeeValidate `rules` prop on required / validated fields
|
|
40
|
+
- `@on-submit` handler calls composable save method
|
|
41
|
+
- Call `modal.value.showLoader(true)` before async, `showLoader(false)` after
|
|
42
|
+
- Call `useToast` success/error inside the submit handler
|
|
43
|
+
|
|
44
|
+
### 3. `use[Name].js` — Composable
|
|
45
|
+
|
|
46
|
+
- `ref` for list data, single item, loading state, pagination
|
|
47
|
+
- `fetchList()`, `fetchOne(id)`, `save(payload)`, `remove(id)` functions
|
|
48
|
+
- `save` detects create vs edit by presence of `id`
|
|
49
|
+
- Return all refs and functions
|
|
50
|
+
|
|
51
|
+
## Output format
|
|
52
|
+
|
|
53
|
+
Ask the user for:
|
|
54
|
+
1. **Module name** (PascalCase, e.g. `Product`)
|
|
55
|
+
2. **Fields** — name, type, required?, options (for selects)
|
|
56
|
+
3. **API base path** (e.g. `/api/products`)
|
|
57
|
+
4. **Output folder** (default: `src/modules/[name]/`)
|
|
58
|
+
|
|
59
|
+
Then generate all three files in one response, each in a separate code block labeled with its file path.
|
|
60
|
+
|
|
61
|
+
## Example invocation
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
/generate-module
|
|
65
|
+
|
|
66
|
+
Module: Invoice
|
|
67
|
+
Fields:
|
|
68
|
+
- title (text, required)
|
|
69
|
+
- amount (number, required, min: 0)
|
|
70
|
+
- status (select: Draft | Sent | Paid, required)
|
|
71
|
+
- due_date (date, required)
|
|
72
|
+
- notes (textarea)
|
|
73
|
+
|
|
74
|
+
API: /api/invoices
|
|
75
|
+
Output: src/modules/invoices/
|
|
76
|
+
```
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use when building a settings or preferences page with AbSettingsForm
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Generate a Settings Form
|
|
6
|
+
|
|
7
|
+
## Before anything else
|
|
8
|
+
|
|
9
|
+
Read `node_modules/@appsbd/vue3-appsbd-ui/.ai/ai_ref_AbSettingsForm.md` for the full API.
|
|
10
|
+
|
|
11
|
+
## What AbSettingsForm does
|
|
12
|
+
|
|
13
|
+
- Wraps fields in a VeeValidate `<Form>` with a built-in submit/loading state.
|
|
14
|
+
- When nested inside an `AbWizardStep`, auto-registers as the step's validator — returning `false` from `onSubmit` blocks the wizard from advancing.
|
|
15
|
+
- Standalone use (outside a wizard) works as a plain validated form.
|
|
16
|
+
|
|
17
|
+
## Supported field components
|
|
18
|
+
|
|
19
|
+
| Field type | Component |
|
|
20
|
+
|---|---|
|
|
21
|
+
| text / email / password | `<ab-input-field>` |
|
|
22
|
+
| number | `<ab-number-field>` |
|
|
23
|
+
| select (single) | `<ab-multi-select mode="single">` |
|
|
24
|
+
| select (multi) | `<ab-multi-select mode="multiple">` |
|
|
25
|
+
| boolean / switch | `<ab-toggle>` |
|
|
26
|
+
| date | `<ab-date-time-picker>` |
|
|
27
|
+
| checkbox / radio group | `<ab-form-check>` |
|
|
28
|
+
| textarea | `<ab-input-field type="textarea">` |
|
|
29
|
+
| file / avatar | `<ab-file-uploader>` |
|
|
30
|
+
| tags | `<ab-input-tag>` |
|
|
31
|
+
| color | `<ab-color-picker>` |
|
|
32
|
+
|
|
33
|
+
## Rules
|
|
34
|
+
|
|
35
|
+
- Import `AbSettingsForm` explicitly — it is **not** globally registered.
|
|
36
|
+
- Pass the save handler to `:on-submit`. The component manages the loading state automatically — do not add a separate loading ref.
|
|
37
|
+
- Return `false` (or throw) from `onSubmit` to block wizard progression or keep the form in error state.
|
|
38
|
+
- Wrap each field in `<ab-field>` only when you need a standalone label+error wrapper outside a component that has its own label prop.
|
|
39
|
+
- All `Ab*` form inputs must receive a `name` prop for VeeValidate to track them.
|
|
40
|
+
|
|
41
|
+
## Standalone settings page
|
|
42
|
+
|
|
43
|
+
```vue
|
|
44
|
+
<template>
|
|
45
|
+
<ab-settings-form :on-submit="save">
|
|
46
|
+
<ab-input-field v-model="form.name" name="name" label="Display name" rules="required" />
|
|
47
|
+
<ab-input-field v-model="form.email" name="email" label="Email" rules="required|email" />
|
|
48
|
+
<ab-toggle v-model="form.notifications" name="notifications" title="Email notifications" />
|
|
49
|
+
<ab-multi-select
|
|
50
|
+
v-model="form.language"
|
|
51
|
+
name="language"
|
|
52
|
+
label="Language"
|
|
53
|
+
:options="languageOptions"
|
|
54
|
+
label-key="title"
|
|
55
|
+
value-key="val"
|
|
56
|
+
/>
|
|
57
|
+
</ab-settings-form>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script setup>
|
|
61
|
+
import { ref } from "vue";
|
|
62
|
+
import { AbSettingsForm, useToast } from "@appsbd/vue3-appsbd-ui";
|
|
63
|
+
|
|
64
|
+
const { toast } = useToast();
|
|
65
|
+
|
|
66
|
+
const form = ref({
|
|
67
|
+
name: "",
|
|
68
|
+
email: "",
|
|
69
|
+
notifications: false,
|
|
70
|
+
language: null,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const languageOptions = [
|
|
74
|
+
{ val: "en", title: "English" },
|
|
75
|
+
{ val: "bn", title: "Bengali" },
|
|
76
|
+
{ val: "ar", title: "Arabic" },
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
async function save(values) {
|
|
80
|
+
await api.saveProfile(values);
|
|
81
|
+
toast.success("Settings saved.");
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Wizard with per-step validation
|
|
87
|
+
|
|
88
|
+
```vue
|
|
89
|
+
<template>
|
|
90
|
+
<ab-wizard @finished="onFinished">
|
|
91
|
+
<ab-wizard-step title="Account">
|
|
92
|
+
<ab-settings-form :on-submit="validateAccount">
|
|
93
|
+
<ab-input-field v-model="form.email" name="email" label="Email" rules="required|email" />
|
|
94
|
+
<ab-input-field v-model="form.password" name="password" label="Password" rules="required|min:8" type="password" />
|
|
95
|
+
</ab-settings-form>
|
|
96
|
+
</ab-wizard-step>
|
|
97
|
+
|
|
98
|
+
<ab-wizard-step title="Profile">
|
|
99
|
+
<ab-settings-form :on-submit="validateProfile">
|
|
100
|
+
<ab-input-field v-model="form.name" name="name" label="Full name" rules="required" />
|
|
101
|
+
<ab-multi-select
|
|
102
|
+
v-model="form.role"
|
|
103
|
+
name="role"
|
|
104
|
+
label="Role"
|
|
105
|
+
:options="roleOptions"
|
|
106
|
+
label-key="title"
|
|
107
|
+
value-key="val"
|
|
108
|
+
rules="required"
|
|
109
|
+
/>
|
|
110
|
+
</ab-settings-form>
|
|
111
|
+
</ab-wizard-step>
|
|
112
|
+
|
|
113
|
+
<ab-wizard-step title="Preferences">
|
|
114
|
+
<ab-settings-form>
|
|
115
|
+
<ab-toggle v-model="form.emails" name="emails" title="Email me updates" />
|
|
116
|
+
<ab-toggle v-model="form.marketing" name="marketing" title="Marketing emails" />
|
|
117
|
+
</ab-settings-form>
|
|
118
|
+
</ab-wizard-step>
|
|
119
|
+
</ab-wizard>
|
|
120
|
+
</template>
|
|
121
|
+
|
|
122
|
+
<script setup>
|
|
123
|
+
import { ref } from "vue";
|
|
124
|
+
import { AbSettingsForm, useToast } from "@appsbd/vue3-appsbd-ui";
|
|
125
|
+
|
|
126
|
+
const { toast } = useToast();
|
|
127
|
+
|
|
128
|
+
const form = ref({
|
|
129
|
+
email: "", password: "", name: "", role: null,
|
|
130
|
+
emails: false, marketing: false,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const roleOptions = [
|
|
134
|
+
{ val: "admin", title: "Admin" },
|
|
135
|
+
{ val: "editor", title: "Editor" },
|
|
136
|
+
{ val: "viewer", title: "Viewer" },
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
async function validateAccount(values) {
|
|
140
|
+
const taken = await api.checkEmail(values.email);
|
|
141
|
+
if (taken) return false; // blocks wizard from advancing to next step
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
async function validateProfile(values) {
|
|
145
|
+
// return false to block, or nothing to allow
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function onFinished() {
|
|
149
|
+
toast.success("Setup complete!");
|
|
150
|
+
}
|
|
151
|
+
</script>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Output format
|
|
155
|
+
|
|
156
|
+
Ask the user for:
|
|
157
|
+
1. **Sections / steps** — one settings form per wizard step, or a single standalone form
|
|
158
|
+
2. **Fields per section** — name, type, required?, options (for selects)
|
|
159
|
+
3. **Save / API endpoint**
|
|
160
|
+
|
|
161
|
+
Then generate the Vue file(s) in one response, each in a separate code block labeled with its file path.
|
|
162
|
+
|
|
163
|
+
## Example invocation
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
/settings-form
|
|
167
|
+
|
|
168
|
+
Page: User Profile Settings
|
|
169
|
+
Sections:
|
|
170
|
+
- Account: email (required), password (required, min 8)
|
|
171
|
+
- Preferences: language (select: English|Bengali|Arabic), email_notifications (toggle), theme (select: Light|Dark)
|
|
172
|
+
|
|
173
|
+
API: /api/user/settings
|
|
174
|
+
Output: src/pages/settings/ProfileSettings.vue
|
|
175
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use when generating code that uses @appsbd/vue3-appsbd-ui components or APIs
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Using @appsbd/vue3-appsbd-ui
|
|
6
|
+
|
|
7
|
+
## Rules
|
|
8
|
+
|
|
9
|
+
- Use `Ab*` components before reaching for any external UI library.
|
|
10
|
+
- Never guess props, events, or slots — always read the reference file first.
|
|
11
|
+
- Globally registered components need no import. All others: `import { X } from "@appsbd/vue3-appsbd-ui"`.
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
1. Read `node_modules/@appsbd/vue3-appsbd-ui/AI_REF.md` to find available components and their reference file paths.
|
|
16
|
+
2. Read `node_modules/@appsbd/vue3-appsbd-ui/.ai/ai_ref_[ComponentName].md` for the exact props / events / slots before writing any code.
|
|
17
|
+
3. Generate code using only the documented API from that file.
|
|
18
|
+
|
|
19
|
+
## Quick API (no file read needed)
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
// Toast
|
|
23
|
+
import { useToast } from "@appsbd/vue3-appsbd-ui";
|
|
24
|
+
const { toast } = useToast();
|
|
25
|
+
toast.success("Done"); // .error / .warning / .info
|
|
26
|
+
|
|
27
|
+
// Alert
|
|
28
|
+
import { useAlert } from "@appsbd/vue3-appsbd-ui";
|
|
29
|
+
const { alert } = useAlert();
|
|
30
|
+
alert.confirm("Sure?", "", { onConfirm: async () => {} });
|
|
31
|
+
|
|
32
|
+
// Theme
|
|
33
|
+
import { useTheme } from "@appsbd/vue3-appsbd-ui";
|
|
34
|
+
const { toggleTheme } = useTheme();
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<!-- v-tooltip (global directive) -->
|
|
39
|
+
<ab-button v-tooltip="'Helper text'">Save</ab-button>
|
|
40
|
+
```
|