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

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.
@@ -22,7 +22,7 @@ import { getClassMap } from '@molecule/app-ui';
22
22
  export const Dropdown = ({ trigger, items = [], onSelect, className, testId, }) => {
23
23
  const cm = getClassMap();
24
24
  const [isOpen, setIsOpen] = useState(false);
25
- return (_jsxs(View, { className: className, testID: testId, children: [_jsx(Pressable, { className: cm.dropdownTrigger, onPress: () => setIsOpen(true), children: trigger }), _jsx(RNModal, { visible: isOpen, transparent: true, animationType: "fade", onRequestClose: () => setIsOpen(false), children: _jsx(Pressable, { className: cm.dialogOverlay, onPress: () => setIsOpen(false), children: _jsx(View, { className: cm.cn(cm.actionSheet, 'pointer-events-auto'), children: _jsx(FlatList, { data: items, keyExtractor: (item, index) => String(item.value ?? index), renderItem: ({ item }) => {
25
+ return (_jsxs(View, { className: className, testID: testId, children: [_jsx(Pressable, { className: cm.dropdownTrigger, onPress: () => setIsOpen(true), children: trigger }), _jsx(RNModal, { visible: isOpen, transparent: true, animationType: "fade", onRequestClose: () => setIsOpen(false), children: _jsx(Pressable, { className: cm.dialogOverlay, onPress: () => setIsOpen(false), children: _jsx(View, { className: cm.cn(cm.actionSheet, cm.pointerEventsAuto), children: _jsx(FlatList, { data: items, keyExtractor: (item, index) => String(item.value ?? index), renderItem: ({ item }) => {
26
26
  if (item.separator) {
27
27
  return _jsx(View, { className: cm.dropdownSeparator });
28
28
  }
@@ -18,5 +18,5 @@ import { getClassMap } from '@molecule/app-ui';
18
18
  export const Modal = ({ children, open, onClose, title, size = 'md', footer, className, testId, }) => {
19
19
  const cm = getClassMap();
20
20
  const contentClasses = cm.cn(cm.modal({ size }), className);
21
- 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, 'pointer-events-auto'), 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 })] }) }) }) }));
21
+ 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 })] }) }) }) }));
22
22
  };
@@ -38,7 +38,7 @@ export const Select = ({ label, options = [], value, onChange, placeholder, erro
38
38
  ? selectedOption
39
39
  : selectedOption.label
40
40
  : placeholder || t('ui.select.placeholder', undefined, { defaultValue: 'Select…' });
41
- return (_jsxs(View, { className: cm.inputWrapper, children: [!!label && (_jsx(Text, { className: cm.cn(cm.labelBlock, cm.label({ required: !!required })), children: label })), _jsxs(Pressable, { className: classes, onPress: () => !disabled && setIsOpen(true), testID: testId, accessibilityRole: "combobox", accessibilityState: { disabled, expanded: isOpen }, children: [_jsx(Text, { className: !selectedOption ? cm.textMuted : undefined, children: displayLabel }), _jsx(Text, { className: cm.selectNative, children: t('ui.icon.chevronDown', undefined, { defaultValue: '▼' }) })] }), _jsx(RNModal, { visible: isOpen, transparent: true, animationType: "slide", onRequestClose: () => setIsOpen(false), children: _jsx(Pressable, { className: cm.dialogOverlay, onPress: () => setIsOpen(false), children: _jsxs(View, { className: cm.cn(cm.actionSheet, 'pointer-events-auto'), children: [_jsx(View, { className: cm.actionSheetHeader, children: _jsx(Text, { className: cm.dialogTitle, children: label || t('ui.select.title', undefined, { defaultValue: 'Select' }) }) }), _jsx(FlatList, { data: options, keyExtractor: (item, index) => typeof item === 'string' ? item : (item.value ?? String(index)), renderItem: ({ item }) => {
41
+ return (_jsxs(View, { className: cm.inputWrapper, children: [!!label && (_jsx(Text, { className: cm.cn(cm.labelBlock, cm.label({ required: !!required })), children: label })), _jsxs(Pressable, { className: classes, onPress: () => !disabled && setIsOpen(true), testID: testId, accessibilityRole: "combobox", accessibilityState: { disabled, expanded: isOpen }, children: [_jsx(Text, { className: !selectedOption ? cm.textMuted : undefined, children: displayLabel }), _jsx(Text, { className: cm.selectNative, children: t('ui.icon.chevronDown', undefined, { defaultValue: '▼' }) })] }), _jsx(RNModal, { visible: isOpen, transparent: true, animationType: "slide", onRequestClose: () => setIsOpen(false), children: _jsx(Pressable, { className: cm.dialogOverlay, onPress: () => setIsOpen(false), children: _jsxs(View, { className: cm.cn(cm.actionSheet, cm.pointerEventsAuto), children: [_jsx(View, { className: cm.actionSheetHeader, children: _jsx(Text, { className: cm.dialogTitle, children: label || t('ui.select.title', undefined, { defaultValue: 'Select' }) }) }), _jsx(FlatList, { data: options, keyExtractor: (item, index) => typeof item === 'string' ? item : (item.value ?? String(index)), renderItem: ({ item }) => {
42
42
  const optValue = typeof item === 'string' ? item : item.value;
43
43
  const optLabel = typeof item === 'string' ? item : item.label;
44
44
  const isSelected = optValue === value;
@@ -25,5 +25,5 @@ export const Tooltip = ({ children, content, className, testId }) => {
25
25
  // RN has no onClick; a normal press (the click analog) hides the tooltip —
26
26
  // pressing a tooltip-wrapped control shouldn't leave its long-press tooltip
27
27
  // lingering. `onPressOut` also clears it when the press is released.
28
- onPress: () => setIsVisible(false), onPressOut: () => setIsVisible(false), children: children }), _jsx(RNModal, { visible: isVisible, transparent: true, animationType: "fade", children: _jsx(Pressable, { className: cm.dialogOverlay, onPress: () => setIsVisible(false), children: _jsx(View, { className: cm.cn(cm.dialogWrapper, 'pointer-events-auto'), children: _jsx(View, { className: cm.tooltip(), children: _jsx(Text, { children: content }) }) }) }) })] }));
28
+ onPress: () => setIsVisible(false), onPressOut: () => setIsVisible(false), children: children }), _jsx(RNModal, { visible: isVisible, transparent: true, animationType: "fade", children: _jsx(Pressable, { className: cm.dialogOverlay, onPress: () => setIsVisible(false), children: _jsx(View, { className: cm.cn(cm.dialogWrapper, cm.pointerEventsAuto), children: _jsx(View, { className: cm.tooltip(), children: _jsx(Text, { children: content }) }) }) }) })] }));
29
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-ui-react-native",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
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",
@@ -36,7 +36,7 @@
36
36
  "devDependencies": {
37
37
  "@molecule/app-i18n": "1.1.2",
38
38
  "@molecule/app-icons": "1.0.3",
39
- "@molecule/app-ui": "1.3.9",
39
+ "@molecule/app-ui": "1.3.10",
40
40
  "@types/node": "26.6.5",
41
41
  "react": "19.3.1",
42
42
  "typescript": "6.0.3",