@layers.digital/layers-design-system-vue3 1.3.0 → 1.3.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.
@@ -1,4 +1,4 @@
1
- "use strict";const u=require("vue"),d=require("./chunk-1481.cjs"),e=require("./chunk-1482.cjs");/**
1
+ "use strict";const u=require("vue"),d=require("./chunk-1478.cjs"),e=require("./chunk-1479.cjs");/**
2
2
  * @license lucide-vue-next v0.395.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,6 +1,6 @@
1
1
  import { h as a } from "vue";
2
- import { toKebabCase as l } from "./chunk-1481.js";
3
- import t from "./chunk-1482.js";
2
+ import { toKebabCase as l } from "./chunk-1478.js";
3
+ import t from "./chunk-1479.js";
4
4
  /**
5
5
  * @license lucide-vue-next v0.395.0 - ISC
6
6
  *
@@ -1,3 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue");function g(n,e){const o=typeof n=="string"&&!e?`${n}Context`:e,r=Symbol(o);return[a=>{const l=t.inject(r,a);if(l||l===null)return l;throw new Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(n)?`one of the following components: ${n.join(", ")}`:`\`${n}\``}`)},a=>(t.provide(r,a),a)]}function I(n){let e=!1,o;const r=t.effectScope(!0);return(...a)=>(e||(o=r.run(()=>n(...a)),e=!0),o)}function O(n){return typeof n=="function"?n():t.unref(n)}const T=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function S(n){var e;const o=O(n);return(e=o?.$el)!=null?e:o}function E(n){return n?n.flatMap(e=>e.type===t.Fragment?E(e.children):[e]):[]}function b(n,e){const o=t.ref(n);function r(a){return e[o.value][a]??o.value}return{state:o,dispatch:a=>{o.value=r(a)}}}const N=t.defineComponent({name:"PrimitiveSlot",inheritAttrs:!1,setup(n,{attrs:e,slots:o}){return()=>{var r,a;if(!o.default)return null;const l=E(o.default()),u=l.findIndex(m=>m.type!==t.Comment);if(u===-1)return l;const i=l[u];(r=i.props)==null||delete r.ref;const c=i.props?t.mergeProps(e,i.props):e;e.class&&(a=i.props)!=null&&a.class&&delete i.props.class;const d=t.cloneVNode(i,c);for(const m in c)m.startsWith("on")&&(d.props||(d.props={}),d.props[m]=c[m]);return l.length===1?d:(l[u]=d,l)}}}),P=t.defineComponent({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(n,{attrs:e,slots:o}){const r=n.asChild?"template":n.as;return typeof r=="string"&&["area","img","input"].includes(r)?()=>t.h(r,e):r!=="template"?()=>t.h(n.as,e,{default:o.default}):()=>t.h(N,e,{default:o.default})}});function M(){const n=t.ref(),e=t.computed(()=>{var o,r;return["#text","#comment"].includes((o=n.value)==null?void 0:o.$el.nodeName)?(r=n.value)==null?void 0:r.$el.nextElementSibling:S(n)});return{primitiveElement:n,currentElement:e}}function x(n,e){const o=t.ref({}),r=t.ref("none"),a=n.value?"mounted":"unmounted",{state:l,dispatch:u}=b(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),i=s=>{var p;if(T){const v=new CustomEvent(s,{bubbles:!1,cancelable:!1});(p=e.value)==null||p.dispatchEvent(v)}};t.watch(n,async(s,p)=>{var v;const y=p!==s;if(await t.nextTick(),y){const A=r.value,w=h(e.value);s?(u("MOUNT"),i("enter"),w==="none"&&i("after-enter")):w==="none"||((v=o.value)==null?void 0:v.display)==="none"?(u("UNMOUNT"),i("leave"),i("after-leave")):p&&A!==w?(u("ANIMATION_OUT"),i("leave")):(u("UNMOUNT"),i("after-leave"))}},{immediate:!0});const c=s=>{const p=h(e.value),v=p.includes(s.animationName),y=l.value==="mounted"?"enter":"leave";s.target===e.value&&v&&(i(`after-${y}`),u("ANIMATION_END")),s.target===e.value&&p==="none"&&u("ANIMATION_END")},d=s=>{s.target===e.value&&(r.value=h(e.value))},m=t.watch(e,(s,p)=>{s?(o.value=getComputedStyle(s),s.addEventListener("animationstart",d),s.addEventListener("animationcancel",c),s.addEventListener("animationend",c)):(u("ANIMATION_END"),p?.removeEventListener("animationstart",d),p?.removeEventListener("animationcancel",c),p?.removeEventListener("animationend",c))},{immediate:!0}),f=t.watch(l,()=>{const s=h(e.value);r.value=l.value==="mounted"?s:"none"});return t.onUnmounted(()=>{m(),f()}),{isPresent:t.computed(()=>["mounted","unmountSuspended"].includes(l.value))}}function h(n){return n&&getComputedStyle(n).animationName||"none"}t.defineComponent({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(n,{slots:e,expose:o}){var r;const{present:a,forceMount:l}=t.toRefs(n),u=t.ref(),{isPresent:i}=x(a,u);o({present:i});let c=e.default({present:i});c=E(c||[]);const d=t.getCurrentInstance();if(c&&c?.length>1){const m=(r=d?.parent)!=null&&r.type.name?`<${d.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${m}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(f=>` - ${f}`).join(`
2
- `)].join(`
3
- `))}return()=>l.value||a.value||i.value?t.h(e.default({present:i})[0],{ref:m=>{const f=S(m);return typeof f?.hasAttribute>"u"||(f!=null&&f.hasAttribute("data-radix-popper-content-wrapper")?u.value=f.firstElementChild:u.value=f),f}}):null}});t.reactive({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set});I(()=>t.ref([]));const[C,$]=g("CollectionProvider");t.defineComponent({name:"CollectionSlot",setup(n,{slots:e}){const o=C(),{primitiveElement:r,currentElement:a}=M();return t.watch(a,()=>{o.collectionRef.value=a.value}),()=>t.h(N,{ref:r},e)}});t.defineComponent({name:"CollectionItem",setup(n,{slots:e,attrs:o}){const r=C(),{primitiveElement:a,currentElement:l}=M(),u=t.getCurrentInstance();return t.watchEffect(i=>{var c;if(l.value){const d=t.markRaw(l.value);r.itemMap.value.set(d,{ref:l.value,...t.markRaw(((c=u?.parent)==null?void 0:c.props)??{})}),i(()=>r.itemMap.value.delete(d))}}),()=>t.h(N,{...o,[r.attrName]:"",ref:a},e)}});function U(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}U();exports.Primitive=P;exports.Slot=N;exports.createContext=g;exports.useStateMachine=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/**
2
+ * @license lucide-vue-next v0.395.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const t=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();exports.toKebabCase=t;
@@ -1,237 +1,10 @@
1
- import { defineComponent as N, Comment as P, mergeProps as U, cloneVNode as $, h as v, toRefs as j, ref as h, getCurrentInstance as A, reactive as D, watch as E, watchEffect as L, markRaw as b, effectScope as _, Fragment as k, computed as I, nextTick as R, onUnmounted as B, inject as W, provide as F, unref as G } from "vue";
2
- function V(t, e) {
3
- const n = typeof t == "string" && !e ? `${t}Context` : e, o = Symbol(n);
4
- return [(r) => {
5
- const a = W(o, r);
6
- if (a || a === null)
7
- return a;
8
- throw new Error(
9
- `Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(t) ? `one of the following components: ${t.join(
10
- ", "
11
- )}` : `\`${t}\``}`
12
- );
13
- }, (r) => (F(o, r), r)];
14
- }
15
- function q(t) {
16
- let e = !1, n;
17
- const o = _(!0);
18
- return (...r) => (e || (n = o.run(() => t(...r)), e = !0), n);
19
- }
20
- function z(t) {
21
- return typeof t == "function" ? t() : G(t);
22
- }
23
- const J = typeof window < "u" && typeof document < "u";
24
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
25
- function O(t) {
26
- var e;
27
- const n = z(t);
28
- return (e = n?.$el) != null ? e : n;
29
- }
30
- function g(t) {
31
- return t ? t.flatMap((e) => e.type === k ? g(e.children) : [e]) : [];
32
- }
33
- function K(t, e) {
34
- const n = h(t);
35
- function o(r) {
36
- return e[n.value][r] ?? n.value;
37
- }
38
- return {
39
- state: n,
40
- dispatch: (r) => {
41
- n.value = o(r);
42
- }
43
- };
44
- }
45
- const M = N({
46
- name: "PrimitiveSlot",
47
- inheritAttrs: !1,
48
- setup(t, { attrs: e, slots: n }) {
49
- return () => {
50
- var o, r;
51
- if (!n.default)
52
- return null;
53
- const a = g(n.default()), i = a.findIndex((p) => p.type !== P);
54
- if (i === -1)
55
- return a;
56
- const l = a[i];
57
- (o = l.props) == null || delete o.ref;
58
- const s = l.props ? U(e, l.props) : e;
59
- e.class && (r = l.props) != null && r.class && delete l.props.class;
60
- const c = $(l, s);
61
- for (const p in s)
62
- p.startsWith("on") && (c.props || (c.props = {}), c.props[p] = s[p]);
63
- return a.length === 1 ? c : (a[i] = c, a);
64
- };
65
- }
66
- }), X = N({
67
- name: "Primitive",
68
- inheritAttrs: !1,
69
- props: {
70
- asChild: {
71
- type: Boolean,
72
- default: !1
73
- },
74
- as: {
75
- type: [String, Object],
76
- default: "div"
77
- }
78
- },
79
- setup(t, { attrs: e, slots: n }) {
80
- const o = t.asChild ? "template" : t.as;
81
- return typeof o == "string" && ["area", "img", "input"].includes(o) ? () => v(o, e) : o !== "template" ? () => v(t.as, e, { default: n.default }) : () => v(M, e, { default: n.default });
82
- }
83
- });
84
- function T() {
85
- const t = h(), e = I(() => {
86
- var n, o;
87
- return ["#text", "#comment"].includes((n = t.value) == null ? void 0 : n.$el.nodeName) ? (o = t.value) == null ? void 0 : o.$el.nextElementSibling : O(t);
88
- });
89
- return {
90
- primitiveElement: t,
91
- currentElement: e
92
- };
93
- }
94
- function Q(t, e) {
95
- const n = h({}), o = h("none"), r = t.value ? "mounted" : "unmounted", { state: a, dispatch: i } = K(r, {
96
- mounted: {
97
- UNMOUNT: "unmounted",
98
- ANIMATION_OUT: "unmountSuspended"
99
- },
100
- unmountSuspended: {
101
- MOUNT: "mounted",
102
- ANIMATION_END: "unmounted"
103
- },
104
- unmounted: {
105
- MOUNT: "mounted"
106
- }
107
- }), l = (u) => {
108
- var d;
109
- if (J) {
110
- const f = new CustomEvent(u, { bubbles: !1, cancelable: !1 });
111
- (d = e.value) == null || d.dispatchEvent(f);
112
- }
113
- };
114
- E(
115
- t,
116
- async (u, d) => {
117
- var f;
118
- const w = d !== u;
119
- if (await R(), w) {
120
- const x = o.value, S = y(e.value);
121
- u ? (i("MOUNT"), l("enter"), S === "none" && l("after-enter")) : S === "none" || ((f = n.value) == null ? void 0 : f.display) === "none" ? (i("UNMOUNT"), l("leave"), l("after-leave")) : d && x !== S ? (i("ANIMATION_OUT"), l("leave")) : (i("UNMOUNT"), l("after-leave"));
122
- }
123
- },
124
- { immediate: !0 }
125
- );
126
- const s = (u) => {
127
- const d = y(e.value), f = d.includes(
128
- u.animationName
129
- ), w = a.value === "mounted" ? "enter" : "leave";
130
- u.target === e.value && f && (l(`after-${w}`), i("ANIMATION_END")), u.target === e.value && d === "none" && i("ANIMATION_END");
131
- }, c = (u) => {
132
- u.target === e.value && (o.value = y(e.value));
133
- }, p = E(
134
- e,
135
- (u, d) => {
136
- u ? (n.value = getComputedStyle(u), u.addEventListener("animationstart", c), u.addEventListener("animationcancel", s), u.addEventListener("animationend", s)) : (i("ANIMATION_END"), d?.removeEventListener("animationstart", c), d?.removeEventListener("animationcancel", s), d?.removeEventListener("animationend", s));
137
- },
138
- { immediate: !0 }
139
- ), m = E(a, () => {
140
- const u = y(e.value);
141
- o.value = a.value === "mounted" ? u : "none";
142
- });
143
- return B(() => {
144
- p(), m();
145
- }), {
146
- isPresent: I(
147
- () => ["mounted", "unmountSuspended"].includes(a.value)
148
- )
149
- };
150
- }
151
- function y(t) {
152
- return t && getComputedStyle(t).animationName || "none";
153
- }
154
- N({
155
- name: "Presence",
156
- props: {
157
- present: {
158
- type: Boolean,
159
- required: !0
160
- },
161
- forceMount: {
162
- type: Boolean
163
- }
164
- },
165
- slots: {},
166
- setup(t, { slots: e, expose: n }) {
167
- var o;
168
- const { present: r, forceMount: a } = j(t), i = h(), { isPresent: l } = Q(r, i);
169
- n({ present: l });
170
- let s = e.default({ present: l });
171
- s = g(s || []);
172
- const c = A();
173
- if (s && s?.length > 1) {
174
- const p = (o = c?.parent) != null && o.type.name ? `<${c.parent.type.name} />` : "component";
175
- throw new Error(
176
- [
177
- `Detected an invalid children for \`${p}\` for \`Presence\` component.`,
178
- "",
179
- "Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",
180
- "You can apply a few solutions:",
181
- [
182
- "Provide a single child element so that `presence` directive attach correctly.",
183
- "Ensure the first child is an actual element instead of a raw text node or comment node."
184
- ].map((m) => ` - ${m}`).join(`
185
- `)
186
- ].join(`
187
- `)
188
- );
189
- }
190
- return () => a.value || r.value || l.value ? v(e.default({ present: l })[0], {
191
- ref: (p) => {
192
- const m = O(p);
193
- return typeof m?.hasAttribute > "u" || (m != null && m.hasAttribute("data-radix-popper-content-wrapper") ? i.value = m.firstElementChild : i.value = m), m;
194
- }
195
- }) : null;
196
- }
197
- });
198
- D({
199
- layersRoot: /* @__PURE__ */ new Set(),
200
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
201
- branches: /* @__PURE__ */ new Set()
202
- });
203
- q(() => h([]));
204
- const [C, Z] = V("CollectionProvider");
205
- N({
206
- name: "CollectionSlot",
207
- setup(t, { slots: e }) {
208
- const n = C(), { primitiveElement: o, currentElement: r } = T();
209
- return E(r, () => {
210
- n.collectionRef.value = r.value;
211
- }), () => v(M, { ref: o }, e);
212
- }
213
- });
214
- N({
215
- name: "CollectionItem",
216
- setup(t, { slots: e, attrs: n }) {
217
- const o = C(), { primitiveElement: r, currentElement: a } = T(), i = A();
218
- return L((l) => {
219
- var s;
220
- if (a.value) {
221
- const c = b(a.value);
222
- o.itemMap.value.set(c, { ref: a.value, ...b(((s = i?.parent) == null ? void 0 : s.props) ?? {}) }), l(() => o.itemMap.value.delete(c));
223
- }
224
- }), () => v(M, { ...n, [o.attrName]: "", ref: r }, e);
225
- }
226
- });
227
- function Y() {
228
- if (typeof matchMedia == "function")
229
- return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
230
- }
231
- Y();
1
+ /**
2
+ * @license lucide-vue-next v0.395.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */
7
+ const a = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
232
8
  export {
233
- X as Primitive,
234
- M as Slot,
235
- V as createContext,
236
- K as useStateMachine
9
+ a as toKebabCase
237
10
  };
