@saykit/react 0.7.0 → 0.8.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.
package/README.md CHANGED
@@ -23,7 +23,7 @@ function App() {
23
23
  return (
24
24
  <SayProvider locale="fr" messages={fr}>
25
25
  <Say>Hello, {name}!</Say>
26
- <Say.Plural _={count} one="# item" other="# items" />
26
+ <Say.Plural _={count} one={<>{count} item</>} other={<>{count} items</>} />
27
27
  </SayProvider>
28
28
  );
29
29
  }
package/dist/index.d.mts CHANGED
@@ -35,7 +35,7 @@ declare namespace Say {
35
35
  * <Say.Plural
36
36
  * _={count}
37
37
  * one="You have 1 item"
38
- * other="You have # items"
38
+ * other={<>You have {count} items</>}
39
39
  * />
40
40
  * ```
41
41
  *
@@ -46,7 +46,7 @@ declare namespace Say {
46
46
  */
47
47
  function Plural(props: {
48
48
  _: number | Named<number>;
49
- } & PropsWithJSXSafeKeys<Disallow<NumeralOptions, 'id' | 'context'>>): ReactNode;
49
+ } & PropsWithJSXSafeKeys<Disallow<NumeralOptions<ReactNode>, 'id' | 'context'>>): ReactNode;
50
50
  /**
51
51
  * Define an ordinal message (e.g. "1st", "2nd", "3rd").
52
52
  *
@@ -54,10 +54,10 @@ declare namespace Say {
54
54
  * ```tsx
55
55
  * <Say.Ordinal
56
56
  * _={position}
57
- * 1="#st"
58
- * 2="#nd"
59
- * 3="#rd"
60
- * other="#th"
57
+ * 1={<>{position}st</>}
58
+ * 2={<>{position}nd</>}
59
+ * 3={<>{position}rd</>}
60
+ * other={<>{position}th</>}
61
61
  * />
62
62
  * ```
63
63
  *
@@ -68,7 +68,7 @@ declare namespace Say {
68
68
  */
69
69
  function Ordinal(props: {
70
70
  _: number | Named<number>;
71
- } & PropsWithJSXSafeKeys<Disallow<NumeralOptions, 'id' | 'context'>>): ReactNode;
71
+ } & PropsWithJSXSafeKeys<Disallow<NumeralOptions<ReactNode>, 'id' | 'context'>>): ReactNode;
72
72
  /**
73
73
  * Define a select message, useful for handling gender, status, or other categories.
74
74
  *
@@ -89,7 +89,7 @@ declare namespace Say {
89
89
  */
90
90
  function Select(props: {
91
91
  _: string | number | Named<string | number>;
92
- } & PropsWithJSXSafeKeys<Disallow<SelectOptions, 'id' | 'context'>>): ReactNode;
92
+ } & PropsWithJSXSafeKeys<Disallow<SelectOptions<ReactNode>, 'id' | 'context'>>): ReactNode;
93
93
  /**
94
94
  * Format a number the way the active locale writes one.
95
95
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saykit/react",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "React integration for saykit, i18n hooks and components",
5
5
  "keywords": [
6
6
  "i18n",
@@ -52,7 +52,7 @@
52
52
  "jsdom": "^29.1.1",
53
53
  "react": "^19.2.8",
54
54
  "react-dom": "^19.2.8",
55
- "saykit": "^0.7.0"
55
+ "saykit": "^0.8.0"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "react": "*",