@nori-ui/core 1.0.6 → 1.1.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/dist/chunk-2UXKXUX2.js +286 -0
- package/dist/chunk-2UXKXUX2.js.map +1 -0
- package/dist/{chunk-DDGMLLS3.js → chunk-46OT4PA6.js} +3 -3
- package/dist/{chunk-DDGMLLS3.js.map → chunk-46OT4PA6.js.map} +1 -1
- package/dist/{chunk-SFNDR6DI.js → chunk-5BM6H2CD.js} +3 -3
- package/dist/{chunk-SFNDR6DI.js.map → chunk-5BM6H2CD.js.map} +1 -1
- package/dist/{chunk-EWWQQ5DB.js → chunk-6JVUVBZH.js} +5 -5
- package/dist/{chunk-EWWQQ5DB.js.map → chunk-6JVUVBZH.js.map} +1 -1
- package/dist/{chunk-FT2XBBQJ.js → chunk-6PO2IWB3.js} +8 -5
- package/dist/chunk-6PO2IWB3.js.map +1 -0
- package/dist/{chunk-YNKKEO2A.js → chunk-7D2BHQ6M.js} +3 -3
- package/dist/{chunk-YNKKEO2A.js.map → chunk-7D2BHQ6M.js.map} +1 -1
- package/dist/{chunk-MRJWPRCX.js → chunk-AFQIK6JI.js} +3 -3
- package/dist/{chunk-MRJWPRCX.js.map → chunk-AFQIK6JI.js.map} +1 -1
- package/dist/{chunk-IKLA2CVQ.js → chunk-C6TRLHMW.js} +21 -5
- package/dist/chunk-C6TRLHMW.js.map +1 -0
- package/dist/{chunk-NRYWNOG5.js → chunk-CGQIVFCN.js} +3 -3
- package/dist/{chunk-NRYWNOG5.js.map → chunk-CGQIVFCN.js.map} +1 -1
- package/dist/chunk-EFK7726V.js +104 -0
- package/dist/chunk-EFK7726V.js.map +1 -0
- package/dist/{chunk-3BDDPFCI.js → chunk-FDBQOQMW.js} +3 -3
- package/dist/{chunk-3BDDPFCI.js.map → chunk-FDBQOQMW.js.map} +1 -1
- package/dist/{chunk-XALU6LOT.js → chunk-GELLSU64.js} +3 -3
- package/dist/{chunk-XALU6LOT.js.map → chunk-GELLSU64.js.map} +1 -1
- package/dist/{chunk-BZLT6R62.js → chunk-GRDVE3IR.js} +3 -3
- package/dist/{chunk-BZLT6R62.js.map → chunk-GRDVE3IR.js.map} +1 -1
- package/dist/{chunk-OMU4R4Y5.js → chunk-HTF6FDB6.js} +3 -3
- package/dist/{chunk-OMU4R4Y5.js.map → chunk-HTF6FDB6.js.map} +1 -1
- package/dist/{chunk-X7APG7G2.js → chunk-HZKXPN6B.js} +154 -34
- package/dist/chunk-HZKXPN6B.js.map +1 -0
- package/dist/{chunk-WGT345SV.js → chunk-IGLMPAWE.js} +3 -3
- package/dist/{chunk-WGT345SV.js.map → chunk-IGLMPAWE.js.map} +1 -1
- package/dist/{chunk-5XEGZFG5.js → chunk-LWQZ257T.js} +3 -3
- package/dist/{chunk-5XEGZFG5.js.map → chunk-LWQZ257T.js.map} +1 -1
- package/dist/{chunk-RFW5SRZA.js → chunk-MJ4AGXS7.js} +3 -3
- package/dist/{chunk-RFW5SRZA.js.map → chunk-MJ4AGXS7.js.map} +1 -1
- package/dist/{chunk-PNP7L4TA.js → chunk-RM5TSXVE.js} +3 -3
- package/dist/{chunk-PNP7L4TA.js.map → chunk-RM5TSXVE.js.map} +1 -1
- package/dist/{chunk-MKSDYRWQ.js → chunk-SINLREQV.js} +3 -3
- package/dist/{chunk-MKSDYRWQ.js.map → chunk-SINLREQV.js.map} +1 -1
- package/dist/{chunk-TLS54G6Y.js → chunk-UF5OENHV.js} +3 -3
- package/dist/{chunk-TLS54G6Y.js.map → chunk-UF5OENHV.js.map} +1 -1
- package/dist/{chunk-ZQMNGPLE.js → chunk-UJ5KFRDE.js} +18 -6
- package/dist/chunk-UJ5KFRDE.js.map +1 -0
- package/dist/{chunk-SWC5CNKE.js → chunk-UPVNZPFV.js} +3 -3
- package/dist/{chunk-SWC5CNKE.js.map → chunk-UPVNZPFV.js.map} +1 -1
- package/dist/{chunk-3F4TXKDY.js → chunk-UUXWRDWW.js} +3 -3
- package/dist/chunk-UUXWRDWW.js.map +1 -0
- package/dist/{chunk-7GPDNQSX.js → chunk-V2AWSDDZ.js} +5 -5
- package/dist/{chunk-7GPDNQSX.js.map → chunk-V2AWSDDZ.js.map} +1 -1
- package/dist/{chunk-JQQ3FBN7.js → chunk-VCJF75T2.js} +3 -3
- package/dist/{chunk-JQQ3FBN7.js.map → chunk-VCJF75T2.js.map} +1 -1
- package/dist/{chunk-ZBW3BA5R.js → chunk-VMAGFYHG.js} +39 -4
- package/dist/chunk-VMAGFYHG.js.map +1 -0
- package/dist/{chunk-JZ774T7U.js → chunk-W3HMOOON.js} +3 -3
- package/dist/{chunk-JZ774T7U.js.map → chunk-W3HMOOON.js.map} +1 -1
- package/dist/{chunk-6AD6KCVB.js → chunk-WAKKQROH.js} +3 -3
- package/dist/{chunk-6AD6KCVB.js.map → chunk-WAKKQROH.js.map} +1 -1
- package/dist/{chunk-LVWNMQGR.js → chunk-WDNDTSNX.js} +5 -5
- package/dist/{chunk-LVWNMQGR.js.map → chunk-WDNDTSNX.js.map} +1 -1
- package/dist/chunk-WOF67PKT.js +60 -0
- package/dist/chunk-WOF67PKT.js.map +1 -0
- package/dist/{chunk-QJNV7YQP.js → chunk-WTNDPO2V.js} +39 -4
- package/dist/chunk-WTNDPO2V.js.map +1 -0
- package/dist/{chunk-FEPTH5RV.js → chunk-XP55RZ3D.js} +3 -3
- package/dist/{chunk-FEPTH5RV.js.map → chunk-XP55RZ3D.js.map} +1 -1
- package/dist/{chunk-CCUXO2HN.js → chunk-Y4ZRSW35.js} +3 -3
- package/dist/{chunk-CCUXO2HN.js.map → chunk-Y4ZRSW35.js.map} +1 -1
- package/dist/client.cjs +619 -123
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +40 -38
- package/dist/client.js.map +1 -1
- package/dist/components/Accordion/index.js +2 -2
- package/dist/components/Alert/index.js +2 -2
- package/dist/components/AlertDialog/index.js +2 -2
- package/dist/components/Avatar/index.js +2 -2
- package/dist/components/Badge/index.js +2 -2
- package/dist/components/Box/index.js +4 -4
- package/dist/components/Breadcrumb/index.cjs +6 -3
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.js +5 -5
- package/dist/components/Button/index.js +2 -2
- package/dist/components/Calendar/index.cjs +170 -35
- package/dist/components/Calendar/index.cjs.map +1 -1
- package/dist/components/Calendar/index.js +5 -5
- package/dist/components/Card/index.js +2 -2
- package/dist/components/Checkbox/index.cjs +36 -1
- package/dist/components/Checkbox/index.cjs.map +1 -1
- package/dist/components/Checkbox/index.d.cts +17 -1
- package/dist/components/Checkbox/index.d.ts +17 -1
- package/dist/components/Checkbox/index.js +2 -2
- package/dist/components/Dialog/index.js +2 -2
- package/dist/components/Field/index.cjs +703 -0
- package/dist/components/Field/index.cjs.map +1 -0
- package/dist/components/Field/index.d.cts +51 -0
- package/dist/components/Field/index.d.ts +51 -0
- package/dist/components/Field/index.js +9 -0
- package/dist/components/Field/index.js.map +1 -0
- package/dist/components/FloatButton/index.cjs +6 -3
- package/dist/components/FloatButton/index.cjs.map +1 -1
- package/dist/components/FloatButton/index.js +5 -5
- package/dist/components/HStack/index.js +4 -4
- package/dist/components/InputGroup/index.cjs.map +1 -1
- package/dist/components/InputGroup/index.d.cts +8 -1
- package/dist/components/InputGroup/index.d.ts +8 -1
- package/dist/components/InputGroup/index.js +2 -2
- package/dist/components/Label/index.cjs +458 -0
- package/dist/components/Label/index.cjs.map +1 -0
- package/dist/components/Label/index.d.cts +14 -0
- package/dist/components/Label/index.d.ts +14 -0
- package/dist/components/Label/index.js +8 -0
- package/dist/components/Label/index.js.map +1 -0
- package/dist/components/Pagination/index.cjs +21 -6
- package/dist/components/Pagination/index.cjs.map +1 -1
- package/dist/components/Pagination/index.js +5 -5
- package/dist/components/Popover/index.js +2 -2
- package/dist/components/Progress/index.js +2 -2
- package/dist/components/Radio/index.cjs +18 -2
- package/dist/components/Radio/index.cjs.map +1 -1
- package/dist/components/Radio/index.d.cts +17 -1
- package/dist/components/Radio/index.d.ts +17 -1
- package/dist/components/Radio/index.js +2 -2
- package/dist/components/SegmentedControl/index.js +2 -2
- package/dist/components/Select/index.cjs +15 -3
- package/dist/components/Select/index.cjs.map +1 -1
- package/dist/components/Select/index.d.cts +6 -0
- package/dist/components/Select/index.d.ts +6 -0
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Switch/index.cjs +36 -1
- package/dist/components/Switch/index.cjs.map +1 -1
- package/dist/components/Switch/index.d.cts +17 -1
- package/dist/components/Switch/index.d.ts +17 -1
- package/dist/components/Switch/index.js +2 -2
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Text/index.js +2 -2
- package/dist/components/TextArea/index.cjs +35 -84
- package/dist/components/TextArea/index.cjs.map +1 -1
- package/dist/components/TextArea/index.js +3 -3
- package/dist/components/TextInput/index.cjs +35 -84
- package/dist/components/TextInput/index.cjs.map +1 -1
- package/dist/components/TextInput/index.d.cts +7 -8
- package/dist/components/TextInput/index.d.ts +7 -8
- package/dist/components/TextInput/index.js +2 -2
- package/dist/components/Toggle/index.js +2 -2
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/VStack/index.js +4 -4
- package/dist/i18n/index.cjs +6 -3
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/index.cjs +619 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +37 -35
- package/package.json +8 -1
- package/dist/chunk-3F4TXKDY.js.map +0 -1
- package/dist/chunk-FT2XBBQJ.js.map +0 -1
- package/dist/chunk-IKLA2CVQ.js.map +0 -1
- package/dist/chunk-QJNV7YQP.js.map +0 -1
- package/dist/chunk-X7APG7G2.js.map +0 -1
- package/dist/chunk-ZBW3BA5R.js.map +0 -1
- package/dist/chunk-ZQMNGPLE.js.map +0 -1
- package/dist/chunk-ZRD4FQBT.js +0 -153
- package/dist/chunk-ZRD4FQBT.js.map +0 -1
|
@@ -3,9 +3,6 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
import { TextInputProps as TextInputProps$1 } from 'react-native';
|
|
4
4
|
|
|
5
5
|
type TextInputProps = Omit<TextInputProps$1, 'editable'> & {
|
|
6
|
-
label?: string;
|
|
7
|
-
helperText?: string;
|
|
8
|
-
error?: string;
|
|
9
6
|
disabled?: boolean;
|
|
10
7
|
leading?: ReactNode;
|
|
11
8
|
trailing?: ReactNode;
|
|
@@ -13,6 +10,8 @@ type TextInputProps = Omit<TextInputProps$1, 'editable'> & {
|
|
|
13
10
|
containerClassName?: string;
|
|
14
11
|
className?: string;
|
|
15
12
|
testID?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
name?: string;
|
|
16
15
|
/** Controlled text handler. Optional so uncontrolled usage works too. */
|
|
17
16
|
onChangeText?: (text: string) => void;
|
|
18
17
|
/** Multi-line mode — flipped by TextArea. Default false. */
|
|
@@ -20,14 +19,14 @@ type TextInputProps = Omit<TextInputProps$1, 'editable'> & {
|
|
|
20
19
|
numberOfLines?: number;
|
|
21
20
|
};
|
|
22
21
|
/**
|
|
23
|
-
* Single-line text input with
|
|
22
|
+
* Single-line text input with leading/trailing slots.
|
|
24
23
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* Wrap in <Field> + <Field.Control> to get label, description, error, and
|
|
25
|
+
* full a11y wiring (aria-labelledby, aria-describedby, aria-invalid).
|
|
27
26
|
*
|
|
28
|
-
* Color flips with the active scheme — the field surface, border,
|
|
27
|
+
* Color flips with the active scheme — the field surface, border, and
|
|
29
28
|
* placeholder all read from the resolved palette via `useThemeColors`.
|
|
30
29
|
*/
|
|
31
|
-
declare const TextInput: ({
|
|
30
|
+
declare const TextInput: ({ disabled, leading, trailing, containerClassName, className, testID, id, name, onChangeText, multiline, numberOfLines, ...rest }: TextInputProps) => react_jsx_runtime.JSX.Element;
|
|
32
31
|
|
|
33
32
|
export { TextInput, type TextInputProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { TextInput } from '../../chunk-
|
|
2
|
-
import '../../chunk-5A2QOOVN.js';
|
|
1
|
+
export { TextInput } from '../../chunk-EFK7726V.js';
|
|
3
2
|
import '../../chunk-CHXHRJNZ.js';
|
|
3
|
+
import '../../chunk-5A2QOOVN.js';
|
|
4
4
|
import '../../chunk-R5JMDDCB.js';
|
|
5
5
|
import '../../chunk-WCQVDF3K.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { Toggle } from '../../chunk-
|
|
2
|
-
import '../../chunk-5A2QOOVN.js';
|
|
1
|
+
export { Toggle } from '../../chunk-SINLREQV.js';
|
|
3
2
|
import '../../chunk-CHXHRJNZ.js';
|
|
3
|
+
import '../../chunk-5A2QOOVN.js';
|
|
4
4
|
import '../../chunk-R5JMDDCB.js';
|
|
5
5
|
import '../../chunk-WCQVDF3K.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { Tooltip } from '../../chunk-
|
|
1
|
+
export { Tooltip } from '../../chunk-CGQIVFCN.js';
|
|
2
2
|
import '../../chunk-ZIBNLXIV.js';
|
|
3
|
-
import '../../chunk-5A2QOOVN.js';
|
|
4
3
|
import '../../chunk-CHXHRJNZ.js';
|
|
4
|
+
import '../../chunk-5A2QOOVN.js';
|
|
5
5
|
import '../../chunk-R5JMDDCB.js';
|
|
6
6
|
import '../../chunk-WCQVDF3K.js';
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { VStack } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-5A2QOOVN.js';
|
|
1
|
+
export { VStack } from '../../chunk-AFQIK6JI.js';
|
|
2
|
+
import '../../chunk-VCJF75T2.js';
|
|
3
|
+
import '../../chunk-W3HMOOON.js';
|
|
5
4
|
import '../../chunk-CHXHRJNZ.js';
|
|
5
|
+
import '../../chunk-5A2QOOVN.js';
|
|
6
6
|
import '../../chunk-R5JMDDCB.js';
|
|
7
7
|
import '../../chunk-WCQVDF3K.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/i18n/index.cjs
CHANGED
|
@@ -36,8 +36,8 @@ var defaultDictionary = {
|
|
|
36
36
|
// floatButton
|
|
37
37
|
"floatButton.backToTop": "Back to top",
|
|
38
38
|
// calendar
|
|
39
|
-
"calendar.header.previous": "Previous",
|
|
40
|
-
"calendar.header.next": "Next",
|
|
39
|
+
"calendar.header.previous": "Previous month",
|
|
40
|
+
"calendar.header.next": "Next month",
|
|
41
41
|
"calendar.header.openMonthView": "Open month picker",
|
|
42
42
|
"calendar.header.openYearView": "Open year picker",
|
|
43
43
|
"calendar.header.openDayView": "Open day picker",
|
|
@@ -53,7 +53,10 @@ var defaultDictionary = {
|
|
|
53
53
|
"checkbox.checked": "Checked",
|
|
54
54
|
"checkbox.unchecked": "Unchecked",
|
|
55
55
|
"switch.on": "On",
|
|
56
|
-
"switch.off": "Off"
|
|
56
|
+
"switch.off": "Off",
|
|
57
|
+
// field
|
|
58
|
+
"field.requiredIndicator": "*",
|
|
59
|
+
"field.requiredLabel": "required"
|
|
57
60
|
};
|
|
58
61
|
|
|
59
62
|
// src/i18n/resolve.ts
|
package/dist/i18n/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/i18n/default-dictionary.ts","../../src/i18n/resolve.ts"],"names":[],"mappings":";;;;;;AAWO,IAAM,iBAAA,GAAgC;AAAA;AAAA,EAEzC,eAAA,EAAiB,QAAA;AAAA,EACjB,gBAAA,EAAkB,SAAA;AAAA,EAClB,cAAA,EAAgB,OAAA;AAAA,EAChB,aAAA,EAAe,MAAA;AAAA,EACf,gBAAA,EAAkB,SAAA;AAAA,EAClB,cAAA,EAAgB,sBAAA;AAAA,EAChB,c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ACX;AACA,EAAA,OAAO,QAAA,CAAS,OAAA,CAAQ,kCAAA,EAAoC,CAAC,QAAQ,IAAA,KAAiB;AAClF,IAAA,MAAM,KAAA,GAAQ,QAAQ,IAAI,CAAA;AAC1B,IAAA,OAAO,UAAU,MAAA,IAAa,KAAA,KAAU,IAAA,GAAO,EAAA,GAAK,OAAO,KAAK,CAAA;AAAA,EACpE,CAAC,CAAA;AACL;AARS,MAAA,CAAA,WAAA,EAAA,aAAA,CAAA","file":"index.cjs","sourcesContent":["import type { Dictionary } from './types';\n\n/**\n * Default English strings used by library components.\n *\n * Key naming convention:\n * <component>.<purpose>[_plural-form]\n *\n * Plural suffixes follow i18next: `_zero`, `_one`, `_two`, `_few`, `_many`, `_other`.\n * Interpolation uses `{{name}}` — double braces, no spaces, by convention.\n */\nexport const defaultDictionary: Dictionary = {\n // generic / shared\n 'common.cancel': 'Cancel',\n 'common.confirm': 'Confirm',\n 'common.close': 'Close',\n 'common.back': 'Back',\n 'common.loading': 'Loading',\n 'common.error': 'Something went wrong',\n 'common.retry': 'Try again',\n\n // breadcrumb\n 'breadcrumb.ariaLabel': 'Breadcrumb',\n 'breadcrumb.expandLabel': 'Show full path',\n 'breadcrumb.ellipsisLabel': 'More',\n 'breadcrumb.currentPageLabel': 'Current page',\n 'breadcrumb.siblingMenuLabel': 'Open sibling pages',\n\n // pagination\n 'pagination.ariaLabel': 'Pagination',\n 'pagination.previous': 'Previous page',\n 'pagination.next': 'Next page',\n 'pagination.first': 'First page',\n 'pagination.last': 'Last page',\n 'pagination.ellipsis': 'More pages',\n 'pagination.currentPage': 'Current page',\n 'pagination.gotoPage': 'Go to page {{page}}',\n 'pagination.range': 'Showing {{from}}–{{to}} of {{total}}',\n 'pagination.pageOf': 'Page {{page}} of {{total}}',\n 'pagination.pageSizeLabel': 'Items per page',\n 'pagination.jumperLabel': 'Go to page',\n 'pagination.jumperPlaceholder': '#',\n\n // floatButton\n 'floatButton.backToTop': 'Back to top',\n\n // calendar\n 'calendar.header.previous': 'Previous month',\n 'calendar.header.next': 'Next month',\n 'calendar.header.openMonthView': 'Open month picker',\n 'calendar.header.openYearView': 'Open year picker',\n 'calendar.header.openDayView': 'Open day picker',\n 'calendar.today': 'Today',\n 'calendar.clear': 'Clear',\n\n // button\n 'button.loadingLabel': 'Loading',\n\n // input\n 'input.clear': 'Clear',\n 'input.passwordShow': 'Show password',\n 'input.passwordHide': 'Hide password',\n\n // checkbox / switch\n 'checkbox.checked': 'Checked',\n 'checkbox.unchecked': 'Unchecked',\n 'switch.on': 'On',\n 'switch.off': 'Off',\n\n // field\n 'field.requiredIndicator': '*',\n 'field.requiredLabel': 'required',\n};\n","import type { Dictionary, I18nInput, I18nOptions, TranslateFn } from './types';\n\n/**\n * Normalizes the consumer's i18n input (undefined | dictionary | function) into a\n * uniform TranslateFn. Internal code only calls the returned function.\n *\n * Precedence for a given key lookup:\n * 1. consumer function (if provided) — called verbatim, no further fallback\n * 2. consumer dictionary (if provided)\n * 3. library defaults\n * 4. options.defaultValue\n * 5. the key itself (so missing strings are visible in dev, not silent)\n */\nexport function resolveI18n(input: I18nInput, defaults: Dictionary): TranslateFn {\n if (typeof input === 'function') {\n // Wrap so the consumer fn is always invoked with (key, options) — enables\n // Jest `toHaveBeenCalledWith(key, undefined)` assertions and mirrors i18next's\n // own call signature exactly.\n return (keyOrKeys, options) => input(keyOrKeys, options);\n }\n\n const dict = input ?? {};\n\n return (keyOrKeys, options) => {\n const keys = Array.isArray(keyOrKeys) ? keyOrKeys : [keyOrKeys];\n for (const rawKey of keys) {\n const key = pluralize(rawKey, options?.count);\n const template = dict[key] ?? defaults[key];\n if (template !== undefined) {\n return interpolate(template, options);\n }\n }\n // exhausted the key list\n const lastKey = keys[keys.length - 1];\n if (options?.defaultValue !== undefined) {\n return interpolate(options.defaultValue, options);\n }\n return lastKey ?? '';\n };\n}\n\nfunction pluralize(key: string, count: number | undefined): string {\n if (count === undefined) {\n return key;\n }\n // Minimal English pluralization — extend with ICU rules later if needed.\n if (count === 1) {\n return `${key}_one`;\n }\n return `${key}_other`;\n}\n\nfunction interpolate(template: string, options: I18nOptions | undefined): string {\n if (!options) {\n return template;\n }\n return template.replace(/\\{\\{\\s*([A-Za-z0-9_.-]+)\\s*\\}\\}/g, (_match, name: string) => {\n const value = options[name];\n return value === undefined || value === null ? '' : String(value);\n });\n}\n"]}
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../chunk-QI6646JZ.js';
|
|
2
|
-
export { defaultDictionary, resolveI18n } from '../chunk-
|
|
2
|
+
export { defaultDictionary, resolveI18n } from '../chunk-6PO2IWB3.js';
|
|
3
3
|
import '../chunk-WCQVDF3K.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|