readytech-ui-library-v2 0.0.9 → 0.0.11

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 +1 @@
1
- .lv-button[data-v-ac3af47a]{border:one;background:red;padding:1rem}.class-input[data-v-f440ad26]{border:none;background:green;padding:1rem}.btn-primary[data-v-ad55ccd4]{background-color:#1976d2;color:#fff}.btn-primary[data-v-ad55ccd4]:hover{background-color:#1565c0}.btn-icon[data-v-ad55ccd4]{padding:0;width:48px;height:48px}.btn-disabled[data-v-ad55ccd4]{opacity:.6;pointer-events:none}.v-badge[aria-label][data-v-9511f409]:focus{outline:2px solid #005fcc;outline-offset:4px}
1
+ .lv-button[data-v-ac3af47a]{border:one;background:red;padding:1rem}.class-input[data-v-f440ad26]{border:none;background:green;padding:1rem}.btn-primary[data-v-ce0d0f31]{background-color:#1976d2;color:#fff}.btn-primary[data-v-ce0d0f31]:hover{background-color:#1565c0}.btn-icon[data-v-ce0d0f31]{padding:0;width:48px;height:48px}.btn-disabled[data-v-ce0d0f31]{opacity:.6;pointer-events:none}.v-badge[aria-label][data-v-02392152]:focus{outline:2px solid #005fcc;outline-offset:4px}.avatar-wrapper[data-v-0d49dde0]{display:flex;gap:16px;justify-content:space-around}.avatar[data-v-0d49dde0]{transition:transform .3s ease;outline:none}.avatar[data-v-0d49dde0]:focus{outline:2px solid #005fcc;outline-offset:4px}.avatar[data-v-0d49dde0]:hover{transform:scale(1.1)}.avatar img[data-v-0d49dde0]{border-radius:50%;object-fit:cover}
@@ -1,27 +1,27 @@
1
- import { createElementBlock as b, openBlock as r, renderSlot as u, toDisplayString as m, resolveComponent as s, createBlock as f, mergeProps as g, normalizeClass as y, withCtx as _, createTextVNode as v, computed as c } from "vue";
2
- const i = (t, a) => {
1
+ import { createElementBlock as _, openBlock as d, renderSlot as g, toDisplayString as s, resolveComponent as c, createBlock as b, mergeProps as k, normalizeClass as S, withCtx as i, createTextVNode as m, computed as v, createVNode as p } from "vue";
2
+ const u = (t, a) => {
3
3
  const e = t.__vccOpts || t;
4
- for (const [l, o] of a)
5
- e[l] = o;
4
+ for (const [n, l] of a)
5
+ e[n] = l;
6
6
  return e;
7
7
  }, B = {}, h = { class: "lv-button" };
8
8
  function x(t, a) {
9
- return r(), b("button", h, [
10
- u(t.$slots, "default", {}, void 0, !0)
9
+ return d(), _("button", h, [
10
+ g(t.$slots, "default", {}, void 0, !0)
11
11
  ]);
12
12
  }
13
- const S = /* @__PURE__ */ i(B, [["render", x], ["__scopeId", "data-v-ac3af47a"]]), k = {
13
+ const C = /* @__PURE__ */ u(B, [["render", x], ["__scopeId", "data-v-ac3af47a"]]), I = {
14
14
  name: "InputTaras",
15
15
  props: {
16
16
  prop: {
17
17
  required: !0
18
18
  }
19
19
  }
20
- }, C = { class: "class-input" };
21
- function V(t, a, e, l, o, n) {
22
- return r(), b("h1", C, m(e.prop) + " taras", 1);
20
+ }, R = { class: "class-input" };
21
+ function z(t, a, e, n, l, o) {
22
+ return d(), _("h1", R, s(e.prop) + " taras", 1);
23
23
  }
24
- const I = /* @__PURE__ */ i(k, [["render", V], ["__scopeId", "data-v-f440ad26"]]), z = {
24
+ const V = /* @__PURE__ */ u(I, [["render", z], ["__scopeId", "data-v-f440ad26"]]), N = {
25
25
  name: "RtText",
26
26
  props: {
27
27
  label: {
@@ -87,11 +87,11 @@ const I = /* @__PURE__ */ i(k, [["render", V], ["__scopeId", "data-v-f440ad26"]]
87
87
  }
88
88
  }
89
89
  };
90
- function R(t, a, e, l, o, n) {
91
- const d = s("v-text-field");
92
- return r(), f(d, g(n.inputProps, {
93
- modelValue: n.inputValue,
94
- "onUpdate:modelValue": a[0] || (a[0] = (p) => n.inputValue = p),
90
+ function T(t, a, e, n, l, o) {
91
+ const r = c("v-text-field");
92
+ return d(), b(r, k(o.inputProps, {
93
+ modelValue: o.inputValue,
94
+ "onUpdate:modelValue": a[0] || (a[0] = (f) => o.inputValue = f),
95
95
  label: e.label,
96
96
  placeholder: e.placeholder,
97
97
  disabled: e.disabled,
@@ -101,10 +101,10 @@ function R(t, a, e, l, o, n) {
101
101
  clearable: "",
102
102
  hint: e.hint,
103
103
  autocomplete: e.autocomplete,
104
- "onClick:clear": n.handleClear
104
+ "onClick:clear": o.handleClear
105
105
  }), null, 16, ["modelValue", "label", "placeholder", "disabled", "error", "error-messages", "prepend-icon", "hint", "autocomplete", "onClick:clear"]);
106
106
  }
107
- const T = /* @__PURE__ */ i(z, [["render", R], ["__scopeId", "data-v-406c1a0f"]]), L = {
107
+ const L = /* @__PURE__ */ u(N, [["render", T], ["__scopeId", "data-v-33b97f38"]]), A = {
108
108
  name: "RtButton",
109
109
  props: {
110
110
  // Button text label
@@ -212,24 +212,24 @@ const T = /* @__PURE__ */ i(z, [["render", R], ["__scopeId", "data-v-406c1a0f"]]
212
212
  setup(t, { emit: a }) {
213
213
  const e = () => {
214
214
  a("click");
215
- }, l = c(() => t.primary ? "flat" : "outlined"), o = c(() => t.label || "Button"), n = c(() => ({
215
+ }, n = v(() => t.primary ? "flat" : "outlined"), l = v(() => t.label || "Button"), o = v(() => ({
216
216
  "btn-primary": t.primary,
217
217
  "btn-icon": t.icon,
218
218
  "btn-disabled": t.disabled
219
219
  }));
220
220
  return {
221
221
  onClick: e,
222
- variant: l,
223
- ariaLabel: o,
224
- buttonClasses: n
222
+ variant: n,
223
+ ariaLabel: l,
224
+ buttonClasses: o
225
225
  };
226
226
  }
227
227
  };
228
- function N(t, a, e, l, o, n) {
229
- const d = s("v-btn");
230
- return r(), f(d, {
228
+ function j(t, a, e, n, l, o) {
229
+ const r = c("v-btn");
230
+ return d(), b(r, {
231
231
  type: "button",
232
- variant: l.variant,
232
+ variant: n.variant,
233
233
  size: e.size,
234
234
  color: e.color,
235
235
  icon: e.icon,
@@ -249,19 +249,19 @@ function N(t, a, e, l, o, n) {
249
249
  exact: e.exact,
250
250
  append: e.append,
251
251
  "background-color": e.backgroundColor,
252
- class: y(l.buttonClasses),
253
- onClick: l.onClick,
254
- "aria-label": l.ariaLabel
252
+ class: S(n.buttonClasses),
253
+ onClick: n.onClick,
254
+ "aria-label": n.ariaLabel
255
255
  }, {
256
- default: _(() => [
257
- u(t.$slots, "default", {}, () => [
258
- v(m(e.label), 1)
256
+ default: i(() => [
257
+ g(t.$slots, "default", {}, () => [
258
+ m(s(e.label), 1)
259
259
  ], !0)
260
260
  ]),
261
261
  _: 3
262
262
  }, 8, ["variant", "size", "color", "icon", "disabled", "loading", "outlined", "text", "tile", "depressed", "rounded", "block", "href", "target", "elevation", "to", "replace", "exact", "append", "background-color", "class", "onClick", "aria-label"]);
263
263
  }
264
- const A = /* @__PURE__ */ i(L, [["render", N], ["__scopeId", "data-v-ad55ccd4"]]), M = {
264
+ const O = /* @__PURE__ */ u(A, [["render", j], ["__scopeId", "data-v-ce0d0f31"]]), q = {
265
265
  name: "RtBadge",
266
266
  props: {
267
267
  value: {
@@ -303,9 +303,9 @@ const A = /* @__PURE__ */ i(L, [["render", N], ["__scopeId", "data-v-ad55ccd4"]]
303
303
  }
304
304
  }
305
305
  };
306
- function P(t, a, e, l, o, n) {
307
- const d = s("v-badge");
308
- return r(), f(d, {
306
+ function M(t, a, e, n, l, o) {
307
+ const r = c("v-badge");
308
+ return d(), b(r, {
309
309
  value: e.value,
310
310
  color: e.color,
311
311
  dot: e.dot,
@@ -315,21 +315,220 @@ function P(t, a, e, l, o, n) {
315
315
  bottom: e.bottom,
316
316
  top: e.top,
317
317
  role: "status",
318
- "aria-label": n.getAriaLabel,
318
+ "aria-label": o.getAriaLabel,
319
319
  "aria-live": e.dot ? "polite" : "off",
320
320
  tabindex: "0"
321
321
  }, {
322
- default: _(() => [
323
- u(t.$slots, "default", {}, void 0, !0)
322
+ default: i(() => [
323
+ g(t.$slots, "default", {}, void 0, !0)
324
324
  ]),
325
325
  _: 3
326
326
  }, 8, ["value", "color", "dot", "overlap", "content", "size", "bottom", "top", "aria-label", "aria-live"]);
327
327
  }
328
- const O = /* @__PURE__ */ i(M, [["render", P], ["__scopeId", "data-v-9511f409"]]), q = {
328
+ const P = /* @__PURE__ */ u(q, [["render", M], ["__scopeId", "data-v-02392152"]]), U = {
329
+ name: "RtSnackbar",
330
+ props: {
331
+ message: {
332
+ type: String,
333
+ default: "Hello, I'm a snackbar!"
334
+ },
335
+ timeout: {
336
+ type: Number,
337
+ default: 6e3
338
+ },
339
+ buttonText: {
340
+ type: String,
341
+ default: "Open Snackbar"
342
+ },
343
+ buttonColor: {
344
+ type: String,
345
+ default: "primary"
346
+ },
347
+ snackbarColor: {
348
+ type: String,
349
+ default: ""
350
+ },
351
+ actionButtonText: {
352
+ type: String,
353
+ default: "Close"
354
+ },
355
+ actionButtonColor: {
356
+ type: String,
357
+ default: "pink"
358
+ }
359
+ },
360
+ data() {
361
+ return {
362
+ snackbar: !1
363
+ };
364
+ }
365
+ }, w = { class: "text-center ma-2" };
366
+ function D(t, a, e, n, l, o) {
367
+ const r = c("v-btn"), f = c("v-snackbar");
368
+ return d(), _("div", w, [
369
+ p(r, {
370
+ color: e.buttonColor,
371
+ onClick: a[0] || (a[0] = (y) => l.snackbar = !0)
372
+ }, {
373
+ default: i(() => [
374
+ m(s(e.buttonText), 1)
375
+ ]),
376
+ _: 1
377
+ }, 8, ["color"]),
378
+ p(f, {
379
+ modelValue: l.snackbar,
380
+ "onUpdate:modelValue": a[2] || (a[2] = (y) => l.snackbar = y),
381
+ timeout: e.timeout,
382
+ color: e.snackbarColor
383
+ }, {
384
+ actions: i(() => [
385
+ p(r, {
386
+ color: e.actionButtonColor,
387
+ variant: "text",
388
+ onClick: a[1] || (a[1] = (y) => l.snackbar = !1)
389
+ }, {
390
+ default: i(() => [
391
+ m(s(e.actionButtonText), 1)
392
+ ]),
393
+ _: 1
394
+ }, 8, ["color"])
395
+ ]),
396
+ default: i(() => [
397
+ m(s(e.message) + " ", 1)
398
+ ]),
399
+ _: 1
400
+ }, 8, ["modelValue", "timeout", "color"])
401
+ ]);
402
+ }
403
+ const E = /* @__PURE__ */ u(U, [["render", D], ["__scopeId", "data-v-75ce5462"]]), F = {
404
+ name: "RtImage",
405
+ props: {
406
+ src: {
407
+ type: String,
408
+ required: !0
409
+ },
410
+ alt: {
411
+ type: String,
412
+ required: !0
413
+ },
414
+ lazySrc: {
415
+ type: String,
416
+ default: ""
417
+ },
418
+ aspectRatio: {
419
+ type: [Number, String],
420
+ default: null
421
+ },
422
+ gradient: {
423
+ type: String,
424
+ default: ""
425
+ },
426
+ loading: {
427
+ type: String,
428
+ default: "lazy",
429
+ // Options: 'lazy', 'eager'
430
+ validator: (t) => ["lazy", "eager"].includes(t)
431
+ },
432
+ transition: {
433
+ type: String,
434
+ default: "fade-transition"
435
+ },
436
+ classes: {
437
+ type: [String, Array, Object],
438
+ default: () => ""
439
+ }
440
+ }
441
+ };
442
+ function H(t, a, e, n, l, o) {
443
+ const r = c("v-img");
444
+ return d(), b(r, {
445
+ src: e.src,
446
+ alt: e.alt,
447
+ "lazy-src": e.lazySrc,
448
+ "aspect-ratio": e.aspectRatio,
449
+ gradient: e.gradient,
450
+ loading: e.loading,
451
+ transition: e.transition,
452
+ class: S(e.classes)
453
+ }, {
454
+ placeholder: i(() => [
455
+ g(t.$slots, "placeholder", {}, () => [
456
+ a[0] || (a[0] = m("Loading..."))
457
+ ], !0)
458
+ ]),
459
+ default: i(() => [
460
+ g(t.$slots, "default", {}, void 0, !0)
461
+ ]),
462
+ _: 3
463
+ }, 8, ["src", "alt", "lazy-src", "aspect-ratio", "gradient", "loading", "transition", "class"]);
464
+ }
465
+ const G = /* @__PURE__ */ u(F, [["render", H], ["__scopeId", "data-v-f3ff4550"]]), J = {
466
+ name: "RtAvatar",
467
+ components: {
468
+ RtImage: G
469
+ },
470
+ props: {
471
+ avatarImage: {
472
+ type: String,
473
+ default: "https://randomuser.me/api/portraits/men/32.jpg"
474
+ },
475
+ alt: {
476
+ type: String,
477
+ default: "Alt"
478
+ },
479
+ ariaLabel: {
480
+ type: String,
481
+ default: "Aria Label"
482
+ },
483
+ name: {
484
+ type: String,
485
+ default: "Name"
486
+ },
487
+ size: {
488
+ type: Number,
489
+ default: 50
490
+ },
491
+ rounded: {
492
+ type: Number,
493
+ default: 1
494
+ }
495
+ },
496
+ computed: {
497
+ initials() {
498
+ return this.name ? this.name.split(" ").map((t) => t[0]).join("").toUpperCase() : "";
499
+ }
500
+ }
501
+ }, K = { class: "avatar-wrapper" }, Q = {
502
+ key: 1,
503
+ class: "initials"
504
+ };
505
+ function W(t, a, e, n, l, o) {
506
+ const r = c("RtImage"), f = c("v-avatar");
507
+ return d(), _("div", K, [
508
+ p(f, {
509
+ size: e.size,
510
+ class: "avatar",
511
+ rounded: e.rounded,
512
+ tabindex: "0",
513
+ role: "img",
514
+ "aria-label": e.ariaLabel
515
+ }, {
516
+ default: i(() => [
517
+ e.avatarImage ? (d(), b(r, {
518
+ key: 0,
519
+ src: e.avatarImage,
520
+ alt: e.alt
521
+ }, null, 8, ["src", "alt"])) : (d(), _("span", Q, s(o.initials), 1))
522
+ ]),
523
+ _: 1
524
+ }, 8, ["size", "rounded", "aria-label"])
525
+ ]);
526
+ }
527
+ const X = /* @__PURE__ */ u(J, [["render", W], ["__scopeId", "data-v-0d49dde0"]]), Z = {
329
528
  install: (t, a) => {
330
- t.component("LearnVueButton", S), t.component("InputTaras", I), t.component("RtText", T), t.component("RtButton", A), t.component("RtBadge", O);
529
+ t.component("LearnVueButton", C), t.component("InputTaras", V), t.component("RtText", L), t.component("RtButton", O), t.component("RtBadge", P), t.component("RtSnackbar", E), t.component("RtAvatar", X);
331
530
  }
332
531
  };
333
532
  export {
334
- q as default
533
+ Z as default
335
534
  };
@@ -1 +1 @@
1
- (function(t,d){typeof exports=="object"&&typeof module<"u"?module.exports=d(require("vue")):typeof define=="function"&&define.amd?define(["vue"],d):(t=typeof globalThis<"u"?globalThis:t||self,t["readytech-ui-library-v2"]=d(t.Vue))})(this,function(t){"use strict";const d=(a,l)=>{const e=a.__vccOpts||a;for(const[n,r]of l)e[n]=r;return e},c={},u={class:"lv-button"};function s(a,l){return t.openBlock(),t.createElementBlock("button",u,[t.renderSlot(a.$slots,"default",{},void 0,!0)])}const f=d(c,[["render",s],["__scopeId","data-v-ac3af47a"]]),p={name:"InputTaras",props:{prop:{required:!0}}},m={class:"class-input"};function b(a,l,e,n,r,o){return t.openBlock(),t.createElementBlock("h1",m,t.toDisplayString(e.prop)+" taras",1)}const _=d(p,[["render",b],["__scopeId","data-v-f440ad26"]]),y={name:"RtText",props:{label:{type:String,default:"Input Field"},hint:{type:String,default:""},placeholder:{type:String,default:""},modelValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},error:{type:Boolean,default:!1},errorMessages:{type:[String,Array],default:()=>[]},prependIcon:{type:String,default:""},clearable:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"}},computed:{inputValue:{get(){return this.modelValue},set(a){this.$emit("update:modelValue",a)}},inputProps(){return{...this.$props}}},methods:{handleClear(){this.$emit("clear")}}};function g(a,l,e,n,r,o){const i=t.resolveComponent("v-text-field");return t.openBlock(),t.createBlock(i,t.mergeProps(o.inputProps,{modelValue:o.inputValue,"onUpdate:modelValue":l[0]||(l[0]=V=>o.inputValue=V),label:e.label,placeholder:e.placeholder,disabled:e.disabled,error:e.error,"error-messages":e.errorMessages,"prepend-icon":e.prependIcon,clearable:"",hint:e.hint,autocomplete:e.autocomplete,"onClick:clear":o.handleClear}),null,16,["modelValue","label","placeholder","disabled","error","error-messages","prepend-icon","hint","autocomplete","onClick:clear"])}const B=d(y,[["render",g],["__scopeId","data-v-406c1a0f"]]),h={name:"RtButton",props:{label:{type:String,default:"Click Me"},primary:{type:Boolean,default:!1},size:{type:String,default:"default",validator:a=>["x-small","small","default","large","x-large"].includes(a)},color:{type:String,default:"primary"},backgroundColor:{type:String},icon:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},text:{type:String,default:""},tile:{type:Boolean,default:!1},depressed:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},block:{type:Boolean,default:!1},href:{type:String,default:""},target:{type:String,default:"_self"},to:{type:[String,Object],default:null},replace:{type:Boolean,default:!1},exact:{type:Boolean,default:!1},append:{type:Boolean,default:!1},elevation:{type:[Number,String],default:2}},emits:["click"],setup(a,{emit:l}){const e=()=>{l("click")},n=t.computed(()=>a.primary?"flat":"outlined"),r=t.computed(()=>a.label||"Button"),o=t.computed(()=>({"btn-primary":a.primary,"btn-icon":a.icon,"btn-disabled":a.disabled}));return{onClick:e,variant:n,ariaLabel:r,buttonClasses:o}}};function k(a,l,e,n,r,o){const i=t.resolveComponent("v-btn");return t.openBlock(),t.createBlock(i,{type:"button",variant:n.variant,size:e.size,color:e.color,icon:e.icon,disabled:e.disabled,loading:e.loading,outlined:e.outlined,text:e.text,tile:e.tile,depressed:e.depressed,rounded:e.rounded,block:e.block,href:e.href,target:e.target,elevation:e.elevation,to:e.to,replace:e.replace,exact:e.exact,append:e.append,"background-color":e.backgroundColor,class:t.normalizeClass(n.buttonClasses),onClick:n.onClick,"aria-label":n.ariaLabel},{default:t.withCtx(()=>[t.renderSlot(a.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(e.label),1)],!0)]),_:3},8,["variant","size","color","icon","disabled","loading","outlined","text","tile","depressed","rounded","block","href","target","elevation","to","replace","exact","append","background-color","class","onClick","aria-label"])}const x=d(h,[["render",k],["__scopeId","data-v-ad55ccd4"]]),S={name:"RtBadge",props:{value:{type:[String,Number],default:0},color:{type:String,default:"red"},dot:{type:Boolean,default:!1},overlap:{type:Boolean,default:!1},content:{type:String,default:""},size:{type:[String,Number],default:"20"},bottom:{type:Boolean,default:!1},top:{type:Boolean,default:!1}},computed:{getAriaLabel(){return this.dot?"Notification dot":this.content?`Badge content: ${this.content}`:this.value?`Badge value: ${this.value}`:"Badge"}}};function C(a,l,e,n,r,o){const i=t.resolveComponent("v-badge");return t.openBlock(),t.createBlock(i,{value:e.value,color:e.color,dot:e.dot,overlap:e.overlap,content:e.content,size:e.size,bottom:e.bottom,top:e.top,role:"status","aria-label":o.getAriaLabel,"aria-live":e.dot?"polite":"off",tabindex:"0"},{default:t.withCtx(()=>[t.renderSlot(a.$slots,"default",{},void 0,!0)]),_:3},8,["value","color","dot","overlap","content","size","bottom","top","aria-label","aria-live"])}const v=d(S,[["render",C],["__scopeId","data-v-9511f409"]]);return{install:(a,l)=>{a.component("LearnVueButton",f),a.component("InputTaras",_),a.component("RtText",B),a.component("RtButton",x),a.component("RtBadge",v)}}});
1
+ (function(t,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("vue")):typeof define=="function"&&define.amd?define(["vue"],i):(t=typeof globalThis<"u"?globalThis:t||self,t["readytech-ui-library-v2"]=i(t.Vue))})(this,function(t){"use strict";const i=(a,n)=>{const e=a.__vccOpts||a;for(const[o,l]of n)e[o]=l;return e},u={},f={class:"lv-button"};function m(a,n){return t.openBlock(),t.createElementBlock("button",f,[t.renderSlot(a.$slots,"default",{},void 0,!0)])}const p=i(u,[["render",m],["__scopeId","data-v-ac3af47a"]]),g={name:"InputTaras",props:{prop:{required:!0}}},_={class:"class-input"};function b(a,n,e,o,l,r){return t.openBlock(),t.createElementBlock("h1",_,t.toDisplayString(e.prop)+" taras",1)}const y=i(g,[["render",b],["__scopeId","data-v-f440ad26"]]),k={name:"RtText",props:{label:{type:String,default:"Input Field"},hint:{type:String,default:""},placeholder:{type:String,default:""},modelValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},error:{type:Boolean,default:!1},errorMessages:{type:[String,Array],default:()=>[]},prependIcon:{type:String,default:""},clearable:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"}},computed:{inputValue:{get(){return this.modelValue},set(a){this.$emit("update:modelValue",a)}},inputProps(){return{...this.$props}}},methods:{handleClear(){this.$emit("clear")}}};function B(a,n,e,o,l,r){const d=t.resolveComponent("v-text-field");return t.openBlock(),t.createBlock(d,t.mergeProps(r.inputProps,{modelValue:r.inputValue,"onUpdate:modelValue":n[0]||(n[0]=c=>r.inputValue=c),label:e.label,placeholder:e.placeholder,disabled:e.disabled,error:e.error,"error-messages":e.errorMessages,"prepend-icon":e.prependIcon,clearable:"",hint:e.hint,autocomplete:e.autocomplete,"onClick:clear":r.handleClear}),null,16,["modelValue","label","placeholder","disabled","error","error-messages","prepend-icon","hint","autocomplete","onClick:clear"])}const S=i(k,[["render",B],["__scopeId","data-v-33b97f38"]]),h={name:"RtButton",props:{label:{type:String,default:"Click Me"},primary:{type:Boolean,default:!1},size:{type:String,default:"default",validator:a=>["x-small","small","default","large","x-large"].includes(a)},color:{type:String,default:"primary"},backgroundColor:{type:String},icon:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},text:{type:String,default:""},tile:{type:Boolean,default:!1},depressed:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},block:{type:Boolean,default:!1},href:{type:String,default:""},target:{type:String,default:"_self"},to:{type:[String,Object],default:null},replace:{type:Boolean,default:!1},exact:{type:Boolean,default:!1},append:{type:Boolean,default:!1},elevation:{type:[Number,String],default:2}},emits:["click"],setup(a,{emit:n}){const e=()=>{n("click")},o=t.computed(()=>a.primary?"flat":"outlined"),l=t.computed(()=>a.label||"Button"),r=t.computed(()=>({"btn-primary":a.primary,"btn-icon":a.icon,"btn-disabled":a.disabled}));return{onClick:e,variant:o,ariaLabel:l,buttonClasses:r}}};function x(a,n,e,o,l,r){const d=t.resolveComponent("v-btn");return t.openBlock(),t.createBlock(d,{type:"button",variant:o.variant,size:e.size,color:e.color,icon:e.icon,disabled:e.disabled,loading:e.loading,outlined:e.outlined,text:e.text,tile:e.tile,depressed:e.depressed,rounded:e.rounded,block:e.block,href:e.href,target:e.target,elevation:e.elevation,to:e.to,replace:e.replace,exact:e.exact,append:e.append,"background-color":e.backgroundColor,class:t.normalizeClass(o.buttonClasses),onClick:o.onClick,"aria-label":o.ariaLabel},{default:t.withCtx(()=>[t.renderSlot(a.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(e.label),1)],!0)]),_:3},8,["variant","size","color","icon","disabled","loading","outlined","text","tile","depressed","rounded","block","href","target","elevation","to","replace","exact","append","background-color","class","onClick","aria-label"])}const C=i(h,[["render",x],["__scopeId","data-v-ce0d0f31"]]),V={name:"RtBadge",props:{value:{type:[String,Number],default:0},color:{type:String,default:"red"},dot:{type:Boolean,default:!1},overlap:{type:Boolean,default:!1},content:{type:String,default:""},size:{type:[String,Number],default:"20"},bottom:{type:Boolean,default:!1},top:{type:Boolean,default:!1}},computed:{getAriaLabel(){return this.dot?"Notification dot":this.content?`Badge content: ${this.content}`:this.value?`Badge value: ${this.value}`:"Badge"}}};function I(a,n,e,o,l,r){const d=t.resolveComponent("v-badge");return t.openBlock(),t.createBlock(d,{value:e.value,color:e.color,dot:e.dot,overlap:e.overlap,content:e.content,size:e.size,bottom:e.bottom,top:e.top,role:"status","aria-label":r.getAriaLabel,"aria-live":e.dot?"polite":"off",tabindex:"0"},{default:t.withCtx(()=>[t.renderSlot(a.$slots,"default",{},void 0,!0)]),_:3},8,["value","color","dot","overlap","content","size","bottom","top","aria-label","aria-live"])}const R=i(V,[["render",I],["__scopeId","data-v-02392152"]]),z={name:"RtSnackbar",props:{message:{type:String,default:"Hello, I'm a snackbar!"},timeout:{type:Number,default:6e3},buttonText:{type:String,default:"Open Snackbar"},buttonColor:{type:String,default:"primary"},snackbarColor:{type:String,default:""},actionButtonText:{type:String,default:"Close"},actionButtonColor:{type:String,default:"pink"}},data(){return{snackbar:!1}}},N={class:"text-center ma-2"};function T(a,n,e,o,l,r){const d=t.resolveComponent("v-btn"),c=t.resolveComponent("v-snackbar");return t.openBlock(),t.createElementBlock("div",N,[t.createVNode(d,{color:e.buttonColor,onClick:n[0]||(n[0]=s=>l.snackbar=!0)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.buttonText),1)]),_:1},8,["color"]),t.createVNode(c,{modelValue:l.snackbar,"onUpdate:modelValue":n[2]||(n[2]=s=>l.snackbar=s),timeout:e.timeout,color:e.snackbarColor},{actions:t.withCtx(()=>[t.createVNode(d,{color:e.actionButtonColor,variant:"text",onClick:n[1]||(n[1]=s=>l.snackbar=!1)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.actionButtonText),1)]),_:1},8,["color"])]),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.message)+" ",1)]),_:1},8,["modelValue","timeout","color"])])}const v=i(z,[["render",T],["__scopeId","data-v-75ce5462"]]),w={name:"RtImage",props:{src:{type:String,required:!0},alt:{type:String,required:!0},lazySrc:{type:String,default:""},aspectRatio:{type:[Number,String],default:null},gradient:{type:String,default:""},loading:{type:String,default:"lazy",validator:a=>["lazy","eager"].includes(a)},transition:{type:String,default:"fade-transition"},classes:{type:[String,Array,Object],default:()=>""}}};function L(a,n,e,o,l,r){const d=t.resolveComponent("v-img");return t.openBlock(),t.createBlock(d,{src:e.src,alt:e.alt,"lazy-src":e.lazySrc,"aspect-ratio":e.aspectRatio,gradient:e.gradient,loading:e.loading,transition:e.transition,class:t.normalizeClass(e.classes)},{placeholder:t.withCtx(()=>[t.renderSlot(a.$slots,"placeholder",{},()=>[n[0]||(n[0]=t.createTextVNode("Loading..."))],!0)]),default:t.withCtx(()=>[t.renderSlot(a.$slots,"default",{},void 0,!0)]),_:3},8,["src","alt","lazy-src","aspect-ratio","gradient","loading","transition","class"])}const A={name:"RtAvatar",components:{RtImage:i(w,[["render",L],["__scopeId","data-v-f3ff4550"]])},props:{avatarImage:{type:String,default:"https://randomuser.me/api/portraits/men/32.jpg"},alt:{type:String,default:"Alt"},ariaLabel:{type:String,default:"Aria Label"},name:{type:String,default:"Name"},size:{type:Number,default:50},rounded:{type:Number,default:1}},computed:{initials(){return this.name?this.name.split(" ").map(a=>a[0]).join("").toUpperCase():""}}},D={class:"avatar-wrapper"},j={key:1,class:"initials"};function E(a,n,e,o,l,r){const d=t.resolveComponent("RtImage"),c=t.resolveComponent("v-avatar");return t.openBlock(),t.createElementBlock("div",D,[t.createVNode(c,{size:e.size,class:"avatar",rounded:e.rounded,tabindex:"0",role:"img","aria-label":e.ariaLabel},{default:t.withCtx(()=>[e.avatarImage?(t.openBlock(),t.createBlock(d,{key:0,src:e.avatarImage,alt:e.alt},null,8,["src","alt"])):(t.openBlock(),t.createElementBlock("span",j,t.toDisplayString(r.initials),1))]),_:1},8,["size","rounded","aria-label"])])}const q=i(A,[["render",E],["__scopeId","data-v-0d49dde0"]]);return{install:(a,n)=>{a.component("LearnVueButton",p),a.component("InputTaras",y),a.component("RtText",S),a.component("RtButton",C),a.component("RtBadge",R),a.component("RtSnackbar",v),a.component("RtAvatar",q)}}});
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "readytech-ui-library-v2",
3
3
  "description": "ui library",
4
4
  "private": false,
5
- "version": "0.0.9",
5
+ "version": "0.0.11",
6
6
  "exports": {
7
7
  ".": {
8
8
  "import": "./dist/readytech-ui-library-v2.es.js",
@@ -17,14 +17,29 @@
17
17
  "scripts": {
18
18
  "dev": "vite",
19
19
  "build": "vite build",
20
- "preview": "vite preview"
20
+ "preview": "vite preview",
21
+ "storybook": "storybook dev -p 6006",
22
+ "build-storybook": "storybook build"
21
23
  },
22
24
  "dependencies": {
23
25
  "vue": "^3.5.13",
24
26
  "vuetify": "^3.7.16"
25
27
  },
26
28
  "devDependencies": {
29
+ "@chromatic-com/storybook": "^3.2.5",
30
+ "@storybook/addon-essentials": "^8.6.4",
31
+ "@storybook/addon-onboarding": "^8.6.4",
32
+ "@storybook/blocks": "^8.6.4",
33
+ "@storybook/experimental-addon-test": "^8.6.4",
34
+ "@storybook/test": "^8.6.4",
35
+ "@storybook/vue3": "^8.6.4",
36
+ "@storybook/vue3-vite": "^8.6.4",
27
37
  "@vitejs/plugin-vue": "^5.2.1",
28
- "vite": "^6.2.0"
38
+ "@vitest/browser": "^3.0.8",
39
+ "@vitest/coverage-v8": "^3.0.8",
40
+ "playwright": "^1.51.0",
41
+ "storybook": "^8.6.4",
42
+ "vite": "^6.2.0",
43
+ "vitest": "^3.0.8"
29
44
  }
30
45
  }