@ugurdemirel/landcraft 0.1.1 → 0.1.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/README.md +103 -19
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +104 -4
- package/dist/index.js +1411 -1124
- package/dist/index.js.map +1 -1
- package/dist/styles.css +3721 -5900
- package/package.json +5 -7
- package/src/components/Blog.tsx +18 -10
- package/src/components/Button.tsx +27 -8
- package/src/components/Footer.tsx +53 -13
- package/src/components/LanguageSwitcher.tsx +223 -0
- package/src/components/MegaMenu.tsx +25 -12
- package/src/components/Modal.tsx +124 -0
- package/src/components/Navbar.tsx +20 -8
- package/src/components/Slot.tsx +78 -0
- package/src/index.ts +9 -0
- package/src/styles/index.css +2 -71
- package/src/styles/theme.css +242 -0
- package/src/utils/iso2Flag.ts +26 -0
- package/tailwind.preset.cjs +0 -121
package/dist/index.d.ts
CHANGED
|
@@ -42,6 +42,8 @@ export declare const BlogCard: ForwardRefExoticComponent<BlogCardProps & RefAttr
|
|
|
42
42
|
export declare interface BlogCardProps extends HTMLAttributes<HTMLAnchorElement> {
|
|
43
43
|
post: BlogPost;
|
|
44
44
|
option?: "card" | "row";
|
|
45
|
+
/** Component used to render the card link. Defaults to `<a>`. Pass your router's `<Link>` (Next.js, Remix, React Router…) for framework-aware navigation. */
|
|
46
|
+
LinkComponent?: ElementType;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
export declare interface BlogPost {
|
|
@@ -72,6 +74,8 @@ export declare interface BlogSectionProps extends Omit<HTMLAttributes<HTMLElemen
|
|
|
72
74
|
description?: ReactNode;
|
|
73
75
|
showAllLabel?: string;
|
|
74
76
|
showAllHref?: string;
|
|
77
|
+
/** Component used to render the "show all" link and post cards. Defaults to `<a>`. Pass your router's `<Link>` (Next.js, Remix, React Router…) for framework-aware navigation. */
|
|
78
|
+
LinkComponent?: ElementType;
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
export declare const Box: (props: IconProps) => JSX_2.Element;
|
|
@@ -86,6 +90,13 @@ export declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElem
|
|
|
86
90
|
/** Paints the button with an arbitrary CSS color; text color is computed for contrast. */
|
|
87
91
|
customColor?: string;
|
|
88
92
|
fullWidth?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* When `true`, the button styling is applied to a single child element
|
|
95
|
+
* instead of a `<button>`. Use it to render a framework router `<Link>`
|
|
96
|
+
* (Next.js, Remix, React Router…). `iconLeft` / `iconRight` are ignored;
|
|
97
|
+
* pass icons inside the child instead.
|
|
98
|
+
*/
|
|
99
|
+
asChild?: boolean;
|
|
89
100
|
}
|
|
90
101
|
|
|
91
102
|
export declare type ButtonSize = "sm" | "md" | "lg";
|
|
@@ -236,7 +247,7 @@ export declare interface FeatureItem {
|
|
|
236
247
|
}
|
|
237
248
|
|
|
238
249
|
export declare const Footer: {
|
|
239
|
-
({ className, brand, description, columns, socials, bottom, option, badge, ...props }: FooterProps): JSX_2.Element;
|
|
250
|
+
({ className, brand, logo, logoSrc, logoAlt, logoClassName, description, columns, socials, bottom, languageSwitcher, option, badge, LinkComponent, ...props }: FooterProps): JSX_2.Element;
|
|
240
251
|
displayName: string;
|
|
241
252
|
};
|
|
242
253
|
|
|
@@ -252,12 +263,23 @@ export declare interface FooterLink {
|
|
|
252
263
|
|
|
253
264
|
export declare interface FooterProps extends HTMLAttributes<HTMLElement> {
|
|
254
265
|
brand?: ReactNode;
|
|
266
|
+
/** Custom logo node (component, <img>, inline SVG…). Replaces the wordmark. */
|
|
267
|
+
logo?: ReactNode;
|
|
268
|
+
/** Quick logo image source. */
|
|
269
|
+
logoSrc?: string;
|
|
270
|
+
logoAlt?: string;
|
|
271
|
+
/** Size / position tuning for logo images. Defaults to `h-7 w-auto`. */
|
|
272
|
+
logoClassName?: string;
|
|
255
273
|
description?: string;
|
|
256
274
|
columns: FooterColumn[];
|
|
257
275
|
socials?: ReactNode;
|
|
258
276
|
bottom?: ReactNode;
|
|
277
|
+
/** Optional language switcher rendered in the footer's bottom bar. */
|
|
278
|
+
languageSwitcher?: ReactNode;
|
|
259
279
|
option?: "classic" | "minimal" | "editorial";
|
|
260
280
|
badge?: ReactNode;
|
|
281
|
+
/** Component used to render footer links. Defaults to `<a>`. Pass your router's `<Link>` (Next.js, Remix, React Router…) for framework-aware navigation. */
|
|
282
|
+
LinkComponent?: ElementType;
|
|
261
283
|
}
|
|
262
284
|
|
|
263
285
|
export declare const Gauge: (props: IconProps) => JSX_2.Element;
|
|
@@ -301,6 +323,43 @@ export declare interface HeroProps extends Omit<HTMLAttributes<HTMLElement>, "ti
|
|
|
301
323
|
*/
|
|
302
324
|
declare type IconProps = SVGProps<SVGSVGElement>;
|
|
303
325
|
|
|
326
|
+
export declare function iso2ToFlagEmoji(code: string): string;
|
|
327
|
+
|
|
328
|
+
export declare interface LanguageOption {
|
|
329
|
+
/** Language code (ISO 3166-1 alpha-2, e.g. `"tr"`) — this is the value passed to `onChange` and the flag source. */
|
|
330
|
+
code: string;
|
|
331
|
+
/** Native display name, e.g. `"Türkçe"`. */
|
|
332
|
+
label: string;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export declare const LanguageSwitcher: {
|
|
336
|
+
({ className, languages, option, value, defaultValue, onChange, align, modalTitle, showFlag, inverse, ...props }: LanguageSwitcherProps): JSX_2.Element | null;
|
|
337
|
+
displayName: string;
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
export declare type LanguageSwitcherOption = "dropdown" | "modal";
|
|
341
|
+
|
|
342
|
+
export declare interface LanguageSwitcherProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
343
|
+
/** `dropdown` opens the anchored menu; `modal` opens a full dialog via the Modal component. */
|
|
344
|
+
option?: LanguageSwitcherOption;
|
|
345
|
+
/** Languages to switch between. Required — no built-in default language list. */
|
|
346
|
+
languages: LanguageOption[];
|
|
347
|
+
/** Controlled current language code. */
|
|
348
|
+
value?: string;
|
|
349
|
+
/** Uncontrolled initial language code. Defaults to the first language. */
|
|
350
|
+
defaultValue?: string;
|
|
351
|
+
/** Called with the selected language code. */
|
|
352
|
+
onChange?: (code: string) => void;
|
|
353
|
+
/** Dropdown menu alignment relative to its trigger. Defaults to `end`. */
|
|
354
|
+
align?: "start" | "end";
|
|
355
|
+
/** Heading rendered inside the `modal` option. Optional — pass it to show a title. */
|
|
356
|
+
modalTitle?: ReactNode;
|
|
357
|
+
/** Replace the globe icon with the selected language's flag emoji (and show flags in options). */
|
|
358
|
+
showFlag?: boolean;
|
|
359
|
+
/** Adapts colors for dark surfaces (inverse Navbar, classic Footer). */
|
|
360
|
+
inverse?: boolean;
|
|
361
|
+
}
|
|
362
|
+
|
|
304
363
|
export declare const Layers: (props: IconProps) => JSX_2.Element;
|
|
305
364
|
|
|
306
365
|
declare const Lock_2: (props: IconProps) => JSX_2.Element;
|
|
@@ -324,7 +383,7 @@ export declare interface LogoItem {
|
|
|
324
383
|
export declare const Mail: (props: IconProps) => JSX_2.Element;
|
|
325
384
|
|
|
326
385
|
export declare const MegaMenu: {
|
|
327
|
-
({ className, variant, brand, logo, logoSrc, logoAlt, logoClassName, brandHref, items, actions, cta, sticky, onKeyDown, ...props }: MegaMenuProps): JSX_2.Element;
|
|
386
|
+
({ className, variant, brand, logo, logoSrc, logoAlt, logoClassName, brandHref, items, actions, cta, languageSwitcher, sticky, LinkComponent, onKeyDown, ...props }: MegaMenuProps): JSX_2.Element;
|
|
328
387
|
displayName: string;
|
|
329
388
|
};
|
|
330
389
|
|
|
@@ -374,13 +433,39 @@ export declare interface MegaMenuProps extends Omit<HTMLAttributes<HTMLElement>,
|
|
|
374
433
|
/** Rendered at the right side of the bar (desktop) and inside the mobile panel. */
|
|
375
434
|
actions?: ReactNode;
|
|
376
435
|
cta?: ReactNode;
|
|
436
|
+
/** Optional language switcher rendered on the right (desktop) and beside the menu button (mobile). */
|
|
437
|
+
languageSwitcher?: ReactNode;
|
|
377
438
|
sticky?: boolean;
|
|
439
|
+
/** Component used to render brand, trigger and panel links. Defaults to `<a>`. Pass your router's `<Link>` (Next.js, Remix, React Router…) for framework-aware navigation. */
|
|
440
|
+
LinkComponent?: ElementType;
|
|
378
441
|
}
|
|
379
442
|
|
|
380
443
|
export declare const Menu: (props: IconProps) => JSX_2.Element;
|
|
381
444
|
|
|
445
|
+
/**
|
|
446
|
+
* Accessible dialog built on the HTML Popover API.
|
|
447
|
+
*
|
|
448
|
+
* `popover="auto"` renders in the top layer and gives light-dismiss (outside
|
|
449
|
+
* click + `Escape`), automatic focus movement and restoration for free, so no
|
|
450
|
+
* portal, focus trap or key handlers are needed. State stays controlled via
|
|
451
|
+
* `open` / `onClose`.
|
|
452
|
+
*/
|
|
453
|
+
export declare const Modal: ForwardRefExoticComponent<ModalProps & RefAttributes<HTMLDivElement>>;
|
|
454
|
+
|
|
455
|
+
export declare interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
456
|
+
open: boolean;
|
|
457
|
+
onClose: () => void;
|
|
458
|
+
/** Dialog heading (required for a11y; auto-linked via `aria-labelledby`). */
|
|
459
|
+
title?: ReactNode;
|
|
460
|
+
description?: ReactNode;
|
|
461
|
+
/** Rendered below the content, e.g. actions. */
|
|
462
|
+
footer?: ReactNode;
|
|
463
|
+
/** Content width. Defaults to `md`. */
|
|
464
|
+
size?: "sm" | "md" | "lg";
|
|
465
|
+
}
|
|
466
|
+
|
|
382
467
|
export declare const Navbar: {
|
|
383
|
-
({ className, variant, brand, logo, logoSrc, logoAlt, logoClassName, brandHref, links, actions, cta, sticky, ...props }: NavbarProps): JSX_2.Element;
|
|
468
|
+
({ className, variant, brand, logo, logoSrc, logoAlt, logoClassName, brandHref, links, actions, cta, languageSwitcher, sticky, LinkComponent, ...props }: NavbarProps): JSX_2.Element;
|
|
384
469
|
displayName: string;
|
|
385
470
|
};
|
|
386
471
|
|
|
@@ -398,8 +483,12 @@ export declare interface NavbarProps extends Omit<HTMLAttributes<HTMLElement>, "
|
|
|
398
483
|
brandHref?: string;
|
|
399
484
|
links: NavLink[];
|
|
400
485
|
actions?: ReactNode;
|
|
401
|
-
sticky?: boolean;
|
|
402
486
|
cta?: ReactNode;
|
|
487
|
+
/** Optional language switcher rendered on the right (desktop) and beside the menu button (mobile). */
|
|
488
|
+
languageSwitcher?: ReactNode;
|
|
489
|
+
sticky?: boolean;
|
|
490
|
+
/** Component used to render the brand and nav links. Defaults to `<a>`. Pass your router's `<Link>` (Next.js, Remix, React Router…) for framework-aware navigation. */
|
|
491
|
+
LinkComponent?: ElementType;
|
|
403
492
|
}
|
|
404
493
|
|
|
405
494
|
export declare interface NavLink {
|
|
@@ -506,6 +595,17 @@ export declare const ShieldCheck: (props: IconProps) => JSX_2.Element;
|
|
|
506
595
|
|
|
507
596
|
export declare const Sliders: (props: IconProps) => JSX_2.Element;
|
|
508
597
|
|
|
598
|
+
/**
|
|
599
|
+
* Merges its props onto a single child element instead of rendering its own
|
|
600
|
+
* DOM node. Used with the `asChild` prop so consumers can render a framework
|
|
601
|
+
* router `<Link>` (Next.js, Remix, React Router…) with a component's styling.
|
|
602
|
+
*/
|
|
603
|
+
export declare const Slot: ForwardRefExoticComponent<SlotProps & RefAttributes<HTMLElement>>;
|
|
604
|
+
|
|
605
|
+
export declare interface SlotProps extends Omit<HTMLAttributes<HTMLElement>, "ref"> {
|
|
606
|
+
children?: ReactNode;
|
|
607
|
+
}
|
|
608
|
+
|
|
509
609
|
export declare const Smartphone: (props: IconProps) => JSX_2.Element;
|
|
510
610
|
|
|
511
611
|
/** Vertical (or horizontal) rhythm helper using flex gaps. */
|