@fpkit/acss 0.5.5 → 0.5.7

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.
Files changed (128) hide show
  1. package/libs/chunk-PWVRDQ3R.js +8 -0
  2. package/libs/chunk-PWVRDQ3R.js.map +1 -0
  3. package/libs/chunk-SVS4MX3U.cjs +31 -0
  4. package/libs/chunk-SVS4MX3U.cjs.map +1 -0
  5. package/libs/{icons-1f5afc0c.d.ts → icons-31ace3de.d.ts} +86 -49
  6. package/libs/icons.cjs +2 -2
  7. package/libs/icons.d.cts +1 -1
  8. package/libs/icons.d.ts +1 -1
  9. package/libs/icons.js +1 -1
  10. package/libs/index.cjs +34 -34
  11. package/libs/index.cjs.map +1 -1
  12. package/libs/index.d.cts +46 -15
  13. package/libs/index.d.ts +46 -15
  14. package/libs/index.js +7 -7
  15. package/libs/index.js.map +1 -1
  16. package/package.json +4 -3
  17. package/src/components/README.mdx +84 -0
  18. package/src/components/alert/README.mdx +86 -0
  19. package/src/components/alert/alert.mdx +74 -0
  20. package/src/components/alert/alert.scss +80 -0
  21. package/src/components/alert/alert.stories.tsx +133 -0
  22. package/src/components/alert/alert.tsx +154 -0
  23. package/src/components/alert/elements/README.mdx +77 -0
  24. package/src/components/alert/elements/dismiss-button.stories.tsx +31 -0
  25. package/src/components/alert/elements/dismiss-button.tsx +28 -0
  26. package/src/components/badge/badge.mdx +124 -0
  27. package/src/components/badge/badge.scss +4 -4
  28. package/src/components/buttons/button.scss +1 -0
  29. package/src/components/buttons/button.test.tsx +72 -72
  30. package/src/components/details/details.scss +20 -1
  31. package/src/components/dialog/README.mdx +187 -0
  32. package/src/components/dialog/dialog-modal.stories.tsx +113 -0
  33. package/src/components/dialog/dialog-modal.tsx +111 -0
  34. package/src/components/dialog/dialog.scss +28 -13
  35. package/src/components/dialog/dialog.stories.tsx +85 -30
  36. package/src/components/dialog/dialog.tsx +106 -61
  37. package/src/components/dialog/hooks/useClickOutside.ts +33 -0
  38. package/src/components/dialog/views/README.mdx +182 -0
  39. package/src/components/dialog/views/dialog-footer.tsx +45 -0
  40. package/src/components/dialog/{view → views}/dialog-header.stories.tsx +3 -4
  41. package/src/components/dialog/views/dialog-header.tsx +61 -0
  42. package/src/components/icons/components/add.tsx +14 -14
  43. package/src/components/icons/components/alert-solid.tsx +36 -0
  44. package/src/components/icons/components/alert-square-solid.tsx +36 -0
  45. package/src/components/icons/components/info-solid.tsx +40 -0
  46. package/src/components/icons/components/info.tsx +36 -0
  47. package/src/components/icons/components/question-solid.tsx +36 -0
  48. package/src/components/icons/components/success-solid.tsx +36 -0
  49. package/src/components/icons/components/warn-solid.tsx +36 -0
  50. package/src/components/icons/icon.stories.tsx +42 -0
  51. package/src/components/icons/icon.tsx +57 -41
  52. package/src/components/icons/index.ts +36 -29
  53. package/src/components/ui.tsx +28 -25
  54. package/src/decorators/instructions.tsx +44 -0
  55. package/src/hooks/useDialogClickHandler.ts +26 -0
  56. package/src/index.scss +23 -22
  57. package/src/sass/_globals.scss +7 -1
  58. package/src/styles/alert/alert.css +68 -0
  59. package/src/styles/alert/alert.css.map +1 -0
  60. package/src/styles/badge/badge.css +3 -3
  61. package/src/styles/buttons/button.css +1 -0
  62. package/src/styles/buttons/button.css.map +1 -1
  63. package/src/styles/details/details.css +14 -1
  64. package/src/styles/details/details.css.map +1 -1
  65. package/src/styles/dialog/dialog.css +28 -13
  66. package/src/styles/dialog/dialog.css.map +1 -1
  67. package/src/styles/index.css +122 -28
  68. package/src/styles/index.css.map +1 -1
  69. package/libs/chunk-QHIABQNQ.js +0 -8
  70. package/libs/chunk-QHIABQNQ.js.map +0 -1
  71. package/libs/chunk-ZOHIKF6I.cjs +0 -31
  72. package/libs/chunk-ZOHIKF6I.cjs.map +0 -1
  73. package/libs/components/badge/badge.css +0 -1
  74. package/libs/components/badge/badge.css.map +0 -1
  75. package/libs/components/badge/badge.min.css +0 -3
  76. package/libs/components/breadcrumbs/breadcrumb.css +0 -1
  77. package/libs/components/breadcrumbs/breadcrumb.css.map +0 -1
  78. package/libs/components/breadcrumbs/breadcrumb.min.css +0 -3
  79. package/libs/components/buttons/button.css +0 -1
  80. package/libs/components/buttons/button.css.map +0 -1
  81. package/libs/components/buttons/button.min.css +0 -3
  82. package/libs/components/cards/card-style.css +0 -1
  83. package/libs/components/cards/card-style.css.map +0 -1
  84. package/libs/components/cards/card-style.min.css +0 -3
  85. package/libs/components/cards/card.css +0 -1
  86. package/libs/components/cards/card.css.map +0 -1
  87. package/libs/components/cards/card.min.css +0 -3
  88. package/libs/components/details/details.css +0 -1
  89. package/libs/components/details/details.css.map +0 -1
  90. package/libs/components/details/details.min.css +0 -3
  91. package/libs/components/dialog/dialog.css +0 -1
  92. package/libs/components/dialog/dialog.css.map +0 -1
  93. package/libs/components/dialog/dialog.min.css +0 -3
  94. package/libs/components/form/form.css +0 -1
  95. package/libs/components/form/form.css.map +0 -1
  96. package/libs/components/form/form.min.css +0 -3
  97. package/libs/components/icons/icon.css +0 -1
  98. package/libs/components/icons/icon.css.map +0 -1
  99. package/libs/components/icons/icon.min.css +0 -3
  100. package/libs/components/images/img.css +0 -1
  101. package/libs/components/images/img.css.map +0 -1
  102. package/libs/components/images/img.min.css +0 -3
  103. package/libs/components/layout/landmarks.css +0 -1
  104. package/libs/components/layout/landmarks.css.map +0 -1
  105. package/libs/components/layout/landmarks.min.css +0 -3
  106. package/libs/components/link/link.css +0 -1
  107. package/libs/components/link/link.css.map +0 -1
  108. package/libs/components/link/link.min.css +0 -3
  109. package/libs/components/nav/nav.css +0 -1
  110. package/libs/components/nav/nav.css.map +0 -1
  111. package/libs/components/nav/nav.min.css +0 -3
  112. package/libs/components/progress/progress.css +0 -1
  113. package/libs/components/progress/progress.css.map +0 -1
  114. package/libs/components/progress/progress.min.css +0 -3
  115. package/libs/components/styles/index.css +0 -1
  116. package/libs/components/styles/index.css.map +0 -1
  117. package/libs/components/styles/index.min.css +0 -3
  118. package/libs/components/tag/tag.css +0 -1
  119. package/libs/components/tag/tag.css.map +0 -1
  120. package/libs/components/tag/tag.min.css +0 -3
  121. package/libs/components/text-to-speech/text-to-speech.css +0 -1
  122. package/libs/components/text-to-speech/text-to-speech.css.map +0 -1
  123. package/libs/components/text-to-speech/text-to-speech.min.css +0 -3
  124. package/libs/index.css +0 -1
  125. package/libs/index.css.map +0 -1
  126. package/src/components/alert-dialog/alert-dialog.stories.tsx +0 -35
  127. package/src/components/alert-dialog/alert-dialog.tsx +0 -76
  128. package/src/components/dialog/view/dialog-header.tsx +0 -32
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/buttons/button.tsx","../src/components/cards/card.tsx","../src/components/form/fields.tsx","../src/components/layout/landmarks.tsx","../src/components/images/img.tsx","../src/components/form/inputs.tsx","../src/components/fp.tsx","../src/components/link/link.tsx","../src/components/list/list.tsx","../src/components/modal/modal.tsx","../src/components/modal/dialog.tsx","../src/components/nav/nav.tsx","../src/components/popover/popover.tsx","../src/components/tables/table-elements.tsx","../src/components/tables/table.tsx","../src/components/tag/tag.tsx","../src/components/details/details.tsx","../src/components/text/text.tsx","../src/components/form/textarea.tsx","../src/components/heading/heading.tsx","../src/components/breadcrumbs/breadcrumb.tsx","../src/libs/content.ts","../src/components/text-to-speech/TextToSpeech.tsx","../src/components/text-to-speech/useTextToSpeech.tsx","../src/components/text-to-speech/views/TextToSpeechControls.tsx","../src/components/dialog/dialog.tsx","../src/components/dialog/view/dialog-header.tsx"],"names":["React","Button","type","children","styles","disabled","classes","onPointerDown","onPointerOver","onPointerLeave","onClick","props","handlePointerDown","e","ui_default","button_default","Title","className","as","Content","Footer","Card","elm","id","Field","label","labelFor","Landmarks","Header","headerBackground","Main","Aside","Section","Article","Img","src","alt","width","height","loading","placeholder","fetchpriority","decoding","imgLoaded","imgError","FP","defaultStyles","ref","Component","styleObj","fp_default","Input","name","value","isDisabled","readonly","required","onChange","onBlur","handleChange","handleBlur","handleKeyDown","Link","href","target","rel","prefetch","btnStyle","relValue","link_default","ListItem","List","variant","role","list_default","ModalDialog","modalRef","openOnMount","dialog_default","Modal","openChild","closeChild","modalHeader","modalFooter","showOpen","dialogRef","openModal","closeModal","NavList","isBlock","NavItem","Nav","Popover","popoverTrigger","hoverRef","popOverRef","isVisible","popoverPosition","handlePointerEvent","handlePointerLeave","use_popover_default","popoverStyles","Caption","Thead","Tbody","Tr","Td","Table","dataStyle","RenderHead","data","head","item","index","RenderBody","rec","RenderTable","tblBody","tblCaption","tblHead","Tag","Details","summary","icon","ariaLabel","open","onToggle","onPointerDownCallback","Text","text","Textarea","rows","cols","readOnly","textarea_default","Heading","ui","heading_default","Truncate","str","length","Items","Breadcrumb","startRoute","startRouteUrl","currentRoute","spacer","routes","ariaLabelPrefix","truncateLength","linkProps","currentPath","setCurrentPath","path","getPathName","pathSegment","route","segments","segment","lastSegment","uuid","currentSegment","url","useState","useEffect","useTextToSpeech","initialVoice","availableVoices","setAvailableVoices","currentVoice","setCurrentVoice","isSpeaking","setIsSpeaking","isPaused","setIsPaused","utterance","setUtterance","updateVoices","voices","googleVoice","voice","englishVoice","options","onEnd","TTSButtonComponent","TTSButton","TextToSpeechControls","onSpeak","onPause","onResume","onCancel","icon_default","TextToSpeechControls_default","TextToSpeech","initialText","showTextInput","pitch","rate","language","speak","pause","resume","cancel","getAvailableLanguages","setText","handleSpeak","handleEnd","DialogHeader","dialogTitle","onClose","dialog_header_default","Dialog","isOpen","onOpen","showDialogHeader","isAlertDialog","dialogOpen","setDialogOpen","handleCancelEvent","handleCloseEvent","closeDialog"],"mappings":"kGACA,OAAOA,OAAW,QAUX,IAAMC,EAAS,CAAC,CACrB,KAAAC,EAAO,SACP,SAAAC,EACA,OAAAC,EACA,SAAAC,EACA,QAAAC,EACA,cAAAC,EACA,cAAAC,EACA,eAAAC,EACA,QAAAC,EACA,GAAGC,CACL,IAAmB,CAMjB,IAAMC,EAAqBC,GAA6C,CACjER,GACHE,IAAgBM,CAAC,CAErB,EAqCA,OACEb,GAAA,cAACc,EAAA,CACC,GAAG,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A,GAAa,YAAc,eDhBpB,IAAMI,GAAS,CAAC,CACrB,OAAAC,EAAS,GACT,YAAAJ,EAAc,SACd,OAAAK,EACA,QAAAJ,EACA,SAAAnB,EACA,iBAAAwB,EAAmB,GACnB,cAAAC,EACA,SAAApN,EACA,GAAGQ,CACL,IAAgC,CAC9B,IAAM0E,EAAYrF,EAAM,OAA0B,IAAI,EAChD,CAACwN,EAAYC,CAAa,EAAIzN,EAAM,SAASoN,CAAM,EAEzDpN,EAAM,UAAU,IAAM,CAChBoN,GAAUC,IACZhI,EAAU,SAAS,UAAU,EAC7BgI,EAAO,GAETI,EAAcL,CAAM,CACtB,EAAG,CAACA,CAAM,CAAC,EAEX,IAAMM,EAAqB7M,GAA+C,CACpEA,EAAE,gBAAkBA,EAAE,QACpBiL,GACFA,EAAS,CAGf,EAEM6B,EAAoB9M,GAA+C,CACnEA,EAAE,gBAAkBA,EAAE,SACpBoM,GACFA,EAAQ,EAEVG,EAAS,GACT/H,EAAU,SAAS,MAAM,EAE7B,EAEMuI,EAAc,IAAM,CACpBX,GACFA,EAAQ,EAEVG,EAAS,GACT/H,EAAU,SAAS,MAAM,CAC3B,EAEA,OACErF,EAAA,cAACc,EAAA,CACC,GAAG,SACH,KAAM0M,EACN,IAAKnI,EACL,KAAMkI,EAAgB,cAAgB,OACtC,SAAUG,EACV,QAASC,EACR,GAAGhN,GAEH2M,GACCtN,EAAA,cAACkN,GAAA,CAAa,YAAaF,EAAa,QAASY,EAAa,EAE/DzN,CACH,CAEJ,EAEO2E,GAAQ9E,EAAM,KAAKmN,EAAM,EAChCA,GAAO,YAAc","sourcesContent":["import UI from '../ui'\nimport React from 'react'\n\nexport type ButtonProps = Partial<React.ComponentProps<typeof UI>> & {\n /**\n * The button type\n * Required - 'button' | 'submit' | 'reset'\n */\n type: 'button' | 'submit' | 'reset'\n }\n\nexport const Button = ({\n type = 'button',\n children,\n styles,\n disabled,\n classes,\n onPointerDown,\n onPointerOver,\n onPointerLeave,\n onClick,\n ...props\n}: ButtonProps) => {\n /**\n * Handles the pointer down event on the button.\n * Only triggers the onPointerDown callback if the button is not disabled.\n * @param e The pointer event object from the button element\n */\n const handlePointerDown = (e: React.PointerEvent<HTMLButtonElement>) => {\n if (!disabled) {\n onPointerDown?.(e)\n }\n }\n\n /**\n * Handles the pointer over event on the button.\n * Only triggers the onPointerOver callback if the button is not disabled.\n * @param e The pointer event object from the button element\n */\n const handlePointerOver = (e: React.PointerEvent<HTMLButtonElement>) => {\n if (!disabled) {\n onPointerOver?.(e)\n }\n }\n\n /**\n * Handles the pointer leave event on the button.\n * Only triggers the onPointerLeave callback if the button is not disabled.\n * @param e The pointer event object from the button element\n */\n const handlePointerLeave = (e: React.PointerEvent<HTMLButtonElement>) => {\n if (!disabled) {\n onPointerLeave?.(e)\n }\n }\n\n /**\n * Handles the click event on the button.\n * Only triggers the onClick callback if the button is not disabled.\n * @param e The mouse event object from the button element\n */\n const handleOnClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n if (!disabled) {\n onClick?.(e)\n }\n }\n\n\n /* Returning a button element. */\n return (\n <UI\n as=\"button\"\n type={type}\n onPointerOver={handlePointerOver}\n onPointerDown={handlePointerDown}\n onPointerLeave={handlePointerLeave}\n onKeyDown={handlePointerDown}\n style={styles}\n className={classes}\n aria-disabled={disabled}\n onClick={handleOnClick}\n {...props}\n >\n {children}\n </UI>\n )\n //\n}\n\nexport default Button\nButton.displayName = 'Button'\n","import React from 'react'\nimport UI from '#components/ui'\n\n/*\n * CardProps interface\n *\n * Extends ComponentProps. Defines props for the Card component.\n *\n * @property {('div' | 'aside' | 'section' | 'article')} [elm='div'] - HTML element to render as\n */\nexport type CardProps = {\n elm?: 'div' | 'aside' | 'section' | 'article'\n title?: React.ReactNode\n footer?: React.ReactNode\n} & React.ComponentProps<typeof UI>\n\n/*\n * Title component\n *\n * Renders a title for the Card component using the UI component.\n *\n * @param {Object} props - Component props\n * @param {ReactNode} props.children - Title content\n * @param {string} [props.className] - Additional CSS classes\n * @param {Object} [props.styles] - Inline styles\n *\n * @returns {ReactElement} Title component\n */\nexport const Title = ({\n children,\n className,\n styles,\n as = 'h3',\n ...props\n}: React.PropsWithChildren<{\n className?: string\n styles?: React.CSSProperties\n as?: React.ElementType\n}>) => {\n return (\n <UI\n as={as}\n className={`card-title ${className || ''}`}\n styles={styles}\n {...props}\n >\n {children}\n </UI>\n )\n}\n\nTitle.displayName = 'Title'\n\n/*\n * CardContent component\n *\n * Renders the content of the Card component using the UI component with an article element.\n *\n * @param {Object} props - Component props\n * @param {ReactNode} props.children - Content\n * @param {string} [props.className] - Additional CSS classes\n * @param {Object} [props.styles] - Inline styles\n *\n * @returns {ReactElement} CardContent component\n */\nexport const Content = ({\n children,\n className,\n styles,\n ...props\n}: React.PropsWithChildren<{\n className?: string\n styles?: React.CSSProperties\n}>) => {\n return (\n <UI\n as=\"article\"\n className={`card-content ${className || ''}`}\n styles={styles}\n {...props}\n >\n {children}\n </UI>\n )\n}\n\nContent.displayName = 'Content'\n\n/*\n * Footer component\n *\n * Renders a footer section for the Card component using the UI component.\n *\n * @param {Object} props - Component props\n * @param {ReactNode} props.children - Footer content\n * @param {string} [props.className] - Additional CSS classes\n * @param {Object} [props.styles] - Inline styles\n *\n * @returns {ReactElement} Footer component\n */\nexport const Footer = ({\n children,\n className,\n styles,\n ...props\n}: React.PropsWithChildren<{\n className?: string\n styles?: React.CSSProperties\n}>) => {\n return (\n <UI\n as=\"div\"\n className={`card-footer ${className || ''}`}\n styles={styles}\n {...props}\n >\n {children}\n </UI>\n )\n}\n\nFooter.displayName = 'Footer'\n\n/*\n * Card component\n *\n * Renders a card container.\n *\n * @param {CardProps} props - Component props\n * @param {('div' | 'aside' | 'section' | 'article')} [props.elm='div'] - Element to render as\n * @param {Object} [props.styles] - CSS styles to apply\n * @param {ReactNode} props.children - Card content\n * @param {boolean} [props.renderStyles=true] - Whether to render default styles\n * @param {string} [props.dataStyle] - data-card attribute value\n * @param {string} [props.id] - Unique ID\n * @returns {ReactElement} Card component\n */\nexport const Card = ({\n elm = 'div',\n styles,\n children,\n classes = 'shadow',\n id,\n ...props\n}: CardProps) => {\n return (\n <UI\n as={elm}\n id={id}\n styles={styles}\n className={classes}\n data-card\n {...props}\n >\n {children}\n </UI>\n )\n}\n\nexport default Card\nCard.displayName = 'Card'\nCard.Title = Title\nCard.Content = Content\nCard.Footer = Footer\n","import React from 'react'\nimport UI from '../ui'\n\nexport type FieldProps = {\n /**\n * The label content\n */\n label: React.ReactNode\n children: React.ReactNode\n} & React.ComponentProps<'label'> &\n Partial<React.ComponentProps<typeof UI>>\n/**\n * Field component that renders a label and children wrapped in a div element.\n * @param labelFor Defines the for attribute of the label element\n * @param styles Custom styles to be applied to the component\n * @param label The label content\n * @param children The children to be rendered inside the component\n * @param props Additional props to be spread to the component\n */\nexport const Field = ({\n label,\n labelFor,\n id,\n styles,\n classes,\n children,\n ...props\n}: FieldProps) => {\n return (\n <UI\n as=\"div\"\n id={id}\n styles={styles}\n className={classes}\n data-style=\"fields\"\n {...props}\n >\n <label htmlFor={labelFor}>{label}</label>\n {children}\n </UI>\n )\n}\n\nexport default Field\nField.displayName = 'Field'\n","import UI from '../ui'\nimport React, { ReactNode } from 'react'\n\ntype ComponentProps = React.ComponentProps<typeof UI>\n\n/**\n * Renders children elements without any wrapping component.\n * Can be used as a placeholder when no semantic landmark is needed.\n */\nexport const Landmarks = (children?: React.FC) => <>{children}</>\n\ntype HeaderProps = {\n headerBackground?: ReactNode\n} & ComponentProps\n/**\n * Header component.\n *\n * Renders a header landmark with a section child.\n *\n * @param children - The content to render inside the header.\n * @param styles - Optional styles object.\n * @param props - Other props.\n */\nexport const Header = ({\n id,\n children,\n headerBackground,\n styles,\n classes,\n ...props\n}: HeaderProps) => {\n return (\n <UI as=\"header\" id={id} styles={styles} className={classes} {...props}>\n {headerBackground}\n <UI as=\"section\">{children}</UI>\n </UI>\n )\n}\n\n/**\n * Main component.\n *\n * Renders a main landmark.\n *\n * @param children - The content to render inside the main element.\n * @param styles - Optional styles object.\n * @param props - Other props.\n */\nexport const Main = ({\n id,\n children,\n styles,\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"main\" id={id} styles={styles} {...props} className={classes}>\n {children}\n </UI>\n )\n}\n\n/**\n * Footer component that renders a footer element with a section element inside.\n * @param {ReactNode} children - Child elements to render inside the section element.\n * @param styles - CSS styles to apply to the footer element.\n * @param props - Additional props to pass to the footer element.\n * @returns A React component that renders a footer element with a section element inside.\n */\nexport const Footer = ({\n id,\n classes,\n children,\n styles = {},\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"footer\" id={id} className={classes} styles={styles} {...props}>\n <UI as=\"section\">{children || 'Copyright © 2022'}</UI>\n </UI>\n )\n}\n\nexport const Aside = ({\n id,\n children,\n styles = {},\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"aside\" id={id} styles={styles} className={classes} {...props}>\n <UI as=\"section\">{children}</UI>\n </UI>\n )\n}\n\n/**\n * Section component that renders a section element.\n *\n * @param children - Child elements to render inside the section.\n * @param styles - CSS styles to apply to the section.\n * @param props - Other props.\n */\nexport const Section = ({\n id,\n children,\n styles,\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"section\" id={id} styles={styles} className={classes} {...props}>\n {children}\n </UI>\n )\n}\n\n/**\n * Article component renders an HTML <article> element.\n *\n * @param children - Child elements to render inside the article.\n * @param styles - CSS styles to apply to the article.\n * @param props - Additional props to pass to the article element.\n */\nexport const Article = ({\n id,\n children,\n\n styles,\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"article\" id={id} styles={styles} className={classes} {...props}>\n {children}\n </UI>\n )\n}\n\nexport default Landmarks\n\nLandmarks.displayName = 'Landmarks'\nLandmarks.Header = Header\nLandmarks.Main = Main\nLandmarks.Footer = Footer\nLandmarks.Aside = Aside\nLandmarks.Section = Section\nLandmarks.Article = Article\n","import UI from '../ui'\nimport React from 'react'\n/*\n * ImageProps interface\n *\n * Extends ComponentProps and defines additional props for the Img component.\n *\n * @property {string} [src] - The image source URL\n * @property {string} alt - Required alt text for image accessibility\n * @property {number} width - Required width of image\n * @property {number} [height] - Optional height of image\n * @property {\"eager\" | \"lazy\"} [loading=\"lazy\"] - Loading behavior\n * @property {string} [placeholder] - Fallback placeholder image\n * @property {\"high\" | \"low\"} [fetchpriority=\"low\"] - Image fetch priority\n * @property {\"sync\" | \"async\" | \"auto\"} [decoding=\"auto\"] - Decode setting\n * @property {function} [imgError] - Error callback\n * @property {function} [imgLoaded] - Loaded callback\n */\nexport type ImageProps = React.ComponentProps<'img'> &\n React.ComponentProps<typeof UI>\n\n/*\n * Img component\n *\n * Renders an <img> element with custom props.\n *\n * @param {string} src - The image source URL.\n * @param {string} alt - The alt text for the image.\n * @param {number} [width=480] - The width of the image.\n * @param {number} [height] - The height of the image.\n * @param {Object} [styles] - Additional CSS styles to apply.\n * @param {boolean} [renderStyles=true] - Whether to render the default styles.\n * @param {\"eager\" | \"lazy\"} [loading=\"lazy\"] - The loading attribute.\n * @param {string} [placeholder] - A placeholder image URL.\n * @param {\"high\" | \"low\"} [fetchpriority=\"low\"] - The fetchpriority attribute.\n * @param {\"sync\" | \"async\" | \"auto\"} [decoding=\"auto\"] - The decoding attribute.\n * @param {function} [imgLoaded] - Callback when image loads successfully.\n * @param {function} [imgError] - Callback when image errors.\n *\n * @returns {JSX.Element} The Img component.\n */\nexport const Img = ({\n src = '//',\n alt,\n width = 480,\n height,\n styles,\n loading = 'lazy',\n placeholder = `https://via.placeholder.com/${width}?text=PLACEHOLDER`,\n fetchpriority = 'low',\n decoding = 'auto',\n imgLoaded,\n imgError,\n ...props\n}: ImageProps) => {\n const handleImgError = (\n e: React.SyntheticEvent<HTMLImageElement, Event>,\n ): void => {\n if (imgError) {\n imgError?.(e)\n return\n }\n if (e.currentTarget.src !== placeholder) {\n e.currentTarget.src = placeholder\n }\n }\n\n const handleImgLoad = (\n e: React.SyntheticEvent<HTMLImageElement, Event>,\n ): void => {\n imgLoaded?.(e)\n }\n\n return (\n <UI\n as=\"img\"\n src={src}\n alt={alt}\n width={width}\n height={height || 'auto'}\n loading={loading}\n style={styles}\n onError={handleImgError}\n onLoad={handleImgLoad}\n fetchPriority={fetchpriority}\n decoding={decoding}\n {...props}\n />\n )\n}\n\nexport default Img\nImg.displayName = 'Img'\n","import React from 'react'\nimport FP from '../fp'\n\nexport type InputProps = {\n /**\n * The type of the input.\n */\n type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search'\n\n /**\n * Set the element as disabled\n */\n isDisabled?: boolean\n} & React.ComponentProps<typeof FP>\n\n/**\n * Input component that renders an HTML input element.\n * @param {InputProps} props - The input component props.\n * @returns {JSX.Element} - The input component.\n */\nexport const Input = ({\n type = 'text',\n name,\n value,\n placeholder,\n id,\n styles,\n classes,\n isDisabled,\n disabled,\n readonly,\n required,\n ref,\n onChange,\n onBlur,\n onPointerDown,\n ...props\n}: InputProps): JSX.Element => {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange && !disabled) {\n onChange?.(e)\n }\n }\n\n const handleBlur = (e: React.FocusEvent<HTMLInputElement>) => {\n if (onBlur && !disabled) {\n onBlur?.(e)\n }\n }\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (onPointerDown && !disabled) {\n e.preventDefault()\n onPointerDown?.(e)\n }\n }\n\n return (\n <FP\n as=\"input\"\n id={id}\n type={type}\n placeholder={placeholder || `${required ? '*' : ''} ${type} input `}\n className={classes}\n styles={styles}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n value={value}\n name={name}\n ref={ref}\n aria-disabled={isDisabled}\n tabIndex={isDisabled ? -1 : undefined}\n aria-readonly={readonly}\n aria-required={required}\n required={required}\n readOnly={readonly}\n {...props}\n />\n )\n}\n\nInput.displayName = 'Input'\nexport default Input\n","import React from 'react'\nimport { ComponentProps } from '../types'\n\ntype PolymorphicRef<C extends React.ElementType> =\n React.ComponentPropsWithRef<C>['ref']\n\ntype AsProp<C extends React.ElementType> = {\n as?: C\n}\n\ntype PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P)\n\ntype PolymorphicComponentProp<\n C extends React.ElementType,\n Props = {},\n> = React.PropsWithChildren<Props & AsProp<C>> &\n Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>\n\ntype PolymorphicComponentPropWithRef<\n C extends React.ElementType,\n Props = {},\n> = PolymorphicComponentProp<C, Props> & {\n ref?: PolymorphicRef<C>\n}\n\ntype FPProps<C extends React.ElementType> = PolymorphicComponentPropWithRef<\n C,\n {\n renderStyles?: boolean\n styles?: React.CSSProperties\n classes?: string\n }\n>\n\n/*\n * FPComponent type definition\n *\n * Defines the component function signature for the FP component.\n *\n * @typeParam C - The HTML element type to render\n * @param props - The component props\n * @returns React component\n */\ntype FPComponent = <C extends React.ElementType = 'span'>(\n props: FPProps<C>,\n) => React.ReactElement | any\n\n/**\n * FP component is a polymorphic component that renders an HTML element with optional styles.\n * @param {Object} props - Component props\n * @param {React.ElementType} props.as - The HTML element to render. Defaults to 'div'.\n * @param {boolean} props.renderStyles - Whether to render styles or not. Defaults to true.\n * @param {Object} props.styles - The styles to apply to the component.\n * @param {Object} props.defaultStyles - The default styles to apply to the component.\n * @param {React.ReactNode} props.children - The children to render inside the component.\n * @returns {React.ReactElement} - A React component that renders an HTML element with optional styles.\n */\nconst FP: FPComponent = React.forwardRef(\n <C extends React.ElementType>(\n { as, styles, classes, children, defaultStyles, ...props }: FPProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div'\n\n const styleObj = { ...defaultStyles, ...styles } as React.CSSProperties\n\n return (\n <Component ref={ref} style={styleObj} className={classes} {...props}>\n {children}\n </Component>\n )\n },\n)\nexport interface BoxProps extends ComponentProps {\n renderStyles: true\n}\n\nexport default FP\n","import UI from \"../ui\";\nimport React from \"react\";\n\nexport type LinkProps = {\n href?: string;\n\n target?: string;\n\n rel?: string;\n\n children: React.ReactNode;\n\n styles?: React.CSSProperties;\n\n prefetch?: boolean;\n\n btnStyle?: string;\n\n onPointerDown?: (event: React.PointerEvent<HTMLAnchorElement>) => void;\n} & React.ComponentProps<typeof UI> &\n React.ComponentProps<\"a\">;\n\nexport const Link = ({\n href,\n target,\n rel,\n children,\n styles,\n prefetch,\n btnStyle,\n onPointerDown,\n ...props\n}: LinkProps) => {\n let relValue = rel;\n\n if (target === \"_blank\")\n relValue = `noopener noreferrer ${prefetch ? \"prefetch\" : \"\"}`;\n\n const handleOnpointerDown = (e: React.PointerEvent<HTMLAnchorElement>) => {\n if (onPointerDown) onPointerDown?.(e);\n };\n\n return (\n <UI\n as=\"a\"\n href={href}\n target={target}\n styles={styles}\n rel={relValue}\n onPointerDown={handleOnpointerDown}\n data-btn={btnStyle}\n prefetch={prefetch}\n {...props}\n >\n {children}\n </UI>\n );\n};\n\nexport default Link;\nLink.displayName = \"Link\";\n","import * as React from 'react'\nimport UI from '../ui'\n\ntype ListProps = {\n /** Type of list to render (default: 'ul') */\n type?: 'ul' | 'ol' | 'dl'\n /** variant of list to render (default: 'none') */\n variant?: string\n} & React.ComponentProps<typeof UI>\n\nexport type ListItemProps = {\n /** Type of list item to render (default: 'li') */\n type?: 'li' | 'dt' | 'dd'\n} & React.ComponentProps<typeof UI>\n\n/**\n * ListItem component\n * @param type - HTML tag type for the list item (default: 'li')\n * @param styles - CSS styles object\n * @param children - Child elements to be rendered inside the list item\n * @param props - Additional props to be passed to the underlying HTML element\n * @returns A React component that renders a list item\n */\nexport const ListItem = ({\n type = 'li',\n id,\n styles,\n children,\n classes,\n ...props\n}: ListItemProps) => {\n return (\n <UI id={id} as={type} className={classes} {...props} style={styles}>\n {children}\n </UI>\n )\n}\n\n/**\n * List component renders a list element with provided props\n * @param children - Child elements to render inside the list\n * @param classes - CSS classes to apply\n * @param type - Type of list element (default: 'ul')\n * @param variant - Variant for styling purposes\n * @param styles - Inline styles object\n * @param role - ARIA role\n * @param props - Additional props to pass to underlying element\n */\nexport const List = ({\n children,\n classes,\n type = 'ul',\n variant,\n styles,\n role,\n ...props\n}: ListProps) => {\n return (\n <UI\n as={type}\n data-variant={variant}\n className={classes}\n style={styles}\n role={role}\n {...props}\n >\n {children}\n </UI>\n )\n}\n\nexport default List\nList.displayName = 'List'\nList.ListItem = ListItem\n","import React from \"react\";\nimport { ComponentProps } from \"../../types\";\nimport { Button } from \"../buttons/button\";\nimport { ModalDialog } from \"./dialog\";\n\nexport interface ModalProps extends ComponentProps {\n /**\n * The child component/content for open button\n */\n openChild?: React.ReactNode;\n /**\n * The child component/content for close button\n */\n closeChild?: React.ReactNode;\n /**\n * The child component/content for modal header\n */\n modalHeader?: React.ReactNode;\n /**\n * The child component/content for modal footer\n */\n modalFooter?: React.ReactNode;\n /**\n * The child component/content for modal body\n */\n children: React.ReactNode;\n /**\n * Open modal on mount when set to true\n */\n showOpen?: boolean;\n}\nexport const Modal = ({\n openChild,\n closeChild,\n modalHeader,\n modalFooter,\n children,\n showOpen = false,\n ...props\n}: ModalProps) => {\n const dialogRef = React.useRef<HTMLDialogElement>(null);\n const openModal = (): void => {\n if (dialogRef.current) {\n if (showOpen) dialogRef.current.show();\n else dialogRef.current.showModal();\n }\n };\n const closeModal = () => {\n if (dialogRef.current) {\n dialogRef.current.close();\n }\n };\n\n return (\n <>\n <ModalDialog modalRef={dialogRef} openOnMount={showOpen} {...props}>\n <section>\n {modalHeader}\n {children}\n {modalFooter ?? (\n <div>\n <Button\n type=\"button\"\n pointerDown={() => {\n closeModal();\n }}\n >\n {closeChild || \"Close\"}\n </Button>{\" \"}\n </div>\n )}\n </section>\n </ModalDialog>\n {!showOpen && (\n <Button type=\"button\" pointerDown={openModal}>\n {openChild || \"Open Modal\"}\n </Button>\n )}\n </>\n );\n};\n\nModal.displayName = \"Modal\";\n","import UI from \"../ui\";\nimport React from \"react\";\n\nexport type DialogProps = {\n /**\n * React ref for dialog element\n */\n modalRef: React.RefObject<HTMLDialogElement>;\n /**\n * Handle close modal event\n */\n closeModal?: (e: React.SyntheticEvent<HTMLDialogElement>) => void;\n /**\n * open modal on mount\n */\n openOnMount?: boolean;\n} & React.ComponentProps<typeof UI>;\n/**\n * Dialog component\n */\nexport const ModalDialog = ({\n id,\n children,\n classes,\n modalRef,\n openOnMount,\n ...props\n}: DialogProps) => {\n const handleCloseModal = (e: React.SyntheticEvent<HTMLDialogElement>) => {\n if (e.currentTarget === e.target) {\n e.currentTarget.close();\n }\n };\n\n return (\n <UI\n as=\"dialog\"\n id={id}\n classes={classes}\n ref={modalRef}\n open={openOnMount}\n onClick={handleCloseModal}\n {...props}\n >\n {children}\n </UI>\n );\n};\n\nexport default React.memo(ModalDialog);\nModalDialog.displayName = \"Dialog\";\n","import UI from '../ui'\nimport List from '../list/list'\nimport React from 'react'\n\nexport type NavListProps = React.ComponentProps<typeof List> & {\n isBlock?: boolean\n}\nexport type NavItemProps = React.ComponentProps<typeof List.ListItem>\n\nexport type NavProps = React.ComponentProps<typeof UI>\n\n/**\n * Renders a NavList component.\n * @param {Object} props - The props for the component.\n * @param {ReactNode} props.children - The child elements.\n * @param {Object} props - Additional props to spread to the List component.\n * @returns {JSX.Element} The rendered NavList component.\n */\nexport const NavList = ({ isBlock, children, ...props }: NavListProps) => {\n return (\n <List type=\"ul\" {...props} data-list={`unstyled ${isBlock ? 'block' : ''}`}>\n {children}\n </List>\n )\n}\n\n/**\n * Renders a NavItem component.\n * @param {Object} props - The props for the component.\n * @param {string} [props.id] - The id for the component.\n * @param {Object} [props.styles] - The styles for the component.\n * @param {string} [props.classes] - The classes for the component.\n * @param {ReactNode} props.children - The child elements.\n * @param {boolean} [props.inline=true] - Whether the item should display inline.\n * @param {Object} props - Additional props to spread to the ListItem component.\n * @returns {JSX.Element} The rendered NavItem component.\n */\nexport const NavItem = ({\n id,\n styles,\n classes,\n children,\n ...props\n}: NavItemProps) => {\n return (\n <List.ListItem\n type=\"li\"\n id={id}\n classes={classes}\n styles={styles}\n {...props}\n >\n {children}\n </List.ListItem>\n )\n}\n\n/**\n * Renders a Nav component.\n * @param {Object} props - The props for the component.\n * @param {ReactNode} props.children - The child elements.\n * @param {Object} props - Additional props to spread to the UI component.\n * @returns {JSX.Element} The rendered Nav component.\n */\nexport const Nav = ({ children, ...props }: NavProps) => {\n return (\n <UI as=\"nav\" {...props}>\n {children}\n </UI>\n )\n}\n\nexport default Nav\nNav.displayName = 'Nav'\nNav.List = NavList\nNav.Item = NavItem\n","import React from 'react'\nimport usePopover from '#hooks/popover/use-popover'\n\n/**\n * Interface for props accepted by the Popover component\n *\n * @property {ReactNode} children - The content to show in the popover\n * @property {ReactNode} [content] - Optional alternative content for popover\n */\nexport type PopoverProps = {\n children: React.ReactNode\n popoverTrigger: React.ReactNode\n styles?: {}\n}\n\nexport const defaultStyles = {\n display: 'block',\n position: 'absolute',\n background: '#000',\n border: '1px solid #010101',\n padding: '10px',\n color: '#fff',\n transition: 'opacity .5s ease-in-out',\n} as React.CSSProperties\n\n/**\n * Popover component to display popover content.\n *\n * @param props - The props for the component\n * @param props.children - The content to show in the popover\n * @param props.popoverTrigger - The element that triggers the popover on hover\n *\n * @returns JSX.Element - The rendered JSX element for the Popover\n * @example - <Popover popoverTrigger={<button>Hover here</button>}>Popover content</Popover>\n *\n * The component uses the usePopover hook to handle popover visibility and positioning.\n *\n * It renders the triggerElement, and conditionally renders the popover content\n * positioned absolutely when visible.\n *\n * Inline styles handle visuals like background, border, padding, etc.\n *\n * Transforms and opacity animate the enter/exit transition of the popover.\n */\n\nexport const Popover = ({\n children,\n popoverTrigger,\n styles,\n ...props\n}: PopoverProps): JSX.Element => {\n const hoverRef = React.useRef(null)\n const popOverRef = React.useRef(null)\n const { isVisible, popoverPosition, handlePointerEvent, handlePointerLeave } =\n usePopover(hoverRef, popOverRef)\n const popoverStyles = {\n opacity: isVisible ? 1 : 0,\n top: popoverPosition.top,\n left: popoverPosition.left,\n // transform: `translateY(${isVisible ? '0px' : '-50px'})`,\n zIndex: 999,\n } as React.CSSProperties\n\n return (\n <>\n <div\n ref={hoverRef}\n onPointerEnter={handlePointerEvent}\n onPointerLeave={handlePointerLeave}\n {...props}\n >\n {popoverTrigger}\n </div>\n {isVisible && (\n <div ref={popOverRef} style={{ ...popoverStyles, ...styles }}>\n {children}\n </div>\n )}\n </>\n )\n}\n\nexport default Popover\nPopover.displayName = 'Popover'\nPopover.styles = defaultStyles\n","import FP from '../fp'\nimport { ComponentProps } from '../../types'\nimport React from 'react'\n\n\nexport const Caption = ({ children, ...props }: ComponentProps) => {\n return (\n <FP as=\"caption\" {...props}>\n {children}\n </FP>\n )\n}\n\nexport const Thead = ({ children, ...props }: ComponentProps) => (\n <FP as=\"thead\" {...props}>\n {children}\n </FP>\n)\n\nexport const Tbody = ({ children, ...props }: ComponentProps) => (\n <FP as=\"tbody\" {...props}>\n {children}\n </FP>\n)\n\nexport const Tr = ({ children, ...props }: ComponentProps) => (\n <FP as=\"tr\" {...props}>\n {children}\n </FP>\n)\n\nexport const Td = ({ children, ...props }: ComponentProps) => (\n <FP as=\"td\" {...props}>\n {children}\n </FP>\n)\n\nexport const Table = ({ id, dataStyle, children, ...props }: ComponentProps) => {\n return (\n <FP\n as=\"section\"\n id={id}\n {...props}\n data-style=\"table-wrapper\"\n >\n <table>{children}</table>\n </FP>\n )\n}\n\nTable.displayName = 'Table'\nCaption.displayName = 'Caption'\nThead.displayName = 'Thead'\nTbody.displayName = 'Tbody'\nTr.displayName = 'Tr'\nTd.displayName = 'Td'\n\n","import { Table, Caption, Thead, Tbody, Td, Tr } from './table-elements'\nimport { ComponentProps } from '../../types'\n\nimport React from 'react'\n\nexport interface TableProps extends ComponentProps {\n tblHead: React.ReactNode\n tblBody: React.ReactNode\n tblCaption?: React.ReactNode\n}\n\nexport type dataType = { id: number; items: string[] }[]\n\n/**\n * Render the `thead` by passing an array of names\n */\nexport const RenderHead = (data: []) => {\n const head = data.map((item, index) => {\n return <th key={index}>{item}</th>\n })\n return <tr>{head}</tr>\n}\n\n/**\n * Render the table body `tr`, `td` with the data provided\n */\nexport const RenderBody = (data: {}[]) => {\n const rec = data.map((item, index) => {\n return (\n <tr key={index}>\n {/* <td>{item?.id}</td>\n <td>{item?.items}</td> */}\n </tr>\n )\n })\n return <Tbody>{rec}</Tbody>\n}\n\n/**\n * Render the table placing `caption`, `thead` and `tbody` in the correct order\n * caption is optional\n */\nexport const RenderTable = ({ tblBody, tblCaption, tblHead }: TableProps) => {\n return (\n <Table>\n {tblCaption && <Caption>{tblCaption}</Caption>}\n <Thead>\n <Tr>{tblHead}</Tr>\n </Thead>\n <Tbody>{tblBody}</Tbody>\n </Table>\n )\n}\n\nRenderTable.displayName = 'TBL'\nRenderBody.displayName = 'renderBody'\nRenderHead.displayName = 'renderHead'\n","import React from 'react'\nimport UI from '#components/ui'\n\nexport type TagProps = {\n /** HTML element to display the badge as span or p */\n elm?: 'span' | 'p'\n /** Aria role for the component - conditional */\n role: 'note' | 'status'\n} & React.ComponentProps<typeof UI>\n\nexport const Tag = ({\n elm = 'span',\n role = 'note',\n children,\n styles,\n ...props\n}: TagProps) => {\n return (\n <UI as={elm} role={role} styles={styles} {...props}>\n {children}\n </UI>\n )\n}\nexport default Tag\nTag.displayName = 'Tag'\n","import UI from \"#components/ui\";\nimport React from \"react\";\n\ntype DetailsProps = {\n /**\n * The summary text shown for the details.\n * Required.\n */\n summary: React.ReactNode;\n\n /**\n * The aria-label element for accessibility.\n */\n ariaLabel: string;\n} & React.ComponentProps<\"details\"> &\n Partial<React.ComponentProps<typeof UI>>;\n\n/**3\n * Details component props interface.\n *\n * @param {React.CSSProperties} [styles] - CSS styles object.\n * @param {string} [classes] - Classnames string.\n * @param {boolean} [open] - Whether the details is open.\n * @param {(e: React.PointerEvent<HTMLDetailsElement>) => void} [onToggle] - onToggle callback.\n * @param {(e: React.PointerEvent<HTMLDetailsElement>) => void} [onPointerDown] - onPointerDown callback.\n * @param {ReactNode} children - The content inside the details.\n * @param {string} [ariaLabel] - aria-label for accessibility.\n * @param {React.Ref<any>} [ref] - Ref object.\n * @param {Object} props - Other props.\n */\nexport const Details = ({\n summary,\n icon,\n styles,\n classes,\n ariaLabel,\n name,\n open,\n onPointerDown,\n onToggle,\n children,\n ref,\n ...props\n}: DetailsProps) => {\n const defaultStyles: React.CSSProperties = { ...styles };\n\n const onPointerDownCallback = (e: React.PointerEvent<HTMLDetailsElement>) => {\n if (onPointerDown) onPointerDown?.(e);\n if (onPointerDown) onPointerDown?.(e);\n };\n\n const onToggleCallback = (e: React.PointerEvent<HTMLDetailsElement>) => {\n if (onToggle) onPointerDown?.(e);\n };\n return (\n <UI\n as=\"details\"\n style={defaultStyles}\n className={classes}\n onToggle={onToggleCallback}\n ref={ref}\n open={open}\n aria-label={ariaLabel || \"Details dropdown\"}\n // aria-roledescription=\"detail accordion\"\n name={name}\n {...props}\n >\n <UI as=\"summary\" onPointerDown={onPointerDownCallback}>\n {icon}\n {summary}\n </UI>\n <UI as=\"section\">{children}</UI>\n </UI>\n );\n};\n\nexport default Details;\nDetails.displayName = \"Details\";\n","// import FP from '../fp'\nimport React from 'react'\nimport UI from '#components/ui'\n\ntype InheritedProps = React.ComponentProps<typeof UI>\n\ntype TextElements =\n | 'a'\n | 'b'\n | 'blockquote'\n | 'b'\n | 'blockquote'\n | 'cite'\n | 'code'\n | 'em'\n | 'i'\n | 'em'\n | 'i'\n | 'kbd'\n | 'mark'\n | 'p'\n | 's'\n | 'small'\n | 'span'\n | 'span'\n | 'strong'\n | 'mark'\n | 'p'\n | 's'\n | 'small'\n | 'span'\n | 'span'\n | 'strong'\n | 'sub'\n | 'sup'\n | 'time'\n | 'time'\n | 'u'\n\nexport type TextProps = {\n /**\n * Text element to to use\n * Text element to to use\n */\n elm?: TextElements\n /** Pass a text element or string */\n text?: string\n} & InheritedProps\n\nexport const Text = ({\n elm = 'p',\n id,\n text,\n styles,\n classes,\n children,\n ...props\n}: TextProps) => {\n return (\n <UI as={elm} id={id} styles={styles} className={classes} {...props}>\n <UI as={elm} id={id} styles={styles} className={classes} {...props}>\n {children || text}\n </UI>\n </UI>\n )\n}\n\ntype TitleProps = {\n /**\n * HTML headings\n */\n elm?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n} & InheritedProps\n\nexport const Title = ({\n elm = 'h3',\n id,\n children,\n styles,\n classes,\n ...props\n}: TitleProps) => {\n return (\n <Text as={elm} id={id} styles={styles} className={classes} {...props}>\n {children}\n </Text>\n )\n}\n\nexport default Text\n\nText.displayName = 'Text'\nTitle.displayName = 'Title'\n","import React from 'react'\nimport UI from '../ui'\n\nexport type TextareaProps = React.ComponentProps<'textarea'> &\n React.ComponentProps<typeof UI>\n\n/**\n * Textarea component.\n *\n * @param value - The value of the textarea.\n * @param rows - The number of rows.\n * @param cols - The number of columns.\n * @param id - The id of the textarea.\n * @param name - The name of the textarea.\n * @param required - Whether the textarea is required.\n * @param disabled - Whether the textarea is disabled.\n * @param readOnly - Whether the textarea is read only.\n * @param onBlur - Blur event handler.\n * @param onPointerDown - Pointer down event handler.\n * @param onChange - Change event handler.\n * @param ref - Ref for the textarea.\n * @param styles - Styles object for the textarea.\n * @param textareaRef - Ref specifically for the textarea element.\n * @param props - Other props.\n */\nexport const Textarea = ({\n id,\n classes,\n value,\n rows = 5,\n cols = 25,\n name,\n required,\n disabled,\n readOnly,\n onBlur,\n onPointerDown,\n onChange,\n ref,\n styles,\n placeholder,\n ...props\n}: TextareaProps) => {\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (onChange && !disabled) {\n onChange?.(e)\n }\n }\n\n const handleBlur = (e: React.FocusEvent<HTMLTextAreaElement>) => {\n if (onBlur && !disabled) {\n onBlur?.(e)\n }\n }\n\n const handlePointerDown = (e: React.PointerEvent<HTMLTextAreaElement>) => {\n if (onPointerDown && !disabled) {\n onPointerDown?.(e)\n }\n }\n\n return (\n <UI\n as=\"textarea\"\n id={id}\n name={name}\n rows={rows}\n cols={cols}\n styles={styles}\n className={classes}\n data-style=\"textarea\"\n required={required}\n value={value}\n aria-disabled={disabled}\n readOnly={readOnly}\n onChange={handleChange}\n onBlur={handleBlur}\n onPointerDown={handlePointerDown}\n ref={ref}\n placeholder={placeholder || `${required ? '*' : ''} Message`}\n {...props}\n />\n )\n}\n\nexport default Textarea\nTextarea.displayName = 'Textarea'\n","import React from 'react'\nimport UI from '#components/ui'\nimport { type } from 'os'\n\nexport type TitleProps = {\n children: React.ReactNode\n type: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n ui?: string\n} & React.ComponentProps<typeof UI>\n\nconst Heading = ({\n type = 'h3',\n id,\n styles,\n ui,\n children,\n ...props\n}: TitleProps) => {\n return (\n <UI as={type} id={id} styles={styles} data-ui={ui} {...props}>\n {children}\n </UI>\n )\n}\n\nexport default Heading\nHeading.displayName = 'Heading'\n","// Code: Breadcrumb component\nimport React from 'react'\nimport UI from '#components/ui'\nimport { Truncate } from '#libs/content'\nimport Link from '#components/link/link'\n\n// TYPES\n\ntype customRoute = {\n /** The path or id for routing */\n path?: string\n /** The display name */\n name: string\n /** The url if linking out */\n url?: string\n}\n\ntype BreadcrumbProps = {\n /** Array of custom route objects */\n routes?: customRoute[]\n /** Starting route node */\n startRoute?: React.ReactNode\n /* Starting route url */\n startRouteUrl?: string\n /** Spacer node between routes */\n spacer?: React.ReactNode\n /** String representing current route */\n currentRoute?: string\n /** Prefix breadcrumb aria-label - \"prefix breadcrumb\" */\n ariaLabelPrefix?: string\n /** Truncate breadcrumb text after this length */\n truncateLength?: number\n /** Link props for breadcrumb links */\n linkProps?: React.ComponentProps<typeof Link>\n} & React.ComponentProps<typeof UI>\n\n// Components\n\n/**\n * Items component.\n *\n * @param styles - Styles object for the item.\n * @param id - Id for the item.\n * @param classes - Class names for the item.\n * @param children - Child components.\n * @param props - Other props.\n */\nconst Items = ({\n styles,\n id,\n classes,\n children,\n ...props\n}: React.ComponentProps<typeof UI>) => {\n return (\n <li data-list=\"unstyled inline\" {...props}>\n {children}\n </li>\n )\n}\n\n/**\n * List component.\n *\n * @param children - The content to render inside the list.\n * @param props - Additional props to pass to the UI component.\n */\nconst List = ({ children, ...props }: React.ComponentProps<typeof UI>) => {\n return (\n <UI as=\"ol\" data-list=\"unstyled inline\" {...props}>\n {children}\n </UI>\n )\n}\n\n/**\n * Nav component.\n *\n * @param styles - Styles object for the nav.\n * @param id - Id for the nav.\n * @param classes - Class names for the nav.\n * @param children - Child components.\n * @param props - Other props.\n */\nconst Nav = ({\n styles,\n id,\n classes,\n children,\n ...props\n}: React.ComponentProps<typeof UI>) => {\n return (\n <UI as=\"nav\" id={id} styles={styles} className={classes} {...props}>\n <List>{children}</List>\n </UI>\n )\n}\n\n/**\n * Navigation component for breadcrumbs.\n *\n * @param props - Props for the navigation component.\n * @param props.startRoute - Starting route node. Default 'Home'.\n * @param props.currentRoute - String representing current route.\n * @param props.spacer - Spacer node between routes. Default '&#47;'.\n * @param props.routes - Array of custom route objects.\n * @param props.styles - Styles object for the nav.\n * @param props.id - Id for the nav.\n * @param props.classes - Class names for the nav.\n * @param props.children - Child components.\n */\nexport const Breadcrumb = ({\n startRoute = 'Home',\n startRouteUrl = \"/\",\n currentRoute,\n spacer = <>&#47;</>,\n routes,\n styles,\n id,\n classes,\n ariaLabelPrefix,\n truncateLength = 15,\n linkProps,\n ...props\n}: BreadcrumbProps): React.JSX.Element => {\n const [currentPath, setCurrentPath] = React.useState('')\n React.useEffect(() => {\n const path = currentRoute || window.location.pathname\n if (path.length) {\n setCurrentPath(path)\n }\n }, [currentRoute])\n\n /**\n * Gets the path name for the given path segment.\n *\n * @param pathSegment - The path segment (string or number) to get the path name for.\n * @returns The path name object for the given path segment.\n */\n const getPathName = (pathSegment: string): customRoute => {\n const route = routes?.find((route) => route.path === pathSegment)\n\n return {\n path: route?.path || pathSegment,\n name: route?.name || pathSegment,\n url: route?.url || pathSegment,\n }\n }\n\n /** Array of path segments from current path */\n const segments = currentPath.split('/').filter((segment) => segment)\n /** Index of last item in segments array */\n const lastSegment = segments.length - 1\n\n /** Unique id for breadcrumb */\n const uuid = React.useId()\n\n\n return currentPath.length ? (\n <Nav\n id={id}\n {...props}\n styles={styles}\n className={classes}\n aria-label={ariaLabelPrefix}\n >\n <Items key={`${startRoute}-${uuid}`}>\n <Link href={startRouteUrl} {...linkProps}>{startRoute}</Link>\n </Items>\n <>\n {segments.length ? (\n segments.map((segment: any, index: number) => {\n const currentSegment = getPathName(segment)\n const { name, url, path } = currentSegment\n return index === lastSegment ? (\n <>\n {typeof segments[lastSegment] === 'string' &&\n segments[lastSegment].length > 3 &&\n segments[lastSegment] !== segments[lastSegment - 1] && (\n <Items key={`${path || index}-${uuid}`}>\n \n <span aria-hidden=\"true\">{spacer}</span>\n <a\n href=\"#\"\n aria-current=\"page\"\n aria-label={\n name.length > truncateLength ? name : undefined\n }\n >\n {Truncate(decodeURIComponent(name), truncateLength)}\n </a>\n \n </Items>\n )}\n </>\n ) : (\n <Items key={`${currentSegment?.name}-${uuid}`}>\n <span aria-hidden=\"true\">{spacer}</span>\n <span>\n <Link\n href={url}\n aria-label={name.length > truncateLength ? name : undefined}\n {...linkProps}\n >\n {Truncate(decodeURIComponent(name), truncateLength)}\n </Link>\n </span>\n </Items>\n );\n })\n ) : (\n null\n )}\n </>\n </Nav>\n ) : (\n <></>\n )\n}\n\nexport default Breadcrumb\n\nBreadcrumb.displayName = 'BreadCrumb'\nBreadcrumb.Nav = Nav\nBreadcrumb.List = List\nBreadcrumb.Items = Items\n","/**\n * Converts a string to a slug by:\n * - Converting to lowercase\n * - Trimming whitespace\n * - Removing non-word and non-hyphen characters\n * - Replacing sequences of whitespace and hyphens with a single hyphen\n * - Removing leading and trailing hyphens\n *\n * @param str - The string to slugify\n * @returns The slugified string\n */\nexport const Slugify = (str: string) => {\n return str\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, '')\n .replace(/[\\s_-]+/g, '-')\n .replace(/^-+|-+$/g, '')\n}\n\n/**\n * Truncates a string to a maximum length.\n *\n * @param str - The string to truncate.\n * @param length - The maximum length of the truncated string. Defaults to 15.\n * @returns The truncated string, with ellipses appended if truncated.\n */\nexport const Truncate = (str: string, length: number = 15) => {\n return str.length > length ? `${str.slice(0, length)}...` : str\n}\n","import React, { useState, ChangeEvent, useEffect } from 'react'\nimport { useTextToSpeech } from './useTextToSpeech'\nimport Textarea from '#components/form/textarea.jsx'\nimport TextToSpeechControls from './views/TextToSpeechControls'\n\n/**\n * Props for the TextToSpeechComponent.\n * @interface TextToSpeechComponentProps\n */\ninterface TextToSpeechComponentProps {\n /** Initial text to be spoken. Defaults to an empty string. */\n initialText?: string\n /** Whether to show the text input field. Defaults to true. */\n showTextInput?: boolean\n /** The voice to be used for speech synthesis. */\n voice?: SpeechSynthesisVoice | undefined\n /** The pitch of the voice. Defaults to 1. */\n pitch?: number\n /** The rate of speech. Defaults to 1. */\n rate?: number\n /** The language to be used for speech synthesis. */\n language?: string\n /** Player label */\n label?: string | React.ReactNode\n /** Callback function to be called when speech ends. */\n onEnd?: () => void\n}\n\n/**\n * A component that converts text to speech using the Web Speech API.\n * @param {TextToSpeechComponentProps} props - The props for the component.\n * @returns {JSX.Element} The rendered TextToSpeechComponent.\n */\nexport const TextToSpeech: React.FC<TextToSpeechComponentProps> = ({\n initialText = '',\n showTextInput = false,\n voice,\n pitch = 1,\n rate = 1,\n language,\n label,\n onEnd,\n}) => {\n const {\n speak,\n pause,\n resume,\n cancel,\n isSpeaking,\n isPaused,\n getAvailableLanguages,\n availableVoices,\n } = useTextToSpeech()\n const [text, setText] = useState<string>(initialText)\n console.log(getAvailableLanguages())\n\n useEffect(() => {\n setText(initialText)\n }, [initialText])\n\n const handleSpeak = (): void => {\n if (text.trim() !== '') {\n speak(text, { voice, pitch, rate }, handleEnd)\n }\n }\n\n const handleChange = (e: ChangeEvent<HTMLTextAreaElement>): void => {\n setText(e.target.value)\n }\n\n const handleEnd = (): void => {\n if (onEnd) {\n onEnd()\n }\n }\n\n return (\n <>\n {showTextInput && <Textarea value={text} onChange={handleChange} />}\n <TextToSpeechControls\n label={label}\n isSpeaking={isSpeaking}\n isPaused={isPaused}\n onSpeak={handleSpeak}\n onPause={pause}\n onResume={resume}\n onCancel={cancel}\n />\n </>\n )\n}\n\nexport default TextToSpeech\nTextToSpeech.displayName = 'TextToSpeechComponent'\n","import { useState, useEffect } from 'react'\n\n/**\n * Options for configuring speech synthesis.\n * @interface SpeechOptions\n */\ninterface SpeechOptions {\n /** The language for speech synthesis (e.g., 'en-US') */\n lang?: string\n\n /** The pitch of the voice (0 to 2) */\n pitch?: number\n /** The speed of the voice (0.1 to 10) */\n rate?: number\n\n /** The voice to use for speech synthesis */\n voice?: SpeechSynthesisVoice\n}\n/**\n * Custom hook to handle text-to-speech functionality.\n *\n * @param {SpeechSynthesisVoice} [initialVoice] - The initial voice to use for speech synthesis.\n * @returns {Object} An object containing methods to control speech synthesis and state variables.\n */\nexport const useTextToSpeech = (initialVoice?: SpeechSynthesisVoice) => {\n const [availableVoices, setAvailableVoices] = useState<\n SpeechSynthesisVoice[]\n >([])\n const [currentVoice, setCurrentVoice] = useState<\n SpeechSynthesisVoice | undefined\n >(initialVoice)\n\n const [isSpeaking, setIsSpeaking] = useState<boolean>(false)\n const [isPaused, setIsPaused] = useState<boolean>(false)\n const [utterance, setUtterance] = useState<SpeechSynthesisUtterance | null>(\n null,\n )\n\n useEffect(() => {\n const updateVoices = () => {\n const voices = window.speechSynthesis.getVoices()\n setAvailableVoices(voices)\n\n // Set default voice to Google US English if available\n const googleVoice = voices.find(\n (voice) => voice.name === 'Google US English',\n )\n if (googleVoice) {\n setCurrentVoice(googleVoice)\n } else {\n // Fallback to the first English voice if Google voice is not available\n const englishVoice = voices.find((voice) =>\n voice.lang.startsWith('en-'),\n )\n if (englishVoice) {\n setCurrentVoice(englishVoice)\n }\n }\n }\n\n updateVoices()\n window.speechSynthesis.onvoiceschanged = updateVoices\n\n return () => {\n window.speechSynthesis.onvoiceschanged = null\n }\n }, [])\n\n /**\n * Gets the list of available languages for speech synthesis.\n * @returns {string[]} An array of available language codes.\n */\n const getAvailableLanguages = () => {\n return [...new Set(availableVoices.map((voice) => voice.lang))]\n }\n\n /**\n * Initiates speech synthesis for the given text.\n *\n * @param {string} text - The text to be spoken.\n * @param {SpeechOptions} [options={}] - Options for speech synthesis.\n * @param {Function} [onEnd] - Callback function to be called when speech ends.\n */\n const speak = (\n text: string,\n options: SpeechOptions = {},\n onEnd?: () => void,\n ) => {\n const utterance = new SpeechSynthesisUtterance(text)\n\n utterance.lang = options.lang ?? 'en-US'\n utterance.pitch = options.pitch ?? 1\n utterance.rate = options.rate ?? 1\n utterance.voice = currentVoice ?? options.voice ?? null\n\n utterance.onend = () => {\n setIsSpeaking(false)\n setIsPaused(false)\n if (onEnd) {\n onEnd()\n }\n }\n\n if ('speechSynthesis' in window) {\n window.speechSynthesis.speak(utterance)\n setUtterance(utterance)\n setIsSpeaking(true)\n setIsPaused(false)\n } else {\n console.error('Speech synthesis not supported')\n // Handle the error appropriately\n }\n }\n\n /**\n * Changes the current voice used for speech synthesis.\n * @param {SpeechSynthesisVoice} voice - The new voice to use.\n */\n const changeVoice = (voice: SpeechSynthesisVoice) => {\n setCurrentVoice(voice)\n }\n\n /**\n * Pauses the ongoing speech synthesis.\n */\n const pause = () => {\n if (isSpeaking && !isPaused) {\n window.speechSynthesis.pause()\n setIsPaused(true)\n }\n }\n\n /**\n * Resumes the paused speech synthesis.\n */\n const resume = () => {\n if (isSpeaking && isPaused) {\n window.speechSynthesis.resume()\n setIsPaused(false)\n }\n }\n\n /**\n * Cancels the ongoing speech synthesis.\n */\n const cancel = () => {\n if (isSpeaking) {\n window.speechSynthesis.cancel()\n setIsSpeaking(false)\n setIsPaused(false)\n }\n }\n\n return {\n /** Initiates speech synthesis for the given text */\n speak,\n /** Pauses the ongoing speech synthesis */\n pause,\n /** Resumes the paused speech synthesis */\n resume,\n /** Cancels the ongoing speech synthesis */\n cancel,\n /** Indicates whether speech synthesis is currently active */\n isSpeaking,\n /** Indicates whether speech synthesis is currently paused */\n isPaused,\n /** Array of available voices for speech synthesis */\n availableVoices,\n /** Changes the current voice used for speech synthesis */\n changeVoice,\n /** The currently selected voice for speech synthesis */\n currentVoice,\n /** Gets the list of available languages for speech synthesis */\n getAvailableLanguages,\n }\n}\n","import React from 'react'\nimport Icon from '#components/icons/icon'\nimport UI from '#components/ui'\nimport { FC } from 'react'\n\n/**\n * Props for the TextToSpeechControls component.\n * @interface TextToSpeechControlsProps\n */\ninterface TextToSpeechControlsProps {\n /** Optional label for the controls */\n label?: string | React.ReactNode\n /** Indicates if the text-to-speech is currently speaking */\n isSpeaking: boolean\n /** Indicates if the text-to-speech is paused */\n isPaused: boolean\n /** Function to start speaking */\n onSpeak: () => void\n /** Function to pause speaking */\n onPause: () => void\n /** Function to resume speaking */\n onResume: () => void\n /** Function to cancel speaking */\n onCancel: () => void\n}\n\n/**\n * TTSButtonComponent props\n * @interface TTSButtonComponentProps\n */\ninterface TTSButtonComponentProps {\n /** The content of the button */\n children: React.ReactNode\n /** Function to call when the button is clicked */\n onClick: () => void\n}\n\n/**\n * TTSButtonComponent is a reusable button component for text-to-speech controls.\n * @param {TTSButtonComponentProps} props - The component props\n * @returns {React.ReactElement} The rendered button\n */\nexport const TTSButtonComponent: React.FC<TTSButtonComponentProps> = ({\n children,\n onClick,\n}) => {\n return (\n <UI\n as=\"button\"\n type=\"button\"\n className=\"tts-border\"\n data-btn=\"sm text pill\"\n onClick={onClick}\n >\n {children}\n </UI>\n )\n}\n\nexport const TTSButton = React.memo(TTSButtonComponent)\n\n/**\n * TextToSpeechControlsComponent interface extends FC<TextToSpeechControlsProps>\n * and includes a TTSButton property.\n * @interface TextToSpeechControlsComponent\n * @extends {FC<TextToSpeechControlsProps>}\n */\ninterface TextToSpeechControlsComponent extends FC<TextToSpeechControlsProps> {\n /** The TTSButton component used within TextToSpeechControls */\n TTSButton: typeof TTSButton\n}\n\n/**\n * TextToSpeechControls component provides a user interface for controlling text-to-speech functionality.\n * @param {TextToSpeechControlsProps} props - The component props\n * @returns {React.ReactElement} The rendered TextToSpeechControls component\n */\nconst TextToSpeechControls: TextToSpeechControlsComponent = ({\n label,\n isSpeaking,\n isPaused,\n onSpeak,\n onPause,\n onResume,\n onCancel,\n}) => {\n const iconSize = 16\n\n return (\n <UI as=\"div\" data-tts>\n {label && <p>{label}</p>}\n {!isSpeaking && (\n <TTSButton aria-label=\"Speak\" onClick={onSpeak}>\n <Icon.PlaySolid size={iconSize} />\n </TTSButton>\n )}\n {isSpeaking && !isPaused && (\n <TTSButton aria-label=\"Pause\" onClick={onPause}>\n <Icon.PauseSolid size={iconSize} />\n </TTSButton>\n )}\n {isPaused && (\n <TTSButton aria-label=\"Resume\" onClick={onResume}>\n <Icon.ResumeSolid size={iconSize} />\n </TTSButton>\n )}\n <TTSButton aria-label=\"Stop\" onClick={onCancel}>\n <Icon.StopSolid size={iconSize} />\n </TTSButton>\n </UI>\n )\n}\n\nTextToSpeechControls.displayName = 'TextToSpeechControls'\nTextToSpeechControls.TTSButton = TTSButton\n\nexport default TextToSpeechControls\n","import React from \"react\";\nimport UI from \"#components/ui\";\nimport DialogHeader from \"./view/dialog-header\";\n\nexport type DialogProps = {\n isOpen?: boolean;\n onOpen?: () => void;\n onClose?: () => void;\n onCancel?: () => void;\n dialogTitle?: string;\n showDialogHeader?: boolean;\n isAlertDialog?: boolean;\n children: React.ReactNode;\n};\n\nexport const Dialog = ({\n isOpen = true,\n dialogTitle = \"Dialog\",\n onOpen,\n onClose,\n onCancel,\n showDialogHeader = true,\n isAlertDialog,\n children,\n ...props\n}: DialogProps): JSX.Element => {\n const dialogRef = React.useRef<HTMLDialogElement>(null);\n const [dialogOpen, setDialogOpen] = React.useState(isOpen);\n\n React.useEffect(() => {\n if (isOpen && onOpen) {\n dialogRef.current?.showModal();\n onOpen();\n }\n setDialogOpen(isOpen);\n }, [isOpen]);\n\n const handleCancelEvent = (e: React.SyntheticEvent<HTMLDialogElement>) => {\n if (e.currentTarget === e.target) {\n if (onCancel) {\n onCancel();\n }\n }\n };\n\n const handleCloseEvent = (e: React.SyntheticEvent<HTMLDialogElement>) => {\n if (e.currentTarget === e.target) {\n if (onClose) {\n onClose();\n }\n isOpen = false;\n dialogRef.current?.close();\n }\n };\n\n const closeDialog = () => {\n if (onClose) {\n onClose();\n }\n isOpen = false;\n dialogRef.current?.close();\n };\n\n return (\n <UI\n as=\"dialog\"\n open={dialogOpen}\n ref={dialogRef}\n role={isAlertDialog ? \"alertdialog\" : undefined}\n onCancel={handleCancelEvent}\n onClose={handleCloseEvent}\n {...props}\n >\n {showDialogHeader && (\n <DialogHeader dialogTitle={dialogTitle} onClose={closeDialog} />\n )}\n {children}\n </UI>\n );\n};\n\nexport default React.memo(Dialog);\nDialog.displayName = \"Dialog\";\n","import React from \"react\";\nimport UI from \"#components/ui\";\nimport Heading from \"#components/heading/heading\";\nimport Button from \"#components/buttons/button\";\nimport Icon from \"#components/icons/icon\";\n\nexport type DialogHeaderProps = {\n dialogTitle: string;\n onClose: () => void;\n};\n\nconst DialogHeader = ({\n dialogTitle,\n onClose,\n}: DialogHeaderProps): JSX.Element => {\n return (\n <UI as=\"div\" classes=\"dialog-header\">\n {dialogTitle && <Heading type=\"h3\">{dialogTitle}</Heading>}\n <Button\n type=\"button\"\n onClick={onClose}\n classes=\"transparent\"\n data-btn=\"icon pill\"\n >\n <Icon.Remove size={16} />\n </Button>\n </UI>\n );\n};\n\nexport default React.memo(DialogHeader);\nDialogHeader.displayName = \"DialogHeader\";\n"]}
1
+ {"version":3,"sources":["../src/components/buttons/button.tsx","../src/components/cards/card.tsx","../src/components/form/fields.tsx","../src/components/layout/landmarks.tsx","../src/components/images/img.tsx","../src/components/form/inputs.tsx","../src/components/fp.tsx","../src/components/link/link.tsx","../src/components/list/list.tsx","../src/components/modal/modal.tsx","../src/components/modal/dialog.tsx","../src/components/nav/nav.tsx","../src/components/popover/popover.tsx","../src/components/tables/table-elements.tsx","../src/components/tables/table.tsx","../src/components/tag/tag.tsx","../src/components/details/details.tsx","../src/components/text/text.tsx","../src/components/form/textarea.tsx","../src/components/heading/heading.tsx","../src/components/breadcrumbs/breadcrumb.tsx","../src/libs/content.ts","../src/components/text-to-speech/TextToSpeech.tsx","../src/components/text-to-speech/useTextToSpeech.tsx","../src/components/text-to-speech/views/TextToSpeechControls.tsx","../src/components/dialog/dialog.tsx","../src/components/dialog/views/dialog-header.tsx","../src/components/dialog/views/dialog-footer.tsx","../src/hooks/useDialogClickHandler.ts"],"names":["React","Button","type","children","styles","disabled","classes","onPointerDown","onPointerOver","onPointerLeave","onClick","props","handlePointerDown","e","ui_default","button_default","Title","className","as","Content","Footer","Card","elm","id","Field","label","labelFor","Landmarks","Header","headerBackground","Main","Aside","Section","Article","Img","src","alt","width","height","loading","placeholder","fetchpriority","decoding","imgLoaded","imgError","FP","defaultStyles","ref","Component","styleObj","fp_default","Input","name","value","isDisabled","readonly","required","onChange","onBlur","handleChange","handleBlur","handleKeyDown","Link","href","target","rel","prefetch","btnStyle","relValue","link_default","ListItem","List","variant","role","list_default","ModalDialog","modalRef","openOnMount","dialog_default","Modal","openChild","closeChild","modalHeader","modalFooter","showOpen","dialogRef","openModal","closeModal","NavList","isBlock","NavItem","Nav","Popover","popoverTrigger","hoverRef","popOverRef","isVisible","popoverPosition","handlePointerEvent","handlePointerLeave","use_popover_default","popoverStyles","Caption","Thead","Tbody","Tr","Td","Table","dataStyle","RenderHead","data","head","item","index","RenderBody","rec","RenderTable","tblBody","tblCaption","tblHead","Tag","Details","summary","icon","ariaLabel","open","onToggle","onPointerDownCallback","Text","text","Textarea","rows","cols","readOnly","textarea_default","Heading","ui","heading_default","Truncate","str","length","Items","Breadcrumb","startRoute","startRouteUrl","currentRoute","spacer","routes","ariaLabelPrefix","truncateLength","linkProps","currentPath","setCurrentPath","path","getPathName","pathSegment","route","segments","segment","lastSegment","uuid","currentSegment","url","useState","useEffect","useTextToSpeech","initialVoice","availableVoices","setAvailableVoices","currentVoice","setCurrentVoice","isSpeaking","setIsSpeaking","isPaused","setIsPaused","utterance","setUtterance","updateVoices","voices","googleVoice","voice","englishVoice","options","onEnd","TTSButtonComponent","TTSButton","TextToSpeechControls","onSpeak","onPause","onResume","onCancel","icon_default","TextToSpeechControls_default","TextToSpeech","initialText","showTextInput","pitch","rate","language","speak","pause","resume","cancel","getAvailableLanguages","setText","handleSpeak","handleEnd","useRef","DialogHeader","dialogTitle","dialog_header_default","DialogFooter","onClose","onConfirm","confirmLabel","cancelLabel","dialog_footer_default","useCallback","useDialogClickHandler","handleClose","dialogDimensions","Dialog","showDialog","isAlertDialog","dialogLabel","hideFooter","isOpen","setIsOpen","dialog","handleClickOutside"],"mappings":"kGACA,OAAOA,OAAW,QAUX,IAAMC,EAAS,CAAC,CACrB,KAAAC,EAAO,SACP,SAAAC,EACA,OAAAC,EACA,SAAAC,EACA,QAAAC,EACA,cAAAC,EACA,cAAAC,EACA,eAAAC,EACA,QAAAC,EACA,GAAGC,CACL,IAAmB,CAMjB,IAAMC,EAAqBC,GAA6C,CACjER,GACHE,IAAgBM,CAAC,CAErB,EAqCA,OACEb,GAAA,cAACc,EAAA,CACC,GAAG,SACH,KAAMZ,EACN,cAlCuBW,GAA6C,CACjER,GACHG,IAAgBK,CAAC,CAErB,EA+BI,cAAeD,EACf,eAzBwBC,GAA6C,CAClER,GACHI,IAAiBI,CAAC,CAEtB,EAsBI,UAAWD,EACX,MAAOR,EACP,UAAWE,EACX,gBAAeD,EACf,QAnBmBQ,GAA2C,CAC3DR,GACFK,IAAUG,CAAC,CAEhB,EAgBK,GAAGF,GAEHR,CACH,CAGJ,EAEOY,EAAQd,EACfA,EAAO,YAAc,SC1FrB,OAAOD,MAAW,QA4BX,IAAMgB,GAAQ,CAAC,CACpB,SAAAb,EACA,UAAAc,EACA,OAAAb,EACA,GAAAc,EAAK,KACL,GAAGP,CACL,IAMIX,EAAA,cAACc,EAAA,CACC,GAAII,EACJ,UAAW,cAAcD,GAAa,EAAE,GACxC,OAAQb,EACP,GAAGO,GAEHR,CACH,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,kBAAkBG,CAAS,GACtC,QAAUJ,GAAwBA,EAAE,gBAAgB,GAEnDV,EACA,CAAC8N,GACAjO,EAAA,cAACwN,GAAA,CACC,QAASG,EACT,UAAWN,EACX,aAAcC,EACd,YAAaC,EACf,CAEJ,CACF,CAEJ,EACOzI,GAAQ9E,EAAM,KAAK6N,EAAM","sourcesContent":["import UI from '../ui'\nimport React from 'react'\n\nexport type ButtonProps = Partial<React.ComponentProps<typeof UI>> & {\n /**\n * The button type\n * Required - 'button' | 'submit' | 'reset'\n */\n type: 'button' | 'submit' | 'reset'\n }\n\nexport const Button = ({\n type = 'button',\n children,\n styles,\n disabled,\n classes,\n onPointerDown,\n onPointerOver,\n onPointerLeave,\n onClick,\n ...props\n}: ButtonProps) => {\n /**\n * Handles the pointer down event on the button.\n * Only triggers the onPointerDown callback if the button is not disabled.\n * @param e The pointer event object from the button element\n */\n const handlePointerDown = (e: React.PointerEvent<HTMLButtonElement>) => {\n if (!disabled) {\n onPointerDown?.(e)\n }\n }\n\n /**\n * Handles the pointer over event on the button.\n * Only triggers the onPointerOver callback if the button is not disabled.\n * @param e The pointer event object from the button element\n */\n const handlePointerOver = (e: React.PointerEvent<HTMLButtonElement>) => {\n if (!disabled) {\n onPointerOver?.(e)\n }\n }\n\n /**\n * Handles the pointer leave event on the button.\n * Only triggers the onPointerLeave callback if the button is not disabled.\n * @param e The pointer event object from the button element\n */\n const handlePointerLeave = (e: React.PointerEvent<HTMLButtonElement>) => {\n if (!disabled) {\n onPointerLeave?.(e)\n }\n }\n\n /**\n * Handles the click event on the button.\n * Only triggers the onClick callback if the button is not disabled.\n * @param e The mouse event object from the button element\n */\n const handleOnClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n if (!disabled) {\n onClick?.(e)\n }\n }\n\n\n /* Returning a button element. */\n return (\n <UI\n as=\"button\"\n type={type}\n onPointerOver={handlePointerOver}\n onPointerDown={handlePointerDown}\n onPointerLeave={handlePointerLeave}\n onKeyDown={handlePointerDown}\n style={styles}\n className={classes}\n aria-disabled={disabled}\n onClick={handleOnClick}\n {...props}\n >\n {children}\n </UI>\n )\n //\n}\n\nexport default Button\nButton.displayName = 'Button'\n","import React from 'react'\nimport UI from '#components/ui'\n\n/*\n * CardProps interface\n *\n * Extends ComponentProps. Defines props for the Card component.\n *\n * @property {('div' | 'aside' | 'section' | 'article')} [elm='div'] - HTML element to render as\n */\nexport type CardProps = {\n elm?: 'div' | 'aside' | 'section' | 'article'\n title?: React.ReactNode\n footer?: React.ReactNode\n} & React.ComponentProps<typeof UI>\n\n/*\n * Title component\n *\n * Renders a title for the Card component using the UI component.\n *\n * @param {Object} props - Component props\n * @param {ReactNode} props.children - Title content\n * @param {string} [props.className] - Additional CSS classes\n * @param {Object} [props.styles] - Inline styles\n *\n * @returns {ReactElement} Title component\n */\nexport const Title = ({\n children,\n className,\n styles,\n as = 'h3',\n ...props\n}: React.PropsWithChildren<{\n className?: string\n styles?: React.CSSProperties\n as?: React.ElementType\n}>) => {\n return (\n <UI\n as={as}\n className={`card-title ${className || ''}`}\n styles={styles}\n {...props}\n >\n {children}\n </UI>\n )\n}\n\nTitle.displayName = 'Title'\n\n/*\n * CardContent component\n *\n * Renders the content of the Card component using the UI component with an article element.\n *\n * @param {Object} props - Component props\n * @param {ReactNode} props.children - Content\n * @param {string} [props.className] - Additional CSS classes\n * @param {Object} [props.styles] - Inline styles\n *\n * @returns {ReactElement} CardContent component\n */\nexport const Content = ({\n children,\n className,\n styles,\n ...props\n}: React.PropsWithChildren<{\n className?: string\n styles?: React.CSSProperties\n}>) => {\n return (\n <UI\n as=\"article\"\n className={`card-content ${className || ''}`}\n styles={styles}\n {...props}\n >\n {children}\n </UI>\n )\n}\n\nContent.displayName = 'Content'\n\n/*\n * Footer component\n *\n * Renders a footer section for the Card component using the UI component.\n *\n * @param {Object} props - Component props\n * @param {ReactNode} props.children - Footer content\n * @param {string} [props.className] - Additional CSS classes\n * @param {Object} [props.styles] - Inline styles\n *\n * @returns {ReactElement} Footer component\n */\nexport const Footer = ({\n children,\n className,\n styles,\n ...props\n}: React.PropsWithChildren<{\n className?: string\n styles?: React.CSSProperties\n}>) => {\n return (\n <UI\n as=\"div\"\n className={`card-footer ${className || ''}`}\n styles={styles}\n {...props}\n >\n {children}\n </UI>\n )\n}\n\nFooter.displayName = 'Footer'\n\n/*\n * Card component\n *\n * Renders a card container.\n *\n * @param {CardProps} props - Component props\n * @param {('div' | 'aside' | 'section' | 'article')} [props.elm='div'] - Element to render as\n * @param {Object} [props.styles] - CSS styles to apply\n * @param {ReactNode} props.children - Card content\n * @param {boolean} [props.renderStyles=true] - Whether to render default styles\n * @param {string} [props.dataStyle] - data-card attribute value\n * @param {string} [props.id] - Unique ID\n * @returns {ReactElement} Card component\n */\nexport const Card = ({\n elm = 'div',\n styles,\n children,\n classes = 'shadow',\n id,\n ...props\n}: CardProps) => {\n return (\n <UI\n as={elm}\n id={id}\n styles={styles}\n className={classes}\n data-card\n {...props}\n >\n {children}\n </UI>\n )\n}\n\nexport default Card\nCard.displayName = 'Card'\nCard.Title = Title\nCard.Content = Content\nCard.Footer = Footer\n","import React from 'react'\nimport UI from '../ui'\n\nexport type FieldProps = {\n /**\n * The label content\n */\n label: React.ReactNode\n children: React.ReactNode\n} & React.ComponentProps<'label'> &\n Partial<React.ComponentProps<typeof UI>>\n/**\n * Field component that renders a label and children wrapped in a div element.\n * @param labelFor Defines the for attribute of the label element\n * @param styles Custom styles to be applied to the component\n * @param label The label content\n * @param children The children to be rendered inside the component\n * @param props Additional props to be spread to the component\n */\nexport const Field = ({\n label,\n labelFor,\n id,\n styles,\n classes,\n children,\n ...props\n}: FieldProps) => {\n return (\n <UI\n as=\"div\"\n id={id}\n styles={styles}\n className={classes}\n data-style=\"fields\"\n {...props}\n >\n <label htmlFor={labelFor}>{label}</label>\n {children}\n </UI>\n )\n}\n\nexport default Field\nField.displayName = 'Field'\n","import UI from '../ui'\nimport React, { ReactNode } from 'react'\n\ntype ComponentProps = React.ComponentProps<typeof UI>\n\n/**\n * Renders children elements without any wrapping component.\n * Can be used as a placeholder when no semantic landmark is needed.\n */\nexport const Landmarks = (children?: React.FC) => <>{children}</>\n\ntype HeaderProps = {\n headerBackground?: ReactNode\n} & ComponentProps\n/**\n * Header component.\n *\n * Renders a header landmark with a section child.\n *\n * @param children - The content to render inside the header.\n * @param styles - Optional styles object.\n * @param props - Other props.\n */\nexport const Header = ({\n id,\n children,\n headerBackground,\n styles,\n classes,\n ...props\n}: HeaderProps) => {\n return (\n <UI as=\"header\" id={id} styles={styles} className={classes} {...props}>\n {headerBackground}\n <UI as=\"section\">{children}</UI>\n </UI>\n )\n}\n\n/**\n * Main component.\n *\n * Renders a main landmark.\n *\n * @param children - The content to render inside the main element.\n * @param styles - Optional styles object.\n * @param props - Other props.\n */\nexport const Main = ({\n id,\n children,\n styles,\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"main\" id={id} styles={styles} {...props} className={classes}>\n {children}\n </UI>\n )\n}\n\n/**\n * Footer component that renders a footer element with a section element inside.\n * @param {ReactNode} children - Child elements to render inside the section element.\n * @param styles - CSS styles to apply to the footer element.\n * @param props - Additional props to pass to the footer element.\n * @returns A React component that renders a footer element with a section element inside.\n */\nexport const Footer = ({\n id,\n classes,\n children,\n styles = {},\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"footer\" id={id} className={classes} styles={styles} {...props}>\n <UI as=\"section\">{children || 'Copyright © 2022'}</UI>\n </UI>\n )\n}\n\nexport const Aside = ({\n id,\n children,\n styles = {},\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"aside\" id={id} styles={styles} className={classes} {...props}>\n <UI as=\"section\">{children}</UI>\n </UI>\n )\n}\n\n/**\n * Section component that renders a section element.\n *\n * @param children - Child elements to render inside the section.\n * @param styles - CSS styles to apply to the section.\n * @param props - Other props.\n */\nexport const Section = ({\n id,\n children,\n styles,\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"section\" id={id} styles={styles} className={classes} {...props}>\n {children}\n </UI>\n )\n}\n\n/**\n * Article component renders an HTML <article> element.\n *\n * @param children - Child elements to render inside the article.\n * @param styles - CSS styles to apply to the article.\n * @param props - Additional props to pass to the article element.\n */\nexport const Article = ({\n id,\n children,\n\n styles,\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"article\" id={id} styles={styles} className={classes} {...props}>\n {children}\n </UI>\n )\n}\n\nexport default Landmarks\n\nLandmarks.displayName = 'Landmarks'\nLandmarks.Header = Header\nLandmarks.Main = Main\nLandmarks.Footer = Footer\nLandmarks.Aside = Aside\nLandmarks.Section = Section\nLandmarks.Article = Article\n","import UI from '../ui'\nimport React from 'react'\n/*\n * ImageProps interface\n *\n * Extends ComponentProps and defines additional props for the Img component.\n *\n * @property {string} [src] - The image source URL\n * @property {string} alt - Required alt text for image accessibility\n * @property {number} width - Required width of image\n * @property {number} [height] - Optional height of image\n * @property {\"eager\" | \"lazy\"} [loading=\"lazy\"] - Loading behavior\n * @property {string} [placeholder] - Fallback placeholder image\n * @property {\"high\" | \"low\"} [fetchpriority=\"low\"] - Image fetch priority\n * @property {\"sync\" | \"async\" | \"auto\"} [decoding=\"auto\"] - Decode setting\n * @property {function} [imgError] - Error callback\n * @property {function} [imgLoaded] - Loaded callback\n */\nexport type ImageProps = React.ComponentProps<'img'> &\n React.ComponentProps<typeof UI>\n\n/*\n * Img component\n *\n * Renders an <img> element with custom props.\n *\n * @param {string} src - The image source URL.\n * @param {string} alt - The alt text for the image.\n * @param {number} [width=480] - The width of the image.\n * @param {number} [height] - The height of the image.\n * @param {Object} [styles] - Additional CSS styles to apply.\n * @param {boolean} [renderStyles=true] - Whether to render the default styles.\n * @param {\"eager\" | \"lazy\"} [loading=\"lazy\"] - The loading attribute.\n * @param {string} [placeholder] - A placeholder image URL.\n * @param {\"high\" | \"low\"} [fetchpriority=\"low\"] - The fetchpriority attribute.\n * @param {\"sync\" | \"async\" | \"auto\"} [decoding=\"auto\"] - The decoding attribute.\n * @param {function} [imgLoaded] - Callback when image loads successfully.\n * @param {function} [imgError] - Callback when image errors.\n *\n * @returns {JSX.Element} The Img component.\n */\nexport const Img = ({\n src = '//',\n alt,\n width = 480,\n height,\n styles,\n loading = 'lazy',\n placeholder = `https://via.placeholder.com/${width}?text=PLACEHOLDER`,\n fetchpriority = 'low',\n decoding = 'auto',\n imgLoaded,\n imgError,\n ...props\n}: ImageProps) => {\n const handleImgError = (\n e: React.SyntheticEvent<HTMLImageElement, Event>,\n ): void => {\n if (imgError) {\n imgError?.(e)\n return\n }\n if (e.currentTarget.src !== placeholder) {\n e.currentTarget.src = placeholder\n }\n }\n\n const handleImgLoad = (\n e: React.SyntheticEvent<HTMLImageElement, Event>,\n ): void => {\n imgLoaded?.(e)\n }\n\n return (\n <UI\n as=\"img\"\n src={src}\n alt={alt}\n width={width}\n height={height || 'auto'}\n loading={loading}\n style={styles}\n onError={handleImgError}\n onLoad={handleImgLoad}\n fetchPriority={fetchpriority}\n decoding={decoding}\n {...props}\n />\n )\n}\n\nexport default Img\nImg.displayName = 'Img'\n","import React from 'react'\nimport FP from '../fp'\n\nexport type InputProps = {\n /**\n * The type of the input.\n */\n type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search'\n\n /**\n * Set the element as disabled\n */\n isDisabled?: boolean\n} & React.ComponentProps<typeof FP>\n\n/**\n * Input component that renders an HTML input element.\n * @param {InputProps} props - The input component props.\n * @returns {JSX.Element} - The input component.\n */\nexport const Input = ({\n type = 'text',\n name,\n value,\n placeholder,\n id,\n styles,\n classes,\n isDisabled,\n disabled,\n readonly,\n required,\n ref,\n onChange,\n onBlur,\n onPointerDown,\n ...props\n}: InputProps): JSX.Element => {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange && !disabled) {\n onChange?.(e)\n }\n }\n\n const handleBlur = (e: React.FocusEvent<HTMLInputElement>) => {\n if (onBlur && !disabled) {\n onBlur?.(e)\n }\n }\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (onPointerDown && !disabled) {\n e.preventDefault()\n onPointerDown?.(e)\n }\n }\n\n return (\n <FP\n as=\"input\"\n id={id}\n type={type}\n placeholder={placeholder || `${required ? '*' : ''} ${type} input `}\n className={classes}\n styles={styles}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n value={value}\n name={name}\n ref={ref}\n aria-disabled={isDisabled}\n tabIndex={isDisabled ? -1 : undefined}\n aria-readonly={readonly}\n aria-required={required}\n required={required}\n readOnly={readonly}\n {...props}\n />\n )\n}\n\nInput.displayName = 'Input'\nexport default Input\n","import React from 'react'\nimport { ComponentProps } from '../types'\n\ntype PolymorphicRef<C extends React.ElementType> =\n React.ComponentPropsWithRef<C>['ref']\n\ntype AsProp<C extends React.ElementType> = {\n as?: C\n}\n\ntype PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P)\n\ntype PolymorphicComponentProp<\n C extends React.ElementType,\n Props = {},\n> = React.PropsWithChildren<Props & AsProp<C>> &\n Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>\n\ntype PolymorphicComponentPropWithRef<\n C extends React.ElementType,\n Props = {},\n> = PolymorphicComponentProp<C, Props> & {\n ref?: PolymorphicRef<C>\n}\n\ntype FPProps<C extends React.ElementType> = PolymorphicComponentPropWithRef<\n C,\n {\n renderStyles?: boolean\n styles?: React.CSSProperties\n classes?: string\n }\n>\n\n/*\n * FPComponent type definition\n *\n * Defines the component function signature for the FP component.\n *\n * @typeParam C - The HTML element type to render\n * @param props - The component props\n * @returns React component\n */\ntype FPComponent = <C extends React.ElementType = 'span'>(\n props: FPProps<C>,\n) => React.ReactElement | any\n\n/**\n * FP component is a polymorphic component that renders an HTML element with optional styles.\n * @param {Object} props - Component props\n * @param {React.ElementType} props.as - The HTML element to render. Defaults to 'div'.\n * @param {boolean} props.renderStyles - Whether to render styles or not. Defaults to true.\n * @param {Object} props.styles - The styles to apply to the component.\n * @param {Object} props.defaultStyles - The default styles to apply to the component.\n * @param {React.ReactNode} props.children - The children to render inside the component.\n * @returns {React.ReactElement} - A React component that renders an HTML element with optional styles.\n */\nconst FP: FPComponent = React.forwardRef(\n <C extends React.ElementType>(\n { as, styles, classes, children, defaultStyles, ...props }: FPProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div'\n\n const styleObj = { ...defaultStyles, ...styles } as React.CSSProperties\n\n return (\n <Component ref={ref} style={styleObj} className={classes} {...props}>\n {children}\n </Component>\n )\n },\n)\nexport interface BoxProps extends ComponentProps {\n renderStyles: true\n}\n\nexport default FP\n","import UI from \"../ui\";\nimport React from \"react\";\n\nexport type LinkProps = {\n href?: string;\n\n target?: string;\n\n rel?: string;\n\n children: React.ReactNode;\n\n styles?: React.CSSProperties;\n\n prefetch?: boolean;\n\n btnStyle?: string;\n\n onPointerDown?: (event: React.PointerEvent<HTMLAnchorElement>) => void;\n} & React.ComponentProps<typeof UI> &\n React.ComponentProps<\"a\">;\n\nexport const Link = ({\n href,\n target,\n rel,\n children,\n styles,\n prefetch,\n btnStyle,\n onPointerDown,\n ...props\n}: LinkProps) => {\n let relValue = rel;\n\n if (target === \"_blank\")\n relValue = `noopener noreferrer ${prefetch ? \"prefetch\" : \"\"}`;\n\n const handleOnpointerDown = (e: React.PointerEvent<HTMLAnchorElement>) => {\n if (onPointerDown) onPointerDown?.(e);\n };\n\n return (\n <UI\n as=\"a\"\n href={href}\n target={target}\n styles={styles}\n rel={relValue}\n onPointerDown={handleOnpointerDown}\n data-btn={btnStyle}\n prefetch={prefetch}\n {...props}\n >\n {children}\n </UI>\n );\n};\n\nexport default Link;\nLink.displayName = \"Link\";\n","import * as React from 'react'\nimport UI from '../ui'\n\ntype ListProps = {\n /** Type of list to render (default: 'ul') */\n type?: 'ul' | 'ol' | 'dl'\n /** variant of list to render (default: 'none') */\n variant?: string\n} & React.ComponentProps<typeof UI>\n\nexport type ListItemProps = {\n /** Type of list item to render (default: 'li') */\n type?: 'li' | 'dt' | 'dd'\n} & React.ComponentProps<typeof UI>\n\n/**\n * ListItem component\n * @param type - HTML tag type for the list item (default: 'li')\n * @param styles - CSS styles object\n * @param children - Child elements to be rendered inside the list item\n * @param props - Additional props to be passed to the underlying HTML element\n * @returns A React component that renders a list item\n */\nexport const ListItem = ({\n type = 'li',\n id,\n styles,\n children,\n classes,\n ...props\n}: ListItemProps) => {\n return (\n <UI id={id} as={type} className={classes} {...props} style={styles}>\n {children}\n </UI>\n )\n}\n\n/**\n * List component renders a list element with provided props\n * @param children - Child elements to render inside the list\n * @param classes - CSS classes to apply\n * @param type - Type of list element (default: 'ul')\n * @param variant - Variant for styling purposes\n * @param styles - Inline styles object\n * @param role - ARIA role\n * @param props - Additional props to pass to underlying element\n */\nexport const List = ({\n children,\n classes,\n type = 'ul',\n variant,\n styles,\n role,\n ...props\n}: ListProps) => {\n return (\n <UI\n as={type}\n data-variant={variant}\n className={classes}\n style={styles}\n role={role}\n {...props}\n >\n {children}\n </UI>\n )\n}\n\nexport default List\nList.displayName = 'List'\nList.ListItem = ListItem\n","import React from \"react\";\nimport { ComponentProps } from \"../../types\";\nimport { Button } from \"../buttons/button\";\nimport { ModalDialog } from \"./dialog\";\n\nexport interface ModalProps extends ComponentProps {\n /**\n * The child component/content for open button\n */\n openChild?: React.ReactNode;\n /**\n * The child component/content for close button\n */\n closeChild?: React.ReactNode;\n /**\n * The child component/content for modal header\n */\n modalHeader?: React.ReactNode;\n /**\n * The child component/content for modal footer\n */\n modalFooter?: React.ReactNode;\n /**\n * The child component/content for modal body\n */\n children: React.ReactNode;\n /**\n * Open modal on mount when set to true\n */\n showOpen?: boolean;\n}\nexport const Modal = ({\n openChild,\n closeChild,\n modalHeader,\n modalFooter,\n children,\n showOpen = false,\n ...props\n}: ModalProps) => {\n const dialogRef = React.useRef<HTMLDialogElement>(null);\n const openModal = (): void => {\n if (dialogRef.current) {\n if (showOpen) dialogRef.current.show();\n else dialogRef.current.showModal();\n }\n };\n const closeModal = () => {\n if (dialogRef.current) {\n dialogRef.current.close();\n }\n };\n\n return (\n <>\n <ModalDialog modalRef={dialogRef} openOnMount={showOpen} {...props}>\n <section>\n {modalHeader}\n {children}\n {modalFooter ?? (\n <div>\n <Button\n type=\"button\"\n pointerDown={() => {\n closeModal();\n }}\n >\n {closeChild || \"Close\"}\n </Button>{\" \"}\n </div>\n )}\n </section>\n </ModalDialog>\n {!showOpen && (\n <Button type=\"button\" pointerDown={openModal}>\n {openChild || \"Open Modal\"}\n </Button>\n )}\n </>\n );\n};\n\nModal.displayName = \"Modal\";\n","import UI from \"../ui\";\nimport React from \"react\";\n\nexport type DialogProps = {\n /**\n * React ref for dialog element\n */\n modalRef: React.RefObject<HTMLDialogElement>;\n /**\n * Handle close modal event\n */\n closeModal?: (e: React.SyntheticEvent<HTMLDialogElement>) => void;\n /**\n * open modal on mount\n */\n openOnMount?: boolean;\n} & React.ComponentProps<typeof UI>;\n/**\n * Dialog component\n */\nexport const ModalDialog = ({\n id,\n children,\n classes,\n modalRef,\n openOnMount,\n ...props\n}: DialogProps) => {\n const handleCloseModal = (e: React.SyntheticEvent<HTMLDialogElement>) => {\n if (e.currentTarget === e.target) {\n e.currentTarget.close();\n }\n };\n\n return (\n <UI\n as=\"dialog\"\n id={id}\n classes={classes}\n ref={modalRef}\n open={openOnMount}\n onClick={handleCloseModal}\n {...props}\n >\n {children}\n </UI>\n );\n};\n\nexport default React.memo(ModalDialog);\nModalDialog.displayName = \"Dialog\";\n","import UI from '../ui'\nimport List from '../list/list'\nimport React from 'react'\n\nexport type NavListProps = React.ComponentProps<typeof List> & {\n isBlock?: boolean\n}\nexport type NavItemProps = React.ComponentProps<typeof List.ListItem>\n\nexport type NavProps = React.ComponentProps<typeof UI>\n\n/**\n * Renders a NavList component.\n * @param {Object} props - The props for the component.\n * @param {ReactNode} props.children - The child elements.\n * @param {Object} props - Additional props to spread to the List component.\n * @returns {JSX.Element} The rendered NavList component.\n */\nexport const NavList = ({ isBlock, children, ...props }: NavListProps) => {\n return (\n <List type=\"ul\" {...props} data-list={`unstyled ${isBlock ? 'block' : ''}`}>\n {children}\n </List>\n )\n}\n\n/**\n * Renders a NavItem component.\n * @param {Object} props - The props for the component.\n * @param {string} [props.id] - The id for the component.\n * @param {Object} [props.styles] - The styles for the component.\n * @param {string} [props.classes] - The classes for the component.\n * @param {ReactNode} props.children - The child elements.\n * @param {boolean} [props.inline=true] - Whether the item should display inline.\n * @param {Object} props - Additional props to spread to the ListItem component.\n * @returns {JSX.Element} The rendered NavItem component.\n */\nexport const NavItem = ({\n id,\n styles,\n classes,\n children,\n ...props\n}: NavItemProps) => {\n return (\n <List.ListItem\n type=\"li\"\n id={id}\n classes={classes}\n styles={styles}\n {...props}\n >\n {children}\n </List.ListItem>\n )\n}\n\n/**\n * Renders a Nav component.\n * @param {Object} props - The props for the component.\n * @param {ReactNode} props.children - The child elements.\n * @param {Object} props - Additional props to spread to the UI component.\n * @returns {JSX.Element} The rendered Nav component.\n */\nexport const Nav = ({ children, ...props }: NavProps) => {\n return (\n <UI as=\"nav\" {...props}>\n {children}\n </UI>\n )\n}\n\nexport default Nav\nNav.displayName = 'Nav'\nNav.List = NavList\nNav.Item = NavItem\n","import React from 'react'\nimport usePopover from '#hooks/popover/use-popover'\n\n/**\n * Interface for props accepted by the Popover component\n *\n * @property {ReactNode} children - The content to show in the popover\n * @property {ReactNode} [content] - Optional alternative content for popover\n */\nexport type PopoverProps = {\n children: React.ReactNode\n popoverTrigger: React.ReactNode\n styles?: {}\n}\n\nexport const defaultStyles = {\n display: 'block',\n position: 'absolute',\n background: '#000',\n border: '1px solid #010101',\n padding: '10px',\n color: '#fff',\n transition: 'opacity .5s ease-in-out',\n} as React.CSSProperties\n\n/**\n * Popover component to display popover content.\n *\n * @param props - The props for the component\n * @param props.children - The content to show in the popover\n * @param props.popoverTrigger - The element that triggers the popover on hover\n *\n * @returns JSX.Element - The rendered JSX element for the Popover\n * @example - <Popover popoverTrigger={<button>Hover here</button>}>Popover content</Popover>\n *\n * The component uses the usePopover hook to handle popover visibility and positioning.\n *\n * It renders the triggerElement, and conditionally renders the popover content\n * positioned absolutely when visible.\n *\n * Inline styles handle visuals like background, border, padding, etc.\n *\n * Transforms and opacity animate the enter/exit transition of the popover.\n */\n\nexport const Popover = ({\n children,\n popoverTrigger,\n styles,\n ...props\n}: PopoverProps): JSX.Element => {\n const hoverRef = React.useRef(null)\n const popOverRef = React.useRef(null)\n const { isVisible, popoverPosition, handlePointerEvent, handlePointerLeave } =\n usePopover(hoverRef, popOverRef)\n const popoverStyles = {\n opacity: isVisible ? 1 : 0,\n top: popoverPosition.top,\n left: popoverPosition.left,\n // transform: `translateY(${isVisible ? '0px' : '-50px'})`,\n zIndex: 999,\n } as React.CSSProperties\n\n return (\n <>\n <div\n ref={hoverRef}\n onPointerEnter={handlePointerEvent}\n onPointerLeave={handlePointerLeave}\n {...props}\n >\n {popoverTrigger}\n </div>\n {isVisible && (\n <div ref={popOverRef} style={{ ...popoverStyles, ...styles }}>\n {children}\n </div>\n )}\n </>\n )\n}\n\nexport default Popover\nPopover.displayName = 'Popover'\nPopover.styles = defaultStyles\n","import FP from '../fp'\nimport { ComponentProps } from '../../types'\nimport React from 'react'\n\n\nexport const Caption = ({ children, ...props }: ComponentProps) => {\n return (\n <FP as=\"caption\" {...props}>\n {children}\n </FP>\n )\n}\n\nexport const Thead = ({ children, ...props }: ComponentProps) => (\n <FP as=\"thead\" {...props}>\n {children}\n </FP>\n)\n\nexport const Tbody = ({ children, ...props }: ComponentProps) => (\n <FP as=\"tbody\" {...props}>\n {children}\n </FP>\n)\n\nexport const Tr = ({ children, ...props }: ComponentProps) => (\n <FP as=\"tr\" {...props}>\n {children}\n </FP>\n)\n\nexport const Td = ({ children, ...props }: ComponentProps) => (\n <FP as=\"td\" {...props}>\n {children}\n </FP>\n)\n\nexport const Table = ({ id, dataStyle, children, ...props }: ComponentProps) => {\n return (\n <FP\n as=\"section\"\n id={id}\n {...props}\n data-style=\"table-wrapper\"\n >\n <table>{children}</table>\n </FP>\n )\n}\n\nTable.displayName = 'Table'\nCaption.displayName = 'Caption'\nThead.displayName = 'Thead'\nTbody.displayName = 'Tbody'\nTr.displayName = 'Tr'\nTd.displayName = 'Td'\n\n","import { Table, Caption, Thead, Tbody, Td, Tr } from './table-elements'\nimport { ComponentProps } from '../../types'\n\nimport React from 'react'\n\nexport interface TableProps extends ComponentProps {\n tblHead: React.ReactNode\n tblBody: React.ReactNode\n tblCaption?: React.ReactNode\n}\n\nexport type dataType = { id: number; items: string[] }[]\n\n/**\n * Render the `thead` by passing an array of names\n */\nexport const RenderHead = (data: []) => {\n const head = data.map((item, index) => {\n return <th key={index}>{item}</th>\n })\n return <tr>{head}</tr>\n}\n\n/**\n * Render the table body `tr`, `td` with the data provided\n */\nexport const RenderBody = (data: {}[]) => {\n const rec = data.map((item, index) => {\n return (\n <tr key={index}>\n {/* <td>{item?.id}</td>\n <td>{item?.items}</td> */}\n </tr>\n )\n })\n return <Tbody>{rec}</Tbody>\n}\n\n/**\n * Render the table placing `caption`, `thead` and `tbody` in the correct order\n * caption is optional\n */\nexport const RenderTable = ({ tblBody, tblCaption, tblHead }: TableProps) => {\n return (\n <Table>\n {tblCaption && <Caption>{tblCaption}</Caption>}\n <Thead>\n <Tr>{tblHead}</Tr>\n </Thead>\n <Tbody>{tblBody}</Tbody>\n </Table>\n )\n}\n\nRenderTable.displayName = 'TBL'\nRenderBody.displayName = 'renderBody'\nRenderHead.displayName = 'renderHead'\n","import React from 'react'\nimport UI from '#components/ui'\n\nexport type TagProps = {\n /** HTML element to display the badge as span or p */\n elm?: 'span' | 'p'\n /** Aria role for the component - conditional */\n role: 'note' | 'status'\n} & React.ComponentProps<typeof UI>\n\nexport const Tag = ({\n elm = 'span',\n role = 'note',\n children,\n styles,\n ...props\n}: TagProps) => {\n return (\n <UI as={elm} role={role} styles={styles} {...props}>\n {children}\n </UI>\n )\n}\nexport default Tag\nTag.displayName = 'Tag'\n","import UI from \"#components/ui\";\nimport React from \"react\";\n\ntype DetailsProps = {\n /**\n * The summary text shown for the details.\n * Required.\n */\n summary: React.ReactNode;\n\n /**\n * The aria-label element for accessibility.\n */\n ariaLabel: string;\n} & React.ComponentProps<\"details\"> &\n Partial<React.ComponentProps<typeof UI>>;\n\n/**3\n * Details component props interface.\n *\n * @param {React.CSSProperties} [styles] - CSS styles object.\n * @param {string} [classes] - Classnames string.\n * @param {boolean} [open] - Whether the details is open.\n * @param {(e: React.PointerEvent<HTMLDetailsElement>) => void} [onToggle] - onToggle callback.\n * @param {(e: React.PointerEvent<HTMLDetailsElement>) => void} [onPointerDown] - onPointerDown callback.\n * @param {ReactNode} children - The content inside the details.\n * @param {string} [ariaLabel] - aria-label for accessibility.\n * @param {React.Ref<any>} [ref] - Ref object.\n * @param {Object} props - Other props.\n */\nexport const Details = ({\n summary,\n icon,\n styles,\n classes,\n ariaLabel,\n name,\n open,\n onPointerDown,\n onToggle,\n children,\n ref,\n ...props\n}: DetailsProps) => {\n const defaultStyles: React.CSSProperties = { ...styles };\n\n const onPointerDownCallback = (e: React.PointerEvent<HTMLDetailsElement>) => {\n if (onPointerDown) onPointerDown?.(e);\n if (onPointerDown) onPointerDown?.(e);\n };\n\n const onToggleCallback = (e: React.PointerEvent<HTMLDetailsElement>) => {\n if (onToggle) onPointerDown?.(e);\n };\n return (\n <UI\n as=\"details\"\n style={defaultStyles}\n className={classes}\n onToggle={onToggleCallback}\n ref={ref}\n open={open}\n aria-label={ariaLabel || \"Details dropdown\"}\n // aria-roledescription=\"detail accordion\"\n name={name}\n {...props}\n >\n <UI as=\"summary\" onPointerDown={onPointerDownCallback}>\n {icon}\n {summary}\n </UI>\n <UI as=\"section\">{children}</UI>\n </UI>\n );\n};\n\nexport default Details;\nDetails.displayName = \"Details\";\n","// import FP from '../fp'\nimport React from 'react'\nimport UI from '#components/ui'\n\ntype InheritedProps = React.ComponentProps<typeof UI>\n\ntype TextElements =\n | 'a'\n | 'b'\n | 'blockquote'\n | 'b'\n | 'blockquote'\n | 'cite'\n | 'code'\n | 'em'\n | 'i'\n | 'em'\n | 'i'\n | 'kbd'\n | 'mark'\n | 'p'\n | 's'\n | 'small'\n | 'span'\n | 'span'\n | 'strong'\n | 'mark'\n | 'p'\n | 's'\n | 'small'\n | 'span'\n | 'span'\n | 'strong'\n | 'sub'\n | 'sup'\n | 'time'\n | 'time'\n | 'u'\n\nexport type TextProps = {\n /**\n * Text element to to use\n * Text element to to use\n */\n elm?: TextElements\n /** Pass a text element or string */\n text?: string\n} & InheritedProps\n\nexport const Text = ({\n elm = 'p',\n id,\n text,\n styles,\n classes,\n children,\n ...props\n}: TextProps) => {\n return (\n <UI as={elm} id={id} styles={styles} className={classes} {...props}>\n <UI as={elm} id={id} styles={styles} className={classes} {...props}>\n {children || text}\n </UI>\n </UI>\n )\n}\n\ntype TitleProps = {\n /**\n * HTML headings\n */\n elm?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n} & InheritedProps\n\nexport const Title = ({\n elm = 'h3',\n id,\n children,\n styles,\n classes,\n ...props\n}: TitleProps) => {\n return (\n <Text as={elm} id={id} styles={styles} className={classes} {...props}>\n {children}\n </Text>\n )\n}\n\nexport default Text\n\nText.displayName = 'Text'\nTitle.displayName = 'Title'\n","import React from 'react'\nimport UI from '../ui'\n\nexport type TextareaProps = React.ComponentProps<'textarea'> &\n React.ComponentProps<typeof UI>\n\n/**\n * Textarea component.\n *\n * @param value - The value of the textarea.\n * @param rows - The number of rows.\n * @param cols - The number of columns.\n * @param id - The id of the textarea.\n * @param name - The name of the textarea.\n * @param required - Whether the textarea is required.\n * @param disabled - Whether the textarea is disabled.\n * @param readOnly - Whether the textarea is read only.\n * @param onBlur - Blur event handler.\n * @param onPointerDown - Pointer down event handler.\n * @param onChange - Change event handler.\n * @param ref - Ref for the textarea.\n * @param styles - Styles object for the textarea.\n * @param textareaRef - Ref specifically for the textarea element.\n * @param props - Other props.\n */\nexport const Textarea = ({\n id,\n classes,\n value,\n rows = 5,\n cols = 25,\n name,\n required,\n disabled,\n readOnly,\n onBlur,\n onPointerDown,\n onChange,\n ref,\n styles,\n placeholder,\n ...props\n}: TextareaProps) => {\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (onChange && !disabled) {\n onChange?.(e)\n }\n }\n\n const handleBlur = (e: React.FocusEvent<HTMLTextAreaElement>) => {\n if (onBlur && !disabled) {\n onBlur?.(e)\n }\n }\n\n const handlePointerDown = (e: React.PointerEvent<HTMLTextAreaElement>) => {\n if (onPointerDown && !disabled) {\n onPointerDown?.(e)\n }\n }\n\n return (\n <UI\n as=\"textarea\"\n id={id}\n name={name}\n rows={rows}\n cols={cols}\n styles={styles}\n className={classes}\n data-style=\"textarea\"\n required={required}\n value={value}\n aria-disabled={disabled}\n readOnly={readOnly}\n onChange={handleChange}\n onBlur={handleBlur}\n onPointerDown={handlePointerDown}\n ref={ref}\n placeholder={placeholder || `${required ? '*' : ''} Message`}\n {...props}\n />\n )\n}\n\nexport default Textarea\nTextarea.displayName = 'Textarea'\n","import React from 'react'\nimport UI from '#components/ui'\nimport { type } from 'os'\n\nexport type TitleProps = {\n children: React.ReactNode\n type: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n ui?: string\n} & React.ComponentProps<typeof UI>\n\nconst Heading = ({\n type = 'h3',\n id,\n styles,\n ui,\n children,\n ...props\n}: TitleProps) => {\n return (\n <UI as={type} id={id} styles={styles} data-ui={ui} {...props}>\n {children}\n </UI>\n )\n}\n\nexport default Heading\nHeading.displayName = 'Heading'\n","// Code: Breadcrumb component\nimport React from 'react'\nimport UI from '#components/ui'\nimport { Truncate } from '#libs/content'\nimport Link from '#components/link/link'\n\n// TYPES\n\ntype customRoute = {\n /** The path or id for routing */\n path?: string\n /** The display name */\n name: string\n /** The url if linking out */\n url?: string\n}\n\ntype BreadcrumbProps = {\n /** Array of custom route objects */\n routes?: customRoute[]\n /** Starting route node */\n startRoute?: React.ReactNode\n /* Starting route url */\n startRouteUrl?: string\n /** Spacer node between routes */\n spacer?: React.ReactNode\n /** String representing current route */\n currentRoute?: string\n /** Prefix breadcrumb aria-label - \"prefix breadcrumb\" */\n ariaLabelPrefix?: string\n /** Truncate breadcrumb text after this length */\n truncateLength?: number\n /** Link props for breadcrumb links */\n linkProps?: React.ComponentProps<typeof Link>\n} & React.ComponentProps<typeof UI>\n\n// Components\n\n/**\n * Items component.\n *\n * @param styles - Styles object for the item.\n * @param id - Id for the item.\n * @param classes - Class names for the item.\n * @param children - Child components.\n * @param props - Other props.\n */\nconst Items = ({\n styles,\n id,\n classes,\n children,\n ...props\n}: React.ComponentProps<typeof UI>) => {\n return (\n <li data-list=\"unstyled inline\" {...props}>\n {children}\n </li>\n )\n}\n\n/**\n * List component.\n *\n * @param children - The content to render inside the list.\n * @param props - Additional props to pass to the UI component.\n */\nconst List = ({ children, ...props }: React.ComponentProps<typeof UI>) => {\n return (\n <UI as=\"ol\" data-list=\"unstyled inline\" {...props}>\n {children}\n </UI>\n )\n}\n\n/**\n * Nav component.\n *\n * @param styles - Styles object for the nav.\n * @param id - Id for the nav.\n * @param classes - Class names for the nav.\n * @param children - Child components.\n * @param props - Other props.\n */\nconst Nav = ({\n styles,\n id,\n classes,\n children,\n ...props\n}: React.ComponentProps<typeof UI>) => {\n return (\n <UI as=\"nav\" id={id} styles={styles} className={classes} {...props}>\n <List>{children}</List>\n </UI>\n )\n}\n\n/**\n * Navigation component for breadcrumbs.\n *\n * @param props - Props for the navigation component.\n * @param props.startRoute - Starting route node. Default 'Home'.\n * @param props.currentRoute - String representing current route.\n * @param props.spacer - Spacer node between routes. Default '&#47;'.\n * @param props.routes - Array of custom route objects.\n * @param props.styles - Styles object for the nav.\n * @param props.id - Id for the nav.\n * @param props.classes - Class names for the nav.\n * @param props.children - Child components.\n */\nexport const Breadcrumb = ({\n startRoute = 'Home',\n startRouteUrl = \"/\",\n currentRoute,\n spacer = <>&#47;</>,\n routes,\n styles,\n id,\n classes,\n ariaLabelPrefix,\n truncateLength = 15,\n linkProps,\n ...props\n}: BreadcrumbProps): React.JSX.Element => {\n const [currentPath, setCurrentPath] = React.useState('')\n React.useEffect(() => {\n const path = currentRoute || window.location.pathname\n if (path.length) {\n setCurrentPath(path)\n }\n }, [currentRoute])\n\n /**\n * Gets the path name for the given path segment.\n *\n * @param pathSegment - The path segment (string or number) to get the path name for.\n * @returns The path name object for the given path segment.\n */\n const getPathName = (pathSegment: string): customRoute => {\n const route = routes?.find((route) => route.path === pathSegment)\n\n return {\n path: route?.path || pathSegment,\n name: route?.name || pathSegment,\n url: route?.url || pathSegment,\n }\n }\n\n /** Array of path segments from current path */\n const segments = currentPath.split('/').filter((segment) => segment)\n /** Index of last item in segments array */\n const lastSegment = segments.length - 1\n\n /** Unique id for breadcrumb */\n const uuid = React.useId()\n\n\n return currentPath.length ? (\n <Nav\n id={id}\n {...props}\n styles={styles}\n className={classes}\n aria-label={ariaLabelPrefix}\n >\n <Items key={`${startRoute}-${uuid}`}>\n <Link href={startRouteUrl} {...linkProps}>{startRoute}</Link>\n </Items>\n <>\n {segments.length ? (\n segments.map((segment: any, index: number) => {\n const currentSegment = getPathName(segment)\n const { name, url, path } = currentSegment\n return index === lastSegment ? (\n <>\n {typeof segments[lastSegment] === 'string' &&\n segments[lastSegment].length > 3 &&\n segments[lastSegment] !== segments[lastSegment - 1] && (\n <Items key={`${path || index}-${uuid}`}>\n \n <span aria-hidden=\"true\">{spacer}</span>\n <a\n href=\"#\"\n aria-current=\"page\"\n aria-label={\n name.length > truncateLength ? name : undefined\n }\n >\n {Truncate(decodeURIComponent(name), truncateLength)}\n </a>\n \n </Items>\n )}\n </>\n ) : (\n <Items key={`${currentSegment?.name}-${uuid}`}>\n <span aria-hidden=\"true\">{spacer}</span>\n <span>\n <Link\n href={url}\n aria-label={name.length > truncateLength ? name : undefined}\n {...linkProps}\n >\n {Truncate(decodeURIComponent(name), truncateLength)}\n </Link>\n </span>\n </Items>\n );\n })\n ) : (\n null\n )}\n </>\n </Nav>\n ) : (\n <></>\n )\n}\n\nexport default Breadcrumb\n\nBreadcrumb.displayName = 'BreadCrumb'\nBreadcrumb.Nav = Nav\nBreadcrumb.List = List\nBreadcrumb.Items = Items\n","/**\n * Converts a string to a slug by:\n * - Converting to lowercase\n * - Trimming whitespace\n * - Removing non-word and non-hyphen characters\n * - Replacing sequences of whitespace and hyphens with a single hyphen\n * - Removing leading and trailing hyphens\n *\n * @param str - The string to slugify\n * @returns The slugified string\n */\nexport const Slugify = (str: string) => {\n return str\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, '')\n .replace(/[\\s_-]+/g, '-')\n .replace(/^-+|-+$/g, '')\n}\n\n/**\n * Truncates a string to a maximum length.\n *\n * @param str - The string to truncate.\n * @param length - The maximum length of the truncated string. Defaults to 15.\n * @returns The truncated string, with ellipses appended if truncated.\n */\nexport const Truncate = (str: string, length: number = 15) => {\n return str.length > length ? `${str.slice(0, length)}...` : str\n}\n","import React, { useState, ChangeEvent, useEffect } from 'react'\nimport { useTextToSpeech } from './useTextToSpeech'\nimport Textarea from '#components/form/textarea.jsx'\nimport TextToSpeechControls from './views/TextToSpeechControls'\n\n/**\n * Props for the TextToSpeechComponent.\n * @interface TextToSpeechComponentProps\n */\ninterface TextToSpeechComponentProps {\n /** Initial text to be spoken. Defaults to an empty string. */\n initialText?: string\n /** Whether to show the text input field. Defaults to true. */\n showTextInput?: boolean\n /** The voice to be used for speech synthesis. */\n voice?: SpeechSynthesisVoice | undefined\n /** The pitch of the voice. Defaults to 1. */\n pitch?: number\n /** The rate of speech. Defaults to 1. */\n rate?: number\n /** The language to be used for speech synthesis. */\n language?: string\n /** Player label */\n label?: string | React.ReactNode\n /** Callback function to be called when speech ends. */\n onEnd?: () => void\n}\n\n/**\n * A component that converts text to speech using the Web Speech API.\n * @param {TextToSpeechComponentProps} props - The props for the component.\n * @returns {JSX.Element} The rendered TextToSpeechComponent.\n */\nexport const TextToSpeech: React.FC<TextToSpeechComponentProps> = ({\n initialText = '',\n showTextInput = false,\n voice,\n pitch = 1,\n rate = 1,\n language,\n label,\n onEnd,\n}) => {\n const {\n speak,\n pause,\n resume,\n cancel,\n isSpeaking,\n isPaused,\n getAvailableLanguages,\n availableVoices,\n } = useTextToSpeech()\n const [text, setText] = useState<string>(initialText)\n console.log(getAvailableLanguages())\n\n useEffect(() => {\n setText(initialText)\n }, [initialText])\n\n const handleSpeak = (): void => {\n if (text.trim() !== '') {\n speak(text, { voice, pitch, rate }, handleEnd)\n }\n }\n\n const handleChange = (e: ChangeEvent<HTMLTextAreaElement>): void => {\n setText(e.target.value)\n }\n\n const handleEnd = (): void => {\n if (onEnd) {\n onEnd()\n }\n }\n\n return (\n <>\n {showTextInput && <Textarea value={text} onChange={handleChange} />}\n <TextToSpeechControls\n label={label}\n isSpeaking={isSpeaking}\n isPaused={isPaused}\n onSpeak={handleSpeak}\n onPause={pause}\n onResume={resume}\n onCancel={cancel}\n />\n </>\n )\n}\n\nexport default TextToSpeech\nTextToSpeech.displayName = 'TextToSpeechComponent'\n","import { useState, useEffect } from 'react'\n\n/**\n * Options for configuring speech synthesis.\n * @interface SpeechOptions\n */\ninterface SpeechOptions {\n /** The language for speech synthesis (e.g., 'en-US') */\n lang?: string\n\n /** The pitch of the voice (0 to 2) */\n pitch?: number\n /** The speed of the voice (0.1 to 10) */\n rate?: number\n\n /** The voice to use for speech synthesis */\n voice?: SpeechSynthesisVoice\n}\n/**\n * Custom hook to handle text-to-speech functionality.\n *\n * @param {SpeechSynthesisVoice} [initialVoice] - The initial voice to use for speech synthesis.\n * @returns {Object} An object containing methods to control speech synthesis and state variables.\n */\nexport const useTextToSpeech = (initialVoice?: SpeechSynthesisVoice) => {\n const [availableVoices, setAvailableVoices] = useState<\n SpeechSynthesisVoice[]\n >([])\n const [currentVoice, setCurrentVoice] = useState<\n SpeechSynthesisVoice | undefined\n >(initialVoice)\n\n const [isSpeaking, setIsSpeaking] = useState<boolean>(false)\n const [isPaused, setIsPaused] = useState<boolean>(false)\n const [utterance, setUtterance] = useState<SpeechSynthesisUtterance | null>(\n null,\n )\n\n useEffect(() => {\n const updateVoices = () => {\n const voices = window.speechSynthesis.getVoices()\n setAvailableVoices(voices)\n\n // Set default voice to Google US English if available\n const googleVoice = voices.find(\n (voice) => voice.name === 'Google US English',\n )\n if (googleVoice) {\n setCurrentVoice(googleVoice)\n } else {\n // Fallback to the first English voice if Google voice is not available\n const englishVoice = voices.find((voice) =>\n voice.lang.startsWith('en-'),\n )\n if (englishVoice) {\n setCurrentVoice(englishVoice)\n }\n }\n }\n\n updateVoices()\n window.speechSynthesis.onvoiceschanged = updateVoices\n\n return () => {\n window.speechSynthesis.onvoiceschanged = null\n }\n }, [])\n\n /**\n * Gets the list of available languages for speech synthesis.\n * @returns {string[]} An array of available language codes.\n */\n const getAvailableLanguages = () => {\n return [...new Set(availableVoices.map((voice) => voice.lang))]\n }\n\n /**\n * Initiates speech synthesis for the given text.\n *\n * @param {string} text - The text to be spoken.\n * @param {SpeechOptions} [options={}] - Options for speech synthesis.\n * @param {Function} [onEnd] - Callback function to be called when speech ends.\n */\n const speak = (\n text: string,\n options: SpeechOptions = {},\n onEnd?: () => void,\n ) => {\n const utterance = new SpeechSynthesisUtterance(text)\n\n utterance.lang = options.lang ?? 'en-US'\n utterance.pitch = options.pitch ?? 1\n utterance.rate = options.rate ?? 1\n utterance.voice = currentVoice ?? options.voice ?? null\n\n utterance.onend = () => {\n setIsSpeaking(false)\n setIsPaused(false)\n if (onEnd) {\n onEnd()\n }\n }\n\n if ('speechSynthesis' in window) {\n window.speechSynthesis.speak(utterance)\n setUtterance(utterance)\n setIsSpeaking(true)\n setIsPaused(false)\n } else {\n console.error('Speech synthesis not supported')\n // Handle the error appropriately\n }\n }\n\n /**\n * Changes the current voice used for speech synthesis.\n * @param {SpeechSynthesisVoice} voice - The new voice to use.\n */\n const changeVoice = (voice: SpeechSynthesisVoice) => {\n setCurrentVoice(voice)\n }\n\n /**\n * Pauses the ongoing speech synthesis.\n */\n const pause = () => {\n if (isSpeaking && !isPaused) {\n window.speechSynthesis.pause()\n setIsPaused(true)\n }\n }\n\n /**\n * Resumes the paused speech synthesis.\n */\n const resume = () => {\n if (isSpeaking && isPaused) {\n window.speechSynthesis.resume()\n setIsPaused(false)\n }\n }\n\n /**\n * Cancels the ongoing speech synthesis.\n */\n const cancel = () => {\n if (isSpeaking) {\n window.speechSynthesis.cancel()\n setIsSpeaking(false)\n setIsPaused(false)\n }\n }\n\n return {\n /** Initiates speech synthesis for the given text */\n speak,\n /** Pauses the ongoing speech synthesis */\n pause,\n /** Resumes the paused speech synthesis */\n resume,\n /** Cancels the ongoing speech synthesis */\n cancel,\n /** Indicates whether speech synthesis is currently active */\n isSpeaking,\n /** Indicates whether speech synthesis is currently paused */\n isPaused,\n /** Array of available voices for speech synthesis */\n availableVoices,\n /** Changes the current voice used for speech synthesis */\n changeVoice,\n /** The currently selected voice for speech synthesis */\n currentVoice,\n /** Gets the list of available languages for speech synthesis */\n getAvailableLanguages,\n }\n}\n","import React from 'react'\nimport Icon from '#components/icons/icon'\nimport UI from '#components/ui'\nimport { FC } from 'react'\n\n/**\n * Props for the TextToSpeechControls component.\n * @interface TextToSpeechControlsProps\n */\ninterface TextToSpeechControlsProps {\n /** Optional label for the controls */\n label?: string | React.ReactNode\n /** Indicates if the text-to-speech is currently speaking */\n isSpeaking: boolean\n /** Indicates if the text-to-speech is paused */\n isPaused: boolean\n /** Function to start speaking */\n onSpeak: () => void\n /** Function to pause speaking */\n onPause: () => void\n /** Function to resume speaking */\n onResume: () => void\n /** Function to cancel speaking */\n onCancel: () => void\n}\n\n/**\n * TTSButtonComponent props\n * @interface TTSButtonComponentProps\n */\ninterface TTSButtonComponentProps {\n /** The content of the button */\n children: React.ReactNode\n /** Function to call when the button is clicked */\n onClick: () => void\n}\n\n/**\n * TTSButtonComponent is a reusable button component for text-to-speech controls.\n * @param {TTSButtonComponentProps} props - The component props\n * @returns {React.ReactElement} The rendered button\n */\nexport const TTSButtonComponent: React.FC<TTSButtonComponentProps> = ({\n children,\n onClick,\n}) => {\n return (\n <UI\n as=\"button\"\n type=\"button\"\n className=\"tts-border\"\n data-btn=\"sm text pill\"\n onClick={onClick}\n >\n {children}\n </UI>\n )\n}\n\nexport const TTSButton = React.memo(TTSButtonComponent)\n\n/**\n * TextToSpeechControlsComponent interface extends FC<TextToSpeechControlsProps>\n * and includes a TTSButton property.\n * @interface TextToSpeechControlsComponent\n * @extends {FC<TextToSpeechControlsProps>}\n */\ninterface TextToSpeechControlsComponent extends FC<TextToSpeechControlsProps> {\n /** The TTSButton component used within TextToSpeechControls */\n TTSButton: typeof TTSButton\n}\n\n/**\n * TextToSpeechControls component provides a user interface for controlling text-to-speech functionality.\n * @param {TextToSpeechControlsProps} props - The component props\n * @returns {React.ReactElement} The rendered TextToSpeechControls component\n */\nconst TextToSpeechControls: TextToSpeechControlsComponent = ({\n label,\n isSpeaking,\n isPaused,\n onSpeak,\n onPause,\n onResume,\n onCancel,\n}) => {\n const iconSize = 16\n\n return (\n <UI as=\"div\" data-tts>\n {label && <p>{label}</p>}\n {!isSpeaking && (\n <TTSButton aria-label=\"Speak\" onClick={onSpeak}>\n <Icon.PlaySolid size={iconSize} />\n </TTSButton>\n )}\n {isSpeaking && !isPaused && (\n <TTSButton aria-label=\"Pause\" onClick={onPause}>\n <Icon.PauseSolid size={iconSize} />\n </TTSButton>\n )}\n {isPaused && (\n <TTSButton aria-label=\"Resume\" onClick={onResume}>\n <Icon.ResumeSolid size={iconSize} />\n </TTSButton>\n )}\n <TTSButton aria-label=\"Stop\" onClick={onCancel}>\n <Icon.StopSolid size={iconSize} />\n </TTSButton>\n </UI>\n )\n}\n\nTextToSpeechControls.displayName = 'TextToSpeechControls'\nTextToSpeechControls.TTSButton = TTSButton\n\nexport default TextToSpeechControls\n","import React, { useRef, useEffect, CSSProperties } from \"react\";\nimport UI from \"#components/ui\";\nimport DialogHeader from \"#components/dialog/views/dialog-header\";\nimport DialogFooter from \"#components/dialog/views/dialog-footer\";\nimport { useDialogClickHandler } from \"#hooks/useDialogClickHandler.js\";\n\n/**\n * Defines the props for the Dialog component.\n *\n * @property {boolean} [showDialog] - Determines whether the dialog should be shown.\n * @property {boolean} [isAlertDialog] - Determines whether the dialog should be displayed as an alert dialog.\n * @property {() => void} [onClose] - A callback function to be called when the dialog is closed.\n * @property {string} dialogTitle - The title of the dialog.\n * @property {string} [dialogLabel] - An optional label for the dialog.\n * @property {React.ReactNode} children - The content to be displayed inside the dialog.\n * @property {() => void | Promise<void>} [onConfirm] - A callback function to be called when the user confirms the dialog.\n * @property {string} [confirmLabel] - The label for the confirm button.\n * @property {string} [cancelLabel] - The label for the cancel button.\n * @property {string} [className] - An optional CSS class name to be applied to the dialog.\n * @property {CSSProperties} [styles] - Optional inline styles to be applied to the dialog.\n */\ntype DialogModalProps = React.ComponentProps<typeof UI> &\n React.ComponentProps<\"dialog\"> & {\n dialogTitle: string;\n dialogLabel?: string;\n children: React.ReactNode;\n showDialog?: boolean;\n isAlertDialog?: boolean;\n onClose?: () => void;\n onConfirm?: () => void | Promise<void>;\n confirmLabel?: string;\n cancelLabel?: string;\n className?: string;\n hideFooter?: boolean;\n styles?: CSSProperties;\n };\n\n/**\n * Renders a dialog modal component with customizable content and behavior.\n *\n * @param showDialog - Determines whether the dialog should be shown.\n * @param isAlertDialog - Determines whether the dialog should be displayed as an alert dialog.\n * @param onClose - A callback function to be called when the dialog is closed.\n * @param dialogTitle - The title of the dialog.\n * @param dialogLabel - An optional label for the dialog.\n * @param children - The content to be displayed inside the dialog.\n * @param onConfirm - A callback function to be called when the user confirms the dialog.\n * @param confirmLabel - The label for the confirm button.\n * @param cancelLabel - The label for the cancel button.\n * @param className - An optional CSS class name to be applied to the dialog.\n * @param styles - Optional inline styles to be applied to the dialog.\n */\nexport const Dialog: React.FC<DialogModalProps> = ({\n showDialog,\n isAlertDialog,\n onClose,\n dialogTitle,\n dialogLabel,\n children,\n onConfirm,\n confirmLabel = \"Confirm\",\n cancelLabel = \"Cancel\",\n className = \"\",\n hideFooter,\n styles,\n}) => {\n const dialogRef = useRef<HTMLDialogElement>(null);\n const [isOpen, setIsOpen] = React.useState(showDialog);\n\n useEffect(() => {\n setIsOpen(showDialog);\n }, [showDialog]);\n\n useEffect(() => {\n const dialog = dialogRef.current;\n if (!dialog) return;\n\n if (isOpen) {\n if (isAlertDialog) {\n dialog.show();\n } else {\n dialog.showModal();\n }\n } else {\n dialog.close();\n }\n }, [isOpen, isAlertDialog]);\n\n const handleClose = () => {\n if (onClose) onClose();\n setIsOpen(false);\n };\n\n const handleClickOutside = useDialogClickHandler(dialogRef, handleClose);\n\n return (\n <UI\n as=\"dialog\"\n role={isAlertDialog ? \"alertdialog\" : \"dialog\"}\n ref={dialogRef}\n onClose={handleClose}\n onClick={handleClickOutside}\n aria-modal={isOpen ? \"true\" : undefined}\n className={`${\"dialog-modal\"} ${className}`}\n aria-label={dialogLabel}\n style={styles}\n >\n <DialogHeader dialogTitle={dialogTitle} onClick={handleClose} />\n\n <UI\n as=\"section\"\n className={`dialog-content ${className}`}\n onClick={(e: React.MouseEvent) => e.stopPropagation()}\n >\n {children}\n {!hideFooter && (\n <DialogFooter\n onClose={handleClose}\n onConfirm={onConfirm}\n confirmLabel={confirmLabel}\n cancelLabel={cancelLabel}\n />\n )}\n </UI>\n </UI>\n );\n};\nexport default React.memo(Dialog);\n","import React from \"react\";\nimport UI from \"#components/ui\";\nimport Heading from \"#components/heading/heading\";\nimport Button from \"#components/buttons/button\";\nimport Icon from \"#components/icons/icon\";\n\nexport type DialogHeaderProps = {\n dialogTitle: string;\n onClick: () => void;\n} & React.ComponentProps<typeof Heading>;\n\n/**\n * DialogHeader component displays the header section of a dialog with a title and close button.\n *\n * @component\n * @param {Object} props - Component props\n * @param {string} props.dialogTitle - The title text to display in the dialog header\n * @param {() => void} props.onClick - Callback function triggered when close button is clicked\n * @param {string} [props.type='h3'] - Heading type/level to use for the title\n * @returns {JSX.Element} A dialog header with title and close button\n *\n * @example\n * ```jsx\n * <DialogHeader\n * dialogTitle=\"Confirm Action\"\n * onClick={() => setIsOpen(false)}\n * type=\"h2\"\n * />\n * ```\n */\n\nconst DialogHeader = ({\n dialogTitle,\n onClick,\n type = \"h3\",\n}: DialogHeaderProps): JSX.Element => {\n const handleClose = () => {\n onClick();\n };\n return (\n <UI as=\"div\" classes=\"dialog-header\">\n <Heading type={type} className=\"dialog-title\">\n {dialogTitle || \"Dialog\"}\n </Heading>\n <Button\n type=\"button\"\n onClick={handleClose}\n className=\"dialog-close\"\n aria-label=\"Close dialog\"\n data-btn=\"icon\"\n >\n <Icon>\n <Icon.Remove size={16} />\n </Icon>\n </Button>\n </UI>\n );\n};\n\nexport default React.memo(DialogHeader);\nDialogHeader.displayName = \"DialogHeader\";\n","import React from \"react\";\nimport UI from \"#components/ui\";\nimport Button from \"#components/buttons/button\";\n\ntype DialogFooterProps = {\n onClose: () => void;\n onConfirm?: () => void | Promise<void>;\n confirmLabel: string;\n cancelLabel: string;\n};\n\nconst DialogFooter: React.FC<DialogFooterProps> = ({\n onClose,\n onConfirm,\n confirmLabel,\n cancelLabel,\n}) => {\n return (\n <UI as=\"section\" className=\"dialog-footer\">\n {cancelLabel && (\n <Button\n type=\"button\"\n onClick={onClose}\n className=\"dialog-button button-secondary\"\n data-btn=\"sm\"\n >\n {cancelLabel}\n </Button>\n )}\n\n {onConfirm && (\n <Button\n type=\"button\"\n onClick={onConfirm}\n className=\"dialog-button button-primary\"\n data-btn=\"sm\"\n >\n {confirmLabel}\n </Button>\n )}\n </UI>\n );\n};\n\nexport default DialogFooter;\n","import { useCallback, RefObject } from \"react\";\n\nexport const useDialogClickHandler = (\n dialogRef: RefObject<HTMLDialogElement>,\n handleClose: () => void\n) => {\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLDialogElement>) => {\n const dialogDimensions = dialogRef.current?.getBoundingClientRect();\n if (dialogDimensions) {\n const isClickOutside =\n e.clientY < dialogDimensions.top ||\n e.clientY > dialogDimensions.bottom ||\n e.clientX < dialogDimensions.left ||\n e.clientX > dialogDimensions.right;\n\n if (isClickOutside) {\n handleClose();\n }\n }\n },\n [dialogRef, handleClose]\n );\n\n return handleClick;\n};\n"]}
package/libs/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { F as FP$1, C as ComponentProps$1 } from './icons-1f5afc0c.js';
2
- export { I as Icon } from './icons-1f5afc0c.js';
1
+ import { F as FP$1, C as ComponentProps$1 } from './icons-31ace3de.js';
2
+ export { I as Icon } from './icons-31ace3de.js';
3
3
  import * as React from 'react';
