@nori-ui/core 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Table.shared-BymRgTnY.d.cts +54 -0
- package/dist/Table.shared-BymRgTnY.d.ts +54 -0
- package/dist/{chunk-ND7MRYW7.js → chunk-2HMQDJ22.js} +4 -4
- package/dist/{chunk-ND7MRYW7.js.map → chunk-2HMQDJ22.js.map} +1 -1
- package/dist/{chunk-KCLWPSV5.js → chunk-2RL6WCFC.js} +4 -4
- package/dist/{chunk-KCLWPSV5.js.map → chunk-2RL6WCFC.js.map} +1 -1
- package/dist/{chunk-FDBQOQMW.js → chunk-3BDDPFCI.js} +3 -3
- package/dist/{chunk-FDBQOQMW.js.map → chunk-3BDDPFCI.js.map} +1 -1
- package/dist/{chunk-WOF67PKT.js → chunk-3CEJ5TB4.js} +3 -3
- package/dist/{chunk-WOF67PKT.js.map → chunk-3CEJ5TB4.js.map} +1 -1
- package/dist/{chunk-BNDUQNG7.js → chunk-3OIWAS2P.js} +3 -3
- package/dist/{chunk-BNDUQNG7.js.map → chunk-3OIWAS2P.js.map} +1 -1
- package/dist/{chunk-6JVUVBZH.js → chunk-4PUPKWEP.js} +5 -5
- package/dist/{chunk-6JVUVBZH.js.map → chunk-4PUPKWEP.js.map} +1 -1
- package/dist/{chunk-6PO2IWB3.js → chunk-4UFAZLSZ.js} +5 -3
- package/dist/chunk-4UFAZLSZ.js.map +1 -0
- package/dist/{chunk-76FZF4GM.js → chunk-5PSC5HT4.js} +8 -125
- package/dist/chunk-5PSC5HT4.js.map +1 -0
- package/dist/{chunk-LWQZ257T.js → chunk-5XEGZFG5.js} +3 -3
- package/dist/{chunk-LWQZ257T.js.map → chunk-5XEGZFG5.js.map} +1 -1
- package/dist/{chunk-WAKKQROH.js → chunk-6AD6KCVB.js} +3 -3
- package/dist/{chunk-WAKKQROH.js.map → chunk-6AD6KCVB.js.map} +1 -1
- package/dist/chunk-73CUV7MW.js +125 -0
- package/dist/chunk-73CUV7MW.js.map +1 -0
- package/dist/{chunk-GRDVE3IR.js → chunk-BZLT6R62.js} +3 -3
- package/dist/{chunk-GRDVE3IR.js.map → chunk-BZLT6R62.js.map} +1 -1
- package/dist/{chunk-Y4ZRSW35.js → chunk-CCUXO2HN.js} +3 -3
- package/dist/{chunk-Y4ZRSW35.js.map → chunk-CCUXO2HN.js.map} +1 -1
- package/dist/{chunk-2UXKXUX2.js → chunk-CPIKN4BX.js} +3 -3
- package/dist/{chunk-2UXKXUX2.js.map → chunk-CPIKN4BX.js.map} +1 -1
- package/dist/{chunk-46OT4PA6.js → chunk-DDGMLLS3.js} +3 -3
- package/dist/{chunk-46OT4PA6.js.map → chunk-DDGMLLS3.js.map} +1 -1
- package/dist/{chunk-XP55RZ3D.js → chunk-FEPTH5RV.js} +3 -3
- package/dist/{chunk-XP55RZ3D.js.map → chunk-FEPTH5RV.js.map} +1 -1
- package/dist/{chunk-MJ4AGXS7.js → chunk-GJMHNEQ3.js} +3 -3
- package/dist/{chunk-MJ4AGXS7.js.map → chunk-GJMHNEQ3.js.map} +1 -1
- package/dist/{chunk-VCJF75T2.js → chunk-JQQ3FBN7.js} +3 -3
- package/dist/{chunk-VCJF75T2.js.map → chunk-JQQ3FBN7.js.map} +1 -1
- package/dist/{chunk-O4NMS3KB.js → chunk-JXLEMBDB.js} +3 -3
- package/dist/{chunk-O4NMS3KB.js.map → chunk-JXLEMBDB.js.map} +1 -1
- package/dist/{chunk-W3HMOOON.js → chunk-JZ774T7U.js} +3 -3
- package/dist/{chunk-W3HMOOON.js.map → chunk-JZ774T7U.js.map} +1 -1
- package/dist/{chunk-SINLREQV.js → chunk-MKSDYRWQ.js} +3 -3
- package/dist/{chunk-SINLREQV.js.map → chunk-MKSDYRWQ.js.map} +1 -1
- package/dist/{chunk-AFQIK6JI.js → chunk-MRJWPRCX.js} +3 -3
- package/dist/{chunk-AFQIK6JI.js.map → chunk-MRJWPRCX.js.map} +1 -1
- package/dist/{chunk-EFK7726V.js → chunk-NF7XG2FG.js} +3 -3
- package/dist/{chunk-EFK7726V.js.map → chunk-NF7XG2FG.js.map} +1 -1
- package/dist/{chunk-WTNDPO2V.js → chunk-NNFJKRXZ.js} +3 -3
- package/dist/{chunk-WTNDPO2V.js.map → chunk-NNFJKRXZ.js.map} +1 -1
- package/dist/{chunk-CGQIVFCN.js → chunk-NRYWNOG5.js} +3 -3
- package/dist/{chunk-CGQIVFCN.js.map → chunk-NRYWNOG5.js.map} +1 -1
- package/dist/{chunk-HTF6FDB6.js → chunk-OMU4R4Y5.js} +3 -3
- package/dist/{chunk-HTF6FDB6.js.map → chunk-OMU4R4Y5.js.map} +1 -1
- package/dist/{chunk-C6TRLHMW.js → chunk-PABG3IJ6.js} +3 -3
- package/dist/{chunk-C6TRLHMW.js.map → chunk-PABG3IJ6.js.map} +1 -1
- package/dist/{chunk-RM5TSXVE.js → chunk-PNP7L4TA.js} +3 -3
- package/dist/{chunk-RM5TSXVE.js.map → chunk-PNP7L4TA.js.map} +1 -1
- package/dist/{chunk-L5X4SYJ4.js → chunk-PZS4A4VQ.js} +3 -3
- package/dist/{chunk-L5X4SYJ4.js.map → chunk-PZS4A4VQ.js.map} +1 -1
- package/dist/{chunk-4I37QSEM.js → chunk-QJVS2VXS.js} +5 -5
- package/dist/{chunk-4I37QSEM.js.map → chunk-QJVS2VXS.js.map} +1 -1
- package/dist/{chunk-H7MFAFV4.js → chunk-RUWD35UI.js} +4 -4
- package/dist/{chunk-H7MFAFV4.js.map → chunk-RUWD35UI.js.map} +1 -1
- package/dist/{chunk-5BM6H2CD.js → chunk-SFNDR6DI.js} +3 -3
- package/dist/{chunk-5BM6H2CD.js.map → chunk-SFNDR6DI.js.map} +1 -1
- package/dist/{chunk-UF5OENHV.js → chunk-TLS54G6Y.js} +3 -3
- package/dist/{chunk-UF5OENHV.js.map → chunk-TLS54G6Y.js.map} +1 -1
- package/dist/{chunk-UUXWRDWW.js → chunk-UJWCEGQY.js} +3 -3
- package/dist/{chunk-UUXWRDWW.js.map → chunk-UJWCEGQY.js.map} +1 -1
- package/dist/{chunk-UJ5KFRDE.js → chunk-UZD77M3J.js} +3 -3
- package/dist/{chunk-UJ5KFRDE.js.map → chunk-UZD77M3J.js.map} +1 -1
- package/dist/chunk-VP7DRJUZ.js +3 -0
- package/dist/chunk-VP7DRJUZ.js.map +1 -0
- package/dist/{chunk-UPVNZPFV.js → chunk-VYRJ7OE5.js} +3 -3
- package/dist/{chunk-UPVNZPFV.js.map → chunk-VYRJ7OE5.js.map} +1 -1
- package/dist/{chunk-IGLMPAWE.js → chunk-WGT345SV.js} +3 -3
- package/dist/{chunk-IGLMPAWE.js.map → chunk-WGT345SV.js.map} +1 -1
- package/dist/{chunk-F7G6R373.js → chunk-WP2Z2ATO.js} +5 -5
- package/dist/{chunk-F7G6R373.js.map → chunk-WP2Z2ATO.js.map} +1 -1
- package/dist/chunk-WYPGQVDV.js +145 -0
- package/dist/chunk-WYPGQVDV.js.map +1 -0
- package/dist/{chunk-GELLSU64.js → chunk-XALU6LOT.js} +3 -3
- package/dist/{chunk-GELLSU64.js.map → chunk-XALU6LOT.js.map} +1 -1
- package/dist/{chunk-VMAGFYHG.js → chunk-Y5TJ7CAX.js} +3 -3
- package/dist/{chunk-VMAGFYHG.js.map → chunk-Y5TJ7CAX.js.map} +1 -1
- package/dist/chunk-YZ27OS2R.js +202 -0
- package/dist/chunk-YZ27OS2R.js.map +1 -0
- package/dist/client.cjs +449 -119
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +3 -0
- package/dist/client.d.ts +3 -0
- package/dist/client.js +50 -46
- package/dist/client.js.map +1 -1
- package/dist/components/Accordion/index.js +2 -2
- package/dist/components/Alert/index.js +2 -2
- package/dist/components/AlertDialog/index.js +2 -2
- package/dist/components/Avatar/index.js +2 -2
- package/dist/components/Badge/index.js +2 -2
- package/dist/components/Box/index.js +4 -4
- package/dist/components/Breadcrumb/index.cjs +3 -1
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.js +5 -5
- package/dist/components/Button/index.js +2 -2
- package/dist/components/Calendar/index.cjs +3 -1
- package/dist/components/Calendar/index.cjs.map +1 -1
- package/dist/components/Calendar/index.js +5 -5
- package/dist/components/Card/index.js +2 -2
- package/dist/components/Checkbox/index.js +2 -2
- package/dist/components/Combobox/index.js +3 -3
- package/dist/components/ContextMenu/index.js +4 -4
- package/dist/components/DataTable/index.cjs +770 -0
- package/dist/components/DataTable/index.cjs.map +1 -0
- package/dist/components/DataTable/index.d.cts +53 -0
- package/dist/components/DataTable/index.d.ts +53 -0
- package/dist/components/DataTable/index.js +8 -0
- package/dist/components/DataTable/index.js.map +1 -0
- package/dist/components/DatePicker/index.cjs +3 -1
- package/dist/components/DatePicker/index.cjs.map +1 -1
- package/dist/components/DatePicker/index.js +7 -7
- package/dist/components/Dialog/index.js +2 -2
- package/dist/components/DropdownMenu/index.js +3 -3
- package/dist/components/Field/index.cjs +3 -1
- package/dist/components/Field/index.cjs.map +1 -1
- package/dist/components/Field/index.d.cts +2 -2
- package/dist/components/Field/index.d.ts +2 -2
- package/dist/components/Field/index.js +3 -3
- package/dist/components/FloatButton/index.cjs +3 -1
- package/dist/components/FloatButton/index.cjs.map +1 -1
- package/dist/components/FloatButton/index.js +5 -5
- package/dist/components/HStack/index.js +4 -4
- package/dist/components/InputGroup/index.js +2 -2
- package/dist/components/Label/index.cjs +3 -1
- package/dist/components/Label/index.cjs.map +1 -1
- package/dist/components/Label/index.js +3 -3
- package/dist/components/Pagination/index.cjs +3 -1
- package/dist/components/Pagination/index.cjs.map +1 -1
- package/dist/components/Pagination/index.js +6 -5
- package/dist/components/Popover/index.js +2 -2
- package/dist/components/Progress/index.js +2 -2
- package/dist/components/Radio/index.js +2 -2
- package/dist/components/SegmentedControl/index.js +2 -2
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Sheet/index.js +2 -2
- package/dist/components/Switch/index.js +2 -2
- package/dist/components/Table/index.cjs +461 -0
- package/dist/components/Table/index.cjs.map +1 -0
- package/dist/components/Table/index.d.cts +16 -0
- package/dist/components/Table/index.d.ts +16 -0
- package/dist/components/Table/index.js +7 -0
- package/dist/components/Table/index.js.map +1 -0
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Text/index.js +2 -2
- package/dist/components/TextArea/index.js +3 -3
- package/dist/components/TextInput/index.js +2 -2
- package/dist/components/Toggle/index.js +2 -2
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/VStack/index.js +4 -4
- package/dist/i18n/index.cjs +3 -1
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/index.cjs +449 -119
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +47 -43
- package/dist/slot/index.d.cts +2 -2
- package/dist/slot/index.d.ts +2 -2
- package/package.json +1 -1
- package/dist/chunk-6PO2IWB3.js.map +0 -1
- package/dist/chunk-76FZF4GM.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Accordion/Accordion.tsx"],"names":["RNText"],"mappings":";;;;;;;;;;;AAsEA,IAAM,gBAAA,GAAmB,cAA4C,IAAI,CAAA;AAEzE,IAAM,mBAAA,2BAAuB,KAAA,KAAyC;AAClE,EAAA,MAAM,GAAA,GAAM,WAAW,gBAAgB,CAAA;AACvC,EAAA,IAAI,CAAC,GAAA,EAAK;AACN,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,CAAA,EAAI,KAAK,CAAA,yCAAA,CAA2C,CAAA;AAAA,EACxE;AACA,EAAA,OAAO,GAAA;AACX,CAAA,EAN4B,qBAAA,CAAA;AAgB5B,IAAM,oBAAA,GAAuB,cAAgD,IAAI,CAAA;AAEjF,IAAM,uBAAA,2BAA2B,KAAA,KAA6C;AAC1E,EAAA,MAAM,GAAA,GAAM,WAAW,oBAAoB,CAAA;AAC3C,EAAA,IAAI,CA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MAE1C,QAAA,kBAAA,GAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACG,GAAA,EAAK,CAAC,IAAA,KAAkB;AACpB,YAAA,QAAA,CAAS,OAAA,GAAU,IAAA;AAAA,UACvB,CAAA;AAAA,UACA,SAAA,EAAW,GAAG,gBAAgB,CAAA;AAAA,UAC9B,KAAA,EAAO,UAAA;AAAA,UAEN,QAAA,EAAA,OAAO,aAAa,QAAA,mBACjB,GAAA;AAAA,YAACA,IAAA;AAAA,YAAA;AAAA,cACG,KAAA,EAAO;AAAA,gBACH,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,KAAA;AAAA,gBAC5B,UAAA,EAAY,OAAO,UAAA,CAAW,IAAA;AAAA,gBAC9B,QAAA,EAAU,EAAA,CAAG,MAAA,CAAO,QAAA,CAAS,EAAE,CAAA;AAAA,gBAC/B,UAAA,EAAY,GAAG,MAAA,CAAO,QAAA,CAAS,EAAE,CAAA,GAAI,MAAA,CAAO,MAAA,CAAO,UAAA,CAAW,MAAM;AAAA,eACxE;AAAA,cAEC;AAAA;AAAA,WACL,GAEA;AAAA;AAAA;AAER;AAAA,GACJ;AAER,CAAA,EAjPgC,kBAAA,CAAA;AAyPzB,IAAM,SAAA,GAAY,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe;AAAA,EAClD,IAAA,EAAM,aAAA;AAAA,EACN,OAAA,EAAS,gBAAA;AAAA,EACT,OAAA,EAAS;AACb,CAAC","file":"chunk-Y4ZRSW35.js","sourcesContent":["'use client';\n\nimport {\n createContext,\n type KeyboardEvent,\n type ReactNode,\n type RefObject,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { LayoutChangeEvent, ViewStyle } from 'react-native';\nimport { Platform, Pressable, Text as RNText, View } from 'react-native';\nimport { AnimatedView } from '../../animation/animated-view';\nimport { useAnimatedNumber } from '../../animation/use-animated-number';\nimport { defaultSemanticIcons } from '../../icons/default-semantic-icons';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type AccordionType = 'single' | 'multiple';\n\ntype SingleProps = {\n /** One-at-a-time mode. */\n type: 'single';\n /** Controlled open value. Pass `null` (with `collapsible`) for \"nothing open\". */\n value?: string | null;\n /** Uncontrolled initial open value. */\n defaultValue?: string;\n /** Fires when the open value changes. Receives the new value (string), or `null` if collapsed. */\n onChange?: (next: string | null) => void;\n /** Allow closing the open item by clicking it again. @defaultValue false */\n collapsible?: boolean;\n};\n\ntype MultipleProps = {\n /** Any combination open. */\n type: 'multiple';\n /** Controlled list of open values. */\n value?: string[];\n /** Uncontrolled initial list of open values. */\n defaultValue?: string[];\n /** Fires when the open list changes. Receives the new list. */\n onChange?: (next: string[]) => void;\n /** No-op in `multiple` mode (items are always individually collapsible). */\n collapsible?: never;\n};\n\ntype CommonProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nexport type AccordionProps = (SingleProps | MultipleProps) & CommonProps;\n\ntype AccordionContextValue = {\n baseId: string;\n isOpen: (value: string) => boolean;\n toggle: (value: string) => void;\n register: (value: string, ref: RefObject<HTMLElement | null>) => void;\n unregister: (value: string) => void;\n moveFocus: (offset: 1 | -1, fromValue: string) => void;\n focusEdge: (edge: 'first' | 'last') => void;\n};\n\nconst AccordionContext = createContext<AccordionContextValue | null>(null);\n\nconst useAccordionContext = (label: string): AccordionContextValue => {\n const ctx = useContext(AccordionContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <Accordion>.`);\n }\n return ctx;\n};\n\ntype AccordionItemContextValue = {\n value: string;\n open: boolean;\n disabled: boolean;\n triggerId: string;\n contentId: string;\n};\n\nconst AccordionItemContext = createContext<AccordionItemContextValue | null>(null);\n\nconst useAccordionItemContext = (label: string): AccordionItemContextValue => {\n const ctx = useContext(AccordionItemContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <Accordion.Item>.`);\n }\n return ctx;\n};\n\n/**\n * Vertically stacked, individually expandable sections. Compose:\n *\n * <Accordion type=\"single\" defaultValue=\"overview\" collapsible>\n * <Accordion.Item value=\"overview\">\n * <Accordion.Trigger>Overview</Accordion.Trigger>\n * <Accordion.Content>...</Accordion.Content>\n * </Accordion.Item>\n * </Accordion>\n *\n * Modes:\n * - `single` — at most one item open. Pass `collapsible` to allow closing the\n * open item.\n * - `multiple` — any combination open. `value` / `defaultValue` are arrays.\n *\n * Controlled (`value` + `onChange`) and uncontrolled (`defaultValue`) both\n * supported. Triggers are real `<button>`s with full keyboard nav: ArrowDown /\n * ArrowUp move focus, Home / End jump to first / last, Enter / Space toggle.\n */\nconst AccordionRoot = (props: AccordionProps) => {\n const baseId = useId();\n const refs = useRef<Map<string, RefObject<HTMLElement | null>>>(new Map());\n const orderRef = useRef<string[]>([]);\n\n // Pull out the props we always need; the discriminated union handlers below\n // narrow on `type` for the actual state logic.\n const { type, children, className, testID } = props;\n\n // Single-mode internal state. We always allocate both state slots so the\n // hook order stays stable across re-renders regardless of `type`.\n const [singleInner, setSingleInner] = useState<string | null>(\n type === 'single' ? (props.defaultValue ?? null) : null\n );\n const [multipleInner, setMultipleInner] = useState<string[]>(type === 'multiple' ? (props.defaultValue ?? []) : []);\n\n const singleControlled = type === 'single' && props.value !== undefined;\n const multipleControlled = type === 'multiple' && props.value !== undefined;\n\n const singleCurrent = type === 'single' ? (singleControlled ? (props.value ?? null) : singleInner) : null;\n const multipleCurrent = type === 'multiple' ? (multipleControlled ? (props.value ?? []) : multipleInner) : [];\n\n const isOpen = useCallback(\n (v: string) => {\n if (type === 'single') {\n return singleCurrent === v;\n }\n return multipleCurrent.includes(v);\n },\n [type, singleCurrent, multipleCurrent]\n );\n\n const toggle = useCallback(\n (v: string) => {\n if (type === 'single') {\n const next = singleCurrent === v ? (props.collapsible ? null : singleCurrent) : v;\n if (next === singleCurrent) {\n return;\n }\n if (!singleControlled) {\n setSingleInner(next);\n }\n props.onChange?.(next);\n } else {\n const has = multipleCurrent.includes(v);\n const next = has ? multipleCurrent.filter((x) => x !== v) : [...multipleCurrent, v];\n if (!multipleControlled) {\n setMultipleInner(next);\n }\n props.onChange?.(next);\n }\n },\n // The handler needs the latest snapshot of every prop — `props` is a\n // discriminated union so spreading it into the deps is the cleanest\n // way to keep both branches honest.\n [type, singleCurrent, multipleCurrent, singleControlled, multipleControlled, props]\n );\n\n const register = useCallback((v: string, ref: RefObject<HTMLElement | null>) => {\n refs.current.set(v, ref);\n if (!orderRef.current.includes(v)) {\n orderRef.current.push(v);\n }\n }, []);\n\n const unregister = useCallback((v: string) => {\n refs.current.delete(v);\n orderRef.current = orderRef.current.filter((x) => x !== v);\n }, []);\n\n const moveFocus = useCallback((offset: 1 | -1, fromValue: string) => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const idx = order.indexOf(fromValue);\n const start = idx === -1 ? 0 : idx;\n const len = order.length;\n const next = order[(start + offset + len) % len];\n if (!next) {\n return;\n }\n refs.current.get(next)?.current?.focus?.();\n }, []);\n\n const focusEdge = useCallback((edge: 'first' | 'last') => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const target = edge === 'first' ? order[0] : order[order.length - 1];\n if (!target) {\n return;\n }\n refs.current.get(target)?.current?.focus?.();\n }, []);\n\n const ctxValue = useMemo<AccordionContextValue>(\n () => ({ baseId, isOpen, toggle, register, unregister, moveFocus, focusEdge }),\n [baseId, isOpen, toggle, register, unregister, moveFocus, focusEdge]\n );\n\n return (\n <AccordionContext.Provider value={ctxValue}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('flex-col w-full', className)}\n style={{ flexDirection: 'column', width: '100%' }}\n >\n {children}\n </View>\n </AccordionContext.Provider>\n );\n};\n\nexport type AccordionItemProps = {\n /** Stable identifier — links the item to `value` / `defaultValue` on the parent. */\n value: string;\n /** Disable expansion of this item. The trigger remains focusable for nav consistency. */\n disabled?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nconst ITEM_BASE: ViewStyle = {\n borderBottomWidth: 1,\n flexDirection: 'column',\n};\n\n// Layout-only constants for the trigger / content; theme-driven sizes are\n// merged in inside the component below.\nconst TRIGGER_LAYOUT_BASE: ViewStyle = {\n minHeight: 44, // component-density literal — not from theme\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n};\n\nconst CONTENT_INNER_LAYOUT_BASE: ViewStyle = {\n // Padding values come from theme inside AccordionContent.\n};\n\n/** A single expandable section. Wraps an `Accordion.Trigger` and `Accordion.Content`. */\nexport const AccordionItem = ({ value, disabled = false, children, className, testID }: AccordionItemProps) => {\n const ctx = useAccordionContext('Accordion.Item');\n const colors = useThemeColors();\n const open = ctx.isOpen(value);\n\n const itemCtx = useMemo<AccordionItemContextValue>(\n () => ({\n value,\n open,\n disabled,\n triggerId: `${ctx.baseId}-trigger-${value}`,\n contentId: `${ctx.baseId}-content-${value}`,\n }),\n [value, open, disabled, ctx.baseId]\n );\n\n return (\n <AccordionItemContext.Provider value={itemCtx}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('flex-col border-b border-semantic-border-default', className)}\n style={[ITEM_BASE, { borderBottomColor: colors.semantic.border.default }]}\n >\n {children}\n </View>\n </AccordionItemContext.Provider>\n );\n};\n\nexport type AccordionTriggerProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * The clickable row that toggles its item open / closed. Renders a real\n * `<button>` (via Pressable) and wires `aria-expanded` + `aria-controls` to\n * the matching `Accordion.Content`.\n */\nexport const AccordionTrigger = ({ children, className, testID }: AccordionTriggerProps) => {\n const ctx = useAccordionContext('Accordion.Trigger');\n const item = useAccordionItemContext('Accordion.Trigger');\n const colors = useThemeColors();\n const ownRef = useRef<HTMLElement | null>(null);\n const triggerStyle: ViewStyle = {\n ...TRIGGER_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['4']),\n paddingVertical: px(colors.spacing['3']),\n gap: px(colors.spacing['3']),\n };\n\n useEffect(() => {\n ctx.register(item.value, ownRef);\n return () => ctx.unregister(item.value);\n }, [ctx, item.value]);\n\n const onPress = useCallback(() => {\n if (item.disabled) {\n return;\n }\n ctx.toggle(item.value);\n }, [ctx, item.value, item.disabled]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n ctx.moveFocus(1, item.value);\n return;\n case 'ArrowUp':\n event.preventDefault();\n ctx.moveFocus(-1, item.value);\n return;\n case 'Home':\n event.preventDefault();\n ctx.focusEdge('first');\n return;\n case 'End':\n event.preventDefault();\n ctx.focusEdge('last');\n return;\n case 'Enter':\n case ' ': {\n event.preventDefault();\n if (!item.disabled) {\n ctx.toggle(item.value);\n }\n return;\n }\n }\n },\n [ctx, item.value, item.disabled]\n );\n\n // CSS transition for the chevron rotation on web. On native, RN expects\n // an array of transform objects (`[{ rotate: '180deg' }]`), so we branch\n // by platform to keep both ends rendering correctly. The web branch also\n // adds a CSS transition for a smooth rotation; native snaps (consumers\n // who want a spring can compose their own).\n const chevronStyle =\n Platform.OS === 'web'\n ? ({\n transition: 'transform 200ms ease',\n transform: `rotate(${item.open ? 180 : 0}deg)`,\n } as unknown as ViewStyle)\n : ({ transform: [{ rotate: item.open ? '180deg' : '0deg' }] } as ViewStyle);\n\n const triggerProps: Record<string, unknown> = {\n ref: (node: HTMLElement | null) => {\n ownRef.current = node;\n },\n role: 'button',\n accessibilityRole: 'button',\n 'aria-expanded': item.open,\n 'aria-controls': item.contentId,\n 'aria-disabled': item.disabled || undefined,\n id: item.triggerId,\n // Every trigger sits in the tab order — pressing Tab moves through\n // the accordion sequentially, then arrow keys take over once focused.\n tabIndex: 0,\n onPress,\n onKeyDown: handleKeyDown,\n ...(item.disabled ? { disabled: true } : {}),\n ...(testID !== undefined ? { testID } : {}),\n };\n\n return (\n <Pressable\n {...triggerProps}\n className={cn(\n 'flex-row items-center justify-between gap-3 px-4 py-3 min-h-[44px] hover:bg-semantic-background-subtle',\n item.disabled ? 'opacity-50' : 'opacity-100',\n className\n )}\n style={[triggerStyle, item.disabled ? { opacity: 0.5 } : null]}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.medium as '500',\n flexShrink: 1,\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n <View aria-hidden={true} style={chevronStyle}>\n <defaultSemanticIcons.chevronDown size={18} color={colors.semantic.text.muted} />\n </View>\n </Pressable>\n );\n};\n\nexport type AccordionContentProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n /**\n * Keep the content mounted even when collapsed. Useful for forms that\n * shouldn't lose state, or content that's expensive to mount.\n * @defaultValue false\n */\n forceMount?: boolean;\n};\n\n// Animation timing — mirrors the Switch slide and the web CSS\n// transition exactly so the accordion feels identical on web and native.\nconst ACCORDION_ANIM_DURATION_MS = 200;\n\n/**\n * The collapsible body. On web it always mounts but slides open / closed\n * via an animated max-height + opacity transition (200ms ease). On native\n * it mounts in a measure-pass on first render to capture the natural\n * content height, then animates `height` + `opacity` via the shared\n * `useAnimatedNumber` primitive (200ms, cubic-bezier(0.16, 1, 0.3, 1) —\n * matches the Switch thumb slide).\n *\n * Implementation note: the web-side height + transition styles are pushed\n * onto the outer wrapper's DOM node via a ref + useEffect rather than\n * through the View's `style` prop. Reason: rn-web's style filter drops\n * keys it doesn't recognise as RN style props (`transition`, `maxHeight`\n * shorthand, etc.), taking the whole fragment with them. Direct DOM\n * mutation bypasses that filter — same trick used by Dialog's backdrop\n * blur.\n */\nexport const AccordionContent = ({\n children,\n className,\n testID,\n forceMount: _forceMount = false,\n}: AccordionContentProps) => {\n const item = useAccordionItemContext('Accordion.Content');\n const colors = useThemeColors();\n const wrapperRef = useRef<HTMLElement | null>(null);\n const innerRef = useRef<HTMLElement | null>(null);\n // Natural (open-state) height of the content, captured on first\n // layout. Re-captured if the layout reports a different size while\n // open (e.g. dynamic content).\n const [measuredHeight, setMeasuredHeight] = useState<number | null>(null);\n const innerStyle: ViewStyle = {\n ...CONTENT_INNER_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['4']),\n paddingTop: px(colors.spacing['1']),\n paddingBottom: px(colors.spacing['3']),\n };\n\n // Slide open/close on web. We measure the natural height of the inner\n // content each time the open state flips, then animate the wrapper's\n // maxHeight to/from 0. Setting maxHeight: 'none' after the transition\n // would let the content grow if it later changes — but for the v0\n // accordion we expect static content, so we leave maxHeight at the\n // measured value (good enough; resize observer can come later).\n useEffect(() => {\n if (Platform.OS !== 'web') {\n return;\n }\n const wrapper = wrapperRef.current;\n const inner = innerRef.current;\n if (!wrapper || !inner) {\n return;\n }\n\n // First-render shortcut: skip the animation when an item starts\n // already open (avoids the \"all items open then animate closed\"\n // flash on mount).\n const isFirstPaint = wrapper.dataset.noriPainted !== '1';\n wrapper.dataset.noriPainted = '1';\n\n wrapper.style.overflow = 'hidden';\n wrapper.style.transitionProperty = 'max-height, opacity';\n wrapper.style.transitionDuration = `${ACCORDION_ANIM_DURATION_MS}ms`;\n wrapper.style.transitionTimingFunction = 'cubic-bezier(0.16, 1, 0.3, 1)';\n\n if (item.open) {\n const target = inner.scrollHeight;\n if (isFirstPaint) {\n wrapper.style.maxHeight = `${target}px`;\n wrapper.style.opacity = '1';\n return;\n }\n // Animate from current measured 0px to the target height.\n wrapper.style.maxHeight = '0px';\n wrapper.style.opacity = '0';\n // Force a reflow so the start state actually applies before\n // we set the end state — otherwise the browser collapses\n // both into a single repaint and skips the animation.\n void wrapper.offsetHeight;\n requestAnimationFrame(() => {\n wrapper.style.maxHeight = `${target}px`;\n wrapper.style.opacity = '1';\n });\n } else {\n // Going from open → closed. Set the explicit current height\n // first so we have something to transition FROM (auto/none\n // doesn't transition).\n const current = inner.scrollHeight;\n wrapper.style.maxHeight = `${current}px`;\n wrapper.style.opacity = '1';\n void wrapper.offsetHeight;\n requestAnimationFrame(() => {\n wrapper.style.maxHeight = '0px';\n wrapper.style.opacity = '0';\n });\n }\n }, [item.open]);\n\n // Native height + opacity animation. Driven by `useAnimatedNumber`,\n // which dispatches per-property to a static-key reanimated worklet\n // (the plugin can't serialize closures over computed keys, so each\n // property gets its own static-key useAnimatedStyle inside the hook).\n //\n // Target values are derived from open + measured size. Before\n // measurement we still call the hooks (hook order must stay\n // stable); they animate to/from 0 which becomes a no-op until the\n // first onLayout fires.\n const targetHeight = item.open ? (measuredHeight ?? 0) : 0;\n const targetOpacity = item.open ? 1 : 0;\n const heightAnim = useAnimatedNumber('height', targetHeight, {\n duration: ACCORDION_ANIM_DURATION_MS,\n });\n const opacityAnim = useAnimatedNumber('opacity', targetOpacity, {\n duration: ACCORDION_ANIM_DURATION_MS,\n });\n\n const onInnerLayout = useCallback(\n (e: LayoutChangeEvent) => {\n if (Platform.OS === 'web') {\n return;\n }\n const next = e.nativeEvent.layout.height;\n if (next > 0 && next !== measuredHeight) {\n setMeasuredHeight(next);\n }\n },\n [measuredHeight]\n );\n\n // Native path: always mount the inner so we can measure its natural\n // height once. Before measurement, we render with `position:\n // absolute, opacity: 0` so the layout pass runs off-screen and\n // doesn't affect the surrounding flow (avoids the \"flash of fully-\n // open content\" on first paint of an initially-closed item).\n // After measurement, the outer Animated.View drives height +\n // opacity together.\n if (Platform.OS !== 'web') {\n const animatedWrapperStyle: ViewStyle = {\n overflow: 'hidden',\n };\n // Pre-measurement: render the inner off-screen for one layout\n // pass. The wrapper claims 0 height in the flow so the next\n // sibling is positioned correctly until we know the real size.\n if (measuredHeight === null) {\n return (\n <AnimatedView\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"none\"\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n style={[animatedWrapperStyle, { height: 0 }]}\n className={cn('overflow-hidden', className)}\n >\n <View\n onLayout={onInnerLayout}\n className={cn('px-4 pt-1 pb-3')}\n // Absolute + left/right:0 stretches the measurement\n // pass to the parent's full width, so wrapping text\n // measures at its REAL natural height. Without\n // left/right, Yoga gives an absolute child width 0\n // and the measurement collapses to a few pixels.\n style={[innerStyle, { position: 'absolute', left: 0, right: 0, opacity: 0 }]}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </AnimatedView>\n );\n }\n return (\n <AnimatedView\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"none\"\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n style={[animatedWrapperStyle, heightAnim as object]}\n className={cn('overflow-hidden', className)}\n >\n <AnimatedView style={opacityAnim as object}>\n {/* No `onLayout` on this inner — once we've captured\n the natural height in the measurement pass above,\n re-measuring here during the animation would see\n the CLIPPED height (the parent is mid-transition\n between 0 and the target) and clobber\n `measuredHeight` with that smaller value, freezing\n the open state at one line. Single-shot measurement\n is fine for static content; remeasuring on content\n change is a follow-up. */}\n <View className={cn('px-4 pt-1 pb-3')} style={innerStyle}>\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </AnimatedView>\n </AnimatedView>\n );\n }\n\n return (\n <View\n ref={(node: unknown) => {\n wrapperRef.current = node as HTMLElement | null;\n }}\n {...(testID !== undefined ? { testID } : {})}\n role=\"region\"\n accessibilityRole=\"none\"\n id={item.contentId}\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n className={cn('overflow-hidden', className)}\n >\n <View\n ref={(node: unknown) => {\n innerRef.current = node as HTMLElement | null;\n }}\n className={cn('px-4 pt-1 pb-3')}\n style={innerStyle}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </View>\n );\n};\n\n/**\n * Public `Accordion` value — the root function plus its `.Item`, `.Trigger`,\n * and `.Content` static members. `Object.assign` produces a value whose\n * inferred type carries the static properties, so `.d.ts` consumers can\n * write `<Accordion.Item>` without a separate import.\n */\nexport const Accordion = Object.assign(AccordionRoot, {\n Item: AccordionItem,\n Trigger: AccordionTrigger,\n Content: AccordionContent,\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/Accordion/Accordion.tsx"],"names":["RNText"],"mappings":";;;;;;;;;;;AAsEA,IAAM,gBAAA,GAAmB,cAA4C,IAAI,CAAA;AAEzE,IAAM,mBAAA,2BAAuB,KAAA,KAAyC;AAClE,EAAA,MAAM,GAAA,GAAM,WAAW,gBAAgB,CAAA;AACvC,EAAA,IAAI,CAAC,GAAA,EAAK;AACN,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,CAAA,EAAI,KAAK,CAAA,yCAAA,CAA2C,CAAA;AAAA,EACxE;AACA,EAAA,OAAO,GAAA;AACX,CAAA,EAN4B,qBAAA,CAAA;AAgB5B,IAAM,oBAAA,GAAuB,cAAgD,IAAI,CAAA;AAEjF,IAAM,uBAAA,2BAA2B,KAAA,KAA6C;AAC1E,EAAA,MAAM,GAAA,GAAM,WAAW,oBAAoB,CAAA;AAC3C,EAAA,IAAI,CAAC,GAAA,EAAK;AACN,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,CAAA,EAAI,KAAK,CAAA,8CAAA,CAAgD,CAAA;AAAA,EAC7E;AACA,EAAA,OAAO,GAAA;AACX,CAAA,EANgC,yBAAA,CAAA;AA2BhC,IAAM,aAAA,2BAAiB,KAAA,KAA0B;AAC7C,EAAA,MAAM,SAAS,KAAA,EAAM;AACrB,EAAA,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AAO,aAAa,QAAA,mBACjB,GAAA;AAAA,YAACA,IAAA;AAAA,YAAA;AAAA,cACG,KAAA,EAAO;AAAA,gBACH,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,KAAA;AAAA,gBAC5B,UAAA,EAAY,OAAO,UAAA,CAAW,IAAA;AAAA,gBAC9B,QAAA,EAAU,EAAA,CAAG,MAAA,CAAO,QAAA,CAAS,EAAE,CAAA;AAAA,gBAC/B,UAAA,EAAY,GAAG,MAAA,CAAO,QAAA,CAAS,EAAE,CAAA,GAAI,MAAA,CAAO,MAAA,CAAO,UAAA,CAAW,MAAM;AAAA,eACxE;AAAA,cAEC;AAAA;AAAA,WACL,GAEA;AAAA;AAAA;AAER;AAAA,GACJ;AAER,CAAA,EAjPgC,kBAAA,CAAA;AAyPzB,IAAM,SAAA,GAAY,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe;AAAA,EAClD,IAAA,EAAM,aAAA;AAAA,EACN,OAAA,EAAS,gBAAA;AAAA,EACT,OAAA,EAAS;AACb,CAAC","file":"chunk-CCUXO2HN.js","sourcesContent":["'use client';\n\nimport {\n createContext,\n type KeyboardEvent,\n type ReactNode,\n type RefObject,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { LayoutChangeEvent, ViewStyle } from 'react-native';\nimport { Platform, Pressable, Text as RNText, View } from 'react-native';\nimport { AnimatedView } from '../../animation/animated-view';\nimport { useAnimatedNumber } from '../../animation/use-animated-number';\nimport { defaultSemanticIcons } from '../../icons/default-semantic-icons';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type AccordionType = 'single' | 'multiple';\n\ntype SingleProps = {\n /** One-at-a-time mode. */\n type: 'single';\n /** Controlled open value. Pass `null` (with `collapsible`) for \"nothing open\". */\n value?: string | null;\n /** Uncontrolled initial open value. */\n defaultValue?: string;\n /** Fires when the open value changes. Receives the new value (string), or `null` if collapsed. */\n onChange?: (next: string | null) => void;\n /** Allow closing the open item by clicking it again. @defaultValue false */\n collapsible?: boolean;\n};\n\ntype MultipleProps = {\n /** Any combination open. */\n type: 'multiple';\n /** Controlled list of open values. */\n value?: string[];\n /** Uncontrolled initial list of open values. */\n defaultValue?: string[];\n /** Fires when the open list changes. Receives the new list. */\n onChange?: (next: string[]) => void;\n /** No-op in `multiple` mode (items are always individually collapsible). */\n collapsible?: never;\n};\n\ntype CommonProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nexport type AccordionProps = (SingleProps | MultipleProps) & CommonProps;\n\ntype AccordionContextValue = {\n baseId: string;\n isOpen: (value: string) => boolean;\n toggle: (value: string) => void;\n register: (value: string, ref: RefObject<HTMLElement | null>) => void;\n unregister: (value: string) => void;\n moveFocus: (offset: 1 | -1, fromValue: string) => void;\n focusEdge: (edge: 'first' | 'last') => void;\n};\n\nconst AccordionContext = createContext<AccordionContextValue | null>(null);\n\nconst useAccordionContext = (label: string): AccordionContextValue => {\n const ctx = useContext(AccordionContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <Accordion>.`);\n }\n return ctx;\n};\n\ntype AccordionItemContextValue = {\n value: string;\n open: boolean;\n disabled: boolean;\n triggerId: string;\n contentId: string;\n};\n\nconst AccordionItemContext = createContext<AccordionItemContextValue | null>(null);\n\nconst useAccordionItemContext = (label: string): AccordionItemContextValue => {\n const ctx = useContext(AccordionItemContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <Accordion.Item>.`);\n }\n return ctx;\n};\n\n/**\n * Vertically stacked, individually expandable sections. Compose:\n *\n * <Accordion type=\"single\" defaultValue=\"overview\" collapsible>\n * <Accordion.Item value=\"overview\">\n * <Accordion.Trigger>Overview</Accordion.Trigger>\n * <Accordion.Content>...</Accordion.Content>\n * </Accordion.Item>\n * </Accordion>\n *\n * Modes:\n * - `single` — at most one item open. Pass `collapsible` to allow closing the\n * open item.\n * - `multiple` — any combination open. `value` / `defaultValue` are arrays.\n *\n * Controlled (`value` + `onChange`) and uncontrolled (`defaultValue`) both\n * supported. Triggers are real `<button>`s with full keyboard nav: ArrowDown /\n * ArrowUp move focus, Home / End jump to first / last, Enter / Space toggle.\n */\nconst AccordionRoot = (props: AccordionProps) => {\n const baseId = useId();\n const refs = useRef<Map<string, RefObject<HTMLElement | null>>>(new Map());\n const orderRef = useRef<string[]>([]);\n\n // Pull out the props we always need; the discriminated union handlers below\n // narrow on `type` for the actual state logic.\n const { type, children, className, testID } = props;\n\n // Single-mode internal state. We always allocate both state slots so the\n // hook order stays stable across re-renders regardless of `type`.\n const [singleInner, setSingleInner] = useState<string | null>(\n type === 'single' ? (props.defaultValue ?? null) : null\n );\n const [multipleInner, setMultipleInner] = useState<string[]>(type === 'multiple' ? (props.defaultValue ?? []) : []);\n\n const singleControlled = type === 'single' && props.value !== undefined;\n const multipleControlled = type === 'multiple' && props.value !== undefined;\n\n const singleCurrent = type === 'single' ? (singleControlled ? (props.value ?? null) : singleInner) : null;\n const multipleCurrent = type === 'multiple' ? (multipleControlled ? (props.value ?? []) : multipleInner) : [];\n\n const isOpen = useCallback(\n (v: string) => {\n if (type === 'single') {\n return singleCurrent === v;\n }\n return multipleCurrent.includes(v);\n },\n [type, singleCurrent, multipleCurrent]\n );\n\n const toggle = useCallback(\n (v: string) => {\n if (type === 'single') {\n const next = singleCurrent === v ? (props.collapsible ? null : singleCurrent) : v;\n if (next === singleCurrent) {\n return;\n }\n if (!singleControlled) {\n setSingleInner(next);\n }\n props.onChange?.(next);\n } else {\n const has = multipleCurrent.includes(v);\n const next = has ? multipleCurrent.filter((x) => x !== v) : [...multipleCurrent, v];\n if (!multipleControlled) {\n setMultipleInner(next);\n }\n props.onChange?.(next);\n }\n },\n // The handler needs the latest snapshot of every prop — `props` is a\n // discriminated union so spreading it into the deps is the cleanest\n // way to keep both branches honest.\n [type, singleCurrent, multipleCurrent, singleControlled, multipleControlled, props]\n );\n\n const register = useCallback((v: string, ref: RefObject<HTMLElement | null>) => {\n refs.current.set(v, ref);\n if (!orderRef.current.includes(v)) {\n orderRef.current.push(v);\n }\n }, []);\n\n const unregister = useCallback((v: string) => {\n refs.current.delete(v);\n orderRef.current = orderRef.current.filter((x) => x !== v);\n }, []);\n\n const moveFocus = useCallback((offset: 1 | -1, fromValue: string) => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const idx = order.indexOf(fromValue);\n const start = idx === -1 ? 0 : idx;\n const len = order.length;\n const next = order[(start + offset + len) % len];\n if (!next) {\n return;\n }\n refs.current.get(next)?.current?.focus?.();\n }, []);\n\n const focusEdge = useCallback((edge: 'first' | 'last') => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const target = edge === 'first' ? order[0] : order[order.length - 1];\n if (!target) {\n return;\n }\n refs.current.get(target)?.current?.focus?.();\n }, []);\n\n const ctxValue = useMemo<AccordionContextValue>(\n () => ({ baseId, isOpen, toggle, register, unregister, moveFocus, focusEdge }),\n [baseId, isOpen, toggle, register, unregister, moveFocus, focusEdge]\n );\n\n return (\n <AccordionContext.Provider value={ctxValue}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('flex-col w-full', className)}\n style={{ flexDirection: 'column', width: '100%' }}\n >\n {children}\n </View>\n </AccordionContext.Provider>\n );\n};\n\nexport type AccordionItemProps = {\n /** Stable identifier — links the item to `value` / `defaultValue` on the parent. */\n value: string;\n /** Disable expansion of this item. The trigger remains focusable for nav consistency. */\n disabled?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nconst ITEM_BASE: ViewStyle = {\n borderBottomWidth: 1,\n flexDirection: 'column',\n};\n\n// Layout-only constants for the trigger / content; theme-driven sizes are\n// merged in inside the component below.\nconst TRIGGER_LAYOUT_BASE: ViewStyle = {\n minHeight: 44, // component-density literal — not from theme\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n};\n\nconst CONTENT_INNER_LAYOUT_BASE: ViewStyle = {\n // Padding values come from theme inside AccordionContent.\n};\n\n/** A single expandable section. Wraps an `Accordion.Trigger` and `Accordion.Content`. */\nexport const AccordionItem = ({ value, disabled = false, children, className, testID }: AccordionItemProps) => {\n const ctx = useAccordionContext('Accordion.Item');\n const colors = useThemeColors();\n const open = ctx.isOpen(value);\n\n const itemCtx = useMemo<AccordionItemContextValue>(\n () => ({\n value,\n open,\n disabled,\n triggerId: `${ctx.baseId}-trigger-${value}`,\n contentId: `${ctx.baseId}-content-${value}`,\n }),\n [value, open, disabled, ctx.baseId]\n );\n\n return (\n <AccordionItemContext.Provider value={itemCtx}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('flex-col border-b border-semantic-border-default', className)}\n style={[ITEM_BASE, { borderBottomColor: colors.semantic.border.default }]}\n >\n {children}\n </View>\n </AccordionItemContext.Provider>\n );\n};\n\nexport type AccordionTriggerProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * The clickable row that toggles its item open / closed. Renders a real\n * `<button>` (via Pressable) and wires `aria-expanded` + `aria-controls` to\n * the matching `Accordion.Content`.\n */\nexport const AccordionTrigger = ({ children, className, testID }: AccordionTriggerProps) => {\n const ctx = useAccordionContext('Accordion.Trigger');\n const item = useAccordionItemContext('Accordion.Trigger');\n const colors = useThemeColors();\n const ownRef = useRef<HTMLElement | null>(null);\n const triggerStyle: ViewStyle = {\n ...TRIGGER_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['4']),\n paddingVertical: px(colors.spacing['3']),\n gap: px(colors.spacing['3']),\n };\n\n useEffect(() => {\n ctx.register(item.value, ownRef);\n return () => ctx.unregister(item.value);\n }, [ctx, item.value]);\n\n const onPress = useCallback(() => {\n if (item.disabled) {\n return;\n }\n ctx.toggle(item.value);\n }, [ctx, item.value, item.disabled]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n ctx.moveFocus(1, item.value);\n return;\n case 'ArrowUp':\n event.preventDefault();\n ctx.moveFocus(-1, item.value);\n return;\n case 'Home':\n event.preventDefault();\n ctx.focusEdge('first');\n return;\n case 'End':\n event.preventDefault();\n ctx.focusEdge('last');\n return;\n case 'Enter':\n case ' ': {\n event.preventDefault();\n if (!item.disabled) {\n ctx.toggle(item.value);\n }\n return;\n }\n }\n },\n [ctx, item.value, item.disabled]\n );\n\n // CSS transition for the chevron rotation on web. On native, RN expects\n // an array of transform objects (`[{ rotate: '180deg' }]`), so we branch\n // by platform to keep both ends rendering correctly. The web branch also\n // adds a CSS transition for a smooth rotation; native snaps (consumers\n // who want a spring can compose their own).\n const chevronStyle =\n Platform.OS === 'web'\n ? ({\n transition: 'transform 200ms ease',\n transform: `rotate(${item.open ? 180 : 0}deg)`,\n } as unknown as ViewStyle)\n : ({ transform: [{ rotate: item.open ? '180deg' : '0deg' }] } as ViewStyle);\n\n const triggerProps: Record<string, unknown> = {\n ref: (node: HTMLElement | null) => {\n ownRef.current = node;\n },\n role: 'button',\n accessibilityRole: 'button',\n 'aria-expanded': item.open,\n 'aria-controls': item.contentId,\n 'aria-disabled': item.disabled || undefined,\n id: item.triggerId,\n // Every trigger sits in the tab order — pressing Tab moves through\n // the accordion sequentially, then arrow keys take over once focused.\n tabIndex: 0,\n onPress,\n onKeyDown: handleKeyDown,\n ...(item.disabled ? { disabled: true } : {}),\n ...(testID !== undefined ? { testID } : {}),\n };\n\n return (\n <Pressable\n {...triggerProps}\n className={cn(\n 'flex-row items-center justify-between gap-3 px-4 py-3 min-h-[44px] hover:bg-semantic-background-subtle',\n item.disabled ? 'opacity-50' : 'opacity-100',\n className\n )}\n style={[triggerStyle, item.disabled ? { opacity: 0.5 } : null]}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.medium as '500',\n flexShrink: 1,\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n <View aria-hidden={true} style={chevronStyle}>\n <defaultSemanticIcons.chevronDown size={18} color={colors.semantic.text.muted} />\n </View>\n </Pressable>\n );\n};\n\nexport type AccordionContentProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n /**\n * Keep the content mounted even when collapsed. Useful for forms that\n * shouldn't lose state, or content that's expensive to mount.\n * @defaultValue false\n */\n forceMount?: boolean;\n};\n\n// Animation timing — mirrors the Switch slide and the web CSS\n// transition exactly so the accordion feels identical on web and native.\nconst ACCORDION_ANIM_DURATION_MS = 200;\n\n/**\n * The collapsible body. On web it always mounts but slides open / closed\n * via an animated max-height + opacity transition (200ms ease). On native\n * it mounts in a measure-pass on first render to capture the natural\n * content height, then animates `height` + `opacity` via the shared\n * `useAnimatedNumber` primitive (200ms, cubic-bezier(0.16, 1, 0.3, 1) —\n * matches the Switch thumb slide).\n *\n * Implementation note: the web-side height + transition styles are pushed\n * onto the outer wrapper's DOM node via a ref + useEffect rather than\n * through the View's `style` prop. Reason: rn-web's style filter drops\n * keys it doesn't recognise as RN style props (`transition`, `maxHeight`\n * shorthand, etc.), taking the whole fragment with them. Direct DOM\n * mutation bypasses that filter — same trick used by Dialog's backdrop\n * blur.\n */\nexport const AccordionContent = ({\n children,\n className,\n testID,\n forceMount: _forceMount = false,\n}: AccordionContentProps) => {\n const item = useAccordionItemContext('Accordion.Content');\n const colors = useThemeColors();\n const wrapperRef = useRef<HTMLElement | null>(null);\n const innerRef = useRef<HTMLElement | null>(null);\n // Natural (open-state) height of the content, captured on first\n // layout. Re-captured if the layout reports a different size while\n // open (e.g. dynamic content).\n const [measuredHeight, setMeasuredHeight] = useState<number | null>(null);\n const innerStyle: ViewStyle = {\n ...CONTENT_INNER_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['4']),\n paddingTop: px(colors.spacing['1']),\n paddingBottom: px(colors.spacing['3']),\n };\n\n // Slide open/close on web. We measure the natural height of the inner\n // content each time the open state flips, then animate the wrapper's\n // maxHeight to/from 0. Setting maxHeight: 'none' after the transition\n // would let the content grow if it later changes — but for the v0\n // accordion we expect static content, so we leave maxHeight at the\n // measured value (good enough; resize observer can come later).\n useEffect(() => {\n if (Platform.OS !== 'web') {\n return;\n }\n const wrapper = wrapperRef.current;\n const inner = innerRef.current;\n if (!wrapper || !inner) {\n return;\n }\n\n // First-render shortcut: skip the animation when an item starts\n // already open (avoids the \"all items open then animate closed\"\n // flash on mount).\n const isFirstPaint = wrapper.dataset.noriPainted !== '1';\n wrapper.dataset.noriPainted = '1';\n\n wrapper.style.overflow = 'hidden';\n wrapper.style.transitionProperty = 'max-height, opacity';\n wrapper.style.transitionDuration = `${ACCORDION_ANIM_DURATION_MS}ms`;\n wrapper.style.transitionTimingFunction = 'cubic-bezier(0.16, 1, 0.3, 1)';\n\n if (item.open) {\n const target = inner.scrollHeight;\n if (isFirstPaint) {\n wrapper.style.maxHeight = `${target}px`;\n wrapper.style.opacity = '1';\n return;\n }\n // Animate from current measured 0px to the target height.\n wrapper.style.maxHeight = '0px';\n wrapper.style.opacity = '0';\n // Force a reflow so the start state actually applies before\n // we set the end state — otherwise the browser collapses\n // both into a single repaint and skips the animation.\n void wrapper.offsetHeight;\n requestAnimationFrame(() => {\n wrapper.style.maxHeight = `${target}px`;\n wrapper.style.opacity = '1';\n });\n } else {\n // Going from open → closed. Set the explicit current height\n // first so we have something to transition FROM (auto/none\n // doesn't transition).\n const current = inner.scrollHeight;\n wrapper.style.maxHeight = `${current}px`;\n wrapper.style.opacity = '1';\n void wrapper.offsetHeight;\n requestAnimationFrame(() => {\n wrapper.style.maxHeight = '0px';\n wrapper.style.opacity = '0';\n });\n }\n }, [item.open]);\n\n // Native height + opacity animation. Driven by `useAnimatedNumber`,\n // which dispatches per-property to a static-key reanimated worklet\n // (the plugin can't serialize closures over computed keys, so each\n // property gets its own static-key useAnimatedStyle inside the hook).\n //\n // Target values are derived from open + measured size. Before\n // measurement we still call the hooks (hook order must stay\n // stable); they animate to/from 0 which becomes a no-op until the\n // first onLayout fires.\n const targetHeight = item.open ? (measuredHeight ?? 0) : 0;\n const targetOpacity = item.open ? 1 : 0;\n const heightAnim = useAnimatedNumber('height', targetHeight, {\n duration: ACCORDION_ANIM_DURATION_MS,\n });\n const opacityAnim = useAnimatedNumber('opacity', targetOpacity, {\n duration: ACCORDION_ANIM_DURATION_MS,\n });\n\n const onInnerLayout = useCallback(\n (e: LayoutChangeEvent) => {\n if (Platform.OS === 'web') {\n return;\n }\n const next = e.nativeEvent.layout.height;\n if (next > 0 && next !== measuredHeight) {\n setMeasuredHeight(next);\n }\n },\n [measuredHeight]\n );\n\n // Native path: always mount the inner so we can measure its natural\n // height once. Before measurement, we render with `position:\n // absolute, opacity: 0` so the layout pass runs off-screen and\n // doesn't affect the surrounding flow (avoids the \"flash of fully-\n // open content\" on first paint of an initially-closed item).\n // After measurement, the outer Animated.View drives height +\n // opacity together.\n if (Platform.OS !== 'web') {\n const animatedWrapperStyle: ViewStyle = {\n overflow: 'hidden',\n };\n // Pre-measurement: render the inner off-screen for one layout\n // pass. The wrapper claims 0 height in the flow so the next\n // sibling is positioned correctly until we know the real size.\n if (measuredHeight === null) {\n return (\n <AnimatedView\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"none\"\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n style={[animatedWrapperStyle, { height: 0 }]}\n className={cn('overflow-hidden', className)}\n >\n <View\n onLayout={onInnerLayout}\n className={cn('px-4 pt-1 pb-3')}\n // Absolute + left/right:0 stretches the measurement\n // pass to the parent's full width, so wrapping text\n // measures at its REAL natural height. Without\n // left/right, Yoga gives an absolute child width 0\n // and the measurement collapses to a few pixels.\n style={[innerStyle, { position: 'absolute', left: 0, right: 0, opacity: 0 }]}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </AnimatedView>\n );\n }\n return (\n <AnimatedView\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"none\"\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n style={[animatedWrapperStyle, heightAnim as object]}\n className={cn('overflow-hidden', className)}\n >\n <AnimatedView style={opacityAnim as object}>\n {/* No `onLayout` on this inner — once we've captured\n the natural height in the measurement pass above,\n re-measuring here during the animation would see\n the CLIPPED height (the parent is mid-transition\n between 0 and the target) and clobber\n `measuredHeight` with that smaller value, freezing\n the open state at one line. Single-shot measurement\n is fine for static content; remeasuring on content\n change is a follow-up. */}\n <View className={cn('px-4 pt-1 pb-3')} style={innerStyle}>\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </AnimatedView>\n </AnimatedView>\n );\n }\n\n return (\n <View\n ref={(node: unknown) => {\n wrapperRef.current = node as HTMLElement | null;\n }}\n {...(testID !== undefined ? { testID } : {})}\n role=\"region\"\n accessibilityRole=\"none\"\n id={item.contentId}\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n className={cn('overflow-hidden', className)}\n >\n <View\n ref={(node: unknown) => {\n innerRef.current = node as HTMLElement | null;\n }}\n className={cn('px-4 pt-1 pb-3')}\n style={innerStyle}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </View>\n );\n};\n\n/**\n * Public `Accordion` value — the root function plus its `.Item`, `.Trigger`,\n * and `.Content` static members. `Object.assign` produces a value whose\n * inferred type carries the static properties, so `.d.ts` consumers can\n * write `<Accordion.Item>` without a separate import.\n */\nexport const Accordion = Object.assign(AccordionRoot, {\n Item: AccordionItem,\n Trigger: AccordionTrigger,\n Content: AccordionContent,\n});\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Spinner } from './chunk-ACLHDHX3.js';
|
|
2
|
-
import { useTranslation } from './chunk-
|
|
2
|
+
import { useTranslation } from './chunk-GJMHNEQ3.js';
|
|
3
3
|
import { px } from './chunk-5A2QOOVN.js';
|
|
4
4
|
import { useThemeColors } from './chunk-R5JMDDCB.js';
|
|
5
5
|
import { __name } from './chunk-WCQVDF3K.js';
|
|
@@ -282,5 +282,5 @@ var Field = Object.assign(FieldRoot, {
|
|
|
282
282
|
});
|
|
283
283
|
|
|
284
284
|
export { Field };
|
|
285
|
-
//# sourceMappingURL=chunk-
|
|
286
|
-
//# sourceMappingURL=chunk-
|
|
285
|
+
//# sourceMappingURL=chunk-CPIKN4BX.js.map
|
|
286
|
+
//# sourceMappingURL=chunk-CPIKN4BX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Field/Field.tsx"],"names":["RNText"],"mappings":";;;;;;;;;AAqCA,IAAM,YAAA,GAAe,cAAwC,IAAI,CAAA;AAEjE,IAAM,qBAAA,2BAAyB,MAAA,KAAsC;AACjE,EAAA,MAAM,GAAA,GAAM,WAAW,YAAY,CAAA;AACnC,EAAA,IAAI,CAAC,GAAA,EAAK;AACN,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,QAAA,EAAW,MAAM,CAAA,8CAAA,CAAgD,CAAA;AAAA,EACrF;AACA,EAAA,OAAO,GAAA;AACX,CAAA,EAN8B,uBAAA,CAAA;AAQ9B,IAAM,mBAAA,mBAAsB,MAAA,CAAA,CAAC,KAAA,EAAkB,IAAA,KAA0B;AACrE,EAAA,IAAI,CAAC,cAAA,CAAe,KAAK,CAAA,EAAG;AACxB,IAAA,OAAO,KAAA;AAAA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P,WAAA,EAAa,gBAAA;AAAA,EACb,OAAA,EAAS,YAAA;AAAA,EACT,KAAA,EAAO,UAAA;AAAA,EACP,KAAA,EAAO;AACX,CAAC","file":"chunk-2UXKXUX2.js","sourcesContent":["'use client';\n\nimport {\n Children,\n cloneElement,\n createContext,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n} from 'react';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { useTranslation } from '../../i18n/use-translation';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { Spinner } from '../Spinner';\n\ntype FieldContextValue = {\n fieldId: string;\n labelId: string;\n descriptionId: string;\n errorId: string;\n hasError: boolean;\n hasDescription: boolean;\n describedBy: string | undefined;\n disabled: boolean;\n required: boolean;\n validating: boolean;\n name?: string;\n error?: string | null;\n isGroup: boolean;\n};\n\nconst FieldContext = createContext<FieldContextValue | null>(null);\n\nconst useFieldContextStrict = (caller: string): FieldContextValue => {\n const ctx = useContext(FieldContext);\n if (!ctx) {\n throw new Error(`[Field] ${caller} must be used inside <Field> or <Field.Group>.`);\n }\n return ctx;\n};\n\nconst childHasDisplayName = (child: ReactNode, name: string): boolean => {\n if (!isValidElement(child)) {\n return false;\n }\n const t = child.type as { displayName?: string } | string;\n return typeof t !== 'string' && t?.displayName === name;\n};\n\n/** Display names that mark a compound-mode child. */\nconst COMPOUND_DISPLAY_NAMES = ['Field.Label', 'Field.Description', 'Field.Error', 'Field.Control'];\n\nconst isCompoundChild = (child: ReactNode): boolean =>\n COMPOUND_DISPLAY_NAMES.some((name) => childHasDisplayName(child, name));\n\nexport type FieldProps = {\n // Shorthand slot props\n label?: ReactNode;\n description?: ReactNode;\n error?: ReactNode;\n\n // State flags\n name?: string;\n required?: boolean;\n disabled?: boolean;\n validating?: boolean;\n\n // Layout\n orientation?: 'vertical' | 'horizontal';\n id?: string;\n\n children: ReactNode;\n className?: string;\n testID?: string;\n};\n\ntype FieldRootInternalProps = FieldProps & { isGroup?: boolean };\n\nconst FieldRoot = ({\n name,\n required = false,\n disabled = false,\n error = null,\n label,\n description,\n validating = false,\n orientation = 'vertical',\n id,\n children,\n className,\n testID,\n isGroup = false,\n}: FieldRootInternalProps) => {\n const colors = useThemeColors();\n const reactId = useId();\n const fieldId = id ?? `nori-ui-field-${reactId}`;\n const labelId = `${fieldId}-label`;\n const descriptionId = `${fieldId}-desc`;\n const errorId = `${fieldId}-error`;\n\n // ---------- mode detection ----------\n const isCompoundMode = useMemo(() => {\n let found = false;\n Children.forEach(children, (child) => {\n if (isCompoundChild(child)) {\n found = true;\n }\n });\n return found;\n }, [children]);\n\n // ---------- derive hasDescription / hasError ----------\n const hasDescription = useMemo(() => {\n if (!isCompoundMode) {\n return description !== undefined && description !== null && description !== false && description !== '';\n }\n let found = false;\n Children.forEach(children, (child) => {\n if (childHasDisplayName(child, 'Field.Description')) {\n found = true;\n }\n });\n return found;\n }, [isCompoundMode, description, children]);\n\n const hasError = useMemo(() => {\n if (!isCompoundMode) {\n return Boolean(error);\n }\n // compound mode: scan for Field.Error child with truthy children\n let found = false;\n Children.forEach(children, (child) => {\n if (childHasDisplayName(child, 'Field.Error') && isValidElement(child)) {\n const el = child as ReactElement<{ children?: ReactNode }>;\n if (\n el.props.children !== undefined &&\n el.props.children !== null &&\n el.props.children !== false &&\n el.props.children !== ''\n ) {\n found = true;\n }\n }\n });\n // also check the legacy `error` prop usage in compound mode\n if (!found && error !== null && error !== undefined && error !== false && error !== '') {\n found = true;\n }\n return found;\n }, [isCompoundMode, error, children]);\n\n const describedBy = useMemo(() => {\n const ids: string[] = [];\n if (hasDescription) {\n ids.push(descriptionId);\n }\n if (hasError) {\n ids.push(errorId);\n }\n return ids.length === 0 ? undefined : ids.join(' ');\n }, [hasDescription, hasError, descriptionId, errorId]);\n\n const value: FieldContextValue = {\n fieldId,\n labelId,\n descriptionId,\n errorId,\n hasError,\n hasDescription,\n describedBy,\n disabled,\n required,\n validating,\n ...(name !== undefined ? { name } : {}),\n // In compound mode pass `error` (string) so Field.Error can fall back to it.\n // In shorthand mode the error prop may be ReactNode; only pass when it is a string/null.\n ...(error !== null && error !== undefined && typeof error === 'string' ? { error } : {}),\n isGroup,\n };\n\n // ---------- dev warning for mixed usage ----------\n const warnedRef = useRef(false);\n useEffect(() => {\n if (process.env.NODE_ENV === 'production' || warnedRef.current) {\n return;\n }\n const hasShorthand = label !== undefined || description !== undefined || error !== undefined;\n if (hasShorthand && isCompoundMode) {\n warnedRef.current = true;\n // biome-ignore lint/suspicious/noConsole: intentional dev-mode warning\n console.warn(\n '[Field] Mixing shorthand props (label/description/error) with compound children (Field.Label/Field.Description/Field.Error) is not supported. The compound children will win. To suppress this warning, use only one mode.'\n );\n }\n }, [label, description, error, isCompoundMode]);\n\n // ---------- layout ----------\n const containerStyle =\n orientation === 'horizontal'\n ? {\n flexDirection: 'row' as const,\n alignItems: 'flex-start' as const,\n gap: px(colors.spacing['3']),\n }\n : { flexDirection: 'column' as const, gap: px(colors.spacing['1']) };\n\n const containerExtra: Record<string, unknown> = {};\n if (testID !== undefined) {\n containerExtra.testID = testID;\n }\n containerExtra['data-orientation'] = orientation;\n if (isGroup) {\n containerExtra.role = 'group';\n containerExtra['aria-labelledby'] = labelId;\n containerExtra.accessibilityRole = 'none';\n }\n if (validating) {\n containerExtra['data-validating'] = '';\n containerExtra['aria-busy'] = true;\n }\n\n // ---------- shorthand mode rendering ----------\n const renderShorthand = () => {\n // Determine if there's exactly one non-Field.* child we can auto-wrap.\n const childArray = Children.toArray(children);\n const controlChild =\n childArray.length === 1 && isValidElement(childArray[0]) ? (childArray[0] as ReactElement) : null;\n\n return (\n <>\n {label !== undefined && label !== null && label !== false ? <FieldLabel>{label}</FieldLabel> : null}\n {description !== undefined && description !== null && description !== false && description !== '' ? (\n <FieldDescription>{description}</FieldDescription>\n ) : null}\n {controlChild !== null ? <FieldControl>{controlChild}</FieldControl> : children}\n {error !== undefined && error !== null && error !== false && error !== '' ? (\n <FieldError>{error}</FieldError>\n ) : null}\n </>\n );\n };\n\n return (\n <FieldContext.Provider value={value}>\n <View style={containerStyle} {...(className !== undefined ? { className } : {})} {...containerExtra}>\n {isCompoundMode ? children : renderShorthand()}\n {validating ? <Spinner size=\"sm\" /> : null}\n </View>\n </FieldContext.Provider>\n );\n};\n\nconst FieldLabel = ({ children }: { children: ReactNode }) => {\n const ctx = useFieldContextStrict('Field.Label');\n const colors = useThemeColors();\n const { t } = useTranslation();\n const requiredIndicator = t('field.requiredIndicator');\n const requiredLabel = t('field.requiredLabel');\n\n const focusInput = () => {\n if (typeof document !== 'undefined') {\n const el = document.getElementById(ctx.fieldId);\n if (el && typeof (el as HTMLElement).focus === 'function') {\n (el as HTMLElement).focus();\n }\n }\n };\n\n return (\n <Pressable onPress={focusInput} accessibilityRole=\"none\" disabled={ctx.disabled}>\n <RNText\n nativeID={ctx.labelId}\n {...({ id: ctx.labelId } as Record<string, unknown>)}\n accessibilityRole=\"text\"\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.medium as '500',\n color: ctx.disabled ? colors.semantic.text.muted : colors.semantic.text.default,\n }}\n >\n {children}\n {ctx.required ? (\n <RNText\n accessibilityLabel={requiredLabel}\n {...({ 'aria-label': requiredLabel } as Record<string, unknown>)}\n style={{ color: colors.color.danger }}\n >\n {` ${requiredIndicator}`}\n </RNText>\n ) : null}\n </RNText>\n </Pressable>\n );\n};\nFieldLabel.displayName = 'Field.Label';\n\nconst FieldControl = ({ children }: { children: ReactElement }) => {\n const ctx = useFieldContextStrict('Field.Control');\n if (Children.count(children) !== 1 || !isValidElement(children)) {\n throw new Error('[Field.Control] expects exactly one child element.');\n }\n const child = children as ReactElement<Record<string, unknown>>;\n const merged: Record<string, unknown> = {\n id: child.props.id ?? ctx.fieldId,\n accessibilityLabelledBy: ctx.labelId,\n 'aria-labelledby': ctx.labelId,\n };\n if (ctx.name !== undefined && child.props.name === undefined) {\n merged.name = ctx.name;\n }\n if (ctx.describedBy !== undefined) {\n merged['aria-describedby'] = ctx.describedBy;\n merged.accessibilityDescribedBy = ctx.describedBy;\n }\n if (ctx.hasError) {\n merged['aria-invalid'] = true;\n }\n if (ctx.required) {\n merged['aria-required'] = true;\n }\n if (ctx.disabled || child.props.disabled) {\n merged.disabled = true;\n }\n return cloneElement(child, merged);\n};\nFieldControl.displayName = 'Field.Control';\n\nconst FieldDescription = ({ children }: { children: ReactNode }) => {\n const ctx = useFieldContextStrict('Field.Description');\n const colors = useThemeColors();\n return (\n <RNText\n nativeID={ctx.descriptionId}\n {...({ id: ctx.descriptionId } as Record<string, unknown>)}\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n }}\n >\n {children}\n </RNText>\n );\n};\nFieldDescription.displayName = 'Field.Description';\n\nconst FieldError = ({ children }: { children?: ReactNode }) => {\n const ctx = useFieldContextStrict('Field.Error');\n const colors = useThemeColors();\n const content = children ?? ctx.error;\n if (content === null || content === undefined || content === '' || content === false) {\n return null;\n }\n return (\n <RNText\n nativeID={ctx.errorId}\n {...({ id: ctx.errorId, role: 'alert' } as Record<string, unknown>)}\n accessibilityRole=\"text\"\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.color.danger,\n }}\n >\n {content}\n </RNText>\n );\n};\nFieldError.displayName = 'Field.Error';\n\nexport type FieldGroupProps = Omit<FieldProps, 'name'>;\n\nconst FieldGroup = (props: FieldGroupProps) => <FieldRoot {...(props as FieldProps)} isGroup />;\nFieldGroup.displayName = 'Field.Group';\n\nexport const Field = Object.assign(FieldRoot as (props: FieldProps) => ReactElement, {\n Label: FieldLabel,\n Description: FieldDescription,\n Control: FieldControl,\n Error: FieldError,\n Group: FieldGroup,\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/Field/Field.tsx"],"names":["RNText"],"mappings":";;;;;;;;;AAqCA,IAAM,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,MAAA,CAAO,QAAA,CAAS,EAAE,CAAA;AAAA,QAC/B,KAAA,EAAO,OAAO,KAAA,CAAM;AAAA,OACxB;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACL;AAER,CAAA,EArBmB,YAAA,CAAA;AAsBnB,UAAA,CAAW,WAAA,GAAc,aAAA;AAIzB,IAAM,UAAA,2BAAc,KAAA,qBAA2B,GAAA,CAAC,aAAW,GAAI,KAAA,EAAsB,OAAA,EAAO,IAAA,EAAC,CAAA,EAA1E,YAAA,CAAA;AACnB,UAAA,CAAW,WAAA,GAAc,aAAA;AAElB,IAAM,KAAA,GAAQ,MAAA,CAAO,MAAA,CAAO,SAAA,EAAkD;AAAA,EACjF,KAAA,EAAO,UAAA;AAAA,EACP,WAAA,EAAa,gBAAA;AAAA,EACb,OAAA,EAAS,YAAA;AAAA,EACT,KAAA,EAAO,UAAA;AAAA,EACP,KAAA,EAAO;AACX,CAAC","file":"chunk-CPIKN4BX.js","sourcesContent":["'use client';\n\nimport {\n Children,\n cloneElement,\n createContext,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n} from 'react';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { useTranslation } from '../../i18n/use-translation';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { Spinner } from '../Spinner';\n\ntype FieldContextValue = {\n fieldId: string;\n labelId: string;\n descriptionId: string;\n errorId: string;\n hasError: boolean;\n hasDescription: boolean;\n describedBy: string | undefined;\n disabled: boolean;\n required: boolean;\n validating: boolean;\n name?: string;\n error?: string | null;\n isGroup: boolean;\n};\n\nconst FieldContext = createContext<FieldContextValue | null>(null);\n\nconst useFieldContextStrict = (caller: string): FieldContextValue => {\n const ctx = useContext(FieldContext);\n if (!ctx) {\n throw new Error(`[Field] ${caller} must be used inside <Field> or <Field.Group>.`);\n }\n return ctx;\n};\n\nconst childHasDisplayName = (child: ReactNode, name: string): boolean => {\n if (!isValidElement(child)) {\n return false;\n }\n const t = child.type as { displayName?: string } | string;\n return typeof t !== 'string' && t?.displayName === name;\n};\n\n/** Display names that mark a compound-mode child. */\nconst COMPOUND_DISPLAY_NAMES = ['Field.Label', 'Field.Description', 'Field.Error', 'Field.Control'];\n\nconst isCompoundChild = (child: ReactNode): boolean =>\n COMPOUND_DISPLAY_NAMES.some((name) => childHasDisplayName(child, name));\n\nexport type FieldProps = {\n // Shorthand slot props\n label?: ReactNode;\n description?: ReactNode;\n error?: ReactNode;\n\n // State flags\n name?: string;\n required?: boolean;\n disabled?: boolean;\n validating?: boolean;\n\n // Layout\n orientation?: 'vertical' | 'horizontal';\n id?: string;\n\n children: ReactNode;\n className?: string;\n testID?: string;\n};\n\ntype FieldRootInternalProps = FieldProps & { isGroup?: boolean };\n\nconst FieldRoot = ({\n name,\n required = false,\n disabled = false,\n error = null,\n label,\n description,\n validating = false,\n orientation = 'vertical',\n id,\n children,\n className,\n testID,\n isGroup = false,\n}: FieldRootInternalProps) => {\n const colors = useThemeColors();\n const reactId = useId();\n const fieldId = id ?? `nori-ui-field-${reactId}`;\n const labelId = `${fieldId}-label`;\n const descriptionId = `${fieldId}-desc`;\n const errorId = `${fieldId}-error`;\n\n // ---------- mode detection ----------\n const isCompoundMode = useMemo(() => {\n let found = false;\n Children.forEach(children, (child) => {\n if (isCompoundChild(child)) {\n found = true;\n }\n });\n return found;\n }, [children]);\n\n // ---------- derive hasDescription / hasError ----------\n const hasDescription = useMemo(() => {\n if (!isCompoundMode) {\n return description !== undefined && description !== null && description !== false && description !== '';\n }\n let found = false;\n Children.forEach(children, (child) => {\n if (childHasDisplayName(child, 'Field.Description')) {\n found = true;\n }\n });\n return found;\n }, [isCompoundMode, description, children]);\n\n const hasError = useMemo(() => {\n if (!isCompoundMode) {\n return Boolean(error);\n }\n // compound mode: scan for Field.Error child with truthy children\n let found = false;\n Children.forEach(children, (child) => {\n if (childHasDisplayName(child, 'Field.Error') && isValidElement(child)) {\n const el = child as ReactElement<{ children?: ReactNode }>;\n if (\n el.props.children !== undefined &&\n el.props.children !== null &&\n el.props.children !== false &&\n el.props.children !== ''\n ) {\n found = true;\n }\n }\n });\n // also check the legacy `error` prop usage in compound mode\n if (!found && error !== null && error !== undefined && error !== false && error !== '') {\n found = true;\n }\n return found;\n }, [isCompoundMode, error, children]);\n\n const describedBy = useMemo(() => {\n const ids: string[] = [];\n if (hasDescription) {\n ids.push(descriptionId);\n }\n if (hasError) {\n ids.push(errorId);\n }\n return ids.length === 0 ? undefined : ids.join(' ');\n }, [hasDescription, hasError, descriptionId, errorId]);\n\n const value: FieldContextValue = {\n fieldId,\n labelId,\n descriptionId,\n errorId,\n hasError,\n hasDescription,\n describedBy,\n disabled,\n required,\n validating,\n ...(name !== undefined ? { name } : {}),\n // In compound mode pass `error` (string) so Field.Error can fall back to it.\n // In shorthand mode the error prop may be ReactNode; only pass when it is a string/null.\n ...(error !== null && error !== undefined && typeof error === 'string' ? { error } : {}),\n isGroup,\n };\n\n // ---------- dev warning for mixed usage ----------\n const warnedRef = useRef(false);\n useEffect(() => {\n if (process.env.NODE_ENV === 'production' || warnedRef.current) {\n return;\n }\n const hasShorthand = label !== undefined || description !== undefined || error !== undefined;\n if (hasShorthand && isCompoundMode) {\n warnedRef.current = true;\n // biome-ignore lint/suspicious/noConsole: intentional dev-mode warning\n console.warn(\n '[Field] Mixing shorthand props (label/description/error) with compound children (Field.Label/Field.Description/Field.Error) is not supported. The compound children will win. To suppress this warning, use only one mode.'\n );\n }\n }, [label, description, error, isCompoundMode]);\n\n // ---------- layout ----------\n const containerStyle =\n orientation === 'horizontal'\n ? {\n flexDirection: 'row' as const,\n alignItems: 'flex-start' as const,\n gap: px(colors.spacing['3']),\n }\n : { flexDirection: 'column' as const, gap: px(colors.spacing['1']) };\n\n const containerExtra: Record<string, unknown> = {};\n if (testID !== undefined) {\n containerExtra.testID = testID;\n }\n containerExtra['data-orientation'] = orientation;\n if (isGroup) {\n containerExtra.role = 'group';\n containerExtra['aria-labelledby'] = labelId;\n containerExtra.accessibilityRole = 'none';\n }\n if (validating) {\n containerExtra['data-validating'] = '';\n containerExtra['aria-busy'] = true;\n }\n\n // ---------- shorthand mode rendering ----------\n const renderShorthand = () => {\n // Determine if there's exactly one non-Field.* child we can auto-wrap.\n const childArray = Children.toArray(children);\n const controlChild =\n childArray.length === 1 && isValidElement(childArray[0]) ? (childArray[0] as ReactElement) : null;\n\n return (\n <>\n {label !== undefined && label !== null && label !== false ? <FieldLabel>{label}</FieldLabel> : null}\n {description !== undefined && description !== null && description !== false && description !== '' ? (\n <FieldDescription>{description}</FieldDescription>\n ) : null}\n {controlChild !== null ? <FieldControl>{controlChild}</FieldControl> : children}\n {error !== undefined && error !== null && error !== false && error !== '' ? (\n <FieldError>{error}</FieldError>\n ) : null}\n </>\n );\n };\n\n return (\n <FieldContext.Provider value={value}>\n <View style={containerStyle} {...(className !== undefined ? { className } : {})} {...containerExtra}>\n {isCompoundMode ? children : renderShorthand()}\n {validating ? <Spinner size=\"sm\" /> : null}\n </View>\n </FieldContext.Provider>\n );\n};\n\nconst FieldLabel = ({ children }: { children: ReactNode }) => {\n const ctx = useFieldContextStrict('Field.Label');\n const colors = useThemeColors();\n const { t } = useTranslation();\n const requiredIndicator = t('field.requiredIndicator');\n const requiredLabel = t('field.requiredLabel');\n\n const focusInput = () => {\n if (typeof document !== 'undefined') {\n const el = document.getElementById(ctx.fieldId);\n if (el && typeof (el as HTMLElement).focus === 'function') {\n (el as HTMLElement).focus();\n }\n }\n };\n\n return (\n <Pressable onPress={focusInput} accessibilityRole=\"none\" disabled={ctx.disabled}>\n <RNText\n nativeID={ctx.labelId}\n {...({ id: ctx.labelId } as Record<string, unknown>)}\n accessibilityRole=\"text\"\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.medium as '500',\n color: ctx.disabled ? colors.semantic.text.muted : colors.semantic.text.default,\n }}\n >\n {children}\n {ctx.required ? (\n <RNText\n accessibilityLabel={requiredLabel}\n {...({ 'aria-label': requiredLabel } as Record<string, unknown>)}\n style={{ color: colors.color.danger }}\n >\n {` ${requiredIndicator}`}\n </RNText>\n ) : null}\n </RNText>\n </Pressable>\n );\n};\nFieldLabel.displayName = 'Field.Label';\n\nconst FieldControl = ({ children }: { children: ReactElement }) => {\n const ctx = useFieldContextStrict('Field.Control');\n if (Children.count(children) !== 1 || !isValidElement(children)) {\n throw new Error('[Field.Control] expects exactly one child element.');\n }\n const child = children as ReactElement<Record<string, unknown>>;\n const merged: Record<string, unknown> = {\n id: child.props.id ?? ctx.fieldId,\n accessibilityLabelledBy: ctx.labelId,\n 'aria-labelledby': ctx.labelId,\n };\n if (ctx.name !== undefined && child.props.name === undefined) {\n merged.name = ctx.name;\n }\n if (ctx.describedBy !== undefined) {\n merged['aria-describedby'] = ctx.describedBy;\n merged.accessibilityDescribedBy = ctx.describedBy;\n }\n if (ctx.hasError) {\n merged['aria-invalid'] = true;\n }\n if (ctx.required) {\n merged['aria-required'] = true;\n }\n if (ctx.disabled || child.props.disabled) {\n merged.disabled = true;\n }\n return cloneElement(child, merged);\n};\nFieldControl.displayName = 'Field.Control';\n\nconst FieldDescription = ({ children }: { children: ReactNode }) => {\n const ctx = useFieldContextStrict('Field.Description');\n const colors = useThemeColors();\n return (\n <RNText\n nativeID={ctx.descriptionId}\n {...({ id: ctx.descriptionId } as Record<string, unknown>)}\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n }}\n >\n {children}\n </RNText>\n );\n};\nFieldDescription.displayName = 'Field.Description';\n\nconst FieldError = ({ children }: { children?: ReactNode }) => {\n const ctx = useFieldContextStrict('Field.Error');\n const colors = useThemeColors();\n const content = children ?? ctx.error;\n if (content === null || content === undefined || content === '' || content === false) {\n return null;\n }\n return (\n <RNText\n nativeID={ctx.errorId}\n {...({ id: ctx.errorId, role: 'alert' } as Record<string, unknown>)}\n accessibilityRole=\"text\"\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.color.danger,\n }}\n >\n {content}\n </RNText>\n );\n};\nFieldError.displayName = 'Field.Error';\n\nexport type FieldGroupProps = Omit<FieldProps, 'name'>;\n\nconst FieldGroup = (props: FieldGroupProps) => <FieldRoot {...(props as FieldProps)} isGroup />;\nFieldGroup.displayName = 'Field.Group';\n\nexport const Field = Object.assign(FieldRoot as (props: FieldProps) => ReactElement, {\n Label: FieldLabel,\n Description: FieldDescription,\n Control: FieldControl,\n Error: FieldError,\n Group: FieldGroup,\n});\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defaultSemanticIcons } from './chunk-7Z4NMNX6.js';
|
|
2
|
-
import { cn } from './chunk-CHXHRJNZ.js';
|
|
3
2
|
import { px } from './chunk-5A2QOOVN.js';
|
|
3
|
+
import { cn } from './chunk-CHXHRJNZ.js';
|
|
4
4
|
import { useThemeColors, useColorScheme } from './chunk-R5JMDDCB.js';
|
|
5
5
|
import { __name } from './chunk-WCQVDF3K.js';
|
|
6
6
|
import { View, Text, Pressable } from 'react-native';
|
|
@@ -184,5 +184,5 @@ var Alert = /* @__PURE__ */ __name(({
|
|
|
184
184
|
}, "Alert");
|
|
185
185
|
|
|
186
186
|
export { Alert };
|
|
187
|
-
//# sourceMappingURL=chunk-
|
|
188
|
-
//# sourceMappingURL=chunk-
|
|
187
|
+
//# sourceMappingURL=chunk-DDGMLLS3.js.map
|
|
188
|
+
//# sourceMappingURL=chunk-DDGMLLS3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Alert/Alert.tsx"],"names":["RNText"],"mappings":";;;;;;;;AA+CA,SAAS,YAAA,CACL,MAAA,EACA,OAAA,EACA,OAAA,EACA,SACA,MAAA,EAC8B;AAC9B,EAAA,IAAI,WAAW,MAAA,EAAQ;AACnB,IAAA,OAAO;AAAA,MACH,IAAA,EAAM;AAAA,QACF,EAAA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AAO,MAAA,CAAO,EAAE,CAAA;AAAA,cACjC,SAAA,EAAW;AAAA,aACf;AAAA,YAEA,QAAA,kBAAA,GAAA,CAAC,qBAAqB,KAAA,EAArB,EAA2B,MAAM,EAAA,EAAI,KAAA,EAAO,QAAQ,EAAA,EAAI;AAAA;AAAA,SAC7D,GACA;AAAA;AAAA;AAAA,GACR;AAER,CAAA,EAxGqB,OAAA","file":"chunk-46OT4PA6.js","sourcesContent":["'use client';\n\nimport type { ComponentType, ReactNode } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { defaultSemanticIcons } from '../../icons/default-semantic-icons';\nimport { px } from '../../theme/px';\nimport { useColorScheme } from '../../theme/use-color-scheme';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type AlertTone = 'info' | 'success' | 'warning' | 'danger';\n\nexport type AlertProps = {\n /**\n * Severity of the alert. Drives the color tone and the default icon.\n * @defaultValue 'info'\n */\n tone?: AlertTone;\n /** Bolded heading line. Optional — provide one of title or description. */\n title?: string;\n /** Body text below the title. */\n description?: string;\n /**\n * When provided, renders a close button in the top-right that calls back\n * when pressed. The Alert itself doesn't track dismissed state — the\n * parent decides whether to keep rendering.\n */\n onDismiss?: () => void;\n /**\n * Override the tone's default icon. Pass `null` to render no icon at\n * all (rare — the icon doubles as the visual severity cue).\n */\n icon?: ReactNode;\n /** Additional content below title/description. */\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\ntype IconType = ComponentType<{ size?: number; color?: string }>;\ntype TonePalette = { bg: string; border: string; fg: string; iconBg: string; defaultIcon: IconType };\n\n// Light/dark soft palettes per tone. Light variants use the familiar\n// pastel scale (Tailwind 50/200/800); dark variants use the deep 950/700/100\n// scale so the alert reads as a calm, on-tone surface against either\n// background — never a harsh white card on a dark page.\nfunction tonePalettes(\n scheme: 'light' | 'dark',\n primary: { '50': string; '200': string; '700': string; '800': string; '900': string; '100': string },\n success: string,\n warning: string,\n danger: string\n): Record<AlertTone, TonePalette> {\n if (scheme === 'dark') {\n return {\n info: {\n bg: primary['900'],\n border: primary['700'],\n fg: primary['100'],\n iconBg: primary['200'],\n defaultIcon: defaultSemanticIcons.info,\n },\n success: {\n bg: '#052e16',\n border: '#14532d',\n fg: '#bbf7d0',\n iconBg: success,\n defaultIcon: defaultSemanticIcons.checkmark,\n },\n warning: {\n bg: '#422006',\n border: '#78350f',\n fg: '#fef3c7',\n iconBg: warning,\n defaultIcon: defaultSemanticIcons.alertTriangle,\n },\n danger: {\n bg: '#450a0a',\n border: '#7f1d1d',\n fg: '#fecaca',\n iconBg: danger,\n defaultIcon: defaultSemanticIcons.alertTriangle,\n },\n };\n }\n return {\n info: {\n bg: primary['50'],\n border: primary['200'],\n fg: primary['800'],\n iconBg: primary['700'],\n defaultIcon: defaultSemanticIcons.info,\n },\n success: {\n bg: '#f0fdf4',\n border: '#bbf7d0',\n fg: '#166534',\n iconBg: success,\n defaultIcon: defaultSemanticIcons.checkmark,\n },\n warning: {\n bg: '#fefce8',\n border: '#fde68a',\n fg: '#92400e',\n iconBg: warning,\n defaultIcon: defaultSemanticIcons.alertTriangle,\n },\n danger: {\n bg: '#fef2f2',\n border: '#fecaca',\n fg: '#991b1b',\n iconBg: danger,\n defaultIcon: defaultSemanticIcons.alertTriangle,\n },\n };\n}\n\n// Layout-only base; theme-driven dimensions (gap/padding/radius) are merged\n// inside the component so a custom theme reshapes the alert.\nconst CONTAINER_LAYOUT_BASE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'flex-start',\n borderWidth: 1,\n};\n\n/**\n * Status banner with an icon, title, optional description, optional dismiss.\n * Use for inline messages that the reader should notice but doesn't need to\n * action immediately (use a Dialog when you need a forced acknowledgement).\n *\n * Color tone flips automatically with the active color scheme — light\n * pastel surface in light mode, deep on-tone surface in dark.\n */\nexport const Alert = ({\n tone = 'info',\n title,\n description,\n onDismiss,\n icon,\n children,\n className,\n testID,\n}: AlertProps) => {\n const colors = useThemeColors();\n const scheme = useColorScheme();\n const palette = tonePalettes(\n scheme,\n colors.color.primary,\n colors.color.success,\n colors.color.warning,\n colors.color.danger\n )[tone];\n const IconComponent = palette.defaultIcon;\n const containerStyle: ViewStyle = {\n ...CONTAINER_LAYOUT_BASE,\n gap: px(colors.spacing['3']),\n padding: px(colors.spacing['3']), // closest token to legacy 14px\n borderRadius: px(colors.radius.lg),\n backgroundColor: palette.bg,\n borderColor: palette.border,\n };\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n role=\"alert\"\n accessibilityRole=\"alert\"\n className={cn('flex-row items-start gap-3 rounded-md border p-3.5', className)}\n style={containerStyle}\n >\n {icon === null ? null : icon !== undefined ? (\n icon\n ) : (\n <View\n aria-hidden={true}\n style={{\n // 20×20 icon hit area — component-density literal — not from theme\n width: 20,\n height: 20,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: 2,\n }}\n >\n <IconComponent size={20} color={palette.iconBg} />\n </View>\n )}\n <View style={{ flex: 1, gap: 2 }}>\n {title !== undefined ? (\n <RNText\n style={{\n color: palette.fg,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.semibold as '600',\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {title}\n </RNText>\n ) : null}\n {description !== undefined ? (\n <RNText\n style={{\n color: palette.fg,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n opacity: 0.85,\n }}\n >\n {description}\n </RNText>\n ) : null}\n {children}\n </View>\n {onDismiss !== undefined ? (\n <Pressable\n onPress={onDismiss}\n role=\"button\"\n accessibilityRole=\"button\"\n accessibilityLabel=\"Dismiss\"\n aria-label=\"Dismiss\"\n style={{\n // 24×24 close button hit area — component-density literal — not from theme\n width: 24,\n height: 24,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: px(colors.radius.sm),\n marginTop: -2,\n }}\n >\n <defaultSemanticIcons.close size={16} color={palette.fg} />\n </Pressable>\n ) : null}\n </View>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/Alert/Alert.tsx"],"names":["RNText"],"mappings":";;;;;;;;AA+CA,SAAS,YAAA,CACL,MAAA,EACA,OAAA,EACA,OAAA,EACA,SACA,MAAA,EAC8B;AAC9B,EAAA,IAAI,WAAW,MAAA,EAAQ;AACnB,IAAA,OAAO;AAAA,MACH,IAAA,EAAM;AAAA,QACF,EAAA,EAAI,QAAQ,KAAK,CAAA;AAAA,QACjB,MAAA,EAAQ,QAAQ,KAAK,CAAA;AAAA,QACrB,EAAA,EAAI,QAAQ,KAAK,CAAA;AAAA,QACjB,MAAA,EAAQ,QAAQ,KAAK,CAAA;AAAA,QACrB,aAAa,oBAAA,CAAqB;AAAA,OACtC;AAAA,MACA,OAAA,EAAS;AAAA,QACL,EAAA,EAAI,SAAA;AAAA,QACJ,MAAA,EAAQ,SAAA;AAAA,QACR,EAAA,EAAI,SAAA;AAAA,QACJ,MAAA,EAAQ,OAAA;AAAA,QACR,aAAa,oBAAA,CAAqB;AAAA,OACtC;AAAA,MACA,OAAA,EAAS;AAAA,QACL,EAAA,EAAI,SAAA;AAAA,QACJ,MAAA,EAAQ,SAAA;AAAA,QACR,EAAA,EAAI,SAAA;AAAA,QACJ,MAAA,EAAQ,OAAA;AAAA,QACR,aAAa,oBAAA,CAAqB;AAAA,OACtC;AAAA,MACA,MAAA,EAAQ;AAAA,QACJ,EAAA,EAAI,SAAA;AAAA,QACJ,MAAA,EAAQ,SAAA;AAAA,QACR,EAAA,EAAI,SAAA;AAAA,QACJ,MAAA,EAAQ,MAAA;AAAA,QACR,aAAa,oBAAA,CAAqB;AAAA;AACtC,KACJ;AAAA,EACJ;AACA,EAAA,OAAO;AAAA,IACH,IAAA,EAAM;AAAA,MACF,EAAA,EAAI,QAAQ,IAAI,CAAA;AAAA,MAChB,MAAA,EAAQ,QAAQ,K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OAAA,EAAS,SAAA;AAAA,YACT,IAAA,EAAK,QAAA;AAAA,YACL,iBAAA,EAAkB,QAAA;AAAA,YAClB,kBAAA,EAAmB,SAAA;AAAA,YACnB,YAAA,EAAW,SAAA;AAAA,YACX,KAAA,EAAO;AAAA;AAAA,cAEH,KAAA,EAAO,EAAA;AAAA,cACP,MAAA,EAAQ,EAAA;AAAA,cACR,UAAA,EAAY,QAAA;AAAA,cACZ,cAAA,EAAgB,QAAA;AAAA,cAChB,YAAA,EAAc,EAAA,CAAG,MAAA,CAAO,MAAA,CAAO,EAAE,CAAA;AAAA,cACjC,SAAA,EAAW;AAAA,aACf;AAAA,YAEA,QAAA,kBAAA,GAAA,CAAC,qBAAqB,KAAA,EAArB,EAA2B,MAAM,EAAA,EAAI,KAAA,EAAO,QAAQ,EAAA,EAAI;AAAA;AAAA,SAC7D,GACA;AAAA;AAAA;AAAA,GACR;AAER,CAAA,EAxGqB,OAAA","file":"chunk-DDGMLLS3.js","sourcesContent":["'use client';\n\nimport type { ComponentType, ReactNode } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { defaultSemanticIcons } from '../../icons/default-semantic-icons';\nimport { px } from '../../theme/px';\nimport { useColorScheme } from '../../theme/use-color-scheme';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type AlertTone = 'info' | 'success' | 'warning' | 'danger';\n\nexport type AlertProps = {\n /**\n * Severity of the alert. Drives the color tone and the default icon.\n * @defaultValue 'info'\n */\n tone?: AlertTone;\n /** Bolded heading line. Optional — provide one of title or description. */\n title?: string;\n /** Body text below the title. */\n description?: string;\n /**\n * When provided, renders a close button in the top-right that calls back\n * when pressed. The Alert itself doesn't track dismissed state — the\n * parent decides whether to keep rendering.\n */\n onDismiss?: () => void;\n /**\n * Override the tone's default icon. Pass `null` to render no icon at\n * all (rare — the icon doubles as the visual severity cue).\n */\n icon?: ReactNode;\n /** Additional content below title/description. */\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\ntype IconType = ComponentType<{ size?: number; color?: string }>;\ntype TonePalette = { bg: string; border: string; fg: string; iconBg: string; defaultIcon: IconType };\n\n// Light/dark soft palettes per tone. Light variants use the familiar\n// pastel scale (Tailwind 50/200/800); dark variants use the deep 950/700/100\n// scale so the alert reads as a calm, on-tone surface against either\n// background — never a harsh white card on a dark page.\nfunction tonePalettes(\n scheme: 'light' | 'dark',\n primary: { '50': string; '200': string; '700': string; '800': string; '900': string; '100': string },\n success: string,\n warning: string,\n danger: string\n): Record<AlertTone, TonePalette> {\n if (scheme === 'dark') {\n return {\n info: {\n bg: primary['900'],\n border: primary['700'],\n fg: primary['100'],\n iconBg: primary['200'],\n defaultIcon: defaultSemanticIcons.info,\n },\n success: {\n bg: '#052e16',\n border: '#14532d',\n fg: '#bbf7d0',\n iconBg: success,\n defaultIcon: defaultSemanticIcons.checkmark,\n },\n warning: {\n bg: '#422006',\n border: '#78350f',\n fg: '#fef3c7',\n iconBg: warning,\n defaultIcon: defaultSemanticIcons.alertTriangle,\n },\n danger: {\n bg: '#450a0a',\n border: '#7f1d1d',\n fg: '#fecaca',\n iconBg: danger,\n defaultIcon: defaultSemanticIcons.alertTriangle,\n },\n };\n }\n return {\n info: {\n bg: primary['50'],\n border: primary['200'],\n fg: primary['800'],\n iconBg: primary['700'],\n defaultIcon: defaultSemanticIcons.info,\n },\n success: {\n bg: '#f0fdf4',\n border: '#bbf7d0',\n fg: '#166534',\n iconBg: success,\n defaultIcon: defaultSemanticIcons.checkmark,\n },\n warning: {\n bg: '#fefce8',\n border: '#fde68a',\n fg: '#92400e',\n iconBg: warning,\n defaultIcon: defaultSemanticIcons.alertTriangle,\n },\n danger: {\n bg: '#fef2f2',\n border: '#fecaca',\n fg: '#991b1b',\n iconBg: danger,\n defaultIcon: defaultSemanticIcons.alertTriangle,\n },\n };\n}\n\n// Layout-only base; theme-driven dimensions (gap/padding/radius) are merged\n// inside the component so a custom theme reshapes the alert.\nconst CONTAINER_LAYOUT_BASE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'flex-start',\n borderWidth: 1,\n};\n\n/**\n * Status banner with an icon, title, optional description, optional dismiss.\n * Use for inline messages that the reader should notice but doesn't need to\n * action immediately (use a Dialog when you need a forced acknowledgement).\n *\n * Color tone flips automatically with the active color scheme — light\n * pastel surface in light mode, deep on-tone surface in dark.\n */\nexport const Alert = ({\n tone = 'info',\n title,\n description,\n onDismiss,\n icon,\n children,\n className,\n testID,\n}: AlertProps) => {\n const colors = useThemeColors();\n const scheme = useColorScheme();\n const palette = tonePalettes(\n scheme,\n colors.color.primary,\n colors.color.success,\n colors.color.warning,\n colors.color.danger\n )[tone];\n const IconComponent = palette.defaultIcon;\n const containerStyle: ViewStyle = {\n ...CONTAINER_LAYOUT_BASE,\n gap: px(colors.spacing['3']),\n padding: px(colors.spacing['3']), // closest token to legacy 14px\n borderRadius: px(colors.radius.lg),\n backgroundColor: palette.bg,\n borderColor: palette.border,\n };\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n role=\"alert\"\n accessibilityRole=\"alert\"\n className={cn('flex-row items-start gap-3 rounded-md border p-3.5', className)}\n style={containerStyle}\n >\n {icon === null ? null : icon !== undefined ? (\n icon\n ) : (\n <View\n aria-hidden={true}\n style={{\n // 20×20 icon hit area — component-density literal — not from theme\n width: 20,\n height: 20,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: 2,\n }}\n >\n <IconComponent size={20} color={palette.iconBg} />\n </View>\n )}\n <View style={{ flex: 1, gap: 2 }}>\n {title !== undefined ? (\n <RNText\n style={{\n color: palette.fg,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.semibold as '600',\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {title}\n </RNText>\n ) : null}\n {description !== undefined ? (\n <RNText\n style={{\n color: palette.fg,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n opacity: 0.85,\n }}\n >\n {description}\n </RNText>\n ) : null}\n {children}\n </View>\n {onDismiss !== undefined ? (\n <Pressable\n onPress={onDismiss}\n role=\"button\"\n accessibilityRole=\"button\"\n accessibilityLabel=\"Dismiss\"\n aria-label=\"Dismiss\"\n style={{\n // 24×24 close button hit area — component-density literal — not from theme\n width: 24,\n height: 24,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: px(colors.radius.sm),\n marginTop: -2,\n }}\n >\n <defaultSemanticIcons.close size={16} color={palette.fg} />\n </Pressable>\n ) : null}\n </View>\n );\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cn } from './chunk-CHXHRJNZ.js';
|
|
2
1
|
import { px } from './chunk-5A2QOOVN.js';
|
|
2
|
+
import { cn } from './chunk-CHXHRJNZ.js';
|
|
3
3
|
import { useThemeColors } from './chunk-R5JMDDCB.js';
|
|
4
4
|
import { __name } from './chunk-WCQVDF3K.js';
|
|
5
5
|
import { useRef, useEffect } from 'react';
|
|
@@ -165,5 +165,5 @@ var Progress = /* @__PURE__ */ __name(({
|
|
|
165
165
|
}, "Progress");
|
|
166
166
|
|
|
167
167
|
export { Progress };
|
|
168
|
-
//# sourceMappingURL=chunk-
|
|
169
|
-
//# sourceMappingURL=chunk-
|
|
168
|
+
//# sourceMappingURL=chunk-FEPTH5RV.js.map
|
|
169
|
+
//# sourceMappingURL=chunk-FEPTH5RV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Progress/Progress.tsx"],"names":["RNText"],"mappings":";;;;;;;;AAmDA,IAAM,OAAA,GAAwC;AAAA,EAC1C,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI;AACR,CAAA;AAEA,IAAM,yBAAA,GAA4B,IAAA;AAClC,IAAM,iBAAA,GAAoB,EAAA;A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AChC;AAAA,kBAEC,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAK,MAAM,GAAG,CAAA;AAAA,oBAAE;AAAA;AAAA;AAAA,eACrB,GACA;AAAA;AAAA;AAAA,SACR,GACA,IAAA;AAAA,4BACH,IAAA,EAAA,EAAM,GAAG,WAAW,KAAA,EAAO,UAAA,EACvB,4CACG,GAAA,CAAC,QAAA,CAAS,MAAT,EAAc,KAAA,EAAO,yBAAwB,EAAG,CAAA,uBAEhD,IAAA,EAAA,EAAK,KAAA,EAAO,sBAAsB,CAAA,EAE3C;AAAA;AAAA;AAAA,GACJ;AAER,CAAA,EAjLwB,UAAA","file":"chunk-XP55RZ3D.js","sourcesContent":["'use client';\n\nimport { useEffect, useRef } from 'react';\nimport { Animated, Easing, Text as RNText, View, type ViewStyle } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type ProgressTone = 'primary' | 'info' | 'success' | 'warning' | 'danger';\nexport type ProgressSize = 'sm' | 'md' | 'lg';\n\nexport type ProgressProps = {\n /**\n * Current progress value (`0..max`). Omit to render the indeterminate\n * marquee variant (use this when you don't know how long the work\n * will take, e.g. an initial load before headers come back).\n */\n value?: number;\n /** Upper bound for `value`. @defaultValue 100 */\n max?: number;\n /**\n * Color of the fill / shuttle. `primary` follows the theme's interactive\n * color (matches buttons + sliders); the rest map to semantic status colors.\n * @defaultValue 'primary'\n */\n tone?: ProgressTone;\n /**\n * Bar height — `sm` 4px, `md` 8px (default), `lg` 12px. The track is\n * always pill-shaped (border-radius = height/2).\n * @defaultValue 'md'\n */\n size?: ProgressSize;\n /**\n * Optional label rendered above the bar. When set, also enables a\n * percentage readout on the right side for determinate progress.\n */\n label?: string;\n /**\n * Hide the auto-rendered percentage when a `label` is provided. Useful\n * when the label itself already conveys the number (e.g. \"Step 3 of 5\").\n * @defaultValue false\n */\n hidePercentage?: boolean;\n /** Accessibility label when no visible `label` is provided. */\n 'aria-label'?: string;\n /** Reference to a labeling element by id. */\n 'aria-labelledby'?: string;\n className?: string;\n testID?: string;\n};\n\nconst SIZE_PX: Record<ProgressSize, number> = {\n sm: 4,\n md: 8,\n lg: 12,\n};\n\nconst INDETERMINATE_DURATION_MS = 1500;\nconst SHUTTLE_WIDTH_PCT = 30;\n\n/**\n * Linear progress indicator. Use the determinate form (`value` set) to\n * communicate \"we're 42% done\"; use the indeterminate form (`value`\n * omitted) for \"we're working, no ETA\". The track is always pill-shaped\n * and the fill animates smoothly between renders for the determinate\n * variant — keep updates throttled to ~10/s in the parent to avoid\n * jitter.\n *\n * Cross-platform: built on `View` + `Animated.View` so it renders\n * identically on web (rn-web) and native. Uses `useThemeColors()` to\n * pick up dark-mode flips automatically.\n *\n * Accessibility: maps to `role=\"progressbar\"` with `aria-valuemin`,\n * `aria-valuemax`, and (for determinate) `aria-valuenow`. Provide an\n * `aria-label`, `aria-labelledby`, or visible `label` so the bar is\n * named.\n */\nexport const Progress = ({\n value,\n max = 100,\n tone = 'primary',\n size = 'md',\n label,\n hidePercentage = false,\n className,\n testID,\n ...rest\n}: ProgressProps) => {\n const colors = useThemeColors();\n const ariaLabel = rest['aria-label'];\n const ariaLabelledBy = rest['aria-labelledby'];\n\n const isIndeterminate = value === undefined;\n const safeMax = max <= 0 ? 100 : max;\n const clamped = isIndeterminate ? 0 : Math.min(safeMax, Math.max(0, value));\n const pct = isIndeterminate ? 0 : (clamped / safeMax) * 100;\n\n const height = SIZE_PX[size];\n\n const fillColor =\n tone === 'primary'\n ? colors.semantic.interactive.primary\n : tone === 'success'\n ? colors.color.success\n : tone === 'warning'\n ? colors.color.warning\n : tone === 'danger'\n ? colors.color.danger\n : colors.color.info;\n\n // Indeterminate marquee — a 30%-wide shuttle that slides from -30% to\n // 100% on a continuous loop. Driven by `Animated.Value` (0..1) which we\n // interpolate to a percent string for `left`. ease-in-out keeps the\n // motion subtle so the bar never feels frantic.\n const shuttle = useRef(new Animated.Value(0)).current;\n useEffect(() => {\n if (!isIndeterminate) {\n return;\n }\n const loop = Animated.loop(\n Animated.timing(shuttle, {\n toValue: 1,\n duration: INDETERMINATE_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n // We animate `left` (a layout property), so the native driver\n // can't be used. Web (rn-web) ignores `useNativeDriver`.\n useNativeDriver: false,\n })\n );\n loop.start();\n return () => {\n loop.stop();\n };\n }, [isIndeterminate, shuttle]);\n\n const trackStyle: ViewStyle = {\n width: '100%',\n height,\n backgroundColor: colors.semantic.background.subtle,\n borderRadius: height / 2,\n overflow: 'hidden',\n position: 'relative',\n };\n\n const determinateFillStyle: ViewStyle = {\n position: 'absolute',\n left: 0,\n top: 0,\n bottom: 0,\n // Cast at the boundary — RN's typed DimensionValue is narrower than\n // the percentage strings rn-web actually accepts.\n width: `${pct}%` as unknown as number,\n backgroundColor: fillColor,\n borderRadius: height / 2,\n };\n\n // Build the indeterminate style only when needed — `Animated.Value.interpolate`\n // returns an animated node that RN reads at render; we keep the call inside\n // the branch so determinate renders never hit it (and so test envs that\n // stub `Animated.Value` don't choke on a missing `interpolate`).\n const buildIndeterminateStyle = () => {\n const left =\n typeof shuttle.interpolate === 'function'\n ? shuttle.interpolate({\n inputRange: [0, 1],\n outputRange: [`-${SHUTTLE_WIDTH_PCT}%`, '100%'],\n })\n : (`-${SHUTTLE_WIDTH_PCT}%` as unknown as number);\n return {\n position: 'absolute' as const,\n top: 0,\n bottom: 0,\n left: left as unknown as number,\n width: `${SHUTTLE_WIDTH_PCT}%` as unknown as number,\n backgroundColor: fillColor,\n borderRadius: height / 2,\n };\n };\n\n // ARIA: only emit aria-valuenow when determinate so AT announces\n // \"in progress\" rather than \"0%\" while indeterminate.\n const ariaProps: Record<string, unknown> = {\n role: 'progressbar',\n accessibilityRole: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n };\n if (!isIndeterminate) {\n ariaProps['aria-valuenow'] = clamped;\n ariaProps.accessibilityValue = { min: 0, max: safeMax, now: clamped };\n }\n if (ariaLabel !== undefined) {\n ariaProps['aria-label'] = ariaLabel;\n ariaProps.accessibilityLabel = ariaLabel;\n } else if (label !== undefined) {\n ariaProps['aria-label'] = label;\n ariaProps.accessibilityLabel = label;\n }\n if (ariaLabelledBy !== undefined) {\n ariaProps['aria-labelledby'] = ariaLabelledBy;\n }\n\n const showHeader = label !== undefined;\n const showPercentage = showHeader && !hidePercentage && !isIndeterminate;\n\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('w-full', className)}\n style={{ width: '100%' }}\n >\n {showHeader ? (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: px(colors.spacing['2']) - 2, // closest to legacy 6\n }}\n >\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n }}\n >\n {label}\n </RNText>\n {showPercentage ? (\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n // Tabular numerals keep the percentage from\n // jittering as digits change width.\n fontVariant: ['tabular-nums'],\n }}\n >\n {Math.round(pct)}%\n </RNText>\n ) : null}\n </View>\n ) : null}\n <View {...ariaProps} style={trackStyle}>\n {isIndeterminate ? (\n <Animated.View style={buildIndeterminateStyle()} />\n ) : (\n <View style={determinateFillStyle} />\n )}\n </View>\n </View>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/Progress/Progress.tsx"],"names":["RNText"],"mappings":";;;;;;;;AAmDA,IAAM,OAAA,GAAwC;AAAA,EAC1C,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI;AACR,CAAA;AAEA,IAAM,yBAAA,GAA4B,IAAA;AAClC,IAAM,iBAAA,GAAoB,EAAA;AAmBnB,IAAM,2BAAW,MAAA,CAAA,CAAC;AAAA,EACrB,KAAA;AAAA,EACA,GAAA,GAAM,GA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AAE;AAAA;AAAA;AAAA,eACrB,GACA;AAAA;AAAA;AAAA,SACR,GACA,IAAA;AAAA,4BACH,IAAA,EAAA,EAAM,GAAG,WAAW,KAAA,EAAO,UAAA,EACvB,4CACG,GAAA,CAAC,QAAA,CAAS,MAAT,EAAc,KAAA,EAAO,yBAAwB,EAAG,CAAA,uBAEhD,IAAA,EAAA,EAAK,KAAA,EAAO,sBAAsB,CAAA,EAE3C;AAAA;AAAA;AAAA,GACJ;AAER,CAAA,EAjLwB,UAAA","file":"chunk-FEPTH5RV.js","sourcesContent":["'use client';\n\nimport { useEffect, useRef } from 'react';\nimport { Animated, Easing, Text as RNText, View, type ViewStyle } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type ProgressTone = 'primary' | 'info' | 'success' | 'warning' | 'danger';\nexport type ProgressSize = 'sm' | 'md' | 'lg';\n\nexport type ProgressProps = {\n /**\n * Current progress value (`0..max`). Omit to render the indeterminate\n * marquee variant (use this when you don't know how long the work\n * will take, e.g. an initial load before headers come back).\n */\n value?: number;\n /** Upper bound for `value`. @defaultValue 100 */\n max?: number;\n /**\n * Color of the fill / shuttle. `primary` follows the theme's interactive\n * color (matches buttons + sliders); the rest map to semantic status colors.\n * @defaultValue 'primary'\n */\n tone?: ProgressTone;\n /**\n * Bar height — `sm` 4px, `md` 8px (default), `lg` 12px. The track is\n * always pill-shaped (border-radius = height/2).\n * @defaultValue 'md'\n */\n size?: ProgressSize;\n /**\n * Optional label rendered above the bar. When set, also enables a\n * percentage readout on the right side for determinate progress.\n */\n label?: string;\n /**\n * Hide the auto-rendered percentage when a `label` is provided. Useful\n * when the label itself already conveys the number (e.g. \"Step 3 of 5\").\n * @defaultValue false\n */\n hidePercentage?: boolean;\n /** Accessibility label when no visible `label` is provided. */\n 'aria-label'?: string;\n /** Reference to a labeling element by id. */\n 'aria-labelledby'?: string;\n className?: string;\n testID?: string;\n};\n\nconst SIZE_PX: Record<ProgressSize, number> = {\n sm: 4,\n md: 8,\n lg: 12,\n};\n\nconst INDETERMINATE_DURATION_MS = 1500;\nconst SHUTTLE_WIDTH_PCT = 30;\n\n/**\n * Linear progress indicator. Use the determinate form (`value` set) to\n * communicate \"we're 42% done\"; use the indeterminate form (`value`\n * omitted) for \"we're working, no ETA\". The track is always pill-shaped\n * and the fill animates smoothly between renders for the determinate\n * variant — keep updates throttled to ~10/s in the parent to avoid\n * jitter.\n *\n * Cross-platform: built on `View` + `Animated.View` so it renders\n * identically on web (rn-web) and native. Uses `useThemeColors()` to\n * pick up dark-mode flips automatically.\n *\n * Accessibility: maps to `role=\"progressbar\"` with `aria-valuemin`,\n * `aria-valuemax`, and (for determinate) `aria-valuenow`. Provide an\n * `aria-label`, `aria-labelledby`, or visible `label` so the bar is\n * named.\n */\nexport const Progress = ({\n value,\n max = 100,\n tone = 'primary',\n size = 'md',\n label,\n hidePercentage = false,\n className,\n testID,\n ...rest\n}: ProgressProps) => {\n const colors = useThemeColors();\n const ariaLabel = rest['aria-label'];\n const ariaLabelledBy = rest['aria-labelledby'];\n\n const isIndeterminate = value === undefined;\n const safeMax = max <= 0 ? 100 : max;\n const clamped = isIndeterminate ? 0 : Math.min(safeMax, Math.max(0, value));\n const pct = isIndeterminate ? 0 : (clamped / safeMax) * 100;\n\n const height = SIZE_PX[size];\n\n const fillColor =\n tone === 'primary'\n ? colors.semantic.interactive.primary\n : tone === 'success'\n ? colors.color.success\n : tone === 'warning'\n ? colors.color.warning\n : tone === 'danger'\n ? colors.color.danger\n : colors.color.info;\n\n // Indeterminate marquee — a 30%-wide shuttle that slides from -30% to\n // 100% on a continuous loop. Driven by `Animated.Value` (0..1) which we\n // interpolate to a percent string for `left`. ease-in-out keeps the\n // motion subtle so the bar never feels frantic.\n const shuttle = useRef(new Animated.Value(0)).current;\n useEffect(() => {\n if (!isIndeterminate) {\n return;\n }\n const loop = Animated.loop(\n Animated.timing(shuttle, {\n toValue: 1,\n duration: INDETERMINATE_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n // We animate `left` (a layout property), so the native driver\n // can't be used. Web (rn-web) ignores `useNativeDriver`.\n useNativeDriver: false,\n })\n );\n loop.start();\n return () => {\n loop.stop();\n };\n }, [isIndeterminate, shuttle]);\n\n const trackStyle: ViewStyle = {\n width: '100%',\n height,\n backgroundColor: colors.semantic.background.subtle,\n borderRadius: height / 2,\n overflow: 'hidden',\n position: 'relative',\n };\n\n const determinateFillStyle: ViewStyle = {\n position: 'absolute',\n left: 0,\n top: 0,\n bottom: 0,\n // Cast at the boundary — RN's typed DimensionValue is narrower than\n // the percentage strings rn-web actually accepts.\n width: `${pct}%` as unknown as number,\n backgroundColor: fillColor,\n borderRadius: height / 2,\n };\n\n // Build the indeterminate style only when needed — `Animated.Value.interpolate`\n // returns an animated node that RN reads at render; we keep the call inside\n // the branch so determinate renders never hit it (and so test envs that\n // stub `Animated.Value` don't choke on a missing `interpolate`).\n const buildIndeterminateStyle = () => {\n const left =\n typeof shuttle.interpolate === 'function'\n ? shuttle.interpolate({\n inputRange: [0, 1],\n outputRange: [`-${SHUTTLE_WIDTH_PCT}%`, '100%'],\n })\n : (`-${SHUTTLE_WIDTH_PCT}%` as unknown as number);\n return {\n position: 'absolute' as const,\n top: 0,\n bottom: 0,\n left: left as unknown as number,\n width: `${SHUTTLE_WIDTH_PCT}%` as unknown as number,\n backgroundColor: fillColor,\n borderRadius: height / 2,\n };\n };\n\n // ARIA: only emit aria-valuenow when determinate so AT announces\n // \"in progress\" rather than \"0%\" while indeterminate.\n const ariaProps: Record<string, unknown> = {\n role: 'progressbar',\n accessibilityRole: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n };\n if (!isIndeterminate) {\n ariaProps['aria-valuenow'] = clamped;\n ariaProps.accessibilityValue = { min: 0, max: safeMax, now: clamped };\n }\n if (ariaLabel !== undefined) {\n ariaProps['aria-label'] = ariaLabel;\n ariaProps.accessibilityLabel = ariaLabel;\n } else if (label !== undefined) {\n ariaProps['aria-label'] = label;\n ariaProps.accessibilityLabel = label;\n }\n if (ariaLabelledBy !== undefined) {\n ariaProps['aria-labelledby'] = ariaLabelledBy;\n }\n\n const showHeader = label !== undefined;\n const showPercentage = showHeader && !hidePercentage && !isIndeterminate;\n\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('w-full', className)}\n style={{ width: '100%' }}\n >\n {showHeader ? (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: px(colors.spacing['2']) - 2, // closest to legacy 6\n }}\n >\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n }}\n >\n {label}\n </RNText>\n {showPercentage ? (\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n // Tabular numerals keep the percentage from\n // jittering as digits change width.\n fontVariant: ['tabular-nums'],\n }}\n >\n {Math.round(pct)}%\n </RNText>\n ) : null}\n </View>\n ) : null}\n <View {...ariaProps} style={trackStyle}>\n {isIndeterminate ? (\n <Animated.View style={buildIndeterminateStyle()} />\n ) : (\n <View style={determinateFillStyle} />\n )}\n </View>\n </View>\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveI18n, defaultDictionary } from './chunk-
|
|
1
|
+
import { resolveI18n, defaultDictionary } from './chunk-4UFAZLSZ.js';
|
|
2
2
|
import { __name } from './chunk-WCQVDF3K.js';
|
|
3
3
|
import { createContext, useMemo, useContext } from 'react';
|
|
4
4
|
import { jsx } from 'nativewind/jsx-runtime';
|
|
@@ -19,5 +19,5 @@ function useTranslation() {
|
|
|
19
19
|
__name(useTranslation, "useTranslation");
|
|
20
20
|
|
|
21
21
|
export { I18nProvider, useTranslation };
|
|
22
|
-
//# sourceMappingURL=chunk-
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
22
|
+
//# sourceMappingURL=chunk-GJMHNEQ3.js.map
|
|
23
|
+
//# sourceMappingURL=chunk-GJMHNEQ3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/i18n/context.tsx","../src/i18n/use-translation.ts"],"names":[],"mappings":";;;;;AAcA,IAAM,YAAA,GAAiC;AAAA,EACnC,CAAA,EAAG,WAAA,CAAY,MAAA,EAAW,iBAAiB;AAC/C,CAAA;AAEO,IAAM,WAAA,GAAc,cAAgC,YAAY,CAAA;AACvE,WAAA,CAAY,WAAA,GAAc,aAAA;AAOnB,SAAS,YAAA,CAAa,EAAE,IAAA,EAAM,QAAA,EAAS,EAAsB;AAChE,EAAA,MAAM,KAAA,GAAQ,OAAA,CAA0B,OAAO,EAAE,CAAA,EAAG,WAAA,CAAY,IAAA,EAAM,iBAAiB,CAAA,EAAE,CAAA,EAAI,CAAC,IAAI,CAAC,CAAA;AACnG,EAAA,uBAAO,GAAA,CAAC,WAAA,CAAY,QAAA,EAAZ,EAAqB,OAAe,QAAA,EAAS,CAAA;AACzD;AAHgB,MAAA,CAAA,YAAA,EAAA,cAAA,CAAA;ACrBT,SAAS,cAAA,GAAmC;AAC/C,EAAA,OAAO,WAAW,WAAW,CAAA;AACjC;AAFgB,MAAA,CAAA,cAAA,EAAA,gBAAA,CAAA","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/i18n/context.tsx","../src/i18n/use-translation.ts"],"names":[],"mappings":";;;;;AAcA,IAAM,YAAA,GAAiC;AAAA,EACnC,CAAA,EAAG,WAAA,CAAY,MAAA,EAAW,iBAAiB;AAC/C,CAAA;AAEO,IAAM,WAAA,GAAc,cAAgC,YAAY,CAAA;AACvE,WAAA,CAAY,WAAA,GAAc,aAAA;AAOnB,SAAS,YAAA,CAAa,EAAE,IAAA,EAAM,QAAA,EAAS,EAAsB;AAChE,EAAA,MAAM,KAAA,GAAQ,OAAA,CAA0B,OAAO,EAAE,CAAA,EAAG,WAAA,CAAY,IAAA,EAAM,iBAAiB,CAAA,EAAE,CAAA,EAAI,CAAC,IAAI,CAAC,CAAA;AACnG,EAAA,uBAAO,GAAA,CAAC,WAAA,CAAY,QAAA,EAAZ,EAAqB,OAAe,QAAA,EAAS,CAAA;AACzD;AAHgB,MAAA,CAAA,YAAA,EAAA,cAAA,CAAA;ACrBT,SAAS,cAAA,GAAmC;AAC/C,EAAA,OAAO,WAAW,WAAW,CAAA;AACjC;AAFgB,MAAA,CAAA,cAAA,EAAA,gBAAA,CAAA","file":"chunk-GJMHNEQ3.js","sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { createContext, useMemo } from 'react';\nimport { defaultDictionary } from './default-dictionary';\nimport { resolveI18n } from './resolve';\nimport type { I18nInput, TranslateFn } from './types';\n\nexport type I18nContextValue = {\n t: TranslateFn;\n};\n\n// Default context value uses the built-in English dictionary; consumers without\n// a provider still get a working t().\nconst defaultValue: I18nContextValue = {\n t: resolveI18n(undefined, defaultDictionary),\n};\n\nexport const I18nContext = createContext<I18nContextValue>(defaultValue);\nI18nContext.displayName = 'I18nContext';\n\nexport type I18nProviderProps = {\n i18n?: I18nInput;\n children?: ReactNode;\n};\n\nexport function I18nProvider({ i18n, children }: I18nProviderProps) {\n const value = useMemo<I18nContextValue>(() => ({ t: resolveI18n(i18n, defaultDictionary) }), [i18n]);\n return <I18nContext.Provider value={value}>{children}</I18nContext.Provider>;\n}\n","'use client';\n\nimport { useContext } from 'react';\nimport { I18nContext, type I18nContextValue } from './context';\n\nexport function useTranslation(): I18nContextValue {\n return useContext(I18nContext);\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Text } from './chunk-
|
|
1
|
+
import { Text } from './chunk-JZ774T7U.js';
|
|
2
2
|
import { __name } from './chunk-WCQVDF3K.js';
|
|
3
3
|
import { Children } from 'react';
|
|
4
4
|
import { jsx } from 'nativewind/jsx-runtime';
|
|
@@ -14,5 +14,5 @@ function wrapStringChildren(children) {
|
|
|
14
14
|
__name(wrapStringChildren, "wrapStringChildren");
|
|
15
15
|
|
|
16
16
|
export { wrapStringChildren };
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-JQQ3FBN7.js.map
|
|
18
|
+
//# sourceMappingURL=chunk-JQQ3FBN7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/wrap-string-children.tsx"],"names":[],"mappings":";;;;;AAyBO,SAAS,mBAAmB,QAAA,EAAgC;AAC/D,EAAA,OAAO,QAAA,CAAS,GAAA,CAAI,QAAA,EAAU,CAAC,KAAA,KAAU;AACrC,IAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,OAAO,UAAU,QAAA,EAAU;AACxD,MAAA,uBAAO,GAAA,CAAC,QAAM,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,IACxB;AACA,IAAA,OAAO,KAAA;AAAA,EACX,CAAC,CAAA;AACL;AAPgB,MAAA,CAAA,kBAAA,EAAA,oBAAA,CAAA","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/utils/wrap-string-children.tsx"],"names":[],"mappings":";;;;;AAyBO,SAAS,mBAAmB,QAAA,EAAgC;AAC/D,EAAA,OAAO,QAAA,CAAS,GAAA,CAAI,QAAA,EAAU,CAAC,KAAA,KAAU;AACrC,IAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,OAAO,UAAU,QAAA,EAAU;AACxD,MAAA,uBAAO,GAAA,CAAC,QAAM,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,IACxB;AACA,IAAA,OAAO,KAAA;AAAA,EACX,CAAC,CAAA;AACL;AAPgB,MAAA,CAAA,kBAAA,EAAA,oBAAA,CAAA","file":"chunk-JQQ3FBN7.js","sourcesContent":["import { Children, type ReactNode } from 'react';\nimport { Text } from '../components/Text';\n\n/**\n * Walks a `ReactNode` (single, array, or fragment) and wraps every\n * string/number child in a themed `<Text>` so the same JSX renders\n * cleanly on web AND native. Non-string children are passed through\n * unchanged.\n *\n * On native, raw strings as children of any non-Text component throw\n * \"Text strings must be rendered within a <Text> component\". On web,\n * react-native-web silently tolerates them — but the rendered string\n * inherits no theme color, so dark mode never flips.\n *\n * Both bugs collapse to the same fix: wrap. Layout primitives\n * (`<HStack>`, `<VStack>`, `<Box>`) use this so consumers can write\n * `<HStack>Hello</HStack>` and have it Just Work on both platforms\n * and across light/dark mode.\n *\n * The wrapper is the lib's own `<Text>`, which reads from\n * `useThemeColors()` — so the wrapped string flips with the active\n * scheme. Importing a `'use client'` component from an RSC-safe file\n * is allowed; React's RSC model lets server components contain client\n * children.\n */\nexport function wrapStringChildren(children: ReactNode): ReactNode {\n return Children.map(children, (child) => {\n if (typeof child === 'string' || typeof child === 'number') {\n return <Text>{child}</Text>;\n }\n return child;\n });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Select } from './chunk-
|
|
1
|
+
import { Select } from './chunk-UZD77M3J.js';
|
|
2
2
|
import { __name } from './chunk-WCQVDF3K.js';
|
|
3
3
|
import { jsx } from 'nativewind/jsx-runtime';
|
|
4
4
|
|
|
@@ -7,5 +7,5 @@ var Combobox = /* @__PURE__ */ __name((props) => {
|
|
|
7
7
|
}, "Combobox");
|
|
8
8
|
|
|
9
9
|
export { Combobox };
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
//# sourceMappingURL=chunk-JXLEMBDB.js.map
|
|
11
|
+
//# sourceMappingURL=chunk-JXLEMBDB.js.map
|