@septkit/ui 0.0.1 → 0.0.3

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
@@ -1,38 +1,40 @@
1
1
  @plugin "daisyui" {
2
- themes: spark --default;
2
+ themes: spark --default;
3
3
  }
4
4
 
5
5
  @plugin "daisyui/theme" {
6
- name: 'spark';
7
- default: true;
8
- prefersdark: false;
9
- color-scheme: 'light';
10
- --color-base-100: oklch(98% 0 0);
11
- --color-base-200: oklch(97% 0 0);
12
- --color-base-300: oklch(92% 0 0);
13
- --color-base-content: oklch(37% 0 0);
14
- --color-primary: oklch(70% 0.213 47.604);
15
- --color-primary-content: oklch(97% 0.013 17.38);
16
- --color-secondary: oklch(95% 0.038 75.164);
17
- --color-secondary-content: oklch(66% 0.179 58.318);
18
- --color-accent: oklch(60% 0.118 184.704);
19
- --color-accent-content: oklch(98% 0.001 106.423);
20
- --color-neutral: oklch(55% 0.013 58.071);
21
- --color-neutral-content: oklch(98% 0.031 120.757);
22
- --color-info: oklch(70% 0.165 254.624);
23
- --color-info-content: oklch(98% 0.001 106.423);
24
- --color-success: oklch(72% 0.219 149.579);
25
- --color-success-content: oklch(98% 0.001 106.423);
26
- --color-warning: oklch(87% 0.169 91.605);
27
- --color-warning-content: oklch(98% 0.001 106.423);
28
- --color-error: oklch(63% 0.237 25.331);
29
- --color-error-content: oklch(98% 0.001 106.423);
30
- --radius-selector: 0.25rem;
31
- --radius-field: 0.25rem;
32
- --radius-box: 0.25rem;
33
- --size-selector: 0.21875rem;
34
- --size-field: 0.21875rem;
35
- --border: 1.5px;
36
- --depth: 1;
37
- --noise: 1;
6
+ name: 'spark';
7
+ default: true;
8
+ prefersdark: false;
9
+ color-scheme: 'light';
10
+ --color-base-100: oklch(98% 0 0);
11
+ --color-base-200: oklch(97% 0 0);
12
+ --color-base-300: oklch(92% 0 0);
13
+ --color-base-content: oklch(37% 0 0);
14
+ --color-primary: oklch(70% 0.213 47.604);
15
+ --color-primary-content: oklch(97% 0.013 17.38);
16
+ --color-secondary: oklch(95% 0.038 75.164);
17
+ --color-secondary-content: oklch(66% 0.179 58.318);
18
+ --color-accent: oklch(60% 0.118 184.704);
19
+ --color-accent-content: oklch(98% 0.001 106.423);
20
+ --color-neutral: oklch(55% 0.013 58.071);
21
+ --color-neutral-content: oklch(98% 0.031 120.757);
22
+ --color-info: oklch(70% 0.165 254.624);
23
+ --color-info-content: oklch(98% 0.001 106.423);
24
+ --color-success: oklch(72% 0.219 149.579);
25
+ --color-success-content: oklch(98% 0.001 106.423);
26
+ --color-warning: oklch(87% 0.169 91.605);
27
+ --color-warning-content: oklch(98% 0.001 106.423);
28
+ --color-error: oklch(63% 0.237 25.331);
29
+ --color-error-content: oklch(98% 0.001 106.423);
30
+ --radius-selector: 0.25rem;
31
+ --radius-field: 0.25rem;
32
+ --radius-box: 0.25rem;
33
+ --size-selector: 0.21875rem;
34
+ --size-field: 0.21875rem;
35
+ --border: 1.5px;
36
+ --depth: 1;
37
+ --noise: 1;
38
+
39
+ --border-color: var(--color-base-content);
38
40
  }
