@molecule/app-ui-react-native 1.0.6 → 1.0.8

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
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-11-08T06:24:54.101Z
6
+ Generated: 2026-11-13T16:13:06.445Z
7
7
  -->
8
8
 
9
9
  # @molecule/app-ui-react-native
@@ -56,7 +56,7 @@ function Greeting() {
56
56
  ## Installation
57
57
 
58
58
  ```bash
59
- npm install @molecule/app-ui-react-native @molecule/app-i18n @molecule/app-icons @molecule/app-ui react react-native
59
+ npm install @molecule/app-ui-react-native @molecule/app-i18n @molecule/app-icons @molecule/app-react @molecule/app-ui react react-native
60
60
  ```
61
61
 
62
62
  ## API
@@ -2111,6 +2111,7 @@ Peer dependencies:
2111
2111
 
2112
2112
  - `@molecule/app-i18n` ^1.0.1
2113
2113
  - `@molecule/app-icons` ^1.0.1
2114
+ - `@molecule/app-react` ^4.4.0
2114
2115
  - `@molecule/app-ui` ^1.0.1
2115
2116
  - `react` ^18.0.0 || ^19.0.0
2116
2117
  - `react-native` >=0.72.0
@@ -2119,6 +2120,7 @@ Peer dependencies:
2119
2120
 
2120
2121
  - `@molecule/app-i18n`
2121
2122
  - `@molecule/app-icons`
2123
+ - `@molecule/app-react`
2122
2124
  - `@molecule/app-ui`
2123
2125
  - `react`
2124
2126
  - `react-native`
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../src/components/Accordion.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA+C,MAAM,OAAO,CAAA;AAInE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAatD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAuE9C,CAAA"}
1
+ {"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../src/components/Accordion.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA+C,MAAM,OAAO,CAAA;AAInE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAatD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAwE9C,CAAA"}
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  */
7
7
  import { createContext, useCallback, useState } from 'react';
8
8
  import { Pressable, Text, View } from 'react-native';
9
- import { t } from '@molecule/app-i18n';
9
+ import { useTranslation } from '@molecule/app-react';
10
10
  import { getClassMap } from '@molecule/app-ui';
11
11
  const AccordionContext = createContext({
12
12
  openItems: [],
@@ -26,6 +26,7 @@ const AccordionContext = createContext({
26
26
  * @returns The rendered Accordion element.
27
27
  */
28
28
  export const Accordion = ({ items = [], multiple = false, defaultValue, value: controlledValue, onChange, collapsible = true, className, testId, }) => {
29
+ const { t } = useTranslation();
29
30
  const cm = getClassMap();
30
31
  const normalize = (v) => {
31
32
  if (!v)
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../src/components/Alert.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAsCtC,CAAA"}
1
+ {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../src/components/Alert.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAuCtC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Pressable, Text, View } from 'react-native';
3
- import { t } from '@molecule/app-i18n';
3
+ import { useTranslation } from '@molecule/app-react';
4
4
  import { getClassMap } from '@molecule/app-ui';
5
5
  /**
6
6
  * Renders an Alert component.
@@ -17,6 +17,7 @@ import { getClassMap } from '@molecule/app-ui';
17
17
  * @returns The rendered Alert element.
18
18
  */
19
19
  export const Alert = ({ children, title, variant: _variant = 'subtle', status, icon, dismissible, onDismiss, className, testId, }) => {
20
+ const { t } = useTranslation();
20
21
  const cm = getClassMap();
21
22
  const classes = cm.cn(cm.alert({
22
23
  variant: (status || 'default'),
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/components/Avatar.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA8CxC,CAAA"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/components/Avatar.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA+CxC,CAAA"}
@@ -6,7 +6,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
6
6
  */
7
7
  import { useState } from 'react';
8
8
  import { Image, Text, View } from 'react-native';
9
- import { t } from '@molecule/app-i18n';
9
+ import { useTranslation } from '@molecule/app-react';
10
10
  import { getClassMap } from '@molecule/app-ui';
11
11
  /**
12
12
  * Renders an Avatar component.
@@ -22,6 +22,7 @@ import { getClassMap } from '@molecule/app-ui';
22
22
  * @returns The rendered Avatar element.
23
23
  */
24
24
  export const Avatar = ({ src, alt, name, fallback, size = 'md', rounded = true, className, testId, }) => {
25
+ const { t } = useTranslation();
25
26
  const cm = getClassMap();
26
27
  const [imageError, setImageError] = useState(false);
27
28
  const namedSize = typeof size === 'string' ? size : undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAGrD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA4C5C,CAAA"}
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAGrD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA6C5C,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Pressable, Text, View } from 'react-native';
3
- import { t } from '@molecule/app-i18n';
3
+ import { useTranslation } from '@molecule/app-react';
4
4
  import { getClassMap } from '@molecule/app-ui';
5
5
  /**
6
6
  * Renders a Checkbox component.
@@ -16,6 +16,7 @@ import { getClassMap } from '@molecule/app-ui';
16
16
  * @returns The rendered Checkbox element.
17
17
  */
18
18
  export const Checkbox = ({ label, checked, indeterminate, onChange, error, disabled, className, testId, }) => {
19
+ const { t } = useTranslation();
19
20
  const cm = getClassMap();
20
21
  const boxClasses = cm.cn(cm.checkbox({ error: !!error }), className);
21
22
  return (_jsxs(Pressable, { className: cm.controlLabel, onPress: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAkC,MAAM,OAAO,CAAA;AACtD,OAAO,EAAmB,SAAS,EAAQ,MAAM,cAAc,CAAA;AAG/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD;;GAEG;AACH,eAAO,MAAM,KAAK,8EA8FjB,CAAA"}
1
+ {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAkC,MAAM,OAAO,CAAA;AACtD,OAAO,EAAmB,SAAS,EAAQ,MAAM,cAAc,CAAA;AAG/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD;;GAEG;AACH,eAAO,MAAM,KAAK,8EAoGjB,CAAA"}
@@ -6,12 +6,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  */
7
7
  import { forwardRef, useCallback } from 'react';
8
8
  import { Pressable, Text, TextInput, View } from 'react-native';
9
- import { t } from '@molecule/app-i18n';
9
+ import { useTranslation } from '@molecule/app-react';
10
10
  import { getClassMap } from '@molecule/app-ui';
11
11
  /**
12
12
  * Text input component.
13
13
  */
14
14
  export const Input = forwardRef(({ label, error, hint, size = 'md', leftElement, rightElement, clearable, className, style, testId, disabled, type, placeholder, value, onChange, onFocus, onBlur, required, ..._rest }, ref) => {
15
+ const { t } = useTranslation();
15
16
  const cm = getClassMap();
16
17
  const inputClasses = cm.cn(cm.input({ error: !!error, size }), !!leftElement && cm.inputPadLeft, !!(rightElement || clearable) && cm.inputPadRight, className);
17
18
  const handleClear = useCallback(() => {
@@ -32,5 +33,5 @@ export const Input = forwardRef(({ label, error, hint, size = 'md', leftElement,
32
33
  if (onChange) {
33
34
  onChange({ target: { value: text } });
34
35
  }
35
- }, onFocus: onFocus, onBlur: onBlur, secureTextEntry: secureTextEntry, keyboardType: keyboardType, accessibilityLabel: typeof label === 'string' ? label : undefined }), clearable && !!value && (_jsx(Pressable, { className: cm.inputClearButton, onPress: handleClear, children: _jsx(Text, { children: t('ui.input.clear', undefined, { defaultValue: '×' }) }) })), !!rightElement && !clearable && (_jsx(View, { className: cm.inputRightElement, children: rightElement }))] }), !!error && typeof error === 'string' && _jsx(Text, { className: cm.formError, children: error }), !!hint && !error && _jsx(Text, { className: cm.formHint, children: hint })] }));
36
+ }, onFocus: onFocus, onBlur: onBlur, secureTextEntry: secureTextEntry, keyboardType: keyboardType, accessibilityLabel: typeof label === 'string' ? label : undefined }), clearable && !!value && (_jsx(Pressable, { className: cm.inputClearButton, onPress: handleClear, accessibilityRole: "button", accessibilityLabel: t('ui.input.clear', undefined, { defaultValue: 'Clear' }), children: _jsx(Text, { children: t('ui.icon.close', undefined, { defaultValue: '✕' }) }) })), !!rightElement && !clearable && (_jsx(View, { className: cm.inputRightElement, children: rightElement }))] }), !!error && typeof error === 'string' && _jsx(Text, { className: cm.formError, children: error }), !!hint && !error && _jsx(Text, { className: cm.formHint, children: hint })] }));
36
37
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/components/Modal.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA0CtC,CAAA"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/components/Modal.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA2CtC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Modal as RNModal, Pressable, ScrollView, Text, View } from 'react-native';
3
- import { t } from '@molecule/app-i18n';
3
+ import { useTranslation } from '@molecule/app-react';
4
4
  import { getClassMap } from '@molecule/app-ui';
5
5
  /**
6
6
  * Renders a Modal component.
@@ -16,6 +16,7 @@ import { getClassMap } from '@molecule/app-ui';
16
16
  * @returns The rendered Modal element.
17
17
  */
18
18
  export const Modal = ({ children, open, onClose, title, size = 'md', footer, className, testId, }) => {
19
+ const { t } = useTranslation();
19
20
  const cm = getClassMap();
20
21
  const contentClasses = cm.cn(cm.modal({ size }), className);
21
22
  return (_jsx(RNModal, { visible: !!open, transparent: true, animationType: "fade", onRequestClose: onClose, testID: testId, children: _jsx(Pressable, { className: cm.dialogOverlay, onPress: onClose, accessibilityRole: "none", children: _jsx(View, { className: cm.cn(cm.dialogWrapper, cm.pointerEventsAuto), children: _jsxs(Pressable, { className: contentClasses, onPress: (e) => e.stopPropagation(), children: [_jsxs(View, { className: cm.dialogHeader, children: [!!title && _jsx(Text, { className: cm.dialogTitle, children: title }), _jsx(Pressable, { className: cm.dialogClose, onPress: onClose, accessibilityLabel: t('ui.modal.close', undefined, { defaultValue: 'Close' }), accessibilityRole: "button", children: _jsx(Text, { children: t('ui.icon.close', undefined, { defaultValue: '✕' }) }) })] }), _jsx(ScrollView, { className: cm.dialogBody, children: children }), !!footer && _jsx(View, { className: cm.dialogFooter, children: footer })] }) }) }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/components/Pagination.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAGvD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyHhD,CAAA"}
1
+ {"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/components/Pagination.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAGvD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAkIhD,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Pressable, Text, View } from 'react-native';
3
- import { t } from '@molecule/app-i18n';
3
+ import { useTranslation } from '@molecule/app-react';
4
4
  import { getClassMap } from '@molecule/app-ui';
5
5
  /**
6
6
  * Renders a Pagination component.
@@ -17,6 +17,7 @@ import { getClassMap } from '@molecule/app-ui';
17
17
  * @returns The rendered Pagination element.
18
18
  */
19
19
  export const Pagination = ({ page, totalPages, onChange, siblings = 1, boundaries = 1, size = 'md', showFirstLast, className, testId, }) => {
20
+ const { t } = useTranslation();
20
21
  const cm = getClassMap();
21
22
  const range = (start, end) => Array.from({ length: end - start + 1 }, (_, i) => start + i);
22
23
  const buildPaginationRange = () => {
@@ -42,5 +43,13 @@ export const Pagination = ({ page, totalPages, onChange, siblings = 1, boundarie
42
43
  return [...new Set(items)];
43
44
  };
44
45
  const pages = buildPaginationRange();
45
- return (_jsx(View, { className: cm.cn(cm.paginationRoot, className), testID: testId, accessibilityRole: "toolbar", accessibilityLabel: t('ui.pagination.nav', undefined, { defaultValue: 'Pagination' }), children: _jsxs(View, { className: cm.paginationContent, children: [showFirstLast && (_jsx(Pressable, { className: cm.paginationPrevious, onPress: () => onChange?.(1), disabled: page <= 1, accessibilityLabel: t('ui.pagination.first', undefined, { defaultValue: 'First' }), children: _jsx(Text, { children: t('ui.icon.chevronsLeft', undefined, { defaultValue: '«' }) }) })), _jsx(Pressable, { className: cm.paginationPrevious, onPress: () => onChange?.(page - 1), disabled: page <= 1, accessibilityLabel: t('ui.pagination.previous', undefined, { defaultValue: 'Previous' }), children: _jsx(Text, { children: t('ui.icon.chevronLeft', undefined, { defaultValue: '‹' }) }) }), pages.map((item, i) => item === 'ellipsis' ? (_jsx(View, { className: cm.paginationEllipsis, children: _jsx(Text, { children: t('ui.icon.ellipsis', undefined, { defaultValue: '…' }) }) }, `ellipsis-${i}`)) : (_jsx(Pressable, { className: cm.cn(cm.paginationLink, cm.pagination({ active: item === page, size })), onPress: () => onChange?.(item), accessibilityRole: "button", accessibilityState: { selected: item === page }, accessibilityLabel: t('ui.pagination.goToPage', { page: String(item) }, { defaultValue: `Page ${item}` }), children: _jsx(Text, { children: item }) }, item))), _jsx(Pressable, { className: cm.paginationNext, onPress: () => onChange?.(page + 1), disabled: page >= totalPages, accessibilityLabel: t('ui.pagination.next', undefined, { defaultValue: 'Next' }), children: _jsx(Text, { children: t('ui.icon.chevronRight', undefined, { defaultValue: '›' }) }) }), showFirstLast && (_jsx(Pressable, { className: cm.paginationNext, onPress: () => onChange?.(totalPages), disabled: page >= totalPages, accessibilityLabel: t('ui.pagination.last', undefined, { defaultValue: 'Last' }), children: _jsx(Text, { children: t('ui.icon.chevronsRight', undefined, { defaultValue: '»' }) }) }))] }) }));
46
+ return (_jsx(View, { className: cm.cn(cm.paginationRoot, className), testID: testId, accessibilityRole: "toolbar", accessibilityLabel: t('ui.pagination.nav', undefined, { defaultValue: 'Pagination' }), children: _jsxs(View, { className: cm.paginationContent, children: [showFirstLast && (_jsx(Pressable, { className: cm.paginationPrevious, onPress: () => onChange?.(1), disabled: page <= 1, accessibilityLabel: t('ui.pagination.first', undefined, {
47
+ defaultValue: 'Go to first page',
48
+ }), children: _jsx(Text, { children: t('ui.icon.chevronsLeft', undefined, { defaultValue: '«' }) }) })), _jsx(Pressable, { className: cm.paginationPrevious, onPress: () => onChange?.(page - 1), disabled: page <= 1, accessibilityLabel: t('ui.pagination.previous', undefined, {
49
+ defaultValue: 'Go to previous page',
50
+ }), children: _jsx(Text, { children: t('ui.icon.chevronLeft', undefined, { defaultValue: '‹' }) }) }), pages.map((item, i) => item === 'ellipsis' ? (_jsx(View, { className: cm.paginationEllipsis, children: _jsx(Text, { children: t('ui.icon.ellipsis', undefined, { defaultValue: '…' }) }) }, `ellipsis-${i}`)) : (_jsx(Pressable, { className: cm.cn(cm.paginationLink, cm.pagination({ active: item === page, size })), onPress: () => onChange?.(item), accessibilityRole: "button", accessibilityState: { selected: item === page }, accessibilityLabel: t('ui.pagination.goToPage', { page: String(item) }, { defaultValue: 'Go to page {{page}}' }), children: _jsx(Text, { children: item }) }, item))), _jsx(Pressable, { className: cm.paginationNext, onPress: () => onChange?.(page + 1), disabled: page >= totalPages, accessibilityLabel: t('ui.pagination.next', undefined, {
51
+ defaultValue: 'Go to next page',
52
+ }), children: _jsx(Text, { children: t('ui.icon.chevronRight', undefined, { defaultValue: '›' }) }) }), showFirstLast && (_jsx(Pressable, { className: cm.paginationNext, onPress: () => onChange?.(totalPages), disabled: page >= totalPages, accessibilityLabel: t('ui.pagination.last', undefined, {
53
+ defaultValue: 'Go to last page',
54
+ }), children: _jsx(Text, { children: t('ui.icon.chevronsRight', undefined, { defaultValue: '»' }) }) }))] }) }));
46
55
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../../src/components/Progress.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAGrE,mEAAmE;AACnE,UAAU,aAAc,SAAQ,SAAS;IACvC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAuD5C,CAAA"}
1
+ {"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../../src/components/Progress.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAGrE,mEAAmE;AACnE,UAAU,aAAc,SAAQ,SAAS;IACvC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAwD5C,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Text, View } from 'react-native';
3
- import { t } from '@molecule/app-i18n';
3
+ import { useTranslation } from '@molecule/app-react';
4
4
  import { getClassMap } from '@molecule/app-ui';
5
5
  /**
6
6
  * Renders a Progress component.
@@ -17,6 +17,7 @@ import { getClassMap } from '@molecule/app-ui';
17
17
  * @returns The rendered Progress element.
18
18
  */
19
19
  export const Progress = ({ value = 0, max = 100, label, showValue, color = 'primary', size = 'md', indeterminate, className, testId, }) => {
20
+ const { t } = useTranslation();
20
21
  const cm = getClassMap();
21
22
  const percentage = Math.min(Math.max((value / max) * 100, 0), 100);
22
23
  return (_jsxs(View, { className: cm.cn(cm.progressWrapper, className), testID: testId, children: [(label || showValue) && (_jsxs(View, { className: cm.progressLabelContainer, children: [!!label && _jsx(Text, { className: cm.progressLabelText, children: label }), showValue && (_jsx(Text, { className: cm.progressLabelText, children: t('ui.progress.value', { value: String(Math.round(percentage)) }, { defaultValue: '{{value}}%' }) }))] })), _jsx(View, { className: cm.cn(cm.progress(), cm.progressHeight(size)), accessibilityRole: "progressbar", accessibilityLabel: typeof label === 'string'
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../src/components/RadioGroup.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAGvD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2DhD,CAAA"}
1
+ {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../src/components/RadioGroup.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAGvD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA4DhD,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Pressable, Text, View } from 'react-native';
3
- import { t } from '@molecule/app-i18n';
3
+ import { useTranslation } from '@molecule/app-react';
4
4
  import { getClassMap } from '@molecule/app-ui';
5
5
  /**
6
6
  * Renders a RadioGroup component.
@@ -17,6 +17,7 @@ import { getClassMap } from '@molecule/app-ui';
17
17
  * @returns The rendered RadioGroup element.
18
18
  */
19
19
  export const RadioGroup = ({ label, options = [], value, onChange, direction = 'vertical', error, disabled, className, testId, }) => {
20
+ const { t } = useTranslation();
20
21
  const cm = getClassMap();
21
22
  const layoutClasses = cm.radioGroupLayout(direction);
22
23
  return (_jsxs(View, { className: className, testID: testId, accessibilityRole: "radiogroup", accessibilityLabel: typeof label === 'string'
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/components/Select.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA6FxC,CAAA"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/components/Select.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA8FxC,CAAA"}
@@ -9,7 +9,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
9
  */
10
10
  import { useState } from 'react';
11
11
  import { FlatList, Modal as RNModal, Pressable, Text, View } from 'react-native';
12
- import { t } from '@molecule/app-i18n';
12
+ import { useTranslation } from '@molecule/app-react';
13
13
  import { getClassMap } from '@molecule/app-ui';
14
14
  /**
15
15
  * Renders a Select component.
@@ -29,6 +29,7 @@ import { getClassMap } from '@molecule/app-ui';
29
29
  * @returns The rendered Select element.
30
30
  */
31
31
  export const Select = ({ label, options = [], value, onChange, placeholder, error, hint, size = 'md', disabled, required, className, testId, }) => {
32
+ const { t } = useTranslation();
32
33
  const cm = getClassMap();
33
34
  const [isOpen, setIsOpen] = useState(false);
34
35
  const classes = cm.cn(cm.select({ error: !!error, size }), className);
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/components/Spinner.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAWpD;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAc1C,CAAA"}
1
+ {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/components/Spinner.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAWpD;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAe1C,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { ActivityIndicator, View } from 'react-native';
3
- import { t } from '@molecule/app-i18n';
3
+ import { useTranslation } from '@molecule/app-react';
4
4
  import { getClassMap } from '@molecule/app-ui';
5
5
  const sizeMap = {
6
6
  xs: 'small',
@@ -18,6 +18,7 @@ const sizeMap = {
18
18
  * @returns The rendered Spinner element.
19
19
  */
20
20
  export const Spinner = ({ size = 'md', className, testId }) => {
21
+ const { t } = useTranslation();
21
22
  const cm = getClassMap();
22
23
  const classes = cm.cn(cm.spinner({ size }), className);
23
24
  return (_jsx(View, { className: classes, testID: testId, accessibilityRole: "progressbar", accessibilityLabel: t('ui.spinner.loading', undefined, { defaultValue: 'Loading' }), children: _jsx(ActivityIndicator, { size: sizeMap[size] || 'small' }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/components/Table.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAKlD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAyG/D,CAAA"}
1
+ {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/components/Table.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAKlD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA0G/D,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { FlatList, Pressable, Text, View } from 'react-native';
3
- import { t } from '@molecule/app-i18n';
3
+ import { useTranslation } from '@molecule/app-react';
4
4
  import { getClassMap } from '@molecule/app-ui';
5
5
  import { Spinner } from './Spinner.js';
6
6
  /**
@@ -22,6 +22,7 @@ import { Spinner } from './Spinner.js';
22
22
  * @returns The rendered Table element.
23
23
  */
24
24
  export const Table = ({ columns = [], data = [], rowKey, onRowClick, striped, bordered, hoverable, loading, emptyContent: emptyMessage, sort, onSort, className, testId, }) => {
25
+ const { t } = useTranslation();
25
26
  const cm = getClassMap();
26
27
  const getRowKey = (row, index) => {
27
28
  if (typeof rowKey === 'function')
@@ -35,7 +36,7 @@ export const Table = ({ columns = [], data = [], rowKey, onRowClick, striped, bo
35
36
  onSort(String(col.key), sort?.key === String(col.key) && sort?.direction === 'asc' ? 'desc' : 'asc'), disabled: !col.sortable, children: [_jsx(Text, { children: col.header }), col.sortable && sort?.key === String(col.key) && (_jsx(Text, { className: cm.tableSortIcon, children: sort.direction === 'asc'
36
37
  ? t('ui.icon.sortAsc', undefined, { defaultValue: '↑' })
37
38
  : t('ui.icon.sortDesc', undefined, { defaultValue: '↓' }) }))] }, String(col.key)))) }), loading && (_jsx(View, { className: cm.tableLoadingOverlay, children: _jsx(Spinner, { size: "md" }) })), data.length === 0 && !loading ? (_jsx(View, { className: cm.tableEmptyCell, children: _jsx(Text, { className: cm.textMuted, children: emptyMessage ||
38
- t('ui.table.empty', undefined, { defaultValue: 'No data' }) }) })) : (_jsx(FlatList, { data: data, keyExtractor: (item, index) => getRowKey(item, index), renderItem: ({ item, index }) => {
39
+ t('ui.table.empty', undefined, { defaultValue: 'No data available' }) }) })) : (_jsx(FlatList, { data: data, keyExtractor: (item, index) => getRowKey(item, index), renderItem: ({ item, index }) => {
39
40
  const row = item;
40
41
  return (_jsx(Pressable, { className: cm.cn(cm.tableRow, striped && index % 2 === 1 && cm.tableRowStriped, hoverable && cm.tableRowHoverable, onRowClick && cm.tableRowClickable), onPress: () => onRowClick?.(row, index), disabled: !onRowClick, children: columns.map((col) => {
41
42
  const cellValue = row[col.key];
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/components/Toast.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA8E,MAAM,OAAO,CAAA;AAIlG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAqDtC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,QAAQ,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,aAAa,CAAA;CACxF,CAGA,CAAA;AASD,UAAU,iBAAiB;IACzB,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,KAAK,MAAM,CAAA;IACvD,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAMD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,QAAQ,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,aAAa,CAAA;CACxF,CAuBA,CAAA;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,iBAAiB,CAU5C"}
1
+ {"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/components/Toast.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA8E,MAAM,OAAO,CAAA;AAIlG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAsDtC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,QAAQ,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,aAAa,CAAA;CACxF,CAGA,CAAA;AASD,UAAU,iBAAiB;IACzB,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,KAAK,MAAM,CAAA;IACvD,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAMD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,QAAQ,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,aAAa,CAAA;CACxF,CAuBA,CAAA;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,iBAAiB,CAW5C"}
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  */
7
7
  import { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react';
8
8
  import { Animated, Pressable, Text, View } from 'react-native';
9
- import { t } from '@molecule/app-i18n';
9
+ import { useTranslation } from '@molecule/app-react';
10
10
  import { getClassMap } from '@molecule/app-ui';
11
11
  /**
12
12
  * Renders a Toast component.
@@ -22,6 +22,7 @@ import { getClassMap } from '@molecule/app-ui';
22
22
  * @returns The rendered Toast element.
23
23
  */
24
24
  export const Toast = ({ title, description, status, duration = 5000, dismissible = true, onDismiss, className, testId, }) => {
25
+ const { t } = useTranslation();
25
26
  const cm = getClassMap();
26
27
  const classes = cm.cn(cm.toast({
27
28
  variant: (status || 'default'),
@@ -79,10 +80,11 @@ export const ToastProvider = ({ children, position = 'bottom-right' }) => {
79
80
  * @returns The toast context value.
80
81
  */
81
82
  export function useToast() {
83
+ const { t } = useTranslation();
82
84
  const context = useContext(ToastContext);
83
85
  if (!context) {
84
86
  throw new Error(t('ui.toast.error.noProvider', undefined, {
85
- defaultValue: 'useToast must be used within a ToastProvider',
87
+ defaultValue: '`useToast` must be used within a `ToastProvider`',
86
88
  }));
87
89
  }
88
90
  return context;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-ui-react-native",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "React Native UI component implementations for molecule.dev",
5
5
  "homepage": "https://www.molecule.dev/packages/app-ui-react-native",
6
6
  "type": "module",
@@ -34,17 +34,20 @@
34
34
  "directory": "packages/app/frameworks/react-native-ui"
35
35
  },
36
36
  "devDependencies": {
37
- "@molecule/app-i18n": "1.1.2",
38
- "@molecule/app-icons": "1.0.3",
39
- "@molecule/app-ui": "1.3.10",
37
+ "@molecule/app-i18n": "1.2.0",
38
+ "@molecule/app-icons": "1.0.4",
39
+ "@molecule/app-react": "4.5.0",
40
+ "@molecule/app-ui": "1.3.11",
40
41
  "@types/node": "26.6.5",
41
42
  "react": "19.3.1",
43
+ "react-dom": "19.3.1",
42
44
  "typescript": "6.0.3",
43
45
  "vitest": "4.1.12"
44
46
  },
45
47
  "peerDependencies": {
46
48
  "@molecule/app-i18n": "^1.0.1",
47
49
  "@molecule/app-icons": "^1.0.1",
50
+ "@molecule/app-react": "^4.4.0",
48
51
  "@molecule/app-ui": "^1.0.1",
49
52
  "react": "^18.0.0 || ^19.0.0",
50
53
  "react-native": ">=0.72.0"