@lmb-it/kitsconcerto-native 0.1.262 → 0.1.264

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../../../apps/mobile/src/Core/Dropdown/index.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useRef, useState, type ChangeEvent } from \"react\";\nimport {\n Dimensions,\n FlatList,\n Keyboard,\n Modal,\n Pressable,\n ScrollView,\n TouchableOpacity,\n View,\n StyleSheet, Text, TextInput\n} from \"react-native\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\nimport { Input, InputField, type VirtualScrollerOptions } from \"../../\";\nimport { resolveThemeTokenForNative, toNativeValue } from '../../Factory/helpers/style';\nimport { useKeyboardHeight } from '../../Factory/helpers/useKeyboardHeight';\nimport { computePanelGeometry } from './panelGeometry';\n\n/* ---------------------------------------------\n Types (PrimeReact-compatible)\n---------------------------------------------- */\n\nexport interface DropdownChangeEvent<T = any> {\n originalEvent?: any;\n value: T | null;\n}\n\n\nexport interface DropdownProps<T = any> {\n value?: T | null;\n options?: T[];\n\n onChange?: (e: ChangeEvent<T>, item:any) => void;\n\n optionLabel?: string;\n optionValue?: string;\n\n placeholder?: string;\n disabled?: boolean;\n editable?: boolean;\n loading?: boolean;\n showClear?: boolean;\n isModal?: boolean;\n\n checkmark?: boolean;\n highlightOnSelect?: boolean;\n\n filter?: boolean;\n filterBy?: string;\n emptyFilterMessage?: string;\n /**\n * Placeholder for the panel's filter field.\n *\n * ⛔ THIS COMPONENT CANNOT TRANSLATE. It lives in `apps/mobile`, which\n * `packages/ui` imports — the reverse import would be a cycle between the two\n * workspaces. So the sentence is resolved by the KitsConcerto wrapper, which\n * has `useLanguage()`, and arrives here already written, exactly as\n * `emptyFilterMessage` does.\n */\n filterPlaceholder?: string;\n /**\n * Open the options in a popup that owns the screen instead of a panel\n * anchored to the trigger.\n *\n * ⛔ THE ANCHOR IS THE PROBLEM THIS ESCAPES. An anchored panel can never be\n * taller than the gap between the trigger and the keyboard, and a field in\n * the middle of a form has ~190pt of gap on a 874pt phone — a search box and\n * four rows. Sizing that gap correctly does not make it big. The popup takes\n * a fixed share of the window instead, so where the field sits stops\n * mattering.\n *\n * Default false: every existing consumer keeps the anchored panel.\n */\n popup?: boolean;\n /**\n * Supplies the popup's container. Injected by the KitsConcerto wrapper\n * because the container is this library's `KitsDialogControlled`, which\n * lives in `packages/ui` — and `packages/ui` imports THIS file, so importing\n * it back would be a cycle between the two workspaces.\n *\n * Without it `popup` falls back to the anchored panel rather than rendering\n * nothing.\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. The wrapper passes the field's label. */\n popupTitle?: React.ReactNode;\n /**\n * Which way the reader reads, from the wrapper's `useLanguage().isRTL`.\n *\n * ⛔ NOT `I18nManager.isRTL`. That is the PROCESS layout direction, which a\n * consumer can force at boot and which does not change when the reader\n * switches language. The filter field follows the interface language, like\n * every other input in this library.\n */\n isRTL?: boolean;\n /**\n * Font family the consuming app's theme names for body text, resolved by the\n * KitsConcerto wrapper with `useThemedFont('body')`.\n *\n * ⛔ React Native does NOT cascade `fontFamily` through View parents, so\n * every text sink has to set it. The panel's rows and its search field set\n * none, which is why an app that swaps in its own face — AlphaMatch loads\n * Noto Kufi Arabic for its Arabic readers — saw that face everywhere except\n * inside the picker.\n */\n fontFamily?: string;\n\n itemTemplate?: (item: T) => React.ReactNode;\n valueTemplate?: (value: T | null) => React.ReactNode;\n panelFooterTemplate?: () => React.ReactNode;\n\n optionGroupLabel?: string;\n optionGroupChildren?: string;\n optionGroupTemplate?: (group: any) => React.ReactNode;\n\n virtualScrollerOptions?: VirtualScrollerOptions;\n\n invalid?: boolean;\n testID?: string;\n style?: import('react-native').ViewStyle;\n}\n\n/* ---------------------------------------------\n Helpers\n---------------------------------------------- */\n\nconst getLabel = (item: any, optionLabel?: string) => {\n if (!item) return \"\";\n if (!optionLabel) return String(item);\n return String(item[optionLabel]);\n};\n\nconst getValue = (item: any, optionValue?: string) => {\n if (!item) return null;\n if (!optionValue) return item;\n return item[optionValue];\n};\n\nconst t = resolveThemeTokenForNative;\n\n/**\n * Option-row text size, taken from the theme's own scale rather than picked.\n *\n * The rows used to set no `fontSize` at all, so they fell through to React\n * Native's default of 14 — which happens to equal the scale's `sm` step, by\n * coincidence rather than intent. `md` is the scale's body size and one step\n * up. `$fontSizes.md` resolves to '1rem' and `toNativeValue` turns that into\n * 16; the `?? 16` is the same number spelled out, for the case where a\n * consumer's theme does not declare the step.\n */\nconst optionFontSize = (): number => {\n const resolved = toNativeValue(resolveThemeTokenForNative('$fontSizes.md'));\n return typeof resolved === 'number' ? resolved : 16;\n};\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\n/* ---------------------------------------------\n Component\n---------------------------------------------- */\n\nexport default function Dropdown<T = any>({\n value,\n options = [],\n onChange,\n\n optionLabel,\n optionValue,\n\n placeholder,\n disabled,\n editable,\n isModal = false,\n\n checkmark,\n highlightOnSelect = true,\n\n filter,\n filterBy,\n // ⚠️ THESE TWO ENGLISH LITERALS ARE A LAST RESORT, NOT A\n // TRANSLATION. The KitsConcerto wrapper always passes the\n // reader's own sentence; these only apply when this component\n // is used directly from `apps/mobile`, and they exist so a\n // panel can never render a blank search box or an empty\n // \"no results\" line. Recorded as English fallbacks.\n emptyFilterMessage = 'No results found',\n filterPlaceholder = 'Search...',\n isRTL = false,\n fontFamily,\n popup = false,\n renderPopup,\n popupTitle,\n\n itemTemplate,\n valueTemplate,\n panelFooterTemplate,\n\n optionGroupLabel,\n optionGroupChildren,\n optionGroupTemplate,\n\n virtualScrollerOptions,\n\n invalid,\n testID,\n style: externalStyle,\n }: DropdownProps<T>) {\n const inputRef = useRef<any>(null);\n const triggerRef = useRef<View>(null);\n const [open, setOpen] = useState(false);\n const [inputText, setInputText] = useState(\"\");\n const [filterQuery, setFilterQuery] = useState(\"\");\n const [triggerLayout, setTriggerLayout] = useState<{\n x: number; y: number; width: number; height: number;\n } | null>(null);\n const insets = useSafeAreaInsets();\n const keyboardHeight = useKeyboardHeight();\n\n const { viewStyle: externalViewStyle, textStyle: externalTextStyle } = splitStyle(externalStyle);\n\n const colors = {\n border: t('border') || t('gray.300'),\n borderInvalid: t('danger') || t('red.500'),\n bg: t('surface-card') || '#fff',\n text: t('text') || t('gray.800'),\n placeholder: t('text-secondary') || t('gray.400'),\n optionSelected: t('highlight-bg') || t('gray.100'),\n groupBg: t('surface-ground') || t('gray.50'),\n filterBorder: t('border') || t('gray.200'),\n filterBg: t('surface-ground') || t('gray.50'),\n filterText: t('text') || t('gray.800'),\n emptyText: t('text-secondary') || t('gray.400'),\n primary: t('primary'),\n };\n\n /* ---------------------------------------------\n Derived\n ---------------------------------------------- */\n\n const selectedItem = useMemo(() => {\n if (value == null) return null;\n // Search through group children when grouped\n if (optionGroupChildren) {\n for (const group of options as any[]) {\n const children = group[optionGroupChildren];\n if (Array.isArray(children)) {\n const found = children.find((c: any) => getValue(c, optionValue) === value);\n if (found) return found;\n }\n }\n return null;\n }\n return options.find(\n (o) => getValue(o, optionValue) === value\n ) ?? null;\n }, [value, options, optionValue, optionGroupChildren]);\n\n /* ---------------------------------------------\n Open / Close\n ---------------------------------------------- */\n\n const toggle = () => {\n if (disabled) return;\n Keyboard.dismiss();\n if (open) {\n setOpen(false);\n return;\n }\n setFilterQuery(\"\");\n // Measure trigger position in window so the popover can be rendered\n // inside a Modal (escaping any parent ScrollView) at the correct anchor.\n triggerRef.current?.measureInWindow((x, y, width, height) => {\n setTriggerLayout({ x, y, width, height });\n setOpen(true);\n });\n };\n\n const close = () => setOpen(false);\n\n /* ---------------------------------------------\n Selection\n ---------------------------------------------- */\n\n const selectItem = (item: T) => {\n const newValue = getValue(item, optionValue);\n\n if (!onChange) return;\n\n const syntheticEvent = {\n target: {\n value: newValue,\n },\n } as React.ChangeEvent<any>;\n\n onChange(syntheticEvent, item);\n\n setOpen(false);\n };\n\n /* ---------------------------------------------\n Render item\n ---------------------------------------------- */\n\n const renderItem = useCallback(\n (item: any, index: number) => {\n if (!item) {\n return null;\n }\n\n // Group header\n if (item.__group) {\n return (\n <Text key={`group-${index}`} style={[styles.groupLabel, { backgroundColor: colors.groupBg }]}>\n {optionGroupLabel ? item.group?.[optionGroupLabel] : \"\"}\n </Text>\n );\n }\n\n const selected =\n value != null &&\n getValue(item, optionValue) === value;\n\n let content: React.ReactElement;\n\n if (itemTemplate) {\n const rendered = itemTemplate(item);\n\n content = React.isValidElement(rendered) ? (\n rendered\n ) : (\n <Text>{String(rendered ?? \"\")}</Text>\n );\n } else {\n content = (\n <Text style={[\n {\n color: colors.text,\n fontSize: optionFontSize(),\n fontFamily,\n },\n /* The row starts at the reader's edge. A label that opens with a\n flag — \"🇦🇺 +61 (AU)\" — then puts the flag where an Arabic reader\n starts reading, which is the right. Left unset the row inherited,\n and the flag sat on the far side of the row from the reader. */\n isRTL ? styles.optionRtl : styles.optionLtr,\n ]}>\n {getLabel(item, optionLabel)}\n </Text>\n );\n }\n\n return (\n <Pressable\n key={`item-${index}`}\n onPress={() => selectItem(item)}\n style={[\n styles.option,\n /* ⛔ `textAlign` ALONE CANNOT MOVE THIS ROW. The row is a flex row\n and the label shrink-wraps, so the line box is only as wide as\n its glyphs and aligning text inside it changes nothing — the box\n itself still sits at the row's start. The process layout stays\n LTR (the reader's language is a KitsConcerto concern, not\n `I18nManager`), so `flex-start` is the left. Reversing the row is\n what actually moves the label, and the checkmark, to the edge an\n Arabic reader starts from. */\n isRTL && styles.optionRowRtl,\n selected && highlightOnSelect && { backgroundColor: colors.optionSelected },\n ]}\n >\n {content}\n {checkmark && selected && <Text>✓</Text>}\n </Pressable>\n );\n },\n [\n value,\n optionValue,\n optionLabel,\n itemTemplate,\n optionGroupLabel,\n checkmark,\n highlightOnSelect,\n ]\n );\n\n\n /* ---------------------------------------------\n Group flattening\n ---------------------------------------------- */\n\n const flatData = useMemo(() => {\n if (!optionGroupLabel || !optionGroupChildren) {\n return options;\n }\n\n const out: any[] = [];\n options.forEach((g: any) => {\n out.push({ __group: true, group: g });\n g[optionGroupChildren]?.forEach((c: any) => out.push(c));\n });\n return out;\n }, [options]);\n\n /* ---------------------------------------------\n Filter\n ---------------------------------------------- */\n\n const filteredData = useMemo(() => {\n if (!filter || !filterQuery) return flatData;\n const q = filterQuery.toLowerCase();\n const key = filterBy || optionLabel;\n\n return flatData.filter((entry: any) => {\n // Keep group headers\n if (entry.__group) return true;\n const label = getLabel(entry, key);\n return label.toLowerCase().includes(q);\n });\n }, [flatData, filter, filterQuery, filterBy, optionLabel]);\n\n /* ---------------------------------------------\n Display value\n ---------------------------------------------- */\n\n const displayValue = valueTemplate\n ? valueTemplate(selectedItem)\n : selectedItem\n ? getLabel(selectedItem, optionLabel)\n : \"\";\n\n /* ---------------------------------------------\n Panel body — the search field and the list\n ---------------------------------------------- */\n\n /*\n * ⛔ ONE BODY, THREE CONTAINERS. The anchored panel and the centred modal\n * each carried their own copy of this markup, which is why the hardcoded\n * \"Search...\" had to be found and fixed twice. The popup would have made it\n * three. The containers differ; what is inside them does not.\n *\n * `fill` is the one real difference. In the anchored panel the container has\n * a `maxHeight` and no height, so the list must shrink-wrap its content up\n * to that ceiling (`flexShrink`). In the popup and the centred modal the\n * container has a real height, so the list takes what is left (`flex: 1`).\n */\n const panelBody = (fill: boolean, autoFocusFilter: boolean) => (\n <>\n {filter && (\n <View style={[styles.filterContainer, { borderBottomColor: colors.filterBorder }]}>\n <TextInput\n value={filterQuery}\n onChangeText={setFilterQuery}\n placeholder={filterPlaceholder}\n placeholderTextColor={colors.placeholder}\n style={[styles.filterInput, {\n borderColor: colors.filterBorder,\n backgroundColor: colors.filterBg,\n color: colors.filterText,\n fontFamily,\n },\n // Every other input in this library names its own edge and\n // direction from the reader's language. Leaving these unset let the\n // platform decide, so the field followed the process layout\n // direction instead of the person reading it.\n isRTL ? styles.filterRtl : styles.filterLtr]}\n /* ⛔ THE ANCHORED PANEL KEEPS ITS AUTOFOCUS — changing it would\n change behaviour for every consumer that has not opted in. In\n the popup the list is already the whole point and is fully\n visible, so the keyboard waits to be asked for: one tap on the\n field raises it, and until then the list has the whole sheet. */\n autoFocus={autoFocusFilter}\n />\n </View>\n )}\n <FlatList\n style={fill ? styles.listFill : styles.listShrink}\n contentContainerStyle={styles.listContent}\n data={filteredData}\n keyExtractor={(item: any, i: number) =>\n item?.__group ? `group-${i}` : `item-${i}`\n }\n renderItem={({ item, index }) => renderItem(item, index)}\n keyboardShouldPersistTaps=\"handled\"\n showsHorizontalScrollIndicator={false}\n ListEmptyComponent={\n filterQuery ? (\n <View style={styles.emptyContainer}>\n <Text style={[styles.emptyText, { color: colors.emptyText, fontFamily }]}>{emptyFilterMessage}</Text>\n </View>\n ) : null\n }\n />\n {panelFooterTemplate?.()}\n </>\n );\n\n /* ---------------------------------------------\n Render\n ---------------------------------------------- */\n\n const usePopup = popup && typeof renderPopup === 'function';\n\n return (\n <View style={styles.container} testID={testID}>\n <Pressable\n ref={triggerRef as any}\n style={[\n styles.control,\n { borderColor: colors.border, backgroundColor: colors.bg },\n invalid && { borderColor: colors.borderInvalid },\n disabled && styles.disabled,\n externalViewStyle,\n ]}\n onPress={toggle}\n >\n {editable ? (\n <Input style={styles.input}>\n <InputField\n ref={inputRef}\n value={inputText}\n onChangeText={setInputText}\n placeholder={placeholder}\n editable={!disabled}\n />\n </Input>\n ) : (\n <Text\n numberOfLines={1}\n style={[\n // Fill the trigger row and left-align the value/placeholder so it\n // doesn't read as centred (the row is justify=space-between, so the\n // arrow stays pinned right).\n { flex: 1, textAlign: \"left\" as const },\n displayValue ? { color: colors.text } : { color: colors.placeholder },\n externalTextStyle,\n !displayValue && { color: colors.placeholder },\n ]}>\n {displayValue || placeholder}\n </Text>\n )}\n\n <Text style={[{ color: colors.text }, externalTextStyle]}>▾</Text>\n </Pressable>\n\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 { top, maxHeight } = computePanelGeometry({\n screenHeight: screen.height,\n insetTop: insets.top,\n insetBottom: insets.bottom,\n keyboardHeight,\n triggerY: triggerLayout.y,\n triggerHeight: triggerLayout.height,\n });\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 {panelBody(false, true)}\n </View>\n );\n })()}\n </Pressable>\n </Modal>\n )}\n\n {!usePopup && isModal && (\n <Modal visible={open} transparent animationType=\"fade\">\n <Pressable style={styles.modalOverlay} onPress={close}>\n <View\n style={[styles.modalPanel, { backgroundColor: colors.bg }]}\n onStartShouldSetResponder={() => true}\n >\n {panelBody(true, true)}\n </View>\n </Pressable>\n </Modal>\n )}\n\n {/* Popup — the container comes from the wrapper (this library's own\n Dialog in sheet position); everything inside it is the same body the\n other two containers render. */}\n {usePopup && renderPopup!({\n visible: open,\n onClose: close,\n title: popupTitle,\n children: panelBody(true, false),\n })}\n\n </View>\n );\n}\n\n/* ---------------------------------------------\n Styles (layout only — colors applied inline via theme tokens)\n---------------------------------------------- */\n\nconst styles = StyleSheet.create({\n container: {\n width: \"100%\",\n position: \"relative\" as const,\n },\n control: {\n flexDirection: \"row\" as const,\n alignItems: \"center\" as const,\n justifyContent: \"space-between\" as const,\n borderWidth: 1,\n borderRadius: 6,\n paddingHorizontal: 10,\n paddingVertical: 10,\n },\n disabled: {\n opacity: 0.5,\n },\n option: {\n paddingHorizontal: 12,\n paddingVertical: 10,\n flexDirection: \"row\" as const,\n justifyContent: \"space-between\" as const,\n alignItems: \"center\" as const,\n },\n groupLabel: {\n paddingHorizontal: 12,\n paddingVertical: 8,\n fontWeight: \"600\" as const,\n },\n input: {\n flex: 1,\n },\n panel: {\n position: \"absolute\" as const,\n top: \"100%\",\n left: 0,\n right: 0,\n marginTop: 4,\n borderWidth: 1,\n borderRadius: 6,\n maxHeight: 260,\n overflow: \"hidden\" as const,\n zIndex: 9999,\n },\n filterContainer: {\n paddingHorizontal: 8,\n paddingVertical: 6,\n borderBottomWidth: 1,\n },\n optionLtr: {\n // `flex: 1` makes the line box span the row, so `textAlign` has something\n // to align within. Without it the box hugs the glyphs and alignment is a\n // no-op.\n flex: 1,\n textAlign: 'left' as const,\n writingDirection: 'ltr' as const,\n },\n optionRowRtl: {\n flexDirection: 'row-reverse' as const,\n },\n optionRtl: {\n flex: 1,\n textAlign: 'right' as const,\n writingDirection: 'rtl' as const,\n },\n listFill: {\n flex: 1,\n },\n // The anchored panel is sized by `maxHeight` with no height, so the list has\n // to grow with its content up to that ceiling and then scroll inside it.\n // `flex: 1` sets flexBasis 0, which contributes nothing to a shrink-wrapping\n // parent.\n listShrink: {\n flexGrow: 0,\n flexShrink: 1,\n },\n listContent: {\n paddingBottom: 12,\n },\n filterInput: {\n fontSize: 14,\n paddingHorizontal: 8,\n paddingVertical: 6,\n borderWidth: 1,\n borderRadius: 4,\n },\n filterLtr: {\n textAlign: 'left' as const,\n writingDirection: 'ltr' as const,\n },\n filterRtl: {\n textAlign: 'right' as const,\n writingDirection: 'rtl' as const,\n },\n emptyContainer: {\n padding: 16,\n alignItems: 'center' as const,\n },\n emptyText: {\n fontSize: 14,\n },\n popoverOverlay: {\n flex: 1,\n backgroundColor: 'transparent',\n },\n popoverPanel: {\n position: 'absolute' as const,\n borderWidth: 1,\n borderRadius: 6,\n overflow: 'hidden' as const,\n elevation: 8,\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.15,\n shadowRadius: 8,\n },\n modalOverlay: {\n flex: 1,\n backgroundColor: 'rgba(0,0,0,0.4)',\n justifyContent: 'center' as const,\n },\n modalPanel: {\n margin: 24,\n maxHeight: '70%',\n borderRadius: 12,\n overflow: 'hidden' as const,\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmIA,MAAM,QAAA,GAAW,CAAC,IAAA,EAAW,WAAA,KAAyB;AACpD,EAAA,IAAI,CAAC,MAAM,OAAO,EAAA;AAClB,EAAA,IAAI,CAAC,WAAA,EAAa,OAAO,MAAA,CAAO,IAAI,CAAA;AACpC,EAAA,OAAO,MAAA,CAAO,IAAA,CAAK,WAAW,CAAC,CAAA;AACjC,CAAA;AAEA,MAAM,QAAA,GAAW,CAAC,IAAA,EAAW,WAAA,KAAyB;AACpD,EAAA,IAAI,CAAC,MAAM,OAAO,IAAA;AAClB,EAAA,IAAI,CAAC,aAAa,OAAO,IAAA;AACzB,EAAA,OAAO,KAAK,WAAW,CAAA;AACzB,CAAA;AAEA,MAAM,CAAA,GAAI,0BAAA;AAYV,MAAM,iBAAiB,MAAc;AACnC,EAAA,MAAM,QAAA,GAAW,aAAA,CAAc,0BAAA,CAA2B,eAAe,CAAC,CAAA;AAC1E,EAAA,OAAO,OAAO,QAAA,KAAa,QAAA,GAAW,QAAA,GAAW,EAAA;AACnD,CAAA;AAEA,MAAM,eAAA,uBAAsB,GAAA,CAAI;AAAA,EAC9B,UAAA;AAAA,EAAY,YAAA;AAAA,EAAc,YAAA;AAAA,EA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AA,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,GAChB;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,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;AAEd,CAAC,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../../apps/mobile/src/Core/Dropdown/index.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useRef, useState, type ChangeEvent } from \"react\";\nimport {\n Dimensions,\n FlatList,\n Keyboard,\n Modal,\n Pressable,\n ScrollView,\n TouchableOpacity,\n View,\n StyleSheet, Text, TextInput\n} from \"react-native\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\nimport { Input, InputField, type VirtualScrollerOptions } from \"../../\";\nimport { resolveThemeTokenForNative, toNativeValue } from '../../Factory/helpers/style';\nimport { useKeyboardHeight } from '../../Factory/helpers/useKeyboardHeight';\nimport { readerEdge } from '../../Factory/helpers/readerEdge';\nimport { computePanelGeometry } from './panelGeometry';\n\n/* ---------------------------------------------\n Types (PrimeReact-compatible)\n---------------------------------------------- */\n\nexport interface DropdownChangeEvent<T = any> {\n originalEvent?: any;\n value: T | null;\n}\n\n\nexport interface DropdownProps<T = any> {\n value?: T | null;\n options?: T[];\n\n onChange?: (e: ChangeEvent<T>, item:any) => void;\n\n optionLabel?: string;\n optionValue?: string;\n\n placeholder?: string;\n disabled?: boolean;\n editable?: boolean;\n loading?: boolean;\n showClear?: boolean;\n isModal?: boolean;\n\n checkmark?: boolean;\n highlightOnSelect?: boolean;\n\n filter?: boolean;\n filterBy?: string;\n emptyFilterMessage?: string;\n /**\n * Placeholder for the panel's filter field.\n *\n * ⛔ THIS COMPONENT CANNOT TRANSLATE. It lives in `apps/mobile`, which\n * `packages/ui` imports — the reverse import would be a cycle between the two\n * workspaces. So the sentence is resolved by the KitsConcerto wrapper, which\n * has `useLanguage()`, and arrives here already written, exactly as\n * `emptyFilterMessage` does.\n */\n filterPlaceholder?: string;\n /**\n * Open the options in a popup that owns the screen instead of a panel\n * anchored to the trigger.\n *\n * ⛔ THE ANCHOR IS THE PROBLEM THIS ESCAPES. An anchored panel can never be\n * taller than the gap between the trigger and the keyboard, and a field in\n * the middle of a form has ~190pt of gap on a 874pt phone — a search box and\n * four rows. Sizing that gap correctly does not make it big. The popup takes\n * a fixed share of the window instead, so where the field sits stops\n * mattering.\n *\n * Default false: every existing consumer keeps the anchored panel.\n */\n popup?: boolean;\n /**\n * Supplies the popup's container. Injected by the KitsConcerto wrapper\n * because the container is this library's `KitsDialogControlled`, which\n * lives in `packages/ui` — and `packages/ui` imports THIS file, so importing\n * it back would be a cycle between the two workspaces.\n *\n * Without it `popup` falls back to the anchored panel rather than rendering\n * nothing.\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. The wrapper passes the field's label. */\n popupTitle?: React.ReactNode;\n /**\n * Which way the reader reads, from the wrapper's `useLanguage().isRTL`.\n *\n * ⛔ NOT `I18nManager.isRTL`. That is the PROCESS layout direction, which a\n * consumer can force at boot and which does not change when the reader\n * switches language. The filter field follows the interface language, like\n * every other input in this library.\n */\n isRTL?: boolean;\n /**\n * Font family the consuming app's theme names for body text, resolved by the\n * KitsConcerto wrapper with `useThemedFont('body')`.\n *\n * ⛔ React Native does NOT cascade `fontFamily` through View parents, so\n * every text sink has to set it. The panel's rows and its search field set\n * none, which is why an app that swaps in its own face — AlphaMatch loads\n * Noto Kufi Arabic for its Arabic readers — saw that face everywhere except\n * inside the picker.\n */\n fontFamily?: string;\n\n itemTemplate?: (item: T) => React.ReactNode;\n valueTemplate?: (value: T | null) => React.ReactNode;\n panelFooterTemplate?: () => React.ReactNode;\n\n optionGroupLabel?: string;\n optionGroupChildren?: string;\n optionGroupTemplate?: (group: any) => React.ReactNode;\n\n virtualScrollerOptions?: VirtualScrollerOptions;\n\n invalid?: boolean;\n testID?: string;\n style?: import('react-native').ViewStyle;\n}\n\n/* ---------------------------------------------\n Helpers\n---------------------------------------------- */\n\nconst getLabel = (item: any, optionLabel?: string) => {\n if (!item) return \"\";\n if (!optionLabel) return String(item);\n return String(item[optionLabel]);\n};\n\nconst getValue = (item: any, optionValue?: string) => {\n if (!item) return null;\n if (!optionValue) return item;\n return item[optionValue];\n};\n\nconst t = resolveThemeTokenForNative;\n\n/**\n * Option-row text size, taken from the theme's own scale rather than picked.\n *\n * The rows used to set no `fontSize` at all, so they fell through to React\n * Native's default of 14 — which happens to equal the scale's `sm` step, by\n * coincidence rather than intent. `md` is the scale's body size and one step\n * up. `$fontSizes.md` resolves to '1rem' and `toNativeValue` turns that into\n * 16; the `?? 16` is the same number spelled out, for the case where a\n * consumer's theme does not declare the step.\n */\nconst optionFontSize = (): number => {\n const resolved = toNativeValue(resolveThemeTokenForNative('$fontSizes.md'));\n return typeof resolved === 'number' ? resolved : 16;\n};\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\n/* ---------------------------------------------\n Component\n---------------------------------------------- */\n\nexport default function Dropdown<T = any>({\n value,\n options = [],\n onChange,\n\n optionLabel,\n optionValue,\n\n placeholder,\n disabled,\n editable,\n isModal = false,\n\n checkmark,\n highlightOnSelect = true,\n\n filter,\n filterBy,\n // ⚠️ THESE TWO ENGLISH LITERALS ARE A LAST RESORT, NOT A\n // TRANSLATION. The KitsConcerto wrapper always passes the\n // reader's own sentence; these only apply when this component\n // is used directly from `apps/mobile`, and they exist so a\n // panel can never render a blank search box or an empty\n // \"no results\" line. Recorded as English fallbacks.\n emptyFilterMessage = 'No results found',\n filterPlaceholder = 'Search...',\n isRTL = false,\n fontFamily,\n popup = false,\n renderPopup,\n popupTitle,\n\n itemTemplate,\n valueTemplate,\n panelFooterTemplate,\n\n optionGroupLabel,\n optionGroupChildren,\n optionGroupTemplate,\n\n virtualScrollerOptions,\n\n invalid,\n testID,\n style: externalStyle,\n }: DropdownProps<T>) {\n const inputRef = useRef<any>(null);\n const triggerRef = useRef<View>(null);\n const [open, setOpen] = useState(false);\n const [inputText, setInputText] = useState(\"\");\n const [filterQuery, setFilterQuery] = useState(\"\");\n const [triggerLayout, setTriggerLayout] = useState<{\n x: number; y: number; width: number; height: number;\n } | null>(null);\n const insets = useSafeAreaInsets();\n const keyboardHeight = useKeyboardHeight();\n /* Physical edges to write so the content lands where the reader starts. */\n const edge = readerEdge(isRTL);\n\n const { viewStyle: externalViewStyle, textStyle: externalTextStyle } = splitStyle(externalStyle);\n\n const colors = {\n border: t('border') || t('gray.300'),\n borderInvalid: t('danger') || t('red.500'),\n bg: t('surface-card') || '#fff',\n text: t('text') || t('gray.800'),\n placeholder: t('text-secondary') || t('gray.400'),\n optionSelected: t('highlight-bg') || t('gray.100'),\n groupBg: t('surface-ground') || t('gray.50'),\n filterBorder: t('border') || t('gray.200'),\n filterBg: t('surface-ground') || t('gray.50'),\n filterText: t('text') || t('gray.800'),\n emptyText: t('text-secondary') || t('gray.400'),\n primary: t('primary'),\n };\n\n /* ---------------------------------------------\n Derived\n ---------------------------------------------- */\n\n const selectedItem = useMemo(() => {\n if (value == null) return null;\n // Search through group children when grouped\n if (optionGroupChildren) {\n for (const group of options as any[]) {\n const children = group[optionGroupChildren];\n if (Array.isArray(children)) {\n const found = children.find((c: any) => getValue(c, optionValue) === value);\n if (found) return found;\n }\n }\n return null;\n }\n return options.find(\n (o) => getValue(o, optionValue) === value\n ) ?? null;\n }, [value, options, optionValue, optionGroupChildren]);\n\n /* ---------------------------------------------\n Open / Close\n ---------------------------------------------- */\n\n const toggle = () => {\n if (disabled) return;\n Keyboard.dismiss();\n if (open) {\n setOpen(false);\n return;\n }\n setFilterQuery(\"\");\n // Measure trigger position in window so the popover can be rendered\n // inside a Modal (escaping any parent ScrollView) at the correct anchor.\n triggerRef.current?.measureInWindow((x, y, width, height) => {\n setTriggerLayout({ x, y, width, height });\n setOpen(true);\n });\n };\n\n const close = () => setOpen(false);\n\n /* ---------------------------------------------\n Selection\n ---------------------------------------------- */\n\n const selectItem = (item: T) => {\n const newValue = getValue(item, optionValue);\n\n if (!onChange) return;\n\n const syntheticEvent = {\n target: {\n value: newValue,\n },\n } as React.ChangeEvent<any>;\n\n onChange(syntheticEvent, item);\n\n setOpen(false);\n };\n\n /* ---------------------------------------------\n Render item\n ---------------------------------------------- */\n\n const renderItem = useCallback(\n (item: any, index: number) => {\n if (!item) {\n return null;\n }\n\n // Group header\n if (item.__group) {\n return (\n <Text key={`group-${index}`} style={[styles.groupLabel, { backgroundColor: colors.groupBg }]}>\n {optionGroupLabel ? item.group?.[optionGroupLabel] : \"\"}\n </Text>\n );\n }\n\n const selected =\n value != null &&\n getValue(item, optionValue) === value;\n\n let content: React.ReactElement;\n\n if (itemTemplate) {\n const rendered = itemTemplate(item);\n\n content = React.isValidElement(rendered) ? (\n rendered\n ) : (\n <Text>{String(rendered ?? \"\")}</Text>\n );\n } else {\n content = (\n <Text style={[\n {\n color: colors.text,\n fontSize: optionFontSize(),\n fontFamily,\n },\n /* The row starts at the reader's edge, and `writingDirection`\n orders the glyphs inside it — which is what puts a leading flag\n at the end an Arabic reader starts from.\n ⛔ The physical edge is COMPUTED, never named directly: React\n Native mirrors `textAlign` when the process is RTL, so naming\n the RTL edge for an RTL reader lands on the LTR one. See\n `readerEdge` for the measurements. */\n styles.optionLabelFill,\n {\n textAlign: edge.textAlign,\n writingDirection: isRTL ? ('rtl' as const) : ('ltr' as const),\n },\n ]}>\n {getLabel(item, optionLabel)}\n </Text>\n );\n }\n\n return (\n <Pressable\n key={`item-${index}`}\n onPress={() => selectItem(item)}\n style={[\n styles.option,\n /* Same rule for the row itself, so the checkmark sits at the end\n the reader finishes on rather than the one the process picks.\n ⛔ REVERSING THE ROW IS NOT WHAT MOVES THE LABEL. The comment that\n stood here said it was, and the measurement says otherwise: a\n shrink-wrapped Text ignores `textAlign` whichever way the row\n runs, so `flex: 1` on the label is what gives the alignment\n somewhere to push to. The row's direction decides only which end\n the checkmark takes.\n ⛔ And it said the process layout \"stays LTR\". It does not — the\n App calls `I18nManager.forceRTL`, which mirrors both `textAlign`\n and `flexDirection: 'row'`. Writing the RTL edge for an RTL\n reader therefore asked for it twice and landed on the LTR one,\n which is the whole reported fault. See `readerEdge`. */\n { flexDirection: edge.flexDirection },\n selected && highlightOnSelect && { backgroundColor: colors.optionSelected },\n ]}\n >\n {content}\n {checkmark && selected && <Text>✓</Text>}\n </Pressable>\n );\n },\n [\n value,\n optionValue,\n optionLabel,\n itemTemplate,\n optionGroupLabel,\n checkmark,\n highlightOnSelect,\n /* ⛔ THE THIRD DISHONEST DEPENDENCY ARRAY IN THIS FAMILY. The body reads\n these too, and a row memoised without them keeps whatever the first\n render happened to hold — the reader's direction, the theme's face and\n the resolved colours. Two frozen memos have already cost a release\n each; this one is listed before it costs a third. */\n isRTL,\n edge.textAlign,\n edge.flexDirection,\n fontFamily,\n colors.text,\n colors.optionSelected,\n colors.groupBg,\n selectItem,\n ]\n );\n\n\n /* ---------------------------------------------\n Group flattening\n ---------------------------------------------- */\n\n const flatData = useMemo(() => {\n if (!optionGroupLabel || !optionGroupChildren) {\n return options;\n }\n\n const out: any[] = [];\n options.forEach((g: any) => {\n out.push({ __group: true, group: g });\n g[optionGroupChildren]?.forEach((c: any) => out.push(c));\n });\n return out;\n }, [options]);\n\n /* ---------------------------------------------\n Filter\n ---------------------------------------------- */\n\n const filteredData = useMemo(() => {\n if (!filter || !filterQuery) return flatData;\n const q = filterQuery.toLowerCase();\n const key = filterBy || optionLabel;\n\n return flatData.filter((entry: any) => {\n // Keep group headers\n if (entry.__group) return true;\n const label = getLabel(entry, key);\n return label.toLowerCase().includes(q);\n });\n }, [flatData, filter, filterQuery, filterBy, optionLabel]);\n\n /* ---------------------------------------------\n Display value\n ---------------------------------------------- */\n\n const displayValue = valueTemplate\n ? valueTemplate(selectedItem)\n : selectedItem\n ? getLabel(selectedItem, optionLabel)\n : \"\";\n\n /* ---------------------------------------------\n Panel body — the search field and the list\n ---------------------------------------------- */\n\n /*\n * ⛔ ONE BODY, THREE CONTAINERS. The anchored panel and the centred modal\n * each carried their own copy of this markup, which is why the hardcoded\n * \"Search...\" had to be found and fixed twice. The popup would have made it\n * three. The containers differ; what is inside them does not.\n *\n * `fill` is the one real difference. In the anchored panel the container has\n * a `maxHeight` and no height, so the list must shrink-wrap its content up\n * to that ceiling (`flexShrink`). In the popup and the centred modal the\n * container has a real height, so the list takes what is left (`flex: 1`).\n */\n const panelBody = (fill: boolean, autoFocusFilter: boolean) => (\n <>\n {filter && (\n <View style={[styles.filterContainer, { borderBottomColor: colors.filterBorder }]}>\n <TextInput\n value={filterQuery}\n onChangeText={setFilterQuery}\n placeholder={filterPlaceholder}\n placeholderTextColor={colors.placeholder}\n style={[styles.filterInput, {\n borderColor: colors.filterBorder,\n backgroundColor: colors.filterBg,\n color: colors.filterText,\n fontFamily,\n },\n // Every other input in this library names its own edge and\n // direction from the reader's language. Leaving these unset let the\n // platform decide, so the field followed the process layout\n // direction instead of the person reading it.\n isRTL ? styles.filterRtl : styles.filterLtr]}\n /* ⛔ THE ANCHORED PANEL KEEPS ITS AUTOFOCUS — changing it would\n change behaviour for every consumer that has not opted in. In\n the popup the list is already the whole point and is fully\n visible, so the keyboard waits to be asked for: one tap on the\n field raises it, and until then the list has the whole sheet. */\n autoFocus={autoFocusFilter}\n />\n </View>\n )}\n <FlatList\n style={fill ? styles.listFill : styles.listShrink}\n contentContainerStyle={styles.listContent}\n data={filteredData}\n keyExtractor={(item: any, i: number) =>\n item?.__group ? `group-${i}` : `item-${i}`\n }\n renderItem={({ item, index }) => renderItem(item, index)}\n keyboardShouldPersistTaps=\"handled\"\n showsHorizontalScrollIndicator={false}\n ListEmptyComponent={\n filterQuery ? (\n <View style={styles.emptyContainer}>\n <Text style={[styles.emptyText, { color: colors.emptyText, fontFamily }]}>{emptyFilterMessage}</Text>\n </View>\n ) : null\n }\n />\n {panelFooterTemplate?.()}\n </>\n );\n\n /* ---------------------------------------------\n Render\n ---------------------------------------------- */\n\n const usePopup = popup && typeof renderPopup === 'function';\n\n return (\n <View style={styles.container} testID={testID}>\n <Pressable\n ref={triggerRef as any}\n style={[\n styles.control,\n { borderColor: colors.border, backgroundColor: colors.bg },\n invalid && { borderColor: colors.borderInvalid },\n disabled && styles.disabled,\n externalViewStyle,\n ]}\n onPress={toggle}\n >\n {editable ? (\n <Input style={styles.input}>\n <InputField\n ref={inputRef}\n value={inputText}\n onChangeText={setInputText}\n placeholder={placeholder}\n editable={!disabled}\n />\n </Input>\n ) : (\n <Text\n numberOfLines={1}\n style={[\n // Fill the trigger row and left-align the value/placeholder so it\n // doesn't read as centred (the row is justify=space-between, so the\n // arrow stays pinned right).\n { flex: 1, textAlign: \"left\" as const },\n displayValue ? { color: colors.text } : { color: colors.placeholder },\n externalTextStyle,\n !displayValue && { color: colors.placeholder },\n ]}>\n {displayValue || placeholder}\n </Text>\n )}\n\n <Text style={[{ color: colors.text }, externalTextStyle]}>▾</Text>\n </Pressable>\n\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 { top, maxHeight } = computePanelGeometry({\n screenHeight: screen.height,\n insetTop: insets.top,\n insetBottom: insets.bottom,\n keyboardHeight,\n triggerY: triggerLayout.y,\n triggerHeight: triggerLayout.height,\n });\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 {panelBody(false, true)}\n </View>\n );\n })()}\n </Pressable>\n </Modal>\n )}\n\n {!usePopup && isModal && (\n <Modal visible={open} transparent animationType=\"fade\">\n <Pressable style={styles.modalOverlay} onPress={close}>\n <View\n style={[styles.modalPanel, { backgroundColor: colors.bg }]}\n onStartShouldSetResponder={() => true}\n >\n {panelBody(true, true)}\n </View>\n </Pressable>\n </Modal>\n )}\n\n {/* Popup — the container comes from the wrapper (this library's own\n Dialog in sheet position); everything inside it is the same body the\n other two containers render. */}\n {usePopup && renderPopup!({\n visible: open,\n onClose: close,\n title: popupTitle,\n children: panelBody(true, false),\n })}\n\n </View>\n );\n}\n\n/* ---------------------------------------------\n Styles (layout only — colors applied inline via theme tokens)\n---------------------------------------------- */\n\nconst styles = StyleSheet.create({\n container: {\n width: \"100%\",\n position: \"relative\" as const,\n },\n control: {\n flexDirection: \"row\" as const,\n alignItems: \"center\" as const,\n justifyContent: \"space-between\" as const,\n borderWidth: 1,\n borderRadius: 6,\n paddingHorizontal: 10,\n paddingVertical: 10,\n },\n disabled: {\n opacity: 0.5,\n },\n /* The label takes the row's spare width so `textAlign` has somewhere to\n push to. Without it the Text shrink-wraps its glyphs and the alignment\n has no effect — the first attempt at this fix set only `textAlign` and\n changed nothing on screen. */\n optionLabelFill: {\n flex: 1,\n },\n option: {\n paddingHorizontal: 12,\n paddingVertical: 10,\n flexDirection: \"row\" as const,\n justifyContent: \"space-between\" as const,\n alignItems: \"center\" as const,\n },\n groupLabel: {\n paddingHorizontal: 12,\n paddingVertical: 8,\n fontWeight: \"600\" as const,\n },\n input: {\n flex: 1,\n },\n panel: {\n position: \"absolute\" as const,\n top: \"100%\",\n left: 0,\n right: 0,\n marginTop: 4,\n borderWidth: 1,\n borderRadius: 6,\n maxHeight: 260,\n overflow: \"hidden\" as const,\n zIndex: 9999,\n },\n filterContainer: {\n paddingHorizontal: 8,\n paddingVertical: 6,\n borderBottomWidth: 1,\n },\n listFill: {\n flex: 1,\n },\n // The anchored panel is sized by `maxHeight` with no height, so the list has\n // to grow with its content up to that ceiling and then scroll inside it.\n // `flex: 1` sets flexBasis 0, which contributes nothing to a shrink-wrapping\n // parent.\n listShrink: {\n flexGrow: 0,\n flexShrink: 1,\n },\n listContent: {\n paddingBottom: 12,\n },\n filterInput: {\n fontSize: 14,\n paddingHorizontal: 8,\n paddingVertical: 6,\n borderWidth: 1,\n borderRadius: 4,\n },\n filterLtr: {\n textAlign: 'left' as const,\n writingDirection: 'ltr' as const,\n },\n filterRtl: {\n textAlign: 'right' as const,\n writingDirection: 'rtl' as const,\n },\n emptyContainer: {\n padding: 16,\n alignItems: 'center' as const,\n },\n emptyText: {\n fontSize: 14,\n },\n popoverOverlay: {\n flex: 1,\n backgroundColor: 'transparent',\n },\n popoverPanel: {\n position: 'absolute' as const,\n borderWidth: 1,\n borderRadius: 6,\n overflow: 'hidden' as const,\n elevation: 8,\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.15,\n shadowRadius: 8,\n },\n modalOverlay: {\n flex: 1,\n backgroundColor: 'rgba(0,0,0,0.4)',\n justifyContent: 'center' as const,\n },\n modalPanel: {\n margin: 24,\n maxHeight: '70%',\n borderRadius: 12,\n overflow: 'hidden' as const,\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoIA,MAAM,QAAA,GAAW,CAAC,IAAA,EAAW,WAAA,KAAyB;AACpD,EAAA,IAAI,CAAC,MAAM,OAAO,EAAA;AAClB,EAAA,IAAI,CAAC,WAAA,EAAa,OAAO,MAAA,CAAO,IAAI,CAAA;AACpC,EAAA,OAAO,MAAA,CAAO,IAAA,CAAK,WAAW,CAAC,CAAA;AACjC,CAAA;AAEA,MAAM,QAAA,GAAW,CAAC,IAAA,EAAW,WAAA,KAAyB;AACpD,EAAA,IAAI,CAAC,MAAM,OAAO,IAAA;AAClB,EAAA,IAAI,CAAC,aAAa,OAAO,IAAA;AACzB,EAAA,OAAO,KAAK,WAAW,CAAA;AACzB,CAAA;AAEA,MAAM,CAAA,GAAI,0BAAA;AAYV,MAAM,iBAAiB,MAAc;AACnC,EAAA,MAAM,QAAA,GAAW,aAAA,CAAc,0BAAA,CAA2B,eAAe,CAAC,CAAA;AAC1E,EAAA,OAAO,OAAO,QAAA,KAAa,QAAA,GAAW,QAAA,GAAW,EAAA;AACnD,CAAA;AAEA,MAAM,eAAA,uBAAsB,GAAA,CAAI;AAAA,EAC9B,UAAA;AAAA,EAAY,YAAA;AAAA,EAAc,YAAA;AAAA,EAAc,WAAA;AAAA,EACxC,OAAA;AAAA,EAAS,eAAA;AAAA,EAAiB,YAAA;AAAA,EAAc,WAAA;AAAA,EACxC,oBAAA;AAAA,EAAsB;AACxB,CAAC,CAAA;AAED,SAAS,WAAW,QAAA,EAAsD;AACxE,EAAA,IAAI,CAAC,QAAA,EAAU,OAAO,EAAC;AACvB,EAAA,MAAM,OAA4B,EAAC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AAA,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,GAChB;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,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;AAEd,CAAC,CAAA;;;;"}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
7
  var reactNative = require('react-native');
