@alikhalilll/ui 1.0.0 → 1.1.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 +155 -187
- package/dist/chunks/ADrawerContent.vue_vue_type_script_setup_true_lang-BivIZvV1.mjs +108 -0
- package/dist/chunks/ADrawerContent.vue_vue_type_script_setup_true_lang-BivIZvV1.mjs.map +1 -0
- package/dist/chunks/AInput.vue_vue_type_script_setup_true_lang-BJUP7ePq.mjs +81 -0
- package/dist/chunks/AInput.vue_vue_type_script_setup_true_lang-BJUP7ePq.mjs.map +1 -0
- package/dist/chunks/APopoverContent.vue_vue_type_script_setup_true_lang-o1XhV9DM.mjs +132 -0
- package/dist/chunks/APopoverContent.vue_vue_type_script_setup_true_lang-o1XhV9DM.mjs.map +1 -0
- package/dist/chunks/AResponsivePopoverContent.vue_vue_type_script_setup_true_lang-BYEb5UBL.mjs +92 -0
- package/dist/chunks/AResponsivePopoverContent.vue_vue_type_script_setup_true_lang-BYEb5UBL.mjs.map +1 -0
- package/dist/chunks/ATellInput.vue_vue_type_script_setup_true_lang-Clc-B8SW.mjs +1353 -0
- package/dist/chunks/ATellInput.vue_vue_type_script_setup_true_lang-Clc-B8SW.mjs.map +1 -0
- package/dist/chunks/cn-B6yFEsav.mjs +9 -0
- package/dist/chunks/cn-B6yFEsav.mjs.map +1 -0
- package/dist/chunks/sizes-B_9MfLkz.mjs +34 -0
- package/dist/chunks/sizes-B_9MfLkz.mjs.map +1 -0
- package/dist/drawer.d.ts +116 -0
- package/dist/drawer.mjs +8 -0
- package/dist/drawer.mjs.map +1 -0
- package/dist/index.d.ts +84 -57
- package/dist/index.mjs +35 -1516
- package/dist/index.mjs.map +1 -1
- package/dist/input.d.ts +65 -0
- package/dist/input.mjs +5 -0
- package/dist/input.mjs.map +1 -0
- package/dist/popover.d.ts +117 -0
- package/dist/popover.mjs +8 -0
- package/dist/popover.mjs.map +1 -0
- package/dist/responsive-popover.d.ts +124 -0
- package/dist/responsive-popover.mjs +7 -0
- package/dist/responsive-popover.mjs.map +1 -0
- package/dist/tell-input.d.ts +637 -0
- package/dist/tell-input.mjs +13 -0
- package/dist/tell-input.mjs.map +1 -0
- package/dist/utils.d.ts +29 -0
- package/dist/utils.mjs +12 -0
- package/dist/utils.mjs.map +1 -0
- package/entries/drawer/README.md +39 -0
- package/entries/input/README.md +42 -0
- package/entries/popover/README.md +37 -0
- package/entries/responsive-popover/README.md +47 -0
- package/entries/tell-input/README.md +52 -0
- package/package.json +30 -4
- /package/dist/{styles.css → assets/styles.css} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# `@alikhalilll/ui/drawer`
|
|
2
|
+
|
|
3
|
+
A themed bottom-sheet drawer built on `vaul-vue` + `reka-ui` — pre-styled with the shared `@alikhalilll/ui` tokens, portal + overlay handled.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @alikhalilll/ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { ADrawer, ADrawerTrigger, ADrawerContent, ADrawerOverlay } from '@alikhalilll/ui/drawer';
|
|
13
|
+
import '@alikhalilll/ui/styles.css';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { ADrawer, ADrawerTrigger, ADrawerContent } from '@alikhalilll/ui/drawer';
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<ADrawer>
|
|
25
|
+
<ADrawerTrigger as-child>
|
|
26
|
+
<button type="button">Open drawer</button>
|
|
27
|
+
</ADrawerTrigger>
|
|
28
|
+
<ADrawerContent class="p-6">
|
|
29
|
+
<p class="text-sm">Drawer body — drag the handle or press Escape to dismiss.</p>
|
|
30
|
+
</ADrawerContent>
|
|
31
|
+
</ADrawer>
|
|
32
|
+
</template>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Every prop on `vaul-vue`'s `DrawerRoot`, `DrawerTrigger`, `DrawerContent`, and `DrawerOverlay` is forwarded — see the [vaul-vue docs](https://github.com/unovue/vaul-vue) for snap points, dismissible, modal, etc.
|
|
36
|
+
|
|
37
|
+
Pairs with [`@alikhalilll/ui/popover`](../popover) under [`@alikhalilll/ui/responsive-popover`](../responsive-popover), which swaps between the two based on viewport size.
|
|
38
|
+
|
|
39
|
+
Full docs: [@alikhalilll/ui — Drawer](https://alikhalilll.github.io/ali-nuxt-toolkit/ui/drawer).
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# `@alikhalilll/ui/input`
|
|
2
|
+
|
|
3
|
+
A sized, themed text input primitive that respects the shared `@alikhalilll/ui` size scale (xs / sm / md / lg / xl) and design tokens.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @alikhalilll/ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { AInput } from '@alikhalilll/ui/input';
|
|
13
|
+
import '@alikhalilll/ui/styles.css';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { ref } from 'vue';
|
|
21
|
+
import { AInput } from '@alikhalilll/ui/input';
|
|
22
|
+
|
|
23
|
+
const value = ref('');
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<AInput v-model="value" placeholder="Enter text" size="md" />
|
|
28
|
+
</template>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Props
|
|
32
|
+
|
|
33
|
+
| Prop | Type | Default | Description |
|
|
34
|
+
| ------------- | -------------------------------------- | ------- | ----------------------------------- |
|
|
35
|
+
| `v-model` | `string` | `''` | Two-way bound value. |
|
|
36
|
+
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Height + padding + text-size scale. |
|
|
37
|
+
| `placeholder` | `string` | — | Standard HTML placeholder. |
|
|
38
|
+
| `disabled` | `boolean` | `false` | |
|
|
39
|
+
|
|
40
|
+
All other `<input>` attributes are forwarded.
|
|
41
|
+
|
|
42
|
+
Full docs: [@alikhalilll/ui — Input](https://alikhalilll.github.io/ali-nuxt-toolkit/ui/input).
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# `@alikhalilll/ui/popover`
|
|
2
|
+
|
|
3
|
+
A themed wrapper around `reka-ui`'s Popover primitive — pre-styled with the shared `@alikhalilll/ui` tokens (radius, shadow, border, animation), with anchor/portal behaviour handled for you.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @alikhalilll/ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { APopover, APopoverTrigger, APopoverContent } from '@alikhalilll/ui/popover';
|
|
13
|
+
import '@alikhalilll/ui/styles.css';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { APopover, APopoverTrigger, APopoverContent } from '@alikhalilll/ui/popover';
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<APopover>
|
|
25
|
+
<APopoverTrigger as-child>
|
|
26
|
+
<button type="button">Open</button>
|
|
27
|
+
</APopoverTrigger>
|
|
28
|
+
<APopoverContent class="w-64 p-4">
|
|
29
|
+
<p class="text-sm">Content lives inside a portal — escape key + outside clicks close it.</p>
|
|
30
|
+
</APopoverContent>
|
|
31
|
+
</APopover>
|
|
32
|
+
</template>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Every prop on `reka-ui`'s `PopoverRoot`, `PopoverTrigger`, and `PopoverContent` is forwarded — see the [reka-ui Popover docs](https://reka-ui.com/docs/components/popover) for the full API.
|
|
36
|
+
|
|
37
|
+
Full docs: [@alikhalilll/ui — Popover](https://alikhalilll.github.io/ali-nuxt-toolkit/ui/popover).
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# `@alikhalilll/ui/responsive-popover`
|
|
2
|
+
|
|
3
|
+
A drop-in popover that **swaps to a bottom-sheet drawer on mobile** (`useMediaQuery` watches `(min-width: 768px)`). Above the breakpoint it composes `@alikhalilll/ui/popover`; below it composes `@alikhalilll/ui/drawer`. Single API, two presentations.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @alikhalilll/ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import {
|
|
13
|
+
AResponsivePopover,
|
|
14
|
+
AResponsivePopoverTrigger,
|
|
15
|
+
AResponsivePopoverContent,
|
|
16
|
+
} from '@alikhalilll/ui/responsive-popover';
|
|
17
|
+
import '@alikhalilll/ui/styles.css';
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```vue
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
import {
|
|
25
|
+
AResponsivePopover,
|
|
26
|
+
AResponsivePopoverTrigger,
|
|
27
|
+
AResponsivePopoverContent,
|
|
28
|
+
} from '@alikhalilll/ui/responsive-popover';
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<AResponsivePopover>
|
|
33
|
+
<AResponsivePopoverTrigger as-child>
|
|
34
|
+
<button type="button">Open</button>
|
|
35
|
+
</AResponsivePopoverTrigger>
|
|
36
|
+
<AResponsivePopoverContent popover-class="w-64 p-4" drawer-class="max-h-[60vh] p-6">
|
|
37
|
+
<p class="text-sm">Renders as a popover on desktop, a drawer on phones.</p>
|
|
38
|
+
</AResponsivePopoverContent>
|
|
39
|
+
</AResponsivePopover>
|
|
40
|
+
</template>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`popover-class` and `drawer-class` let you apply variant-specific styling — only the active surface is mounted at any given time.
|
|
44
|
+
|
|
45
|
+
This component is what powers the country picker inside [`@alikhalilll/ui/tell-input`](../tell-input).
|
|
46
|
+
|
|
47
|
+
Full docs: [@alikhalilll/ui — Responsive Popover](https://alikhalilll.github.io/ali-nuxt-toolkit/ui/responsive-popover).
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# `@alikhalilll/ui/tell-input`
|
|
2
|
+
|
|
3
|
+
Vue 3 phone-number input with smart country detection (libphonenumber-js + IP/timezone/locale hint), a responsive popover/drawer country picker, and a structured `PhoneValidationResult` exposed via template ref.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @alikhalilll/ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { ATellInput } from '@alikhalilll/ui/tell-input';
|
|
13
|
+
import '@alikhalilll/ui/styles.css';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The subpath import loads only this component's chunk — none of the other `@alikhalilll/ui` components ship into the consumer's bundle.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```vue
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import { ref } from 'vue';
|
|
23
|
+
import { ATellInput } from '@alikhalilll/ui/tell-input';
|
|
24
|
+
|
|
25
|
+
const phone = ref('');
|
|
26
|
+
const country = ref<number | null>(null);
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<ATellInput v-model:phone="phone" v-model:country="country" show-validation />
|
|
31
|
+
</template>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The default shape is a plain phone input with the country picker hidden. As the user types or pastes, detection runs (debounced) against known dial codes; on first match the picker slides in pre-filled and `phone` is normalised to the national significant number — `01066105963` becomes `1066105963`, `+447911123456` becomes `7911123456`.
|
|
35
|
+
|
|
36
|
+
## Variants
|
|
37
|
+
|
|
38
|
+
- **Picker pre-filled** — pass `default-country="…"` or seed `v-model:country` so the picker renders visible at mount.
|
|
39
|
+
- **Restricted countries** — pass `allowed-dial-codes` (array of dial-digit strings, no `+`). Whitelisted countries surface in the Suggested group at the top; disallowed countries render below as disabled.
|
|
40
|
+
- **Always-visible picker (legacy)** — `:detect-from-input="false"` reverts to the IP/timezone/locale chain auto-filling the picker on mount.
|
|
41
|
+
|
|
42
|
+
## Exposed via template ref
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
const ref = ref<InstanceType<typeof ATellInput>>();
|
|
46
|
+
ref.value.validation; // PhoneValidationResult — reactive
|
|
47
|
+
ref.value.required; // PhoneRequiredInfo | null — example, length range, format hint
|
|
48
|
+
ref.value.selectedDialCode; // '+20' | null
|
|
49
|
+
ref.value.validationState; // 'idle' | 'valid' | 'error'
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Full prop reference, customization recipes, slot catalogue, and theming guide live in the [main library docs](https://alikhalilll.github.io/ali-nuxt-toolkit/ui/tell-input).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alikhalilll/ui",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Headless, shadcn-vue style component library
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "Headless, shadcn-vue style Vue 3 component library — every component is its own importable subpath (`@alikhalilll/ui/tell-input`, `@alikhalilll/ui/popover`, …) so users pay only for what they actually use.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "alikhalilll",
|
|
7
7
|
"repository": {
|
|
@@ -38,12 +38,38 @@
|
|
|
38
38
|
"types": "./dist/index.d.ts",
|
|
39
39
|
"import": "./dist/index.mjs"
|
|
40
40
|
},
|
|
41
|
-
"./
|
|
41
|
+
"./tell-input": {
|
|
42
|
+
"types": "./dist/tell-input.d.ts",
|
|
43
|
+
"import": "./dist/tell-input.mjs"
|
|
44
|
+
},
|
|
45
|
+
"./input": {
|
|
46
|
+
"types": "./dist/input.d.ts",
|
|
47
|
+
"import": "./dist/input.mjs"
|
|
48
|
+
},
|
|
49
|
+
"./popover": {
|
|
50
|
+
"types": "./dist/popover.d.ts",
|
|
51
|
+
"import": "./dist/popover.mjs"
|
|
52
|
+
},
|
|
53
|
+
"./drawer": {
|
|
54
|
+
"types": "./dist/drawer.d.ts",
|
|
55
|
+
"import": "./dist/drawer.mjs"
|
|
56
|
+
},
|
|
57
|
+
"./responsive-popover": {
|
|
58
|
+
"types": "./dist/responsive-popover.d.ts",
|
|
59
|
+
"import": "./dist/responsive-popover.mjs"
|
|
60
|
+
},
|
|
61
|
+
"./utils": {
|
|
62
|
+
"types": "./dist/utils.d.ts",
|
|
63
|
+
"import": "./dist/utils.mjs"
|
|
64
|
+
},
|
|
65
|
+
"./assets/styles.css": "./dist/assets/styles.css",
|
|
66
|
+
"./styles.css": "./dist/assets/styles.css",
|
|
42
67
|
"./package.json": "./package.json"
|
|
43
68
|
},
|
|
44
69
|
"types": "./dist/index.d.ts",
|
|
45
70
|
"files": [
|
|
46
71
|
"dist",
|
|
72
|
+
"entries/**/README.md",
|
|
47
73
|
"README.md",
|
|
48
74
|
"LICENSE"
|
|
49
75
|
],
|
|
@@ -75,7 +101,7 @@
|
|
|
75
101
|
},
|
|
76
102
|
"scripts": {
|
|
77
103
|
"clean": "rimraf dist",
|
|
78
|
-
"build": "pnpm clean && vite build && node -e \"require('node:fs').copyFileSync('
|
|
104
|
+
"build": "pnpm clean && vite build && node -e \"const fs=require('node:fs'); fs.mkdirSync('dist/assets',{recursive:true}); fs.copyFileSync('assets/styles.css','dist/assets/styles.css');\"",
|
|
79
105
|
"typecheck": "vue-tsc --noEmit -p tsconfig.json"
|
|
80
106
|
}
|
|
81
107
|
}
|
|
File without changes
|