brutx-ui-vue 0.7.6 → 0.7.8
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/dist/{SubmitButton-B-aiDN2P.js → SubmitButton-BVvwf6n0.js} +90 -34
- package/dist/SubmitButton-Dn5gDHDH.cjs +1 -0
- package/dist/brutx-ui-vue.css +1 -1
- package/dist/components/auth-card/AuthCard.vue.d.ts.map +1 -1
- package/dist/components/blog-card/BlogCard.vue.d.ts +2 -2
- package/dist/components/blog-card/BlogCard.vue.d.ts.map +1 -1
- package/dist/components/brutalist-hero/BrutalistHero.vue.d.ts.map +1 -1
- package/dist/components/checkbox/Checkbox.vue.d.ts +1 -1
- package/dist/components/checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/color-mode-switcher/ColorModeSwitcher.vue.d.ts.map +1 -1
- package/dist/components/color-picker/ColorPicker.vue.d.ts.map +1 -1
- package/dist/components/color-picker/ColorPickerInput.vue.d.ts.map +1 -1
- package/dist/components/color-picker/ColorPickerPanel.vue.d.ts.map +1 -1
- package/dist/components/command/CommandDialog.vue.d.ts +2 -2
- package/dist/components/command/CommandDialog.vue.d.ts.map +1 -1
- package/dist/components/dashboard-shell/DashboardShell.vue.d.ts +3 -3
- package/dist/components/dashboard-shell/DashboardShell.vue.d.ts.map +1 -1
- package/dist/components/data-table/DataTable.vue.d.ts +7 -1
- package/dist/components/data-table/DataTable.vue.d.ts.map +1 -1
- package/dist/components/data-table/data-table-variants.d.ts +4 -0
- package/dist/components/data-table/data-table-variants.d.ts.map +1 -1
- package/dist/components/data-table-section/DataTableSection.vue.d.ts.map +1 -1
- package/dist/components/date-picker/DatePickerPanel.vue.d.ts.map +1 -1
- package/dist/components/date-picker/DatePickerRangePanel.vue.d.ts.map +1 -1
- package/dist/components/date-picker/DateTimePickerPanel.vue.d.ts.map +1 -1
- package/dist/components/date-picker/MonthPickerPanel.vue.d.ts.map +1 -1
- package/dist/components/date-picker/TimePicker.vue.d.ts +2 -0
- package/dist/components/date-picker/TimePicker.vue.d.ts.map +1 -1
- package/dist/components/date-picker/WeekPickerPanel.vue.d.ts.map +1 -1
- package/dist/components/date-picker/YearPickerPanel.vue.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-variants.d.ts +4 -1
- package/dist/components/date-picker/date-picker-variants.d.ts.map +1 -1
- package/dist/components/form/FormWizard.vue.d.ts.map +1 -1
- package/dist/components/glitch-button/GlitchButton.vue.d.ts +2 -0
- package/dist/components/glitch-button/GlitchButton.vue.d.ts.map +1 -1
- package/dist/components/glitch-button/glitch-button-variants.d.ts +1 -0
- package/dist/components/glitch-button/glitch-button-variants.d.ts.map +1 -1
- package/dist/components/glitch-text/GlitchText.vue.d.ts +2 -0
- package/dist/components/glitch-text/GlitchText.vue.d.ts.map +1 -1
- package/dist/components/glitch-text/glitch-text-variants.d.ts +1 -0
- package/dist/components/glitch-text/glitch-text-variants.d.ts.map +1 -1
- package/dist/components/noise-background/NoiseBackground.vue.d.ts +3 -0
- package/dist/components/noise-background/NoiseBackground.vue.d.ts.map +1 -1
- package/dist/components/select/SelectItem.vue.d.ts +4 -0
- package/dist/components/select/SelectItem.vue.d.ts.map +1 -1
- package/dist/components/select/SelectTrigger.vue.d.ts +2 -0
- package/dist/components/select/SelectTrigger.vue.d.ts.map +1 -1
- package/dist/components/submit-button/SubmitButton.vue.d.ts +3 -3
- package/dist/components/submit-button/SubmitButton.vue.d.ts.map +1 -1
- package/dist/components/toast/Toast.vue.d.ts.map +1 -1
- package/dist/components/waitlist-page/WaitlistPage.vue.d.ts.map +1 -1
- package/dist/composables/useDataTableFilter.d.ts +17 -0
- package/dist/composables/useDataTableFilter.d.ts.map +1 -0
- package/dist/composables/useDataTablePagination.d.ts +15 -0
- package/dist/composables/useDataTablePagination.d.ts.map +1 -0
- package/dist/composables/useDataTableSelection.d.ts +18 -0
- package/dist/composables/useDataTableSelection.d.ts.map +1 -0
- package/dist/composables/useDataTableSort.d.ts +18 -0
- package/dist/composables/useDataTableSort.d.ts.map +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3662 -3288
- package/dist/styles.css +1 -1
- package/dist/submit-button.cjs +1 -1
- package/dist/submit-button.js +1 -1
- package/package.json +1 -1
- package/dist/SubmitButton-BdK-WtL4.cjs +0 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { n as e, t } from "./utils-BkwM-_ON.js";
|
|
2
2
|
import { t as n } from "./zh-CN-NiyPjUoc.js";
|
|
3
|
-
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createTextVNode as c, defineComponent as l, inject as u, normalizeClass as d, openBlock as f, provide as p, renderSlot as m, toDisplayString as h, unref as g } from "vue";
|
|
4
|
-
import { Loader2 as
|
|
3
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createTextVNode as c, defineComponent as l, inject as u, normalizeClass as d, openBlock as f, provide as p, renderSlot as m, toDisplayString as h, unref as g, withCtx as _ } from "vue";
|
|
4
|
+
import { Loader2 as v } from "@lucide/vue";
|
|
5
|
+
import { Primitive as y } from "reka-ui";
|
|
5
6
|
//#region ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
6
|
-
var
|
|
7
|
-
if (t?.variants == null) return
|
|
7
|
+
var b = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, x = e, S = (e, t) => (n) => {
|
|
8
|
+
if (t?.variants == null) return x(e, n?.class, n?.className);
|
|
8
9
|
let { variants: r, defaultVariants: i } = t, a = Object.keys(r).map((e) => {
|
|
9
10
|
let t = n?.[e], a = i?.[e];
|
|
10
11
|
if (t === null) return null;
|
|
11
|
-
let o =
|
|
12
|
+
let o = b(t) || b(a);
|
|
12
13
|
return r[e][o];
|
|
13
14
|
}), o = n && Object.entries(n).reduce((e, t) => {
|
|
14
15
|
let [n, r] = t;
|
|
15
16
|
return r === void 0 || (e[n] = r), e;
|
|
16
17
|
}, {});
|
|
17
|
-
return
|
|
18
|
+
return x(e, a, t?.compoundVariants?.reduce((e, t) => {
|
|
18
19
|
let { class: n, className: r, ...a } = t;
|
|
19
20
|
return Object.entries(a).every((e) => {
|
|
20
21
|
let [t, n] = e;
|
|
@@ -31,7 +32,7 @@ var v = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = e, b = (e
|
|
|
31
32
|
r
|
|
32
33
|
] : e;
|
|
33
34
|
}, []), n?.class, n?.className);
|
|
34
|
-
},
|
|
35
|
+
}, C = S([
|
|
35
36
|
"inline-flex items-center justify-center gap-2",
|
|
36
37
|
"border-3 border-brutal",
|
|
37
38
|
"font-black tracking-wide",
|
|
@@ -101,11 +102,62 @@ var v = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = e, b = (e
|
|
|
101
102
|
variant: "default",
|
|
102
103
|
size: "default"
|
|
103
104
|
}
|
|
104
|
-
}),
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
}), w = /* @__PURE__ */ l({
|
|
106
|
+
__name: "Button",
|
|
107
|
+
props: {
|
|
108
|
+
variant: { default: "default" },
|
|
109
|
+
size: { default: "default" },
|
|
110
|
+
asChild: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: !1
|
|
113
|
+
},
|
|
114
|
+
loading: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: !1
|
|
117
|
+
},
|
|
118
|
+
disabled: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: !1
|
|
121
|
+
},
|
|
122
|
+
class: { default: void 0 }
|
|
123
|
+
},
|
|
124
|
+
setup(e) {
|
|
125
|
+
let n = e, r = i(() => n.disabled || n.loading), s = i(() => t(C({
|
|
126
|
+
variant: n.variant,
|
|
127
|
+
size: n.size
|
|
128
|
+
}), n.asChild && r.value && "pointer-events-none", n.class)), c = {
|
|
129
|
+
sm: "h-3 w-3",
|
|
130
|
+
default: "h-4 w-4",
|
|
131
|
+
lg: "h-5 w-5",
|
|
132
|
+
xl: "h-6 w-6"
|
|
133
|
+
}, l = i(() => c[n.size] ?? c.default);
|
|
134
|
+
return (n, i) => (f(), a(g(y), {
|
|
135
|
+
as: e.asChild ? void 0 : "button",
|
|
136
|
+
"as-child": e.asChild,
|
|
137
|
+
class: d(s.value),
|
|
138
|
+
disabled: !e.asChild && r.value,
|
|
139
|
+
"aria-disabled": e.asChild && r.value ? !0 : void 0,
|
|
140
|
+
"aria-busy": e.loading || void 0
|
|
141
|
+
}, {
|
|
142
|
+
default: _(() => [e.loading ? (f(), a(g(v), {
|
|
143
|
+
key: 0,
|
|
144
|
+
class: d(g(t)(l.value, "animate-spin"))
|
|
145
|
+
}, null, 8, ["class"])) : o("", !0), m(n.$slots, "default")]),
|
|
146
|
+
_: 3
|
|
147
|
+
}, 8, [
|
|
148
|
+
"as",
|
|
149
|
+
"as-child",
|
|
150
|
+
"class",
|
|
151
|
+
"disabled",
|
|
152
|
+
"aria-disabled",
|
|
153
|
+
"aria-busy"
|
|
154
|
+
]));
|
|
155
|
+
}
|
|
156
|
+
}), T = Symbol("brutx-ui-locale");
|
|
157
|
+
function E(e) {
|
|
158
|
+
p(T, e);
|
|
107
159
|
}
|
|
108
|
-
function
|
|
160
|
+
function D(e, t) {
|
|
109
161
|
let n = t.split("."), r = e;
|
|
110
162
|
for (let e of n) {
|
|
111
163
|
if (typeof r != "object" || !r) return;
|
|
@@ -113,16 +165,16 @@ function w(e, t) {
|
|
|
113
165
|
}
|
|
114
166
|
return typeof r == "string" ? r : void 0;
|
|
115
167
|
}
|
|
116
|
-
function
|
|
168
|
+
function O(e, t) {
|
|
117
169
|
return t ? Object.entries(t).reduce((e, [t, n]) => e.split(`{${t}}`).join(String(n)), e) : e;
|
|
118
170
|
}
|
|
119
|
-
function
|
|
120
|
-
let e = u(
|
|
171
|
+
function k() {
|
|
172
|
+
let e = u(T, void 0), t = i(() => (e ? g(e) : void 0) ?? n);
|
|
121
173
|
function r(e, r) {
|
|
122
|
-
let i =
|
|
123
|
-
if (i !== void 0) return
|
|
124
|
-
let a =
|
|
125
|
-
return a === void 0 ? e :
|
|
174
|
+
let i = D(t.value, e);
|
|
175
|
+
if (i !== void 0) return O(i, r);
|
|
176
|
+
let a = D(n, e);
|
|
177
|
+
return a === void 0 ? e : O(a, r);
|
|
126
178
|
}
|
|
127
179
|
return {
|
|
128
180
|
locale: t,
|
|
@@ -130,8 +182,8 @@ function E() {
|
|
|
130
182
|
};
|
|
131
183
|
}
|
|
132
184
|
//#endregion
|
|
133
|
-
//#region src/components/submit-button/SubmitButton.vue
|
|
134
|
-
var
|
|
185
|
+
//#region src/components/submit-button/SubmitButton.vue
|
|
186
|
+
var A = /* @__PURE__ */ l({
|
|
135
187
|
__name: "SubmitButton",
|
|
136
188
|
props: {
|
|
137
189
|
variant: { default: "default" },
|
|
@@ -148,21 +200,25 @@ var D = ["disabled", "aria-busy"], O = /* @__PURE__ */ l({
|
|
|
148
200
|
class: { default: void 0 }
|
|
149
201
|
},
|
|
150
202
|
setup(e) {
|
|
151
|
-
let
|
|
152
|
-
|
|
153
|
-
size: n.size
|
|
154
|
-
}), n.class));
|
|
155
|
-
return (t, n) => (f(), s("button", {
|
|
203
|
+
let t = e, { t: n } = k(), o = i(() => t.pendingText ?? n("submitButton.submitting"));
|
|
204
|
+
return (n, i) => (f(), a(w, {
|
|
156
205
|
type: "submit",
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
"
|
|
164
|
-
|
|
206
|
+
variant: e.variant,
|
|
207
|
+
size: e.size,
|
|
208
|
+
loading: e.loading,
|
|
209
|
+
disabled: e.disabled,
|
|
210
|
+
class: d(t.class)
|
|
211
|
+
}, {
|
|
212
|
+
default: _(() => [e.loading && o.value ? (f(), s(r, { key: 0 }, [c(h(o.value), 1)], 64)) : m(n.$slots, "default", { key: 1 })]),
|
|
213
|
+
_: 3
|
|
214
|
+
}, 8, [
|
|
215
|
+
"variant",
|
|
216
|
+
"size",
|
|
217
|
+
"loading",
|
|
218
|
+
"disabled",
|
|
219
|
+
"class"
|
|
220
|
+
]));
|
|
165
221
|
}
|
|
166
222
|
});
|
|
167
223
|
//#endregion
|
|
168
|
-
export {
|
|
224
|
+
export { w as a, k as i, T as n, C as o, E as r, S as s, A as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./utils-BC5WDCkH.cjs"),t=require("./zh-CN-XM377bmZ.cjs");let n=require("vue"),r=require("@lucide/vue"),i=require("reka-ui");var a=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,o=e.n,s=(e,t)=>n=>{if(t?.variants==null)return o(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,s=Object.keys(r).map(e=>{let t=n?.[e],o=i?.[e];if(t===null)return null;let s=a(t)||a(o);return r[e][s]}),c=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return o(e,s,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...c}[t]):{...i,...c}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},c=s([`inline-flex items-center justify-center gap-2`,`border-3 border-brutal`,`font-black tracking-wide`,`transition-all duration-150`,`focus:outline focus:outline-[3px] focus:outline-brutal-ring focus:outline-offset-2`,`disabled:opacity-50 disabled:pointer-events-none`,`active:translate-y-[var(--brutal-pressed-offset,2px)] active:shadow-none`],{variants:{variant:{default:[`bg-brutal-bg text-brutal-fg`,`shadow-brutal`,`hover:shadow-brutal-lg hover:-translate-x-0.5 hover:-translate-y-0.5`],primary:[`bg-brutal-primary text-brutal-primary-foreground`,`shadow-brutal`,`hover:shadow-brutal-lg hover:-translate-x-0.5 hover:-translate-y-0.5`],secondary:[`bg-brutal-secondary text-brutal-secondary-foreground`,`shadow-brutal`,`hover:shadow-brutal-lg hover:-translate-x-0.5 hover:-translate-y-0.5`],accent:[`bg-brutal-accent text-brutal-accent-foreground`,`shadow-brutal`,`hover:shadow-brutal-lg hover:-translate-x-0.5 hover:-translate-y-0.5`],danger:[`bg-brutal-destructive text-brutal-destructive-foreground`,`shadow-brutal`,`hover:shadow-brutal-lg hover:-translate-x-0.5 hover:-translate-y-0.5`],success:[`bg-brutal-success text-brutal-success-foreground`,`shadow-brutal`,`hover:shadow-brutal-lg hover:-translate-x-0.5 hover:-translate-y-0.5`],outline:[`bg-transparent text-brutal-fg`,`shadow-brutal`,`hover:bg-brutal-fg hover:text-brutal-bg`,`hover:shadow-brutal-lg hover:-translate-x-0.5 hover:-translate-y-0.5`],ghost:[`bg-transparent text-brutal-fg border-transparent`,`shadow-none`,`hover:bg-brutal-muted hover:border-brutal`],link:[`bg-transparent text-brutal-fg border-transparent`,`shadow-none underline-offset-4`,`hover:underline`]},size:{sm:`h-9 px-3 py-1 text-sm`,default:`h-11 px-5 py-2 text-base`,lg:`h-14 px-8 py-3 text-lg`,xl:`h-16 px-10 py-4 text-xl`,icon:`h-11 w-11 p-0`}},defaultVariants:{variant:`default`,size:`default`}}),l=(0,n.defineComponent)({__name:`Button`,props:{variant:{default:`default`},size:{default:`default`},asChild:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},class:{default:void 0}},setup(t){let a=t,o=(0,n.computed)(()=>a.disabled||a.loading),s=(0,n.computed)(()=>e.t(c({variant:a.variant,size:a.size}),a.asChild&&o.value&&`pointer-events-none`,a.class)),l={sm:`h-3 w-3`,default:`h-4 w-4`,lg:`h-5 w-5`,xl:`h-6 w-6`},u=(0,n.computed)(()=>l[a.size]??l.default);return(a,c)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(i.Primitive),{as:t.asChild?void 0:`button`,"as-child":t.asChild,class:(0,n.normalizeClass)(s.value),disabled:!t.asChild&&o.value,"aria-disabled":t.asChild&&o.value?!0:void 0,"aria-busy":t.loading||void 0},{default:(0,n.withCtx)(()=>[t.loading?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.Loader2),{key:0,class:(0,n.normalizeClass)((0,n.unref)(e.t)(u.value,`animate-spin`))},null,8,[`class`])):(0,n.createCommentVNode)(``,!0),(0,n.renderSlot)(a.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`,`disabled`,`aria-disabled`,`aria-busy`]))}}),u=Symbol(`brutx-ui-locale`);function d(e){(0,n.provide)(u,e)}function f(e,t){let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r)return;r=r[e]}return typeof r==`string`?r:void 0}function p(e,t){return t?Object.entries(t).reduce((e,[t,n])=>e.split(`{${t}}`).join(String(n)),e):e}function m(){let e=(0,n.inject)(u,void 0),r=(0,n.computed)(()=>(e?(0,n.unref)(e):void 0)??t.t);function i(e,n){let i=f(r.value,e);if(i!==void 0)return p(i,n);let a=f(t.t,e);return a===void 0?e:p(a,n)}return{locale:r,t:i}}var h=(0,n.defineComponent)({__name:`SubmitButton`,props:{variant:{default:`default`},size:{default:`default`},pendingText:{default:void 0},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},class:{default:void 0}},setup(e){let t=e,{t:r}=m(),i=(0,n.computed)(()=>t.pendingText??r(`submitButton.submitting`));return(r,a)=>((0,n.openBlock)(),(0,n.createBlock)(l,{type:`submit`,variant:e.variant,size:e.size,loading:e.loading,disabled:e.disabled,class:(0,n.normalizeClass)(t.class)},{default:(0,n.withCtx)(()=>[e.loading&&i.value?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[(0,n.createTextVNode)((0,n.toDisplayString)(i.value),1)],64)):(0,n.renderSlot)(r.$slots,`default`,{key:1})]),_:3},8,[`variant`,`size`,`loading`,`disabled`,`class`]))}});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|