8
+ var readerEdge = require('../../Factory/helpers/readerEdge.cjs');
8
9
  var style = require('../../Factory/helpers/style.cjs');
9
10
 
10
11
  const t = style.resolveThemeTokenForNative;
@@ -63,6 +64,7 @@ function MultiSelect(props) {
63
64
  selectedItemTemplate,
64
65
  style: externalStyle
65
66
  } = props;
67
+ const edge = readerEdge.readerEdge(isRTL);
66
68
  const triggerRef = React.useRef(null);
67
69
  const [open, setOpen] = React.useState(false);
68
70
  const [query, setQuery] = React.useState("");
@@ -196,9 +198,13 @@ function MultiSelect(props) {
196
198
  styles.itemText,
197
199
  { color: colors.text, fontFamily },
198
200
  checked && { color: colors.itemSelectedText, fontWeight: "500" },
199
- // The row starts at the reader's edge, so a label that opens
200
- // with a flag puts the flag where they start reading.
201
- isRTL ? styles.itemRtl : styles.itemLtr
201
+ /* ⛔ The physical edge is COMPUTED — React Native mirrors
202
+ `textAlign` when the process is RTL, so naming the RTL edge
203
+ for an RTL reader lands on the LTR one. See `readerEdge`. */
204
+ {
205
+ textAlign: edge.textAlign,
206
+ writingDirection: isRTL ? "rtl" : "ltr"
207
+ }
202
208
  ], children: getLabel(entry.data, optionLabel) })
