@juxtui/ui 0.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 +21 -0
- package/README.md +62 -0
- package/dist/components/avatar/JAvatar.vue.d.ts +26 -0
- package/dist/components/badge/JBadge.vue.d.ts +26 -0
- package/dist/components/button/JButton.vue.d.ts +37 -0
- package/dist/components/card/JCard.vue.d.ts +29 -0
- package/dist/components/checkbox/JCheckbox.vue.d.ts +36 -0
- package/dist/components/command-palette/JCommandPalette.vue.d.ts +81 -0
- package/dist/components/command-palette/search.d.ts +16 -0
- package/dist/components/dialog/JDialog.vue.d.ts +53 -0
- package/dist/components/dropdown-menu/JDropdownMenu.vue.d.ts +39 -0
- package/dist/components/dropdown-menu/JDropdownMenuItem.vue.d.ts +35 -0
- package/dist/components/dropdown-menu/JDropdownMenuLabel.vue.d.ts +12 -0
- package/dist/components/dropdown-menu/JDropdownMenuSeparator.vue.d.ts +3 -0
- package/dist/components/dropdown-menu/JDropdownMenuSub.vue.d.ts +17 -0
- package/dist/components/dropdown-menu/JMenuContent.vue.d.ts +44 -0
- package/dist/components/dropdown-menu/context.d.ts +17 -0
- package/dist/components/field/JFieldShell.vue.d.ts +33 -0
- package/dist/components/field/useField.d.ts +24 -0
- package/dist/components/input/JInput.vue.d.ts +42 -0
- package/dist/components/primitives/JPortal.vue.d.ts +17 -0
- package/dist/components/primitives/JSlot.d.ts +8 -0
- package/dist/components/select/JSelect.vue.d.ts +53 -0
- package/dist/components/switch/JSwitch.vue.d.ts +37 -0
- package/dist/components/tabs/JTabs.vue.d.ts +48 -0
- package/dist/components/textarea/JTextarea.vue.d.ts +38 -0
- package/dist/components/toast/JToastItem.vue.d.ts +13 -0
- package/dist/components/toast/JToaster.vue.d.ts +18 -0
- package/dist/components/tooltip/JTooltip.vue.d.ts +24 -0
- package/dist/components.d.ts +19 -0
- package/dist/composables/useFloating.d.ts +28 -0
- package/dist/composables/useFocusTrap.d.ts +12 -0
- package/dist/composables/useHotkey.d.ts +10 -0
- package/dist/composables/useLayer.d.ts +13 -0
- package/dist/composables/useRecentCommands.d.ts +19 -0
- package/dist/composables/useScrollLock.d.ts +3 -0
- package/dist/composables/useToast.d.ts +93 -0
- package/dist/composables/useTypeahead.d.ts +8 -0
- package/dist/icons.d.ts +18 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +3486 -0
- package/dist/index.js.map +1 -0
- package/dist/nuxt.d.ts +13 -0
- package/dist/nuxt.js +61 -0
- package/dist/nuxt.js.map +1 -0
- package/dist/plugin.d.ts +9 -0
- package/dist/style.css +2463 -0
- package/dist/tailwind.css +74 -0
- package/dist/tokens.css +237 -0
- package/dist/utils/dom.d.ts +10 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Julius K.
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# juxt
|
|
2
|
+
|
|
3
|
+
**Thoughtfully crafted components for Nuxt & Vue.**
|
|
4
|
+
|
|
5
|
+
Juxt is a small component library that cares about the details you feel but rarely notice: how far a menu travels when it opens, where focus goes when a dialog closes, whether a loading button changes width, what happens when you press Escape with a select open inside a dialog.
|
|
6
|
+
|
|
7
|
+
It is fifteen components, one token system and one motion language. It's mostly grayscale, and the green `#079D6B` is kept for state.
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<JButton>
|
|
11
|
+
Save changes
|
|
12
|
+
</JButton>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add @juxtui/ui
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Nuxt**: add the module. Components, composables and styles are wired up for you.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
// nuxt.config.ts
|
|
25
|
+
export default defineNuxtConfig({
|
|
26
|
+
modules: ['@juxtui/ui/nuxt'],
|
|
27
|
+
})
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Vue**: import the stylesheet once, then import what you use.
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import '@juxtui/ui/style.css'
|
|
34
|
+
import { JButton, toast } from '@juxtui/ui'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Using Tailwind CSS v4? `@import '@juxtui/ui/tailwind.css'` maps the tokens onto utilities (`bg-surface`, `text-fg-muted`, `rounded-md`, `duration-fast`, …). Juxt's styles live in a `juxt` cascade layer, so your own classes always win.
|
|
38
|
+
|
|
39
|
+
## Components
|
|
40
|
+
|
|
41
|
+
| | |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| **Actions** | Button |
|
|
44
|
+
| **Forms** | Input · Textarea · Checkbox · Switch · Select |
|
|
45
|
+
| **Overlays** | Dialog · Dropdown Menu · Tooltip · Command Palette |
|
|
46
|
+
| **Feedback** | Toast · Badge |
|
|
47
|
+
| **Display** | Avatar · Card |
|
|
48
|
+
| **Navigation** | Tabs |
|
|
49
|
+
|
|
50
|
+
Each one supports light and dark themes, full keyboard use, reduced motion and SSR. Its docs page lists the keys it handles and the ARIA it exposes.
|
|
51
|
+
|
|
52
|
+
## Design philosophy
|
|
53
|
+
|
|
54
|
+
- **Quiet until it matters.** The interface is grayscale, and green marks state: focus, checked, success, where you are. Primary buttons use ink, not green.
|
|
55
|
+
- **Motion is feedback.** There are four durations (80–240ms) and three curves, and only `transform` and `opacity` animate. Entrances are slower than exits. With reduced motion, things still fade but don't move.
|
|
56
|
+
- **Accessible by construction.** Overlays trap focus, restore it when they close, and stack correctly: Escape and outside clicks go to the top-most layer only.
|
|
57
|
+
- **Small APIs.** Props are named after what they do, and anything that holds state has a `v-model`. If you know one component, you know the rest.
|
|
58
|
+
- **Tokens all the way down.** Colour, type, space, radius, elevation, motion and layering are CSS custom properties. Change `--juxt-accent` and the whole system follows.
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
MIT
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type AvatarStatus = 'online' | 'away' | 'busy' | 'offline';
|
|
2
|
+
export interface AvatarProps {
|
|
3
|
+
src?: string;
|
|
4
|
+
/** Image alt text. Defaults to `name`. */
|
|
5
|
+
alt?: string;
|
|
6
|
+
/** Full name — used for initials and as the accessible name. */
|
|
7
|
+
name?: string;
|
|
8
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
shape?: 'circle' | 'square';
|
|
10
|
+
status?: AvatarStatus;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Slots = {
|
|
13
|
+
fallback?: () => unknown;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<AvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarProps> & Readonly<{}>, {
|
|
16
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
17
|
+
shape: "circle" | "square";
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type BadgeVariant = 'neutral' | 'success' | 'warning' | 'destructive' | 'accent';
|
|
2
|
+
export interface BadgeProps {
|
|
3
|
+
variant?: BadgeVariant;
|
|
4
|
+
size?: 'sm' | 'md';
|
|
5
|
+
/**
|
|
6
|
+
* Status style: plain text led by a small square marker, no fill.
|
|
7
|
+
* Reads as a state rather than a label.
|
|
8
|
+
*/
|
|
9
|
+
dot?: boolean;
|
|
10
|
+
}
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
default?: () => unknown;
|
|
13
|
+
leading?: () => unknown;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<BadgeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BadgeProps> & Readonly<{}>, {
|
|
16
|
+
size: "sm" | "md";
|
|
17
|
+
variant: BadgeVariant;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';
|
|
3
|
+
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
4
|
+
export interface ButtonProps {
|
|
5
|
+
/** Visual weight. `primary` is for the single most important action in a view. */
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
/** Shows a spinner, keeps the width, and blocks activation while staying focusable. */
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Square button for a single icon. Provide an `aria-label`. */
|
|
12
|
+
icon?: boolean;
|
|
13
|
+
/** Stretch to the full width of the container. */
|
|
14
|
+
block?: boolean;
|
|
15
|
+
/** Render as another element or component, e.g. `a` or `NuxtLink`. */
|
|
16
|
+
as?: string | Component;
|
|
17
|
+
type?: 'button' | 'submit' | 'reset';
|
|
18
|
+
}
|
|
19
|
+
type __VLS_Slots = {
|
|
20
|
+
default?: () => unknown;
|
|
21
|
+
leading?: () => unknown;
|
|
22
|
+
trailing?: () => unknown;
|
|
23
|
+
};
|
|
24
|
+
declare const __VLS_base: import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
|
|
25
|
+
size: ButtonSize;
|
|
26
|
+
type: "button" | "submit" | "reset";
|
|
27
|
+
variant: ButtonVariant;
|
|
28
|
+
as: string | Component;
|
|
29
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
31
|
+
declare const _default: typeof __VLS_export;
|
|
32
|
+
export default _default;
|
|
33
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
34
|
+
new (): {
|
|
35
|
+
$slots: S;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
export interface CardProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
/** `outline` sits on the page; `muted` recedes into it. */
|
|
6
|
+
variant?: 'outline' | 'muted';
|
|
7
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
8
|
+
as?: string | Component;
|
|
9
|
+
}
|
|
10
|
+
type __VLS_Slots = {
|
|
11
|
+
default?: () => unknown;
|
|
12
|
+
header?: () => unknown;
|
|
13
|
+
/** Sits to the right of the title — a button, badge or menu. */
|
|
14
|
+
actions?: () => unknown;
|
|
15
|
+
footer?: () => unknown;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<CardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CardProps> & Readonly<{}>, {
|
|
18
|
+
variant: "outline" | "muted";
|
|
19
|
+
as: string | Component;
|
|
20
|
+
padding: "none" | "sm" | "md" | "lg";
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface CheckboxProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
/** Shows a dash. Typically used for "select all" when only some items are selected. */
|
|
7
|
+
indeterminate?: boolean;
|
|
8
|
+
name?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Props = CheckboxProps;
|
|
13
|
+
type __VLS_Slots = {
|
|
14
|
+
default?: () => unknown;
|
|
15
|
+
description?: () => unknown;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_ModelProps = {
|
|
18
|
+
modelValue?: boolean;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
21
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
22
|
+
input: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
23
|
+
focus: () => void | undefined;
|
|
24
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
+
"update:modelValue": (value: boolean) => any;
|
|
26
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
27
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
28
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
export interface CommandItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
/** An icon component, rendered at 16px. */
|
|
7
|
+
icon?: Component;
|
|
8
|
+
/** Shortcut to display, in hotkey syntax: `mod+shift+p`. Display only. */
|
|
9
|
+
shortcut?: string;
|
|
10
|
+
/** Extra terms that should find this item. */
|
|
11
|
+
keywords?: string[];
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Called when the item is chosen, before `select` is emitted. */
|
|
14
|
+
onSelect?: (item: CommandItem) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface CommandGroup {
|
|
17
|
+
id: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
items: CommandItem[];
|
|
20
|
+
}
|
|
21
|
+
export interface CommandPaletteProps {
|
|
22
|
+
groups: CommandGroup[];
|
|
23
|
+
/** Shown as a "Recent" group while the search is empty. */
|
|
24
|
+
recent?: CommandItem[];
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
/** Show a loading indicator — for async results. */
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Built-in ranking and filtering. Set to `false` when you filter yourself
|
|
30
|
+
* (e.g. server-side search driven by `v-model:search`).
|
|
31
|
+
*/
|
|
32
|
+
filter?: boolean;
|
|
33
|
+
/** Global shortcut that toggles the palette. `false` to disable. */
|
|
34
|
+
hotkey?: string | false;
|
|
35
|
+
/** Accessible name of the dialog. */
|
|
36
|
+
label?: string;
|
|
37
|
+
emptyText?: string;
|
|
38
|
+
}
|
|
39
|
+
type __VLS_Props = CommandPaletteProps;
|
|
40
|
+
type __VLS_Slots = {
|
|
41
|
+
item?: (props: {
|
|
42
|
+
item: CommandItem;
|
|
43
|
+
active: boolean;
|
|
44
|
+
}) => unknown;
|
|
45
|
+
empty?: (props: {
|
|
46
|
+
search: string;
|
|
47
|
+
}) => unknown;
|
|
48
|
+
footer?: () => unknown;
|
|
49
|
+
};
|
|
50
|
+
declare function close(): void;
|
|
51
|
+
type __VLS_ModelProps = {
|
|
52
|
+
'open'?: boolean;
|
|
53
|
+
'search'?: string;
|
|
54
|
+
};
|
|
55
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
56
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
57
|
+
close: typeof close;
|
|
58
|
+
focus: () => void | undefined;
|
|
59
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
60
|
+
select: (item: CommandItem) => any;
|
|
61
|
+
"update:open": (value: boolean) => any;
|
|
62
|
+
"update:search": (value: string) => any;
|
|
63
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
64
|
+
onSelect?: ((item: CommandItem) => any) | undefined;
|
|
65
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
66
|
+
"onUpdate:search"?: ((value: string) => any) | undefined;
|
|
67
|
+
}>, {
|
|
68
|
+
label: string;
|
|
69
|
+
filter: boolean;
|
|
70
|
+
placeholder: string;
|
|
71
|
+
hotkey: string | false;
|
|
72
|
+
emptyText: string;
|
|
73
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
74
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
75
|
+
declare const _default: typeof __VLS_export;
|
|
76
|
+
export default _default;
|
|
77
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
78
|
+
new (): {
|
|
79
|
+
$slots: S;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ranking for the command palette. Cheap enough to run on every keystroke
|
|
3
|
+
* over a few thousand items, and ordered the way people expect:
|
|
4
|
+
* exact › prefix › word start › substring › in-order letters.
|
|
5
|
+
*/
|
|
6
|
+
export type MatchRange = [start: number, end: number];
|
|
7
|
+
export interface MatchResult {
|
|
8
|
+
score: number;
|
|
9
|
+
ranges: MatchRange[];
|
|
10
|
+
}
|
|
11
|
+
export declare function matchText(query: string, text: string): MatchResult;
|
|
12
|
+
/** Split text into highlighted and plain runs. */
|
|
13
|
+
export declare function splitByRanges(text: string, ranges: MatchRange[]): Array<{
|
|
14
|
+
text: string;
|
|
15
|
+
match: boolean;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface DialogProps {
|
|
2
|
+
title?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
/** Close when the backdrop is clicked. Defaults to true. */
|
|
6
|
+
closeOnOverlay?: boolean;
|
|
7
|
+
/** Close when Escape is pressed. Defaults to true. */
|
|
8
|
+
closeOnEscape?: boolean;
|
|
9
|
+
/** Hide the close button in the corner. */
|
|
10
|
+
hideClose?: boolean;
|
|
11
|
+
/** Accessible label when there is no visible title. */
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
type __VLS_Props = DialogProps;
|
|
15
|
+
type __VLS_Slots = {
|
|
16
|
+
default?: (props: {
|
|
17
|
+
close: () => void;
|
|
18
|
+
}) => unknown;
|
|
19
|
+
/** Custom header. Put `titleId` on your heading so the dialog stays labelled. */
|
|
20
|
+
header?: (props: {
|
|
21
|
+
titleId: string;
|
|
22
|
+
descriptionId: string;
|
|
23
|
+
}) => unknown;
|
|
24
|
+
footer?: (props: {
|
|
25
|
+
close: () => void;
|
|
26
|
+
}) => unknown;
|
|
27
|
+
};
|
|
28
|
+
declare function close(): void;
|
|
29
|
+
type __VLS_ModelProps = {
|
|
30
|
+
'open'?: boolean;
|
|
31
|
+
};
|
|
32
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
33
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
34
|
+
close: typeof close;
|
|
35
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
"update:open": (value: boolean) => any;
|
|
37
|
+
afterClose: () => any;
|
|
38
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
39
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
40
|
+
onAfterClose?: (() => any) | undefined;
|
|
41
|
+
}>, {
|
|
42
|
+
size: "sm" | "md" | "lg";
|
|
43
|
+
closeOnOverlay: boolean;
|
|
44
|
+
closeOnEscape: boolean;
|
|
45
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
46
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
47
|
+
declare const _default: typeof __VLS_export;
|
|
48
|
+
export default _default;
|
|
49
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Placement } from '../../composables/useFloating';
|
|
2
|
+
export interface DropdownMenuProps {
|
|
3
|
+
placement?: Placement;
|
|
4
|
+
/** Distance from the trigger, in px. */
|
|
5
|
+
offset?: number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
type __VLS_Props = DropdownMenuProps;
|
|
9
|
+
type __VLS_Slots = {
|
|
10
|
+
/** The element that opens the menu — usually a `JButton`. */
|
|
11
|
+
trigger?: (props: {
|
|
12
|
+
open: boolean;
|
|
13
|
+
}) => unknown;
|
|
14
|
+
default?: () => unknown;
|
|
15
|
+
};
|
|
16
|
+
declare function close(restoreFocus?: boolean): void;
|
|
17
|
+
type __VLS_ModelProps = {
|
|
18
|
+
'open'?: boolean;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
21
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
22
|
+
open: () => void;
|
|
23
|
+
close: typeof close;
|
|
24
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
+
"update:open": (value: boolean) => any;
|
|
26
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
27
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
placement: Placement;
|
|
30
|
+
offset: number;
|
|
31
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
export interface DropdownMenuItemProps {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
/** Styles the item as a destructive action. */
|
|
5
|
+
destructive?: boolean;
|
|
6
|
+
/** A keyboard shortcut to display, e.g. `⌘D`. Display only. */
|
|
7
|
+
shortcut?: string;
|
|
8
|
+
/** Render as another element, e.g. `a` or `NuxtLink` for navigation items. */
|
|
9
|
+
as?: string | Component;
|
|
10
|
+
/**
|
|
11
|
+
* Makes the item one choice in a set (e.g. a theme picker). `true` shows a
|
|
12
|
+
* check at the end of the row. Leave undefined for a plain action.
|
|
13
|
+
*/
|
|
14
|
+
checked?: boolean;
|
|
15
|
+
}
|
|
16
|
+
type __VLS_Slots = {
|
|
17
|
+
default?: () => unknown;
|
|
18
|
+
leading?: () => unknown;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_base: import("vue").DefineComponent<DropdownMenuItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
select: (event: Event) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<DropdownMenuItemProps> & Readonly<{
|
|
23
|
+
onSelect?: ((event: Event) => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
as: string | Component;
|
|
26
|
+
checked: boolean;
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
29
|
+
declare const _default: typeof __VLS_export;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type __VLS_Slots = {
|
|
2
|
+
default?: () => unknown;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
5
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface DropdownMenuSubProps {
|
|
2
|
+
label: string;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
type __VLS_Slots = {
|
|
6
|
+
default?: () => unknown;
|
|
7
|
+
leading?: () => unknown;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<DropdownMenuSubProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DropdownMenuSubProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal: the floating list shared by the root menu and submenus.
|
|
3
|
+
* Owns positioning, keyboard navigation, typeahead and the layer.
|
|
4
|
+
*/
|
|
5
|
+
import type { Placement } from '../../composables/useFloating';
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
open: boolean;
|
|
8
|
+
reference: HTMLElement | null;
|
|
9
|
+
id: string;
|
|
10
|
+
labelledby?: string;
|
|
11
|
+
placement: Placement;
|
|
12
|
+
offset: number | {
|
|
13
|
+
mainAxis?: number;
|
|
14
|
+
crossAxis?: number;
|
|
15
|
+
};
|
|
16
|
+
/** What to focus once open. */
|
|
17
|
+
initialFocus: 'first' | 'last' | 'content' | 'none';
|
|
18
|
+
isSub?: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare var __VLS_14: {};
|
|
21
|
+
type __VLS_Slots = {} & {
|
|
22
|
+
default?: (props: typeof __VLS_14) => any;
|
|
23
|
+
};
|
|
24
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
25
|
+
content: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
26
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
|
+
pointerenter: () => any;
|
|
28
|
+
escape: () => any;
|
|
29
|
+
outside: (event: PointerEvent) => any;
|
|
30
|
+
back: () => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
32
|
+
onPointerenter?: (() => any) | undefined;
|
|
33
|
+
onEscape?: (() => any) | undefined;
|
|
34
|
+
onOutside?: ((event: PointerEvent) => any) | undefined;
|
|
35
|
+
onBack?: (() => any) | undefined;
|
|
36
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
38
|
+
declare const _default: typeof __VLS_export;
|
|
39
|
+
export default _default;
|
|
40
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
41
|
+
new (): {
|
|
42
|
+
$slots: S;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
+
export interface MenuRootContext {
|
|
3
|
+
/** Close the whole menu tree. */
|
|
4
|
+
close: (restoreFocus?: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface MenuLevelContext {
|
|
7
|
+
content: Ref<HTMLElement | null>;
|
|
8
|
+
/** Id of the submenu currently open at this level. */
|
|
9
|
+
openSub: Ref<string | null>;
|
|
10
|
+
setOpenSub: (id: string | null) => void;
|
|
11
|
+
/** Close the open submenu shortly, unless the pointer is on its way into it. */
|
|
12
|
+
scheduleSubClose: () => void;
|
|
13
|
+
cancelSubClose: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const MENU_ROOT: InjectionKey<MenuRootContext>;
|
|
16
|
+
export declare const MENU_LEVEL: InjectionKey<MenuLevelContext>;
|
|
17
|
+
export declare function getMenuItems(content: HTMLElement | null): HTMLElement[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal: lays out label, control, description and error for form fields.
|
|
3
|
+
* Not exported — every field component composes it.
|
|
4
|
+
*/
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
id: string;
|
|
7
|
+
labelId: string;
|
|
8
|
+
descriptionId: string;
|
|
9
|
+
errorId: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
showDescription?: boolean;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Render the label as a plain element when the control isn't labelable (e.g. a button). */
|
|
17
|
+
labelFor?: string | null;
|
|
18
|
+
};
|
|
19
|
+
declare var __VLS_7: {}, __VLS_9: {};
|
|
20
|
+
type __VLS_Slots = {} & {
|
|
21
|
+
label?: (props: typeof __VLS_7) => any;
|
|
22
|
+
} & {
|
|
23
|
+
default?: (props: typeof __VLS_9) => any;
|
|
24
|
+
};
|
|
25
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
export interface FieldProps {
|
|
3
|
+
/** Visible label. Also used as the accessible name. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Supporting text under the control. Hidden while an error message is shown. */
|
|
6
|
+
description?: string;
|
|
7
|
+
/** An error message, or `true` to mark the field invalid without a message. */
|
|
8
|
+
error?: string | boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Id for the control. Generated when omitted. */
|
|
12
|
+
id?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Ids and ARIA wiring shared by every form control. */
|
|
15
|
+
export declare function useField(props: MaybeRefOrGetter<FieldProps>): {
|
|
16
|
+
id: import("vue").ComputedRef<string>;
|
|
17
|
+
labelId: import("vue").ComputedRef<string>;
|
|
18
|
+
descriptionId: import("vue").ComputedRef<string>;
|
|
19
|
+
errorId: import("vue").ComputedRef<string>;
|
|
20
|
+
invalid: import("vue").ComputedRef<boolean>;
|
|
21
|
+
errorMessage: import("vue").ComputedRef<string>;
|
|
22
|
+
showDescription: import("vue").ComputedRef<boolean>;
|
|
23
|
+
describedBy: import("vue").ComputedRef<string | undefined>;
|
|
24
|
+
};
|