4
- import React__default, { ReactNode } from 'react';
4
+ import React__default, { ReactNode, CSSProperties } from 'react';
5
5
 
6
6
  type ButtonProps = Partial<React__default.ComponentProps<typeof FP$1>> & {
7
7
  /**
@@ -542,19 +542,50 @@ interface TextToSpeechComponentProps {
542
542
  */
543
543
  declare const TextToSpeech: React__default.FC<TextToSpeechComponentProps>;
544
544
 
545
- type DialogProps = {
546
- isOpen?: boolean;
547
- onOpen?: () => void;
548
- onClose?: () => void;
549
- onCancel?: () => void;
550
- dialogTitle?: string;
551
- showDialogHeader?: boolean;
552
- isAlertDialog?: boolean;
545
+ /**
546
+ * Defines the props for the Dialog component.
547
+ *
548
+ * @property {boolean} [showDialog] - Determines whether the dialog should be shown.
549
+ * @property {boolean} [isAlertDialog] - Determines whether the dialog should be displayed as an alert dialog.
550
+ * @property {() => void} [onClose] - A callback function to be called when the dialog is closed.
551
+ * @property {string} dialogTitle - The title of the dialog.
552
+ * @property {string} [dialogLabel] - An optional label for the dialog.
553
+ * @property {React.ReactNode} children - The content to be displayed inside the dialog.
554
+ * @property {() => void | Promise<void>} [onConfirm] - A callback function to be called when the user confirms the dialog.
555
+ * @property {string} [confirmLabel] - The label for the confirm button.
556
+ * @property {string} [cancelLabel] - The label for the cancel button.
557
+ * @property {string} [className] - An optional CSS class name to be applied to the dialog.
558
+ * @property {CSSProperties} [styles] - Optional inline styles to be applied to the dialog.
559
+ */
560
+ type DialogModalProps = React__default.ComponentProps<typeof FP$1> & React__default.ComponentProps<"dialog"> & {
561
+ dialogTitle: string;
562
+ dialogLabel?: string;
553
563
  children: React__default.ReactNode;
564
+ showDialog?: boolean;
565
+ isAlertDialog?: boolean;
566
+ onClose?: () => void;
567
+ onConfirm?: () => void | Promise<void>;
568
+ confirmLabel?: string;
569
+ cancelLabel?: string;
570
+ className?: string;
571
+ hideFooter?: boolean;
572
+ styles?: CSSProperties;
554
573
  };
555
- declare const Dialog: {
556
- ({ isOpen, dialogTitle, onOpen, onClose, onCancel, showDialogHeader, isAlertDialog, children, ...props }: DialogProps): JSX.Element;
557
- displayName: string;
558
- };
574
+ /**
575
+ * Renders a dialog modal component with customizable content and behavior.
576
+ *
577
+ * @param showDialog - Determines whether the dialog should be shown.
578
+ * @param isAlertDialog - Determines whether the dialog should be displayed as an alert dialog.
579
+ * @param onClose - A callback function to be called when the dialog is closed.
580
+ * @param dialogTitle - The title of the dialog.
581
+ * @param dialogLabel - An optional label for the dialog.
582
+ * @param children - The content to be displayed inside the dialog.
583
+ * @param onConfirm - A callback function to be called when the user confirms the dialog.
584
+ * @param confirmLabel - The label for the confirm button.
585
+ * @param cancelLabel - The label for the cancel button.
586
+ * @param className - An optional CSS class name to be applied to the dialog.
587
+ * @param styles - Optional inline styles to be applied to the dialog.
588
+ */
589
+ declare const Dialog: React__default.FC<DialogModalProps>;
559
590
 
560
591
  export { Article, Aside, FP as Box, Breadcrumb, Button, Caption, Card, Details, Dialog, FP, Field, Footer, Header, Img, Input, Landmarks, Link, List, Main, Modal, Nav, NavItem, NavItemProps, NavList, NavListProps, NavProps, Popover, Section, RenderTable as TBL, Table, Tag, TagProps, Tbody, Td, Text, TextProps, TextToSpeech, Textarea, TextareaProps, Thead, Title, TitleProps, Link as To, Tr };
package/libs/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { F as FP$1, C as ComponentProps$1 } from './icons-1f5afc0c.js';
2
- export { I as Icon } from './icons-1f5afc0c.js';
1
+ import { F as FP$1, C as ComponentProps$1 } from './icons-31ace3de.js';
2
+ export { I as Icon } from './icons-31ace3de.js';
3
3
  import * as React from 'react';
4
- import React__default, { ReactNode } from 'react';
4
+ import React__default, { ReactNode, CSSProperties } from 'react';
5
5
 
6
6
  type ButtonProps = Partial<React__default.ComponentProps<typeof FP$1>> & {
7
7
  /**
@@ -542,19 +542,50 @@ interface TextToSpeechComponentProps {
542
542
  */
543
543
  declare const TextToSpeech: React__default.FC<TextToSpeechComponentProps>;
544
544
 
545
- type DialogProps = {
546
- isOpen?: boolean;
547
- onOpen?: () => void;
548
- onClose?: () => void;
549
- onCancel?: () => void;
550
- dialogTitle?: string;
551
- showDialogHeader?: boolean;
552
- isAlertDialog?: boolean;
545
+ /**
546
+ * Defines the props for the Dialog component.
547
+ *
548
+ * @property {boolean} [showDialog] - Determines whether the dialog should be shown.
549
+ * @property {boolean} [isAlertDialog] - Determines whether the dialog should be displayed as an alert dialog.
550
+ * @property {() => void} [onClose] - A callback function to be called when the dialog is closed.
551
+ * @property {string} dialogTitle - The title of the dialog.
552
+ * @property {string} [dialogLabel] - An optional label for the dialog.
553
+ * @property {React.ReactNode} children - The content to be displayed inside the dialog.
554
+ * @property {() => void | Promise<void>} [onConfirm] - A callback function to be called when the user confirms the dialog.
555
+ * @property {string} [confirmLabel] - The label for the confirm button.
556
+ * @property {string} [cancelLabel] - The label for the cancel button.
557
+ * @property {string} [className] - An optional CSS class name to be applied to the dialog.
558
+ * @property {CSSProperties} [styles] - Optional inline styles to be applied to the dialog.
559
+ */
560
+ type DialogModalProps = React__default.ComponentProps<typeof FP$1> & React__default.ComponentProps<"dialog"> & {
561
+ dialogTitle: string;
562
+ dialogLabel?: string;
553
563
  children: React__default.ReactNode;
564
+ showDialog?: boolean;
565
+ isAlertDialog?: boolean;
566
+ onClose?: () => void;
567
+ onConfirm?: () => void | Promise<void>;
568
+ confirmLabel?: string;
569
+ cancelLabel?: string;
570
+ className?: string;
571
+ hideFooter?: boolean;
572
+ styles?: CSSProperties;
554
573
  };
555
- declare const Dialog: {
556
- ({ isOpen, dialogTitle, onOpen, onClose, onCancel, showDialogHeader, isAlertDialog, children, ...props }: DialogProps): JSX.Element;
557
- displayName: string;
558
- };
574
+ /**
575
+ * Renders a dialog modal component with customizable content and behavior.
576
+ *
577
+ * @param showDialog - Determines whether the dialog should be shown.
578
+ * @param isAlertDialog - Determines whether the dialog should be displayed as an alert dialog.
579
+ * @param onClose - A callback function to be called when the dialog is closed.
580
+ * @param dialogTitle - The title of the dialog.
581
+ * @param dialogLabel - An optional label for the dialog.
582
+ * @param children - The content to be displayed inside the dialog.
583
+ * @param onConfirm - A callback function to be called when the user confirms the dialog.
584
+ * @param confirmLabel - The label for the confirm button.
585
+ * @param cancelLabel - The label for the cancel button.
586
+ * @param className - An optional CSS class name to be applied to the dialog.
587
+ * @param styles - Optional inline styles to be applied to the dialog.
588
+ */
589
+ declare const Dialog: React__default.FC<DialogModalProps>;
559
590
 
560
591
  export { Article, Aside, FP as Box, Breadcrumb, Button, Caption, Card, Details, Dialog, FP, Field, Footer, Header, Img, Input, Landmarks, Link, List, Main, Modal, Nav, NavItem, NavItemProps, NavList, NavListProps, NavProps, Popover, Section, RenderTable as TBL, Table, Tag, TagProps, Tbody, Td, Text, TextProps, TextToSpeech, Textarea, TextareaProps, Thead, Title, TitleProps, Link as To, Tr };