{"version":3,"sources":["../src/components/list/list.tsx"],"names":["React","ListItem","type","id","styles","children","classes","props","ref","ui_default","List","variant","role","ListWithItem","list_default"],"mappings":"yCACA,OAAOA,MAAW,QA8CX,IAAMC,EAAWD,EAAM,WAG5B,CAAC,CAAE,KAAAE,EAAO,KAAM,GAAAC,EAAI,OAAAC,EAAQ,SAAAC,EAAU,QAAAC,EAAS,GAAGC,CAAM,EAAGC,IAEzDR,EAAA,cAACS,EAAA,CACC,GAAIN,EACJ,GAAID,EACJ,UAAWI,EACX,MAAOF,EACP,IAAKI,EACJ,GAAGD,GAEHF,CACH,CAEH,EAEDJ,EAAS,YAAc,WA4EhB,IAAMS,EAAOV,EAAM,WAGxB,CAAC,CAAE,SAAAK,EAAU,QAAAC,EAAS,KAAAJ,EAAO,KAAM,QAAAS,EAAS,OAAAP,EAAQ,KAAAQ,EAAM,GAAGL,CAAM,EAAGC,IAEpER,EAAA,cAACS,EAAA,CACC,GAAIP,EACJ,eAAcS,EACd,UAAWL,EACX,MAAOF,EACP,KAAMQ,EACN,IAAKJ,EACJ,GAAGD,GAEHF,CACH,CAEH,EAEDK,EAAK,YAAc,OAWnB,IAAMG,EAAe,OAAO,OAAOH,EAAM,CACvC,SAAAT,CACF,CAAC,EAEMa,EAAQD","sourcesContent":["import UI from \"#components/ui\";\nimport React from \"react\";\nimport type { ListProps, ListItemProps } from \"./list.types\";\n\n// Re-export types for external use\nexport type { ListProps, ListItemProps };\n\n/**\n * ListItem - A flexible list item component for ul, ol, and dl lists.\n *\n * This component renders different HTML elements (li, dt, dd) based on the parent\n * list type, maintaining semantic HTML and accessibility best practices.\n *\n * ## Key Features:\n * - **Semantic HTML**: Renders appropriate element type (li, dt, dd)\n * - **Type-Safe**: Full TypeScript support with comprehensive props\n * - **Ref Forwarding**: Enables direct DOM access for focus management\n * - **Customizable**: Supports custom styles and CSS classes\n *\n * ## Accessibility:\n * - ✅ Uses semantic HTML elements\n * - ✅ Works with screen readers out of the box\n * - ✅ Supports all native HTML attributes\n * - ✅ Ref forwarding for programmatic focus\n *\n * @example\n * ```tsx\n * // Standard list item\n * <ListItem>Item content</ListItem>\n * ```\n *\n * @example\n * ```tsx\n * // Definition term\n * <ListItem type=\"dt\">Term to define</ListItem>\n * ```\n *\n * @example\n * ```tsx\n * // Definition description\n * <ListItem type=\"dd\">The definition text</ListItem>\n * ```\n *\n * @param {ListItemProps} props - Component props\n * @param {React.Ref} ref - Forwarded ref for DOM access\n * @returns {React.ReactElement} A list item element\n */\nexport const ListItem = React.forwardRef<\n  HTMLLIElement | HTMLElement,\n  ListItemProps\n>(({ type = \"li\", id, styles, children, classes, ...props }, ref) => {\n  return (\n    <UI\n      id={id}\n      as={type}\n      className={classes}\n      style={styles}\n      ref={ref}\n      {...props}\n    >\n      {children}\n    </UI>\n  );\n});\n\nListItem.displayName = \"ListItem\";\n\n/**\n * List - A flexible, accessible list component for creating ul, ol, and dl lists.\n *\n * This component provides a type-safe, accessible way to create different types of lists\n * with built-in support for custom styling, variants, and WCAG 2.1 AA compliance.\n *\n * ## Key Features:\n * - **Multiple List Types**: Supports ul (unordered), ol (ordered), and dl (definition) lists\n * - **Semantic HTML**: Uses native HTML list elements for proper accessibility\n * - **Customizable Styling**: CSS custom properties and variant support\n * - **Type-Safe**: Comprehensive TypeScript types with JSDoc\n * - **Ref Forwarding**: Direct DOM access for scroll positioning and focus management\n * - **WCAG 2.1 AA**: Meets accessibility standards with proper semantic structure\n *\n * ## Accessibility:\n * - ✅ WCAG 2.1 AA compliant using semantic HTML\n * - ✅ Screen reader compatible (announced as \"list\" with item count)\n * - ✅ Supports role=\"list\" override for styled lists (Safari/VoiceOver compatibility)\n * - ✅ Keyboard navigation works naturally with focusable children\n * - ✅ Ref forwarding for programmatic focus management\n *\n * ## Common Use Cases:\n * - **Navigation menus** - Use ul with variant=\"inline\" or \"none\"\n * - **Sequential steps** - Use ol for numbered instructions\n * - **Glossaries** - Use dl for term-definition pairs\n * - **Feature lists** - Use ul for product features\n *\n * @example\n * ```tsx\n * // Basic unordered list\n * <List>\n *   <List.ListItem>First item</List.ListItem>\n *   <List.ListItem>Second item</List.ListItem>\n * </List>\n * ```\n *\n * @example\n * ```tsx\n * // Ordered list with custom styling\n * <List\n *   type=\"ol\"\n *   variant=\"numbered\"\n *   styles={{ '--list-marker-color': '#0066cc' }}\n * >\n *   <List.ListItem>Step one</List.ListItem>\n *   <List.ListItem>Step two</List.ListItem>\n * </List>\n * ```\n *\n * @example\n * ```tsx\n * // Unstyled list with role restoration for accessibility\n * // IMPORTANT: Use role=\"list\" when removing list styling\n * <List variant=\"none\" role=\"list\">\n *   <List.ListItem>Navigation link</List.ListItem>\n *   <List.ListItem>Another link</List.ListItem>\n * </List>\n * ```\n *\n * @example\n * ```tsx\n * // Definition list\n * <List type=\"dl\">\n *   <List.ListItem type=\"dt\">React</List.ListItem>\n *   <List.ListItem type=\"dd\">A JavaScript library for building UIs</List.ListItem>\n *   <List.ListItem type=\"dt\">TypeScript</List.ListItem>\n *   <List.ListItem type=\"dd\">JavaScript with syntax for types</List.ListItem>\n * </List>\n * ```\n *\n * @param {ListProps} props - Component props\n * @param {React.Ref} ref - Forwarded ref for DOM access\n * @returns {React.ReactElement} A list element (ul, ol, or dl)\n */\nexport const List = React.forwardRef<\n  HTMLUListElement | HTMLOListElement | HTMLDListElement,\n  ListProps\n>(({ children, classes, type = \"ul\", variant, styles, role, ...props }, ref) => {\n  return (\n    <UI\n      as={type}\n      data-variant={variant}\n      className={classes}\n      style={styles}\n      role={role}\n      ref={ref}\n      {...props}\n    >\n      {children}\n    </UI>\n  );\n});\n\nList.displayName = \"List\";\n\n// Compound component pattern - attach ListItem to List with proper typing\nexport interface ListComponent\n  extends React.ForwardRefExoticComponent<\n    ListProps & React.RefAttributes<HTMLUListElement | HTMLOListElement | HTMLDListElement>\n  > {\n  ListItem: typeof ListItem;\n}\n\n// Attach ListItem to List using Object.assign for better type inference\nconst ListWithItem = Object.assign(List, {\n  ListItem,\n});\n\nexport default ListWithItem as ListComponent;\n"]}