@@ -1 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunk-1483.cjs"),r=e.cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-bold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}});exports.buttonVariants=r;
1
+ "use strict";/**
2
+ * @license lucide-vue-next v0.395.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */var t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};module.exports=t;
@@ -1,30 +1,20 @@
1
- import { cva as e } from "./chunk-1483.js";
2
- const t = e(
3
- "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-bold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
4
- {
5
- variants: {
6
- variant: {
7
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
8
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
9
- outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
10
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
11
- ghost: "hover:bg-accent hover:text-accent-foreground",
12
- link: "text-primary underline-offset-4 hover:underline"
13
- },
14
- size: {
15
- default: "h-10 px-4 py-2",
16
- xs: "h-7 rounded px-2",
17
- sm: "h-9 rounded-md px-3",
18
- lg: "h-11 rounded-md px-8",
19
- icon: "h-10 w-10"
20
- }
21
- },
22
- defaultVariants: {
23
- variant: "default",
24
- size: "default"
25
- }
26
- }
27
- );
1
+ /**
2
+ * @license lucide-vue-next v0.395.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */
7
+ var t = {
8
+ xmlns: "http://www.w3.org/2000/svg",
9
+ width: 24,
10
+ height: 24,
11
+ viewBox: "0 0 24 24",
12
+ fill: "none",
13
+ stroke: "currentColor",
14
+ "stroke-width": 2,
15
+ "stroke-linecap": "round",
16
+ "stroke-linejoin": "round"
17
+ };
28
18
  export {
29
- t as buttonVariants
19
+ t as default
30
20
  };
