@srimandir/common 1.6.0 → 1.7.0

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
+ import { default as React } from 'react';
2
+ export interface I18nContextValue<Locale extends string = string> {
3
+ locale: Locale;
4
+ t: (key: string) => string;
5
+ }
6
+ export interface I18nProviderProps<Locale extends string = string> {
7
+ locale: Locale;
8
+ children: React.ReactNode;
9
+ }
10
+ /**
11
+ * Builds a locale-scoped `I18nProvider`/`useI18n` pair for a product package's
12
+ * own translation dictionary. Each call produces an isolated context, so
13
+ * packages don't share state — only the plumbing is shared.
14
+ */
15
+ export declare function createI18n<Locale extends string>(translations: Record<Locale, Record<string, string>>): {
16
+ I18nProvider: React.FC<I18nProviderProps<Locale>>;
17
+ useI18n: () => I18nContextValue<Locale> | null;
18
+ };
@@ -0,0 +1,2 @@
1
+ export { createI18n } from './createI18n';
2
+ export type { I18nContextValue, I18nProviderProps } from './createI18n';
package/dist/index.d.ts CHANGED
@@ -8,3 +8,6 @@
8
8
  */
9
9
  export { BottomSheet } from './components/BottomSheet';
10
10
  export type { BottomSheetProps } from './components/BottomSheet';
11
+ export { cn } from './utils/cn';
12
+ export { createI18n } from './i18n';
13
+ export type { I18nContextValue } from './i18n';
@@ -0,0 +1,2 @@
1
+ import { ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@srimandir/common",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Generic, product-agnostic UI primitives (bottom sheet, buttons, modals) shared across the Srimandir packages",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -28,6 +28,10 @@
28
28
  "dev": "vite build --watch",
29
29
  "build": "vite build"
30
30
  },
31
+ "dependencies": {
32
+ "clsx": "^2.1.1",
33
+ "tailwind-merge": "^3.6.0"
34
+ },
31
35
  "peerDependencies": {
32
36
  "react": "^18.0.0",
33
37
  "react-dom": "^18.0.0"
@@ -49,6 +53,5 @@
49
53
  "srimandir",
50
54
  "react"
51
55
  ],
52
- "license": "MIT",
53
- "gitHead": "68d150b07603d894f514219c67a003e6753004cf"
56
+ "license": "MIT"
54
57
  }