@lmb-it/kitsconcerto-native 0.1.261 → 0.1.262
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/animations/index.cjs +1 -2
- package/animations/index.cjs.map +1 -1
- package/animations/index.js +1 -2
- package/animations/index.js.map +1 -1
- package/apps/mobile/src/Core/Dropdown/index.cjs +39 -5
- package/apps/mobile/src/Core/Dropdown/index.cjs.map +1 -1
- package/apps/mobile/src/Core/Dropdown/index.js +39 -5
- package/apps/mobile/src/Core/Dropdown/index.js.map +1 -1
- package/apps/mobile/src/Core/MultiSelect/index.cjs +15 -3
- package/apps/mobile/src/Core/MultiSelect/index.cjs.map +1 -1
- package/apps/mobile/src/Core/MultiSelect/index.js +15 -3
- package/apps/mobile/src/Core/MultiSelect/index.js.map +1 -1
- package/components/overlay/Dialog/index.cjs +2 -2
- package/components/overlay/Dialog/index.cjs.map +1 -1
- package/components/overlay/Dialog/index.js +3 -3
- package/components/overlay/Dialog/index.js.map +1 -1
- package/form/selects/Dropdown/index.cjs +3 -0
- package/form/selects/Dropdown/index.cjs.map +1 -1
- package/form/selects/Dropdown/index.js +3 -0
- package/form/selects/Dropdown/index.js.map +1 -1
- package/form/selects/MultiSelect/index.cjs +3 -0
- package/form/selects/MultiSelect/index.cjs.map +1 -1
- package/form/selects/MultiSelect/index.js +3 -0
- package/form/selects/MultiSelect/index.js.map +1 -1
- package/form-renderer/hooks/useFieldLogic.cjs +1 -1
- package/form-renderer/hooks/useFieldLogic.cjs.map +1 -1
- package/form-renderer/hooks/useFieldLogic.js +1 -1
- package/form-renderer/hooks/useFieldLogic.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../../../apps/mobile/src/Core/MultiSelect/index.tsx"],"sourcesContent":["import React, { useMemo, useRef, useState } from 'react';\nimport {\n View,\n Text,\n TouchableOpacity,\n Modal,\n FlatList,\n TextInput,\n StyleSheet,\n Pressable,\n ActivityIndicator,\n Dimensions,\n} from 'react-native';\nimport { resolveThemeTokenForNative } from '../../Factory/helpers/style';\n\nexport type MultiSelectChangeEvent<T> = React.ChangeEvent<{\n value: T[];\n}>;\n\nexport interface MultiSelectProps<T> {\n value?: T[] | null;\n onChange?: (e: MultiSelectChangeEvent<T>, selectedItems: T[]) => void;\n isModal?: boolean;\n\n options?: T[];\n\n optionLabel?: keyof T | string;\n optionValue?: keyof T | string;\n\n optionGroupLabel?: keyof T | string;\n optionGroupChildren?: keyof T | string;\n\n placeholder?: string;\n disabled?: boolean;\n loading?: boolean;\n filter?: boolean;\n emptyFilterMessage?: string;\n /**\n * Placeholder for the panel's filter field, already written in the reader's\n * language by the KitsConcerto wrapper — this component lives in\n * `apps/mobile`, which `packages/ui` imports, so it cannot translate.\n */\n filterPlaceholder?: string;\n /** Reader's direction, from the wrapper's `useLanguage().isRTL`. */\n isRTL?: boolean;\n /**\n * Open the options in a popup that owns the screen instead of a panel\n * anchored to the trigger. Default false — see the Dropdown's own `popup`\n * for why the anchor is the thing being escaped.\n */\n popup?: boolean;\n /**\n * Supplies the popup's container. Injected by the KitsConcerto wrapper: the\n * container is this library's `KitsDialogControlled`, which lives in\n * `packages/ui`, and `packages/ui` imports THIS file.\n */\n renderPopup?: (args: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => React.ReactNode;\n /** Title for the popup header. */\n popupTitle?: React.ReactNode;\n\n display?: 'comma' | 'chip';\n maxSelectedLabels?: number;\n\n itemTemplate?: (item: T) => React.ReactElement;\n selectedItemTemplate?: (item: T) => React.ReactElement;\n style?: import('react-native').ViewStyle;\n}\n\nconst t = resolveThemeTokenForNative;\n\nconst TEXT_STYLE_KEYS = new Set([\n 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle',\n 'color', 'letterSpacing', 'lineHeight', 'textAlign',\n 'textDecorationLine', 'textTransform',\n]);\n\nfunction splitStyle(combined?: any): { viewStyle?: any; textStyle?: any } {\n if (!combined) return {};\n const view: Record<string, any> = {};\n const text: Record<string, any> = {};\n for (const [k, v] of Object.entries(combined)) {\n if (TEXT_STYLE_KEYS.has(k)) text[k] = v;\n else view[k] = v;\n }\n return {\n viewStyle: Object.keys(view).length ? view : undefined,\n textStyle: Object.keys(text).length ? text : undefined,\n };\n}\n\nexport default function MultiSelect<T>(props: MultiSelectProps<T>) {\n const {\n value,\n onChange,\n options = [],\n optionLabel,\n optionValue,\n optionGroupLabel,\n optionGroupChildren,\n isModal = false,\n placeholder = 'Select',\n disabled,\n loading,\n filter,\n // ⚠️ English literals of last resort, not translations — the wrapper always\n // passes the reader's own sentence. These only apply when this component is\n // used directly from `apps/mobile`, so a panel can never render blank.\n emptyFilterMessage = 'No results found',\n filterPlaceholder = 'Search...',\n isRTL = false,\n popup = false,\n renderPopup,\n popupTitle,\n display = 'chip',\n maxSelectedLabels = 10,\n itemTemplate,\n selectedItemTemplate,\n style: externalStyle,\n } = props;\n\n const triggerRef = useRef<View>(null);\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const [triggerLayout, setTriggerLayout] = useState<{\n x: number; y: number; width: number; height: number;\n } | null>(null);\n\n const close = () => setOpen(false);\n\n const toggleOpen = () => {\n if (disabled) return;\n if (open) {\n setOpen(false);\n return;\n }\n triggerRef.current?.measureInWindow((x, y, width, height) => {\n setTriggerLayout({ x, y, width, height });\n setOpen(true);\n });\n };\n\n const { viewStyle: externalViewStyle, textStyle: externalTextStyle } = splitStyle(externalStyle);\n\n const colors = {\n border: t('border') || t('gray.300'),\n borderFocus: t('primary'),\n bg: t('surface-card') || '#fff',\n disabledBg: t('surface-ground') || t('gray.100'),\n placeholder: t('text-secondary') || t('gray.400'),\n text: t('text') || t('gray.800'),\n textSecondary: t('text-secondary') || t('gray.500'),\n chipBg: t('primary.100') || t('indigo.100'),\n chipText: t('primary.700') || t('indigo.700'),\n chipRemove: t('primary.500') || t('indigo.500'),\n chipMoreBg: t('surface-ground') || t('gray.100'),\n headerBorder: t('border') || t('gray.200'),\n groupBg: t('surface-ground') || t('gray.50'),\n groupBorder: t('border') || t('gray.200'),\n itemBorder: t('surface-ground') || t('gray.100'),\n itemSelectedBg: t('highlight-bg') || t('indigo.50'),\n itemSelectedText: t('primary.700') || t('indigo.700'),\n checkboxBorder: t('border') || t('gray.300'),\n checkboxChecked: t('primary'),\n invalidBorder: t('danger') || t('red.500'),\n searchBg: t('surface-ground') || t('gray.50'),\n };\n\n const getValue = (item: T, key?: keyof T | string) =>\n key ? (item as any)[key] : item;\n\n const getLabel = (item: T, key?: keyof T | string) =>\n String(key ? (item as any)[key] : item);\n\n const selectedValues = Array.isArray(value) ? value : [];\n\n // Build display items: flat list with optional group headers\n const displayItems: { type: 'group' | 'item'; data: any }[] = useMemo(() => {\n if (optionGroupLabel && optionGroupChildren) {\n const result: { type: 'group' | 'item'; data: any }[] = [];\n options.forEach((group: any) => {\n result.push({ type: 'group', data: group });\n const children = group[optionGroupChildren] ?? [];\n children.forEach((child: any) => result.push({ type: 'item', data: child }));\n });\n return result;\n }\n return options.map((item) => ({ type: 'item' as const, data: item }));\n }, [options, optionGroupLabel, optionGroupChildren]);\n\n const filtered = useMemo(() => {\n if (!filter || !query) return displayItems;\n return displayItems.filter((entry) => {\n if (entry.type === 'group') return true; // keep group headers\n return getLabel(entry.data, optionLabel)\n .toLowerCase()\n .includes(query.toLowerCase());\n });\n }, [query, displayItems]);\n\n const isSelected = (item: T) =>\n selectedValues.some(\n (v) => getValue(v, optionValue) === getValue(item, optionValue),\n );\n\n const toggleItem = (item: T) => {\n const exists = isSelected(item);\n const next = exists\n ? selectedValues.filter(\n (v) => getValue(v, optionValue) !== getValue(item, optionValue),\n )\n : [...selectedValues, item];\n\n const syntheticEvent = {\n target: { value: next },\n } as React.ChangeEvent<any>;\n\n onChange?.(syntheticEvent, next);\n };\n\n const removeItem = (item: T) => {\n const next = selectedValues.filter(\n (v) => getValue(v, optionValue) !== getValue(item, optionValue),\n );\n const syntheticEvent = {\n target: { value: next },\n } as React.ChangeEvent<any>;\n onChange?.(syntheticEvent, next);\n };\n\n const renderCheckbox = (checked: boolean) => (\n <View\n style={[\n styles.checkbox,\n { borderColor: colors.checkboxBorder, backgroundColor: colors.bg },\n checked && { backgroundColor: colors.checkboxChecked, borderColor: colors.checkboxChecked },\n ]}\n >\n {checked && <Text style={styles.checkmark}>✓</Text>}\n </View>\n );\n\n const renderListContent = () => {\n if (loading) {\n return (\n <View style={styles.loadingContainer}>\n <ActivityIndicator size=\"small\" color={colors.checkboxChecked} />\n <Text style={[styles.loadingText, { color: colors.placeholder }]}>Loading...</Text>\n </View>\n );\n }\n\n const itemsOnly = filtered.filter((e) => e.type === 'item');\n if (itemsOnly.length === 0) {\n return (\n <View style={styles.emptyContainer}>\n <Text style={[styles.emptyText, { color: colors.placeholder }]}>{emptyFilterMessage}</Text>\n </View>\n );\n }\n\n return (\n <FlatList\n data={filtered}\n keyExtractor={(entry, i) =>\n entry.type === 'group' ? `group-${i}` : `item-${i}`\n }\n keyboardShouldPersistTaps=\"handled\"\n renderItem={({ item: entry }) => {\n if (entry.type === 'group') {\n return (\n <View style={[styles.groupHeader, { backgroundColor: colors.groupBg, borderBottomColor: colors.groupBorder }]}>\n <Text style={[styles.groupHeaderText, { color: colors.textSecondary }]}>\n {getLabel(entry.data, optionGroupLabel)}\n </Text>\n </View>\n );\n }\n const checked = isSelected(entry.data);\n return (\n <TouchableOpacity\n onPress={() => toggleItem(entry.data)}\n style={[\n styles.item,\n { borderBottomColor: colors.itemBorder },\n checked && { backgroundColor: colors.itemSelectedBg },\n ]}\n activeOpacity={0.7}\n >\n {renderCheckbox(checked)}\n {itemTemplate ? (\n itemTemplate(entry.data)\n ) : (\n <Text style={[\n styles.itemText,\n { color: colors.text },\n checked && { color: colors.itemSelectedText, fontWeight: '500' },\n ]}>\n {getLabel(entry.data, optionLabel)}\n </Text>\n )}\n </TouchableOpacity>\n );\n }}\n />\n );\n };\n\n const renderSelected = () => {\n if (!selectedValues.length) {\n return <Text style={[styles.placeholder, { color: colors.placeholder }, externalTextStyle]}>{placeholder}</Text>;\n }\n\n if (display === 'chip') {\n const visibleItems = selectedValues.slice(0, maxSelectedLabels);\n const remaining = selectedValues.length - maxSelectedLabels;\n return (\n <View style={styles.chips}>\n {visibleItems.map((item, i) =>\n selectedItemTemplate ? (\n <React.Fragment key={i}>{selectedItemTemplate(item)}</React.Fragment>\n ) : (\n <View key={i} style={[styles.chip, { backgroundColor: colors.chipBg }]}>\n <Text style={[styles.chipText, { color: colors.chipText }]}>{getLabel(item, optionLabel)}</Text>\n <TouchableOpacity\n onPress={() => removeItem(item)}\n hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}\n >\n <Text style={[styles.chipRemove, { color: colors.chipRemove }]}>✕</Text>\n </TouchableOpacity>\n </View>\n ),\n )}\n {remaining > 0 && (\n <View style={[styles.chipMore, { backgroundColor: colors.chipMoreBg }]}>\n <Text style={[styles.chipMoreText, { color: colors.textSecondary }]}>+{remaining}</Text>\n </View>\n )}\n </View>\n );\n }\n\n return (\n <Text numberOfLines={1} style={[styles.commaText, { color: colors.text }, externalTextStyle]}>\n {selectedValues\n .slice(0, maxSelectedLabels)\n .map((v) => getLabel(v, optionLabel))\n .join(', ')}\n </Text>\n );\n };\n\n const usePopup = popup && typeof renderPopup === 'function';\n\n const panelContent = (\n <View style={{ flex: 1 }}>\n {/* Header */}\n <View style={[styles.panelHeader, { borderBottomColor: colors.headerBorder }]}>\n <Text style={[styles.panelHeaderText, { color: colors.textSecondary }]}>\n {selectedValues.length} item{selectedValues.length !== 1 ? 's' : ''} selected\n </Text>\n {/* In popup mode the sheet already draws a close control, and two ✕\n in one header is a question the reader should not have to answer.\n The count stays — it is information, not chrome. */}\n {!usePopup && (\n <TouchableOpacity onPress={() => setOpen(false)}>\n <Text style={[styles.panelCloseText, { color: colors.placeholder }]}>✕</Text>\n </TouchableOpacity>\n )}\n </View>\n\n {/* Search */}\n {filter && (\n <View style={[styles.searchContainer, { borderColor: colors.border, backgroundColor: colors.searchBg }]}>\n <Text style={styles.searchIcon}>🔍</Text>\n <TextInput\n value={query}\n onChangeText={setQuery}\n placeholder={filterPlaceholder}\n style={[\n styles.searchInput,\n { color: colors.text },\n // The filter follows the reader's language, not the platform's\n // layout direction — same rule as the Dropdown's panel.\n isRTL ? styles.searchRtl : styles.searchLtr,\n ]}\n placeholderTextColor={colors.placeholder}\n />\n </View>\n )}\n\n {/* List */}\n {renderListContent()}\n </View>\n );\n\n return (\n <View style={{ width: '100%' }}>\n {/* Input trigger */}\n <TouchableOpacity\n ref={triggerRef as any}\n activeOpacity={0.8}\n disabled={disabled}\n onPress={toggleOpen}\n style={[\n styles.input,\n { borderColor: colors.border, backgroundColor: colors.bg },\n disabled && { backgroundColor: colors.disabledBg, opacity: 0.6 },\n open && { borderColor: colors.borderFocus },\n externalViewStyle,\n ]}\n >\n <View style={styles.inputContent}>\n {renderSelected()}\n </View>\n <Text style={[styles.dropdownArrow, { color: colors.placeholder }]}>{open ? '▲' : '▼'}</Text>\n </TouchableOpacity>\n\n {/* Popup — the container comes from the wrapper (this library's own\n Dialog in sheet position); `panelContent` is unchanged. */}\n {usePopup && renderPopup!({\n visible: open,\n onClose: () => setOpen(false),\n title: popupTitle,\n children: panelContent,\n })}\n\n {/* Modal mode */}\n {!usePopup && isModal && (\n <Modal visible={open} transparent animationType=\"fade\">\n <Pressable style={styles.overlay} onPress={() => setOpen(false)}>\n <View\n style={[styles.modalPanel, { backgroundColor: colors.bg }]}\n onStartShouldSetResponder={() => true}\n >\n {panelContent}\n </View>\n </Pressable>\n </Modal>\n )}\n\n {/* Inline mode — Modal-portal popover anchored to trigger */}\n {!usePopup && !isModal && (\n <Modal\n visible={open && !!triggerLayout}\n transparent\n animationType=\"none\"\n onRequestClose={close}\n >\n <Pressable style={styles.popoverOverlay} onPress={close}>\n {triggerLayout && (() => {\n const screen = Dimensions.get('window');\n const PANEL_MAX_HEIGHT = 320;\n const GAP = 4;\n const spaceBelow = screen.height - (triggerLayout.y + triggerLayout.height);\n const spaceAbove = triggerLayout.y;\n const openUp = spaceBelow < PANEL_MAX_HEIGHT && spaceAbove > spaceBelow;\n const maxHeight = Math.min(\n PANEL_MAX_HEIGHT,\n openUp ? spaceAbove - GAP : spaceBelow - GAP,\n );\n const top = openUp\n ? triggerLayout.y - maxHeight - GAP\n : triggerLayout.y + triggerLayout.height + GAP;\n\n return (\n <View\n style={[\n styles.popoverPanel,\n {\n top,\n left: triggerLayout.x,\n width: triggerLayout.width,\n maxHeight,\n borderColor: colors.border,\n backgroundColor: colors.bg,\n },\n ]}\n onStartShouldSetResponder={() => true}\n >\n {panelContent}\n </View>\n );\n })()}\n </Pressable>\n </Modal>\n )}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n // Input\n input: {\n minHeight: 42,\n borderWidth: 1,\n borderRadius: 6,\n paddingHorizontal: 10,\n paddingVertical: 6,\n flexDirection: 'row',\n alignItems: 'center',\n },\n inputContent: {\n flex: 1,\n },\n dropdownArrow: {\n fontSize: 10,\n marginLeft: 8,\n },\n\n // Placeholder\n placeholder: { fontSize: 14 },\n commaText: { fontSize: 14 },\n\n // Chips display\n chips: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: 4,\n },\n chip: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingLeft: 10,\n paddingRight: 6,\n paddingVertical: 3,\n borderRadius: 16,\n gap: 4,\n },\n chipText: {\n fontSize: 13,\n },\n chipRemove: {\n fontSize: 12,\n paddingHorizontal: 2,\n },\n chipMore: {\n paddingHorizontal: 10,\n paddingVertical: 3,\n borderRadius: 16,\n },\n chipMoreText: {\n fontSize: 13,\n },\n\n // Panel header\n panelHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingHorizontal: 12,\n paddingVertical: 10,\n borderBottomWidth: 1,\n },\n panelHeaderText: {\n fontSize: 13,\n },\n panelCloseText: {\n fontSize: 18,\n fontWeight: '600',\n },\n\n // Search\n searchContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n margin: 8,\n paddingHorizontal: 10,\n height: 36,\n borderWidth: 1,\n borderRadius: 6,\n },\n searchIcon: {\n fontSize: 14,\n marginRight: 6,\n },\n searchInput: {\n flex: 1,\n fontSize: 14,\n paddingVertical: 0,\n },\n searchLtr: {\n textAlign: 'left' as const,\n writingDirection: 'ltr' as const,\n },\n searchRtl: {\n textAlign: 'right' as const,\n writingDirection: 'rtl' as const,\n },\n\n // Group header\n groupHeader: {\n paddingHorizontal: 12,\n paddingVertical: 8,\n borderBottomWidth: StyleSheet.hairlineWidth,\n },\n groupHeaderText: {\n fontSize: 12,\n fontWeight: '700',\n textTransform: 'uppercase',\n letterSpacing: 0.5,\n },\n\n // Items\n item: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingVertical: 10,\n paddingHorizontal: 12,\n gap: 10,\n borderBottomWidth: StyleSheet.hairlineWidth,\n },\n itemText: {\n fontSize: 14,\n flex: 1,\n },\n\n // Checkbox\n checkbox: {\n width: 20,\n height: 20,\n borderWidth: 2,\n borderRadius: 4,\n justifyContent: 'center',\n alignItems: 'center',\n },\n checkmark: {\n color: '#fff',\n fontSize: 13,\n fontWeight: '700',\n },\n\n // Loading / Empty\n loadingContainer: {\n padding: 24,\n alignItems: 'center',\n gap: 8,\n },\n loadingText: {\n fontSize: 13,\n },\n emptyContainer: {\n padding: 24,\n alignItems: 'center',\n },\n emptyText: {\n fontSize: 14,\n },\n\n // Modal\n overlay: {\n flex: 1,\n backgroundColor: 'rgba(0,0,0,0.4)',\n justifyContent: 'center',\n },\n modalPanel: {\n margin: 24,\n maxHeight: '70%',\n borderRadius: 12,\n overflow: 'hidden',\n },\n\n // Popover (Modal-portal)\n popoverOverlay: {\n flex: 1,\n backgroundColor: 'transparent',\n },\n popoverPanel: {\n position: 'absolute',\n borderWidth: 1,\n borderRadius: 6,\n overflow: 'hidden',\n elevation: 8,\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\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AAAA;AAAA,EAGA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,CAAA;AAAA,IACN,eAAA,EAAiB,iBAAA;AAAA,IACjB,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,UAAA,EAAY;AAAA,IACV,MAAA,EAAQ,EAAA;AAAA,IACR,SAAA,EAAW,KAAA;AAAA,IACX,YAAA,EAAc,EAAA;AAAA,IACd,QAAA,EAAU;AAAA,GACZ;AAAA;AAAA,EAGA,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,CAAA;AAAA,IACN,eAAA,EAAiB;AAAA,GACnB;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,QAAA,EAAU,UAAA;AAAA,IACV,WAAA,EAAa,CAAA;AAAA,IACb,YAAA,EAAc,CAAA;AAAA,IACd,QAAA,EAAU,QAAA;AAAA,IACV,SAAA,EAAW,CAAA;AAAA,IACX,WAAA,EAAa,MAAA;AAAA,IACb,YAAA,EAAc,EAAE,KAAA,EAAO,CAAA,EAAG,QAAQ,CAAA,EAAE;AAAA,IACpC,aAAA,EAAe,IAAA;AAAA,IACf,YAAA,EAAc;AAAA;AAElB,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../../apps/mobile/src/Core/MultiSelect/index.tsx"],"sourcesContent":["import React, { useMemo, useRef, useState } from 'react';\nimport {\n View,\n Text,\n TouchableOpacity,\n Modal,\n FlatList,\n TextInput,\n StyleSheet,\n Pressable,\n ActivityIndicator,\n Dimensions,\n} from 'react-native';\nimport { resolveThemeTokenForNative } from '../../Factory/helpers/style';\n\nexport type MultiSelectChangeEvent<T> = React.ChangeEvent<{\n value: T[];\n}>;\n\nexport interface MultiSelectProps<T> {\n value?: T[] | null;\n onChange?: (e: MultiSelectChangeEvent<T>, selectedItems: T[]) => void;\n isModal?: boolean;\n\n options?: T[];\n\n optionLabel?: keyof T | string;\n optionValue?: keyof T | string;\n\n optionGroupLabel?: keyof T | string;\n optionGroupChildren?: keyof T | string;\n\n placeholder?: string;\n disabled?: boolean;\n loading?: boolean;\n filter?: boolean;\n emptyFilterMessage?: string;\n /**\n * Placeholder for the panel's filter field, already written in the reader's\n * language by the KitsConcerto wrapper — this component lives in\n * `apps/mobile`, which `packages/ui` imports, so it cannot translate.\n */\n filterPlaceholder?: string;\n /** Reader's direction, from the wrapper's `useLanguage().isRTL`. */\n isRTL?: boolean;\n /**\n * Font family the app's theme names for body text, resolved by the wrapper.\n * React Native does not cascade fontFamily through Views, so each text sink\n * must set it — see the Dropdown's own note.\n */\n fontFamily?: string;\n /**\n * Open the options in a popup that owns the screen instead of a panel\n * anchored to the trigger. Default false — see the Dropdown's own `popup`\n * for why the anchor is the thing being escaped.\n */\n popup?: boolean;\n /**\n * Supplies the popup's container. Injected by the KitsConcerto wrapper: the\n * container is this library's `KitsDialogControlled`, which lives in\n * `packages/ui`, and `packages/ui` imports THIS file.\n */\n renderPopup?: (args: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => React.ReactNode;\n /** Title for the popup header. */\n popupTitle?: React.ReactNode;\n\n display?: 'comma' | 'chip';\n maxSelectedLabels?: number;\n\n itemTemplate?: (item: T) => React.ReactElement;\n selectedItemTemplate?: (item: T) => React.ReactElement;\n style?: import('react-native').ViewStyle;\n}\n\nconst t = resolveThemeTokenForNative;\n\nconst TEXT_STYLE_KEYS = new Set([\n 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle',\n 'color', 'letterSpacing', 'lineHeight', 'textAlign',\n 'textDecorationLine', 'textTransform',\n]);\n\nfunction splitStyle(combined?: any): { viewStyle?: any; textStyle?: any } {\n if (!combined) return {};\n const view: Record<string, any> = {};\n const text: Record<string, any> = {};\n for (const [k, v] of Object.entries(combined)) {\n if (TEXT_STYLE_KEYS.has(k)) text[k] = v;\n else view[k] = v;\n }\n return {\n viewStyle: Object.keys(view).length ? view : undefined,\n textStyle: Object.keys(text).length ? text : undefined,\n };\n}\n\nexport default function MultiSelect<T>(props: MultiSelectProps<T>) {\n const {\n value,\n onChange,\n options = [],\n optionLabel,\n optionValue,\n optionGroupLabel,\n optionGroupChildren,\n isModal = false,\n placeholder = 'Select',\n disabled,\n loading,\n filter,\n // ⚠️ English literals of last resort, not translations — the wrapper always\n // passes the reader's own sentence. These only apply when this component is\n // used directly from `apps/mobile`, so a panel can never render blank.\n emptyFilterMessage = 'No results found',\n filterPlaceholder = 'Search...',\n isRTL = false,\n fontFamily,\n popup = false,\n renderPopup,\n popupTitle,\n display = 'chip',\n maxSelectedLabels = 10,\n itemTemplate,\n selectedItemTemplate,\n style: externalStyle,\n } = props;\n\n const triggerRef = useRef<View>(null);\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const [triggerLayout, setTriggerLayout] = useState<{\n x: number; y: number; width: number; height: number;\n } | null>(null);\n\n const close = () => setOpen(false);\n\n const toggleOpen = () => {\n if (disabled) return;\n if (open) {\n setOpen(false);\n return;\n }\n triggerRef.current?.measureInWindow((x, y, width, height) => {\n setTriggerLayout({ x, y, width, height });\n setOpen(true);\n });\n };\n\n const { viewStyle: externalViewStyle, textStyle: externalTextStyle } = splitStyle(externalStyle);\n\n const colors = {\n border: t('border') || t('gray.300'),\n borderFocus: t('primary'),\n bg: t('surface-card') || '#fff',\n disabledBg: t('surface-ground') || t('gray.100'),\n placeholder: t('text-secondary') || t('gray.400'),\n text: t('text') || t('gray.800'),\n textSecondary: t('text-secondary') || t('gray.500'),\n chipBg: t('primary.100') || t('indigo.100'),\n chipText: t('primary.700') || t('indigo.700'),\n chipRemove: t('primary.500') || t('indigo.500'),\n chipMoreBg: t('surface-ground') || t('gray.100'),\n headerBorder: t('border') || t('gray.200'),\n groupBg: t('surface-ground') || t('gray.50'),\n groupBorder: t('border') || t('gray.200'),\n itemBorder: t('surface-ground') || t('gray.100'),\n itemSelectedBg: t('highlight-bg') || t('indigo.50'),\n itemSelectedText: t('primary.700') || t('indigo.700'),\n checkboxBorder: t('border') || t('gray.300'),\n checkboxChecked: t('primary'),\n invalidBorder: t('danger') || t('red.500'),\n searchBg: t('surface-ground') || t('gray.50'),\n };\n\n const getValue = (item: T, key?: keyof T | string) =>\n key ? (item as any)[key] : item;\n\n const getLabel = (item: T, key?: keyof T | string) =>\n String(key ? (item as any)[key] : item);\n\n const selectedValues = Array.isArray(value) ? value : [];\n\n // Build display items: flat list with optional group headers\n const displayItems: { type: 'group' | 'item'; data: any }[] = useMemo(() => {\n if (optionGroupLabel && optionGroupChildren) {\n const result: { type: 'group' | 'item'; data: any }[] = [];\n options.forEach((group: any) => {\n result.push({ type: 'group', data: group });\n const children = group[optionGroupChildren] ?? [];\n children.forEach((child: any) => result.push({ type: 'item', data: child }));\n });\n return result;\n }\n return options.map((item) => ({ type: 'item' as const, data: item }));\n }, [options, optionGroupLabel, optionGroupChildren]);\n\n const filtered = useMemo(() => {\n if (!filter || !query) return displayItems;\n return displayItems.filter((entry) => {\n if (entry.type === 'group') return true; // keep group headers\n return getLabel(entry.data, optionLabel)\n .toLowerCase()\n .includes(query.toLowerCase());\n });\n }, [query, displayItems]);\n\n const isSelected = (item: T) =>\n selectedValues.some(\n (v) => getValue(v, optionValue) === getValue(item, optionValue),\n );\n\n const toggleItem = (item: T) => {\n const exists = isSelected(item);\n const next = exists\n ? selectedValues.filter(\n (v) => getValue(v, optionValue) !== getValue(item, optionValue),\n )\n : [...selectedValues, item];\n\n const syntheticEvent = {\n target: { value: next },\n } as React.ChangeEvent<any>;\n\n onChange?.(syntheticEvent, next);\n };\n\n const removeItem = (item: T) => {\n const next = selectedValues.filter(\n (v) => getValue(v, optionValue) !== getValue(item, optionValue),\n );\n const syntheticEvent = {\n target: { value: next },\n } as React.ChangeEvent<any>;\n onChange?.(syntheticEvent, next);\n };\n\n const renderCheckbox = (checked: boolean) => (\n <View\n style={[\n styles.checkbox,\n { borderColor: colors.checkboxBorder, backgroundColor: colors.bg },\n checked && { backgroundColor: colors.checkboxChecked, borderColor: colors.checkboxChecked },\n ]}\n >\n {checked && <Text style={styles.checkmark}>✓</Text>}\n </View>\n );\n\n const renderListContent = () => {\n if (loading) {\n return (\n <View style={styles.loadingContainer}>\n <ActivityIndicator size=\"small\" color={colors.checkboxChecked} />\n <Text style={[styles.loadingText, { color: colors.placeholder }]}>Loading...</Text>\n </View>\n );\n }\n\n const itemsOnly = filtered.filter((e) => e.type === 'item');\n if (itemsOnly.length === 0) {\n return (\n <View style={styles.emptyContainer}>\n <Text style={[styles.emptyText, { color: colors.placeholder }]}>{emptyFilterMessage}</Text>\n </View>\n );\n }\n\n return (\n <FlatList\n data={filtered}\n keyExtractor={(entry, i) =>\n entry.type === 'group' ? `group-${i}` : `item-${i}`\n }\n keyboardShouldPersistTaps=\"handled\"\n renderItem={({ item: entry }) => {\n if (entry.type === 'group') {\n return (\n <View style={[styles.groupHeader, { backgroundColor: colors.groupBg, borderBottomColor: colors.groupBorder }]}>\n <Text style={[styles.groupHeaderText, { color: colors.textSecondary }]}>\n {getLabel(entry.data, optionGroupLabel)}\n </Text>\n </View>\n );\n }\n const checked = isSelected(entry.data);\n return (\n <TouchableOpacity\n onPress={() => toggleItem(entry.data)}\n style={[\n styles.item,\n { borderBottomColor: colors.itemBorder },\n checked && { backgroundColor: colors.itemSelectedBg },\n ]}\n activeOpacity={0.7}\n >\n {renderCheckbox(checked)}\n {itemTemplate ? (\n itemTemplate(entry.data)\n ) : (\n <Text style={[\n styles.itemText,\n { color: colors.text, fontFamily },\n checked && { color: colors.itemSelectedText, fontWeight: '500' },\n // The row starts at the reader's edge, so a label that opens\n // with a flag puts the flag where they start reading.\n isRTL ? styles.itemRtl : styles.itemLtr,\n ]}>\n {getLabel(entry.data, optionLabel)}\n </Text>\n )}\n </TouchableOpacity>\n );\n }}\n />\n );\n };\n\n const renderSelected = () => {\n if (!selectedValues.length) {\n return <Text style={[styles.placeholder, { color: colors.placeholder }, externalTextStyle]}>{placeholder}</Text>;\n }\n\n if (display === 'chip') {\n const visibleItems = selectedValues.slice(0, maxSelectedLabels);\n const remaining = selectedValues.length - maxSelectedLabels;\n return (\n <View style={styles.chips}>\n {visibleItems.map((item, i) =>\n selectedItemTemplate ? (\n <React.Fragment key={i}>{selectedItemTemplate(item)}</React.Fragment>\n ) : (\n <View key={i} style={[styles.chip, { backgroundColor: colors.chipBg }]}>\n <Text style={[styles.chipText, { color: colors.chipText }]}>{getLabel(item, optionLabel)}</Text>\n <TouchableOpacity\n onPress={() => removeItem(item)}\n hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}\n >\n <Text style={[styles.chipRemove, { color: colors.chipRemove }]}>✕</Text>\n </TouchableOpacity>\n </View>\n ),\n )}\n {remaining > 0 && (\n <View style={[styles.chipMore, { backgroundColor: colors.chipMoreBg }]}>\n <Text style={[styles.chipMoreText, { color: colors.textSecondary }]}>+{remaining}</Text>\n </View>\n )}\n </View>\n );\n }\n\n return (\n <Text numberOfLines={1} style={[styles.commaText, { color: colors.text }, externalTextStyle]}>\n {selectedValues\n .slice(0, maxSelectedLabels)\n .map((v) => getLabel(v, optionLabel))\n .join(', ')}\n </Text>\n );\n };\n\n const usePopup = popup && typeof renderPopup === 'function';\n\n const panelContent = (\n <View style={{ flex: 1 }}>\n {/* Header */}\n <View style={[styles.panelHeader, { borderBottomColor: colors.headerBorder }]}>\n <Text style={[styles.panelHeaderText, { color: colors.textSecondary }]}>\n {selectedValues.length} item{selectedValues.length !== 1 ? 's' : ''} selected\n </Text>\n {/* In popup mode the sheet already draws a close control, and two ✕\n in one header is a question the reader should not have to answer.\n The count stays — it is information, not chrome. */}\n {!usePopup && (\n <TouchableOpacity onPress={() => setOpen(false)}>\n <Text style={[styles.panelCloseText, { color: colors.placeholder }]}>✕</Text>\n </TouchableOpacity>\n )}\n </View>\n\n {/* Search */}\n {filter && (\n <View style={[styles.searchContainer, { borderColor: colors.border, backgroundColor: colors.searchBg }]}>\n <Text style={styles.searchIcon}>🔍</Text>\n <TextInput\n value={query}\n onChangeText={setQuery}\n placeholder={filterPlaceholder}\n style={[\n styles.searchInput,\n { color: colors.text, fontFamily },\n // The filter follows the reader's language, not the platform's\n // layout direction — same rule as the Dropdown's panel.\n isRTL ? styles.searchRtl : styles.searchLtr,\n ]}\n placeholderTextColor={colors.placeholder}\n />\n </View>\n )}\n\n {/* List */}\n {renderListContent()}\n </View>\n );\n\n return (\n <View style={{ width: '100%' }}>\n {/* Input trigger */}\n <TouchableOpacity\n ref={triggerRef as any}\n activeOpacity={0.8}\n disabled={disabled}\n onPress={toggleOpen}\n style={[\n styles.input,\n { borderColor: colors.border, backgroundColor: colors.bg },\n disabled && { backgroundColor: colors.disabledBg, opacity: 0.6 },\n open && { borderColor: colors.borderFocus },\n externalViewStyle,\n ]}\n >\n <View style={styles.inputContent}>\n {renderSelected()}\n </View>\n <Text style={[styles.dropdownArrow, { color: colors.placeholder }]}>{open ? '▲' : '▼'}</Text>\n </TouchableOpacity>\n\n {/* Popup — the container comes from the wrapper (this library's own\n Dialog in sheet position); `panelContent` is unchanged. */}\n {usePopup && renderPopup!({\n visible: open,\n onClose: () => setOpen(false),\n title: popupTitle,\n children: panelContent,\n })}\n\n {/* Modal mode */}\n {!usePopup && isModal && (\n <Modal visible={open} transparent animationType=\"fade\">\n <Pressable style={styles.overlay} onPress={() => setOpen(false)}>\n <View\n style={[styles.modalPanel, { backgroundColor: colors.bg }]}\n onStartShouldSetResponder={() => true}\n >\n {panelContent}\n </View>\n </Pressable>\n </Modal>\n )}\n\n {/* Inline mode — Modal-portal popover anchored to trigger */}\n {!usePopup && !isModal && (\n <Modal\n visible={open && !!triggerLayout}\n transparent\n animationType=\"none\"\n onRequestClose={close}\n >\n <Pressable style={styles.popoverOverlay} onPress={close}>\n {triggerLayout && (() => {\n const screen = Dimensions.get('window');\n const PANEL_MAX_HEIGHT = 320;\n const GAP = 4;\n const spaceBelow = screen.height - (triggerLayout.y + triggerLayout.height);\n const spaceAbove = triggerLayout.y;\n const openUp = spaceBelow < PANEL_MAX_HEIGHT && spaceAbove > spaceBelow;\n const maxHeight = Math.min(\n PANEL_MAX_HEIGHT,\n openUp ? spaceAbove - GAP : spaceBelow - GAP,\n );\n const top = openUp\n ? triggerLayout.y - maxHeight - GAP\n : triggerLayout.y + triggerLayout.height + GAP;\n\n return (\n <View\n style={[\n styles.popoverPanel,\n {\n top,\n left: triggerLayout.x,\n width: triggerLayout.width,\n maxHeight,\n borderColor: colors.border,\n backgroundColor: colors.bg,\n },\n ]}\n onStartShouldSetResponder={() => true}\n >\n {panelContent}\n </View>\n );\n })()}\n </Pressable>\n </Modal>\n )}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n // Input\n input: {\n minHeight: 42,\n borderWidth: 1,\n borderRadius: 6,\n paddingHorizontal: 10,\n paddingVertical: 6,\n flexDirection: 'row',\n alignItems: 'center',\n },\n inputContent: {\n flex: 1,\n },\n dropdownArrow: {\n fontSize: 10,\n marginLeft: 8,\n },\n\n // Placeholder\n placeholder: { fontSize: 14 },\n commaText: { fontSize: 14 },\n\n // Chips display\n chips: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: 4,\n },\n chip: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingLeft: 10,\n paddingRight: 6,\n paddingVertical: 3,\n borderRadius: 16,\n gap: 4,\n },\n chipText: {\n fontSize: 13,\n },\n chipRemove: {\n fontSize: 12,\n paddingHorizontal: 2,\n },\n chipMore: {\n paddingHorizontal: 10,\n paddingVertical: 3,\n borderRadius: 16,\n },\n chipMoreText: {\n fontSize: 13,\n },\n\n // Panel header\n panelHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingHorizontal: 12,\n paddingVertical: 10,\n borderBottomWidth: 1,\n },\n panelHeaderText: {\n fontSize: 13,\n },\n panelCloseText: {\n fontSize: 18,\n fontWeight: '600',\n },\n\n // Search\n searchContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n margin: 8,\n paddingHorizontal: 10,\n height: 36,\n borderWidth: 1,\n borderRadius: 6,\n },\n searchIcon: {\n fontSize: 14,\n marginRight: 6,\n },\n searchInput: {\n flex: 1,\n fontSize: 14,\n paddingVertical: 0,\n },\n itemLtr: {\n textAlign: 'left' as const,\n writingDirection: 'ltr' as const,\n },\n itemRtl: {\n textAlign: 'right' as const,\n writingDirection: 'rtl' as const,\n },\n searchLtr: {\n textAlign: 'left' as const,\n writingDirection: 'ltr' as const,\n },\n searchRtl: {\n textAlign: 'right' as const,\n writingDirection: 'rtl' as const,\n },\n\n // Group header\n groupHeader: {\n paddingHorizontal: 12,\n paddingVertical: 8,\n borderBottomWidth: StyleSheet.hairlineWidth,\n },\n groupHeaderText: {\n fontSize: 12,\n fontWeight: '700',\n textTransform: 'uppercase',\n letterSpacing: 0.5,\n },\n\n // Items\n item: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingVertical: 10,\n paddingHorizontal: 12,\n gap: 10,\n borderBottomWidth: StyleSheet.hairlineWidth,\n },\n itemText: {\n fontSize: 14,\n flex: 1,\n },\n\n // Checkbox\n checkbox: {\n width: 20,\n height: 20,\n borderWidth: 2,\n borderRadius: 4,\n justifyContent: 'center',\n alignItems: 'center',\n },\n checkmark: {\n color: '#fff',\n fontSize: 13,\n fontWeight: '700',\n },\n\n // Loading / Empty\n loadingContainer: {\n padding: 24,\n alignItems: 'center',\n gap: 8,\n },\n loadingText: {\n fontSize: 13,\n },\n emptyContainer: {\n padding: 24,\n alignItems: 'center',\n },\n emptyText: {\n fontSize: 14,\n },\n\n // Modal\n overlay: {\n flex: 1,\n backgroundColor: 'rgba(0,0,0,0.4)',\n justifyContent: 'center',\n },\n modalPanel: {\n margin: 24,\n maxHeight: '70%',\n borderRadius: 12,\n overflow: 'hidden',\n },\n\n // Popover (Modal-portal)\n popoverOverlay: {\n flex: 1,\n backgroundColor: 'transparent',\n },\n popoverPanel: {\n position: 'absolute',\n borderWidth: 1,\n borderRadius: 6,\n overflow: 'hidden',\n elevation: 8,\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.15,\n shadowRad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AS,EAAA;AAAA,IACT,UAAA,EAAY,QAAA;AAAA,IACZ,GAAA,EAAK;AAAA,GACP;AAAA,EACA,WAAA,EAAa;AAAA,IACX,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,OAAA,EAAS,EAAA;AAAA,IACT,UAAA,EAAY;AAAA,GACd;AAAA,EACA,SAAA,EAAW;AAAA,IACT,QAAA,EAAU;AAAA,GACZ;AAAA;AAAA,EAGA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,CAAA;AAAA,IACN,eAAA,EAAiB,iBAAA;AAAA,IACjB,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,UAAA,EAAY;AAAA,IACV,MAAA,EAAQ,EAAA;AAAA,IACR,SAAA,EAAW,KAAA;AAAA,IACX,YAAA,EAAc,EAAA;AAAA,IACd,QAAA,EAAU;AAAA,GACZ;AAAA;AAAA,EAGA,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,CAAA;AAAA,IACN,eAAA,EAAiB;AAAA,GACnB;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,QAAA,EAAU,UAAA;AAAA,IACV,WAAA,EAAa,CAAA;AAAA,IACb,YAAA,EAAc,CAAA;AAAA,IACd,QAAA,EAAU,QAAA;AAAA,IACV,SAAA,EAAW,CAAA;AAAA,IACX,WAAA,EAAa,MAAA;AAAA,IACb,YAAA,EAAc,EAAE,KAAA,EAAO,CAAA,EAAG,QAAQ,CAAA,EAAE;AAAA,IACpC,aAAA,EAAe,IAAA;AAAA,IACf,YAAA,EAAc;AAAA;AAElB,CAAC,CAAA;;;;"}
|
|
@@ -109,8 +109,8 @@ function KitsDialogControlled({ state, onHide }) {
|
|
|
109
109
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
110
110
|
Animated.View,
|
|
111
111
|
{
|
|
112
|
-
entering: isSheet ? Animated.SlideInDown.springify().damping(index.overlayAnimations.sheet.enter.damping).stiffness(index.overlayAnimations.sheet.enter.stiffness).mass(index.overlayAnimations.sheet.enter.mass) : Animated.ZoomIn.springify().damping(index.overlayAnimations.dialog.enter.damping).stiffness(index.overlayAnimations.dialog.enter.stiffness).mass(index.overlayAnimations.dialog.enter.mass),
|
|
113
|
-
exiting: (isSheet ? Animated.SlideOutDown.duration(index.overlayAnimations.sheet.exitDuration).easing(Animated.Easing.in(Animated.Easing.ease)) : Animated.ZoomOut.duration(index.overlayAnimations.dialog.exitDuration).easing(Animated.Easing.in(Animated.Easing.ease))).withCallback((finished) => {
|
|
112
|
+
entering: isSheet ? Animated.SlideInDown.springify().damping(index.overlayAnimations.sheet.enter.damping).stiffness(index.overlayAnimations.sheet.enter.stiffness).mass(index.overlayAnimations.sheet.enter.mass).reduceMotion(Animated.ReduceMotion.Never ) : Animated.ZoomIn.springify().damping(index.overlayAnimations.dialog.enter.damping).stiffness(index.overlayAnimations.dialog.enter.stiffness).mass(index.overlayAnimations.dialog.enter.mass),
|
|
113
|
+
exiting: (isSheet ? Animated.SlideOutDown.duration(index.overlayAnimations.sheet.exitDuration).easing(Animated.Easing.in(Animated.Easing.ease)).reduceMotion(Animated.ReduceMotion.Never ) : Animated.ZoomOut.duration(index.overlayAnimations.dialog.exitDuration).easing(Animated.Easing.in(Animated.Easing.ease))).withCallback((finished) => {
|
|
114
114
|
"worklet";
|
|
115
115
|
if (finished) Animated.runOnJS(handleExitFinished)();
|
|
116
116
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/overlay/Dialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, ScrollView, StyleSheet, View, useWindowDimensions} from \"react-native\";\nimport Animated, {Easing, FadeIn, FadeOut, runOnJS, SlideInDown, SlideOutDown, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IKitsDialogControlled} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim} from \"../../../animations\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit re-renders the inner (which\n * re-enters), and the still-pending exit callback is ignored because\n * `visibleRef` is already back to `true` — so the Modal is never torn down\n * mid-reopen.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\nexport default function KitsDialogControlled({state, onHide}: IKitsDialogControlled) {\n const {\n children,\n content: contentProp,\n onClose,\n asyncClose,\n type,\n icon,\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n position = 'center',\n responsive = true,\n hideHeader,\n headerRender,\n footerRender,\n footerStyle,\n canClose,\n bodyStyle,\n closeIcon,\n // Native default true preserves historical tap-to-dismiss; web's\n // PrimeReact default is false — pass explicitly in shared code.\n dismissableMask = true,\n breakpoints,\n ...rest\n } = state;\n const {resolveToken, theme} = useKitsTheme();\n const severityColors = useSeverityColors(type || 'secondary');\n const colors = type ? severityColors : null;\n const insets = useSafeAreaInsets();\n const isSheet = position === 'bottom';\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const borderColor = colors?.border ?? resolveToken('border');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n const resolvedFooterStyle = useResolvedStyle(footerStyle || {});\n const resolvedBodyStyle = useResolvedStyle(bodyStyle || {});\n\n const {width: screenWidth} = useWindowDimensions();\n // Consumer `breakpoints` ({'960px': '75vw'}) mirrors the web prop: the\n // smallest max-width threshold >= the screen width wins; vw/% both map\n // to a percentage of the window width. Falls back to the responsive\n // default (50% tablets/desktop, 95% phones <=641px).\n const breakpointWidth = (() => {\n if (!breakpoints) return null;\n const matches = Object.entries(breakpoints)\n .map(([k, v]) => [parseFloat(k), v] as const)\n .filter(([px]) => !Number.isNaN(px) && screenWidth <= px)\n .sort(([a], [b]) => a - b);\n const value = matches[0]?.[1];\n if (value == null) return null;\n const num = parseFloat(value);\n return Number.isNaN(num) ? null : `${num}%`;\n })();\n const responsiveWidth = breakpointWidth ?? (screenWidth > 641 ? '50%' : '95%');\n const hasExplicitWidth = (resolvedStyle as any).width != null;\n\n const hide = async () => {\n // canClose gate — intercepts every close path (backdrop Pressable,\n // built-in X Pressable, RN Modal onRequestClose). When blocked,\n // onClose is suppressed and the dialog stays open.\n if (canClose === false || (typeof canClose === 'function' && !canClose())) {\n return;\n }\n if (asyncClose && typeof onClose === \"function\") {\n await onClose();\n } else {\n onClose?.();\n }\n onHide();\n };\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!state.visible);\n if (!mounted) return null;\n\n const content = typeof children === \"function\" ? children(hide) : children;\n // Content-mode override (mirrors web): consumer node replaces the whole\n // header / body / footer template inside the panel.\n const contentMode = contentProp != null\n ? (typeof contentProp === \"function\" ? contentProp({hide}) : contentProp)\n : null;\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {state.visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(anim.scrim.exitDuration)}\n style={[isSheet ? styles.sheetOverlay : styles.overlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={dismissableMask ? hide : undefined}/>\n <Animated.View\n entering={isSheet\n ? SlideInDown.springify().damping(anim.sheet.enter.damping).stiffness(anim.sheet.enter.stiffness).mass(anim.sheet.enter.mass ?? 1)\n : ZoomIn.springify().damping(anim.dialog.enter.damping).stiffness(anim.dialog.enter.stiffness).mass(anim.dialog.enter.mass ?? 1)}\n exiting={(isSheet\n ? SlideOutDown.duration(anim.sheet.exitDuration).easing(Easing.in(Easing.ease))\n : ZoomOut.duration(anim.dialog.exitDuration).easing(Easing.in(Easing.ease))\n ).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n isSheet && styles.sheetPanel,\n {backgroundColor: surfaceColor, borderColor},\n // Explicit `breakpoints` win even when responsive=false (web parity)\n !isSheet && !hasExplicitWidth && (breakpoints != null || responsive) ? {width: responsiveWidth} : null,\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {contentMode != null ? contentMode : <>\n {/* Grabber (bottom-sheet) */}\n {isSheet && <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>}\n\n {/* Severity accent strip */}\n {colors && !isSheet && (\n <View style={{height: 4, backgroundColor: colors.solid, borderTopLeftRadius: 20, borderTopRightRadius: 20}}/>\n )}\n\n {/* Custom header (headerRender) — fully replaces the built-in header\n View when provided. Wins over the default header even if `header`\n is also set. */}\n {!hideHeader && headerRender != null && headerRender({close: () => { void hide(); }})}\n\n {/* Header (default) — rendered when no headerRender and `header` is set. */}\n {!hideHeader && headerRender == null && rest.header != null && (\n <View style={[styles.header, {borderBottomColor: borderColor}, resolvedHeaderStyle as any]}>\n {/* Inline severity icon */}\n {(icon || brandLogo) && colors && (\n <View style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: colors.iconBg,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n }}>\n {brandLogo ? brandLogo : typeof icon === 'string' ? (\n <Icon name={icon as never} size={'lg'} color={colors.iconFg}/>\n ) : icon}\n </View>\n )}\n <Text style={{fontSize: 18, fontWeight: \"700\", color: textColor, flex: 1}}>\n {rest.header as React.ReactNode}\n </Text>\n <Pressable onPress={hide} hitSlop={8}>\n {closeIcon ?? <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>}\n </Pressable>\n </View>\n )}\n\n {/* Body — bodyStyle is applied AFTER the built-in maxHeight: 400,\n so consumers can lift the cap (`maxHeight: 600`) or unlock flex\n sizing (`minHeight: 0`) without losing the default behavior when\n bodyStyle is unset. */}\n <ScrollView\n style={[styles.body, resolvedBodyStyle as any]}\n contentContainerStyle={styles.bodyContent}\n showsVerticalScrollIndicator={false}\n >\n {content}\n </ScrollView>\n\n {/* Footer — footerRender takes precedence over `footer`. footerStyle\n is merged AFTER the built-in flex defaults so consumers can override\n alignment (e.g. justifyContent: 'space-between' for left-delete /\n right-actions layouts) without losing the borderTop / padding. */}\n {(footerRender != null || rest.footer != null) && (\n <View style={[\n styles.footer,\n {borderTopColor: borderColor},\n isSheet && {paddingBottom: 12 + insets.bottom},\n resolvedFooterStyle as any,\n ]}>\n {footerRender\n ? footerRender({close: () => { void hide(); }})\n : (rest.footer as React.ReactNode)}\n </View>\n )}\n </>}\n </Animated.View>\n </Animated.View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n sheetOverlay: {\n flex: 1,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n width: \"100%\",\n maxWidth: \"100%\",\n maxHeight: \"90%\",\n borderWidth: 0,\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n paddingTop: 10,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n panel: {\n // 20 == radii.xl (no numeric radii resolver on native — see report).\n borderRadius: 20,\n borderWidth: 1,\n minWidth: 250,\n maxWidth: \"90%\",\n maxHeight: \"80%\",\n overflow: \"hidden\",\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n header: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n paddingVertical: 16,\n borderBottomWidth: 1,\n },\n body: {\n maxHeight: 400,\n },\n bodyContent: {\n padding: 20,\n },\n footer: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n paddingHorizontal: 20,\n paddingVertical: 12,\n borderTopWidth: 1,\n gap: 8,\n },\n});\n"],"names":["useKitsTheme","useSeverityColors","useSafeAreaInsets","useResolvedStyle","useWindowDimensions","jsx","Modal","jsxs","FadeIn","anim","FadeOut","Pressable","StyleSheet","SlideInDown","ZoomIn","SlideOutDown","Easing","ZoomOut","runOnJS","Fragment","View","Icon","Text","ScrollView"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,KAAA,CAAM,SAAS,OAAO,CAAA;AACpD,EAAA,MAAM,UAAA,GAAa,KAAA,CAAM,MAAA,CAAO,OAAO,CAAA;AACvC,EAAA,KAAA,CAAM,UAAU,MAAM;AAClB,IAAA,UAAA,CAAW,OAAA,GAAU,OAAA;AACrB,IAAA,IAAI,OAAA,aAAoB,IAAI,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,kBAAA,GAAqB,KAAA,CAAM,WAAA,CAAY,MAAM;AAC/C,IAAA,IAAI,CAAC,UAAA,CAAW,OAAA,EAAS,UAAA,CAAW,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A;AAAA,IACX,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,KAAA,EAAO;AAAA;AAAA,IAEH,YAAA,EAAc,EAAA;AAAA,IACd,WAAA,EAAa,CAAA;AAAA,IACb,QAAA,EAAU,GAAA;AAAA,IACV,QAAA,EAAU,KAAA;AAAA,IACV,SAAA,EAAW,KAAA;AAAA,IACX,QAAA,EAAU,QAAA;AAAA;AAAA,IAEV,SAAA,EAAW,CAAA;AAAA,IACX,WAAA,EAAa,MAAA;AAAA,IACb,YAAA,EAAc,EAAC,KAAA,EAAO,CAAA,EAAG,QAAQ,CAAA,EAAC;AAAA,IAClC,aAAA,EAAe,IAAA;AAAA,IACf,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,UAAA,EAAY,QAAA;AAAA,IACZ,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB;AAAA,GACvB;AAAA,EACA,IAAA,EAAM;AAAA,IACF,SAAA,EAAW;AAAA,GACf;AAAA,EACA,WAAA,EAAa;AAAA,IACT,OAAA,EAAS;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,cAAA,EAAgB,UAAA;AAAA,IAChB,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,cAAA,EAAgB,CAAA;AAAA,IAChB,GAAA,EAAK;AAAA;AAEb,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/overlay/Dialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, ScrollView, StyleSheet, View, useWindowDimensions} from \"react-native\";\nimport Animated, {Easing, FadeIn, FadeOut, ReduceMotion, runOnJS, SlideInDown, SlideOutDown, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IKitsDialogControlled} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim} from \"../../../animations\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit re-renders the inner (which\n * re-enters), and the still-pending exit callback is ignored because\n * `visibleRef` is already back to `true` — so the Modal is never torn down\n * mid-reopen.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\nexport default function KitsDialogControlled({state, onHide}: IKitsDialogControlled) {\n const {\n children,\n content: contentProp,\n onClose,\n asyncClose,\n type,\n icon,\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n position = 'center',\n responsive = true,\n hideHeader,\n headerRender,\n footerRender,\n footerStyle,\n canClose,\n bodyStyle,\n closeIcon,\n // Native default true preserves historical tap-to-dismiss; web's\n // PrimeReact default is false — pass explicitly in shared code.\n dismissableMask = true,\n breakpoints,\n ...rest\n } = state;\n const {resolveToken, theme} = useKitsTheme();\n const severityColors = useSeverityColors(type || 'secondary');\n const colors = type ? severityColors : null;\n const insets = useSafeAreaInsets();\n const isSheet = position === 'bottom';\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const borderColor = colors?.border ?? resolveToken('border');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n const resolvedFooterStyle = useResolvedStyle(footerStyle || {});\n const resolvedBodyStyle = useResolvedStyle(bodyStyle || {});\n\n const {width: screenWidth} = useWindowDimensions();\n // Consumer `breakpoints` ({'960px': '75vw'}) mirrors the web prop: the\n // smallest max-width threshold >= the screen width wins; vw/% both map\n // to a percentage of the window width. Falls back to the responsive\n // default (50% tablets/desktop, 95% phones <=641px).\n const breakpointWidth = (() => {\n if (!breakpoints) return null;\n const matches = Object.entries(breakpoints)\n .map(([k, v]) => [parseFloat(k), v] as const)\n .filter(([px]) => !Number.isNaN(px) && screenWidth <= px)\n .sort(([a], [b]) => a - b);\n const value = matches[0]?.[1];\n if (value == null) return null;\n const num = parseFloat(value);\n return Number.isNaN(num) ? null : `${num}%`;\n })();\n const responsiveWidth = breakpointWidth ?? (screenWidth > 641 ? '50%' : '95%');\n const hasExplicitWidth = (resolvedStyle as any).width != null;\n\n const hide = async () => {\n // canClose gate — intercepts every close path (backdrop Pressable,\n // built-in X Pressable, RN Modal onRequestClose). When blocked,\n // onClose is suppressed and the dialog stays open.\n if (canClose === false || (typeof canClose === 'function' && !canClose())) {\n return;\n }\n if (asyncClose && typeof onClose === \"function\") {\n await onClose();\n } else {\n onClose?.();\n }\n onHide();\n };\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!state.visible);\n if (!mounted) return null;\n\n const content = typeof children === \"function\" ? children(hide) : children;\n // Content-mode override (mirrors web): consumer node replaces the whole\n // header / body / footer template inside the panel.\n const contentMode = contentProp != null\n ? (typeof contentProp === \"function\" ? contentProp({hide}) : contentProp)\n : null;\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {state.visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(anim.scrim.exitDuration)}\n style={[isSheet ? styles.sheetOverlay : styles.overlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={dismissableMask ? hide : undefined}/>\n <Animated.View\n /* The sheet asks Reanimated to keep moving under iOS\n \"Reduce Motion\" — see `overlayAnimations.sheet`. Without\n it the panel appears in one frame and the only motion\n left is the scrim, which reads as a fade. The centred\n dialog keeps the system default. */\n entering={isSheet\n ? SlideInDown.springify().damping(anim.sheet.enter.damping).stiffness(anim.sheet.enter.stiffness).mass(anim.sheet.enter.mass ?? 1)\n .reduceMotion(anim.sheet.keepMotionWhenReduced ? ReduceMotion.Never : ReduceMotion.System)\n : ZoomIn.springify().damping(anim.dialog.enter.damping).stiffness(anim.dialog.enter.stiffness).mass(anim.dialog.enter.mass ?? 1)}\n exiting={(isSheet\n ? SlideOutDown.duration(anim.sheet.exitDuration).easing(Easing.in(Easing.ease))\n .reduceMotion(anim.sheet.keepMotionWhenReduced ? ReduceMotion.Never : ReduceMotion.System)\n : ZoomOut.duration(anim.dialog.exitDuration).easing(Easing.in(Easing.ease))\n ).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n isSheet && styles.sheetPanel,\n {backgroundColor: surfaceColor, borderColor},\n // Explicit `breakpoints` win even when responsive=false (web parity)\n !isSheet && !hasExplicitWidth && (breakpoints != null || responsive) ? {width: responsiveWidth} : null,\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {contentMode != null ? contentMode : <>\n {/* Grabber (bottom-sheet) */}\n {isSheet && <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>}\n\n {/* Severity accent strip */}\n {colors && !isSheet && (\n <View style={{height: 4, backgroundColor: colors.solid, borderTopLeftRadius: 20, borderTopRightRadius: 20}}/>\n )}\n\n {/* Custom header (headerRender) — fully replaces the built-in header\n View when provided. Wins over the default header even if `header`\n is also set. */}\n {!hideHeader && headerRender != null && headerRender({close: () => { void hide(); }})}\n\n {/* Header (default) — rendered when no headerRender and `header` is set. */}\n {!hideHeader && headerRender == null && rest.header != null && (\n <View style={[styles.header, {borderBottomColor: borderColor}, resolvedHeaderStyle as any]}>\n {/* Inline severity icon */}\n {(icon || brandLogo) && colors && (\n <View style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: colors.iconBg,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n }}>\n {brandLogo ? brandLogo : typeof icon === 'string' ? (\n <Icon name={icon as never} size={'lg'} color={colors.iconFg}/>\n ) : icon}\n </View>\n )}\n <Text style={{fontSize: 18, fontWeight: \"700\", color: textColor, flex: 1}}>\n {rest.header as React.ReactNode}\n </Text>\n <Pressable onPress={hide} hitSlop={8}>\n {closeIcon ?? <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>}\n </Pressable>\n </View>\n )}\n\n {/* Body — bodyStyle is applied AFTER the built-in maxHeight: 400,\n so consumers can lift the cap (`maxHeight: 600`) or unlock flex\n sizing (`minHeight: 0`) without losing the default behavior when\n bodyStyle is unset. */}\n <ScrollView\n style={[styles.body, resolvedBodyStyle as any]}\n contentContainerStyle={styles.bodyContent}\n showsVerticalScrollIndicator={false}\n >\n {content}\n </ScrollView>\n\n {/* Footer — footerRender takes precedence over `footer`. footerStyle\n is merged AFTER the built-in flex defaults so consumers can override\n alignment (e.g. justifyContent: 'space-between' for left-delete /\n right-actions layouts) without losing the borderTop / padding. */}\n {(footerRender != null || rest.footer != null) && (\n <View style={[\n styles.footer,\n {borderTopColor: borderColor},\n isSheet && {paddingBottom: 12 + insets.bottom},\n resolvedFooterStyle as any,\n ]}>\n {footerRender\n ? footerRender({close: () => { void hide(); }})\n : (rest.footer as React.ReactNode)}\n </View>\n )}\n </>}\n </Animated.View>\n </Animated.View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n sheetOverlay: {\n flex: 1,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n width: \"100%\",\n maxWidth: \"100%\",\n maxHeight: \"90%\",\n borderWidth: 0,\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n paddingTop: 10,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n panel: {\n // 20 == radii.xl (no numeric radii resolver on native — see report).\n borderRadius: 20,\n borderWidth: 1,\n minWidth: 250,\n maxWidth: \"90%\",\n maxHeight: \"80%\",\n overflow: \"hidden\",\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n header: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n paddingVertical: 16,\n borderBottomWidth: 1,\n },\n body: {\n maxHeight: 400,\n },\n bodyContent: {\n padding: 20,\n },\n footer: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n paddingHorizontal: 20,\n paddingVertical: 12,\n borderTopWidth: 1,\n gap: 8,\n },\n});\n"],"names":["useKitsTheme","useSeverityColors","useSafeAreaInsets","useResolvedStyle","useWindowDimensions","jsx","Modal","jsxs","FadeIn","anim","FadeOut","Pressable","StyleSheet","SlideInDown","ReduceMotion","ZoomIn","SlideOutDown","Easing","ZoomOut","runOnJS","Fragment","View","Icon","Text","ScrollView"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,KAAA,CAAM,SAAS,OAAO,CAAA;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ACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,cAAA,EAAgB,UAAA;AAAA,IAChB,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,cAAA,EAAgB,CAAA;AAAA,IAChB,GAAA,EAAK;AAAA;AAEb,CAAC,CAAA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useWindowDimensions, Modal, Pressable, StyleSheet, View, ScrollView } from 'react-native';
|
|
4
|
-
import Animated, { SlideOutDown, Easing, ZoomOut, runOnJS, SlideInDown, ZoomIn, FadeOut, FadeIn } from 'react-native-reanimated';
|
|
4
|
+
import Animated, { SlideOutDown, Easing, ReduceMotion, ZoomOut, runOnJS, SlideInDown, ZoomIn, FadeOut, FadeIn } from 'react-native-reanimated';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import { useSeverityColors } from '../../../hooks/useSeverityColors.js';
|
|
7
7
|
import '../../../contexts/DialogContext.js';
|
|
@@ -105,8 +105,8 @@ function KitsDialogControlled({ state, onHide }) {
|
|
|
105
105
|
/* @__PURE__ */ jsx(
|
|
106
106
|
Animated.View,
|
|
107
107
|
{
|
|
108
|
-
entering: isSheet ? SlideInDown.springify().damping(overlayAnimations.sheet.enter.damping).stiffness(overlayAnimations.sheet.enter.stiffness).mass(overlayAnimations.sheet.enter.mass) : ZoomIn.springify().damping(overlayAnimations.dialog.enter.damping).stiffness(overlayAnimations.dialog.enter.stiffness).mass(overlayAnimations.dialog.enter.mass),
|
|
109
|
-
exiting: (isSheet ? SlideOutDown.duration(overlayAnimations.sheet.exitDuration).easing(Easing.in(Easing.ease)) : ZoomOut.duration(overlayAnimations.dialog.exitDuration).easing(Easing.in(Easing.ease))).withCallback((finished) => {
|
|
108
|
+
entering: isSheet ? SlideInDown.springify().damping(overlayAnimations.sheet.enter.damping).stiffness(overlayAnimations.sheet.enter.stiffness).mass(overlayAnimations.sheet.enter.mass).reduceMotion(ReduceMotion.Never ) : ZoomIn.springify().damping(overlayAnimations.dialog.enter.damping).stiffness(overlayAnimations.dialog.enter.stiffness).mass(overlayAnimations.dialog.enter.mass),
|
|
109
|
+
exiting: (isSheet ? SlideOutDown.duration(overlayAnimations.sheet.exitDuration).easing(Easing.in(Easing.ease)).reduceMotion(ReduceMotion.Never ) : ZoomOut.duration(overlayAnimations.dialog.exitDuration).easing(Easing.in(Easing.ease))).withCallback((finished) => {
|
|
110
110
|
"worklet";
|
|
111
111
|
if (finished) runOnJS(handleExitFinished)();
|
|
112
112
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/overlay/Dialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, ScrollView, StyleSheet, View, useWindowDimensions} from \"react-native\";\nimport Animated, {Easing, FadeIn, FadeOut, runOnJS, SlideInDown, SlideOutDown, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IKitsDialogControlled} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim} from \"../../../animations\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit re-renders the inner (which\n * re-enters), and the still-pending exit callback is ignored because\n * `visibleRef` is already back to `true` — so the Modal is never torn down\n * mid-reopen.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\nexport default function KitsDialogControlled({state, onHide}: IKitsDialogControlled) {\n const {\n children,\n content: contentProp,\n onClose,\n asyncClose,\n type,\n icon,\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n position = 'center',\n responsive = true,\n hideHeader,\n headerRender,\n footerRender,\n footerStyle,\n canClose,\n bodyStyle,\n closeIcon,\n // Native default true preserves historical tap-to-dismiss; web's\n // PrimeReact default is false — pass explicitly in shared code.\n dismissableMask = true,\n breakpoints,\n ...rest\n } = state;\n const {resolveToken, theme} = useKitsTheme();\n const severityColors = useSeverityColors(type || 'secondary');\n const colors = type ? severityColors : null;\n const insets = useSafeAreaInsets();\n const isSheet = position === 'bottom';\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const borderColor = colors?.border ?? resolveToken('border');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n const resolvedFooterStyle = useResolvedStyle(footerStyle || {});\n const resolvedBodyStyle = useResolvedStyle(bodyStyle || {});\n\n const {width: screenWidth} = useWindowDimensions();\n // Consumer `breakpoints` ({'960px': '75vw'}) mirrors the web prop: the\n // smallest max-width threshold >= the screen width wins; vw/% both map\n // to a percentage of the window width. Falls back to the responsive\n // default (50% tablets/desktop, 95% phones <=641px).\n const breakpointWidth = (() => {\n if (!breakpoints) return null;\n const matches = Object.entries(breakpoints)\n .map(([k, v]) => [parseFloat(k), v] as const)\n .filter(([px]) => !Number.isNaN(px) && screenWidth <= px)\n .sort(([a], [b]) => a - b);\n const value = matches[0]?.[1];\n if (value == null) return null;\n const num = parseFloat(value);\n return Number.isNaN(num) ? null : `${num}%`;\n })();\n const responsiveWidth = breakpointWidth ?? (screenWidth > 641 ? '50%' : '95%');\n const hasExplicitWidth = (resolvedStyle as any).width != null;\n\n const hide = async () => {\n // canClose gate — intercepts every close path (backdrop Pressable,\n // built-in X Pressable, RN Modal onRequestClose). When blocked,\n // onClose is suppressed and the dialog stays open.\n if (canClose === false || (typeof canClose === 'function' && !canClose())) {\n return;\n }\n if (asyncClose && typeof onClose === \"function\") {\n await onClose();\n } else {\n onClose?.();\n }\n onHide();\n };\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!state.visible);\n if (!mounted) return null;\n\n const content = typeof children === \"function\" ? children(hide) : children;\n // Content-mode override (mirrors web): consumer node replaces the whole\n // header / body / footer template inside the panel.\n const contentMode = contentProp != null\n ? (typeof contentProp === \"function\" ? contentProp({hide}) : contentProp)\n : null;\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {state.visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(anim.scrim.exitDuration)}\n style={[isSheet ? styles.sheetOverlay : styles.overlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={dismissableMask ? hide : undefined}/>\n <Animated.View\n entering={isSheet\n ? SlideInDown.springify().damping(anim.sheet.enter.damping).stiffness(anim.sheet.enter.stiffness).mass(anim.sheet.enter.mass ?? 1)\n : ZoomIn.springify().damping(anim.dialog.enter.damping).stiffness(anim.dialog.enter.stiffness).mass(anim.dialog.enter.mass ?? 1)}\n exiting={(isSheet\n ? SlideOutDown.duration(anim.sheet.exitDuration).easing(Easing.in(Easing.ease))\n : ZoomOut.duration(anim.dialog.exitDuration).easing(Easing.in(Easing.ease))\n ).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n isSheet && styles.sheetPanel,\n {backgroundColor: surfaceColor, borderColor},\n // Explicit `breakpoints` win even when responsive=false (web parity)\n !isSheet && !hasExplicitWidth && (breakpoints != null || responsive) ? {width: responsiveWidth} : null,\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {contentMode != null ? contentMode : <>\n {/* Grabber (bottom-sheet) */}\n {isSheet && <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>}\n\n {/* Severity accent strip */}\n {colors && !isSheet && (\n <View style={{height: 4, backgroundColor: colors.solid, borderTopLeftRadius: 20, borderTopRightRadius: 20}}/>\n )}\n\n {/* Custom header (headerRender) — fully replaces the built-in header\n View when provided. Wins over the default header even if `header`\n is also set. */}\n {!hideHeader && headerRender != null && headerRender({close: () => { void hide(); }})}\n\n {/* Header (default) — rendered when no headerRender and `header` is set. */}\n {!hideHeader && headerRender == null && rest.header != null && (\n <View style={[styles.header, {borderBottomColor: borderColor}, resolvedHeaderStyle as any]}>\n {/* Inline severity icon */}\n {(icon || brandLogo) && colors && (\n <View style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: colors.iconBg,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n }}>\n {brandLogo ? brandLogo : typeof icon === 'string' ? (\n <Icon name={icon as never} size={'lg'} color={colors.iconFg}/>\n ) : icon}\n </View>\n )}\n <Text style={{fontSize: 18, fontWeight: \"700\", color: textColor, flex: 1}}>\n {rest.header as React.ReactNode}\n </Text>\n <Pressable onPress={hide} hitSlop={8}>\n {closeIcon ?? <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>}\n </Pressable>\n </View>\n )}\n\n {/* Body — bodyStyle is applied AFTER the built-in maxHeight: 400,\n so consumers can lift the cap (`maxHeight: 600`) or unlock flex\n sizing (`minHeight: 0`) without losing the default behavior when\n bodyStyle is unset. */}\n <ScrollView\n style={[styles.body, resolvedBodyStyle as any]}\n contentContainerStyle={styles.bodyContent}\n showsVerticalScrollIndicator={false}\n >\n {content}\n </ScrollView>\n\n {/* Footer — footerRender takes precedence over `footer`. footerStyle\n is merged AFTER the built-in flex defaults so consumers can override\n alignment (e.g. justifyContent: 'space-between' for left-delete /\n right-actions layouts) without losing the borderTop / padding. */}\n {(footerRender != null || rest.footer != null) && (\n <View style={[\n styles.footer,\n {borderTopColor: borderColor},\n isSheet && {paddingBottom: 12 + insets.bottom},\n resolvedFooterStyle as any,\n ]}>\n {footerRender\n ? footerRender({close: () => { void hide(); }})\n : (rest.footer as React.ReactNode)}\n </View>\n )}\n </>}\n </Animated.View>\n </Animated.View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n sheetOverlay: {\n flex: 1,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n width: \"100%\",\n maxWidth: \"100%\",\n maxHeight: \"90%\",\n borderWidth: 0,\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n paddingTop: 10,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n panel: {\n // 20 == radii.xl (no numeric radii resolver on native — see report).\n borderRadius: 20,\n borderWidth: 1,\n minWidth: 250,\n maxWidth: \"90%\",\n maxHeight: \"80%\",\n overflow: \"hidden\",\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n header: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n paddingVertical: 16,\n borderBottomWidth: 1,\n },\n body: {\n maxHeight: 400,\n },\n bodyContent: {\n padding: 20,\n },\n footer: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n paddingHorizontal: 20,\n paddingVertical: 12,\n borderTopWidth: 1,\n gap: 8,\n },\n});\n"],"names":["anim"],"mappings":";;;;;;;;;;;;;AAqBA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,KAAA,CAAM,SAAS,OAAO,CAAA;AACpD,EAAA,MAAM,UAAA,GAAa,KAAA,CAAM,MAAA,CAAO,OAAO,CAAA;AACvC,EAAA,KAAA,CAAM,UAAU,MAAM;AAClB,IAAA,UAAA,CAAW,OAAA,GAAU,OAAA;AACrB,IAAA,IAAI,OAAA,aAAoB,IAAI,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,kBAAA,GAAqB,KAAA,CAAM,WAAA,CAAY,MAAM;AAC/C,IAAA,IAAI,CAAC,UAAA,CAAW,OAAA,EAAS,UAAA,CAAW,KAAK,CAAA;AAAA,EAC7C,CAAA,EAAG,EAAE,CAAA;AACL,EAAA,OAAO,EAAC,SAAS,kBAAA,EAAkB;AACvC;AAEA,SAAwB,oBAAA,CAAqB,EAAC,KAAA,EAAO,MAAA,EAAM,EAA0B;AACjF,EAAA,MAAM;AAAA,IACF,QAAA;AAAA,IACA,OAAA,EAAS,WAAA;AAAA,IACT,OAAA;AAAA,IACA,UAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA,GAAW,QAAA;AAAA,IACX,UAAA,GAAa,IAAA;AAAA,IACb,UAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA;AAAA;AAAA;AAAA,IAGA,eAAA,GAAkB,IAAA;AAAA,IAClB,WAAA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;AAAA,GACf;AAAA,EACA,WAAA,EAAa;AAAA,IACT,OAAA,EAAS;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,cAAA,EAAgB,UAAA;AAAA,IAChB,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,cAAA,EAAgB,CAAA;AAAA,IAChB,GAAA,EAAK;AAAA;AAEb,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/overlay/Dialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, ScrollView, StyleSheet, View, useWindowDimensions} from \"react-native\";\nimport Animated, {Easing, FadeIn, FadeOut, ReduceMotion, runOnJS, SlideInDown, SlideOutDown, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IKitsDialogControlled} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim} from \"../../../animations\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit re-renders the inner (which\n * re-enters), and the still-pending exit callback is ignored because\n * `visibleRef` is already back to `true` — so the Modal is never torn down\n * mid-reopen.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\nexport default function KitsDialogControlled({state, onHide}: IKitsDialogControlled) {\n const {\n children,\n content: contentProp,\n onClose,\n asyncClose,\n type,\n icon,\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n position = 'center',\n responsive = true,\n hideHeader,\n headerRender,\n footerRender,\n footerStyle,\n canClose,\n bodyStyle,\n closeIcon,\n // Native default true preserves historical tap-to-dismiss; web's\n // PrimeReact default is false — pass explicitly in shared code.\n dismissableMask = true,\n breakpoints,\n ...rest\n } = state;\n const {resolveToken, theme} = useKitsTheme();\n const severityColors = useSeverityColors(type || 'secondary');\n const colors = type ? severityColors : null;\n const insets = useSafeAreaInsets();\n const isSheet = position === 'bottom';\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const borderColor = colors?.border ?? resolveToken('border');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n const resolvedFooterStyle = useResolvedStyle(footerStyle || {});\n const resolvedBodyStyle = useResolvedStyle(bodyStyle || {});\n\n const {width: screenWidth} = useWindowDimensions();\n // Consumer `breakpoints` ({'960px': '75vw'}) mirrors the web prop: the\n // smallest max-width threshold >= the screen width wins; vw/% both map\n // to a percentage of the window width. Falls back to the responsive\n // default (50% tablets/desktop, 95% phones <=641px).\n const breakpointWidth = (() => {\n if (!breakpoints) return null;\n const matches = Object.entries(breakpoints)\n .map(([k, v]) => [parseFloat(k), v] as const)\n .filter(([px]) => !Number.isNaN(px) && screenWidth <= px)\n .sort(([a], [b]) => a - b);\n const value = matches[0]?.[1];\n if (value == null) return null;\n const num = parseFloat(value);\n return Number.isNaN(num) ? null : `${num}%`;\n })();\n const responsiveWidth = breakpointWidth ?? (screenWidth > 641 ? '50%' : '95%');\n const hasExplicitWidth = (resolvedStyle as any).width != null;\n\n const hide = async () => {\n // canClose gate — intercepts every close path (backdrop Pressable,\n // built-in X Pressable, RN Modal onRequestClose). When blocked,\n // onClose is suppressed and the dialog stays open.\n if (canClose === false || (typeof canClose === 'function' && !canClose())) {\n return;\n }\n if (asyncClose && typeof onClose === \"function\") {\n await onClose();\n } else {\n onClose?.();\n }\n onHide();\n };\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!state.visible);\n if (!mounted) return null;\n\n const content = typeof children === \"function\" ? children(hide) : children;\n // Content-mode override (mirrors web): consumer node replaces the whole\n // header / body / footer template inside the panel.\n const contentMode = contentProp != null\n ? (typeof contentProp === \"function\" ? contentProp({hide}) : contentProp)\n : null;\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {state.visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(anim.scrim.exitDuration)}\n style={[isSheet ? styles.sheetOverlay : styles.overlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={dismissableMask ? hide : undefined}/>\n <Animated.View\n /* The sheet asks Reanimated to keep moving under iOS\n \"Reduce Motion\" — see `overlayAnimations.sheet`. Without\n it the panel appears in one frame and the only motion\n left is the scrim, which reads as a fade. The centred\n dialog keeps the system default. */\n entering={isSheet\n ? SlideInDown.springify().damping(anim.sheet.enter.damping).stiffness(anim.sheet.enter.stiffness).mass(anim.sheet.enter.mass ?? 1)\n .reduceMotion(anim.sheet.keepMotionWhenReduced ? ReduceMotion.Never : ReduceMotion.System)\n : ZoomIn.springify().damping(anim.dialog.enter.damping).stiffness(anim.dialog.enter.stiffness).mass(anim.dialog.enter.mass ?? 1)}\n exiting={(isSheet\n ? SlideOutDown.duration(anim.sheet.exitDuration).easing(Easing.in(Easing.ease))\n .reduceMotion(anim.sheet.keepMotionWhenReduced ? ReduceMotion.Never : ReduceMotion.System)\n : ZoomOut.duration(anim.dialog.exitDuration).easing(Easing.in(Easing.ease))\n ).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n isSheet && styles.sheetPanel,\n {backgroundColor: surfaceColor, borderColor},\n // Explicit `breakpoints` win even when responsive=false (web parity)\n !isSheet && !hasExplicitWidth && (breakpoints != null || responsive) ? {width: responsiveWidth} : null,\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {contentMode != null ? contentMode : <>\n {/* Grabber (bottom-sheet) */}\n {isSheet && <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>}\n\n {/* Severity accent strip */}\n {colors && !isSheet && (\n <View style={{height: 4, backgroundColor: colors.solid, borderTopLeftRadius: 20, borderTopRightRadius: 20}}/>\n )}\n\n {/* Custom header (headerRender) — fully replaces the built-in header\n View when provided. Wins over the default header even if `header`\n is also set. */}\n {!hideHeader && headerRender != null && headerRender({close: () => { void hide(); }})}\n\n {/* Header (default) — rendered when no headerRender and `header` is set. */}\n {!hideHeader && headerRender == null && rest.header != null && (\n <View style={[styles.header, {borderBottomColor: borderColor}, resolvedHeaderStyle as any]}>\n {/* Inline severity icon */}\n {(icon || brandLogo) && colors && (\n <View style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: colors.iconBg,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n }}>\n {brandLogo ? brandLogo : typeof icon === 'string' ? (\n <Icon name={icon as never} size={'lg'} color={colors.iconFg}/>\n ) : icon}\n </View>\n )}\n <Text style={{fontSize: 18, fontWeight: \"700\", color: textColor, flex: 1}}>\n {rest.header as React.ReactNode}\n </Text>\n <Pressable onPress={hide} hitSlop={8}>\n {closeIcon ?? <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>}\n </Pressable>\n </View>\n )}\n\n {/* Body — bodyStyle is applied AFTER the built-in maxHeight: 400,\n so consumers can lift the cap (`maxHeight: 600`) or unlock flex\n sizing (`minHeight: 0`) without losing the default behavior when\n bodyStyle is unset. */}\n <ScrollView\n style={[styles.body, resolvedBodyStyle as any]}\n contentContainerStyle={styles.bodyContent}\n showsVerticalScrollIndicator={false}\n >\n {content}\n </ScrollView>\n\n {/* Footer — footerRender takes precedence over `footer`. footerStyle\n is merged AFTER the built-in flex defaults so consumers can override\n alignment (e.g. justifyContent: 'space-between' for left-delete /\n right-actions layouts) without losing the borderTop / padding. */}\n {(footerRender != null || rest.footer != null) && (\n <View style={[\n styles.footer,\n {borderTopColor: borderColor},\n isSheet && {paddingBottom: 12 + insets.bottom},\n resolvedFooterStyle as any,\n ]}>\n {footerRender\n ? footerRender({close: () => { void hide(); }})\n : (rest.footer as React.ReactNode)}\n </View>\n )}\n </>}\n </Animated.View>\n </Animated.View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n sheetOverlay: {\n flex: 1,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n width: \"100%\",\n maxWidth: \"100%\",\n maxHeight: \"90%\",\n borderWidth: 0,\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n paddingTop: 10,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n panel: {\n // 20 == radii.xl (no numeric radii resolver on native — see report).\n borderRadius: 20,\n borderWidth: 1,\n minWidth: 250,\n maxWidth: \"90%\",\n maxHeight: \"80%\",\n overflow: \"hidden\",\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n header: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n paddingVertical: 16,\n borderBottomWidth: 1,\n },\n body: {\n maxHeight: 400,\n },\n bodyContent: {\n padding: 20,\n },\n footer: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n paddingHorizontal: 20,\n paddingVertical: 12,\n borderTopWidth: 1,\n gap: 8,\n },\n});\n"],"names":["anim"],"mappings":";;;;;;;;;;;;;AAqBA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,KAAA,CAAM,SAAS,OAAO,CAAA;AACpD,EAAA,MAAM,UAAA,GAAa,KAAA,CAAM,MAAA,CAAO,OAAO,CAAA;AACvC,EAAA,KAAA,CAAM,UAAU,MAAM;AAClB,IAAA,UAAA,CAAW,OAAA,GAAU,OAAA;AACrB,IAAA,IAAI,OAAA,aAAoB,IAAI,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,kBAAA,GAAqB,KAAA,CAAM,WAAA,CAAY,MAAM;AAC/C,IAAA,IAAI,CAAC,UAAA,CAAW,OAAA,EAAS,UAAA,CAAW,KAAK,CAAA;AAAA,EAC7C,CAAA,EAAG,EAAE,CAAA;AACL,EAAA,OAAO,EAAC,SAAS,kBAAA,EAAkB;AACvC;AAEA,SAAwB,oBAAA,CAAqB,EAAC,KAAA,EAAO,MAAA,EAAM,EAA0B;AACjF,EAAA,MAAM;AAAA,IACF,QAAA;AAAA,IACA,OAAA,EAAS,WAAA;AAAA,IACT,OAAA;AAAA,IACA,UAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA,GAAW,QAAA;AAAA,IACX,UAAA,GAAa,IAAA;AAAA,IACb,UAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,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AA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,UAAA,EAAY,QAAA;AAAA,IACZ,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB;AAAA,GACvB;AAAA,EACA,IAAA,EAAM;AAAA,IACF,SAAA,EAAW;AAAA,GACf;AAAA,EACA,WAAA,EAAa;AAAA,IACT,OAAA,EAAS;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,cAAA,EAAgB,UAAA;AAAA,IAChB,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,cAAA,EAAgB,CAAA;AAAA,IAChB,GAAA,EAAK;AAAA;AAEb,CAAC,CAAA;;;;"}
|
|
@@ -90,6 +90,7 @@ var locale = require('../../../hooks/locale.cjs');
|
|
|
90
90
|
require('../../../contexts/DialogContext.cjs');
|
|
91
91
|
var useComponentDefaults = require('../../../hooks/useComponentDefaults.cjs');
|
|
92
92
|
var useResolvedStyle = require('../../../hooks/useResolvedStyle.cjs');
|
|
93
|
+
var useThemedFont = require('../../../hooks/useThemedFont.cjs');
|
|
93
94
|
var SelectPopupOverlay_native = require('../helpers/SelectPopupOverlay.cjs');
|
|
94
95
|
var index_native = require('../../helpers/FormContainer/index.cjs');
|
|
95
96
|
require('axios');
|
|
@@ -126,6 +127,7 @@ const KitsDropdown = ({ className, ref, ...rawProps }) => {
|
|
|
126
127
|
} = props;
|
|
127
128
|
const { list, keys, onChange, selectedValue } = useSelectBase.useSelectBase();
|
|
128
129
|
const { t, isRTL } = locale.useLanguage();
|
|
130
|
+
const bodyFont = useThemedFont.default("body");
|
|
129
131
|
const ClState = Functions.ClHelper({
|
|
130
132
|
inputSize: inputSize ?? "",
|
|
131
133
|
isChecked: false,
|
|
@@ -139,6 +141,7 @@ const KitsDropdown = ({ className, ref, ...rawProps }) => {
|
|
|
139
141
|
emptyFilterMessage: emptyFilterMessage ?? t("emptyFilterMessage"),
|
|
140
142
|
filterPlaceholder: t("searchPlaceholder"),
|
|
141
143
|
isRTL,
|
|
144
|
+
fontFamily: bodyFont,
|
|
142
145
|
popup,
|
|
143
146
|
popupTitle: label ?? placeholder,
|
|
144
147
|
renderPopup: ({ visible, onClose, title, children }) => /* @__PURE__ */ jsxRuntime.jsx(SelectPopupOverlay_native.default, { visible, onClose, title, children }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/selects/Dropdown/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dropdown } from \"@lmb-it/kitsconcertomobile\";\nimport type { IDropdownSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { KitsContainer } from \"../../../_compat\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"../../../hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\n\nconst KitsDropdown = ({ className, ref, ...rawProps }: IDropdownSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('DropdownSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n rightAddon,\n leftAddon,\n errors,\n invalid,\n disabled,\n required,\n label,\n localProps,\n helperText,\n isFloatedLabel,\n withFilter,\n attached,\n inputSize,\n placeholder,\n hideError,\n virtualScroll,\n emptyFilterMessage,\n filterBy,\n loading,\n showClear,\n containerStyle,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue } = useSelectBase();\n\n /* The panel's own copy. The native Dropdown lives in `apps/mobile`, which\n this package imports, so it cannot reach LocaleContext itself without a\n cycle between the two workspaces — the sentence is resolved here, where\n `useLanguage()` already is, and passed down as a prop.\n\n ⛔ `isRTL` is the READER's language, never `I18nManager.isRTL`. A\n consumer that forces RTL at boot keeps that process direction after the\n reader switches to English, and the filter field must follow the reader. */\n const { t, isRTL } = useLanguage();\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const dropdownValue = selectedValue != null && typeof selectedValue !== 'object'\n ? selectedValue.toString()\n : selectedValue;\n\n const Element = (\n <Dropdown\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n popup={popup}\n popupTitle={label ?? placeholder}\n /* The container is this library's own Dialog. It is injected rather\n than imported by the native Dropdown because that component lives\n in `apps/mobile`, which this package imports — the reverse import\n would be a cycle between the two workspaces. */\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={dropdownValue}\n placeholder={placeholder}\n options={Array.isArray(list) ? list : []}\n disabled={disabled}\n loading={loading}\n showClear={showClear ?? (!required && selectedValue != null)}\n style={{ width: '100%', height: attached ? '100%' : undefined, borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n onChange={onChange}\n {...keys}\n invalid={hideError && !!invalid}\n filter={!!withFilter}\n filterBy={filterBy ?? 'label'}\n virtualScrollerOptions={virtualScroll}\n className={`w-full ${className ?? ''} ${ClState}`}\n {...(localProps ? localProps : {})}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsDropdown;\n"],"names":["useComponentDefaults","useResolvedStyle","useSelectBase","useLanguage","ClHelper","jsx","Dropdown","SelectPopupOverlay","KitsContainer"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/selects/Dropdown/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dropdown } from \"@lmb-it/kitsconcertomobile\";\nimport type { IDropdownSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { KitsContainer } from \"../../../_compat\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"../../../hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\nimport useThemedFont from \"../../../hooks/useThemedFont\";\n\nconst KitsDropdown = ({ className, ref, ...rawProps }: IDropdownSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('DropdownSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n rightAddon,\n leftAddon,\n errors,\n invalid,\n disabled,\n required,\n label,\n localProps,\n helperText,\n isFloatedLabel,\n withFilter,\n attached,\n inputSize,\n placeholder,\n hideError,\n virtualScroll,\n emptyFilterMessage,\n filterBy,\n loading,\n showClear,\n containerStyle,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue } = useSelectBase();\n\n /* The panel's own copy. The native Dropdown lives in `apps/mobile`, which\n this package imports, so it cannot reach LocaleContext itself without a\n cycle between the two workspaces — the sentence is resolved here, where\n `useLanguage()` already is, and passed down as a prop.\n\n ⛔ `isRTL` is the READER's language, never `I18nManager.isRTL`. A\n consumer that forces RTL at boot keeps that process direction after the\n reader switches to English, and the filter field must follow the reader. */\n const { t, isRTL } = useLanguage();\n /* The face the consuming app's theme names for body text. React Native does\n not cascade fontFamily through Views, so the panel has to be told. */\n const bodyFont = useThemedFont('body');\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const dropdownValue = selectedValue != null && typeof selectedValue !== 'object'\n ? selectedValue.toString()\n : selectedValue;\n\n const Element = (\n <Dropdown\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n fontFamily={bodyFont}\n popup={popup}\n popupTitle={label ?? placeholder}\n /* The container is this library's own Dialog. It is injected rather\n than imported by the native Dropdown because that component lives\n in `apps/mobile`, which this package imports — the reverse import\n would be a cycle between the two workspaces. */\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={dropdownValue}\n placeholder={placeholder}\n options={Array.isArray(list) ? list : []}\n disabled={disabled}\n loading={loading}\n showClear={showClear ?? (!required && selectedValue != null)}\n style={{ width: '100%', height: attached ? '100%' : undefined, borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n onChange={onChange}\n {...keys}\n invalid={hideError && !!invalid}\n filter={!!withFilter}\n filterBy={filterBy ?? 'label'}\n virtualScrollerOptions={virtualScroll}\n className={`w-full ${className ?? ''} ${ClState}`}\n {...(localProps ? localProps : {})}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsDropdown;\n"],"names":["useComponentDefaults","useResolvedStyle","useS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AAA,EAAQ,CAAC,CAAC,UAAA;AAAA,MACV,UAAU,QAAA,IAAY,OAAA;AAAA,MACtB,sBAAA,EAAwB,aAAA;AAAA,MACxB,SAAA,EAAW,CAAA,OAAA,EAAU,SAAA,IAAa,EAAE,IAAI,OAAO,CAAA,CAAA;AAAA,MAC9C,GAAI,UAAA,GAAa,UAAA,GAAa;AAAC;AAAA,GACpC;AAGJ,EAAA,IAAI,QAAA,EAAU;AACV,IAAA,OAAO,OAAA;AAAA,EACX;AAEA,EAAA,uBACIF,cAAA;AAAA,IAACG,oBAAA;AAAA,IAAA;AAAA,MACG,EAAA;AAAA,MACA,SAAA;AAAA,MACA,cAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA,cAAA;AAAA,MACA,aAAA;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACL;AAER;;;;"}
|
|
@@ -86,6 +86,7 @@ import { useLanguage } from '../../../hooks/locale.js';
|
|
|
86
86
|
import '../../../contexts/DialogContext.js';
|
|
87
87
|
import useComponentDefaults from '../../../hooks/useComponentDefaults.js';
|
|
88
88
|
import useResolvedStyle from '../../../hooks/useResolvedStyle.js';
|
|
89
|
+
import useThemedFont from '../../../hooks/useThemedFont.js';
|
|
89
90
|
import SelectPopupOverlay from '../helpers/SelectPopupOverlay.js';
|
|
90
91
|
import KitsContainer from '../../helpers/FormContainer/index.js';
|
|
91
92
|
import 'axios';
|
|
@@ -122,6 +123,7 @@ const KitsDropdown = ({ className, ref, ...rawProps }) => {
|
|
|
122
123
|
} = props;
|
|
123
124
|
const { list, keys, onChange, selectedValue } = useSelectBase();
|
|
124
125
|
const { t, isRTL } = useLanguage();
|
|
126
|
+
const bodyFont = useThemedFont("body");
|
|
125
127
|
const ClState = ClHelper({
|
|
126
128
|
inputSize: inputSize ?? "",
|
|
127
129
|
isChecked: false,
|
|
@@ -135,6 +137,7 @@ const KitsDropdown = ({ className, ref, ...rawProps }) => {
|
|
|
135
137
|
emptyFilterMessage: emptyFilterMessage ?? t("emptyFilterMessage"),
|
|
136
138
|
filterPlaceholder: t("searchPlaceholder"),
|
|
137
139
|
isRTL,
|
|
140
|
+
fontFamily: bodyFont,
|
|
138
141
|
popup,
|
|
139
142
|
popupTitle: label ?? placeholder,
|
|
140
143
|
renderPopup: ({ visible, onClose, title, children }) => /* @__PURE__ */ jsx(SelectPopupOverlay, { visible, onClose, title, children }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/form/selects/Dropdown/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dropdown } from \"@lmb-it/kitsconcertomobile\";\nimport type { IDropdownSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { KitsContainer } from \"../../../_compat\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"../../../hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\n\nconst KitsDropdown = ({ className, ref, ...rawProps }: IDropdownSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('DropdownSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n rightAddon,\n leftAddon,\n errors,\n invalid,\n disabled,\n required,\n label,\n localProps,\n helperText,\n isFloatedLabel,\n withFilter,\n attached,\n inputSize,\n placeholder,\n hideError,\n virtualScroll,\n emptyFilterMessage,\n filterBy,\n loading,\n showClear,\n containerStyle,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue } = useSelectBase();\n\n /* The panel's own copy. The native Dropdown lives in `apps/mobile`, which\n this package imports, so it cannot reach LocaleContext itself without a\n cycle between the two workspaces — the sentence is resolved here, where\n `useLanguage()` already is, and passed down as a prop.\n\n ⛔ `isRTL` is the READER's language, never `I18nManager.isRTL`. A\n consumer that forces RTL at boot keeps that process direction after the\n reader switches to English, and the filter field must follow the reader. */\n const { t, isRTL } = useLanguage();\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const dropdownValue = selectedValue != null && typeof selectedValue !== 'object'\n ? selectedValue.toString()\n : selectedValue;\n\n const Element = (\n <Dropdown\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n popup={popup}\n popupTitle={label ?? placeholder}\n /* The container is this library's own Dialog. It is injected rather\n than imported by the native Dropdown because that component lives\n in `apps/mobile`, which this package imports — the reverse import\n would be a cycle between the two workspaces. */\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={dropdownValue}\n placeholder={placeholder}\n options={Array.isArray(list) ? list : []}\n disabled={disabled}\n loading={loading}\n showClear={showClear ?? (!required && selectedValue != null)}\n style={{ width: '100%', height: attached ? '100%' : undefined, borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n onChange={onChange}\n {...keys}\n invalid={hideError && !!invalid}\n filter={!!withFilter}\n filterBy={filterBy ?? 'label'}\n virtualScrollerOptions={virtualScroll}\n className={`w-full ${className ?? ''} ${ClState}`}\n {...(localProps ? localProps : {})}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsDropdown;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/form/selects/Dropdown/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dropdown } from \"@lmb-it/kitsconcertomobile\";\nimport type { IDropdownSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { KitsContainer } from \"../../../_compat\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"../../../hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\nimport useThemedFont from \"../../../hooks/useThemedFont\";\n\nconst KitsDropdown = ({ className, ref, ...rawProps }: IDropdownSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('DropdownSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n rightAddon,\n leftAddon,\n errors,\n invalid,\n disabled,\n required,\n label,\n localProps,\n helperText,\n isFloatedLabel,\n withFilter,\n attached,\n inputSize,\n placeholder,\n hideError,\n virtualScroll,\n emptyFilterMessage,\n filterBy,\n loading,\n showClear,\n containerStyle,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue } = useSelectBase();\n\n /* The panel's own copy. The native Dropdown lives in `apps/mobile`, which\n this package imports, so it cannot reach LocaleContext itself without a\n cycle between the two workspaces — the sentence is resolved here, where\n `useLanguage()` already is, and passed down as a prop.\n\n ⛔ `isRTL` is the READER's language, never `I18nManager.isRTL`. A\n consumer that forces RTL at boot keeps that process direction after the\n reader switches to English, and the filter field must follow the reader. */\n const { t, isRTL } = useLanguage();\n /* The face the consuming app's theme names for body text. React Native does\n not cascade fontFamily through Views, so the panel has to be told. */\n const bodyFont = useThemedFont('body');\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const dropdownValue = selectedValue != null && typeof selectedValue !== 'object'\n ? selectedValue.toString()\n : selectedValue;\n\n const Element = (\n <Dropdown\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n fontFamily={bodyFont}\n popup={popup}\n popupTitle={label ?? placeholder}\n /* The container is this library's own Dialog. It is injected rather\n than imported by the native Dropdown because that component lives\n in `apps/mobile`, which this package imports — the reverse import\n would be a cycle between the two workspaces. */\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={dropdownValue}\n placeholder={placeholder}\n options={Array.isArray(list) ? list : []}\n disabled={disabled}\n loading={loading}\n showClear={showClear ?? (!required && selectedValue != null)}\n style={{ width: '100%', height: attached ? '100%' : undefined, borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n onChange={onChange}\n {...keys}\n invalid={hideError && !!invalid}\n filter={!!withFilter}\n filterBy={filterBy ?? 'label'}\n virtualScrollerOptions={virtualScroll}\n className={`w-full ${className ?? ''} ${ClState}`}\n {...(localProps ? localProps : {})}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsDropdown;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;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