@@ -1 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./chunk-1484.cjs"),t=require("./chunk-1485.cjs");function n(...e){return t.twMerge(r.clsx(e))}exports.cn=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue");function g(n,e){const o=typeof n=="string"&&!e?`${n}Context`:e,r=Symbol(o);return[a=>{const l=t.inject(r,a);if(l||l===null)return l;throw new Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(n)?`one of the following components: ${n.join(", ")}`:`\`${n}\``}`)},a=>(t.provide(r,a),a)]}function I(n){let e=!1,o;const r=t.effectScope(!0);return(...a)=>(e||(o=r.run(()=>n(...a)),e=!0),o)}function O(n){return typeof n=="function"?n():t.unref(n)}const T=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function S(n){var e;const o=O(n);return(e=o?.$el)!=null?e:o}function E(n){return n?n.flatMap(e=>e.type===t.Fragment?E(e.children):[e]):[]}function b(n,e){const o=t.ref(n);function r(a){return e[o.value][a]??o.value}return{state:o,dispatch:a=>{o.value=r(a)}}}const N=t.defineComponent({name:"PrimitiveSlot",inheritAttrs:!1,setup(n,{attrs:e,slots:o}){return()=>{var r,a;if(!o.default)return null;const l=E(o.default()),u=l.findIndex(m=>m.type!==t.Comment);if(u===-1)return l;const i=l[u];(r=i.props)==null||delete r.ref;const c=i.props?t.mergeProps(e,i.props):e;e.class&&(a=i.props)!=null&&a.class&&delete i.props.class;const d=t.cloneVNode(i,c);for(const m in c)m.startsWith("on")&&(d.props||(d.props={}),d.props[m]=c[m]);return l.length===1?d:(l[u]=d,l)}}}),P=t.defineComponent({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(n,{attrs:e,slots:o}){const r=n.asChild?"template":n.as;return typeof r=="string"&&["area","img","input"].includes(r)?()=>t.h(r,e):r!=="template"?()=>t.h(n.as,e,{default:o.default}):()=>t.h(N,e,{default:o.default})}});function M(){const n=t.ref(),e=t.computed(()=>{var o,r;return["#text","#comment"].includes((o=n.value)==null?void 0:o.$el.nodeName)?(r=n.value)==null?void 0:r.$el.nextElementSibling:S(n)});return{primitiveElement:n,currentElement:e}}function x(n,e){const o=t.ref({}),r=t.ref("none"),a=n.value?"mounted":"unmounted",{state:l,dispatch:u}=b(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),i=s=>{var p;if(T){const v=new CustomEvent(s,{bubbles:!1,cancelable:!1});(p=e.value)==null||p.dispatchEvent(v)}};t.watch(n,async(s,p)=>{var v;const y=p!==s;if(await t.nextTick(),y){const A=r.value,w=h(e.value);s?(u("MOUNT"),i("enter"),w==="none"&&i("after-enter")):w==="none"||((v=o.value)==null?void 0:v.display)==="none"?(u("UNMOUNT"),i("leave"),i("after-leave")):p&&A!==w?(u("ANIMATION_OUT"),i("leave")):(u("UNMOUNT"),i("after-leave"))}},{immediate:!0});const c=s=>{const p=h(e.value),v=p.includes(s.animationName),y=l.value==="mounted"?"enter":"leave";s.target===e.value&&v&&(i(`after-${y}`),u("ANIMATION_END")),s.target===e.value&&p==="none"&&u("ANIMATION_END")},d=s=>{s.target===e.value&&(r.value=h(e.value))},m=t.watch(e,(s,p)=>{s?(o.value=getComputedStyle(s),s.addEventListener("animationstart",d),s.addEventListener("animationcancel",c),s.addEventListener("animationend",c)):(u("ANIMATION_END"),p?.removeEventListener("animationstart",d),p?.removeEventListener("animationcancel",c),p?.removeEventListener("animationend",c))},{immediate:!0}),f=t.watch(l,()=>{const s=h(e.value);r.value=l.value==="mounted"?s:"none"});return t.onUnmounted(()=>{m(),f()}),{isPresent:t.computed(()=>["mounted","unmountSuspended"].includes(l.value))}}function h(n){return n&&getComputedStyle(n).animationName||"none"}t.defineComponent({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(n,{slots:e,expose:o}){var r;const{present:a,forceMount:l}=t.toRefs(n),u=t.ref(),{isPresent:i}=x(a,u);o({present:i});let c=e.default({present:i});c=E(c||[]);const d=t.getCurrentInstance();if(c&&c?.length>1){const m=(r=d?.parent)!=null&&r.type.name?`<${d.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${m}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(f=>` - ${f}`).join(`
2
+ `)].join(`
3
+ `))}return()=>l.value||a.value||i.value?t.h(e.default({present:i})[0],{ref:m=>{const f=S(m);return typeof f?.hasAttribute>"u"||(f!=null&&f.hasAttribute("data-radix-popper-content-wrapper")?u.value=f.firstElementChild:u.value=f),f}}):null}});t.reactive({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set});I(()=>t.ref([]));const[C,$]=g("CollectionProvider");t.defineComponent({name:"CollectionSlot",setup(n,{slots:e}){const o=C(),{primitiveElement:r,currentElement:a}=M();return t.watch(a,()=>{o.collectionRef.value=a.value}),()=>t.h(N,{ref:r},e)}});t.defineComponent({name:"CollectionItem",setup(n,{slots:e,attrs:o}){const r=C(),{primitiveElement:a,currentElement:l}=M(),u=t.getCurrentInstance();return t.watchEffect(i=>{var c;if(l.value){const d=t.markRaw(l.value);r.itemMap.value.set(d,{ref:l.value,...t.markRaw(((c=u?.parent)==null?void 0:c.props)??{})}),i(()=>r.itemMap.value.delete(d))}}),()=>t.h(N,{...o,[r.attrName]:"",ref:a},e)}});function U(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}U();exports.Primitive=P;exports.Slot=N;exports.createContext=g;exports.useStateMachine=b;
@@ -1,8 +1,237 @@
1
- import { clsx as o } from "./chunk-1484.js";
2
- import { twMerge as t } from "./chunk-1485.js";
3
- function n(...r) {
4
- return t(o(r));
1
+ import { defineComponent as N, Comment as P, mergeProps as U, cloneVNode as $, h as v, toRefs as j, ref as h, getCurrentInstance as A, reactive as D, watch as E, watchEffect as L, markRaw as b, effectScope as _, Fragment as k, computed as I, nextTick as R, onUnmounted as B, inject as W, provide as F, unref as G } from "vue";
2
+ function V(t, e) {
3
+ const n = typeof t == "string" && !e ? `${t}Context` : e, o = Symbol(n);
4
+ return [(r) => {
5
+ const a = W(o, r);
6
+ if (a || a === null)
7
+ return a;
8
+ throw new Error(
9
+ `Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(t) ? `one of the following components: ${t.join(
10
+ ", "
11
+ )}` : `\`${t}\``}`
12
+ );
13
+ }, (r) => (F(o, r), r)];
5
14
  }
15
+ function q(t) {
16
+ let e = !1, n;
17
+ const o = _(!0);
18
+ return (...r) => (e || (n = o.run(() => t(...r)), e = !0), n);
19
+ }
20
+ function z(t) {
21
+ return typeof t == "function" ? t() : G(t);
22
+ }
23
+ const J = typeof window < "u" && typeof document < "u";
24
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
25
+ function O(t) {
26
+ var e;
27
+ const n = z(t);
28
+ return (e = n?.$el) != null ? e : n;
29
+ }
30
+ function g(t) {
31
+ return t ? t.flatMap((e) => e.type === k ? g(e.children) : [e]) : [];
32
+ }
33
+ function K(t, e) {
34
+ const n = h(t);
35
+ function o(r) {
36
+ return e[n.value][r] ?? n.value;
37
+ }
38
+ return {
39
+ state: n,
40
+ dispatch: (r) => {
41
+ n.value = o(r);
42
+ }
43
+ };
44
+ }
45
+ const M = N({
46
+ name: "PrimitiveSlot",
47
+ inheritAttrs: !1,
48
+ setup(t, { attrs: e, slots: n }) {
49
+ return () => {
50
+ var o, r;
51
+ if (!n.default)
52
+ return null;
53
+ const a = g(n.default()), i = a.findIndex((p) => p.type !== P);
54
+ if (i === -1)
55
+ return a;
56
+ const l = a[i];
57
+ (o = l.props) == null || delete o.ref;
58
+ const s = l.props ? U(e, l.props) : e;
59
+ e.class && (r = l.props) != null && r.class && delete l.props.class;
60
+ const c = $(l, s);
61
+ for (const p in s)
62
+ p.startsWith("on") && (c.props || (c.props = {}), c.props[p] = s[p]);
63
+ return a.length === 1 ? c : (a[i] = c, a);
64
+ };
65
+ }
66
+ }), X = N({
67
+ name: "Primitive",
68
+ inheritAttrs: !1,
69
+ props: {
70
+ asChild: {
71
+ type: Boolean,
72
+ default: !1
73
+ },
74
+ as: {
75
+ type: [String, Object],
76
+ default: "div"
77
+ }
78
+ },
79
+ setup(t, { attrs: e, slots: n }) {
80
+ const o = t.asChild ? "template" : t.as;
81
+ return typeof o == "string" && ["area", "img", "input"].includes(o) ? () => v(o, e) : o !== "template" ? () => v(t.as, e, { default: n.default }) : () => v(M, e, { default: n.default });
82
+ }
83
+ });
84
+ function T() {
85
+ const t = h(), e = I(() => {
86
+ var n, o;
87
+ return ["#text", "#comment"].includes((n = t.value) == null ? void 0 : n.$el.nodeName) ? (o = t.value) == null ? void 0 : o.$el.nextElementSibling : O(t);
88
+ });
89
+ return {
90
+ primitiveElement: t,
91
+ currentElement: e
92
+ };
93
+ }
94
+ function Q(t, e) {
95
+ const n = h({}), o = h("none"), r = t.value ? "mounted" : "unmounted", { state: a, dispatch: i } = K(r, {
96
+ mounted: {
97
+ UNMOUNT: "unmounted",
98
+ ANIMATION_OUT: "unmountSuspended"
99
+ },
100
+ unmountSuspended: {
101
+ MOUNT: "mounted",
102
+ ANIMATION_END: "unmounted"
103
+ },
104
+ unmounted: {
105
+ MOUNT: "mounted"
106
+ }
107
+ }), l = (u) => {
108
+ var d;
109
+ if (J) {
110
+ const f = new CustomEvent(u, { bubbles: !1, cancelable: !1 });
111
+ (d = e.value) == null || d.dispatchEvent(f);
112
+ }
113
+ };
114
+ E(
115
+ t,
116
+ async (u, d) => {
117
+ var f;
118
+ const w = d !== u;
119
+ if (await R(), w) {
120
+ const x = o.value, S = y(e.value);
121
+ u ? (i("MOUNT"), l("enter"), S === "none" && l("after-enter")) : S === "none" || ((f = n.value) == null ? void 0 : f.display) === "none" ? (i("UNMOUNT"), l("leave"), l("after-leave")) : d && x !== S ? (i("ANIMATION_OUT"), l("leave")) : (i("UNMOUNT"), l("after-leave"));
122
+ }
123
+ },
124
+ { immediate: !0 }
125
+ );
126
+ const s = (u) => {
127
+ const d = y(e.value), f = d.includes(
128
+ u.animationName
129
+ ), w = a.value === "mounted" ? "enter" : "leave";
130
+ u.target === e.value && f && (l(`after-${w}`), i("ANIMATION_END")), u.target === e.value && d === "none" && i("ANIMATION_END");
131
+ }, c = (u) => {
132
+ u.target === e.value && (o.value = y(e.value));
133
+ }, p = E(
134
+ e,
135
+ (u, d) => {
136
+ u ? (n.value = getComputedStyle(u), u.addEventListener("animationstart", c), u.addEventListener("animationcancel", s), u.addEventListener("animationend", s)) : (i("ANIMATION_END"), d?.removeEventListener("animationstart", c), d?.removeEventListener("animationcancel", s), d?.removeEventListener("animationend", s));
137
+ },
138
+ { immediate: !0 }
139
+ ), m = E(a, () => {
140
+ const u = y(e.value);
141
+ o.value = a.value === "mounted" ? u : "none";
142
+ });
143
+ return B(() => {
144
+ p(), m();
145
+ }), {
146
+ isPresent: I(
147
+ () => ["mounted", "unmountSuspended"].includes(a.value)
148
+ )
149
+ };
150
+ }
151
+ function y(t) {
152
+ return t && getComputedStyle(t).animationName || "none";
153
+ }
154
+ N({
155
+ name: "Presence",
156
+ props: {
157
+ present: {
158
+ type: Boolean,
159
+ required: !0
160
+ },
161
+ forceMount: {
162
+ type: Boolean
163
+ }
164
+ },
165
+ slots: {},
166
+ setup(t, { slots: e, expose: n }) {
167
+ var o;
168
+ const { present: r, forceMount: a } = j(t), i = h(), { isPresent: l } = Q(r, i);
169
+ n({ present: l });
170
+ let s = e.default({ present: l });
171
+ s = g(s || []);
172
+ const c = A();
173
+ if (s && s?.length > 1) {
174
+ const p = (o = c?.parent) != null && o.type.name ? `<${c.parent.type.name} />` : "component";
175
+ throw new Error(
176
+ [
177
+ `Detected an invalid children for \`${p}\` for \`Presence\` component.`,
178
+ "",
179
+ "Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",
180
+ "You can apply a few solutions:",
181
+ [
182
+ "Provide a single child element so that `presence` directive attach correctly.",
183
+ "Ensure the first child is an actual element instead of a raw text node or comment node."
184
+ ].map((m) => ` - ${m}`).join(`
185
+ `)
186
+ ].join(`
187
+ `)
188
+ );
189
+ }
190
+ return () => a.value || r.value || l.value ? v(e.default({ present: l })[0], {
191
+ ref: (p) => {
192
+ const m = O(p);
193
+ return typeof m?.hasAttribute > "u" || (m != null && m.hasAttribute("data-radix-popper-content-wrapper") ? i.value = m.firstElementChild : i.value = m), m;
194
+ }
195
+ }) : null;
196
+ }
197
+ });
198
+ D({
199
+ layersRoot: /* @__PURE__ */ new Set(),
200
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
201
+ branches: /* @__PURE__ */ new Set()
202
+ });
203
+ q(() => h([]));
204
+ const [C, Z] = V("CollectionProvider");
205
+ N({
206
+ name: "CollectionSlot",
207
+ setup(t, { slots: e }) {
208
+ const n = C(), { primitiveElement: o, currentElement: r } = T();
209
+ return E(r, () => {
210
+ n.collectionRef.value = r.value;
211
+ }), () => v(M, { ref: o }, e);
212
+ }
213
+ });
214
+ N({
215
+ name: "CollectionItem",
216
+ setup(t, { slots: e, attrs: n }) {
217
+ const o = C(), { primitiveElement: r, currentElement: a } = T(), i = A();
218
+ return L((l) => {
219
+ var s;
220
+ if (a.value) {
221
+ const c = b(a.value);
222
+ o.itemMap.value.set(c, { ref: a.value, ...b(((s = i?.parent) == null ? void 0 : s.props) ?? {}) }), l(() => o.itemMap.value.delete(c));
223
+ }
224
+ }), () => v(M, { ...n, [o.attrName]: "", ref: r }, e);
225
+ }
226
+ });
227
+ function Y() {
228
+ if (typeof matchMedia == "function")
229
+ return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
230
+ }
231
+ Y();
6
232
  export {
7
- n as cn
233
+ X as Primitive,
234
+ M as Slot,
235
+ V as createContext,
236
+ K as useStateMachine
8
237
  };
