@m1kapp/kit 0.0.18 → 0.0.21

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/bin/m1kkit.mjs CHANGED
File without changes
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { ReactNode, CSSProperties } from 'react';
3
+ import React__default, { ReactNode, CSSProperties, RefObject } from 'react';
4
4
  import { MetadataRoute, Viewport } from 'next';
5
5
  import { ClassValue } from 'clsx';
6
6
 
@@ -69,6 +69,27 @@ interface AppShellContentProps {
69
69
  */
70
70
  declare function AppShellContent({ children, className }: AppShellContentProps): react_jsx_runtime.JSX.Element;
71
71
 
72
+ interface FabProps {
73
+ onClick: () => void;
74
+ icon: ReactNode;
75
+ /** Accent background color. Default: zinc-900/white (follows dark mode) */
76
+ color?: string;
77
+ className?: string;
78
+ }
79
+ /**
80
+ * Floating Action Button — positioned absolute bottom-right inside AppShell.
81
+ *
82
+ * Portals into the nearest `.in-app-sheet-content-portal` (AppShellContent wrapper)
83
+ * so it stays pinned regardless of scroll content height.
84
+ *
85
+ * @example
86
+ * <AppShellContent>
87
+ * {content}
88
+ * <Fab onClick={handleAdd} icon={<PlusIcon />} color="#6366f1" />
89
+ * </AppShellContent>
90
+ */
91
+ declare function Fab({ onClick, icon, color, className }: FabProps): react_jsx_runtime.JSX.Element;
92
+
72
93
  interface TabBarProps {
73
94
  children: ReactNode;
74
95
  className?: string;
@@ -559,6 +580,26 @@ declare function useInView(options?: UseInViewOptions): UseInViewResult;
559
580
  */
560
581
  declare function useFocusTrap<T extends HTMLElement = HTMLElement>(active: boolean): React$1.RefObject<T | null>;
561
582
 
583
+ /**
584
+ * Calls `onEscape` when the Escape key is pressed while `active` is true.
585
+ */
586
+ declare function useEscapeKey(active: boolean, onEscape: () => void): void;
587
+
588
+ /**
589
+ * Locks scroll on the nearest `.tab-scroll` ancestor (or falls back to querySelector)
590
+ * while `active` is true. Restores previous overflow on cleanup.
591
+ */
592
+ declare function useScrollLock(active: boolean, anchorRef?: RefObject<HTMLElement | null>): void;
593
+
594
+ /**
595
+ * Finds the nearest portal container by walking up from a hidden anchor span.
596
+ * Searches for `selectors` in order via `.closest()`, falls back to `document.body`.
597
+ *
598
+ * Returns `[anchorRef, target]` — attach `anchorRef` to a hidden `<span>` so
599
+ * the DOM walk has a starting point.
600
+ */
601
+ declare function usePortalTarget(selectors?: string | string[]): [React.RefObject<HTMLSpanElement | null>, HTMLElement | null];
602
+
562
603
  interface SkeletonProps {
563
604
  /** Tailwind classes for width / height (e.g. "h-4 w-3/4") */
564
605
  className?: string;
@@ -600,10 +641,16 @@ interface InAppSheetProps {
600
641
  onClose: () => void;
601
642
  children: React.ReactNode;
602
643
  className?: string;
644
+ /** 시트 상단 타이틀 — X 버튼과 나란히 정렬 */
645
+ title?: string;
603
646
  /** true면 시트가 AppShell 전체 높이를 채움 */
604
647
  fullHeight?: boolean;
648
+ /** 우상단 X 버튼 숨기기. Default: false (보임) */
649
+ hideClose?: boolean;
650
+ /** 닫기 버튼 aria-label. Default: "닫기" */
651
+ closeLabel?: string;
605
652
  }
606
- declare function InAppSheet({ open, onClose, children, className, fullHeight, }: InAppSheetProps): react_jsx_runtime.JSX.Element;
653
+ declare function InAppSheet({ open, onClose, children, className, title, fullHeight, hideClose, closeLabel, }: InAppSheetProps): react_jsx_runtime.JSX.Element;
607
654
 
608
655
  type PWAInstallState = "android-ready" | "ios-safari" | "installed" | "unsupported";
609
656
  interface UsePWAInstallReturn {
@@ -818,4 +865,4 @@ declare function formatPrice(amount: number, currency?: string, locale?: string)
818
865
 
819
866
  declare function cn(...inputs: ClassValue[]): string;
820
867
 
821
- export { type ApiClient, type ApiClientOptions, ApiError, AppShell, AppShellContent, type AppShellContentProps, AppShellHeader, type AppShellHeaderProps, type AppShellProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, type ColorName, Dialog, type DialogProps, Divider, EmojiButton, type EmojiButtonProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerProps, EmptyState, type EmptyStateProps, FontLinks, type FontName, GrassMap, type GrassMapData, type GrassMapLabels, type GrassMapProps, IOSInstallSheet, InAppSheet, type InAppSheetProps, KitStyles, PWAInstallButton, type PWAInstallState, Section, SectionHeader, type SectionHeaderProps, type SectionProps, ShareButton, type ShareButtonProps, Skeleton, type SkeletonProps, StatChip, type StatChipProps, THEME_SCRIPT, Tab, TabBar, type TabBarProps, type TabProps, ThemeButton, type ThemeButtonProps, ThemeDialog, type ThemeDialogLabels, type ThemeDialogProps, type ToastOptions, ToastProvider, type ToastVariant, Tooltip, type TooltipProps, Typewriter, type TypewriterProps, type UseFetchOptions, type UseFetchResult, type UseFormSubmitOptions, type UseFormSubmitResult, type UseInViewOptions, type UseInViewResult, type UsePWAInstallReturn, type UsePollingOptions, type UsePollingResult, type UseShareOptions, type UseShareReturn, Watermark, type WatermarkProps, type WatermarkSponsor, clearFetchCache, cn, colors, createApiClient, createManifest, fontFamily, fonts, formatNumber, formatPrice, mobileViewport, relativeTime, svgIcon, useDebounce, useFetch, useFocusTrap, useFormSubmit, useInView, useLocalStorage, usePWAInstall, usePolling, useShare, useToast };
868
+ export { type ApiClient, type ApiClientOptions, ApiError, AppShell, AppShellContent, type AppShellContentProps, AppShellHeader, type AppShellHeaderProps, type AppShellProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, type ColorName, Dialog, type DialogProps, Divider, EmojiButton, type EmojiButtonProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerProps, EmptyState, type EmptyStateProps, Fab, type FabProps, FontLinks, type FontName, GrassMap, type GrassMapData, type GrassMapLabels, type GrassMapProps, IOSInstallSheet, InAppSheet, type InAppSheetProps, KitStyles, PWAInstallButton, type PWAInstallState, Section, SectionHeader, type SectionHeaderProps, type SectionProps, ShareButton, type ShareButtonProps, Skeleton, type SkeletonProps, StatChip, type StatChipProps, THEME_SCRIPT, Tab, TabBar, type TabBarProps, type TabProps, ThemeButton, type ThemeButtonProps, ThemeDialog, type ThemeDialogLabels, type ThemeDialogProps, type ToastOptions, ToastProvider, type ToastVariant, Tooltip, type TooltipProps, Typewriter, type TypewriterProps, type UseFetchOptions, type UseFetchResult, type UseFormSubmitOptions, type UseFormSubmitResult, type UseInViewOptions, type UseInViewResult, type UsePWAInstallReturn, type UsePollingOptions, type UsePollingResult, type UseShareOptions, type UseShareReturn, Watermark, type WatermarkProps, type WatermarkSponsor, clearFetchCache, cn, colors, createApiClient, createManifest, fontFamily, fonts, formatNumber, formatPrice, mobileViewport, relativeTime, svgIcon, useDebounce, useEscapeKey, useFetch, useFocusTrap, useFormSubmit, useInView, useLocalStorage, usePWAInstall, usePolling, usePortalTarget, useScrollLock, useShare, useToast };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { ReactNode, CSSProperties } from 'react';
3
+ import React__default, { ReactNode, CSSProperties, RefObject } from 'react';
4
4
  import { MetadataRoute, Viewport } from 'next';
5
5
  import { ClassValue } from 'clsx';
6
6
 
@@ -69,6 +69,27 @@ interface AppShellContentProps {
69
69
  */
70
70
  declare function AppShellContent({ children, className }: AppShellContentProps): react_jsx_runtime.JSX.Element;
71
71
 
72
+ interface FabProps {
73
+ onClick: () => void;
74
+ icon: ReactNode;
75
+ /** Accent background color. Default: zinc-900/white (follows dark mode) */
76
+ color?: string;
77
+ className?: string;
78
+ }
79
+ /**
80
+ * Floating Action Button — positioned absolute bottom-right inside AppShell.
81
+ *
82
+ * Portals into the nearest `.in-app-sheet-content-portal` (AppShellContent wrapper)
83
+ * so it stays pinned regardless of scroll content height.
84
+ *
85
+ * @example
86
+ * <AppShellContent>
87
+ * {content}
88
+ * <Fab onClick={handleAdd} icon={<PlusIcon />} color="#6366f1" />
89
+ * </AppShellContent>
90
+ */
91
+ declare function Fab({ onClick, icon, color, className }: FabProps): react_jsx_runtime.JSX.Element;
92
+
72
93
  interface TabBarProps {
73
94
  children: ReactNode;
74
95
  className?: string;
@@ -559,6 +580,26 @@ declare function useInView(options?: UseInViewOptions): UseInViewResult;
559
580
  */
560
581
  declare function useFocusTrap<T extends HTMLElement = HTMLElement>(active: boolean): React$1.RefObject<T | null>;
561
582
 
583
+ /**
584
+ * Calls `onEscape` when the Escape key is pressed while `active` is true.
585
+ */
586
+ declare function useEscapeKey(active: boolean, onEscape: () => void): void;
587
+
588
+ /**
589
+ * Locks scroll on the nearest `.tab-scroll` ancestor (or falls back to querySelector)
590
+ * while `active` is true. Restores previous overflow on cleanup.
591
+ */
592
+ declare function useScrollLock(active: boolean, anchorRef?: RefObject<HTMLElement | null>): void;
593
+
594
+ /**
595
+ * Finds the nearest portal container by walking up from a hidden anchor span.
596
+ * Searches for `selectors` in order via `.closest()`, falls back to `document.body`.
597
+ *
598
+ * Returns `[anchorRef, target]` — attach `anchorRef` to a hidden `<span>` so
599
+ * the DOM walk has a starting point.
600
+ */
601
+ declare function usePortalTarget(selectors?: string | string[]): [React.RefObject<HTMLSpanElement | null>, HTMLElement | null];
602
+
562
603
  interface SkeletonProps {
563
604
  /** Tailwind classes for width / height (e.g. "h-4 w-3/4") */
564
605
  className?: string;
@@ -600,10 +641,16 @@ interface InAppSheetProps {
600
641
  onClose: () => void;
601
642
  children: React.ReactNode;
602
643
  className?: string;
644
+ /** 시트 상단 타이틀 — X 버튼과 나란히 정렬 */
645
+ title?: string;
603
646
  /** true면 시트가 AppShell 전체 높이를 채움 */
604
647
  fullHeight?: boolean;
648
+ /** 우상단 X 버튼 숨기기. Default: false (보임) */
649
+ hideClose?: boolean;
650
+ /** 닫기 버튼 aria-label. Default: "닫기" */
651
+ closeLabel?: string;
605
652
  }
606
- declare function InAppSheet({ open, onClose, children, className, fullHeight, }: InAppSheetProps): react_jsx_runtime.JSX.Element;
653
+ declare function InAppSheet({ open, onClose, children, className, title, fullHeight, hideClose, closeLabel, }: InAppSheetProps): react_jsx_runtime.JSX.Element;
607
654
 
608
655
  type PWAInstallState = "android-ready" | "ios-safari" | "installed" | "unsupported";
609
656
  interface UsePWAInstallReturn {
@@ -818,4 +865,4 @@ declare function formatPrice(amount: number, currency?: string, locale?: string)
818
865
 
819
866
  declare function cn(...inputs: ClassValue[]): string;
820
867
 
821
- export { type ApiClient, type ApiClientOptions, ApiError, AppShell, AppShellContent, type AppShellContentProps, AppShellHeader, type AppShellHeaderProps, type AppShellProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, type ColorName, Dialog, type DialogProps, Divider, EmojiButton, type EmojiButtonProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerProps, EmptyState, type EmptyStateProps, FontLinks, type FontName, GrassMap, type GrassMapData, type GrassMapLabels, type GrassMapProps, IOSInstallSheet, InAppSheet, type InAppSheetProps, KitStyles, PWAInstallButton, type PWAInstallState, Section, SectionHeader, type SectionHeaderProps, type SectionProps, ShareButton, type ShareButtonProps, Skeleton, type SkeletonProps, StatChip, type StatChipProps, THEME_SCRIPT, Tab, TabBar, type TabBarProps, type TabProps, ThemeButton, type ThemeButtonProps, ThemeDialog, type ThemeDialogLabels, type ThemeDialogProps, type ToastOptions, ToastProvider, type ToastVariant, Tooltip, type TooltipProps, Typewriter, type TypewriterProps, type UseFetchOptions, type UseFetchResult, type UseFormSubmitOptions, type UseFormSubmitResult, type UseInViewOptions, type UseInViewResult, type UsePWAInstallReturn, type UsePollingOptions, type UsePollingResult, type UseShareOptions, type UseShareReturn, Watermark, type WatermarkProps, type WatermarkSponsor, clearFetchCache, cn, colors, createApiClient, createManifest, fontFamily, fonts, formatNumber, formatPrice, mobileViewport, relativeTime, svgIcon, useDebounce, useFetch, useFocusTrap, useFormSubmit, useInView, useLocalStorage, usePWAInstall, usePolling, useShare, useToast };
868
+ export { type ApiClient, type ApiClientOptions, ApiError, AppShell, AppShellContent, type AppShellContentProps, AppShellHeader, type AppShellHeaderProps, type AppShellProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, type ColorName, Dialog, type DialogProps, Divider, EmojiButton, type EmojiButtonProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerProps, EmptyState, type EmptyStateProps, Fab, type FabProps, FontLinks, type FontName, GrassMap, type GrassMapData, type GrassMapLabels, type GrassMapProps, IOSInstallSheet, InAppSheet, type InAppSheetProps, KitStyles, PWAInstallButton, type PWAInstallState, Section, SectionHeader, type SectionHeaderProps, type SectionProps, ShareButton, type ShareButtonProps, Skeleton, type SkeletonProps, StatChip, type StatChipProps, THEME_SCRIPT, Tab, TabBar, type TabBarProps, type TabProps, ThemeButton, type ThemeButtonProps, ThemeDialog, type ThemeDialogLabels, type ThemeDialogProps, type ToastOptions, ToastProvider, type ToastVariant, Tooltip, type TooltipProps, Typewriter, type TypewriterProps, type UseFetchOptions, type UseFetchResult, type UseFormSubmitOptions, type UseFormSubmitResult, type UseInViewOptions, type UseInViewResult, type UsePWAInstallReturn, type UsePollingOptions, type UsePollingResult, type UseShareOptions, type UseShareReturn, Watermark, type WatermarkProps, type WatermarkSponsor, clearFetchCache, cn, colors, createApiClient, createManifest, fontFamily, fonts, formatNumber, formatPrice, mobileViewport, relativeTime, svgIcon, useDebounce, useEscapeKey, useFetch, useFocusTrap, useFormSubmit, useInView, useLocalStorage, usePWAInstall, usePolling, usePortalTarget, useScrollLock, useShare, useToast };