203
209
  ]
204
210
  }
@@ -431,14 +437,6 @@ const styles = reactNative.StyleSheet.create({
431
437
  fontSize: 14,
432
438
  paddingVertical: 0
433
439
  },
434
- itemLtr: {
435
- textAlign: "left",
436
- writingDirection: "ltr"
437
- },
438
- itemRtl: {
439
- textAlign: "right",
440
- writingDirection: "rtl"
441
- },
442
440
  searchLtr: {
443
441
  textAlign: "left",
444
442
  writingDirection: "ltr"
@@ -470,6 +468,10 @@ const styles = reactNative.StyleSheet.create({
470
468
  },
471
469
  itemText: {
472
470
  fontSize: 14,
471
+ /* The label takes the row's spare width so `textAlign` has somewhere to
472
+ push to — a shrink-wrapped Text ignores it. Already here, which is why
473
+ MultiSelect needs no extra entry; Dropdown's label style carries no flex
474
+ and got `optionLabelFill`. */
473
475
  flex: 1
474
476
  },
475
477
  // Checkbox
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","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 shadowRadius: 8,\n },\n});\n"],"names":["resolveThemeTokenForNative","useRef","useState","useMemo","jsx","View","Text","jsxs","ActivityIndicator","FlatList","TouchableOpacity","TextInput","Modal","Pressable","Dimensions","StyleSheet"],"mappings":";;;;;;;;;AA+EA,MAAM,CAAA,GAAIA,gCAAA;AAEV,MAAM,eAAA,uBAAsB,GAAA,CAAI;AAAA,EAC9B,UAAA;AAAA,EAAY,YAAA;AAAA,EAAc,YAAA;AAAA,EAAc,WAAA;AAAA,EACxC,OAAA;AAAA,EAAS,eAAA;AAAA,EAAiB,YAAA;AAAA,EAAc,WAAA;AAAA,EACxC,oBAAA;AAAA,EAAsB;AACxB,CAAC,CAAA;AAED,SAAS,WAAW,QAAA,EAAsD;AACxE,EAAA,IAAI,CAAC,QAAA,EAAU,OAAO,EAAC;AACvB,EAAA,MAAM,OAA4B,EAAC;AACnC,EAAA,MAAM,OAA4B,EAAC;AACnC,EAAA,KAAA,MAAW,CAAC,CAAA,EAAG,CAAC,KAAK,MAAA,CAAO,OAAA,CAAQ,QAAQ,CAAA,EAAG;AAC7C,IAAA,IAAI,gBAAgB,GAAA,CAAI,CAAC,CAAA,EAAG,IAAA,CAAK,CAAC,CAAA,GAAI,CAAA;AAAA,SACjC,IAAA,CAAK,CAAC,CAAA,GAAI,CAAA;AAAA,EACjB;AACA,EAAA,OAAO;AAAA,IACL,WAAW,MAAA,CAAO,IAAA,CAAK,IAAI,CAAA,CAAE,SAAS,IAAA,GAAO,MAAA;AAAA,IAC7C,WAAW,MAAA,CAAO,IAAA,CAAK,IAAI,CAAA,CAAE,SAAS,IAAA,GAAO;AAAA,GAC/C;AACF;AAEA,SAAwB,YAAe,KAAA,EAA4B;AACjE,EAAA,MAAM;AAAA,IACJ,KAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAU,EAAC;AAAA,IACX,WAAA;AAAA,IACA,WAAA;AAAA,IACA,gBAAA;AAAA,IACA,mBAAA;AAAA,IACA,OAAA,GAAU,KAAA;AAAA,IACV,WAAA,GAAc,QAAA;AAAA,IACd,QAAA;AAAA,IACA,OA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elect/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 { readerEdge } from '../../Factory/helpers/readerEdge';\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 /* Physical edges to write so content lands where the reader starts. */\n const edge = readerEdge(isRTL);\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 physical edge is COMPUTED — React Native mirrors\n `textAlign` when the process is RTL, so naming the RTL edge\n for an RTL reader lands on the LTR one. See `readerEdge`. */\n {\n textAlign: edge.textAlign,\n writingDirection: isRTL ? ('rtl' as const) : ('ltr' as const),\n },\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 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 /* The label takes the row's spare width so `textAlign` has somewhere to\n push to — a shrink-wrapped Text ignores it. Already here, which is why\n MultiSelect needs no extra entry; Dropdown's label style carries no flex\n and got `optionLabelFill`. */\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 shadowRadius: 8,\n },\n});\n"],"names":["resolveThemeTokenForNative","readerEdge","useRef","useState","useMemo","jsx","View","Text","jsxs","ActivityIndicator","FlatList","TouchableOpacity","TextInput","Modal","Pressable","Dimensions","StyleSheet"],"mappings":";;;;;;;;;;AAgFA,MAAM,CAAA,GAAIA,gCAAA;AAEV,MAAM,eAAA,uBAAsB,GAAA,CAAI;AAAA,EAC9B,UAAA;AAAA,EAAY,YAAA;AAAA,EAAc,YAAA;AAAA,EAAc,WAAA;AAAA,EACxC,OAAA;AAAA,EAAS,eAAA;AAAA,EAAiB,YAAA;AAAA,EAAc,WAAA;AAAA,EACxC,oBAAA;AAAA,EAAsB;AACxB,CAAC,CAAA;AAED,SAAS,WAAW,QAAA,EAAsD;AACxE,EAAA,IAAI,CAAC,QAAA,EAAU,OAAO,EAAC;AACvB,EAAA,MAAM,OAA4B,EAAC;AACnC,EAAA,MAAM,OAA4B,EAAC;AACnC,EAAA,KAAA,MAAW,CAAC,CAA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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,6 +1,7 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import React, { useRef, useState, useMemo } from 'react';
3
3
  import { View, Text, TouchableOpacity, TextInput, Modal, Pressable, Dimensions, ActivityIndicator, FlatList, StyleSheet } from 'react-native';
