@foundrykit/blocks 1.0.23 → 1.0.25

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.
@@ -0,0 +1,18 @@
1
+
2
+ 
3
+ > @foundrykit/blocks@1.0.24 build /Users/isj/Desktop/work/projects/foundry/packages/blocks
4
+ > tsup
5
+
6
+ CLI Building entry: src/index.ts
7
+ CLI Using tsconfig: tsconfig.json
8
+ CLI tsup v8.5.0
9
+ CLI Using tsup config: /Users/isj/Desktop/work/projects/foundry/packages/blocks/tsup.config.ts
10
+ CLI Target: es2022
11
+ CLI Cleaning output folder
12
+ ESM Build start
13
+ ESM dist/index.js 7.08 KB
14
+ ESM dist/index.js.map 10.90 KB
15
+ ESM ⚡️ Build success in 231ms
16
+ DTS Build start
17
+ DTS ⚡️ Build success in 3781ms
18
+ DTS dist/index.d.ts 1.36 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @foundrykit/blocks
2
2
 
3
+ ## 1.0.25
4
+
5
+ ### Patch Changes
6
+
7
+ - Updating maps
8
+ - Updated dependencies
9
+ - @foundrykit/maps@1.0.1
10
+
11
+ ## 1.0.24
12
+
13
+ ### Patch Changes
14
+
15
+ - Just a quick demo for Anvar
16
+ - Updated dependencies
17
+ - @foundrykit/animation@1.0.9
18
+ - @foundrykit/components@1.0.23
19
+ - @foundrykit/primitives@1.0.14
20
+ - @foundrykit/types@1.0.9
21
+ - @foundrykit/utils@1.0.6
22
+
3
23
  ## 1.0.23
4
24
 
5
25
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ export { InteractiveRegionsMap } from '@foundrykit/maps';
2
3
  export { cn } from '@foundrykit/utils';
3
4
 
4
5
  interface HeroMinimalProps {
@@ -44,20 +45,4 @@ interface TestimonialsProps {
44
45
  }
45
46
  declare function Testimonials({ testimonials, title, subtitle, className, }: TestimonialsProps): react_jsx_runtime.JSX.Element;
46
47
 
47
- interface Region {
48
- countries: string[];
49
- name: string;
50
- color?: string;
51
- href?: string;
52
- }
53
- interface InteractiveRegionsMapProps {
54
- title: string;
55
- content?: string;
56
- regions: Region[];
57
- onRegionClick?: (region: Region) => void;
58
- onRegionHover?: (region: Region | null) => void;
59
- className?: string;
60
- }
61
- declare function InteractiveRegionsMap({ title, content, regions, onRegionClick, onRegionHover, className }: InteractiveRegionsMapProps): react_jsx_runtime.JSX.Element;
62
-
63
- export { HeroMinimal, InteractiveRegionsMap, Pricing, Testimonials };
48
+ export { HeroMinimal, Pricing, Testimonials };
package/dist/index.js CHANGED
@@ -137,455 +137,8 @@ function Testimonials({
137
137
  ] }) });
138
138
  }
139
139
 
