zabi-components 1.0.9 → 2.0.2

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/README.md CHANGED
@@ -4,7 +4,7 @@ A clean, minimal Svelte component library built with TypeScript and Tailwind CSS
4
4
 
5
5
  ## Philosophy
6
6
 
7
- **Clean & Simple**: No unnecessary complexity, just clean components that focus on what matters most. Every component is designed to be intuitive, accessible, and performant.
7
+ **Clean & Simple**: No unnecessary complexity, just clean components that focus on what matters most. Every component is designed to be intuitive, accessible, and performant. We've simplified everything to use modern CSS and minimal JavaScript.
8
8
 
9
9
  ## Features
10
10
 
@@ -12,11 +12,12 @@ A clean, minimal Svelte component library built with TypeScript and Tailwind CSS
12
12
  - 🎨 **Tailwind CSS Integration** - Built with Tailwind CSS for consistent styling
13
13
  - ♿ **Accessibility First** - ARIA compliant components with keyboard navigation support
14
14
  - 📱 **Responsive Design** - Mobile-first approach with responsive utilities
15
- - 🎭 **Dark Mode Support** - Built-in dark mode support with CSS custom properties
16
- - 🧩 **Clean API** - Simple, intuitive component APIs
15
+ - 🧩 **Clean API** - Simple, intuitive component APIs with minimal props
17
16
  - 📦 **Tree Shakeable** - Import only what you need
18
17
  - ✅ **Production Ready** - Fully tested and optimized for production use
19
- - 🚀 **Modern CSS** - Uses modern CSS features like Container Queries and CSS Grid
18
+ - 🚀 **Modern CSS** - CSS-only positioning, animations, and interactions
19
+ - ⚡ **Lightweight** - 60-80% less code than traditional component libraries
20
+ - 🎭 **Emoji Icons** - Simple emoji-based icons instead of complex SVG libraries
20
21
 
21
22
  ## Installation
22
23
 
@@ -114,26 +115,35 @@ import type { ButtonEvents, InputEvents } from 'zabi-components/types';
114
115
 
115
116
  | Component | Category | Description | Key Features |
116
117
  |-----------|----------|-------------|--------------|
117
- | **Card** | Atom | Clean card container | Interactive, elevated variants, semantic HTML |
118
- | **Form** | Molecule | Simple form wrapper | FormData handling, validation support |
119
- | **Layout** | Molecule | Page layout system | Header, main, footer slots, responsive |
120
- | **Navigation** | Organism | Clean navigation | Header/sidebar variants, keyboard nav |
121
- | **Button** | Atom | Action button | Multiple variants, loading states |
122
- | **Input** | Atom | Form input | Validation, error states, accessibility |
123
- | **Badge** | Atom | Status indicator | Color variants, closable |
124
- | **Alert** | Molecule | Notification | Dismissible, multiple variants |
125
- | **Modal** | Molecule | Overlay dialog | Focus trap, keyboard navigation |
126
- | **Tabs** | Molecule | Tab navigation | Keyboard navigation, ARIA compliant |
127
-
128
- ### Advanced Components
118
+ | **Card** | Atom | Clean card container | Simple, interactive, image support |
119
+ | **Form** | Molecule | Simple form wrapper | FormData handling, clean API |
120
+ | **Layout** | Molecule | Page layout system | Header, main, footer slots |
121
+ | **Navigation** | Organism | Clean navigation | Header/sidebar variants, active state |
122
+ | **Button** | Atom | Action button | 3 variants (primary, secondary, danger) |
123
+ | **Input** | Atom | Form input | Essential props, accessibility |
124
+ | **Badge** | Atom | Status indicator | 5 color variants, closable |
125
+ | **Modal** | Molecule | Overlay dialog | Simple backdrop, close button |
126
+ | **Tabs** | Molecule | Tab navigation | Keyboard navigation, 2 variants |
127
+ | **Dropdown** | Molecule | Dropdown menu | CSS-only positioning |
128
+ | **ImageUpload** | Molecule | File upload | Direct selection, preview |
129
+ | **Navbar** | Organism | Navigation bar | Mobile menu, responsive |
130
+
131
+ ### Simplified Components
129
132
 