@@ -1,9 +1,9 @@
1
- import { defineComponent as w, useTemplateRef as g, ref as y, computed as o, createElementBlock as a, openBlock as d, createElementVNode as k, withDirectives as h, normalizeClass as z, withModifiers as C, renderSlot as l, unref as O } from "vue";
2
- import { VOnClickOutside as S } from "../external/.pnpm/@vueuse_components@13.5.0_vue@3.5.17_typescript@5.8.3_/node_modules/@vueuse/components/index.js";
3
- const B = ["open"], _ = {
1
+ import { defineComponent as h, useTemplateRef as k, ref as _, computed as t, createElementBlock as l, openBlock as r, createElementVNode as z, withDirectives as C, normalizeClass as O, withModifiers as S, renderSlot as a, 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
4
  "data-testid": "dropdown-menu",
5
5
  class: "menu dropdown-content bg-base-100 z-1 w-52 p-2 shadow-sm"
6
- }, D = /* @__PURE__ */ w({
6
+ }, $ = /* @__PURE__ */ h({
7
7
  __name: "dropdown",
8
8
  props: {
9
9
  color: {},
@@ -11,10 +11,12 @@ const B = ["open"], _ = {
11
11
  size: {},
12
12
  active: { type: Boolean },
13
13
  disabled: { type: Boolean },
14
- modifier: {}
14
+ modifier: {},
15
+ id: {}
15
16
  },
16
- setup(r, { expose: c }) {
17
- const n = r, s = g("details-ref"), e = y(!1), u = o(
17
+ emits: ["open", "close"],
18
+ setup(c, { expose: u, emit: p }) {
19
+ const n = c, d = p, i = k("details-ref"), e = _(!1), b = t(
18
20
  () => ({
19
21
  neutral: "btn-neutral",
20
22
  primary: "btn-primary",
@@ -26,7 +28,7 @@ const B = ["open"], _ = {
26
28
  error: "btn-error",
27
29
  undefined: ""
28
30
  })[n.color ?? "undefined"]
29
- ), b = o(
31
+ ), f = t(
30
32
  () => ({
31
33
  outline: "btn-outline",
32
34
  dash: "btn-dash",
@@ -35,7 +37,7 @@ const B = ["open"], _ = {
35
37
  link: "btn-link",
36
38
  undefined: ""
37
39
  })[n.variant ?? "undefined"]
38
- ), f = o(
40
+ ), m = t(
39
41
  () => ({
40
42
  xs: "btn-xs",
41
43
  sm: "btn-sm",
@@ -44,7 +46,7 @@ const B = ["open"], _ = {
44
46
  xl: "btn-xl",
45
47
  undefined: ""
46
48
  })[n.size ?? "undefined"]
47
- ), p = o(
49
+ ), g = t(
48
50
  () => ({
49
51
  wide: "btn-wide",
50
52
  block: "btn-block",
@@ -53,50 +55,57 @@ const B = ["open"], _ = {
53
55
  undefined: ""
54
56
  })[n.modifier ?? "undefined"]
55
57
  );
56
- function m() {
57
- s.value && (s.value.open = e.value);
58
- }
59
58
  function v() {
60
- e.value = !1;
59
+ i.value && (i.value.open = e.value);
60
+ }
61
+ function s() {
62
+ e.value = !1, d("close");
63
+ }
64
+ function w() {
65
+ console.debug({ level: "debug", msg: "opening dropdown" }), e.value = !0, d("open");
66
+ }
67
+ function y() {
68
+ console.debug({ level: "debug", msg: "toggle dropdown" }), e.value ? s() : w();
61
69
  }
62
- return c({
70
+ return u({
63
71
  /** Method to close the dropdown */
64
- close: v,
72
+ close: s,
65
73
  /** Reactive boolean of the dropdown state */
66
- isOpen: e
67
- }), (t, i) => (d(), a("details", {
74
+ isOpen: e,
75
+ id: n.id
76
+ }), (o, E) => (r(), l("details", {
68
77
  "data-testid": "dropdown-wrapper",
69
78
  ref: "details-ref",
70
79
  class: "dropdown",
71
80
  open: e.value,
72
- onToggle: m
81
+ onToggle: v
73
82
  }, [
74
- k("summary", {
83
+ z("summary", {
75
84
  "data-testid": "dropdown-trigger",
76
- onClick: i[0] || (i[0] = C((x) => e.value = !e.value, ["stop"])),
77
- class: z(["btn", [
78
- u.value,
85
+ onClick: S(y, ["stop"]),
86
+ class: O(["btn", [
79
87
  b.value,
80
88
  f.value,
81
- p.value,
82
- { "btn-active": t.active, "btn-disabled": t.disabled }
89
+ m.value,
90
+ g.value,
91
+ { "btn-active": o.active, "btn-disabled": o.disabled }
83
92
  ]])
84
93
  }, [
85
- l(t.$slots, "label")
94
+ a(o.$slots, "label")
86
95
  ], 2),
87
- h((d(), a("ul", _, [
88
- l(t.$slots, "items")
96
+ C((r(), l("ul", q, [
97
+ a(o.$slots, "items")
89
98
  ])), [
90
99
  [
91
- O(S),
92
- () => e.value = !1,
100
+ B(D),
101
+ s,
93
102
  void 0,
94
103
  { bubble: !0 }
95
104
  ]
96
105
  ])
97
- ], 40, B));
106
+ ], 40, x));
98
107
  }
99
108
  });
100
109
  export {
101
- D as default
110
+ $ as default
102
111
  };
package/dist/index.d.ts CHANGED
@@ -11,7 +11,14 @@ declare const __VLS_component_2: DefineComponent<__VLS_Props_2, {
11
11
  close: typeof closeDropdown;
12
12
  /** Reactive boolean of the dropdown state */
13
13
  isOpen: Ref<boolean, boolean>;
14
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
14
+ id: string | undefined;
15
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
16
+ open: (...args: any[]) => void;
17
+ close: (...args: any[]) => void;
18
+ }, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
19
+ onOpen?: ((...args: any[]) => any) | undefined;
20
+ onClose?: ((...args: any[]) => any) | undefined;
21
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
15
22
  'details-ref': HTMLDetailsElement;
16
23
  }, HTMLDetailsElement>;
17
24
 
@@ -37,6 +44,7 @@ declare type __VLS_Props_2 = {
37
44
  disabled?: boolean;
38
45
  /** Trigger modifier */
39
46
  modifier?: 'wide' | 'block' | 'square' | 'circle';
47
+ id?: string;
40
48
  };
41
49
 
42
50
  declare function __VLS_template(): {
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@septkit/ui",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "source": "lib/index.ts",
6
6
  "scripts": {
7
7
  "dev": "storybook dev -p 6006",
8
8
  "//====== BUILD ======//": "",
9
- "build": "run-p type-check \"build-only {@}\" -- && pnpm run copy-tailwind-config",
9
+ "build": "run-p type-check \"build-only {@}\" --",
10
+ "build:watch": "vite build --watch",
10
11
  "preview": "vite preview",
11
12
  "build-only": "vite build",
12
13
  "copy-tailwind-config": "cp ./lib/assets/config.css ./dist/config.css",
@@ -37,6 +38,7 @@
37
38
  "@vueuse/core": "^13.5.0",
38
39
  "pinia": "^3.0.3",
39
40
  "tailwindcss": "^4.1.11",
41
+ "vite-plugin-static-copy": "^3.1.1",
40
42
  "vue": "^3.5.17"
41
43
  },
42
44
  "devDependencies": {
@@ -73,4 +75,4 @@
73
75
  "daisyui": "^5.0.0",
74
76
  "tailwindcss": "^4.0.0"
75
77
  }
76
- }
78
+ }