140
- // src/components/interactive-regions-map/index.tsx
141
- import { useState, useCallback, useMemo } from "react";
142
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
143
- var COUNTRY_MAPPING = {
144
- "us": "united-states",
145
- "ca": "canada",
146
- "mx": "mexico",
147
- "br": "brazil",
148
- "ar": "argentina",
149
- "gb": "united-kingdom",
150
- "fr": "france",
151
- "de": "germany",
152
- "es": "spain",
153
- "it": "italy",
154
- "ru": "russia",
155
- "cn": "china",
156
- "in": "india",
157
- "jp": "japan",
158
- "au": "australia",
159
- "za": "south-africa",
160
- "eg": "egypt",
161
- "ke": "kenya",
162
- "mg": "madagascar",
163
- "iq": "iraq",
164
- "ir": "iran",
165
- "sa": "saudi-arabia"
166
- };
167
- var NAME_TO_CODE = Object.entries(COUNTRY_MAPPING).reduce(
168
- (acc, [code, name]) => ({ ...acc, [name]: code }),
169
- {}
170
- );
171
- function InteractiveRegionsMap({
172
- title = "Interactive Regions Map",
173
- content,
174
- regions = [],
175
- onRegionClick,
176
- onRegionHover,
177
- className = ""
178
- }) {
179
- const [hoveredRegion, setHoveredRegion] = useState(null);
180
- const [isLoading, setIsLoading] = useState(false);
181
- const countryToRegion = useMemo(() => {
182
- const mapping = {};
183
- regions.forEach((region) => {
184
- region.countries.forEach((country) => {
185
- const countryCode = NAME_TO_CODE[country.toLowerCase()];
186
- if (countryCode) {
187
- mapping[countryCode] = region;
188
- }
189
- });
190
- });
191
- return mapping;
192
- }, [regions]);
193
- const handleCountryHover = useCallback((countryCode) => {
194
- if (!countryCode) {
195
- setHoveredRegion(null);
196
- onRegionHover?.(null);
197
- return;
198
- }
199
- const region = countryToRegion[countryCode];
200
- if (region) {
201
- setHoveredRegion(region.name);
202
- onRegionHover?.(region);
203
- } else {
204
- setHoveredRegion(null);
205
- onRegionHover?.(null);
206
- }
207
- }, [countryToRegion, onRegionHover]);
208
- const handleCountryClick = useCallback(async (countryCode) => {
209
- const region = countryToRegion[countryCode];
210
- if (!region) return;
211
- setIsLoading(true);
212
- try {
213
- if (onRegionClick) {
214
- onRegionClick(region);
215
- } else if (region.href) {
216
- window.location.href = region.href;
217
- }
218
- } catch (error) {
219
- console.error("Navigation error:", error);
220
- } finally {
221
- setIsLoading(false);
222
- }
223
- }, [countryToRegion, onRegionClick]);
224
- const getCountryFill = useCallback((countryCode) => {
225
- const region = countryToRegion[countryCode];
226
- if (!region) return "#e5e7eb";
227
- if (hoveredRegion && hoveredRegion !== region.name) {
228
- return region.color ? `${region.color}66` : "#d1d5db";
229
- }
230
- return region.color || "#3b82f6";
231
- }, [countryToRegion, hoveredRegion]);
232
- const isCountryInteractive = useCallback((countryCode) => {
233
- return countryCode in countryToRegion;
234
- }, [countryToRegion]);
235
- return /* @__PURE__ */ jsxs4("section", { className: `max-w-6xl mx-auto flex flex-col p-6 ${className}`, children: [
236
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-col text-center justify-center items-center mb-8", children: [
237
- /* @__PURE__ */ jsx4("h2", { className: "text-3xl font-bold text-gray-900 mb-2", children: title }),
238
- content && /* @__PURE__ */ jsx4("p", { className: "text-lg text-gray-600 max-w-2xl", children: content })
239
- ] }),
240
- /* @__PURE__ */ jsxs4("div", { className: "relative w-full bg-gray-50 rounded-lg overflow-hidden shadow-lg", children: [
241
- isLoading && /* @__PURE__ */ jsx4("div", { className: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center z-10", children: /* @__PURE__ */ jsx4("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600" }) }),
242
- /* @__PURE__ */ jsxs4(
243
- "svg",
244
- {
245
- viewBox: "0 0 1000 500",
246
- className: "w-full h-auto max-h-96",
247
- style: { maxHeight: "500px" },
248
- children: [
249
- /* @__PURE__ */ jsx4(
250
- "path",
251
- {
252
- id: "us",
253
- d: "M200 200 L350 200 L350 250 L200 250 Z",
254
- fill: getCountryFill("us"),
255
- stroke: "#374151",
256
- strokeWidth: "0.5",
257
- className: `transition-all duration-200 ${isCountryInteractive("us") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
258
- onMouseEnter: () => handleCountryHover("us"),
259
- onMouseLeave: () => handleCountryHover(null),
260
- onClick: () => handleCountryClick("us")
261
- }
262
- ),
263
- /* @__PURE__ */ jsx4(
264
- "path",
265
- {
266
- id: "ca",
267
- d: "M200 150 L350 150 L350 200 L200 200 Z",
268
- fill: getCountryFill("ca"),
269
- stroke: "#374151",
270
- strokeWidth: "0.5",
271
- className: `transition-all duration-200 ${isCountryInteractive("ca") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
272
- onMouseEnter: () => handleCountryHover("ca"),
273
- onMouseLeave: () => handleCountryHover(null),
274
- onClick: () => handleCountryClick("ca")
275
- }
276
- ),
277
- /* @__PURE__ */ jsx4(
278
- "path",
279
- {
280
- id: "fr",
281
- d: "M450 220 L480 220 L480 250 L450 250 Z",
282
- fill: getCountryFill("fr"),
283
- stroke: "#374151",
284
- strokeWidth: "0.5",
285
- className: `transition-all duration-200 ${isCountryInteractive("fr") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
286
- onMouseEnter: () => handleCountryHover("fr"),
287
- onMouseLeave: () => handleCountryHover(null),
288
- onClick: () => handleCountryClick("fr")
289
- }
290
- ),
291
- /* @__PURE__ */ jsx4(
292
- "path",
293
- {
294
- id: "de",
295
- d: "M480 220 L510 220 L510 250 L480 250 Z",
296
- fill: getCountryFill("de"),
297
- stroke: "#374151",
298
- strokeWidth: "0.5",
299
- className: `transition-all duration-200 ${isCountryInteractive("de") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
300
- onMouseEnter: () => handleCountryHover("de"),
301
- onMouseLeave: () => handleCountryHover(null),
302
- onClick: () => handleCountryClick("de")
303
- }
304
- ),
305
- /* @__PURE__ */ jsx4(
306
- "path",
307
- {
308
- id: "es",
309
- d: "M420 250 L450 250 L450 280 L420 280 Z",
310
- fill: getCountryFill("es"),
311
- stroke: "#374151",
312
- strokeWidth: "0.5",
313
- className: `transition-all duration-200 ${isCountryInteractive("es") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
314
- onMouseEnter: () => handleCountryHover("es"),
315
- onMouseLeave: () => handleCountryHover(null),
316
- onClick: () => handleCountryClick("es")
317
- }
318
- ),
319
- /* @__PURE__ */ jsx4(
320
- "path",
321
- {
322
- id: "iq",
323
- d: "M550 280 L570 280 L570 300 L550 300 Z",
324
- fill: getCountryFill("iq"),
325
- stroke: "#374151",
326
- strokeWidth: "0.5",
327
- className: `transition-all duration-200 ${isCountryInteractive("iq") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
328
- onMouseEnter: () => handleCountryHover("iq"),
329
- onMouseLeave: () => handleCountryHover(null),
330
- onClick: () => handleCountryClick("iq")
331
- }
332
- ),
333
- /* @__PURE__ */ jsx4(
334
- "path",
335
- {
336
- id: "ir",
337
- d: "M570 280 L600 280 L600 300 L570 300 Z",
338
- fill: getCountryFill("ir"),
339
- stroke: "#374151",
340
- strokeWidth: "0.5",
341
- className: `transition-all duration-200 ${isCountryInteractive("ir") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
342
- onMouseEnter: () => handleCountryHover("ir"),
343
- onMouseLeave: () => handleCountryHover(null),
344
- onClick: () => handleCountryClick("ir")
345
- }
346
- ),
347
- /* @__PURE__ */ jsx4(
348
- "path",
349
- {
350
- id: "za",
351
- d: "M480 380 L510 380 L510 410 L480 410 Z",
352
- fill: getCountryFill("za"),
353
- stroke: "#374151",
354
- strokeWidth: "0.5",
355
- className: `transition-all duration-200 ${isCountryInteractive("za") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
356
- onMouseEnter: () => handleCountryHover("za"),
357
- onMouseLeave: () => handleCountryHover(null),
358
- onClick: () => handleCountryClick("za")
359
- }
360
- ),
361
- /* @__PURE__ */ jsx4(
362
- "path",
363
- {
364
- id: "ke",
365
- d: "M520 350 L540 350 L540 370 L520 370 Z",
366
- fill: getCountryFill("ke"),
367
- stroke: "#374151",
368
- strokeWidth: "0.5",
369
- className: `transition-all duration-200 ${isCountryInteractive("ke") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
370
- onMouseEnter: () => handleCountryHover("ke"),
371
- onMouseLeave: () => handleCountryHover(null),
372
- onClick: () => handleCountryClick("ke")
373
- }
374
- ),
375
- /* @__PURE__ */ jsx4(
376
- "path",
377
- {
378
- id: "mg",
379
- d: "M540 380 L555 380 L555 400 L540 400 Z",
380
- fill: getCountryFill("mg"),
381
- stroke: "#374151",
382
- strokeWidth: "0.5",
383
- className: `transition-all duration-200 ${isCountryInteractive("mg") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
384
- onMouseEnter: () => handleCountryHover("mg"),
385
- onMouseLeave: () => handleCountryHover(null),
386
- onClick: () => handleCountryClick("mg")
387
- }
388
- ),
389
- /* @__PURE__ */ jsx4(
390
- "path",
391
- {
392
- id: "gb",
393
- d: "M420 200 L440 200 L440 220 L420 220 Z",
394
- fill: getCountryFill("gb"),
395
- stroke: "#374151",
396
- strokeWidth: "0.5",
397
- className: `transition-all duration-200 ${isCountryInteractive("gb") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
398
- onMouseEnter: () => handleCountryHover("gb"),
399
- onMouseLeave: () => handleCountryHover(null),
400
- onClick: () => handleCountryClick("gb")
401
- }
402
- ),
403
- /* @__PURE__ */ jsx4(
404
- "path",
405
- {
406
- id: "it",
407
- d: "M480 250 L500 250 L500 280 L480 280 Z",
408
- fill: getCountryFill("it"),
409
- stroke: "#374151",
410
- strokeWidth: "0.5",
411
- className: `transition-all duration-200 ${isCountryInteractive("it") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
412
- onMouseEnter: () => handleCountryHover("it"),
413
- onMouseLeave: () => handleCountryHover(null),
414
- onClick: () => handleCountryClick("it")
415
- }
416
- ),
417
- /* @__PURE__ */ jsx4(
418
- "path",
419
- {
420
- id: "ru",
421
- d: "M550 150 L650 150 L650 200 L550 200 Z",
422
- fill: getCountryFill("ru"),
423
- stroke: "#374151",
424
- strokeWidth: "0.5",
425
- className: `transition-all duration-200 ${isCountryInteractive("ru") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
426
- onMouseEnter: () => handleCountryHover("ru"),
427
- onMouseLeave: () => handleCountryHover(null),
428
- onClick: () => handleCountryClick("ru")
429
- }
430
- ),
431
- /* @__PURE__ */ jsx4(
432
- "path",
433
- {
434
- id: "cn",
435
- d: "M700 220 L750 220 L750 270 L700 270 Z",
436
- fill: getCountryFill("cn"),
437
- stroke: "#374151",
438
- strokeWidth: "0.5",
439
- className: `transition-all duration-200 ${isCountryInteractive("cn") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
440
- onMouseEnter: () => handleCountryHover("cn"),
441
- onMouseLeave: () => handleCountryHover(null),
442
- onClick: () => handleCountryClick("cn")
443
- }
444
- ),
445
- /* @__PURE__ */ jsx4(
446
- "path",
447
- {
448
- id: "in",
449
- d: "M650 280 L700 280 L700 320 L650 320 Z",
450
- fill: getCountryFill("in"),
451
- stroke: "#374151",
452
- strokeWidth: "0.5",
453
- className: `transition-all duration-200 ${isCountryInteractive("in") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
454
- onMouseEnter: () => handleCountryHover("in"),
455
- onMouseLeave: () => handleCountryHover(null),
456
- onClick: () => handleCountryClick("in")
457
- }
458
- ),
459
- /* @__PURE__ */ jsx4(
460
- "path",
461
- {
462
- id: "jp",
463
- d: "M750 240 L770 240 L770 270 L750 270 Z",
464
- fill: getCountryFill("jp"),
465
- stroke: "#374151",
466
- strokeWidth: "0.5",
467
- className: `transition-all duration-200 ${isCountryInteractive("jp") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
468
- onMouseEnter: () => handleCountryHover("jp"),
469
- onMouseLeave: () => handleCountryHover(null),
470
- onClick: () => handleCountryClick("jp")
471
- }
472
- ),
473
- /* @__PURE__ */ jsx4(
474
- "path",
475
- {
476
- id: "au",
477
- d: "M750 380 L800 380 L800 420 L750 420 Z",
478
- fill: getCountryFill("au"),
479
- stroke: "#374151",
480
- strokeWidth: "0.5",
481
- className: `transition-all duration-200 ${isCountryInteractive("au") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
482
- onMouseEnter: () => handleCountryHover("au"),
483
- onMouseLeave: () => handleCountryHover(null),
484
- onClick: () => handleCountryClick("au")
485
- }
486
- ),
487
- /* @__PURE__ */ jsx4(
488
- "path",
489
- {
490
- id: "br",
491
- d: "M300 320 L380 320 L380 400 L300 400 Z",
492
- fill: getCountryFill("br"),
493
- stroke: "#374151",
494
- strokeWidth: "0.5",
495
- className: `transition-all duration-200 ${isCountryInteractive("br") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
496
- onMouseEnter: () => handleCountryHover("br"),
497
- onMouseLeave: () => handleCountryHover(null),
498
- onClick: () => handleCountryClick("br")
499
- }
500
- ),
501
- /* @__PURE__ */ jsx4(
502
- "path",
503
- {
504
- id: "ar",
505
- d: "M280 400 L320 400 L320 460 L280 460 Z",
506
- fill: getCountryFill("ar"),
507
- stroke: "#374151",
508
- strokeWidth: "0.5",
509
- className: `transition-all duration-200 ${isCountryInteractive("ar") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
510
- onMouseEnter: () => handleCountryHover("ar"),
511
- onMouseLeave: () => handleCountryHover(null),
512
- onClick: () => handleCountryClick("ar")
513
- }
514
- ),
515
- /* @__PURE__ */ jsx4(
516
- "path",
517
- {
518
- id: "mx",
519
- d: "M150 280 L250 280 L250 320 L150 320 Z",
520
- fill: getCountryFill("mx"),
521
- stroke: "#374151",
522
- strokeWidth: "0.5",
523
- className: `transition-all duration-200 ${isCountryInteractive("mx") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
524
- onMouseEnter: () => handleCountryHover("mx"),
525
- onMouseLeave: () => handleCountryHover(null),
526
- onClick: () => handleCountryClick("mx")
527
- }
528
- ),
529
- /* @__PURE__ */ jsx4(
530
- "path",
531
- {
532
- id: "eg",
533
- d: "M500 310 L520 310 L520 330 L500 330 Z",
534
- fill: getCountryFill("eg"),
535
- stroke: "#374151",
536
- strokeWidth: "0.5",
537
- className: `transition-all duration-200 ${isCountryInteractive("eg") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
538
- onMouseEnter: () => handleCountryHover("eg"),
539
- onMouseLeave: () => handleCountryHover(null),
540
- onClick: () => handleCountryClick("eg")
541
- }
542
- ),
543
- /* @__PURE__ */ jsx4(
544
- "path",
545
- {
546
- id: "sa",
547
- d: "M530 300 L570 300 L570 330 L530 330 Z",
548
- fill: getCountryFill("sa"),
549
- stroke: "#374151",
550
- strokeWidth: "0.5",
551
- className: `transition-all duration-200 ${isCountryInteractive("sa") ? "cursor-pointer hover:stroke-2 hover:stroke-gray-700" : "cursor-default"}`,
552
- onMouseEnter: () => handleCountryHover("sa"),
553
- onMouseLeave: () => handleCountryHover(null),
554
- onClick: () => handleCountryClick("sa")
555
- }
556
- )
557
- ]
558
- }
559
- )
560
- ] }),
561
- regions.length > 0 && /* @__PURE__ */ jsx4("div", { className: "mt-6 flex flex-wrap justify-center gap-4", children: regions.map((region, index) => /* @__PURE__ */ jsxs4(
562
- "div",
563
- {
564
- className: `flex items-center gap-2 px-3 py-2 rounded-lg border transition-all duration-200 ${hoveredRegion === region.name ? "bg-gray-100 border-gray-400 shadow-md" : "bg-white border-gray-200"}`,
565
- children: [
566
- /* @__PURE__ */ jsx4(
567
- "div",
568
- {
569
- className: "w-4 h-4 rounded border border-gray-300",
570
- style: {
571
- backgroundColor: region.color || "#3b82f6"
572
- }
573
- }
574
- ),
575
- /* @__PURE__ */ jsx4("span", { className: "text-sm font-medium text-gray-700", children: region.name })
576
- ]
577
- },
578
- index
579
- )) }),
580
- process.env.NODE_ENV === "development" && hoveredRegion && /* @__PURE__ */ jsxs4("div", { className: "mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded text-sm", children: [
581
- /* @__PURE__ */ jsx4("strong", { children: "Debug:" }),
582
- " Hovering over region: ",
583
- hoveredRegion
584
- ] })
585
- ] });
586
- }
587
-
588
140
  // src/index.ts
141
+ import { InteractiveRegionsMap } from "@foundrykit/maps";
589
142
  import { cn } from "@foundrykit/utils";
590
143
  export {
591
144
  HeroMinimal,