130
133
  | Component | Category | Description | Key Features |
131
134
  |-----------|----------|-------------|--------------|
132
- | **KeyValueForm** | Molecule | Dynamic form builder | Field types, validation, TypeScript |
133
- | **ImageUpload** | Molecule | File upload | Drag & drop, preview, validation |
134
- | **Dropdown** | Molecule | Select dropdown | Search, keyboard navigation |
135
- | **ToastManager** | Organism | Toast notifications | Queue management, positioning |
136
- | **Navbar** | Organism | Navigation bar | Mobile menu, responsive |
135
+ | **Checkbox** | Atom | Checkbox input | Simple on/off state |
136
+ | **Select** | Atom | Dropdown select | Basic options support |
137
+ | **Textarea** | Atom | Multi-line input | Essential configuration |
138
+ | **Toggle** | Atom | Toggle switch | Fixed size, simple state |
139
+ | **Progress** | Atom | Progress bar | Percentage display |
140
+ | **Heading** | Atom | Text headings | 6 levels, clean styling |
141
+ | **ThemeToggle** | Atom | Theme switcher | Emoji-based, simple |
142
+ | **Toast** | Atom | Notification toast | Fixed position, basic |
143
+ | **Tooltip** | Atom | Hover tooltip | CSS-only positioning |
144
+ | **Skeleton** | Atom | Loading placeholder | Simple animation |
145
+ | **ColorPicker** | Atom | Color selection | Simple color grid |
146
+ | **SlideUp** | Molecule | Slide-up panel | CSS-only animations |
137
147
 
138
148
  ## Component API
139
149
 
@@ -718,7 +728,13 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
718
728
 
719
729
  ## Changelog
720
730
 
721
- ### v1.0.7 (Latest) - "Less is More" Edition
731
+ ### v1.1.1 (Latest) - "Enhanced Type Safety" Edition
732
+
733
+ #### 🔧 TypeScript Improvements
734
+ - **Enhanced Type Definitions**: Updated generated TypeScript definitions for better type safety
735
+ - **Improved Package Structure**: Enhanced package structure with improved type exports
736
+ - **Build Consistency**: Fixed build consistency and versioning across all generated files
737
+ - **Better Type Exports**: Improved TypeScript declaration file generation
722
738
 
723
739
  #### 🎯 Philosophy Change
724
740
  - **Clean & Simple**: Adopted "less is more" philosophy - removed unnecessary complexity