@@ -1,6 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/**
2
- * @license lucide-vue-next v0.395.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const t=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();exports.toKebabCase=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunk-1483.cjs"),r=e.cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-bold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}});exports.buttonVariants=r;
@@ -1,10 +1,30 @@
1
- /**
2
- * @license lucide-vue-next v0.395.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */
7
- const a = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1
+ import { cva as e } from "./chunk-1483.js";
2
+ const t = e(
3
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-bold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
4
+ {
5
+ variants: {
6
+ variant: {
7
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
8
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
9
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
10
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
11
+ ghost: "hover:bg-accent hover:text-accent-foreground",
12
+ link: "text-primary underline-offset-4 hover:underline"
13
+ },
14
+ size: {
15
+ default: "h-10 px-4 py-2",
16
+ xs: "h-7 rounded px-2",
17
+ sm: "h-9 rounded-md px-3",
18
+ lg: "h-11 rounded-md px-8",
19
+ icon: "h-10 w-10"
20
+ }
21
+ },
22
+ defaultVariants: {
23
+ variant: "default",
24
+ size: "default"
25
+ }
26
+ }
27
+ );
8
28
  export {
9
- a as toKebabCase
29
+ t as buttonVariants
10
30
  };
@@ -1,6 +1 @@
1
- "use strict";/**
2
- * @license lucide-vue-next v0.395.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */var t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};module.exports=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./chunk-1484.cjs"),t=require("./chunk-1485.cjs");function n(...e){return t.twMerge(r.clsx(e))}exports.cn=n;
@@ -1,20 +1,8 @@
1
- /**
2
- * @license lucide-vue-next v0.395.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */
7
- var t = {
8
- xmlns: "http://www.w3.org/2000/svg",
9
- width: 24,
10
- height: 24,
11
- viewBox: "0 0 24 24",
12
- fill: "none",
13
- stroke: "currentColor",
14
- "stroke-width": 2,
15
- "stroke-linecap": "round",
16
- "stroke-linejoin": "round"
17
- };
1
+ import { clsx as o } from "./chunk-1484.js";
2
+ import { twMerge as t } from "./chunk-1485.js";
3
+ function n(...r) {
4
+ return t(o(r));
5
+ }
18
6
  export {
19
- t as default
7
+ n as cn
20
8
  };
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),n=require("./chunk-1478.cjs"),r=require("./chunk-1479.cjs"),i=require("./chunk-1480.cjs"),l=e.defineComponent({__name:"LButtonTest",props:{variant:{default:"default"},size:{default:"default"},class:{default:""},asChild:{type:Boolean},as:{default:"button"}},setup(t){const a=t;return(s,u)=>(e.openBlock(),e.createBlock(e.unref(n.Primitive),{as:s.as,"as-child":s.asChild,class:e.normalizeClass(e.unref(i.cn)(e.unref(r.buttonVariants)({variant:s.variant,size:s.size}),a.class))},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},8,["as","as-child","class"]))}});module.exports=l;
1
+ "use strict";const e=require("vue"),n=require("./chunk-1480.cjs"),r=require("./chunk-1481.cjs"),i=require("./chunk-1482.cjs"),l=e.defineComponent({__name:"LButtonTest",props:{variant:{default:"default"},size:{default:"default"},class:{default:""},asChild:{type:Boolean},as:{default:"button"}},setup(t){const a=t;return(s,u)=>(e.openBlock(),e.createBlock(e.unref(n.Primitive),{as:s.as,"as-child":s.asChild,class:e.normalizeClass(e.unref(i.cn)(e.unref(r.buttonVariants)({variant:s.variant,size:s.size}),a.class))},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},8,["as","as-child","class"]))}});module.exports=l;
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as o, openBlock as r, createBlock as l, unref as t, normalizeClass as i, withCtx as n, renderSlot as f } from "vue";
2
- import { Primitive as u } from "./chunk-1478.js";
3
- import { buttonVariants as d } from "./chunk-1479.js";
4
- import { cn as m } from "./chunk-1480.js";
2
+ import { Primitive as u } from "./chunk-1480.js";
3
+ import { buttonVariants as d } from "./chunk-1481.js";
4
+ import { cn as m } from "./chunk-1482.js";
5
5
  const z = /* @__PURE__ */ o({
6
6
  __name: "LButtonTest",
7
7
  props: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layers.digital/layers-design-system-vue3",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "files": [
@@ -28,6 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@iconify/vue": "^4.1.1",
31
+ "lucide-vue-next": "^0.395.0",
31
32
  "sass": "^1.77.5",
32
33
  "vue": "^3.4.29"
33
34
  },
@@ -54,7 +55,6 @@
54
55
  "globals": "^15.4.0",
55
56
  "husky": "^9.0.11",
56
57
  "lint-staged": "^15.2.7",
57
- "lucide-vue-next": "^0.395.0",
58
58
  "prettier": "^3.3.2",
59
59
  "radix-vue": "^1.8.3",
60
60
  "storybook": "^8.1.9",