najm-kit 2.11.23 → 2.12.0

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +21 -12
  2. package/README.md +28 -1
  3. package/dist/NIcon-D73-C51g.d.ts +21 -0
  4. package/dist/{NNotFoundState-BmGDW2Bx.d.ts → NNotFoundState-Z2n2gbhS.d.ts} +1 -16
  5. package/dist/{NajmUIProvider-BwL5HFIV.d.ts → NajmUIProvider-C9IJW1ya.d.ts} +2 -19
  6. package/dist/adapters/app.d.ts +6 -4
  7. package/dist/adapters/app.mjs +9 -6
  8. package/dist/adapters/next.d.ts +2 -1
  9. package/dist/adapters/next.mjs +5 -3
  10. package/dist/chunk-5UY7U2ED.mjs +9 -0
  11. package/dist/chunk-A34LRQYI.mjs +7 -0
  12. package/dist/chunk-BFFTC7LD.mjs +66 -0
  13. package/dist/{chunk-5ZTOCWRA.mjs → chunk-F32O3WRX.mjs} +7 -197
  14. package/dist/chunk-FZX3DONZ.mjs +200 -0
  15. package/dist/chunk-GYPQLOQ5.mjs +2202 -0
  16. package/dist/{chunk-BDQK6ECA.mjs → chunk-LMW4DM5L.mjs} +43 -101
  17. package/dist/{chunk-DKHIQFXX.mjs → chunk-QDFLHSWO.mjs} +1 -1
  18. package/dist/{chunk-5JVFMOLI.mjs → chunk-QJ22WAQY.mjs} +2 -28
  19. package/dist/{chunk-LK3SMYUP.mjs → chunk-TZRTOQCC.mjs} +1 -6
  20. package/dist/chunk-VZXMMC72.mjs +31 -0
  21. package/dist/{chunk-M5VGBZ7R.mjs → chunk-WHGRN7PP.mjs} +2 -1
  22. package/dist/formFill-CQkTA0JS.d.ts +17 -0
  23. package/dist/index.d.ts +20 -436
  24. package/dist/index.mjs +338 -1950
  25. package/dist/json.mjs +5 -3
  26. package/dist/location/google.d.ts +14 -0
  27. package/dist/location/google.mjs +184 -0
  28. package/dist/location/index.d.ts +33 -0
  29. package/dist/location/index.mjs +9 -0
  30. package/dist/location/leaflet.d.ts +13 -0
  31. package/dist/location/leaflet.mjs +168 -0
  32. package/dist/theme.css +23 -2
  33. package/dist/types-BQBx0RZd.d.ts +578 -0
  34. package/package.json +30 -3