@@ -0,0 +1,222 @@
1
+ import { w as Q, x as D, y as Z, z as V, P as W, g as c, A as X, s as m, B as k, D as $, C as ee, E as te, F as re, v as ae, G as ne, H as se, I as ie, J as oe, K as le, S as z, L as N, M as g, N as x, O as M, i as Y, f as O, k as q, t as S, b as w, p as U, c as G, Q as E, m as P, d as R, h as A, o as K, R as F, a as L, n as T, q as fe } from "./store-ZmZCXeMy.js";
2
+ function pe(a, e) {
3
+ Q(() => {
4
+ var t = a.getRootNode(), r = (
5
+ /** @type {ShadowRoot} */
6
+ t.host ? (
7
+ /** @type {ShadowRoot} */
8
+ t
9
+ ) : (
10
+ /** @type {Document} */
11
+ t.head ?? /** @type {Document} */
12
+ t.ownerDocument.head
13
+ )
14
+ );
15
+ if (!r.querySelector("#" + e.hash)) {
16
+ const n = document.createElement("style");
17
+ n.id = e.hash, n.textContent = e.code, r.appendChild(n);
18
+ }
19
+ });
20
+ }
21
+ function he(a) {
22
+ return function(...e) {
23
+ var t = (
24
+ /** @type {Event} */
25
+ e[0]
26
+ );
27
+ return t.preventDefault(), a == null ? void 0 : a.apply(this, e);
28
+ };
29
+ }
30
+ const ue = {
31
+ get(a, e) {
32
+ let t = a.props.length;
33
+ for (; t--; ) {
34
+ let r = a.props[t];
35
+ if (g(r) && (r = r()), typeof r == "object" && r !== null && e in r) return r[e];
36
+ }
37
+ },
38
+ set(a, e, t) {
39
+ let r = a.props.length;
40
+ for (; r--; ) {
41
+ let n = a.props[r];
42
+ g(n) && (n = n());
43
+ const i = D(n, e);
44
+ if (i && i.set)
45
+ return i.set(t), !0;
46
+ }
47
+ return !1;
48
+ },
49
+ getOwnPropertyDescriptor(a, e) {
50
+ let t = a.props.length;
51
+ for (; t--; ) {
52
+ let r = a.props[t];
53
+ if (g(r) && (r = r()), typeof r == "object" && r !== null && e in r) {
54
+ const n = D(r, e);
55
+ return n && !n.configurable && (n.configurable = !0), n;
56
+ }
57
+ }
58
+ },
59
+ has(a, e) {
60
+ if (e === z || e === N) return !1;
61
+ for (let t of a.props)
62
+ if (g(t) && (t = t()), t != null && e in t) return !0;
63
+ return !1;
64
+ },
65
+ ownKeys(a) {
66
+ const e = [];
67
+ for (let t of a.props)
68
+ if (g(t) && (t = t()), !!t) {
69
+ for (const r in t)
70
+ e.includes(r) || e.push(r);
71
+ for (const r of Object.getOwnPropertySymbols(t))
72
+ e.includes(r) || e.push(r);
73
+ }
74
+ return e;
75
+ }
76
+ };
77
+ function ge(...a) {
78
+ return new Proxy({ props: a }, ue);
79
+ }
80
+ function p(a, e, t, r) {
81
+ var j;
82
+ var n = !ne || (t & se) !== 0, i = (t & re) !== 0, v = (t & oe) !== 0, l = (
83
+ /** @type {V} */
84
+ r
85
+ ), b = !0, f = () => (b && (b = !1, l = v ? ae(
86
+ /** @type {() => V} */
87
+ r
88
+ ) : (
89
+ /** @type {V} */
90
+ r
91
+ )), l), u;
92
+ if (i) {
93
+ var I = z in a || N in a;
94
+ u = ((j = D(a, e)) == null ? void 0 : j.set) ?? (I && e in a ? (s) => a[e] = s : void 0);
95
+ }
96
+ var o, d = !1;
97
+ i ? [o, d] = Z(() => (
98
+ /** @type {V} */
99
+ a[e]
100
+ )) : o = /** @type {V} */
101
+ a[e], o === void 0 && r !== void 0 && (o = f(), u && (n && V(), u(o)));
102
+ var _;
103
+ if (n ? _ = () => {
104
+ var s = (
105
+ /** @type {V} */
106
+ a[e]
107
+ );
108
+ return s === void 0 ? f() : (b = !0, s);
109
+ } : _ = () => {
110
+ var s = (
111
+ /** @type {V} */
112
+ a[e]
113
+ );
114
+ return s !== void 0 && (l = /** @type {V} */
115
+ void 0), s === void 0 ? l : s;
116
+ }, n && (t & W) === 0)
117
+ return _;
118
+ if (u) {
119
+ var H = a.$$legacy;
120
+ return (
121
+ /** @type {() => V} */
122
+ (function(s, y) {
123
+ return arguments.length > 0 ? ((!n || !y || H || d) && u(y ? _() : s), s) : _();
124
+ })
125
+ );
126
+ }
127
+ var C = !1, h = ((t & ie) !== 0 ? ee : te)(() => (C = !1, _()));
128
+ i && c(h);
129
+ var J = (
130
+ /** @type {Effect} */
131
+ k
132
+ );
133
+ return (
134
+ /** @type {() => V} */
135
+ (function(s, y) {
136
+ if (arguments.length > 0) {
137
+ const B = y ? c(h) : n && i ? X(s) : s;
138
+ return m(h, B), C = !0, l !== void 0 && (l = B), s;
139
+ }
140
+ return le && C || (J.f & $) !== 0 ? h.v : c(h);
141
+ })
142
+ );
143
+ }
144
+ var de = O("<button><!></button>");
145
+ function me(a, e) {
146
+ G(e, !1);
147
+ const t = P(), r = P(), n = P();
148
+ let i = p(e, "variant", 8, "primary"), v = p(e, "size", 8, "md"), l = p(e, "disabled", 8, !1), b = p(e, "type", 8, "button");
149
+ x(() => {
150
+ }, () => {
151
+ m(t, {
152
+ sm: "px-3 py-1.5 text-sm",
153
+ md: "px-4 py-2 text-sm",
154
+ lg: "px-5 py-3 text-base"
155
+ });
156
+ }), x(() => {
157
+ }, () => {
158
+ m(r, {
159
+ primary: "bg-blue-600 text-white hover:bg-blue-700",
160
+ secondary: "bg-gray-600 text-white hover:bg-gray-700",
161
+ danger: "bg-red-600 text-white hover:bg-red-700"
162
+ });
163
+ }), x(
164
+ () => (c(t), E(v()), c(r), E(i())),
165
+ () => {
166
+ m(n, [
167
+ "inline-flex items-center justify-center font-medium rounded-md",
168
+ "disabled:opacity-50 disabled:cursor-not-allowed",
169
+ c(t)[v()],
170
+ c(r)[i()]
171
+ ].join(" "));
172
+ }
173
+ ), M(), Y();
174
+ var f = de(), u = R(f);
175
+ q(u, e, "default", {}), S(() => {
176
+ A(f, "type", b()), K(f, 1, F(c(n))), f.disabled = l();
177
+ }), w(a, f), U();
178
+ }
179
+ var ce = O('<img class="w-full h-48 object-cover rounded-md mb-4"/>'), ve = O('<h3 class="text-lg font-semibold mb-2"> </h3>'), _e = O("<div><!> <!> <!></div>");
180
+ function ye(a, e) {
181
+ G(e, !1);
182
+ const t = P();
183
+ let r = p(e, "title", 8, ""), n = p(e, "image", 8, ""), i = p(e, "interactive", 8, !1);
184
+ x(() => E(i()), () => {
185
+ m(t, [
186
+ "bg-white border border-gray-200 rounded-lg p-4",
187
+ i() ? "cursor-pointer hover:shadow-md" : ""
188
+ ].join(" "));
189
+ }), M(), Y();
190
+ var v = _e(), l = R(v);
191
+ {
192
+ var b = (o) => {
193
+ var d = ce();
194
+ S(() => {
195
+ A(d, "src", n()), A(d, "alt", r());
196
+ }), w(o, d);
197
+ };
198
+ L(l, (o) => {
199
+ n() && o(b);
200
+ });
201
+ }
202
+ var f = T(l, 2);
203
+ {
204
+ var u = (o) => {
205
+ var d = ve(), _ = R(d);
206
+ S(() => fe(_, r())), w(o, d);
207
+ };
208
+ L(f, (o) => {
209
+ r() && o(u);
210
+ });
211
+ }
212
+ var I = T(f, 2);
213
+ q(I, e, "default", {}), S(() => K(v, 1, F(c(t)))), w(a, v), U();
214
+ }
215
+ export {
216
+ me as B,
217
+ ye as C,
218
+ he as a,
219
+ pe as b,
220
+ p,
221
+ ge as s
222
+ };
@@ -0,0 +1,81 @@
1
+ import { j as G, i as H, f as p, k as _, a as C, t as D, e as M, b as c, p as I, l as J, c as K, d as a, n, g as t, m as ia, o as h, q as L, s as na, r as oa, u as da, h as la, v as j } from "./store-ZmZCXeMy.js";
2
+ import { createEventDispatcher as Q } from "svelte";
3
+ import { T as F } from "./ThemeToggle-CRI92cOb.js";
4
+ var ca = p('<div class="mt-2"><!></div>'), pa = p('<div class="md:hidden"><div class="px-2 pt-2 pb-3 space-y-1 sm:px-3 border-t border-gray-200"><!> <div class="pt-4"><!> <!></div></div></div>'), ua = p('<nav><div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"><div class="flex justify-between items-center h-16"><div class="flex-shrink-0"><button type="button" class="text-xl font-bold text-gray-900"> </button></div> <div class="hidden md:block"><div class="ml-10 flex items-baseline space-x-4"><!></div></div> <div class="hidden md:block"><div class="ml-4 flex items-center space-x-4"><!> <!></div></div> <div class="md:hidden"><button type="button" class="text-gray-500 hover:text-gray-600" aria-label="Toggle menu"><span class="text-2xl">☰</span></button></div></div> <!></div></nav>');
5
+ function ga(g, r) {
6
+ K(r, !1);
7
+ const m = () => G(props, "$props", y), [y, k] = J();
8
+ let { brand: u = "", showThemeToggle: b = !0, className: $ = "" } = m()();
9
+ const T = Q();
10
+ let o = ia(!1);
11
+ function d() {
12
+ na(o, !t(o));
13
+ }
14
+ function f() {
15
+ T("brandClick");
16
+ }
17
+ H();
18
+ var s = ua(), e = a(s), l = a(e), v = a(l), x = a(v), w = a(x), q = n(v, 2), R = a(q), S = a(R);
19
+ _(S, r, "nav", {});
20
+ var z = n(q, 2), U = a(z), B = a(U);
21
+ _(B, r, "actions", {});
22
+ var V = n(B, 2);
23
+ {
24
+ var W = (i) => {
25
+ F(i, {});
26
+ };
27
+ C(V, (i) => {
28
+ b && i(W);
29
+ });
30
+ }
31
+ var X = n(z, 2), Y = a(X), Z = n(l, 2);
32
+ {
33
+ var aa = (i) => {
34
+ var E = pa(), ea = a(E), O = a(ea);
35
+ _(O, r, "nav", {});
36
+ var ta = n(O, 2), P = a(ta);
37
+ _(P, r, "actions", {});
38
+ var sa = n(P, 2);
39
+ {
40
+ var ra = (N) => {
41
+ var A = ca(), va = a(A);
42
+ F(va, {}), c(N, A);
43
+ };
44
+ C(sa, (N) => {
45
+ b && N(ra);
46
+ });
47
+ }
48
+ c(i, E);
49
+ };
50
+ C(Z, (i) => {
51
+ t(o) && i(aa);
52
+ });
53
+ }
54
+ D(() => {
55
+ h(s, 1, `bg-white border-b border-gray-200 sticky top-0 z-50 ${$ ?? ""}`), L(w, u);
56
+ }), M("click", x, f), M("click", Y, d), c(g, s), I(), k();
57
+ }
58
+ var ba = p("<li><a> </a></li>"), fa = p("<nav><ul></ul></nav>");
59
+ function ma(g, r) {
60
+ K(r, !1);
61
+ const m = () => G(props, "$props", y), [y, k] = J();
62
+ let { variant: u = "header", items: b = [], currentPath: $ = "" } = m()();
63
+ const T = Q();
64
+ function o(s, e) {
65
+ e.preventDefault(), T("navigate", { item: s, href: s.href });
66
+ }
67
+ H();
68
+ var d = fa(), f = a(d);
69
+ oa(f, 5, () => b, da, (s, e) => {
70
+ var l = ba(), v = a(l), x = a(v);
71
+ D(() => {
72
+ la(v, "href", (t(e), j(() => t(e).href))), h(v, 1, `px-3 py-2 text-sm font-medium rounded-md transition-colors ${t(e), j(() => $ === t(e).href ? "bg-blue-100 text-blue-700" : "text-gray-600 hover:text-gray-900 hover:bg-gray-100") ?? ""}`), L(x, (t(e), j(() => t(e).label)));
73
+ }), M("click", v, (w) => o(t(e), w)), c(s, l);
74
+ }), D(() => {
75
+ h(d, 1, `navigation navigation-${u ?? ""}`), h(f, 1, `flex ${u === "sidebar" ? "flex-col space-y-2" : "space-x-6"}`);
76
+ }), c(g, d), I(), k();
77
+ }
78
+ export {
79
+ ga as N,
80
+ ma as a
81
+ };