@m1kapp/kit 0.0.11 → 0.0.16

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
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
2
+ import * as React$1 from 'react';
3
3
  import React__default, { ReactNode, CSSProperties } from 'react';
4
4
  import { MetadataRoute, Viewport } from 'next';
5
5
  import { ClassValue } from 'clsx';
@@ -214,6 +214,12 @@ interface ThemeButtonProps {
214
214
  * - Without `color`: moon (light mode) or sun (dark mode) icon.
215
215
  */
216
216
  declare function ThemeButton({ color, dark: darkProp, onClick, className }: ThemeButtonProps): react_jsx_runtime.JSX.Element;
217
+ interface ThemeDialogLabels {
218
+ title?: string;
219
+ light?: string;
220
+ dark?: string;
221
+ close?: string;
222
+ }
217
223
  interface ThemeDialogProps {
218
224
  open: boolean;
219
225
  onClose: () => void;
@@ -223,12 +229,14 @@ interface ThemeDialogProps {
223
229
  onDarkToggle?: () => void;
224
230
  /** Override the color palette. Defaults to built-in colors. */
225
231
  palette?: Record<string, string>;
232
+ /** Override default Korean labels for i18n */
233
+ labels?: ThemeDialogLabels;
226
234
  }
227
235
  /**
228
236
  * Bottom-sheet style color picker dialog.
229
237
  * Shows a 5-column grid of color circles with check on the active one.
230
238
  */
231
- declare function ThemeDialog({ open, onClose, current, onSelect, dark: darkProp, onDarkToggle, palette, }: ThemeDialogProps): React.ReactPortal | null;
239
+ declare function ThemeDialog({ open, onClose, current, onSelect, dark: darkProp, onDarkToggle, palette, labels: _labels, }: ThemeDialogProps): react_jsx_runtime.JSX.Element;
232
240
 
233
241
  /**
234
242
  * Font presets for @m1kapp/ui.
@@ -324,16 +332,22 @@ interface EmojiButtonProps {
324
332
  * Use it anywhere — tab icons, headers, list items, etc.
325
333
  */
326
334
  declare function EmojiButton({ emoji, onClick, className }: EmojiButtonProps): react_jsx_runtime.JSX.Element;
335
+ interface EmojiPickerLabels {
336
+ title?: string;
337
+ close?: string;
338
+ }
327
339
  interface EmojiPickerProps {
328
340
  open: boolean;
329
341
  onClose: () => void;
330
342
  current: string;
331
343
  onSelect: (emoji: string) => void;
344
+ /** Override default Korean labels for i18n */
345
+ labels?: EmojiPickerLabels;
332
346
  }
333
347
  /**
334
348
  * Bottom-sheet emoji picker with categories.
335
349
  */
336
- declare function EmojiPicker({ open, onClose, current, onSelect }: EmojiPickerProps): React.ReactPortal | null;
350
+ declare function EmojiPicker({ open, onClose, current, onSelect, labels: _labels }: EmojiPickerProps): react_jsx_runtime.JSX.Element;
337
351
 
338
352
  interface TooltipProps {
339
353
  label: string;
@@ -356,14 +370,24 @@ interface GrassMapData {
356
370
  date: string;
357
371
  count: number;
358
372
  }
373
+ interface GrassMapLabels {
374
+ firstRecord?: string;
375
+ noRecord?: string;
376
+ today?: string;
377
+ less?: string;
378
+ more?: string;
379
+ first?: string;
380
+ }
359
381
  interface GrassMapProps {
360
382
  data: GrassMapData[];
361
383
  accent: string;
362
384
  isDark?: boolean;
363
385
  /** Unit label appended to count in tooltip. e.g. "명", "commits". Default: "" */
364
386
  unit?: string;
387
+ /** Override default Korean labels for i18n */
388
+ labels?: GrassMapLabels;
365
389
  }
366
- declare function GrassMap({ data, accent, isDark, unit }: GrassMapProps): react_jsx_runtime.JSX.Element;
390
+ declare function GrassMap({ data, accent, isDark, unit, labels: _labels }: GrassMapProps): react_jsx_runtime.JSX.Element;
367
391
 
368
392
  type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl";
369
393
  type AvatarShape = "circle" | "rounded";
@@ -503,6 +527,15 @@ interface UseInViewResult {
503
527
  */
504
528
  declare function useInView(options?: UseInViewOptions): UseInViewResult;
505
529
 
530
+ /**
531
+ * Traps keyboard focus inside a container while active.
532
+ * Tab / Shift+Tab cycle through focusable elements without escaping.
533
+ *
534
+ * @param active — whether the trap is currently engaged
535
+ * @returns ref to attach to the container element
536
+ */
537
+ declare function useFocusTrap<T extends HTMLElement = HTMLElement>(active: boolean): React$1.RefObject<T | null>;
538
+
506
539
  interface SkeletonProps {
507
540
  /** Tailwind classes for width / height (e.g. "h-4 w-3/4") */
508
541
  className?: string;
@@ -533,26 +566,21 @@ interface DialogProps {
533
566
  children: React__default.ReactNode;
534
567
  /** Hide the backdrop click-to-close behaviour */
535
568
  persistent?: boolean;
569
+ /** Close button aria-label. Default: "닫기" */
570
+ closeLabel?: string;
536
571
  className?: string;
537
572
  }
538
- /**
539
- * Modal dialog with:
540
- * - Portal render (no z-index issues)
541
- * - Backdrop click to close
542
- * - Escape key to close
543
- * - Body scroll lock
544
- * - Smooth scale + fade animation
545
- *
546
- * @example
547
- * <Dialog open={open} onClose={() => setOpen(false)} title="삭제 확인">
548
- * <p className="text-sm text-zinc-500">정말 삭제할까요?</p>
549
- * <div className="flex gap-2 mt-4">
550
- * <Button onClick={handleDelete}>삭제</Button>
551
- * <Button onClick={() => setOpen(false)}>취소</Button>
552
- * </div>
553
- * </Dialog>
554
- */
555
- declare function Dialog({ open, onClose, title, size, children, persistent, className, }: DialogProps): React__default.ReactPortal | null;
573
+ declare function Dialog({ open, onClose, title, size, children, persistent, closeLabel, className, }: DialogProps): react_jsx_runtime.JSX.Element;
574
+
575
+ interface InAppSheetProps {
576
+ open: boolean;
577
+ onClose: () => void;
578
+ children: React.ReactNode;
579
+ className?: string;
580
+ /** true면 시트가 AppShell 전체 높이를 채움 */
581
+ fullHeight?: boolean;
582
+ }
583
+ declare function InAppSheet({ open, onClose, children, className, fullHeight, }: InAppSheetProps): react_jsx_runtime.JSX.Element;
556
584
 
557
585
  type PWAInstallState = "android-ready" | "ios-safari" | "installed" | "unsupported";
558
586
  interface UsePWAInstallReturn {
@@ -597,6 +625,24 @@ interface IOSInstallSheetProps {
597
625
  */
598
626
  declare function IOSInstallSheet({ open, onClose, appName, iconSrc }: IOSInstallSheetProps): react_jsx_runtime.JSX.Element | null;
599
627
 
628
+ /**
629
+ * Drop into <head> in your root layout to pre-load kit styles and
630
+ * prevent the JS injection from re-running (eliminates FOUC).
631
+ *
632
+ * Usage:
633
+ * // app/layout.tsx
634
+ * import { KitStyles } from "@m1kapp/kit/pwa";
635
+ * <head>
636
+ * <KitStyles />
637
+ * </head>
638
+ */
639
+ declare function KitStyles(): React__default.DetailedReactHTMLElement<{
640
+ "data-m1kapp-ui": string;
641
+ dangerouslySetInnerHTML: {
642
+ __html: string;
643
+ };
644
+ }, HTMLElement>;
645
+
600
646
  /**
601
647
  * Standard mobile viewport config for Next.js.
602
648
  * - Disables pinch zoom via maximumScale (Android, older iOS)
@@ -749,4 +795,4 @@ declare function formatPrice(amount: number, currency?: string, locale?: string)
749
795
 
750
796
  declare function cn(...inputs: ClassValue[]): string;
751
797
 
752
- 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 EmojiPickerProps, EmptyState, type EmptyStateProps, type FontName, GrassMap, type GrassMapData, type GrassMapProps, IOSInstallSheet, 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 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, useFormSubmit, useInView, useLocalStorage, usePWAInstall, usePolling, useShare, useToast };
798
+ 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, 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 };