4
+ import { readerEdge } from '../../Factory/helpers/readerEdge.js';
4
5
  import { resolveThemeTokenForNative } from '../../Factory/helpers/style.js';
5
6
 
6
7
  const t = resolveThemeTokenForNative;
@@ -59,6 +60,7 @@ function MultiSelect(props) {
59
60
  selectedItemTemplate,
60
61
  style: externalStyle
61
62
  } = props;
63
+ const edge = readerEdge(isRTL);
62
64
  const triggerRef = useRef(null);
63
65
  const [open, setOpen] = useState(false);
64
66
  const [query, setQuery] = useState("");
@@ -192,9 +194,13 @@ function MultiSelect(props) {
192
194
  styles.itemText,
193
195
  { color: colors.text, fontFamily },
194
196
  checked && { color: colors.itemSelectedText, fontWeight: "500" },
195
- // The row starts at the reader's edge, so a label that opens
196
- // with a flag puts the flag where they start reading.
197
- isRTL ? styles.itemRtl : styles.itemLtr
197
+ /* ⛔ The physical edge is COMPUTED — React Native mirrors
198
+ `textAlign` when the process is RTL, so naming the RTL edge
199
+ for an RTL reader lands on the LTR one. See `readerEdge`. */
200
+ {
201
+ textAlign: edge.textAlign,
202
+ writingDirection: isRTL ? "rtl" : "ltr"
203
+ }
198
204
  ], children: getLabel(entry.data, optionLabel) })
199
205
  ]
200
206
  }
@@ -427,14 +433,6 @@ const styles = StyleSheet.create({
427
433
  fontSize: 14,
428
434
  paddingVertical: 0
429
435
  },
430
- itemLtr: {
431
- textAlign: "left",
432
- writingDirection: "ltr"
433
- },
434
- itemRtl: {
435
- textAlign: "right",
436
- writingDirection: "rtl"
437
- },
438
436
  searchLtr: {
439
437
  textAlign: "left",
440
438
  writingDirection: "ltr"
@@ -466,6 +464,10 @@ const styles = StyleSheet.create({
466
464
  },
467
465
  itemText: {
468
466
  fontSize: 14,
467
+ /* The label takes the row's spare width so `textAlign` has somewhere to
468
+ push to — a shrink-wrapped Text ignores it. Already here, which is why
469
+ MultiSelect needs no extra entry; Dropdown's label style carries no flex
470
+ and got `optionLabelFill`. */
469
471
  flex: 1
470
472
  },
471
473
  // Checkbox