@ugurdemirel/landcraft 0.1.0 → 0.1.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/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, sticky, LinkComponent, onKeyDown, ...props }: MegaMenuProps): JSX_2.Element;
328
387
  displayName: string;
329
388
  };
330
389
 
@@ -375,12 +434,36 @@ export declare interface MegaMenuProps extends Omit<HTMLAttributes<HTMLElement>,
375
434
  actions?: ReactNode;
376
435
  cta?: ReactNode;
377
436
  sticky?: boolean;
437
+ /** 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. */
438
+ LinkComponent?: ElementType;
378
439
  }
379
440
 
380
441
  export declare const Menu: (props: IconProps) => JSX_2.Element;
381
442
 
443
+ /**
444
+ * Accessible dialog built on the HTML Popover API.
445
+ *
446
+ * `popover="auto"` renders in the top layer and gives light-dismiss (outside
447
+ * click + `Escape`), automatic focus movement and restoration for free, so no
448
+ * portal, focus trap or key handlers are needed. State stays controlled via
449
+ * `open` / `onClose`.
450
+ */
451
+ export declare const Modal: ForwardRefExoticComponent<ModalProps & RefAttributes<HTMLDivElement>>;
452
+
453
+ export declare interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
454
+ open: boolean;
455
+ onClose: () => void;
456
+ /** Dialog heading (required for a11y; auto-linked via `aria-labelledby`). */
457
+ title?: ReactNode;
458
+ description?: ReactNode;
459
+ /** Rendered below the content, e.g. actions. */
460
+ footer?: ReactNode;
461
+ /** Content width. Defaults to `md`. */
462
+ size?: "sm" | "md" | "lg";
463
+ }
464
+
382
465
  export declare const Navbar: {
383
- ({ className, variant, brand, logo, logoSrc, logoAlt, logoClassName, brandHref, links, actions, cta, sticky, ...props }: NavbarProps): JSX_2.Element;
466
+ ({ className, variant, brand, logo, logoSrc, logoAlt, logoClassName, brandHref, links, actions, cta, languageSwitcher, sticky, LinkComponent, ...props }: NavbarProps): JSX_2.Element;
384
467
  displayName: string;
385
468
  };
386
469
 
@@ -398,8 +481,12 @@ export declare interface NavbarProps extends Omit<HTMLAttributes<HTMLElement>, "
398
481
  brandHref?: string;
399
482
  links: NavLink[];
400
483
  actions?: ReactNode;
401
- sticky?: boolean;
402
484
  cta?: ReactNode;
485
+ /** Optional language switcher rendered on the right (desktop) and beside the menu button (mobile). */
486
+ languageSwitcher?: ReactNode;
487
+ sticky?: boolean;
488
+ /** 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. */
489
+ LinkComponent?: ElementType;
403
490
  }
404
491
 
405
492
  export declare interface NavLink {
@@ -506,6 +593,17 @@ export declare const ShieldCheck: (props: IconProps) => JSX_2.Element;
506
593
 
507
594
  export declare const Sliders: (props: IconProps) => JSX_2.Element;
508
595
 
596
+ /**
597
+ * Merges its props onto a single child element instead of rendering its own
598
+ * DOM node. Used with the `asChild` prop so consumers can render a framework
599
+ * router `<Link>` (Next.js, Remix, React Router…) with a component's styling.
600
+ */
601
+ export declare const Slot: ForwardRefExoticComponent<SlotProps & RefAttributes<HTMLElement>>;
602
+
603
+ export declare interface SlotProps extends Omit<HTMLAttributes<HTMLElement>, "ref"> {
604
+ children?: ReactNode;
605
+ }
606
+
509
607
  export declare const Smartphone: (props: IconProps) => JSX_2.Element;
510
608
 
511
609
  /** Vertical (or horizontal) rhythm helper using flex gaps. */