@septkit/ui 0.0.8 → 0.0.10

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/config.css CHANGED
@@ -36,7 +36,7 @@
36
36
  --depth: 1;
37
37
  --noise: 1;
38
38
 
39
- --border-color: var(--color-base-content);
39
+ --border-color: var(--color-base-300);
40
40
  }
41
41
 
42
42
  :root {
@@ -1,9 +1,6 @@
1
- import { defineComponent as h, useTemplateRef as k, ref as _, computed as o, createElementBlock as l, openBlock as a, createElementVNode as z, withDirectives as C, normalizeClass as O, withModifiers as S, renderSlot as r, unref as B } from "vue";
2
- import { VOnClickOutside as D } from "../external/.pnpm/@vueuse_components@13.5.0_vue@3.5.17_typescript@5.8.3_/node_modules/@vueuse/components/index.js";
3
- const x = ["open"], q = {
4
- "data-testid": "dropdown-menu",
5
- class: "menu dropdown-content bg-base-100 z-1 w-52 p-2 shadow-sm"
6
- }, $ = /* @__PURE__ */ h({
1
+ import { defineComponent as z, useTemplateRef as S, ref as C, computed as n, createElementBlock as i, openBlock as c, createElementVNode as O, withDirectives as B, normalizeClass as l, withModifiers as D, renderSlot as d, unref as _ } from "vue";
2
+ import { VOnClickOutside as x } from "../external/.pnpm/@vueuse_components@13.5.0_vue@3.5.17_typescript@5.8.3_/node_modules/@vueuse/components/index.js";
3
+ const q = ["open"], $ = /* @__PURE__ */ z({
7
4
  __name: "dropdown",
8
5
  props: {
9
6
  color: {},
@@ -12,98 +9,101 @@ const x = ["open"], q = {
12
9
  active: { type: Boolean },
13
10
  disabled: { type: Boolean },
14
11
  modifier: {},
12
+ background: {},
15
13
  id: {}
16
14
  },
17
15
  emits: ["open", "close"],
18
- setup(c, { expose: u, emit: p }) {
19
- const n = c, i = p, d = k("details-ref"), e = _(!1), b = o(
20
- () => ({
21
- neutral: "btn-neutral",
22
- primary: "btn-primary",
23
- secondary: "btn-secondary",
24
- accent: "btn-accent",
25
- info: "btn-info",
26
- success: "btn-success",
27
- warning: "btn-warning",
28
- error: "btn-error",
29
- undefined: ""
30
- })[n.color ?? "undefined"]
31
- ), f = o(
32
- () => ({
33
- outline: "btn-outline",
34
- dash: "btn-dash",
35
- soft: "btn-soft",
36
- ghost: "btn-ghost",
37
- link: "btn-link",
38
- undefined: ""
39
- })[n.variant ?? "undefined"]
40
- ), m = o(
41
- () => ({
42
- xs: "btn-xs",
43
- sm: "btn-sm",
44
- md: "btn-md",
45
- lg: "btn-lg",
46
- xl: "btn-xl",
47
- undefined: ""
48
- })[n.size ?? "undefined"]
49
- ), v = o(
50
- () => ({
51
- wide: "btn-wide",
52
- block: "btn-block",
53
- square: "btn-square",
54
- circle: "btn-circle",
55
- undefined: ""
56
- })[n.modifier ?? "undefined"]
57
- );
58
- function w() {
59
- d.value && (d.value.open = e.value);
16
+ setup(b, { expose: u, emit: p }) {
17
+ const e = b, a = p, s = S("details-ref"), o = C(!1), g = n(() => ({
18
+ "bg-neutral": e.background === "neutral",
19
+ "bg-primary": e.background === "primary",
20
+ "bg-secondary": e.background === "secondary",
21
+ "bg-accent": e.background === "accent",
22
+ "bg-info": e.background === "info",
23
+ "bg-success": e.background === "success",
24
+ "bg-warning": e.background === "warning",
25
+ "bg-error": e.background === "error",
26
+ "bg-base-100": e.background === "base",
27
+ "bg-white": !e.background
28
+ })), m = n(() => ({
29
+ "btn-neutral": e.color === "neutral" || !e.color,
30
+ "btn-primary": e.color === "primary",
31
+ "btn-secondary": e.color === "secondary",
32
+ "btn-accent": e.color === "accent",
33
+ "btn-info": e.color === "info",
34
+ "btn-success": e.color === "success",
35
+ "btn-warning": e.color === "warning",
36
+ "btn-error": e.color === "error"
37
+ })), f = n(() => ({
38
+ "btn-outline": e.variant === "outline",
39
+ "btn-dash": e.variant === "dash",
40
+ "btn-soft": e.variant === "soft",
41
+ "btn-ghost": e.variant === "ghost" || !e.variant,
42
+ "btn-link": e.variant === "link"
43
+ })), v = n(() => ({
44
+ "btn-xs": e.size === "xs",
45
+ "btn-sm": e.size === "sm" || !e.size,
46
+ "btn-md": e.size === "md",
47
+ "btn-lg": e.size === "lg",
48
+ "btn-xl": e.size === "xl"
49
+ })), w = n(() => ({
50
+ "btn-wide": e.modifier === "wide" || !e.modifier,
51
+ "btn-block": e.modifier === "block",
52
+ "btn-square": e.modifier === "square",
53
+ "btn-circle": e.modifier === "circle"
54
+ }));
55
+ function k() {
56
+ s.value && (s.value.open = o.value);
60
57
  }
61
- function s() {
62
- e.value = !1, i("close");
63
- }
64
- function g() {
65
- e.value = !0, i("open");
58
+ function r() {
59
+ o.value = !1, a("close");
66
60
  }
67
61
  function y() {
68
- e.value ? s() : g();
62
+ o.value = !0, a("open");
63
+ }
64
+ function h() {
65
+ o.value ? r() : y();
69
66
  }
70
67
  return u({
71
68
  /** Method to close the dropdown */
72
- close: s,
69
+ close: r,
73
70
  /** Reactive boolean of the dropdown state */
74
- isOpen: e,
75
- id: n.id
76
- }), (t, E) => (a(), l("details", {
71
+ isOpen: o,
72
+ id: e.id
73
+ }), (t, E) => (c(), i("details", {
77
74
  "data-testid": "dropdown-wrapper",
78
75
  ref: "details-ref",
79
76
  class: "dropdown",
80
- open: e.value,
81
- onToggle: w
77
+ open: o.value,
78
+ onToggle: k
82
79
  }, [
83
- z("summary", {
80
+ O("summary", {
84
81
  "data-testid": "dropdown-trigger",
85
- onClick: S(y, ["stop"]),
86
- class: O(["btn", [
87
- b.value,
88
- f.value,
82
+ onClick: D(h, ["stop"]),
83
+ class: l(["btn", [
89
84
  m.value,
85
+ f.value,
90
86
  v.value,
87
+ w.value,
91
88
  { "btn-active": t.active, "btn-disabled": t.disabled }
92
89
  ]])
93
90
  }, [
94
- r(t.$slots, "label")
91
+ d(t.$slots, "label")
95
92
  ], 2),
96
- C((a(), l("ul", q, [
97
- r(t.$slots, "items")
98
- ])), [
93
+ B((c(), i("ul", {
94
+ "data-testid": "dropdown-menu",
95
+ class: l([[g.value], "menu dropdown-content z-1 w-52 p-2 shadow-sm"])
96
+ }, [
97
+ d(t.$slots, "items")
98
+ ], 2)), [
99
99
  [
100
- B(D),
101
- s,
100
+ _(x),
101
+ r,
102
102
  void 0,
103
103
  { bubble: !0 }
104
104
  ]
105
105
  ])
106
- ], 40, x));
106
+ ], 40, q));
107
107
  }
108
108
  });
109
109
  export {
package/dist/index.d.ts CHANGED
@@ -45,6 +45,8 @@ declare type __VLS_Props_2 = {
45
45
  disabled?: boolean;
46
46
  /** Trigger modifier */
47
47
  modifier?: 'wide' | 'block' | 'square' | 'circle';
48
+ /** Menu background */
49
+ background?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | 'base' | 'white';
48
50
  id?: string;
49
51
  };
50
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@septkit/ui",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "source": "lib/index.ts",
6
6
  "scripts": {