@ansh-ui/vue 0.2.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/dist/chunk-2VSROZ2N.js +1281 -0
- package/dist/chunk-2VSROZ2N.js.map +1 -0
- package/dist/chunk-5BQEZYG6.cjs +1294 -0
- package/dist/chunk-5BQEZYG6.cjs.map +1 -0
- package/dist/chunk-6732H4BQ.cjs +28 -0
- package/dist/chunk-6732H4BQ.cjs.map +1 -0
- package/dist/chunk-6ABPGOJP.js +722 -0
- package/dist/chunk-6ABPGOJP.js.map +1 -0
- package/dist/chunk-6XJOB6LE.js +62 -0
- package/dist/chunk-6XJOB6LE.js.map +1 -0
- package/dist/chunk-774WBLDR.cjs +24 -0
- package/dist/chunk-774WBLDR.cjs.map +1 -0
- package/dist/chunk-B6OXKW5Q.js +567 -0
- package/dist/chunk-B6OXKW5Q.js.map +1 -0
- package/dist/chunk-DMPNT3MY.cjs +64 -0
- package/dist/chunk-DMPNT3MY.cjs.map +1 -0
- package/dist/chunk-EISHOEB6.cjs +158 -0
- package/dist/chunk-EISHOEB6.cjs.map +1 -0
- package/dist/chunk-EVO23GUS.js +223 -0
- package/dist/chunk-EVO23GUS.js.map +1 -0
- package/dist/chunk-FVKLCGA4.js +1035 -0
- package/dist/chunk-FVKLCGA4.js.map +1 -0
- package/dist/chunk-IOXGBPOV.cjs +3681 -0
- package/dist/chunk-IOXGBPOV.cjs.map +1 -0
- package/dist/chunk-J2LA4GRP.cjs +1051 -0
- package/dist/chunk-J2LA4GRP.cjs.map +1 -0
- package/dist/chunk-JQ4YLXXM.cjs +580 -0
- package/dist/chunk-JQ4YLXXM.cjs.map +1 -0
- package/dist/chunk-KCA7RNJ4.cjs +781 -0
- package/dist/chunk-KCA7RNJ4.cjs.map +1 -0
- package/dist/chunk-NJDDNO4C.js +23 -0
- package/dist/chunk-NJDDNO4C.js.map +1 -0
- package/dist/chunk-OAQ7MDYX.js +22 -0
- package/dist/chunk-OAQ7MDYX.js.map +1 -0
- package/dist/chunk-PP6OYURM.cjs +238 -0
- package/dist/chunk-PP6OYURM.cjs.map +1 -0
- package/dist/chunk-SHX2JGID.cjs +269 -0
- package/dist/chunk-SHX2JGID.cjs.map +1 -0
- package/dist/chunk-SOYRICHU.js +3645 -0
- package/dist/chunk-SOYRICHU.js.map +1 -0
- package/dist/chunk-T425FIC7.js +773 -0
- package/dist/chunk-T425FIC7.js.map +1 -0
- package/dist/chunk-TMG3M6TK.js +152 -0
- package/dist/chunk-TMG3M6TK.js.map +1 -0
- package/dist/chunk-XLLSS464.cjs +286 -0
- package/dist/chunk-XLLSS464.cjs.map +1 -0
- package/dist/chunk-XZ5ZFLZM.js +280 -0
- package/dist/chunk-XZ5ZFLZM.js.map +1 -0
- package/dist/chunk-Z7XOFKM4.cjs +733 -0
- package/dist/chunk-Z7XOFKM4.cjs.map +1 -0
- package/dist/chunk-ZGMXOMCB.js +266 -0
- package/dist/chunk-ZGMXOMCB.js.map +1 -0
- package/dist/data.cjs +70 -0
- package/dist/data.cjs.map +1 -0
- package/dist/data.d.cts +963 -0
- package/dist/data.d.ts +963 -0
- package/dist/data.js +5 -0
- package/dist/data.js.map +1 -0
- package/dist/form.cjs +151 -0
- package/dist/form.cjs.map +1 -0
- package/dist/form.d.cts +2639 -0
- package/dist/form.d.ts +2639 -0
- package/dist/form.js +6 -0
- package/dist/form.js.map +1 -0
- package/dist/index.cjs +1158 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +439 -0
- package/dist/index.d.ts +439 -0
- package/dist/index.js +547 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.cjs +67 -0
- package/dist/layout.cjs.map +1 -0
- package/dist/layout.d.cts +729 -0
- package/dist/layout.d.ts +729 -0
- package/dist/layout.js +6 -0
- package/dist/layout.js.map +1 -0
- package/dist/motion.cjs +50 -0
- package/dist/motion.cjs.map +1 -0
- package/dist/motion.d.cts +681 -0
- package/dist/motion.d.ts +681 -0
- package/dist/motion.js +5 -0
- package/dist/motion.js.map +1 -0
- package/dist/navigation.cjs +48 -0
- package/dist/navigation.cjs.map +1 -0
- package/dist/navigation.d.cts +515 -0
- package/dist/navigation.d.ts +515 -0
- package/dist/navigation.js +7 -0
- package/dist/navigation.js.map +1 -0
- package/dist/overlay.cjs +61 -0
- package/dist/overlay.cjs.map +1 -0
- package/dist/overlay.d.cts +772 -0
- package/dist/overlay.d.ts +772 -0
- package/dist/overlay.js +8 -0
- package/dist/overlay.js.map +1 -0
- package/dist/position-Cn7qP1pn.d.cts +50 -0
- package/dist/position-Cn7qP1pn.d.ts +50 -0
- package/dist/primitives.cjs +129 -0
- package/dist/primitives.cjs.map +1 -0
- package/dist/primitives.d.cts +300 -0
- package/dist/primitives.d.ts +300 -0
- package/dist/primitives.js +8 -0
- package/dist/primitives.js.map +1 -0
- package/dist/sidebar-CQqEmpid.d.cts +124 -0
- package/dist/sidebar-CTZ-Ckko.d.ts +124 -0
- package/dist/styles.css +5593 -0
- package/dist/utils-IKPG3zcC.d.cts +46 -0
- package/dist/utils-IKPG3zcC.d.ts +46 -0
- package/package.json +91 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
import { Resizable, VStack, Stack, Spacer, ScrollArea, HStack, GridItem, Grid, Divider, Container, Center, AspectRatio } from './chunk-B6OXKW5Q.js';
|
|
2
|
+
export { AspectRatio, Center, Container, Divider, Grid, GridItem, HStack, Resizable, ScrollArea, Spacer, Stack, VStack } from './chunk-B6OXKW5Q.js';
|
|
3
|
+
import { DateRangePicker, DatePicker, Calendar, ColorPicker, Dropzone, Rating, TagsInput, PinInput, Slider, RangeSlider, Combobox, Select, OptionList, Switch, RadioGroup, Radio, ChoiceCard, Checkbox, Textarea, NumberInput, Input, VisuallyHidden, Fieldset, Field } from './chunk-SOYRICHU.js';
|
|
4
|
+
export { Calendar, Checkbox, ChoiceCard, ColorPicker, Combobox, DatePicker, DateRangePicker, Dropzone, Field, Fieldset, Input, NumberInput, OptionList, PinInput, Radio, RadioGroup, RangeSlider, Rating, Select, Slider, Switch, TagsInput, Textarea, VisuallyHidden, addDays, addMonths, filterOptions, firstEnabled, isSameDay, scoreOption, startOfDay, stepActive, useFieldContext, useFieldControl, useTypeahead } from './chunk-SOYRICHU.js';
|
|
5
|
+
import { DropdownMenu, ContextMenu, Drawer, TooltipProvider, Tooltip, PopoverTrigger, PopoverContent, Popover, HoverCard, DialogFooter, Dialog, AlertDialog } from './chunk-2VSROZ2N.js';
|
|
6
|
+
export { AlertDialog, ContextMenu, Dialog, DialogFooter, Drawer, DropdownMenu, HoverCard, Popover, PopoverContent, PopoverTrigger, Tooltip, TooltipProvider } from './chunk-2VSROZ2N.js';
|
|
7
|
+
export { usePresence } from './chunk-6XJOB6LE.js';
|
|
8
|
+
export { computePosition, getLayerStack, useAnchoredPosition, useDismiss, useScrollLock } from './chunk-XZ5ZFLZM.js';
|
|
9
|
+
import { Progress, Meter, CircularProgress, Timeline, Stat, Kbd, EmptyState, DescriptionList, CodeBlock, Badge, AvatarGroup, Avatar, Table, Pagination, DataTable } from './chunk-FVKLCGA4.js';
|
|
10
|
+
export { Avatar, AvatarGroup, Badge, CircularProgress, CodeBlock, DataTable, DescriptionList, EmptyState, Kbd, Meter, Pagination, Progress, Stat, Table, Timeline } from './chunk-FVKLCGA4.js';
|
|
11
|
+
import { DisclosureList, Collapsible, Accordion, Tabs, NavigationMenu, Stepper, Breadcrumbs } from './chunk-T425FIC7.js';
|
|
12
|
+
export { Accordion, Breadcrumbs, Collapsible, DisclosureList, NavigationMenu, Stepper, Tabs } from './chunk-T425FIC7.js';
|
|
13
|
+
import { AppShell, Sidebar } from './chunk-ZGMXOMCB.js';
|
|
14
|
+
export { AppShell, Sidebar } from './chunk-ZGMXOMCB.js';
|
|
15
|
+
export { getTabbable, useAutoFocus, useFocusRestore, useFocusTrap, useRovingFocus } from './chunk-TMG3M6TK.js';
|
|
16
|
+
export { useControllableState } from './chunk-OAQ7MDYX.js';
|
|
17
|
+
import { Motion, Draggable, AnimatePresence, ThemeProvider, MotionConfig, AnimatedText, GradientText } from './chunk-6ABPGOJP.js';
|
|
18
|
+
export { AnimatePresence, AnimatedText, Draggable, GradientText, Motion, MotionConfig, ThemeProvider, themeScript, useMotionConfig, useTheme } from './chunk-6ABPGOJP.js';
|
|
19
|
+
export { useAnimate, useAnimatedFrom, useElementSize, useFrameBudget, useInView, useMotionRef, useMotionStyle, useMotionValue, usePointer, useReducedMotion, useScrollProgress, useSpringValue, useTicker, useWindowScroll } from './chunk-EVO23GUS.js';
|
|
20
|
+
import { __export, resolveSlotContent, cx } from './chunk-NJDDNO4C.js';
|
|
21
|
+
export { cx, resolveSlotContent, useId } from './chunk-NJDDNO4C.js';
|
|
22
|
+
import { defineComponent, ref, h, onMounted, watch, onBeforeUnmount, getCurrentScope, onScopeDispose } from 'vue';
|
|
23
|
+
import { mountEffect, mountBehaviour, aurora, meshGradient, animatedGradient, particleField, constellation, meteors, rain, snow, fireflies, waves, blob, noiseLayer, spotlight, magnetic, tilt, ripple, marquee, scrollReveal, parallax, setReducedMotionMode, getTicker, attachLifecycle } from '@ansh-ui/core';
|
|
24
|
+
export { MotionValue, animate, checkContrast, createGradient, createNoise, createScale, createTimeline, cubicBezier, easings, ensureContrast, generatePalette, getRegistry, getTicker, mixColors, motionValue, palettes, parseColor, pickReadable, prefersReducedMotion, registerEasing, setReducedMotionMode, signature as signatureEasings, springs, stagger, toHex, toOklchString } from '@ansh-ui/core';
|
|
25
|
+
|
|
26
|
+
var HOST_STYLE = {
|
|
27
|
+
position: "relative",
|
|
28
|
+
isolation: "isolate",
|
|
29
|
+
overflow: "hidden"
|
|
30
|
+
};
|
|
31
|
+
var CONTENT_STYLE = {
|
|
32
|
+
position: "relative",
|
|
33
|
+
zIndex: 1
|
|
34
|
+
};
|
|
35
|
+
function createEffectComponent(definition, name) {
|
|
36
|
+
const optionKeys = Object.keys(definition.defaults);
|
|
37
|
+
const props = {};
|
|
38
|
+
for (const key of optionKeys) {
|
|
39
|
+
props[key] = { type: null, default: void 0 };
|
|
40
|
+
}
|
|
41
|
+
props.as = { type: String, default: void 0 };
|
|
42
|
+
const component = defineComponent({
|
|
43
|
+
name: name ?? `Ansh${pascal(definition.name)}`,
|
|
44
|
+
// Attributes are bound explicitly below so our positioning styles merge with the author's
|
|
45
|
+
// rather than being overwritten by automatic inheritance.
|
|
46
|
+
inheritAttrs: false,
|
|
47
|
+
props,
|
|
48
|
+
setup(componentProps, { slots, attrs, expose }) {
|
|
49
|
+
const host = ref(null);
|
|
50
|
+
let handle = null;
|
|
51
|
+
const collect = () => {
|
|
52
|
+
const out = {};
|
|
53
|
+
for (const key of optionKeys) {
|
|
54
|
+
const value = componentProps[key];
|
|
55
|
+
if (value !== void 0) out[key] = value;
|
|
56
|
+
}
|
|
57
|
+
return out;
|
|
58
|
+
};
|
|
59
|
+
onMounted(() => {
|
|
60
|
+
if (!host.value) return;
|
|
61
|
+
handle = mountEffect(definition, host.value, collect());
|
|
62
|
+
});
|
|
63
|
+
watch(collect, (next) => handle?.update(next), { deep: true, flush: "post" });
|
|
64
|
+
onBeforeUnmount(() => {
|
|
65
|
+
handle?.destroy();
|
|
66
|
+
handle = null;
|
|
67
|
+
});
|
|
68
|
+
expose({
|
|
69
|
+
pause: () => handle?.pause(),
|
|
70
|
+
resume: () => handle?.resume(),
|
|
71
|
+
renderOnce: () => handle?.renderOnce(),
|
|
72
|
+
get canvas() {
|
|
73
|
+
return handle?.canvas ?? null;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return () => {
|
|
77
|
+
const tag = componentProps.as ?? "div";
|
|
78
|
+
const { class: className, style, ...rest } = attrs;
|
|
79
|
+
return h(
|
|
80
|
+
tag,
|
|
81
|
+
{
|
|
82
|
+
ref: host,
|
|
83
|
+
class: className,
|
|
84
|
+
// Array form lets Vue merge our styles with the author's, with theirs winning.
|
|
85
|
+
style: [HOST_STYLE, style],
|
|
86
|
+
...rest
|
|
87
|
+
},
|
|
88
|
+
slots.default ? [h("div", { style: CONTENT_STYLE }, slots.default())] : void 0
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
return component;
|
|
94
|
+
}
|
|
95
|
+
function pascal(value) {
|
|
96
|
+
return value.replace(/(^|-)([a-z])/g, (_, __, letter) => letter.toUpperCase());
|
|
97
|
+
}
|
|
98
|
+
function createBehaviourComponent(definition, name, defaultTag = "div") {
|
|
99
|
+
const optionKeys = Object.keys(definition.defaults);
|
|
100
|
+
const props = {};
|
|
101
|
+
for (const key of optionKeys) {
|
|
102
|
+
props[key] = { type: null, default: void 0 };
|
|
103
|
+
}
|
|
104
|
+
props.as = { type: String, default: void 0 };
|
|
105
|
+
const component = defineComponent({
|
|
106
|
+
name: name ?? `Ansh${pascal2(definition.name)}`,
|
|
107
|
+
inheritAttrs: false,
|
|
108
|
+
props,
|
|
109
|
+
setup(componentProps, { slots, attrs, expose }) {
|
|
110
|
+
const host = ref(null);
|
|
111
|
+
let handle = null;
|
|
112
|
+
const collect = () => {
|
|
113
|
+
const out = {};
|
|
114
|
+
for (const key of optionKeys) {
|
|
115
|
+
const value = componentProps[key];
|
|
116
|
+
if (value !== void 0) out[key] = value;
|
|
117
|
+
}
|
|
118
|
+
return out;
|
|
119
|
+
};
|
|
120
|
+
onMounted(() => {
|
|
121
|
+
if (!host.value) return;
|
|
122
|
+
handle = mountBehaviour(definition, host.value, collect());
|
|
123
|
+
});
|
|
124
|
+
watch(collect, (next) => handle?.update(next), { deep: true, flush: "post" });
|
|
125
|
+
onBeforeUnmount(() => {
|
|
126
|
+
handle?.destroy();
|
|
127
|
+
handle = null;
|
|
128
|
+
});
|
|
129
|
+
expose({
|
|
130
|
+
get element() {
|
|
131
|
+
return host.value;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
return () => {
|
|
135
|
+
const tag = componentProps.as ?? defaultTag;
|
|
136
|
+
return h(tag, { ref: host, ...attrs }, slots.default?.());
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
return component;
|
|
141
|
+
}
|
|
142
|
+
function useBehaviour(target, definition, options) {
|
|
143
|
+
let handle = null;
|
|
144
|
+
const resolve = () => typeof options === "function" ? options() : options ?? {};
|
|
145
|
+
watch(
|
|
146
|
+
target,
|
|
147
|
+
(element) => {
|
|
148
|
+
handle?.destroy();
|
|
149
|
+
handle = null;
|
|
150
|
+
if (!element) return;
|
|
151
|
+
handle = mountBehaviour(definition, element, resolve());
|
|
152
|
+
},
|
|
153
|
+
{ immediate: true, flush: "post" }
|
|
154
|
+
);
|
|
155
|
+
watch(resolve, (next) => handle?.update(next), { deep: true, flush: "post" });
|
|
156
|
+
if (getCurrentScope()) {
|
|
157
|
+
onScopeDispose(() => {
|
|
158
|
+
handle?.destroy();
|
|
159
|
+
handle = null;
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function pascal2(value) {
|
|
164
|
+
return value.replace(/(^|-)([a-z])/g, (_, __, letter) => letter.toUpperCase());
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// src/components/index.ts
|
|
168
|
+
var components_exports = {};
|
|
169
|
+
__export(components_exports, {
|
|
170
|
+
AnimatedGradient: () => AnimatedGradient,
|
|
171
|
+
AuroraBackground: () => AuroraBackground,
|
|
172
|
+
Constellation: () => Constellation,
|
|
173
|
+
Fireflies: () => Fireflies,
|
|
174
|
+
LiquidBlob: () => LiquidBlob,
|
|
175
|
+
MagneticButton: () => MagneticButton,
|
|
176
|
+
Marquee: () => Marquee,
|
|
177
|
+
MeshGradient: () => MeshGradient,
|
|
178
|
+
MeteorShower: () => MeteorShower,
|
|
179
|
+
NoiseLayer: () => NoiseLayer,
|
|
180
|
+
Parallax: () => Parallax,
|
|
181
|
+
ParticleField: () => ParticleField,
|
|
182
|
+
Rain: () => Rain,
|
|
183
|
+
Ripple: () => Ripple,
|
|
184
|
+
ScrollReveal: () => ScrollReveal,
|
|
185
|
+
Snow: () => Snow,
|
|
186
|
+
Spotlight: () => Spotlight,
|
|
187
|
+
TiltCard: () => TiltCard,
|
|
188
|
+
Waves: () => Waves
|
|
189
|
+
});
|
|
190
|
+
var AuroraBackground = createEffectComponent(aurora, "AuroraBackground");
|
|
191
|
+
var MeshGradient = createEffectComponent(meshGradient, "MeshGradient");
|
|
192
|
+
var AnimatedGradient = createEffectComponent(animatedGradient, "AnimatedGradient");
|
|
193
|
+
var ParticleField = createEffectComponent(particleField, "ParticleField");
|
|
194
|
+
var Constellation = createEffectComponent(constellation, "Constellation");
|
|
195
|
+
var MeteorShower = createEffectComponent(meteors, "MeteorShower");
|
|
196
|
+
var Rain = createEffectComponent(rain, "Rain");
|
|
197
|
+
var Snow = createEffectComponent(snow, "Snow");
|
|
198
|
+
var Fireflies = createEffectComponent(fireflies, "Fireflies");
|
|
199
|
+
var Waves = createEffectComponent(waves, "Waves");
|
|
200
|
+
var LiquidBlob = createEffectComponent(blob, "LiquidBlob");
|
|
201
|
+
var NoiseLayer = createEffectComponent(noiseLayer, "NoiseLayer");
|
|
202
|
+
var Spotlight = createEffectComponent(spotlight, "Spotlight");
|
|
203
|
+
var MagneticButton = createBehaviourComponent(magnetic, "MagneticButton", "button");
|
|
204
|
+
var TiltCard = createBehaviourComponent(tilt, "TiltCard");
|
|
205
|
+
var Ripple = createBehaviourComponent(ripple, "Ripple");
|
|
206
|
+
var Marquee = createBehaviourComponent(marquee, "Marquee");
|
|
207
|
+
var ScrollReveal = createBehaviourComponent(scrollReveal, "ScrollReveal");
|
|
208
|
+
var Parallax = createBehaviourComponent(parallax, "Parallax");
|
|
209
|
+
var ICONS = {
|
|
210
|
+
info: () => h(
|
|
211
|
+
"svg",
|
|
212
|
+
{
|
|
213
|
+
viewBox: "0 0 20 20",
|
|
214
|
+
width: "18",
|
|
215
|
+
height: "18",
|
|
216
|
+
fill: "none",
|
|
217
|
+
stroke: "currentColor",
|
|
218
|
+
"stroke-width": "1.6"
|
|
219
|
+
},
|
|
220
|
+
[
|
|
221
|
+
h("circle", { cx: "10", cy: "10", r: "7.5" }),
|
|
222
|
+
h("path", { d: "M10 9v4.5", "stroke-linecap": "round" }),
|
|
223
|
+
h("circle", { cx: "10", cy: "6.5", r: "0.9", fill: "currentColor", stroke: "none" })
|
|
224
|
+
]
|
|
225
|
+
),
|
|
226
|
+
success: () => h(
|
|
227
|
+
"svg",
|
|
228
|
+
{
|
|
229
|
+
viewBox: "0 0 20 20",
|
|
230
|
+
width: "18",
|
|
231
|
+
height: "18",
|
|
232
|
+
fill: "none",
|
|
233
|
+
stroke: "currentColor",
|
|
234
|
+
"stroke-width": "1.6"
|
|
235
|
+
},
|
|
236
|
+
[
|
|
237
|
+
h("circle", { cx: "10", cy: "10", r: "7.5" }),
|
|
238
|
+
h("path", {
|
|
239
|
+
d: "M6.5 10.3l2.4 2.4 4.6-5.2",
|
|
240
|
+
"stroke-linecap": "round",
|
|
241
|
+
"stroke-linejoin": "round"
|
|
242
|
+
})
|
|
243
|
+
]
|
|
244
|
+
),
|
|
245
|
+
warning: () => h(
|
|
246
|
+
"svg",
|
|
247
|
+
{
|
|
248
|
+
viewBox: "0 0 20 20",
|
|
249
|
+
width: "18",
|
|
250
|
+
height: "18",
|
|
251
|
+
fill: "none",
|
|
252
|
+
stroke: "currentColor",
|
|
253
|
+
"stroke-width": "1.6"
|
|
254
|
+
},
|
|
255
|
+
[
|
|
256
|
+
h("path", {
|
|
257
|
+
d: "M8.6 3.2L1.9 14.6a1.6 1.6 0 001.4 2.4h13.4a1.6 1.6 0 001.4-2.4L11.4 3.2a1.6 1.6 0 00-2.8 0z",
|
|
258
|
+
"stroke-linejoin": "round"
|
|
259
|
+
}),
|
|
260
|
+
h("path", { d: "M10 7.5v3.5", "stroke-linecap": "round" }),
|
|
261
|
+
h("circle", { cx: "10", cy: "13.6", r: "0.9", fill: "currentColor", stroke: "none" })
|
|
262
|
+
]
|
|
263
|
+
),
|
|
264
|
+
danger: () => h(
|
|
265
|
+
"svg",
|
|
266
|
+
{
|
|
267
|
+
viewBox: "0 0 20 20",
|
|
268
|
+
width: "18",
|
|
269
|
+
height: "18",
|
|
270
|
+
fill: "none",
|
|
271
|
+
stroke: "currentColor",
|
|
272
|
+
"stroke-width": "1.6"
|
|
273
|
+
},
|
|
274
|
+
[
|
|
275
|
+
h("circle", { cx: "10", cy: "10", r: "7.5" }),
|
|
276
|
+
h("path", { d: "M7.5 7.5l5 5M12.5 7.5l-5 5", "stroke-linecap": "round" })
|
|
277
|
+
]
|
|
278
|
+
),
|
|
279
|
+
neutral: null
|
|
280
|
+
};
|
|
281
|
+
var Alert = defineComponent({
|
|
282
|
+
name: "AnshAlert",
|
|
283
|
+
inheritAttrs: false,
|
|
284
|
+
props: {
|
|
285
|
+
tone: { type: String, default: "info" },
|
|
286
|
+
title: { type: [String, Object, Function], default: void 0 },
|
|
287
|
+
/** Replace the default icon, or pass `null` to omit it. */
|
|
288
|
+
icon: { type: [String, Object, Function], default: void 0 },
|
|
289
|
+
/** Show a dismiss button. */
|
|
290
|
+
dismissible: { type: Boolean, default: false },
|
|
291
|
+
/** Buttons or links under the message. */
|
|
292
|
+
actions: { type: [String, Object, Function], default: void 0 },
|
|
293
|
+
variant: { type: String, default: "soft" }
|
|
294
|
+
},
|
|
295
|
+
emits: ["dismiss"],
|
|
296
|
+
setup(props, { attrs, emit, slots }) {
|
|
297
|
+
const visible = ref(true);
|
|
298
|
+
return () => {
|
|
299
|
+
if (!visible.value) return null;
|
|
300
|
+
const { class: attrClass, ...restAttrs } = attrs;
|
|
301
|
+
const urgent = props.tone === "danger" || props.tone === "warning";
|
|
302
|
+
const resolvedIcon = props.icon === void 0 ? ICONS[props.tone]?.() ?? null : props.icon === null ? null : resolveSlotContent(props.icon);
|
|
303
|
+
return h(
|
|
304
|
+
"div",
|
|
305
|
+
{
|
|
306
|
+
class: cx(
|
|
307
|
+
"ansh-alert",
|
|
308
|
+
`ansh-alert--${props.tone}`,
|
|
309
|
+
`ansh-alert--${props.variant}`,
|
|
310
|
+
attrClass
|
|
311
|
+
),
|
|
312
|
+
role: urgent ? "alert" : "status",
|
|
313
|
+
// Errors are assertive; everything else waits for a natural pause.
|
|
314
|
+
"aria-live": urgent ? "assertive" : "polite",
|
|
315
|
+
...restAttrs
|
|
316
|
+
},
|
|
317
|
+
[
|
|
318
|
+
resolvedIcon !== null ? h("span", { class: "ansh-alert__icon", "aria-hidden": "true" }, [resolvedIcon]) : null,
|
|
319
|
+
h("div", { class: "ansh-alert__body" }, [
|
|
320
|
+
props.title ? h("p", { class: "ansh-alert__title" }, [resolveSlotContent(props.title)]) : null,
|
|
321
|
+
slots.default ? h("div", { class: "ansh-alert__message" }, slots.default()) : null,
|
|
322
|
+
props.actions ? h("div", { class: "ansh-alert__actions" }, [resolveSlotContent(props.actions)]) : null
|
|
323
|
+
]),
|
|
324
|
+
props.dismissible ? h(
|
|
325
|
+
"button",
|
|
326
|
+
{
|
|
327
|
+
type: "button",
|
|
328
|
+
class: "ansh-alert__close ansh-focusable",
|
|
329
|
+
"aria-label": "Dismiss message",
|
|
330
|
+
onClick: () => {
|
|
331
|
+
visible.value = false;
|
|
332
|
+
emit("dismiss");
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
[
|
|
336
|
+
h(
|
|
337
|
+
"svg",
|
|
338
|
+
{ viewBox: "0 0 16 16", width: "12", height: "12", "aria-hidden": "true" },
|
|
339
|
+
[
|
|
340
|
+
h("path", {
|
|
341
|
+
d: "M4 4l8 8M12 4l-8 8",
|
|
342
|
+
stroke: "currentColor",
|
|
343
|
+
"stroke-width": "1.75",
|
|
344
|
+
"stroke-linecap": "round",
|
|
345
|
+
fill: "none"
|
|
346
|
+
})
|
|
347
|
+
]
|
|
348
|
+
)
|
|
349
|
+
]
|
|
350
|
+
) : null
|
|
351
|
+
]
|
|
352
|
+
);
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
var Banner = defineComponent({
|
|
357
|
+
name: "AnshBanner",
|
|
358
|
+
inheritAttrs: false,
|
|
359
|
+
props: {
|
|
360
|
+
tone: { type: String, default: "info" },
|
|
361
|
+
title: { type: [String, Object, Function], default: void 0 },
|
|
362
|
+
icon: { type: [String, Object, Function], default: void 0 },
|
|
363
|
+
dismissible: { type: Boolean, default: false },
|
|
364
|
+
actions: { type: [String, Object, Function], default: void 0 },
|
|
365
|
+
/** Pin to the top of the viewport. */
|
|
366
|
+
sticky: { type: Boolean, default: false }
|
|
367
|
+
},
|
|
368
|
+
emits: ["dismiss"],
|
|
369
|
+
setup(props, { attrs, emit, slots }) {
|
|
370
|
+
return () => {
|
|
371
|
+
const { class: attrClass, ...restAttrs } = attrs;
|
|
372
|
+
return h(
|
|
373
|
+
Alert,
|
|
374
|
+
{
|
|
375
|
+
tone: props.tone,
|
|
376
|
+
title: props.title,
|
|
377
|
+
icon: props.icon,
|
|
378
|
+
dismissible: props.dismissible,
|
|
379
|
+
actions: props.actions,
|
|
380
|
+
variant: "solid",
|
|
381
|
+
class: cx("ansh-banner", props.sticky && "ansh-banner--sticky", attrClass),
|
|
382
|
+
onDismiss: () => emit("dismiss"),
|
|
383
|
+
...restAttrs
|
|
384
|
+
},
|
|
385
|
+
slots
|
|
386
|
+
);
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
var Callout = defineComponent({
|
|
391
|
+
name: "AnshCallout",
|
|
392
|
+
inheritAttrs: false,
|
|
393
|
+
props: {
|
|
394
|
+
/** Short label — "Note", "Tip", "Warning". */
|
|
395
|
+
label: { type: String, default: void 0 },
|
|
396
|
+
tone: { type: String, default: "info" },
|
|
397
|
+
icon: { type: [String, Object, Function], default: void 0 }
|
|
398
|
+
},
|
|
399
|
+
setup(props, { attrs, slots }) {
|
|
400
|
+
return () => {
|
|
401
|
+
const { class: attrClass, ...restAttrs } = attrs;
|
|
402
|
+
const resolvedIcon = props.icon !== void 0 ? resolveSlotContent(props.icon) : ICONS[props.tone]?.() ?? null;
|
|
403
|
+
return h(
|
|
404
|
+
"aside",
|
|
405
|
+
{
|
|
406
|
+
class: cx("ansh-callout", `ansh-callout--${props.tone}`, attrClass),
|
|
407
|
+
...restAttrs
|
|
408
|
+
},
|
|
409
|
+
[
|
|
410
|
+
h("span", { class: "ansh-callout__icon", "aria-hidden": "true" }, [resolvedIcon]),
|
|
411
|
+
h("div", { class: "ansh-callout__body" }, [
|
|
412
|
+
props.label ? h("p", { class: "ansh-callout__label" }, props.label) : null,
|
|
413
|
+
h("div", { class: "ansh-callout__content" }, slots.default?.())
|
|
414
|
+
])
|
|
415
|
+
]
|
|
416
|
+
);
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
var applicationComponents = {
|
|
421
|
+
MotionConfig,
|
|
422
|
+
ThemeProvider,
|
|
423
|
+
Field,
|
|
424
|
+
Fieldset,
|
|
425
|
+
VisuallyHidden,
|
|
426
|
+
Input,
|
|
427
|
+
NumberInput,
|
|
428
|
+
Textarea,
|
|
429
|
+
Checkbox,
|
|
430
|
+
ChoiceCard,
|
|
431
|
+
Radio,
|
|
432
|
+
RadioGroup,
|
|
433
|
+
Switch,
|
|
434
|
+
OptionList,
|
|
435
|
+
Select,
|
|
436
|
+
Combobox,
|
|
437
|
+
RangeSlider,
|
|
438
|
+
Slider,
|
|
439
|
+
PinInput,
|
|
440
|
+
TagsInput,
|
|
441
|
+
Rating,
|
|
442
|
+
Dropzone,
|
|
443
|
+
ColorPicker,
|
|
444
|
+
Calendar,
|
|
445
|
+
DatePicker,
|
|
446
|
+
DateRangePicker,
|
|
447
|
+
AlertDialog,
|
|
448
|
+
Dialog,
|
|
449
|
+
DialogFooter,
|
|
450
|
+
HoverCard,
|
|
451
|
+
Popover,
|
|
452
|
+
PopoverContent,
|
|
453
|
+
PopoverTrigger,
|
|
454
|
+
Tooltip,
|
|
455
|
+
TooltipProvider,
|
|
456
|
+
Drawer,
|
|
457
|
+
ContextMenu,
|
|
458
|
+
DropdownMenu,
|
|
459
|
+
DataTable,
|
|
460
|
+
Pagination,
|
|
461
|
+
Table,
|
|
462
|
+
Avatar,
|
|
463
|
+
AvatarGroup,
|
|
464
|
+
Badge,
|
|
465
|
+
CodeBlock,
|
|
466
|
+
DescriptionList,
|
|
467
|
+
EmptyState,
|
|
468
|
+
Kbd,
|
|
469
|
+
Stat,
|
|
470
|
+
Timeline,
|
|
471
|
+
CircularProgress,
|
|
472
|
+
Meter,
|
|
473
|
+
Progress,
|
|
474
|
+
Breadcrumbs,
|
|
475
|
+
Stepper,
|
|
476
|
+
Sidebar,
|
|
477
|
+
AppShell,
|
|
478
|
+
NavigationMenu,
|
|
479
|
+
Tabs,
|
|
480
|
+
Alert,
|
|
481
|
+
Banner,
|
|
482
|
+
Callout,
|
|
483
|
+
Accordion,
|
|
484
|
+
Collapsible,
|
|
485
|
+
DisclosureList,
|
|
486
|
+
AspectRatio,
|
|
487
|
+
Center,
|
|
488
|
+
Container,
|
|
489
|
+
Divider,
|
|
490
|
+
Grid,
|
|
491
|
+
GridItem,
|
|
492
|
+
HStack,
|
|
493
|
+
ScrollArea,
|
|
494
|
+
Spacer,
|
|
495
|
+
Stack,
|
|
496
|
+
VStack,
|
|
497
|
+
Resizable,
|
|
498
|
+
AnimatePresence,
|
|
499
|
+
Draggable,
|
|
500
|
+
Motion
|
|
501
|
+
};
|
|
502
|
+
var AnshPlugin = {
|
|
503
|
+
install(app, options = {}) {
|
|
504
|
+
const {
|
|
505
|
+
prefix = "Ansh",
|
|
506
|
+
registerComponents = true,
|
|
507
|
+
reducedMotion,
|
|
508
|
+
timeScale,
|
|
509
|
+
quality,
|
|
510
|
+
pauseWhenHidden = true,
|
|
511
|
+
pauseWhenBlurred = false,
|
|
512
|
+
respectBattery = true
|
|
513
|
+
} = options;
|
|
514
|
+
if (registerComponents) {
|
|
515
|
+
const all = {
|
|
516
|
+
...components_exports,
|
|
517
|
+
GradientText,
|
|
518
|
+
AnimatedText,
|
|
519
|
+
...applicationComponents
|
|
520
|
+
};
|
|
521
|
+
for (const [name, component] of Object.entries(all)) {
|
|
522
|
+
app.component(`${prefix}${name}`, component);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if (reducedMotion) setReducedMotionMode(reducedMotion);
|
|
526
|
+
const ticker = getTicker();
|
|
527
|
+
if (timeScale !== void 0) ticker.timeScale = timeScale;
|
|
528
|
+
if (quality !== void 0) ticker.lockQuality(quality);
|
|
529
|
+
if (typeof document !== "undefined") {
|
|
530
|
+
const detach = attachLifecycle(ticker, {
|
|
531
|
+
pauseWhenHidden,
|
|
532
|
+
pauseWhenBlurred,
|
|
533
|
+
respectBattery
|
|
534
|
+
});
|
|
535
|
+
const originalUnmount = app.unmount.bind(app);
|
|
536
|
+
app.unmount = () => {
|
|
537
|
+
detach();
|
|
538
|
+
originalUnmount();
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
};
|
|
543
|
+
var VERSION = "0.1.0";
|
|
544
|
+
|
|
545
|
+
export { Alert, AnimatedGradient, AnshPlugin, AuroraBackground, Banner, Callout, Constellation, Fireflies, LiquidBlob, MagneticButton, Marquee, MeshGradient, MeteorShower, NoiseLayer, Parallax, ParticleField, Rain, Ripple, ScrollReveal, Snow, Spotlight, TiltCard, VERSION, Waves, createBehaviourComponent, createEffectComponent, useBehaviour };
|
|
546
|
+
//# sourceMappingURL=index.js.map
|
|
547
|
+
//# sourceMappingURL=index.js.map
|