@@ -0,0 +1,200 @@
1
+ import { useResolvedFeedbackLabels } from './chunk-BFFTC7LD.mjs';
2
+ import { useNajmDesign } from './chunk-TZRTOQCC.mjs';
3
+ import { cn } from './chunk-5UY7U2ED.mjs';
4
+ import { LoaderCircleIcon, LoaderPinwheelIcon, LoaderIcon } from 'lucide-react';
5
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
+
7
+ var Default = ({ className, ...props }) => /* @__PURE__ */ jsx(LoaderIcon, { className: cn("animate-spin", className), ...props });
8
+ var Circle = ({ className, ...props }) => /* @__PURE__ */ jsx(LoaderCircleIcon, { className: cn("animate-spin", className), ...props });
9
+ var Pinwheel = ({ className, ...props }) => /* @__PURE__ */ jsx(LoaderPinwheelIcon, { className: cn("animate-spin", className), ...props });
10
+ var CircleFilled = ({ className, size = 24, ...props }) => /* @__PURE__ */ jsxs("div", { className: "relative", style: { width: size, height: size }, children: [
11
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 rotate-180", children: /* @__PURE__ */ jsx(LoaderCircleIcon, { className: cn("animate-spin", className, "text-foreground opacity-20"), size, ...props }) }),
12
+ /* @__PURE__ */ jsx(LoaderCircleIcon, { className: cn("relative animate-spin", className), size, ...props })
13
+ ] });
14
+ var Ellipsis = ({ size = 24, ...props }) => /* @__PURE__ */ jsxs("svg", { height: size, viewBox: "0 0 24 24", width: size, xmlns: "http://www.w3.org/2000/svg", ...props, children: [
15
+ /* @__PURE__ */ jsx("title", { children: "Loading..." }),
16
+ /* @__PURE__ */ jsx("circle", { cx: "4", cy: "12", fill: "currentColor", r: "2", children: /* @__PURE__ */ jsx("animate", { attributeName: "cy", begin: "0;ellipsis3.end+0.25s", calcMode: "spline", dur: "0.6s", id: "ellipsis1", keySplines: ".33,.66,.66,1;.33,0,.66,.33", values: "12;6;12" }) }),
17
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", fill: "currentColor", r: "2", children: /* @__PURE__ */ jsx("animate", { attributeName: "cy", begin: "ellipsis1.begin+0.1s", calcMode: "spline", dur: "0.6s", keySplines: ".33,.66,.66,1;.33,0,.66,.33", values: "12;6;12" }) }),
18
+ /* @__PURE__ */ jsx("circle", { cx: "20", cy: "12", fill: "currentColor", r: "2", children: /* @__PURE__ */ jsx("animate", { attributeName: "cy", begin: "ellipsis1.begin+0.2s", calcMode: "spline", dur: "0.6s", id: "ellipsis3", keySplines: ".33,.66,.66,1;.33,0,.66,.33", values: "12;6;12" }) })
19
+ ] });
20
+ var Ring = ({ size = 24, ...props }) => /* @__PURE__ */ jsxs("svg", { height: size, stroke: "currentColor", viewBox: "0 0 44 44", width: size, xmlns: "http://www.w3.org/2000/svg", ...props, children: [
21
+ /* @__PURE__ */ jsx("title", { children: "Loading..." }),
22
+ /* @__PURE__ */ jsxs("g", { fill: "none", fillRule: "evenodd", strokeWidth: "2", children: [
23
+ /* @__PURE__ */ jsxs("circle", { cx: "22", cy: "22", r: "1", children: [
24
+ /* @__PURE__ */ jsx("animate", { attributeName: "r", begin: "0s", calcMode: "spline", dur: "1.8s", keySplines: "0.165, 0.84, 0.44, 1", keyTimes: "0; 1", repeatCount: "indefinite", values: "1; 20" }),
25
+ /* @__PURE__ */ jsx("animate", { attributeName: "stroke-opacity", begin: "0s", calcMode: "spline", dur: "1.8s", keySplines: "0.3, 0.61, 0.355, 1", keyTimes: "0; 1", repeatCount: "indefinite", values: "1; 0" })
26
+ ] }),
27
+ /* @__PURE__ */ jsxs("circle", { cx: "22", cy: "22", r: "1", children: [
28
+ /* @__PURE__ */ jsx("animate", { attributeName: "r", begin: "-0.9s", calcMode: "spline", dur: "1.8s", keySplines: "0.165, 0.84, 0.44, 1", keyTimes: "0; 1", repeatCount: "indefinite", values: "1; 20" }),
29
+ /* @__PURE__ */ jsx("animate", { attributeName: "stroke-opacity", begin: "-0.9s", calcMode: "spline", dur: "1.8s", keySplines: "0.3, 0.61, 0.355, 1", keyTimes: "0; 1", repeatCount: "indefinite", values: "1; 0" })
30
+ ] })
31
+ ] })
32
+ ] });
33
+ var Bars = ({ size = 24, ...props }) => /* @__PURE__ */ jsxs("svg", { height: size, viewBox: "0 0 24 24", width: size, xmlns: "http://www.w3.org/2000/svg", ...props, children: [
34
+ /* @__PURE__ */ jsx("title", { children: "Loading..." }),
35
+ /* @__PURE__ */ jsx("rect", { fill: "currentColor", height: "4", rx: "1", width: "4", x: "1", y: "10", children: /* @__PURE__ */ jsx("animate", { attributeName: "opacity", begin: "0s", dur: "0.6s", keyTimes: "0;0.5;1", repeatCount: "indefinite", values: "1;0.3;1" }) }),
36
+ /* @__PURE__ */ jsx("rect", { fill: "currentColor", height: "4", rx: "1", width: "4", x: "10", y: "10", children: /* @__PURE__ */ jsx("animate", { attributeName: "opacity", begin: "0.1s", dur: "0.6s", keyTimes: "0;0.5;1", repeatCount: "indefinite", values: "1;0.3;1" }) }),
37
+ /* @__PURE__ */ jsx("rect", { fill: "currentColor", height: "4", rx: "1", width: "4", x: "19", y: "10", children: /* @__PURE__ */ jsx("animate", { attributeName: "opacity", begin: "0.2s", dur: "0.6s", keyTimes: "0;0.5;1", repeatCount: "indefinite", values: "1;0.3;1" }) })
38
+ ] });
39
+ var Infinite = ({ size = 24, ...props }) => /* @__PURE__ */ jsxs(
40
+ "svg",
41
+ {
42
+ height: size,
43
+ preserveAspectRatio: "xMidYMid",
44
+ viewBox: "0 0 100 100",
45
+ width: size,
46
+ xmlns: "http://www.w3.org/2000/svg",
47
+ ...props,
48
+ children: [
49
+ /* @__PURE__ */ jsx("title", { children: "Loading..." }),
50
+ /* @__PURE__ */ jsx(
51
+ "path",
52
+ {
53
+ d: "M24.3 30C11.4 30 5 43.3 5 50s6.4 20 19.3 20c19.3 0 32.1-40 51.4-40 C88.6 30 95 43.3 95 50s-6.4 20-19.3 20C56.4 70 43.6 30 24.3 30z",
54
+ fill: "none",
55
+ stroke: "currentColor",
56
+ strokeDasharray: "205.271142578125 51.317785644531256",
57
+ strokeLinecap: "round",
58
+ strokeWidth: "10",
59
+ style: { transform: "scale(0.8)", transformOrigin: "50px 50px" },
60
+ children: /* @__PURE__ */ jsx(
61
+ "animate",
62
+ {
63
+ attributeName: "stroke-dashoffset",
64
+ dur: "2s",
65
+ keyTimes: "0;1",
66
+ repeatCount: "indefinite",
67
+ values: "0;256.58892822265625"
68
+ }
69
+ )
70
+ }
71
+ )
72
+ ]
73
+ }
74
+ );
75
+ var spinnerVariants = {
76
+ default: Default,
77
+ circle: Circle,
78
+ pinwheel: Pinwheel,
79
+ "circle-filled": CircleFilled,
80
+ ellipsis: Ellipsis,
81
+ ring: Ring,
82
+ bars: Bars,
83
+ infinite: Infinite
84
+ };
85
+ function NSpinner({ variant = "default", size = 24, className, ...props }) {
86
+ const Component = spinnerVariants[variant] || Default;
87
+ return /* @__PURE__ */ jsx(Component, { className, size, ...props });
88
+ }
89
+ function NPageLayout({
90
+ as: Comp = "main",
91
+ className,
92
+ style,
93
+ ...props
94
+ }) {
95
+ const { layout } = useNajmDesign();
96
+ const pageGutter = layout?.pageGutter ?? "var(--page-gutter, 24px)";
97
+ const sectionGap = layout?.sectionGap ?? "var(--section-gap, 20px)";
98
+ return /* @__PURE__ */ jsx(
99
+ Comp,
100
+ {
101
+ className: cn("flex min-w-0 flex-col", className),
102
+ style: {
103
+ /**
104
+ * Published so descendants can cancel the page padding exactly. A
105
+ * full-bleed child (a non-card NPageHeader) cannot guess these: the
106
+ * design config resolves them to literals, not to the `--page-gutter`
107
+ * / `--section-gap` fallbacks.
108
+ */
109
+ "--najm-page-gutter": pageGutter,
110
+ "--najm-section-gap": sectionGap,
111
+ gap: sectionGap,
112
+ paddingInline: pageGutter,
113
+ paddingBlock: sectionGap,
114
+ ...style
115
+ },
116
+ ...props
117
+ }
118
+ );
119
+ }
120
+ var INLINE_PADDING = {
121
+ loading: "py-8",
122
+ error: "py-8",
123
+ empty: "py-12"
124
+ };
125
+ var PANEL_BASE = "flex min-h-64 w-full flex-col items-center justify-center gap-3";
126
+ var PAGE_MIN = "min-h-[60vh]";
127
+ function NFeedbackStateFrame({
128
+ surface = "inline",
129
+ spacing = "empty",
130
+ className,
131
+ children,
132
+ ...rest
133
+ }) {
134
+ if (surface === "page") {
135
+ return /* @__PURE__ */ jsx(
136
+ NPageLayout,
137
+ {
138
+ as: "div",
139
+ className: cn(
140
+ "items-center justify-center text-center",
141
+ PAGE_MIN,
142
+ className
143
+ ),
144
+ ...rest,
145
+ children
146
+ }
147
+ );
148
+ }
149
+ if (surface === "panel") {
150
+ return /* @__PURE__ */ jsx("div", { className: cn(PANEL_BASE, className), ...rest, children });
151
+ }
152
+ return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col items-center justify-center gap-3", INLINE_PADDING[spacing], className), ...rest, children });
153
+ }
154
+ function useLoadingLabel(explicit) {
155
+ const labels = useResolvedFeedbackLabels();
156
+ if (explicit !== void 0) return explicit;
157
+ return labels.loadingLabel;
158
+ }
159
+ function NLoadingState({
160
+ label,
161
+ className,
162
+ fullScreen = false,
163
+ spinnerVariant = "circle",
164
+ spinnerSize = 32,
165
+ surface = "inline"
166
+ }) {
167
+ const resolvedLabel = useLoadingLabel(label);
168
+ if (fullScreen) {
169
+ return /* @__PURE__ */ jsxs(
170
+ "div",
171
+ {
172
+ className: cn(
173
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm flex flex-col items-center justify-center gap-3 py-8",
174
+ className
175
+ ),
176
+ children: [
177
+ /* @__PURE__ */ jsx(NSpinner, { variant: spinnerVariant, size: spinnerSize }),
178
+ resolvedLabel && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: resolvedLabel })
179
+ ]
180
+ }
181
+ );
182
+ }
183
+ return /* @__PURE__ */ jsxs(
184
+ NFeedbackStateFrame,
185
+ {
186
+ surface,
187
+ spacing: "loading",
188
+ role: "status",
189
+ "aria-live": "polite",
190
+ "aria-busy": "true",
191
+ className,
192
+ children: [
193
+ /* @__PURE__ */ jsx(NSpinner, { variant: spinnerVariant, size: spinnerSize }),
194
+ resolvedLabel && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: resolvedLabel })
195
+ ]
196
+ }
197
+ );
198
+ }
199
+
200
+ export { NFeedbackStateFrame, NLoadingState, NPageLayout, NSpinner };