@ably/ui 15.4.1 → 15.5.0-dev.4b8dd74

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 (197) hide show
  1. package/README.md +23 -2
  2. package/core/Accordion/types.js +2 -1
  3. package/core/Accordion/types.js.map +1 -0
  4. package/core/Accordion/utils.js +2 -1
  5. package/core/Accordion/utils.js.map +1 -0
  6. package/core/Accordion.js +2 -1
  7. package/core/Accordion.js.map +1 -0
  8. package/core/Badge.js +2 -1
  9. package/core/Badge.js.map +1 -0
  10. package/core/Button.js +2 -1
  11. package/core/Button.js.map +1 -0
  12. package/core/Code/component.js +2 -1
  13. package/core/Code/component.js.map +1 -0
  14. package/core/Code.js +2 -1
  15. package/core/Code.js.map +1 -0
  16. package/core/ConnectStateWrapper.js +2 -1
  17. package/core/ConnectStateWrapper.js.map +1 -0
  18. package/core/ContactFooter/component.js +2 -1
  19. package/core/ContactFooter/component.js.map +1 -0
  20. package/core/ContactFooter.js +2 -1
  21. package/core/ContactFooter.js.map +1 -0
  22. package/core/CookieMessage.js +2 -1
  23. package/core/CookieMessage.js.map +1 -0
  24. package/core/CustomerLogos.js +2 -1
  25. package/core/CustomerLogos.js.map +1 -0
  26. package/core/DropdownMenu.js +2 -1
  27. package/core/DropdownMenu.js.map +1 -0
  28. package/core/Expander.js +2 -1
  29. package/core/Expander.js.map +1 -0
  30. package/core/FeaturedLink.js +2 -1
  31. package/core/FeaturedLink.js.map +1 -0
  32. package/core/Flash.js +2 -1
  33. package/core/Flash.js.map +1 -0
  34. package/core/Flyout.js +2 -1
  35. package/core/Flyout.js.map +1 -0
  36. package/core/Footer.js +2 -1
  37. package/core/Footer.js.map +1 -0
  38. package/core/Header/HeaderLinks.js +2 -1
  39. package/core/Header/HeaderLinks.js.map +1 -0
  40. package/core/Header.js +2 -1
  41. package/core/Header.js.map +1 -0
  42. package/core/Icon/computed-icons.js +2 -1
  43. package/core/Icon/computed-icons.js.map +1 -0
  44. package/core/Icon/types.js +2 -1
  45. package/core/Icon/types.js.map +1 -0
  46. package/core/Icon/utils.js +2 -1
  47. package/core/Icon/utils.js.map +1 -0
  48. package/core/Icon.js +2 -1
  49. package/core/Icon.js.map +1 -0
  50. package/core/LinkButton.js +2 -1
  51. package/core/LinkButton.js.map +1 -0
  52. package/core/Loader.js +2 -1
  53. package/core/Loader.js.map +1 -0
  54. package/core/Logo.js +2 -1
  55. package/core/Logo.js.map +1 -0
  56. package/core/Meganav/component.js +2 -1
  57. package/core/Meganav/component.js.map +1 -0
  58. package/core/Meganav.js +2 -1
  59. package/core/Meganav.js.map +1 -0
  60. package/core/MeganavBlogPostsList/component.js +2 -1
  61. package/core/MeganavBlogPostsList/component.js.map +1 -0
  62. package/core/MeganavBlogPostsList.js +2 -1
  63. package/core/MeganavBlogPostsList.js.map +1 -0
  64. package/core/MeganavContentCompany.js +2 -1
  65. package/core/MeganavContentCompany.js.map +1 -0
  66. package/core/MeganavContentDevelopers.js +2 -1
  67. package/core/MeganavContentDevelopers.js.map +1 -0
  68. package/core/MeganavContentProducts.js +2 -1
  69. package/core/MeganavContentProducts.js.map +1 -0
  70. package/core/MeganavContentUseCases.js +2 -1
  71. package/core/MeganavContentUseCases.js.map +1 -0
  72. package/core/MeganavControl/component.js +2 -1
  73. package/core/MeganavControl/component.js.map +1 -0
  74. package/core/MeganavControl.js +2 -1
  75. package/core/MeganavControl.js.map +1 -0
  76. package/core/MeganavControlMobileDropdown/component.js +2 -1
  77. package/core/MeganavControlMobileDropdown/component.js.map +1 -0
  78. package/core/MeganavControlMobileDropdown.js +2 -1
  79. package/core/MeganavControlMobileDropdown.js.map +1 -0
  80. package/core/MeganavControlMobilePanelClose/component.js +2 -1
  81. package/core/MeganavControlMobilePanelClose/component.js.map +1 -0
  82. package/core/MeganavControlMobilePanelClose.js +2 -1
  83. package/core/MeganavControlMobilePanelClose.js.map +1 -0
  84. package/core/MeganavControlMobilePanelOpen/component.js +2 -1
  85. package/core/MeganavControlMobilePanelOpen/component.js.map +1 -0
  86. package/core/MeganavControlMobilePanelOpen.js +2 -1
  87. package/core/MeganavControlMobilePanelOpen.js.map +1 -0
  88. package/core/MeganavItemsDesktop.js +2 -1
  89. package/core/MeganavItemsDesktop.js.map +1 -0
  90. package/core/MeganavItemsMobile.js +2 -1
  91. package/core/MeganavItemsMobile.js.map +1 -0
  92. package/core/MeganavItemsSignedIn.js +2 -1
  93. package/core/MeganavItemsSignedIn.js.map +1 -0
  94. package/core/MeganavSearch.js +2 -1
  95. package/core/MeganavSearch.js.map +1 -0
  96. package/core/MeganavSearchAutocomplete/component.js +2 -1
  97. package/core/MeganavSearchAutocomplete/component.js.map +1 -0
  98. package/core/MeganavSearchAutocomplete.js +2 -1
  99. package/core/MeganavSearchAutocomplete.js.map +1 -0
  100. package/core/MeganavSearchPanel.js +2 -1
  101. package/core/MeganavSearchPanel.js.map +1 -0
  102. package/core/MeganavSearchSuggestions/component.js +2 -1
  103. package/core/MeganavSearchSuggestions/component.js.map +1 -0
  104. package/core/MeganavSearchSuggestions.js +2 -1
  105. package/core/MeganavSearchSuggestions.js.map +1 -0
  106. package/core/Notice/component.js +2 -1
  107. package/core/Notice/component.js.map +1 -0
  108. package/core/Notice.js +2 -1
  109. package/core/Notice.js.map +1 -0
  110. package/core/Pricing/PricingCards.js +2 -1
  111. package/core/Pricing/PricingCards.js.map +1 -0
  112. package/core/Pricing/data.js +2 -1
  113. package/core/Pricing/data.js.map +1 -0
  114. package/core/Pricing/types.js +2 -1
  115. package/core/Pricing/types.js.map +1 -0
  116. package/core/ProductTile/ProductDescription.js +2 -1
  117. package/core/ProductTile/ProductDescription.js.map +1 -0
  118. package/core/ProductTile/ProductIcon.js +2 -1
  119. package/core/ProductTile/ProductIcon.js.map +1 -0
  120. package/core/ProductTile/ProductLabel.js +2 -1
  121. package/core/ProductTile/ProductLabel.js.map +1 -0
  122. package/core/ProductTile/data.js +2 -1
  123. package/core/ProductTile/data.js.map +1 -0
  124. package/core/ProductTile.js +2 -1
  125. package/core/ProductTile.js.map +1 -0
  126. package/core/SignOutLink.js +2 -1
  127. package/core/SignOutLink.js.map +1 -0
  128. package/core/Slider/component.js +2 -1
  129. package/core/Slider/component.js.map +1 -0
  130. package/core/Slider.js +2 -1
  131. package/core/Slider.js.map +1 -0
  132. package/core/Status.js +2 -1
  133. package/core/Status.js.map +1 -0
  134. package/core/TabMenu.js +2 -1
  135. package/core/TabMenu.js.map +1 -0
  136. package/core/Table/Table.js +2 -1
  137. package/core/Table/Table.js.map +1 -0
  138. package/core/Table/TableCell.js +2 -1
  139. package/core/Table/TableCell.js.map +1 -0
  140. package/core/Table/TableRow.js +2 -1
  141. package/core/Table/TableRow.js.map +1 -0
  142. package/core/Table/data.js +2 -1
  143. package/core/Table/data.js.map +1 -0
  144. package/core/Table.js +2 -1
  145. package/core/Table.js.map +1 -0
  146. package/core/Toggle.js +2 -1
  147. package/core/Toggle.js.map +1 -0
  148. package/core/Tooltip.js +2 -1
  149. package/core/Tooltip.js.map +1 -0
  150. package/core/css.js +2 -1
  151. package/core/css.js.map +1 -0
  152. package/core/dom-query.js +2 -1
  153. package/core/dom-query.js.map +1 -0
  154. package/core/hubspot-chat-toggle.js +2 -1
  155. package/core/hubspot-chat-toggle.js.map +1 -0
  156. package/core/icons.js +2 -1
  157. package/core/icons.js.map +1 -0
  158. package/core/insights/index.js +2 -0
  159. package/core/insights/index.js.map +1 -0
  160. package/core/insights/mixpanel.js +2 -0
  161. package/core/insights/mixpanel.js.map +1 -0
  162. package/core/insights/posthog.js +2 -0
  163. package/core/insights/posthog.js.map +1 -0
  164. package/core/load-sprites.js +2 -1
  165. package/core/load-sprites.js.map +1 -0
  166. package/core/react-renderer.js +2 -1
  167. package/core/react-renderer.js.map +1 -0
  168. package/core/remote-blogs-posts.js +2 -1
  169. package/core/remote-blogs-posts.js.map +1 -0
  170. package/core/remote-data-store.js +2 -1
  171. package/core/remote-data-store.js.map +1 -0
  172. package/core/remote-data-util.js +2 -1
  173. package/core/remote-data-util.js.map +1 -0
  174. package/core/remote-session-data.js +2 -1
  175. package/core/remote-session-data.js.map +1 -0
  176. package/core/scripts.js +2 -1
  177. package/core/scripts.js.map +1 -0
  178. package/core/styles/colors/computed-colors.json +1 -0
  179. package/core/styles/colors/types.js +2 -1
  180. package/core/styles/colors/types.js.map +1 -0
  181. package/core/styles/colors/utils.js +2 -1
  182. package/core/styles/colors/utils.js.map +1 -0
  183. package/core/styles/forms/story-components.js +2 -1
  184. package/core/styles/forms/story-components.js.map +1 -0
  185. package/core/url-base.js +2 -1
  186. package/core/url-base.js.map +1 -0
  187. package/core/utils/cn.js +2 -1
  188. package/core/utils/cn.js.map +1 -0
  189. package/core/utils/heights.js +2 -1
  190. package/core/utils/heights.js.map +1 -0
  191. package/core/utils/syntax-highlighter-registry.js +2 -1
  192. package/core/utils/syntax-highlighter-registry.js.map +1 -0
  193. package/core/utils/syntax-highlighter.js +2 -1
  194. package/core/utils/syntax-highlighter.js.map +1 -0
  195. package/package.json +8 -2
  196. package/reset/scripts.js +2 -1
  197. package/reset/scripts.js.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/TabMenu.tsx"],"sourcesContent":["import React, { ReactNode, useEffect } from \"react\";\nimport * as Tabs from \"@radix-ui/react-tabs\";\nimport throttle from \"lodash.throttle\";\nimport cn from \"./utils/cn\";\n\n/**\n * Props for the TabMenu component.\n */\nexport type TabMenuProps = {\n /**\n * An array of tabs, which can be either a string or an object with a label and an optional disabled state.\n */\n tabs: (string | { label: string; disabled?: boolean })[];\n\n /**\n * An optional array of React nodes representing the content for each tab.\n */\n contents?: ReactNode[];\n\n /**\n * An optional callback function that is called when a tab is clicked, receiving the index of the clicked tab.\n */\n tabOnClick?: (index: number) => void;\n\n /**\n * An optional class name to apply to each tab.\n */\n tabClassName?: string;\n\n /**\n * An optional class name to apply to the Tabs.Root element.\n */\n rootClassName?: string;\n\n /**\n * An optional class name to apply to the Tabs.Content element.\n */\n contentClassName?: string;\n\n /**\n * Optional configuration options for the TabMenu.\n */\n options?: {\n /**\n * The index of the tab that should be selected by default.\n */\n defaultTabIndex?: number;\n\n /**\n * Whether to show an underline below the selected tab.\n */\n underline?: boolean;\n\n /**\n * Whether to animate the transition between tabs.\n */\n animated?: boolean;\n\n /**\n * Whether the tab width should be flexible.\n */\n flexibleTabWidth?: boolean;\n\n /**\n * Whether the tab height should be flexible.\n */\n flexibleTabHeight?: boolean;\n };\n};\n\nconst DEFAULT_TAILWIND_ANIMATION_DURATION = 150;\n\nconst TabMenu: React.FC<TabMenuProps> = ({\n tabs = [],\n contents = [],\n tabOnClick,\n tabClassName,\n rootClassName,\n contentClassName,\n options,\n}) => {\n const {\n defaultTabIndex = 0,\n underline = true,\n animated: animatedOption = true,\n flexibleTabWidth = false,\n flexibleTabHeight = false,\n } = options ?? {};\n\n const listRef = React.useRef<HTMLDivElement>(null);\n const [animated, setAnimated] = React.useState(false);\n const [highlight, setHighlight] = React.useState({ offset: 0, width: 0 });\n\n useEffect(() => {\n if (animatedOption && highlight.width > 0) {\n setTimeout(() => {\n setAnimated(true);\n }, DEFAULT_TAILWIND_ANIMATION_DURATION);\n }\n }, [animatedOption, highlight.width]);\n\n useEffect(() => {\n const handleResize = throttle(() => {\n const activeTabElement =\n listRef.current?.querySelector<HTMLButtonElement>(\n `[data-state=\"active\"]`,\n );\n\n if (activeTabElement) {\n updateHighlightDimensions(activeTabElement);\n }\n }, 100);\n\n handleResize();\n\n window.addEventListener(\"resize\", handleResize);\n\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n };\n }, []);\n\n const updateHighlightDimensions = (element: HTMLButtonElement) => {\n const { left: parentLeft } = listRef.current?.getBoundingClientRect() ?? {};\n const { left, width } = element.getBoundingClientRect() ?? {};\n\n setHighlight({\n offset: (left ?? 0) - (parentLeft ?? 0),\n width: width ?? 0,\n });\n };\n\n const handleTabClick = (\n event: React.MouseEvent<HTMLButtonElement>,\n index: number,\n ) => {\n tabOnClick?.(index);\n updateHighlightDimensions(event.currentTarget as HTMLButtonElement);\n };\n\n return (\n <Tabs.Root\n defaultValue={`tab-${defaultTabIndex}`}\n className={cn({ \"h-full\": flexibleTabHeight }, rootClassName)}\n >\n <Tabs.List\n ref={listRef}\n className={cn(\n \"relative\",\n {\n \"flex border-b border-neutral-300 dark:border-neutral-1000\":\n underline,\n },\n { \"h-full\": flexibleTabHeight },\n )}\n >\n {tabs.map((tab, index) => (\n <Tabs.Trigger\n key={`tab-${index}`}\n className={cn(\n \"lg:px-24 md:px-20 px-16 py-16 ui-text-menu1 font-bold data-[state=active]:text-neutral-1300 text-neutral-1000 dark:data-[state=active]:text-neutral-000 dark:text-neutral-300 focus:outline-none focus-visible:outline-gui-focus transition-colors hover:text-neutral-1300 dark:hover:text-neutral-000 active:text-neutral-900 dark:active:text-neutral-400 disabled:text-gui-unavailable dark:disabled:text-gui-unavailable-dark disabled:cursor-not-allowed\",\n { \"flex-1\": flexibleTabWidth },\n { \"h-full\": flexibleTabHeight },\n tabClassName,\n )}\n value={`tab-${index}`}\n onClick={(event) => handleTabClick(event, index)}\n disabled={typeof tab === \"object\" ? tab.disabled : false}\n >\n {typeof tab === \"object\" ? tab.label : tab}\n </Tabs.Trigger>\n ))}\n <div\n className={cn(\n \"absolute bottom-0 bg-neutral-1300 dark:bg-neutral-000 h-[3px] w-24\",\n { \"transition-[transform,width]\": animated },\n )}\n style={{\n transform: `translateX(${highlight.offset}px)`,\n width: `${highlight.width}px`,\n }}\n ></div>\n </Tabs.List>\n {contents.map((content, index) => (\n <Tabs.Content\n key={`tab-${index}`}\n value={`tab-${index}`}\n className={contentClassName}\n >\n {content}\n </Tabs.Content>\n ))}\n </Tabs.Root>\n );\n};\n\nexport default TabMenu;\n"],"names":["React","useEffect","Tabs","throttle","cn","DEFAULT_TAILWIND_ANIMATION_DURATION","TabMenu","tabs","contents","tabOnClick","tabClassName","rootClassName","contentClassName","options","defaultTabIndex","underline","animated","animatedOption","flexibleTabWidth","flexibleTabHeight","listRef","useRef","setAnimated","useState","highlight","setHighlight","offset","width","setTimeout","handleResize","activeTabElement","current","querySelector","updateHighlightDimensions","window","addEventListener","removeEventListener","element","left","parentLeft","getBoundingClientRect","handleTabClick","event","index","currentTarget","Root","defaultValue","className","List","ref","map","tab","Trigger","key","value","onClick","disabled","label","div","style","transform","content","Content"],"mappings":"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"}
@@ -1 +1,2 @@
1
- import React,{cloneElement}from"react";export const Table=({id,children,...rest})=>React.createElement("table",{id:id,...rest,className:`ui-standard-container mb-4 sm:table-fixed ${rest?.className??""}`},children);export const TableBody=({children,...rest})=>React.createElement("tbody",rest,children);export const TableHeader=({children,...rest})=>React.createElement("thead",{...rest,className:`sticky bg-white z-10 top-0 ${rest?.className??""}`},cloneElement(children,{isHeader:true}));export const TableRowHeader=({children,...rest})=>React.createElement("tr",{className:`-ml-24 mt-8 sm:ml-0 sm:mt-0 sm:sticky z-10 ${rest?.className??""}`},cloneElement(children,{isRowHeader:true}));
1
+ import React,{cloneElement}from"react";export const Table=({id,children,...rest})=>React.createElement("table",{id:id,...rest,className:`ui-standard-container mb-4 sm:table-fixed ${rest?.className??""}`},children);export const TableBody=({children,...rest})=>React.createElement("tbody",rest,children);export const TableHeader=({children,...rest})=>React.createElement("thead",{...rest,className:`sticky bg-white z-10 top-0 ${rest?.className??""}`},cloneElement(children,{isHeader:true}));export const TableRowHeader=({children,...rest})=>React.createElement("tr",{className:`-ml-24 mt-8 sm:ml-0 sm:mt-0 sm:sticky z-10 ${rest?.className??""}`},cloneElement(children,{isRowHeader:true}));
2
+ //# sourceMappingURL=Table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/Table/Table.tsx"],"sourcesContent":["import React, {\n PropsWithChildren,\n ReactElement,\n TableHTMLAttributes,\n cloneElement,\n} from \"react\";\n\ntype TableProps = {\n id?: string;\n};\n\nexport const Table = ({\n id,\n children,\n ...rest\n}: PropsWithChildren<TableProps & TableHTMLAttributes<HTMLTableElement>>) => (\n <table\n id={id}\n {...rest}\n className={`ui-standard-container mb-4 sm:table-fixed ${\n rest?.className ?? \"\"\n }`}\n >\n {children}\n </table>\n);\n\nexport const TableBody = ({\n children,\n ...rest\n}: PropsWithChildren<TableHTMLAttributes<HTMLTableSectionElement>>) => (\n <tbody {...rest}>{children}</tbody>\n);\n\nexport const TableHeader = ({\n children,\n ...rest\n}: PropsWithChildren<TableHTMLAttributes<HTMLTableSectionElement>>) => (\n <thead\n {...rest}\n className={`sticky bg-white z-10 top-0 ${rest?.className ?? \"\"}`}\n >\n {cloneElement(children as ReactElement, { isHeader: true })}\n </thead>\n);\n\nexport const TableRowHeader = ({\n children,\n ...rest\n}: PropsWithChildren<TableHTMLAttributes<HTMLTableRowElement>>) => (\n <tr\n className={`-ml-24 mt-8 sm:ml-0 sm:mt-0 sm:sticky z-10 ${\n rest?.className ?? \"\"\n }`}\n >\n {cloneElement(children as ReactElement, { isRowHeader: true })}\n </tr>\n);\n"],"names":["React","cloneElement","Table","id","children","rest","table","className","TableBody","tbody","TableHeader","thead","isHeader","TableRowHeader","tr","isRowHeader"],"mappings":"AAAA,OAAOA,OAILC,YAAY,KACP,OAAQ,AAMf,QAAO,MAAMC,MAAQ,CAAC,CACpBC,EAAE,CACFC,QAAQ,CACR,GAAGC,KACmE,GACtE,oBAACC,SACCH,GAAIA,GACH,GAAGE,IAAI,CACRE,UAAW,CAAC,0CAA0C,EACpDF,MAAME,WAAa,GACpB,CAAC,EAEDH,SAEH,AAEF,QAAO,MAAMI,UAAY,CAAC,CACxBJ,QAAQ,CACR,GAAGC,KAC6D,GAChE,oBAACI,QAAUJ,KAAOD,SAClB,AAEF,QAAO,MAAMM,YAAc,CAAC,CAC1BN,QAAQ,CACR,GAAGC,KAC6D,GAChE,oBAACM,SACE,GAAGN,IAAI,CACRE,UAAW,CAAC,2BAA2B,EAAEF,MAAME,WAAa,GAAG,CAAC,EAE/DN,aAAaG,SAA0B,CAAEQ,SAAU,IAAK,GAE3D,AAEF,QAAO,MAAMC,eAAiB,CAAC,CAC7BT,QAAQ,CACR,GAAGC,KACyD,GAC5D,oBAACS,MACCP,UAAW,CAAC,2CAA2C,EACrDF,MAAME,WAAa,GACpB,CAAC,EAEDN,aAAaG,SAA0B,CAAEW,YAAa,IAAK,GAE9D"}
@@ -4,4 +4,5 @@ import React from"react";const LabelCell=({children,...rest})=>{const classes=`
4
4
  border-light-grey sm:p-24 leading-none flex sm:table-cell
5
5
  ${isRowHeader?"rounded-l-none rounded-r sm:rounded-lg py-20 px-24":"py-6"}
6
6
  ${rest?.className??""}
7
- `},children);const HeaderCell=({children,...rest})=>React.createElement("td",{...rest,className:`ui-text-h3 px-24 py-24 hidden sm:table-cell ${rest?.className??""}`},children);const CtaCell=({children,...rest})=>React.createElement("td",{...rest,className:`pt-24 hidden sm:table-cell ${rest?.className??""}`},children);export{TableCell,LabelCell,HeaderCell,CtaCell};
7
+ `},children);const HeaderCell=({children,...rest})=>React.createElement("td",{...rest,className:`ui-text-h3 px-24 py-24 hidden sm:table-cell ${rest?.className??""}`},children);const CtaCell=({children,...rest})=>React.createElement("td",{...rest,className:`pt-24 hidden sm:table-cell ${rest?.className??""}`},children);export{TableCell,LabelCell,HeaderCell,CtaCell};
8
+ //# sourceMappingURL=TableCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/Table/TableCell.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\n\ntype TableCellProps = {\n isRowHeader?: boolean;\n} & React.TdHTMLAttributes<HTMLTableCellElement>;\n\nconst LabelCell = ({\n children,\n ...rest\n}: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => {\n const classes = `\n ui-text-p1 font-bold pt-24 pb-8 border-light-grey sm:p-24 sm:relative sm:top-2 flex sm:table-cell ${\n rest?.className ?? \"\"\n }\n `;\n\n return (\n <td {...rest} className={classes}>\n {children}\n </td>\n );\n};\n\nconst TableCell = ({\n children,\n isRowHeader,\n ...rest\n}: PropsWithChildren<TableCellProps>) => (\n <td\n {...rest}\n className={`\n border-light-grey sm:p-24 leading-none flex sm:table-cell\n ${\n isRowHeader\n ? \"rounded-l-none rounded-r sm:rounded-lg py-20 px-24\"\n : \"py-6\"\n }\n ${rest?.className ?? \"\"}\n `}\n >\n {children}\n </td>\n);\n\nconst HeaderCell = ({\n children,\n ...rest\n}: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => (\n <td\n {...rest}\n className={`ui-text-h3 px-24 py-24 hidden sm:table-cell ${\n rest?.className ?? \"\"\n }`}\n >\n {children}\n </td>\n);\n\nconst CtaCell = ({\n children,\n ...rest\n}: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => (\n <td\n {...rest}\n className={`pt-24 hidden sm:table-cell ${rest?.className ?? \"\"}`}\n >\n {children}\n </td>\n);\n\nexport { TableCell, LabelCell, HeaderCell, CtaCell };\n"],"names":["React","LabelCell","children","rest","classes","className","td","TableCell","isRowHeader","HeaderCell","CtaCell"],"mappings":"AAAA,OAAOA,UAAkC,OAAQ,CAMjD,MAAMC,UAAY,CAAC,CACjBC,QAAQ,CACR,GAAGC,KAC6D,IAChE,MAAMC,QAAU;AAClB,sGAAsG,EAChGD,MAAME,WAAa;AAEzB,EAAE,CAAC,CAED,OACE,oBAACC,MAAI,GAAGH,IAAI,CAAEE,UAAWD,SACtBF,SAGP,EAEA,MAAMK,UAAY,CAAC,CACjBL,QAAQ,CACRM,WAAW,CACX,GAAGL,KAC+B,GAClC,oBAACG,MACE,GAAGH,IAAI,CACRE,UAAW;AACf;AACA,QAAQ,EACEG,YACI,qDACA;AAEd,QAAQ,EAAEL,MAAME,WAAa;AAC7B,MAAM,CAAC,EAEFH,UAIL,MAAMO,WAAa,CAAC,CAClBP,QAAQ,CACR,GAAGC,KAC6D,GAChE,oBAACG,MACE,GAAGH,IAAI,CACRE,UAAW,CAAC,4CAA4C,EACtDF,MAAME,WAAa,GACpB,CAAC,EAEDH,UAIL,MAAMQ,QAAU,CAAC,CACfR,QAAQ,CACR,GAAGC,KAC6D,GAChE,oBAACG,MACE,GAAGH,IAAI,CACRE,UAAW,CAAC,2BAA2B,EAAEF,MAAME,WAAa,GAAG,CAAC,EAE/DH,SAIL,QAASK,SAAS,CAAEN,SAAS,CAAEQ,UAAU,CAAEC,OAAO,CAAG"}
@@ -1 +1,2 @@
1
- import React from"react";const CtaRow=({children})=>React.createElement("tr",null,React.createElement("td",{className:"hidden sm:block"}),children);const TableRow=({children,isHeader,...rest})=>React.createElement("tr",rest,isHeader&&React.createElement("td",{className:"bg-white"}),children);export{TableRow,CtaRow};
1
+ import React from"react";const CtaRow=({children})=>React.createElement("tr",null,React.createElement("td",{className:"hidden sm:block"}),children);const TableRow=({children,isHeader,...rest})=>React.createElement("tr",rest,isHeader&&React.createElement("td",{className:"bg-white"}),children);export{TableRow,CtaRow};
2
+ //# sourceMappingURL=TableRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/Table/TableRow.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\n\nconst CtaRow = ({ children }: PropsWithChildren) => (\n <tr>\n <td className=\"hidden sm:block\"></td>\n {children}\n </tr>\n);\n\ntype RowProps = {\n isHeader?: boolean;\n} & React.HTMLAttributes<HTMLTableRowElement>;\n\nconst TableRow = ({\n children,\n isHeader,\n ...rest\n}: PropsWithChildren<RowProps>) => (\n <tr {...rest}>\n {isHeader && <td className=\"bg-white\" />}\n {children}\n </tr>\n);\n\nexport { TableRow, CtaRow };\n"],"names":["React","CtaRow","children","tr","td","className","TableRow","isHeader","rest"],"mappings":"AAAA,OAAOA,UAAkC,OAAQ,CAEjD,MAAMC,OAAS,CAAC,CAAEC,QAAQ,CAAqB,GAC7C,oBAACC,UACC,oBAACC,MAAGC,UAAU,oBACbH,UAQL,MAAMI,SAAW,CAAC,CAChBJ,QAAQ,CACRK,QAAQ,CACR,GAAGC,KACyB,GAC5B,oBAACL,KAAOK,KACLD,UAAY,oBAACH,MAAGC,UAAU,aAC1BH,SAIL,QAASI,QAAQ,CAAEL,MAAM,CAAG"}
@@ -1 +1,2 @@
1
- import React,{Fragment}from"react";import Tooltip from"../Tooltip";import Table from"../Table";import Icon from"../Icon";const Supported=()=>React.createElement(Icon,{name:"icon-gui-check-circle-solid",size:"1.5rem",color:"text-gui-success",additionalCSS:"flex-grow-0 flex-shrink-0","data-testid":"supported-icon"});const Unsupported=()=>React.createElement(Icon,{name:"icon-gui-x-circle-solid",size:"1.5rem",color:"text-gui-error",additionalCSS:"flex-grow-0 flex-shrink-0","data-testid":"unsupported-icon"});const testRow=index=>({label:`Label ${index+1}`,cells:[{label:"text",content:"Cell content",column:"Free"},{label:"yes",content:React.createElement("div",{className:"flex items-center sm:flex-col sm:items-start"},React.createElement("span",{className:"sm:order-1 px-6 sm:py-6 sm:px-0"},"Supported"),React.createElement("span",{className:"sm:order-0"},React.createElement(Supported,null))),column:"PAYG"},{label:"no",content:React.createElement("div",{className:"flex items-center sm:flex-col sm:items-start"},React.createElement("span",{className:"sm:order-1 px-6 sm:py-6 sm:px-0"},"Unsupported"),React.createElement("span",{className:"sm:order-0"},React.createElement(Unsupported,null))),column:"Custom"}]});const sections=["Features","Support","Technical Support"].map(label=>({label,rows:[...Array(5)].map((_,i)=>testRow(i))}));export const PricingPageTable=()=>{return React.createElement("div",{className:"ui-standard-container"},React.createElement("h2",{className:"ui-text-h2 text-center m-32"},"Pricing Page Table"),React.createElement("p",{className:"text-center m-32"},"Example content"),React.createElement(Table.Root,null,React.createElement(Table.Header,null,React.createElement(Table.Row,null,React.createElement(Table.Cell,null,React.createElement("span",{className:"ui-text-h3 hidden sm:block"},"Free")),React.createElement(Table.Cell,null,React.createElement("span",{className:"ui-text-h3 hidden sm:block"},"PAYG")),React.createElement(Table.Cell,null,React.createElement("span",{className:"ui-text-h3 hidden sm:block"},"Custom")))),React.createElement(Table.Body,null,sections.map(section=>React.createElement(Fragment,{key:section.label},React.createElement(Table.RowHeader,null,React.createElement(Table.Cell,{colSpan:4},section.label)),section.rows.map(row=>React.createElement(Table.Row,{key:row.label},React.createElement(Table.LabelCell,{key:row.label,className:"border-t border-light-grey"},React.createElement("a",{className:"ui-link",href:"#"},row.label),React.createElement(Tooltip,null,"Example tooltip")),row.cells.map(cell=>React.createElement(Table.Cell,{key:cell.label,className:"last:mb-16 sm:mb-0"},React.createElement("div",{className:"flex-1 sm:hidden !text-dark-grey ui-text-overline2"},cell.column),cell.content)))))),React.createElement(Table.Row,null,React.createElement(Table.Cell,null),React.createElement(Table.CtaCell,null,React.createElement("a",{href:"#",className:"ui-btn-secondary"},"Get started")),React.createElement(Table.CtaCell,null,React.createElement("a",{href:"#",className:"ui-btn-secondary"},"Get started")),React.createElement(Table.CtaCell,null,React.createElement("a",{href:"#",className:"ui-btn"},"Contact sales"))))))};
1
+ import React,{Fragment}from"react";import Tooltip from"../Tooltip";import Table from"../Table";import Icon from"../Icon";const Supported=()=>React.createElement(Icon,{name:"icon-gui-check-circle-solid",size:"1.5rem",color:"text-gui-success",additionalCSS:"flex-grow-0 flex-shrink-0","data-testid":"supported-icon"});const Unsupported=()=>React.createElement(Icon,{name:"icon-gui-x-circle-solid",size:"1.5rem",color:"text-gui-error",additionalCSS:"flex-grow-0 flex-shrink-0","data-testid":"unsupported-icon"});const testRow=index=>({label:`Label ${index+1}`,cells:[{label:"text",content:"Cell content",column:"Free"},{label:"yes",content:React.createElement("div",{className:"flex items-center sm:flex-col sm:items-start"},React.createElement("span",{className:"sm:order-1 px-6 sm:py-6 sm:px-0"},"Supported"),React.createElement("span",{className:"sm:order-0"},React.createElement(Supported,null))),column:"PAYG"},{label:"no",content:React.createElement("div",{className:"flex items-center sm:flex-col sm:items-start"},React.createElement("span",{className:"sm:order-1 px-6 sm:py-6 sm:px-0"},"Unsupported"),React.createElement("span",{className:"sm:order-0"},React.createElement(Unsupported,null))),column:"Custom"}]});const sections=["Features","Support","Technical Support"].map(label=>({label,rows:[...Array(5)].map((_,i)=>testRow(i))}));export const PricingPageTable=()=>{return React.createElement("div",{className:"ui-standard-container"},React.createElement("h2",{className:"ui-text-h2 text-center m-32"},"Pricing Page Table"),React.createElement("p",{className:"text-center m-32"},"Example content"),React.createElement(Table.Root,null,React.createElement(Table.Header,null,React.createElement(Table.Row,null,React.createElement(Table.Cell,null,React.createElement("span",{className:"ui-text-h3 hidden sm:block"},"Free")),React.createElement(Table.Cell,null,React.createElement("span",{className:"ui-text-h3 hidden sm:block"},"PAYG")),React.createElement(Table.Cell,null,React.createElement("span",{className:"ui-text-h3 hidden sm:block"},"Custom")))),React.createElement(Table.Body,null,sections.map(section=>React.createElement(Fragment,{key:section.label},React.createElement(Table.RowHeader,null,React.createElement(Table.Cell,{colSpan:4},section.label)),section.rows.map(row=>React.createElement(Table.Row,{key:row.label},React.createElement(Table.LabelCell,{key:row.label,className:"border-t border-light-grey"},React.createElement("a",{className:"ui-link",href:"#"},row.label),React.createElement(Tooltip,null,"Example tooltip")),row.cells.map(cell=>React.createElement(Table.Cell,{key:cell.label,className:"last:mb-16 sm:mb-0"},React.createElement("div",{className:"flex-1 sm:hidden !text-dark-grey ui-text-overline2"},cell.column),cell.content)))))),React.createElement(Table.Row,null,React.createElement(Table.Cell,null),React.createElement(Table.CtaCell,null,React.createElement("a",{href:"#",className:"ui-btn-secondary"},"Get started")),React.createElement(Table.CtaCell,null,React.createElement("a",{href:"#",className:"ui-btn-secondary"},"Get started")),React.createElement(Table.CtaCell,null,React.createElement("a",{href:"#",className:"ui-btn"},"Contact sales"))))))};
2
+ //# sourceMappingURL=data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/Table/data.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\n\nimport Tooltip from \"../Tooltip\";\nimport Table from \"../Table\";\nimport Icon from \"../Icon\";\n\nconst Supported = () => (\n <Icon\n name=\"icon-gui-check-circle-solid\"\n size=\"1.5rem\"\n color=\"text-gui-success\"\n additionalCSS=\"flex-grow-0 flex-shrink-0\"\n data-testid=\"supported-icon\"\n />\n);\n\nconst Unsupported = () => (\n <Icon\n name=\"icon-gui-x-circle-solid\"\n size=\"1.5rem\"\n color=\"text-gui-error\"\n additionalCSS=\"flex-grow-0 flex-shrink-0\"\n data-testid=\"unsupported-icon\"\n />\n);\n\nconst testRow = (index: number) => ({\n label: `Label ${index + 1}`,\n cells: [\n { label: \"text\", content: \"Cell content\", column: \"Free\" },\n {\n label: \"yes\",\n content: (\n <div className=\"flex items-center sm:flex-col sm:items-start\">\n <span className=\"sm:order-1 px-6 sm:py-6 sm:px-0\">Supported</span>\n <span className=\"sm:order-0\">\n <Supported />\n </span>\n </div>\n ),\n column: \"PAYG\",\n },\n {\n label: \"no\",\n content: (\n <div className=\"flex items-center sm:flex-col sm:items-start\">\n <span className=\"sm:order-1 px-6 sm:py-6 sm:px-0\">Unsupported</span>\n <span className=\"sm:order-0\">\n <Unsupported />\n </span>\n </div>\n ),\n column: \"Custom\",\n },\n ],\n});\n\nconst sections = [\"Features\", \"Support\", \"Technical Support\"].map((label) => ({\n label,\n rows: [...Array(5)].map((_, i) => testRow(i)),\n}));\n\nexport const PricingPageTable = () => {\n return (\n <div className=\"ui-standard-container\">\n <h2 className=\"ui-text-h2 text-center m-32\">Pricing Page Table</h2>\n <p className=\"text-center m-32\">Example content</p>\n <Table.Root>\n <Table.Header>\n <Table.Row>\n <Table.Cell>\n <span className=\"ui-text-h3 hidden sm:block\">Free</span>\n </Table.Cell>\n <Table.Cell>\n <span className=\"ui-text-h3 hidden sm:block\">PAYG</span>\n </Table.Cell>\n <Table.Cell>\n <span className=\"ui-text-h3 hidden sm:block\">Custom</span>\n </Table.Cell>\n </Table.Row>\n </Table.Header>\n <Table.Body>\n {sections.map((section) => (\n <Fragment key={section.label}>\n <Table.RowHeader>\n <Table.Cell colSpan={4}>{section.label}</Table.Cell>\n </Table.RowHeader>\n {section.rows.map((row) => (\n <Table.Row key={row.label}>\n <Table.LabelCell\n key={row.label}\n className=\"border-t border-light-grey\"\n >\n <a className=\"ui-link\" href=\"#\">\n {row.label}\n </a>\n <Tooltip>Example tooltip</Tooltip>\n </Table.LabelCell>\n {row.cells.map((cell) => (\n <Table.Cell key={cell.label} className=\"last:mb-16 sm:mb-0\">\n <div className=\"flex-1 sm:hidden !text-dark-grey ui-text-overline2\">\n {cell.column}\n </div>\n {cell.content}\n </Table.Cell>\n ))}\n </Table.Row>\n ))}\n </Fragment>\n ))}\n <Table.Row>\n <Table.Cell></Table.Cell>\n <Table.CtaCell>\n <a href=\"#\" className=\"ui-btn-secondary\">\n Get started\n </a>\n </Table.CtaCell>\n <Table.CtaCell>\n <a href=\"#\" className=\"ui-btn-secondary\">\n Get started\n </a>\n </Table.CtaCell>\n <Table.CtaCell>\n <a href=\"#\" className=\"ui-btn\">\n Contact sales\n </a>\n </Table.CtaCell>\n </Table.Row>\n </Table.Body>\n </Table.Root>\n </div>\n );\n};\n"],"names":["React","Fragment","Tooltip","Table","Icon","Supported","name","size","color","additionalCSS","data-testid","Unsupported","testRow","index","label","cells","content","column","div","className","span","sections","map","rows","Array","_","i","PricingPageTable","h2","p","Root","Header","Row","Cell","Body","section","key","RowHeader","colSpan","row","LabelCell","a","href","cell","CtaCell"],"mappings":"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"}
package/core/Table.js CHANGED
@@ -1 +1,2 @@
1
- import{Table,TableRowHeader,TableHeader,TableBody}from"./Table/Table";import{TableRow}from"./Table/TableRow";import{TableCell,LabelCell,HeaderCell,CtaCell}from"./Table/TableCell";export default{Root:Table,Row:TableRow,Cell:TableCell,LabelCell,HeaderCell,CtaCell,RowHeader:TableRowHeader,Body:TableBody,Header:TableHeader};
1
+ import{Table,TableRowHeader,TableHeader,TableBody}from"./Table/Table";import{TableRow}from"./Table/TableRow";import{TableCell,LabelCell,HeaderCell,CtaCell}from"./Table/TableCell";export default{Root:Table,Row:TableRow,Cell:TableCell,LabelCell,HeaderCell,CtaCell,RowHeader:TableRowHeader,Body:TableBody,Header:TableHeader};
2
+ //# sourceMappingURL=Table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/Table.tsx"],"sourcesContent":["import { Table, TableRowHeader, TableHeader, TableBody } from \"./Table/Table\";\nimport { TableRow } from \"./Table/TableRow\";\nimport { TableCell, LabelCell, HeaderCell, CtaCell } from \"./Table/TableCell\";\n\nexport default {\n Root: Table,\n Row: TableRow,\n Cell: TableCell,\n LabelCell,\n HeaderCell,\n CtaCell,\n RowHeader: TableRowHeader,\n Body: TableBody,\n Header: TableHeader,\n};\n"],"names":["Table","TableRowHeader","TableHeader","TableBody","TableRow","TableCell","LabelCell","HeaderCell","CtaCell","Root","Row","Cell","RowHeader","Body","Header"],"mappings":"AAAA,OAASA,KAAK,CAAEC,cAAc,CAAEC,WAAW,CAAEC,SAAS,KAAQ,eAAgB,AAC9E,QAASC,QAAQ,KAAQ,kBAAmB,AAC5C,QAASC,SAAS,CAAEC,SAAS,CAAEC,UAAU,CAAEC,OAAO,KAAQ,mBAAoB,AAE9E,eAAe,CACbC,KAAMT,MACNU,IAAKN,SACLO,KAAMN,UACNC,UACAC,WACAC,QACAI,UAAWX,eACXY,KAAMV,UACNW,OAAQZ,WACV,CAAE"}
package/core/Toggle.js CHANGED
@@ -1 +1,2 @@
1
- import*as Switch from"@radix-ui/react-switch";import React from"react";import cn from"./utils/cn";const Toggle=({id,size="lg",label,className,...props})=>{const rootSize=size==="sm"?"w-[42px] h-24":"w-[56px] h-32";const thumbSize=size==="sm"?"w-[21px] h-[21px] translate-x-1 data-[state=checked]:translate-x-[20px]":"h-[28px] w-[28px] translate-x-2 data-[state=checked]:translate-x-[26px]";return React.createElement("div",{className:"flex items-center"},React.createElement(Switch.Root,{className:cn("p-0 bg-neutral-600 rounded-full relative inline-block transition-colors data-[disabled]:bg-gui-unavailable data-[disabled]:cursor-not-allowed data-[state=checked]:bg-orange-600 focus-base",className,rootSize),id:id,...props},React.createElement(Switch.Thumb,{className:cn(`block bg-white data-[disabled]:bg-neutral-500 rounded-full drop-shadow-toggle transition-transform`,thumbSize)})),label?React.createElement("label",{className:"ml-16",htmlFor:id},label):null)};export default Toggle;
1
+ import*as Switch from"@radix-ui/react-switch";import React from"react";import cn from"./utils/cn";const Toggle=({id,size="lg",label,className,...props})=>{const rootSize=size==="sm"?"w-[42px] h-24":"w-[56px] h-32";const thumbSize=size==="sm"?"w-[21px] h-[21px] translate-x-1 data-[state=checked]:translate-x-[20px]":"h-[28px] w-[28px] translate-x-2 data-[state=checked]:translate-x-[26px]";return React.createElement("div",{className:"flex items-center"},React.createElement(Switch.Root,{className:cn("p-0 bg-neutral-600 rounded-full relative inline-block transition-colors data-[disabled]:bg-gui-unavailable data-[disabled]:cursor-not-allowed data-[state=checked]:bg-orange-600 focus-base",className,rootSize),id:id,...props},React.createElement(Switch.Thumb,{className:cn(`block bg-white data-[disabled]:bg-neutral-500 rounded-full drop-shadow-toggle transition-transform`,thumbSize)})),label?React.createElement("label",{className:"ml-16",htmlFor:id},label):null)};export default Toggle;
2
+ //# sourceMappingURL=Toggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/Toggle.tsx"],"sourcesContent":["import * as Switch from \"@radix-ui/react-switch\";\nimport React from \"react\";\nimport cn from \"./utils/cn\";\n\ntype ToggleProps = {\n id: string;\n size?: \"sm\" | \"lg\";\n label?: string;\n className?: string;\n onCheckedChange?: (checked: boolean) => void;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nconst Toggle: React.FC<ToggleProps> = ({\n id,\n size = \"lg\",\n label,\n className,\n ...props\n}) => {\n const rootSize = size === \"sm\" ? \"w-[42px] h-24\" : \"w-[56px] h-32\";\n const thumbSize =\n size === \"sm\"\n ? \"w-[21px] h-[21px] translate-x-1 data-[state=checked]:translate-x-[20px]\"\n : \"h-[28px] w-[28px] translate-x-2 data-[state=checked]:translate-x-[26px]\";\n\n return (\n <div className=\"flex items-center\">\n <Switch.Root\n className={cn(\n \"p-0 bg-neutral-600 rounded-full relative inline-block transition-colors data-[disabled]:bg-gui-unavailable data-[disabled]:cursor-not-allowed data-[state=checked]:bg-orange-600 focus-base\",\n className,\n rootSize,\n )}\n id={id}\n {...props}\n >\n <Switch.Thumb\n className={cn(\n `block bg-white data-[disabled]:bg-neutral-500 rounded-full drop-shadow-toggle transition-transform`,\n thumbSize,\n )}\n />\n </Switch.Root>\n {label ? (\n <label className=\"ml-16\" htmlFor={id}>\n {label}\n </label>\n ) : null}\n </div>\n );\n};\n\nexport default Toggle;\n"],"names":["Switch","React","cn","Toggle","id","size","label","className","props","rootSize","thumbSize","div","Root","Thumb","htmlFor"],"mappings":"AAAA,UAAYA,WAAY,wBAAyB,AACjD,QAAOC,UAAW,OAAQ,AAC1B,QAAOC,OAAQ,YAAa,CAU5B,MAAMC,OAAgC,CAAC,CACrCC,EAAE,CACFC,KAAO,IAAI,CACXC,KAAK,CACLC,SAAS,CACT,GAAGC,MACJ,IACC,MAAMC,SAAWJ,OAAS,KAAO,gBAAkB,gBACnD,MAAMK,UACJL,OAAS,KACL,0EACA,0EAEN,OACE,oBAACM,OAAIJ,UAAU,qBACb,oBAACP,OAAOY,IAAI,EACVL,UAAWL,GACT,8LACAK,UACAE,UAEFL,GAAIA,GACH,GAAGI,KAAK,EAET,oBAACR,OAAOa,KAAK,EACXN,UAAWL,GACT,CAAC,kGAAkG,CAAC,CACpGQ,cAILJ,MACC,oBAACA,SAAMC,UAAU,QAAQO,QAASV,IAC/BE,OAED,KAGV,CAEA,gBAAeH,MAAO"}
package/core/Tooltip.js CHANGED
@@ -1 +1,2 @@
1
- import React,{useRef,useState,useEffect}from"react";import{createPortal}from"react-dom";import Icon from"./Icon";const Tooltip=({children,triggerElement,triggerProps,tooltipProps,interactive=false,...rest})=>{const[open,setOpen]=useState(false);const[fadeOut,setFadeOut]=useState(false);const[position,setPosition]=useState({x:0,y:0,orientation:"top"});const offset=8;const reference=useRef(null);const floating=useRef(null);const fadeOutTimeoutRef=useRef(null);useEffect(()=>{if(open){const floatingRect=floating.current?.getBoundingClientRect();const referenceRect=reference.current?.getBoundingClientRect();const viewportWidth=window.innerWidth;const viewportHeight=window.innerHeight;let orientation="top";if(floatingRect&&referenceRect){let x=referenceRect.left+referenceRect.width/2-floatingRect.width/2+window.scrollX;let y=referenceRect.top-floatingRect.height-offset+window.scrollY;if(x+floatingRect.width>viewportWidth+window.scrollX){x=viewportWidth+window.scrollX-floatingRect.width-offset;orientation="left"}if(x<window.scrollX){x=window.scrollX+offset;orientation="right"}if(y<window.scrollY){y=referenceRect.bottom+offset+window.scrollY;orientation="bottom"}if(y+floatingRect.height>viewportHeight+window.scrollY){y=referenceRect.top-floatingRect.height-offset+window.scrollY}setPosition({x,y,orientation})}}else{setPosition({x:0,y:0,orientation:"top"})}return()=>{if(fadeOutTimeoutRef.current!==null){clearTimeout(fadeOutTimeoutRef.current)}}},[open]);const initiateFadeOut=()=>{setFadeOut(true);fadeOutTimeoutRef.current=setTimeout(()=>{setOpen(false);setFadeOut(false)},250)};const cursorTowardsTooltip=(event,ref)=>{if(!ref.current){return false}const{clientX,clientY}=event;const{x,y,width,height}=ref.current.getBoundingClientRect();const{orientation}=position;switch(orientation){case"top":return clientX>=x&&clientX<=x+width&&clientY<y;case"left":return clientY>=y&&clientY<=y+height&&clientX<x;case"right":return clientY>=y&&clientY<=y+height&&clientX>x+width;case"bottom":return clientX>=x&&clientX<=x+width&&clientY>y+height;default:return false}};const fadeOutIfNotWithinTrigger=event=>{if(!reference.current)return;const{clientX,clientY}=event;const{x,y,width,height}=reference.current.getBoundingClientRect();const withinBounds=clientX>=x&&clientX<=x+width&&clientY>=y&&clientY<=y+height;if(!withinBounds){initiateFadeOut()}};return React.createElement("div",{...rest,className:`inline-flex ml-8 ${rest?.className??""}`},React.createElement("button",{onMouseEnter:()=>setOpen(true),onMouseLeave:event=>{if(!interactive||!cursorTowardsTooltip(event,reference)){initiateFadeOut()}},type:"button",ref:reference,"aria-describedby":"tooltip",...triggerProps,className:`p-0 relative focus:outline-none h-[1rem] ${triggerProps?.className??""}`},triggerElement??React.createElement(Icon,{name:"icon-gui-information-circle-micro",color:"text-neutral-800 dark:text-neutral-500",size:"1rem"})),open?createPortal(React.createElement("div",{role:"tooltip",ref:floating,onMouseLeave:event=>setTimeout(()=>fadeOutIfNotWithinTrigger(event),250),style:{top:position.y,left:position.x,zIndex:1e3,boxShadow:"4px 4px 15px rgba(0, 0, 0, 0.2)"},...tooltipProps,className:`bg-neutral-1000 dark:bg-neutral-300 text-neutral-200 dark:text-neutral-1000 ui-text-p3 font-medium p-16 ${interactive?"":"pointer-events-none"} rounded-lg absolute ${tooltipProps?.className??""} ${fadeOut?"animate-[tooltipExit_0.25s_ease-in-out]":"animate-[tooltipEntry_0.25s_ease-in-out]"}`},React.createElement("div",{className:"max-w-[240px] w-auto"},children)),document.body):null)};export default Tooltip;
1
+ import React,{useRef,useState,useEffect}from"react";import{createPortal}from"react-dom";import Icon from"./Icon";const Tooltip=({children,triggerElement,triggerProps,tooltipProps,interactive=false,...rest})=>{const[open,setOpen]=useState(false);const[fadeOut,setFadeOut]=useState(false);const[position,setPosition]=useState({x:0,y:0,orientation:"top"});const offset=8;const reference=useRef(null);const floating=useRef(null);const fadeOutTimeoutRef=useRef(null);useEffect(()=>{if(open){const floatingRect=floating.current?.getBoundingClientRect();const referenceRect=reference.current?.getBoundingClientRect();const viewportWidth=window.innerWidth;const viewportHeight=window.innerHeight;let orientation="top";if(floatingRect&&referenceRect){let x=referenceRect.left+referenceRect.width/2-floatingRect.width/2+window.scrollX;let y=referenceRect.top-floatingRect.height-offset+window.scrollY;if(x+floatingRect.width>viewportWidth+window.scrollX){x=viewportWidth+window.scrollX-floatingRect.width-offset;orientation="left"}if(x<window.scrollX){x=window.scrollX+offset;orientation="right"}if(y<window.scrollY){y=referenceRect.bottom+offset+window.scrollY;orientation="bottom"}if(y+floatingRect.height>viewportHeight+window.scrollY){y=referenceRect.top-floatingRect.height-offset+window.scrollY}setPosition({x,y,orientation})}}else{setPosition({x:0,y:0,orientation:"top"})}return()=>{if(fadeOutTimeoutRef.current!==null){clearTimeout(fadeOutTimeoutRef.current)}}},[open]);const initiateFadeOut=()=>{setFadeOut(true);fadeOutTimeoutRef.current=setTimeout(()=>{setOpen(false);setFadeOut(false)},250)};const cursorTowardsTooltip=(event,ref)=>{if(!ref.current){return false}const{clientX,clientY}=event;const{x,y,width,height}=ref.current.getBoundingClientRect();const{orientation}=position;switch(orientation){case"top":return clientX>=x&&clientX<=x+width&&clientY<y;case"left":return clientY>=y&&clientY<=y+height&&clientX<x;case"right":return clientY>=y&&clientY<=y+height&&clientX>x+width;case"bottom":return clientX>=x&&clientX<=x+width&&clientY>y+height;default:return false}};const fadeOutIfNotWithinTrigger=event=>{if(!reference.current)return;const{clientX,clientY}=event;const{x,y,width,height}=reference.current.getBoundingClientRect();const withinBounds=clientX>=x&&clientX<=x+width&&clientY>=y&&clientY<=y+height;if(!withinBounds){initiateFadeOut()}};return React.createElement("div",{...rest,className:`inline-flex ml-8 ${rest?.className??""}`},React.createElement("button",{onMouseEnter:()=>setOpen(true),onMouseLeave:event=>{if(!interactive||!cursorTowardsTooltip(event,reference)){initiateFadeOut()}},type:"button",ref:reference,"aria-describedby":"tooltip",...triggerProps,className:`p-0 relative focus:outline-none h-[1rem] ${triggerProps?.className??""}`},triggerElement??React.createElement(Icon,{name:"icon-gui-information-circle-micro",color:"text-neutral-800 dark:text-neutral-500",size:"1rem"})),open?createPortal(React.createElement("div",{role:"tooltip",ref:floating,onMouseLeave:event=>setTimeout(()=>fadeOutIfNotWithinTrigger(event),250),style:{top:position.y,left:position.x,zIndex:1e3,boxShadow:"4px 4px 15px rgba(0, 0, 0, 0.2)"},...tooltipProps,className:`bg-neutral-1000 dark:bg-neutral-300 text-neutral-200 dark:text-neutral-1000 ui-text-p3 font-medium p-16 ${interactive?"":"pointer-events-none"} rounded-lg absolute ${tooltipProps?.className??""} ${fadeOut?"animate-[tooltipExit_0.25s_ease-in-out]":"animate-[tooltipEntry_0.25s_ease-in-out]"}`},React.createElement("div",{className:"max-w-[240px] w-auto"},children)),document.body):null)};export default Tooltip;
2
+ //# sourceMappingURL=Tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/Tooltip.tsx"],"sourcesContent":["import React, {\n ButtonHTMLAttributes,\n HTMLAttributes,\n PropsWithChildren,\n ReactNode,\n useRef,\n useState,\n MouseEvent,\n RefObject,\n useEffect,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport Icon from \"./Icon\";\n\ntype TooltipProps = {\n triggerElement?: ReactNode;\n triggerProps?: ButtonHTMLAttributes<HTMLButtonElement>;\n tooltipProps?: HTMLAttributes<HTMLDivElement>;\n interactive?: boolean;\n} & HTMLAttributes<HTMLDivElement>;\n\nconst Tooltip = ({\n children,\n triggerElement,\n triggerProps,\n tooltipProps,\n interactive = false,\n ...rest\n}: PropsWithChildren<TooltipProps>) => {\n const [open, setOpen] = useState(false);\n const [fadeOut, setFadeOut] = useState(false);\n const [position, setPosition] = useState({ x: 0, y: 0, orientation: \"top\" });\n const offset = 8;\n const reference = useRef<HTMLButtonElement>(null);\n const floating = useRef<HTMLDivElement>(null);\n const fadeOutTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n useEffect(() => {\n if (open) {\n const floatingRect = floating.current?.getBoundingClientRect();\n const referenceRect = reference.current?.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n let orientation = \"top\";\n\n if (floatingRect && referenceRect) {\n let x =\n referenceRect.left +\n referenceRect.width / 2 -\n floatingRect.width / 2 +\n window.scrollX;\n let y =\n referenceRect.top - floatingRect.height - offset + window.scrollY;\n\n // Adjust if tooltip goes off the right edge\n if (x + floatingRect.width > viewportWidth + window.scrollX) {\n x = viewportWidth + window.scrollX - floatingRect.width - offset;\n orientation = \"left\";\n }\n\n // Adjust if tooltip goes off the left edge\n if (x < window.scrollX) {\n x = window.scrollX + offset;\n orientation = \"right\";\n }\n\n // Adjust if tooltip goes off the top edge\n if (y < window.scrollY) {\n y = referenceRect.bottom + offset + window.scrollY;\n orientation = \"bottom\";\n }\n\n // Adjust if tooltip goes off the bottom edge\n if (y + floatingRect.height > viewportHeight + window.scrollY) {\n y = referenceRect.top - floatingRect.height - offset + window.scrollY;\n }\n\n setPosition({ x, y, orientation });\n }\n } else {\n setPosition({ x: 0, y: 0, orientation: \"top\" });\n }\n\n return () => {\n if (fadeOutTimeoutRef.current !== null) {\n clearTimeout(fadeOutTimeoutRef.current);\n }\n };\n }, [open]);\n\n const initiateFadeOut = () => {\n setFadeOut(true);\n fadeOutTimeoutRef.current = setTimeout(() => {\n setOpen(false);\n setFadeOut(false);\n }, 250);\n };\n\n const cursorTowardsTooltip = (\n event: MouseEvent,\n ref: RefObject<HTMLButtonElement>,\n ) => {\n if (!ref.current) {\n return false;\n }\n\n const { clientX, clientY } = event;\n const { x, y, width, height } = ref.current.getBoundingClientRect();\n const { orientation } = position;\n\n switch (orientation) {\n case \"top\":\n return clientX >= x && clientX <= x + width && clientY < y;\n case \"left\":\n return clientY >= y && clientY <= y + height && clientX < x;\n case \"right\":\n return clientY >= y && clientY <= y + height && clientX > x + width;\n case \"bottom\":\n return clientX >= x && clientX <= x + width && clientY > y + height;\n default:\n return false;\n }\n };\n\n const fadeOutIfNotWithinTrigger = (event: MouseEvent) => {\n if (!reference.current) return;\n\n const { clientX, clientY } = event;\n const { x, y, width, height } = reference.current.getBoundingClientRect();\n const withinBounds =\n clientX >= x &&\n clientX <= x + width &&\n clientY >= y &&\n clientY <= y + height;\n\n if (!withinBounds) {\n initiateFadeOut();\n }\n };\n\n return (\n <div {...rest} className={`inline-flex ml-8 ${rest?.className ?? \"\"}`}>\n <button\n onMouseEnter={() => setOpen(true)}\n onMouseLeave={(event) => {\n if (!interactive || !cursorTowardsTooltip(event, reference)) {\n initiateFadeOut();\n }\n }}\n type=\"button\"\n ref={reference}\n aria-describedby=\"tooltip\"\n {...triggerProps}\n className={`p-0 relative focus:outline-none h-[1rem] ${\n triggerProps?.className ?? \"\"\n }`}\n >\n {triggerElement ?? (\n <Icon\n name=\"icon-gui-information-circle-micro\"\n color=\"text-neutral-800 dark:text-neutral-500\"\n size=\"1rem\"\n />\n )}\n </button>\n\n {open\n ? createPortal(\n <div\n role=\"tooltip\"\n ref={floating}\n onMouseLeave={(event) =>\n setTimeout(() => fadeOutIfNotWithinTrigger(event), 250)\n }\n style={{\n top: position.y,\n left: position.x,\n zIndex: 1000,\n boxShadow: \"4px 4px 15px rgba(0, 0, 0, 0.2)\",\n }}\n {...tooltipProps}\n className={`bg-neutral-1000 dark:bg-neutral-300 text-neutral-200 dark:text-neutral-1000 ui-text-p3 font-medium p-16 ${interactive ? \"\" : \"pointer-events-none\"} rounded-lg absolute ${\n tooltipProps?.className ?? \"\"\n } ${fadeOut ? \"animate-[tooltipExit_0.25s_ease-in-out]\" : \"animate-[tooltipEntry_0.25s_ease-in-out]\"}`}\n >\n <div className=\"max-w-[240px] w-auto\">{children}</div>\n </div>,\n document.body,\n )\n : null}\n </div>\n );\n};\n\nexport default Tooltip;\n"],"names":["React","useRef","useState","useEffect","createPortal","Icon","Tooltip","children","triggerElement","triggerProps","tooltipProps","interactive","rest","open","setOpen","fadeOut","setFadeOut","position","setPosition","x","y","orientation","offset","reference","floating","fadeOutTimeoutRef","floatingRect","current","getBoundingClientRect","referenceRect","viewportWidth","window","innerWidth","viewportHeight","innerHeight","left","width","scrollX","top","height","scrollY","bottom","clearTimeout","initiateFadeOut","setTimeout","cursorTowardsTooltip","event","ref","clientX","clientY","fadeOutIfNotWithinTrigger","withinBounds","div","className","button","onMouseEnter","onMouseLeave","type","aria-describedby","name","color","size","role","style","zIndex","boxShadow","document","body"],"mappings":"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"}
package/core/css.js CHANGED
@@ -1 +1,2 @@
1
- export const remsToPixelValue=remString=>parseFloat(remString)*parseFloat(getComputedStyle(document.documentElement).fontSize);
1
+ export const remsToPixelValue=remString=>parseFloat(remString)*parseFloat(getComputedStyle(document.documentElement).fontSize);
2
+ //# sourceMappingURL=css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/css.js"],"sourcesContent":["export const remsToPixelValue = (remString) =>\n parseFloat(remString) *\n parseFloat(getComputedStyle(document.documentElement).fontSize);\n"],"names":["remsToPixelValue","remString","parseFloat","getComputedStyle","document","documentElement","fontSize"],"mappings":"AAAA,OAAO,MAAMA,iBAAmB,AAACC,WAC/BC,WAAWD,WACXC,WAAWC,iBAAiBC,SAASC,eAAe,EAAEC,QAAQ,CAAE"}
package/core/dom-query.js CHANGED
@@ -1 +1,2 @@
1
- export const queryId=(val,root=document)=>root.querySelector(`[data-id=${val}]`);export const queryIdAll=(val,root=document)=>root.querySelectorAll(`[data-id=${val}]`);
1
+ export const queryId=(val,root=document)=>root.querySelector(`[data-id=${val}]`);export const queryIdAll=(val,root=document)=>root.querySelectorAll(`[data-id=${val}]`);
2
+ //# sourceMappingURL=dom-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/dom-query.js"],"sourcesContent":["export const queryId = (val, root = document) =>\n root.querySelector(`[data-id=${val}]`);\n\nexport const queryIdAll = (val, root = document) =>\n root.querySelectorAll(`[data-id=${val}]`);\n"],"names":["queryId","val","root","document","querySelector","queryIdAll","querySelectorAll"],"mappings":"AAAA,OAAO,MAAMA,QAAU,CAACC,IAAKC,KAAOC,QAAQ,GAC1CD,KAAKE,aAAa,CAAC,CAAC,SAAS,EAAEH,IAAI,CAAC,CAAC,CAAE,AAEzC,QAAO,MAAMI,WAAa,CAACJ,IAAKC,KAAOC,QAAQ,GAC7CD,KAAKI,gBAAgB,CAAC,CAAC,SAAS,EAAEL,IAAI,CAAC,CAAC,CAAE"}
@@ -1 +1,2 @@
1
- import{queryId}from"./dom-query";function enableBtn(el,text){el.disabled=false;el.innerText=text}function disableBtn(el,text){el.disabled=true;el.innerText=text}const WAIT_BETWEEN_RETRIES_MS=100;let MAX_RETRY_COUNT=30;export default function toggleChatWidget(params){const{dataId}=params??{};const container=queryId(dataId);const chatButton=queryId("open-chat-widget",container);const textEnabled=chatButton.dataset.enabledLabel;const textDisabled=chatButton.dataset.disabledLabel;if(!dataId||!container)return;const trigger=queryId("open-chat-widget",container);let clickHandler;const waitForScript=delay=>{const widget=window?.HubSpotConversations?.widget;const iframe=document.querySelector("#hubspot-messages-iframe-container");clickHandler=e=>{e.preventDefault();widget.open()};if(widget&&iframe){trigger.addEventListener("click",clickHandler);enableBtn(trigger,textEnabled)}else if(--MAX_RETRY_COUNT){setTimeout(()=>waitForScript(WAIT_BETWEEN_RETRIES_MS),delay)}};disableBtn(trigger,textDisabled);waitForScript(0);return()=>{disableBtn(trigger,textDisabled);trigger.removeEventListener("click",clickHandler)}}
1
+ import{queryId}from"./dom-query";function enableBtn(el,text){el.disabled=false;el.innerText=text}function disableBtn(el,text){el.disabled=true;el.innerText=text}const WAIT_BETWEEN_RETRIES_MS=100;let MAX_RETRY_COUNT=30;export default function toggleChatWidget(params){const{dataId}=params??{};const container=queryId(dataId);const chatButton=queryId("open-chat-widget",container);const textEnabled=chatButton.dataset.enabledLabel;const textDisabled=chatButton.dataset.disabledLabel;if(!dataId||!container)return;const trigger=queryId("open-chat-widget",container);let clickHandler;const waitForScript=delay=>{const widget=window?.HubSpotConversations?.widget;const iframe=document.querySelector("#hubspot-messages-iframe-container");clickHandler=e=>{e.preventDefault();widget.open()};if(widget&&iframe){trigger.addEventListener("click",clickHandler);enableBtn(trigger,textEnabled)}else if(--MAX_RETRY_COUNT){setTimeout(()=>waitForScript(WAIT_BETWEEN_RETRIES_MS),delay)}};disableBtn(trigger,textDisabled);waitForScript(0);return()=>{disableBtn(trigger,textDisabled);trigger.removeEventListener("click",clickHandler)}}
2
+ //# sourceMappingURL=hubspot-chat-toggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/hubspot-chat-toggle.js"],"sourcesContent":["import { queryId } from \"./dom-query\";\n\n/*\n A method to enable/disable a CTA that\n is used to open the HubSpot chat widget\n\n If the Chat widget is unavailable this script\n will apply a disabled property and change\n the text on the button, to warn the user.\n\n Params:\n - dataId the parent container data-id\n\n*/\n\nfunction enableBtn(el, text) {\n el.disabled = false;\n el.innerText = text;\n}\n\nfunction disableBtn(el, text) {\n el.disabled = true;\n el.innerText = text;\n}\n\nconst WAIT_BETWEEN_RETRIES_MS = 100;\nlet MAX_RETRY_COUNT = 30;\n\nexport default function toggleChatWidget(params) {\n const { dataId } = params ?? {};\n const container = queryId(dataId);\n const chatButton = queryId(\"open-chat-widget\", container);\n const textEnabled = chatButton.dataset.enabledLabel;\n const textDisabled = chatButton.dataset.disabledLabel;\n\n if (!dataId || !container) return;\n const trigger = queryId(\"open-chat-widget\", container);\n\n let clickHandler;\n\n const waitForScript = (delay) => {\n const widget = window?.HubSpotConversations?.widget;\n\n // If the chat is set to be hidden out of hours this will return null\n const iframe = document.querySelector(\"#hubspot-messages-iframe-container\");\n\n clickHandler = (e) => {\n e.preventDefault();\n widget.open();\n };\n\n if (widget && iframe) {\n trigger.addEventListener(\"click\", clickHandler);\n enableBtn(trigger, textEnabled);\n } else if (--MAX_RETRY_COUNT) {\n setTimeout(() => waitForScript(WAIT_BETWEEN_RETRIES_MS), delay);\n }\n };\n\n disableBtn(trigger, textDisabled);\n waitForScript(0);\n\n return () => {\n disableBtn(trigger, textDisabled);\n trigger.removeEventListener(\"click\", clickHandler);\n };\n}\n"],"names":["queryId","enableBtn","el","text","disabled","innerText","disableBtn","WAIT_BETWEEN_RETRIES_MS","MAX_RETRY_COUNT","toggleChatWidget","params","dataId","container","chatButton","textEnabled","dataset","enabledLabel","textDisabled","disabledLabel","trigger","clickHandler","waitForScript","delay","widget","window","HubSpotConversations","iframe","document","querySelector","e","preventDefault","open","addEventListener","setTimeout","removeEventListener"],"mappings":"AAAA,OAASA,OAAO,KAAQ,aAAc,CAetC,SAASC,UAAUC,EAAE,CAAEC,IAAI,EACzBD,GAAGE,QAAQ,CAAG,KACdF,CAAAA,GAAGG,SAAS,CAAGF,IACjB,CAEA,SAASG,WAAWJ,EAAE,CAAEC,IAAI,EAC1BD,GAAGE,QAAQ,CAAG,IACdF,CAAAA,GAAGG,SAAS,CAAGF,IACjB,CAEA,MAAMI,wBAA0B,IAChC,IAAIC,gBAAkB,EAEtB,gBAAe,SAASC,iBAAiBC,MAAM,EAC7C,KAAM,CAAEC,MAAM,CAAE,CAAGD,QAAU,CAAC,EAC9B,MAAME,UAAYZ,QAAQW,QAC1B,MAAME,WAAab,QAAQ,mBAAoBY,WAC/C,MAAME,YAAcD,WAAWE,OAAO,CAACC,YAAY,CACnD,MAAMC,aAAeJ,WAAWE,OAAO,CAACG,aAAa,CAErD,GAAI,CAACP,QAAU,CAACC,UAAW,OAC3B,MAAMO,QAAUnB,QAAQ,mBAAoBY,WAE5C,IAAIQ,aAEJ,MAAMC,cAAgB,AAACC,QACrB,MAAMC,OAASC,QAAQC,sBAAsBF,OAG7C,MAAMG,OAASC,SAASC,aAAa,CAAC,sCAEtCR,aAAe,AAACS,IACdA,EAAEC,cAAc,GAChBP,OAAOQ,IAAI,EACb,EAEA,GAAIR,QAAUG,OAAQ,CACpBP,QAAQa,gBAAgB,CAAC,QAASZ,cAClCnB,UAAUkB,QAASL,YACrB,MAAO,GAAI,EAAEN,gBAAiB,CAC5ByB,WAAW,IAAMZ,cAAcd,yBAA0Be,MAC3D,CACF,EAEAhB,WAAWa,QAASF,cACpBI,cAAc,GAEd,MAAO,KACLf,WAAWa,QAASF,cACpBE,QAAQe,mBAAmB,CAAC,QAASd,aACvC,CACF"}
package/core/icons.js CHANGED
@@ -1 +1,2 @@
1
- import{loadSprites}from"./scripts";import sprites from"../../core/sprites.svg";const loadIcons=()=>loadSprites(sprites);export default loadIcons;
1
+ import{loadSprites}from"./scripts";import sprites from"../../core/sprites.svg";const loadIcons=()=>loadSprites(sprites);export default loadIcons;
2
+ //# sourceMappingURL=icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/icons.js"],"sourcesContent":["import { loadSprites } from \"./scripts\";\nimport sprites from \"../../core/sprites.svg\";\n\nconst loadIcons = () => loadSprites(sprites);\n\nexport default loadIcons;\n"],"names":["loadSprites","sprites","loadIcons"],"mappings":"AAAA,OAASA,WAAW,KAAQ,WAAY,AACxC,QAAOC,YAAa,wBAAyB,CAE7C,MAAMC,UAAY,IAAMF,YAAYC,QAEpC,gBAAeC,SAAU"}
@@ -0,0 +1,2 @@
1
+ import*as mixpanel from"./mixpanel";import*as posthog from"./posthog";let debugMode=false;export const initInsights=({mixpanelToken,mixpanelAutoCapture,posthogApiKey,posthogApiHost,debug=false})=>{debugMode=!!debug;try{mixpanel.initMixpanel(mixpanelToken,mixpanelAutoCapture,debugMode)}catch(e){if(debugMode){console.error("Failed to initialize Mixpanel",e)}}try{posthog.initPosthog(posthogApiKey,posthogApiHost)}catch(e){if(debugMode){console.error("Failed to initialize Posthog",e)}}};export const enableDebugMode=()=>{debugMode=true;try{mixpanel.enableDebugMode();posthog.enableDebugMode()}catch(e){console.error("Failed to enable debug mode",e)}};export const disableDebugMode=()=>{debugMode=false;try{mixpanel.disableDebugMode();posthog.disableDebugMode()}catch(e){console.error("Failed to disable debug mode",e)}};export const identify=({userId,accountId,organisationId,email,name})=>{try{mixpanel.identify(userId,accountId,organisationId,email,name)}catch(e){if(debugMode){console.error("Failed to identify user in Mixpanel",e)}}try{posthog.identify(userId,accountId,organisationId,email,name)}catch(e){if(debugMode){console.error("Failed to identify user in Posthog",e)}}};export const trackPageView=()=>{try{mixpanel.trackPageView()}catch(e){if(debugMode){console.error("Failed to track page view in Mixpanel",e)}}try{posthog.trackPageView()}catch(e){if(debugMode){console.error("Failed to track page view in Posthog",e)}}};export const track=(event,properties)=>{try{mixpanel.track(event,properties)}catch(e){if(debugMode){console.error("Failed to track event in Mixpanel",e)}}try{posthog.track(event,properties)}catch(e){if(debugMode){console.error("Failed to track event in Posthog",e)}}};export const setupObserver=()=>{const getInsightAttributes=element=>{const MAX_ATTRIBUTES=10;let count=0;const attributes={};for(const attr of element.attributes){if(count>=MAX_ATTRIBUTES)break;if(attr.name.startsWith("data-insight-")){if(!/^data-insight-[a-zA-Z0-9-]+$/.test(attr.name))continue;if(typeof attr.value!=="string"||attr.value.length>100)continue;const key=attr.name.replace("data-insight-","").split("-").map((part,index)=>index===0?part:part.charAt(0).toUpperCase()+part.slice(1)).join("");attributes[key]=attr.value;count++}}return attributes};const findClosestElementWithInsights=element=>{let current=element;while(current&&current!==document.body){const insights=getInsightAttributes(current);if(Object.keys(insights).length>0){return insights}current=current.parentElement}return null};const handleClick=event=>{if(!(event.target instanceof HTMLElement))return;const insights=findClosestElementWithInsights(event.target);if(insights){const{event:eventName,...properties}=insights;track(eventName||"element_clicked",properties)}};document.body.addEventListener("click",handleClick);return()=>{document.body.removeEventListener("click",handleClick)}};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/insights/index.ts"],"sourcesContent":["import * as mixpanel from './mixpanel';\nimport * as posthog from './posthog';\n\nexport type InsightsConfig = {\n debug: boolean;\n mixpanelToken: string;\n mixpanelAutoCapture: boolean;\n posthogApiKey: string;\n posthogApiHost: string;\n};\n\nlet debugMode = false;\n\nexport const initInsights = ({mixpanelToken, mixpanelAutoCapture, posthogApiKey, posthogApiHost, debug = false}: InsightsConfig) => {\n debugMode = !!debug;\n\n try {\n mixpanel.initMixpanel(mixpanelToken, mixpanelAutoCapture, debugMode);\n } catch (e) {\n if (debugMode) {\n console.error('Failed to initialize Mixpanel', e);\n }\n }\n\n try {\n posthog.initPosthog(posthogApiKey, posthogApiHost);\n } catch (e) {\n if (debugMode) {\n console.error('Failed to initialize Posthog', e);\n }\n }\n};\n\nexport const enableDebugMode = () => {\n debugMode = true;\n try {\n mixpanel.enableDebugMode();\n posthog.enableDebugMode();\n } catch (e) {\n console.error('Failed to enable debug mode', e);\n }\n};\n\nexport const disableDebugMode = () => {\n debugMode = false;\n try {\n mixpanel.disableDebugMode();\n posthog.disableDebugMode();\n } catch (e) {\n console.error('Failed to disable debug mode', e);\n }\n};\n\nexport const identify = ({userId, accountId, organisationId, email, name}: {userId: string, accountId: string, organisationId?: string, email?: string, name?: string}) => {\n try {\n mixpanel.identify(userId, accountId, organisationId, email, name);\n } catch (e) {\n if (debugMode) {\n console.error('Failed to identify user in Mixpanel', e);\n }\n }\n\n try {\n posthog.identify(userId, accountId, organisationId, email, name);\n } catch (e) {\n if (debugMode) {\n console.error('Failed to identify user in Posthog', e);\n }\n }\n};\n\nexport const trackPageView = () => {\n try {\n mixpanel.trackPageView();\n } catch (e) {\n if (debugMode) {\n console.error('Failed to track page view in Mixpanel', e);\n }\n }\n\n try {\n posthog.trackPageView();\n } catch (e) {\n if (debugMode) {\n console.error('Failed to track page view in Posthog', e);\n }\n }\n};\n\nexport const track = (event: string, properties?: Record<string, unknown>) => {\n try {\n mixpanel.track(event, properties);\n } catch (e) {\n if (debugMode) {\n console.error('Failed to track event in Mixpanel', e);\n }\n }\n\n try {\n posthog.track(event, properties);\n } catch (e) {\n if (debugMode) {\n console.error('Failed to track event in Posthog', e);\n }\n }\n};\n\ntype InsightAttributes = {\n event?: string;\n [key: string]: string | undefined;\n};\n\nexport const setupObserver = () => {\n // Helper to get all data-insight-* attributes from an element\n const getInsightAttributes = (element): InsightAttributes => {\n // limit how many data attributes we'll process\n const MAX_ATTRIBUTES = 10;\n let count = 0;\n\n const attributes: InsightAttributes = {};\n\n for (const attr of element.attributes) {\n if (count >= MAX_ATTRIBUTES) break;\n if (attr.name.startsWith('data-insight-')) {\n // Validate attribute name format\n if (!/^data-insight-[a-zA-Z0-9-]+$/.test(attr.name)) continue;\n\n // Sanitize attribute value\n if (typeof attr.value !== 'string' || attr.value.length > 100) continue;\n\n // Convert data-insight-event-name to eventName\n const key = attr.name\n .replace('data-insight-', '')\n .split('-')\n .map((part, index) =>\n index === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1)\n )\n .join('');\n attributes[key] = attr.value;\n count++;\n }\n }\n return attributes;\n };\n\n // Helper to find closest element with data-insight attributes\n const findClosestElementWithInsights = (element) => {\n let current = element;\n while (current && current !== document.body) {\n const insights = getInsightAttributes(current);\n if (Object.keys(insights).length > 0) {\n return insights;\n }\n current = current.parentElement;\n }\n return null;\n };\n\n // Global click handler\n const handleClick = (event: MouseEvent): void => {\n if (!(event.target instanceof HTMLElement)) return;\n const insights = findClosestElementWithInsights(event.target);\n if (insights) {\n // Extract special properties if they exist\n const { event: eventName, ...properties } = insights;\n track(eventName || 'element_clicked', properties);\n }\n };\n\n // Add listener to document body to catch all clicks\n document.body.addEventListener('click', handleClick);\n\n // Return cleanup function in case it's needed\n return () => {\n document.body.removeEventListener('click', handleClick);\n };\n};\n"],"names":["mixpanel","posthog","debugMode","initInsights","mixpanelToken","mixpanelAutoCapture","posthogApiKey","posthogApiHost","debug","initMixpanel","e","console","error","initPosthog","enableDebugMode","disableDebugMode","identify","userId","accountId","organisationId","email","name","trackPageView","track","event","properties","setupObserver","getInsightAttributes","element","MAX_ATTRIBUTES","count","attributes","attr","startsWith","test","value","length","key","replace","split","map","part","index","charAt","toUpperCase","slice","join","findClosestElementWithInsights","current","document","body","insights","Object","keys","parentElement","handleClick","target","HTMLElement","eventName","addEventListener","removeEventListener"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import mixpanel from"mixpanel-browser";export const initMixpanel=(token,autoCapture=false,debug=false)=>{const blockSelectors=["[ph-no-capture]",'[data-sl="mask"]'];if(!token){console.warn("Mixpanel token not provided, skipping initialization");return}mixpanel.init(token,{debug:debug,persistence:"localStorage",autocapture:autoCapture?{block_selectors:blockSelectors}:false,track_pageview:false})};export const enableDebugMode=()=>{mixpanel.set_config({debug:true})};export const disableDebugMode=()=>{mixpanel.set_config({debug:false})};export const identify=(userId,accountId,organisationId,email,name)=>{mixpanel.identify(userId);mixpanel.people.set({$email:email,$name:name});mixpanel.people.union({account_id:[accountId]});if(organisationId){mixpanel.people.set({organisation_id:[organisationId]})}};export const trackPageView=()=>{mixpanel.track_pageview()};export const track=(event,properties)=>{mixpanel.track(event,properties)};
2
+ //# sourceMappingURL=mixpanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/insights/mixpanel.ts"],"sourcesContent":["import mixpanel from \"mixpanel-browser\";\n\nexport const initMixpanel = (\n token: string,\n autoCapture: boolean = false,\n debug: boolean = false,\n) => {\n const blockSelectors = [\"[ph-no-capture]\", '[data-sl=\"mask\"]'];\n if (!token) {\n console.warn(\"Mixpanel token not provided, skipping initialization\");\n return;\n }\n\n mixpanel.init(token, {\n debug: debug,\n persistence: \"localStorage\",\n autocapture: autoCapture\n ? {\n block_selectors: blockSelectors,\n }\n : false,\n track_pageview: false, // We'll track page views manually\n });\n};\n\nexport const enableDebugMode = () => {\n mixpanel.set_config({ debug: true });\n};\n\nexport const disableDebugMode = () => {\n mixpanel.set_config({ debug: false });\n};\n\nexport const identify = (\n userId: string,\n accountId: string,\n organisationId?: string,\n email?: string,\n name?: string,\n) => {\n mixpanel.identify(userId);\n mixpanel.people.set({ $email: email, $name: name });\n\n mixpanel.people.union({ account_id: [accountId] });\n\n if (organisationId) {\n mixpanel.people.set({ organisation_id: [organisationId] });\n }\n};\n\nexport const trackPageView = () => {\n mixpanel.track_pageview();\n};\n\nexport const track = (event: string, properties?: Record<string, unknown>) => {\n mixpanel.track(event, properties);\n};\n"],"names":["mixpanel","initMixpanel","token","autoCapture","debug","blockSelectors","console","warn","init","persistence","autocapture","block_selectors","track_pageview","enableDebugMode","set_config","disableDebugMode","identify","userId","accountId","organisationId","email","name","people","set","$email","$name","union","account_id","organisation_id","trackPageView","track","event","properties"],"mappings":"AAAA,OAAOA,aAAc,kBAAmB,AAExC,QAAO,MAAMC,aAAe,CAC1BC,MACAC,YAAuB,KAAK,CAC5BC,MAAiB,KAAK,IAEtB,MAAMC,eAAiB,CAAC,kBAAmB,mBAAmB,CAC9D,GAAI,CAACH,MAAO,CACVI,QAAQC,IAAI,CAAC,wDACb,MACF,CAEAP,SAASQ,IAAI,CAACN,MAAO,CACnBE,MAAOA,MACPK,YAAa,eACbC,YAAaP,YACT,CACEQ,gBAAiBN,cACnB,EACA,MACJO,eAAgB,KAClB,EACF,CAAE,AAEF,QAAO,MAAMC,gBAAkB,KAC7Bb,SAASc,UAAU,CAAC,CAAEV,MAAO,IAAK,EACpC,CAAE,AAEF,QAAO,MAAMW,iBAAmB,KAC9Bf,SAASc,UAAU,CAAC,CAAEV,MAAO,KAAM,EACrC,CAAE,AAEF,QAAO,MAAMY,SAAW,CACtBC,OACAC,UACAC,eACAC,MACAC,QAEArB,SAASgB,QAAQ,CAACC,QAClBjB,SAASsB,MAAM,CAACC,GAAG,CAAC,CAAEC,OAAQJ,MAAOK,MAAOJ,IAAK,GAEjDrB,SAASsB,MAAM,CAACI,KAAK,CAAC,CAAEC,WAAY,CAACT,UAAU,AAAC,GAEhD,GAAIC,eAAgB,CAClBnB,SAASsB,MAAM,CAACC,GAAG,CAAC,CAAEK,gBAAiB,CAACT,eAAe,AAAC,EAC1D,CACF,CAAE,AAEF,QAAO,MAAMU,cAAgB,KAC3B7B,SAASY,cAAc,EACzB,CAAE,AAEF,QAAO,MAAMkB,MAAQ,CAACC,MAAeC,cACnChC,SAAS8B,KAAK,CAACC,MAAOC,WACxB,CAAE"}
@@ -0,0 +1,2 @@
1
+ import posthog from"posthog-js";export const initPosthog=(apiKey,apiHost)=>{posthog.init(apiKey,{api_host:apiHost,capture_pageview:false})};export const enableDebugMode=()=>{posthog.debug()};export const disableDebugMode=()=>{posthog.debug(false)};export const identify=(userId,accountId,organisationId,email,name)=>{if(userId!==posthog.get_distinct_id()){posthog.identify(userId,{email,name})}posthog.group("account",accountId);if(organisationId){posthog.group("organisation",organisationId)}};export const trackPageView=()=>{posthog.capture("$pageview")};export const track=(event,properties)=>{posthog.capture(event,properties)};
2
+ //# sourceMappingURL=posthog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/insights/posthog.ts"],"sourcesContent":["import posthog from \"posthog-js\";\n\nexport const initPosthog = (apiKey: string, apiHost: string) => {\n posthog.init(apiKey, {\n api_host: apiHost,\n capture_pageview: false,\n });\n};\n\nexport const enableDebugMode = () => {\n posthog.debug();\n};\n\nexport const disableDebugMode = () => {\n posthog.debug(false);\n};\n\nexport const identify = (\n userId: string,\n accountId: string,\n organisationId?: string,\n email?: string,\n name?: string,\n) => {\n if (userId !== posthog.get_distinct_id()) {\n posthog.identify(userId, { email, name });\n }\n\n // Associate all events in this session with this account\n posthog.group(\"account\", accountId);\n\n // Associate all events in this session with this organisation (if available)\n if (organisationId) {\n posthog.group(\"organisation\", organisationId);\n }\n};\n\nexport const trackPageView = () => {\n posthog.capture(\"$pageview\");\n};\n\nexport const track = (event: string, properties?: Record<string, unknown>) => {\n posthog.capture(event, properties);\n};\n"],"names":["posthog","initPosthog","apiKey","apiHost","init","api_host","capture_pageview","enableDebugMode","debug","disableDebugMode","identify","userId","accountId","organisationId","email","name","get_distinct_id","group","trackPageView","capture","track","event","properties"],"mappings":"AAAA,OAAOA,YAAa,YAAa,AAEjC,QAAO,MAAMC,YAAc,CAACC,OAAgBC,WAC1CH,QAAQI,IAAI,CAACF,OAAQ,CACnBG,SAAUF,QACVG,iBAAkB,KACpB,EACF,CAAE,AAEF,QAAO,MAAMC,gBAAkB,KAC7BP,QAAQQ,KAAK,EACf,CAAE,AAEF,QAAO,MAAMC,iBAAmB,KAC9BT,QAAQQ,KAAK,CAAC,MAChB,CAAE,AAEF,QAAO,MAAME,SAAW,CACtBC,OACAC,UACAC,eACAC,MACAC,QAEA,GAAIJ,SAAWX,QAAQgB,eAAe,GAAI,CACxChB,QAAQU,QAAQ,CAACC,OAAQ,CAAEG,MAAOC,IAAK,EACzC,CAGAf,QAAQiB,KAAK,CAAC,UAAWL,WAGzB,GAAIC,eAAgB,CAClBb,QAAQiB,KAAK,CAAC,eAAgBJ,eAChC,CACF,CAAE,AAEF,QAAO,MAAMK,cAAgB,KAC3BlB,QAAQmB,OAAO,CAAC,YAClB,CAAE,AAEF,QAAO,MAAMC,MAAQ,CAACC,MAAeC,cACnCtB,QAAQmB,OAAO,CAACE,MAAOC,WACzB,CAAE"}
@@ -1 +1,2 @@
1
- export default(spritesUrl=>{if(document.querySelector(".ably-sprites"))return;fetch(spritesUrl).then(response=>response.text()).then(image=>{const container=document.createElement("div");container.className="ably-sprites";container.style.opacity=0;container.style.position="absolute";container.style.width="0";container.style.height="0";container.innerHTML=image;document.body.appendChild(container)}).catch(err=>console.error(err))});
1
+ export default(spritesUrl=>{if(document.querySelector(".ably-sprites"))return;fetch(spritesUrl).then(response=>response.text()).then(image=>{const container=document.createElement("div");container.className="ably-sprites";container.style.opacity=0;container.style.position="absolute";container.style.width="0";container.style.height="0";container.innerHTML=image;document.body.appendChild(container)}).catch(err=>console.error(err))});
2
+ //# sourceMappingURL=load-sprites.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/load-sprites.js"],"sourcesContent":["export default (spritesUrl) => {\n if (document.querySelector(\".ably-sprites\")) return;\n\n fetch(spritesUrl)\n .then((response) => response.text())\n .then((image) => {\n const container = document.createElement(\"div\");\n container.className = \"ably-sprites\";\n container.style.opacity = 0;\n container.style.position = \"absolute\";\n container.style.width = \"0\";\n container.style.height = \"0\";\n container.innerHTML = image;\n document.body.appendChild(container);\n })\n .catch((err) => console.error(err));\n};\n"],"names":["spritesUrl","document","querySelector","fetch","then","response","text","image","container","createElement","className","style","opacity","position","width","height","innerHTML","body","appendChild","catch","err","console","error"],"mappings":"AAAA,cAAe,CAAA,AAACA,aACd,GAAIC,SAASC,aAAa,CAAC,iBAAkB,OAE7CC,MAAMH,YACHI,IAAI,CAAC,AAACC,UAAaA,SAASC,IAAI,IAChCF,IAAI,CAAC,AAACG,QACL,MAAMC,UAAYP,SAASQ,aAAa,CAAC,MACzCD,CAAAA,UAAUE,SAAS,CAAG,cACtBF,CAAAA,UAAUG,KAAK,CAACC,OAAO,CAAG,CAC1BJ,CAAAA,UAAUG,KAAK,CAACE,QAAQ,CAAG,UAC3BL,CAAAA,UAAUG,KAAK,CAACG,KAAK,CAAG,GACxBN,CAAAA,UAAUG,KAAK,CAACI,MAAM,CAAG,GACzBP,CAAAA,UAAUQ,SAAS,CAAGT,MACtBN,SAASgB,IAAI,CAACC,WAAW,CAACV,UAC5B,GACCW,KAAK,CAAC,AAACC,KAAQC,QAAQC,KAAK,CAACF,KAClC,CAAA,CAAE"}
@@ -1 +1,2 @@
1
- import React from"react";import{createRoot}from"react-dom/client";const renderComponent=(Component,props,node)=>{const root=createRoot(node);root.render(React.createElement(Component,props))};export{renderComponent};export default function reactRenderer(components){const reactComponents=document.querySelectorAll("[data-react]");Array.from(reactComponents).forEach(node=>{const className=node.getAttribute("data-react")??"";const Constructor=components[className];if(!Constructor)return;const propsJson=node.getAttribute("data-react-props");const props=propsJson&&JSON.parse(propsJson||"");const root=createRoot(node);root.render(React.createElement(Constructor,props));node.removeAttribute("data-react");node.removeAttribute("data-react-props")})}
1
+ import React from"react";import{createRoot}from"react-dom/client";const renderComponent=(Component,props,node)=>{const root=createRoot(node);root.render(React.createElement(Component,props))};export{renderComponent};export default function reactRenderer(components){const reactComponents=document.querySelectorAll("[data-react]");Array.from(reactComponents).forEach(node=>{const className=node.getAttribute("data-react")??"";const Constructor=components[className];if(!Constructor)return;const propsJson=node.getAttribute("data-react-props");const props=propsJson&&JSON.parse(propsJson||"");const root=createRoot(node);root.render(React.createElement(Constructor,props));node.removeAttribute("data-react");node.removeAttribute("data-react-props")})}
2
+ //# sourceMappingURL=react-renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/react-renderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { createRoot } from \"react-dom/client\";\n\nconst renderComponent = (Component, props, node) => {\n const root = createRoot(node);\n root.render(<Component {...props} />);\n};\n\nexport { renderComponent };\n\nexport default function reactRenderer(components) {\n const reactComponents = document.querySelectorAll(\"[data-react]\");\n\n Array.from(reactComponents).forEach((node) => {\n const className = node.getAttribute(\"data-react\") ?? \"\";\n const Constructor = components[className];\n\n if (!Constructor) return;\n\n const propsJson = node.getAttribute(\"data-react-props\");\n const props = propsJson && JSON.parse(propsJson || \"\");\n\n const root = createRoot(node);\n root.render(<Constructor {...props} />);\n\n node.removeAttribute(\"data-react\");\n node.removeAttribute(\"data-react-props\");\n });\n}\n"],"names":["React","createRoot","renderComponent","Component","props","node","root","render","reactRenderer","components","reactComponents","document","querySelectorAll","Array","from","forEach","className","getAttribute","Constructor","propsJson","JSON","parse","removeAttribute"],"mappings":"AAAA,OAAOA,UAAW,OAAQ,AAC1B,QAASC,UAAU,KAAQ,kBAAmB,CAE9C,MAAMC,gBAAkB,CAACC,UAAWC,MAAOC,QACzC,MAAMC,KAAOL,WAAWI,MACxBC,KAAKC,MAAM,CAAC,oBAACJ,UAAcC,OAC7B,CAEA,QAASF,eAAe,CAAG,AAE3B,gBAAe,SAASM,cAAcC,UAAU,EAC9C,MAAMC,gBAAkBC,SAASC,gBAAgB,CAAC,gBAElDC,MAAMC,IAAI,CAACJ,iBAAiBK,OAAO,CAAC,AAACV,OACnC,MAAMW,UAAYX,KAAKY,YAAY,CAAC,eAAiB,GACrD,MAAMC,YAAcT,UAAU,CAACO,UAAU,CAEzC,GAAI,CAACE,YAAa,OAElB,MAAMC,UAAYd,KAAKY,YAAY,CAAC,oBACpC,MAAMb,MAAQe,WAAaC,KAAKC,KAAK,CAACF,WAAa,IAEnD,MAAMb,KAAOL,WAAWI,MACxBC,KAAKC,MAAM,CAAC,oBAACW,YAAgBd,QAE7BC,KAAKiB,eAAe,CAAC,cACrBjB,KAAKiB,eAAe,CAAC,mBACvB,EACF"}
@@ -1 +1,2 @@
1
- import{isJsonResponse}from"./remote-data-util";const fetchBlogPosts=async(store,blogUrl)=>{try{if(!blogUrl){console.log(`Skipping fetching blog posts, invalid blogUrl: "${blogUrl}"`);return}const res=await fetch(blogUrl);if(isJsonResponse(res.headers.get("content-type"))){const payload=await res.json();store.dispatch({type:"blog/loaded",payload})}else{throw new Error("Blog posts url is not serving json")}}catch(e){console.warn("Could not fetch blog posts due to error:",e)}};const initialState={recent:null};const REDUCER_KEY="blogPosts";const reducerBlogPosts={[REDUCER_KEY]:(state=initialState,action)=>{switch(action.type){case"blog/loaded":return{...state,recent:action.payload};default:return state}}};const selectRecentBlogPosts=store=>store.getState()[REDUCER_KEY]?.recent;export{fetchBlogPosts,reducerBlogPosts,selectRecentBlogPosts};
1
+ import{isJsonResponse}from"./remote-data-util";const fetchBlogPosts=async(store,blogUrl)=>{try{if(!blogUrl){console.log(`Skipping fetching blog posts, invalid blogUrl: "${blogUrl}"`);return}const options={headers:{accept:"application/json"},cache:"no-cache"};if(true){options.credentials="include"}const res=await fetch(blogUrl,options);if(isJsonResponse(res.headers.get("content-type"))){const payload=await res.json();store.dispatch({type:"blog/loaded",payload})}else{throw new Error("Blog posts url is not serving json")}}catch(e){console.warn("Could not fetch blog posts due to error:",e)}};const initialState={recent:null};const REDUCER_KEY="blogPosts";const reducerBlogPosts={[REDUCER_KEY]:(state=initialState,action)=>{switch(action.type){case"blog/loaded":return{...state,recent:action.payload};default:return state}}};const selectRecentBlogPosts=store=>store.getState()[REDUCER_KEY]?.recent;export{fetchBlogPosts,reducerBlogPosts,selectRecentBlogPosts};
2
+ //# sourceMappingURL=remote-blogs-posts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/remote-blogs-posts.js"],"sourcesContent":["/* global __ENABLE_FETCH_WITH_CREDENTIALS__ */\n\nimport { isJsonResponse } from \"./remote-data-util\";\n\nconst fetchBlogPosts = async (store, blogUrl) => {\n try {\n if (!blogUrl) {\n console.log(\n `Skipping fetching blog posts, invalid blogUrl: \"${blogUrl}\"`,\n );\n return;\n }\n\n const options = {\n headers: {\n accept: \"application/json\",\n },\n cache: \"no-cache\",\n };\n\n if (__ENABLE_FETCH_WITH_CREDENTIALS__) {\n options.credentials = \"include\";\n }\n\n const res = await fetch(blogUrl, options);\n\n if (isJsonResponse(res.headers.get(\"content-type\"))) {\n const payload = await res.json();\n store.dispatch({ type: \"blog/loaded\", payload });\n } else {\n throw new Error(\"Blog posts url is not serving json\");\n }\n } catch (e) {\n console.warn(\"Could not fetch blog posts due to error:\", e);\n }\n};\n\nconst initialState = { recent: null };\n\nconst REDUCER_KEY = \"blogPosts\";\n\nconst reducerBlogPosts = {\n [REDUCER_KEY]: (state = initialState, action) => {\n switch (action.type) {\n case \"blog/loaded\":\n return { ...state, recent: action.payload };\n default:\n return state;\n }\n },\n};\n\nconst selectRecentBlogPosts = (store) => store.getState()[REDUCER_KEY]?.recent;\n\nexport { fetchBlogPosts, reducerBlogPosts, selectRecentBlogPosts };\n"],"names":["isJsonResponse","fetchBlogPosts","store","blogUrl","console","log","options","headers","accept","cache","credentials","res","fetch","get","payload","json","dispatch","type","Error","e","warn","initialState","recent","REDUCER_KEY","reducerBlogPosts","state","action","selectRecentBlogPosts","getState"],"mappings":"AAEA,OAASA,cAAc,KAAQ,oBAAqB,CAEpD,MAAMC,eAAiB,MAAOC,MAAOC,WACnC,GAAI,CACF,GAAI,CAACA,QAAS,CACZC,QAAQC,GAAG,CACT,CAAC,gDAAgD,EAAEF,QAAQ,CAAC,CAAC,EAE/D,MACF,CAEA,MAAMG,QAAU,CACdC,QAAS,CACPC,OAAQ,kBACV,EACAC,MAAO,UACT,EAEA,GApBJ,KAoB2C,CACrCH,QAAQI,WAAW,CAAG,SACxB,CAEA,MAAMC,IAAM,MAAMC,MAAMT,QAASG,SAEjC,GAAIN,eAAeW,IAAIJ,OAAO,CAACM,GAAG,CAAC,iBAAkB,CACnD,MAAMC,QAAU,MAAMH,IAAII,IAAI,GAC9Bb,MAAMc,QAAQ,CAAC,CAAEC,KAAM,cAAeH,OAAQ,EAChD,KAAO,CACL,MAAM,IAAII,MAAM,qCAClB,CACF,CAAE,MAAOC,EAAG,CACVf,QAAQgB,IAAI,CAAC,2CAA4CD,EAC3D,CACF,EAEA,MAAME,aAAe,CAAEC,OAAQ,IAAK,EAEpC,MAAMC,YAAc,YAEpB,MAAMC,iBAAmB,CACvB,CAACD,YAAY,CAAE,CAACE,MAAQJ,YAAY,CAAEK,UACpC,OAAQA,OAAOT,IAAI,EACjB,IAAK,cACH,MAAO,CAAE,GAAGQ,KAAK,CAAEH,OAAQI,OAAOZ,OAAO,AAAC,CAC5C,SACE,OAAOW,KACX,CACF,CACF,EAEA,MAAME,sBAAwB,AAACzB,OAAUA,MAAM0B,QAAQ,EAAE,CAACL,YAAY,EAAED,MAExE,QAASrB,cAAc,CAAEuB,gBAAgB,CAAEG,qBAAqB,CAAG"}
@@ -1 +1,2 @@
1
- import{createStore,combineReducers}from"redux";export const attachStoreToWindow=store=>{window.AblyUi=window.AblyUi||{};window.AblyUi.RemoteDataStore=store};export const getRemoteDataStore=()=>{if(!window.AblyUi.RemoteDataStore){throw new Error("Remote store was called before one was created")}return window.AblyUi.RemoteDataStore};export const connectState=(selector,setState)=>{const store=getRemoteDataStore();let cachedOldState=selector(store);store.subscribe(()=>{const newState=selector(store);if(newState===cachedOldState){return}cachedOldState=newState;setState(newState)})};export const createRemoteDataStore=reducers=>createStore(combineReducers(reducers));
1
+ import{createStore,combineReducers}from"redux";export const attachStoreToWindow=store=>{window.AblyUi=window.AblyUi||{};window.AblyUi.RemoteDataStore=store};export const getRemoteDataStore=()=>{if(!window.AblyUi.RemoteDataStore){throw new Error("Remote store was called before one was created")}return window.AblyUi.RemoteDataStore};export const connectState=(selector,setState)=>{const store=getRemoteDataStore();let cachedOldState=selector(store);store.subscribe(()=>{const newState=selector(store);if(newState===cachedOldState){return}cachedOldState=newState;setState(newState)})};export const createRemoteDataStore=reducers=>createStore(combineReducers(reducers));
2
+ //# sourceMappingURL=remote-data-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/remote-data-store.js"],"sourcesContent":["import { createStore, combineReducers } from \"redux\";\n\nexport const attachStoreToWindow = (store) => {\n window.AblyUi = window.AblyUi || {};\n window.AblyUi.RemoteDataStore = store;\n};\n\nexport const getRemoteDataStore = () => {\n if (!window.AblyUi.RemoteDataStore) {\n throw new Error(\"Remote store was called before one was created\");\n }\n\n return window.AblyUi.RemoteDataStore;\n};\n\nexport const connectState = (selector, setState) => {\n const store = getRemoteDataStore();\n let cachedOldState = selector(store);\n\n store.subscribe(() => {\n const newState = selector(store);\n\n // Do nothing, state is the same\n if (newState === cachedOldState) {\n return;\n }\n\n cachedOldState = newState;\n setState(newState);\n });\n};\n\nexport const createRemoteDataStore = (reducers) =>\n createStore(combineReducers(reducers));\n"],"names":["createStore","combineReducers","attachStoreToWindow","store","window","AblyUi","RemoteDataStore","getRemoteDataStore","Error","connectState","selector","setState","cachedOldState","subscribe","newState","createRemoteDataStore","reducers"],"mappings":"AAAA,OAASA,WAAW,CAAEC,eAAe,KAAQ,OAAQ,AAErD,QAAO,MAAMC,oBAAsB,AAACC,QAClCC,OAAOC,MAAM,CAAGD,OAAOC,MAAM,EAAI,CAAC,CAClCD,CAAAA,OAAOC,MAAM,CAACC,eAAe,CAAGH,KAClC,CAAE,AAEF,QAAO,MAAMI,mBAAqB,KAChC,GAAI,CAACH,OAAOC,MAAM,CAACC,eAAe,CAAE,CAClC,MAAM,IAAIE,MAAM,iDAClB,CAEA,OAAOJ,OAAOC,MAAM,CAACC,eAAe,AACtC,CAAE,AAEF,QAAO,MAAMG,aAAe,CAACC,SAAUC,YACrC,MAAMR,MAAQI,qBACd,IAAIK,eAAiBF,SAASP,OAE9BA,MAAMU,SAAS,CAAC,KACd,MAAMC,SAAWJ,SAASP,OAG1B,GAAIW,WAAaF,eAAgB,CAC/B,MACF,CAEAA,eAAiBE,SACjBH,SAASG,SACX,EACF,CAAE,AAEF,QAAO,MAAMC,sBAAwB,AAACC,UACpChB,YAAYC,gBAAgBe,UAAW"}
@@ -1 +1,2 @@
1
- export const isJsonResponse=contentType=>contentType&&contentType.includes("application/json");
1
+ export const isJsonResponse=contentType=>contentType&&contentType.includes("application/json");
2
+ //# sourceMappingURL=remote-data-util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/remote-data-util.js"],"sourcesContent":["// isJsonResponse is useful for environments where hitting an endpoint\n// would return an html page (eg. Gatsby local dev)\nexport const isJsonResponse = (contentType) =>\n contentType && contentType.includes(\"application/json\");\n"],"names":["isJsonResponse","contentType","includes"],"mappings":"AAEA,OAAO,MAAMA,eAAiB,AAACC,aAC7BA,aAAeA,YAAYC,QAAQ,CAAC,mBAAoB"}
@@ -1 +1,2 @@
1
- import{isJsonResponse}from"./remote-data-util";const NOT_FOUND_ERROR_CODE="not-found";const fetchSessionData=async(store,sessionUrl)=>{const sessionLoaded=(payload={})=>store.dispatch({type:"session/loaded",payload});try{if(!sessionUrl){console.log(`Skipping fetching session, invalid sessionUrl: "${sessionUrl}"`);sessionLoaded();return}const res=await fetch(sessionUrl,{cache:"no-cache"});const jsonResponse=isJsonResponse(res.headers.get("content-type"));if(!jsonResponse){throw new Error("Session endpoint is not serving json")}const payload=await res.json();if(payload.error===NOT_FOUND_ERROR_CODE){sessionLoaded()}else{sessionLoaded(payload)}}catch(e){sessionLoaded();console.warn("Could not fetch session data due to error:",e)}};const initialState={data:null};const REDUCER_KEY="session";const reducerSessionData={[REDUCER_KEY]:(state=initialState,action)=>{switch(action.type){case"session/loaded":return{...state,data:action.payload};default:return state}}};const selectSessionData=store=>store.getState()[REDUCER_KEY]?.data;export{fetchSessionData,reducerSessionData,selectSessionData};
1
+ import{isJsonResponse}from"./remote-data-util";const NOT_FOUND_ERROR_CODE="not-found";const fetchSessionData=async(store,sessionUrl)=>{const sessionLoaded=(payload={})=>store.dispatch({type:"session/loaded",payload});try{if(!sessionUrl){console.log(`Skipping fetching session, invalid sessionUrl: "${sessionUrl}"`);sessionLoaded();return}const options={headers:{accept:"application/json"},cache:"no-cache"};if(true){options.credentials="include"}const res=await fetch(sessionUrl,options);const jsonResponse=isJsonResponse(res.headers.get("content-type"));if(!jsonResponse){throw new Error("Session endpoint is not serving json")}const payload=await res.json();if(payload.error===NOT_FOUND_ERROR_CODE){sessionLoaded()}else{sessionLoaded(payload)}}catch(e){sessionLoaded();console.warn("Could not fetch session data due to error:",e)}};const initialState={data:null};const REDUCER_KEY="session";const reducerSessionData={[REDUCER_KEY]:(state=initialState,action)=>{switch(action.type){case"session/loaded":return{...state,data:action.payload};default:return state}}};const selectSessionData=store=>store.getState()[REDUCER_KEY]?.data;export{fetchSessionData,reducerSessionData,selectSessionData};
2
+ //# sourceMappingURL=remote-session-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/remote-session-data.js"],"sourcesContent":["/* global __ENABLE_FETCH_WITH_CREDENTIALS__ */\n\n// Fetches current users session data\n// Assumes an authenticated session, so will only work when used on ably.com/ably.io\n\nimport { isJsonResponse } from \"./remote-data-util\";\n\nconst NOT_FOUND_ERROR_CODE = \"not-found\";\n\nconst fetchSessionData = async (store, sessionUrl) => {\n const sessionLoaded = (payload = {}) =>\n store.dispatch({ type: \"session/loaded\", payload });\n\n try {\n if (!sessionUrl) {\n console.log(\n `Skipping fetching session, invalid sessionUrl: \"${sessionUrl}\"`,\n );\n sessionLoaded();\n return;\n }\n\n const options = {\n headers: {\n accept: \"application/json\",\n },\n cache: \"no-cache\",\n };\n\n if (__ENABLE_FETCH_WITH_CREDENTIALS__) {\n options.credentials = \"include\";\n }\n\n const res = await fetch(sessionUrl, options);\n const jsonResponse = isJsonResponse(res.headers.get(\"content-type\"));\n\n if (!jsonResponse) {\n throw new Error(\"Session endpoint is not serving json\");\n }\n\n const payload = await res.json();\n\n if (payload.error === NOT_FOUND_ERROR_CODE) {\n sessionLoaded();\n } else {\n sessionLoaded(payload);\n }\n } catch (e) {\n sessionLoaded();\n console.warn(\"Could not fetch session data due to error:\", e);\n }\n};\n\nconst initialState = { data: null };\n\nconst REDUCER_KEY = \"session\";\n\nconst reducerSessionData = {\n [REDUCER_KEY]: (state = initialState, action) => {\n switch (action.type) {\n case \"session/loaded\":\n return { ...state, data: action.payload };\n default:\n return state;\n }\n },\n};\n\nconst selectSessionData = (store) => store.getState()[REDUCER_KEY]?.data;\n\nexport { fetchSessionData, reducerSessionData, selectSessionData };\n"],"names":["isJsonResponse","NOT_FOUND_ERROR_CODE","fetchSessionData","store","sessionUrl","sessionLoaded","payload","dispatch","type","console","log","options","headers","accept","cache","credentials","res","fetch","jsonResponse","get","Error","json","error","e","warn","initialState","data","REDUCER_KEY","reducerSessionData","state","action","selectSessionData","getState"],"mappings":"AAKA,OAASA,cAAc,KAAQ,oBAAqB,CAEpD,MAAMC,qBAAuB,YAE7B,MAAMC,iBAAmB,MAAOC,MAAOC,cACrC,MAAMC,cAAgB,CAACC,QAAU,CAAC,CAAC,GACjCH,MAAMI,QAAQ,CAAC,CAAEC,KAAM,iBAAkBF,OAAQ,GAEnD,GAAI,CACF,GAAI,CAACF,WAAY,CACfK,QAAQC,GAAG,CACT,CAAC,gDAAgD,EAAEN,WAAW,CAAC,CAAC,EAElEC,gBACA,MACF,CAEA,MAAMM,QAAU,CACdC,QAAS,CACPC,OAAQ,kBACV,EACAC,MAAO,UACT,EAEA,GA7BJ,KA6B2C,CACrCH,QAAQI,WAAW,CAAG,SACxB,CAEA,MAAMC,IAAM,MAAMC,MAAMb,WAAYO,SACpC,MAAMO,aAAelB,eAAegB,IAAIJ,OAAO,CAACO,GAAG,CAAC,iBAEpD,GAAI,CAACD,aAAc,CACjB,MAAM,IAAIE,MAAM,uCAClB,CAEA,MAAMd,QAAU,MAAMU,IAAIK,IAAI,GAE9B,GAAIf,QAAQgB,KAAK,GAAKrB,qBAAsB,CAC1CI,eACF,KAAO,CACLA,cAAcC,QAChB,CACF,CAAE,MAAOiB,EAAG,CACVlB,gBACAI,QAAQe,IAAI,CAAC,6CAA8CD,EAC7D,CACF,EAEA,MAAME,aAAe,CAAEC,KAAM,IAAK,EAElC,MAAMC,YAAc,UAEpB,MAAMC,mBAAqB,CACzB,CAACD,YAAY,CAAE,CAACE,MAAQJ,YAAY,CAAEK,UACpC,OAAQA,OAAOtB,IAAI,EACjB,IAAK,iBACH,MAAO,CAAE,GAAGqB,KAAK,CAAEH,KAAMI,OAAOxB,OAAO,AAAC,CAC1C,SACE,OAAOuB,KACX,CACF,CACF,EAEA,MAAME,kBAAoB,AAAC5B,OAAUA,MAAM6B,QAAQ,EAAE,CAACL,YAAY,EAAED,IAEpE,QAASxB,gBAAgB,CAAE0B,kBAAkB,CAAEG,iBAAiB,CAAG"}
package/core/scripts.js CHANGED
@@ -1 +1,2 @@
1
- import"array-flat-polyfill";export{default as reactRenderer,renderComponent}from"./react-renderer";export{default as loadSprites}from"./load-sprites";export{default as toggleChatWidget}from"./hubspot-chat-toggle";export*from"./remote-data-store";export*from"./remote-blogs-posts";export*from"./remote-session-data";export*from"./dom-query";
1
+ import"array-flat-polyfill";export{default as reactRenderer,renderComponent}from"./react-renderer";export{default as loadSprites}from"./load-sprites";export{default as toggleChatWidget}from"./hubspot-chat-toggle";export*from"./remote-data-store";export*from"./remote-blogs-posts";export*from"./remote-session-data";export*from"./dom-query";
2
+ //# sourceMappingURL=scripts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/scripts.js"],"sourcesContent":["import \"array-flat-polyfill\";\n\nexport { default as reactRenderer, renderComponent } from \"./react-renderer\";\nexport { default as loadSprites } from \"./load-sprites\";\nexport { default as toggleChatWidget } from \"./hubspot-chat-toggle\";\n\nexport * from \"./remote-data-store\";\nexport * from \"./remote-blogs-posts\";\nexport * from \"./remote-session-data\";\nexport * from \"./dom-query\";\n"],"names":["default","reactRenderer","renderComponent","loadSprites","toggleChatWidget"],"mappings":"AAAA,MAAO,qBAAsB,AAE7B,QAASA,WAAWC,aAAa,CAAEC,eAAe,KAAQ,kBAAmB,AAC7E,QAASF,WAAWG,WAAW,KAAQ,gBAAiB,AACxD,QAASH,WAAWI,gBAAgB,KAAQ,uBAAwB,AAEpE,YAAc,qBAAsB,AACpC,YAAc,sBAAuB,AACrC,YAAc,uBAAwB,AACtC,YAAc,aAAc"}
@@ -0,0 +1 @@
1
+ ["bg-blue-400","bg-blue-100","bg-neutral-1300","bg-neutral-300","bg-neutral-200","bg-neutral-100","bg-neutral-000","bg-neutral-600","bg-orange-900","bg-orange-600","border-blue-400","border-neutral-200","border-neutral-600","border-neutral-500","border-orange-600","from-neutral-400","group-hover:bg-neutral-100","text-blue-600","text-blue-200","text-neutral-1300","text-neutral-300","text-neutral-000","text-neutral-1100","text-neutral-1000","text-neutral-800","text-neutral-700","text-neutral-600","text-neutral-500","text-orange-200","text-orange-600"]
@@ -1 +1,2 @@
1
- export const variants=["","dark:"];export const prefixes=["text","bg","from","to","border"];export const colors=["neutral","orange","blue","yellow","green","violet","pink"];export const neutralColors=["neutral-000","neutral-100","neutral-200","neutral-300","neutral-400","neutral-500","neutral-600","neutral-700","neutral-800","neutral-900","neutral-1000","neutral-1100","neutral-1200","neutral-1300"];export const orangeColors=["orange-100","orange-200","orange-300","orange-400","orange-500","orange-600","orange-700","orange-800","orange-900","orange-1000","orange-1100"];export const yellowColors=["yellow-100","yellow-200","yellow-300","yellow-400","yellow-500","yellow-600","yellow-700","yellow-800","yellow-900"];export const greenColors=["green-100","green-200","green-300","green-400","green-500","green-600","green-700","green-800","green-900"];export const blueColors=["blue-100","blue-200","blue-300","blue-400","blue-500","blue-600","blue-700","blue-800","blue-900"];export const violetColors=["violet-100","violet-200","violet-300","violet-400","violet-500","violet-600","violet-700","violet-800","violet-900"];export const pinkColors=["pink-100","pink-200","pink-300","pink-400","pink-500","pink-600","pink-700","pink-800","pink-900"];const secondaryColors=[...yellowColors,...greenColors,...blueColors,...violetColors,...pinkColors];const guiColors=["gui-blue-default-light","gui-blue-hover-light","gui-blue-active-light","gui-blue-default-dark","gui-blue-hover-dark","gui-blue-active-dark","gui-blue-focus","gui-unavailable","gui-success-green","gui-error-red","gui-focus","gui-focus-outline","gui-visited"];export const aliasedColors=["white","extra-light-grey","light-grey","mid-grey","dark-grey","charcoal-grey","cool-black","active-orange","bright-red","red-orange","electric-cyan","zingy-green","jazzy-pink","gui-default","gui-hover","gui-active","gui-error","gui-success","gui-default-dark","gui-hover-dark","gui-active-dark","transparent"];export const colorRoles={neutral:neutralColors,orange:orangeColors,secondary:secondaryColors,gui:guiColors};export const colorGroupLengths={neutral:neutralColors.length,orange:orangeColors.length,blue:blueColors.length,yellow:yellowColors.length,green:greenColors.length,violet:violetColors.length,pink:pinkColors.length};
1
+ export const variants=["","dark:"];export const prefixes=["text","bg","from","to","border"];export const colors=["neutral","orange","blue","yellow","green","violet","pink"];export const neutralColors=["neutral-000","neutral-100","neutral-200","neutral-300","neutral-400","neutral-500","neutral-600","neutral-700","neutral-800","neutral-900","neutral-1000","neutral-1100","neutral-1200","neutral-1300"];export const orangeColors=["orange-100","orange-200","orange-300","orange-400","orange-500","orange-600","orange-700","orange-800","orange-900","orange-1000","orange-1100"];export const yellowColors=["yellow-100","yellow-200","yellow-300","yellow-400","yellow-500","yellow-600","yellow-700","yellow-800","yellow-900"];export const greenColors=["green-100","green-200","green-300","green-400","green-500","green-600","green-700","green-800","green-900"];export const blueColors=["blue-100","blue-200","blue-300","blue-400","blue-500","blue-600","blue-700","blue-800","blue-900"];export const violetColors=["violet-100","violet-200","violet-300","violet-400","violet-500","violet-600","violet-700","violet-800","violet-900"];export const pinkColors=["pink-100","pink-200","pink-300","pink-400","pink-500","pink-600","pink-700","pink-800","pink-900"];const secondaryColors=[...yellowColors,...greenColors,...blueColors,...violetColors,...pinkColors];const guiColors=["gui-blue-default-light","gui-blue-hover-light","gui-blue-active-light","gui-blue-default-dark","gui-blue-hover-dark","gui-blue-active-dark","gui-blue-focus","gui-unavailable","gui-success-green","gui-error-red","gui-focus","gui-focus-outline","gui-visited"];export const aliasedColors=["white","extra-light-grey","light-grey","mid-grey","dark-grey","charcoal-grey","cool-black","active-orange","bright-red","red-orange","electric-cyan","zingy-green","jazzy-pink","gui-default","gui-hover","gui-active","gui-error","gui-success","gui-default-dark","gui-hover-dark","gui-active-dark","transparent"];export const colorRoles={neutral:neutralColors,orange:orangeColors,secondary:secondaryColors,gui:guiColors};export const colorGroupLengths={neutral:neutralColors.length,orange:orangeColors.length,blue:blueColors.length,yellow:yellowColors.length,green:greenColors.length,violet:violetColors.length,pink:pinkColors.length};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/core/styles/colors/types.ts"],"sourcesContent":["export type ColorName =\n | (typeof neutralColors)[number]\n | (typeof orangeColors)[number]\n | (typeof secondaryColors)[number]\n | (typeof guiColors)[number]\n | (typeof aliasedColors)[number];\n\nexport const variants = [\"\", \"dark:\"] as const;\n\ntype ColorClassVariants = (typeof variants)[number];\n\nexport const prefixes = [\"text\", \"bg\", \"from\", \"to\", \"border\"] as const;\n\ntype ColorClassPrefixes = (typeof prefixes)[number];\n\nexport const colors = [\n \"neutral\",\n \"orange\",\n \"blue\",\n \"yellow\",\n \"green\",\n \"violet\",\n \"pink\",\n] as const;\n\nexport type ColorClassColorGroups = (typeof colors)[number];\n\nexport type Theme = \"light\" | \"dark\";\n\nexport type ColorClass =\n `${ColorClassVariants}${ColorClassPrefixes}-${ColorName}`;\n\nexport type ColorThemeSet = `${string} dark:${string}`;\n\nexport const neutralColors = [\n \"neutral-000\",\n \"neutral-100\",\n \"neutral-200\",\n \"neutral-300\",\n \"neutral-400\",\n \"neutral-500\",\n \"neutral-600\",\n \"neutral-700\",\n \"neutral-800\",\n \"neutral-900\",\n \"neutral-1000\",\n \"neutral-1100\",\n \"neutral-1200\",\n \"neutral-1300\",\n] as const;\n\nexport const orangeColors = [\n \"orange-100\",\n \"orange-200\",\n \"orange-300\",\n \"orange-400\",\n \"orange-500\",\n \"orange-600\",\n \"orange-700\",\n \"orange-800\",\n \"orange-900\",\n \"orange-1000\",\n \"orange-1100\",\n] as const;\n\nexport const yellowColors = [\n \"yellow-100\",\n \"yellow-200\",\n \"yellow-300\",\n \"yellow-400\",\n \"yellow-500\",\n \"yellow-600\",\n \"yellow-700\",\n \"yellow-800\",\n \"yellow-900\",\n] as const;\n\nexport const greenColors = [\n \"green-100\",\n \"green-200\",\n \"green-300\",\n \"green-400\",\n \"green-500\",\n \"green-600\",\n \"green-700\",\n \"green-800\",\n \"green-900\",\n] as const;\n\nexport const blueColors = [\n \"blue-100\",\n \"blue-200\",\n \"blue-300\",\n \"blue-400\",\n \"blue-500\",\n \"blue-600\",\n \"blue-700\",\n \"blue-800\",\n \"blue-900\",\n] as const;\n\nexport const violetColors = [\n \"violet-100\",\n \"violet-200\",\n \"violet-300\",\n \"violet-400\",\n \"violet-500\",\n \"violet-600\",\n \"violet-700\",\n \"violet-800\",\n \"violet-900\",\n] as const;\n\nexport const pinkColors = [\n \"pink-100\",\n \"pink-200\",\n \"pink-300\",\n \"pink-400\",\n \"pink-500\",\n \"pink-600\",\n \"pink-700\",\n \"pink-800\",\n \"pink-900\",\n] as const;\n\nconst secondaryColors = [\n ...yellowColors,\n ...greenColors,\n ...blueColors,\n ...violetColors,\n ...pinkColors,\n] as const;\n\nconst guiColors = [\n \"gui-blue-default-light\",\n \"gui-blue-hover-light\",\n \"gui-blue-active-light\",\n \"gui-blue-default-dark\",\n \"gui-blue-hover-dark\",\n \"gui-blue-active-dark\",\n \"gui-blue-focus\",\n \"gui-unavailable\",\n \"gui-success-green\",\n \"gui-error-red\",\n \"gui-focus\",\n \"gui-focus-outline\",\n \"gui-visited\",\n] as const;\n\nexport const aliasedColors = [\n \"white\",\n \"extra-light-grey\",\n \"light-grey\",\n \"mid-grey\",\n \"dark-grey\",\n \"charcoal-grey\",\n \"cool-black\",\n \"active-orange\",\n \"bright-red\",\n \"red-orange\",\n \"electric-cyan\",\n \"zingy-green\",\n \"jazzy-pink\",\n \"gui-default\",\n \"gui-hover\",\n \"gui-active\",\n \"gui-error\",\n \"gui-success\",\n \"gui-default-dark\",\n \"gui-hover-dark\",\n \"gui-active-dark\",\n \"transparent\",\n] as const;\n\nexport const colorRoles = {\n neutral: neutralColors,\n orange: orangeColors,\n secondary: secondaryColors,\n gui: guiColors,\n};\n\nexport const colorGroupLengths = {\n neutral: neutralColors.length,\n orange: orangeColors.length,\n blue: blueColors.length,\n yellow: yellowColors.length,\n green: greenColors.length,\n violet: violetColors.length,\n pink: pinkColors.length,\n};\n"],"names":["variants","prefixes","colors","neutralColors","orangeColors","yellowColors","greenColors","blueColors","violetColors","pinkColors","secondaryColors","guiColors","aliasedColors","colorRoles","neutral","orange","secondary","gui","colorGroupLengths","length","blue","yellow","green","violet","pink"],"mappings":"AAOA,OAAO,MAAMA,SAAW,CAAC,GAAI,QAAQ,AAAU,AAI/C,QAAO,MAAMC,SAAW,CAAC,OAAQ,KAAM,OAAQ,KAAM,SAAS,AAAU,AAIxE,QAAO,MAAMC,OAAS,CACpB,UACA,SACA,OACA,SACA,QACA,SACA,OACD,AAAU,AAWX,QAAO,MAAMC,cAAgB,CAC3B,cACA,cACA,cACA,cACA,cACA,cACA,cACA,cACA,cACA,cACA,eACA,eACA,eACA,eACD,AAAU,AAEX,QAAO,MAAMC,aAAe,CAC1B,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,cACA,cACD,AAAU,AAEX,QAAO,MAAMC,aAAe,CAC1B,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACD,AAAU,AAEX,QAAO,MAAMC,YAAc,CACzB,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACD,AAAU,AAEX,QAAO,MAAMC,WAAa,CACxB,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACD,AAAU,AAEX,QAAO,MAAMC,aAAe,CAC1B,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACD,AAAU,AAEX,QAAO,MAAMC,WAAa,CACxB,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACD,AAAU,CAEX,MAAMC,gBAAkB,IACnBL,gBACAC,eACAC,cACAC,gBACAC,WACJ,CAED,MAAME,UAAY,CAChB,yBACA,uBACA,wBACA,wBACA,sBACA,uBACA,iBACA,kBACA,oBACA,gBACA,YACA,oBACA,cACD,AAED,QAAO,MAAMC,cAAgB,CAC3B,QACA,mBACA,aACA,WACA,YACA,gBACA,aACA,gBACA,aACA,aACA,gBACA,cACA,aACA,cACA,YACA,aACA,YACA,cACA,mBACA,iBACA,kBACA,cACD,AAAU,AAEX,QAAO,MAAMC,WAAa,CACxBC,QAASX,cACTY,OAAQX,aACRY,UAAWN,gBACXO,IAAKN,SACP,CAAE,AAEF,QAAO,MAAMO,kBAAoB,CAC/BJ,QAASX,cAAcgB,MAAM,CAC7BJ,OAAQX,aAAae,MAAM,CAC3BC,KAAMb,WAAWY,MAAM,CACvBE,OAAQhB,aAAac,MAAM,CAC3BG,MAAOhB,YAAYa,MAAM,CACzBI,OAAQf,aAAaW,MAAM,CAC3BK,KAAMf,WAAWU,MAAM,AACzB,CAAE"}
@@ -1 +1,2 @@
1
- import{colorGroupLengths}from"./types";export const convertTailwindClassToVar=className=>className.replace(/(text|bg|from|to)-([a-z0-9-]+)/gi,"var(--color-$2)");export const invertTailwindClassVariant=className=>{const splitMatch=className.split("-");if(splitMatch.length<3){throw new Error("Invalid TW class format")}const color=splitMatch[splitMatch.length-2];const variant=splitMatch[splitMatch.length-1];const property=splitMatch.slice(0,splitMatch.length-1).join("-");const numericalVariant=Number(variant.slice(0,-2))??0;if(isNaN(numericalVariant)){throw new Error(`Invalid variant value in TW class: ${className}`)}const flippedVariant=colorGroupLengths[color]-numericalVariant-(color==="neutral"?1:-1);const flippedMatch=`${property}-${flippedVariant}00`;return flippedMatch};
1
+ import{colorGroupLengths}from"./types";export const convertTailwindClassToVar=className=>className.replace(/(text|bg|from|to)-([a-z0-9-]+)/gi,"var(--color-$2)");export const invertTailwindClassVariant=className=>{const splitMatch=className.split("-");if(splitMatch.length<3){throw new Error("Invalid TW class format")}const color=splitMatch[splitMatch.length-2];const variant=splitMatch[splitMatch.length-1];const property=splitMatch.slice(0,splitMatch.length-1).join("-");const numericalVariant=Number(variant.slice(0,-2))??0;if(isNaN(numericalVariant)){throw new Error(`Invalid variant value in TW class: ${className}`)}const flippedVariant=colorGroupLengths[color]-numericalVariant-(color==="neutral"?1:-1);const flippedMatch=`${property}-${flippedVariant}00`;return flippedMatch};
2
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/core/styles/colors/utils.ts"],"sourcesContent":["import { ColorClass, ColorClassColorGroups, colorGroupLengths } from \"./types\";\n\nexport const convertTailwindClassToVar = (className: string) =>\n className.replace(/(text|bg|from|to)-([a-z0-9-]+)/gi, \"var(--color-$2)\");\n\nexport const invertTailwindClassVariant = (className: string): ColorClass => {\n const splitMatch = className.split(\"-\");\n if (splitMatch.length < 3) {\n throw new Error(\"Invalid TW class format\");\n }\n\n const color = splitMatch[splitMatch.length - 2];\n const variant = splitMatch[splitMatch.length - 1];\n const property = splitMatch.slice(0, splitMatch.length - 1).join(\"-\");\n\n const numericalVariant = Number(variant.slice(0, -2)) ?? 0;\n if (isNaN(numericalVariant)) {\n throw new Error(`Invalid variant value in TW class: ${className}`);\n }\n\n const flippedVariant =\n colorGroupLengths[color as ColorClassColorGroups] -\n numericalVariant -\n (color === \"neutral\" ? 1 : -1);\n const flippedMatch = `${property}-${flippedVariant}00`;\n\n return flippedMatch as ColorClass;\n};\n"],"names":["colorGroupLengths","convertTailwindClassToVar","className","replace","invertTailwindClassVariant","splitMatch","split","length","Error","color","variant","property","slice","join","numericalVariant","Number","isNaN","flippedVariant","flippedMatch"],"mappings":"AAAA,OAA4CA,iBAAiB,KAAQ,SAAU,AAE/E,QAAO,MAAMC,0BAA4B,AAACC,WACxCA,UAAUC,OAAO,CAAC,mCAAoC,kBAAmB,AAE3E,QAAO,MAAMC,2BAA6B,AAACF,YACzC,MAAMG,WAAaH,UAAUI,KAAK,CAAC,KACnC,GAAID,WAAWE,MAAM,CAAG,EAAG,CACzB,MAAM,IAAIC,MAAM,0BAClB,CAEA,MAAMC,MAAQJ,UAAU,CAACA,WAAWE,MAAM,CAAG,EAAE,CAC/C,MAAMG,QAAUL,UAAU,CAACA,WAAWE,MAAM,CAAG,EAAE,CACjD,MAAMI,SAAWN,WAAWO,KAAK,CAAC,EAAGP,WAAWE,MAAM,CAAG,GAAGM,IAAI,CAAC,KAEjE,MAAMC,iBAAmBC,OAAOL,QAAQE,KAAK,CAAC,EAAG,CAAC,KAAO,EACzD,GAAII,MAAMF,kBAAmB,CAC3B,MAAM,IAAIN,MAAM,CAAC,mCAAmC,EAAEN,UAAU,CAAC,CACnE,CAEA,MAAMe,eACJjB,iBAAiB,CAACS,MAA+B,CACjDK,iBACCL,CAAAA,QAAU,UAAY,EAAI,CAAC,CAAA,EAC9B,MAAMS,aAAe,CAAC,EAAEP,SAAS,CAAC,EAAEM,eAAe,EAAE,CAAC,CAEtD,OAAOC,YACT,CAAE"}
@@ -1 +1,2 @@
1
- import React from"react";import Icon from"../../Icon";export const Checkbox=({index,disabled})=>React.createElement("div",{className:"ui-checkbox-p1 flex items-center"},React.createElement("input",{"data-ui-checkbox-native":"",type:"checkbox",id:`checkbox-example-${index}`,name:`checkbox-example-${index}`,value:"yes",className:"ui-checkbox-input",disabled:disabled}),React.createElement("div",{"data-ui-checkbox-styled":"",className:"ui-checkbox-styled"},React.createElement(Icon,{name:"icon-gui-check-micro",size:"1rem",additionalCSS:"ui-checkbox-styled-tick"})),React.createElement("label",{htmlFor:`checkbox-example-${index}`,className:"ui-checkbox-label-p1"},"Option ",index));export const RadioButton=({index,disabled})=>React.createElement("div",{className:"flex items-center gap-8"},React.createElement("input",{"data-ui-radio-native":"",type:"radio",id:`radio-example-${index}`,name:"radio-example",value:`option-${index}`,className:"ui-radio",disabled:disabled}),React.createElement("label",{className:"text-neutral-1300 dark:text-neutral-000",htmlFor:`radio-example-${index}`},"Option ",index));
1
+ import React from"react";import Icon from"../../Icon";export const Checkbox=({index,disabled})=>React.createElement("div",{className:"ui-checkbox-p1 flex items-center"},React.createElement("input",{"data-ui-checkbox-native":"",type:"checkbox",id:`checkbox-example-${index}`,name:`checkbox-example-${index}`,value:"yes",className:"ui-checkbox-input",disabled:disabled}),React.createElement("div",{"data-ui-checkbox-styled":"",className:"ui-checkbox-styled"},React.createElement(Icon,{name:"icon-gui-check-micro",size:"1rem",additionalCSS:"ui-checkbox-styled-tick"})),React.createElement("label",{htmlFor:`checkbox-example-${index}`,className:"ui-checkbox-label-p1"},"Option ",index));export const RadioButton=({index,disabled})=>React.createElement("div",{className:"flex items-center gap-8"},React.createElement("input",{"data-ui-radio-native":"",type:"radio",id:`radio-example-${index}`,name:"radio-example",value:`option-${index}`,className:"ui-radio",disabled:disabled}),React.createElement("label",{className:"text-neutral-1300 dark:text-neutral-000",htmlFor:`radio-example-${index}`},"Option ",index));
2
+ //# sourceMappingURL=story-components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/core/styles/forms/story-components.tsx"],"sourcesContent":["import React from \"react\";\nimport Icon from \"../../Icon\";\n\ntype FormElementProps = {\n index: number;\n disabled?: boolean;\n};\n\nexport const Checkbox = ({ index, disabled }: FormElementProps) => (\n <div className=\"ui-checkbox-p1 flex items-center\">\n <input\n data-ui-checkbox-native=\"\"\n type=\"checkbox\"\n id={`checkbox-example-${index}`}\n name={`checkbox-example-${index}`}\n value=\"yes\"\n className=\"ui-checkbox-input\"\n disabled={disabled}\n />\n <div data-ui-checkbox-styled=\"\" className=\"ui-checkbox-styled\">\n <Icon\n name=\"icon-gui-check-micro\"\n size=\"1rem\"\n additionalCSS=\"ui-checkbox-styled-tick\"\n />\n </div>\n <label\n htmlFor={`checkbox-example-${index}`}\n className=\"ui-checkbox-label-p1\"\n >\n Option {index}\n </label>\n </div>\n);\n\nexport const RadioButton = ({ index, disabled }: FormElementProps) => (\n <div className=\"flex items-center gap-8\">\n <input\n data-ui-radio-native=\"\"\n type=\"radio\"\n id={`radio-example-${index}`}\n name=\"radio-example\"\n value={`option-${index}`}\n className=\"ui-radio\"\n disabled={disabled}\n />\n <label\n className=\"text-neutral-1300 dark:text-neutral-000\"\n htmlFor={`radio-example-${index}`}\n >\n Option {index}\n </label>\n </div>\n);\n"],"names":["React","Icon","Checkbox","index","disabled","div","className","input","data-ui-checkbox-native","type","id","name","value","data-ui-checkbox-styled","size","additionalCSS","label","htmlFor","RadioButton","data-ui-radio-native"],"mappings":"AAAA,OAAOA,UAAW,OAAQ,AAC1B,QAAOC,SAAU,YAAa,AAO9B,QAAO,MAAMC,SAAW,CAAC,CAAEC,KAAK,CAAEC,QAAQ,CAAoB,GAC5D,oBAACC,OAAIC,UAAU,oCACb,oBAACC,SACCC,0BAAwB,GACxBC,KAAK,WACLC,GAAI,CAAC,iBAAiB,EAAEP,MAAM,CAAC,CAC/BQ,KAAM,CAAC,iBAAiB,EAAER,MAAM,CAAC,CACjCS,MAAM,MACNN,UAAU,oBACVF,SAAUA,WAEZ,oBAACC,OAAIQ,0BAAwB,GAAGP,UAAU,sBACxC,oBAACL,MACCU,KAAK,uBACLG,KAAK,OACLC,cAAc,6BAGlB,oBAACC,SACCC,QAAS,CAAC,iBAAiB,EAAEd,MAAM,CAAC,CACpCG,UAAU,wBACX,UACSH,OAGZ,AAEF,QAAO,MAAMe,YAAc,CAAC,CAAEf,KAAK,CAAEC,QAAQ,CAAoB,GAC/D,oBAACC,OAAIC,UAAU,2BACb,oBAACC,SACCY,uBAAqB,GACrBV,KAAK,QACLC,GAAI,CAAC,cAAc,EAAEP,MAAM,CAAC,CAC5BQ,KAAK,gBACLC,MAAO,CAAC,OAAO,EAAET,MAAM,CAAC,CACxBG,UAAU,WACVF,SAAUA,WAEZ,oBAACY,SACCV,UAAU,0CACVW,QAAS,CAAC,cAAc,EAAEd,MAAM,CAAC,EAClC,UACSA,OAGZ"}
package/core/url-base.js CHANGED
@@ -1 +1,2 @@
1
- const DEFAULT_URL_BASE="";const absUrl=(path,urlBase=DEFAULT_URL_BASE)=>{return`${urlBase}${path}`};export default absUrl;
1
+ const DEFAULT_URL_BASE="";const absUrl=(path,urlBase=DEFAULT_URL_BASE)=>{return`${urlBase}${path}`};export default absUrl;
2
+ //# sourceMappingURL=url-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/url-base.js"],"sourcesContent":["const DEFAULT_URL_BASE = \"\";\n\nconst absUrl = (path, urlBase = DEFAULT_URL_BASE) => {\n return `${urlBase}${path}`;\n};\n\nexport default absUrl;\n"],"names":["DEFAULT_URL_BASE","absUrl","path","urlBase"],"mappings":"AAAA,MAAMA,iBAAmB,GAEzB,MAAMC,OAAS,CAACC,KAAMC,QAAUH,gBAAgB,IAC9C,MAAO,CAAC,EAAEG,QAAQ,EAAED,KAAK,CAAC,AAC5B,CAEA,gBAAeD,MAAO"}
package/core/utils/cn.js CHANGED
@@ -1 +1,2 @@
1
- import{twMerge}from"tailwind-merge";import clsx from"clsx";const cn=(...inputs)=>{return twMerge(clsx(inputs))};export default cn;
1
+ import{twMerge}from"tailwind-merge";import clsx from"clsx";const cn=(...inputs)=>{return twMerge(clsx(inputs))};export default cn;
2
+ //# sourceMappingURL=cn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/utils/cn.ts"],"sourcesContent":["import { twMerge } from \"tailwind-merge\";\nimport clsx, { ClassValue } from \"clsx\";\n\nconst cn = (...inputs: ClassValue[]) => {\n return twMerge(clsx(inputs));\n};\n\nexport default cn;\n"],"names":["twMerge","clsx","cn","inputs"],"mappings":"AAAA,OAASA,OAAO,KAAQ,gBAAiB,AACzC,QAAOC,SAA0B,MAAO,CAExC,MAAMC,GAAK,CAAC,GAAGC,UACb,OAAOH,QAAQC,KAAKE,QACtB,CAEA,gBAAeD,EAAG"}
@@ -1 +1,2 @@
1
- export const HEADER_HEIGHT=64;export const HEADER_BOTTOM_MARGIN=24;export const componentMaxHeight=(...heights)=>{const totalHeight=heights.reduce((sum,height)=>sum+height,0)+"px";return`calc(100vh - ${totalHeight})`};
1
+ export const HEADER_HEIGHT=64;export const HEADER_BOTTOM_MARGIN=24;export const componentMaxHeight=(...heights)=>{const totalHeight=heights.reduce((sum,height)=>sum+height,0)+"px";return`calc(100vh - ${totalHeight})`};
2
+ //# sourceMappingURL=heights.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/utils/heights.ts"],"sourcesContent":["/*\n Since we perform CSS calc operations involving various UI element heights, we need to centralise\n these values to prevent magic numbers popping up with no obvious reasoning. When making alterations\n to Layout components, here or in downstream repos, consider these values and update where necessary.\n*/\nexport const HEADER_HEIGHT = 64;\nexport const HEADER_BOTTOM_MARGIN = 24;\n\n/**\n * Calculates the maximum height for a component by subtracting the total of given heights from 100vh.\n *\n * @param {...number} heights - An array of heights in pixels.\n * @returns {string} The CSS calc expression for the maximum height.\n */\nexport const componentMaxHeight = (...heights: number[]): string => {\n const totalHeight = heights.reduce((sum, height) => sum + height, 0) + \"px\";\n return `calc(100vh - ${totalHeight})`;\n};\n"],"names":["HEADER_HEIGHT","HEADER_BOTTOM_MARGIN","componentMaxHeight","heights","totalHeight","reduce","sum","height"],"mappings":"AAKA,OAAO,MAAMA,cAAgB,EAAG,AAChC,QAAO,MAAMC,qBAAuB,EAAG,AAQvC,QAAO,MAAMC,mBAAqB,CAAC,GAAGC,WACpC,MAAMC,YAAcD,QAAQE,MAAM,CAAC,CAACC,IAAKC,SAAWD,IAAMC,OAAQ,GAAK,KACvE,MAAO,CAAC,aAAa,EAAEH,YAAY,CAAC,CAAC,AACvC,CAAE"}
@@ -1 +1,2 @@
1
- import bash from"highlight.js/lib/languages/bash";import cpp from"highlight.js/lib/languages/cpp";import csharp from"highlight.js/lib/languages/csharp";import css from"highlight.js/lib/languages/css";import dart from"highlight.js/lib/languages/dart";import dos from"highlight.js/lib/languages/dos";import diff from"highlight.js/lib/languages/diff";import erlang from"highlight.js/lib/languages/erlang";import elixir from"highlight.js/lib/languages/elixir";import plaintext from"highlight.js/lib/languages/plaintext";import go from"highlight.js/lib/languages/go";import http from"highlight.js/lib/languages/http";import java from"highlight.js/lib/languages/java";import javascript from"highlight.js/lib/languages/javascript";import typescript from"highlight.js/lib/languages/typescript";import json from"highlight.js/lib/languages/json";import objectivec from"highlight.js/lib/languages/objectivec";import php from"highlight.js/lib/languages/php";import python from"highlight.js/lib/languages/python";import ruby from"highlight.js/lib/languages/ruby";import swift from"highlight.js/lib/languages/swift";import kotlin from"highlight.js/lib/languages/kotlin";import sql from"highlight.js/lib/languages/sql";import xml from"highlight.js/lib/languages/xml";import yaml from"highlight.js/lib/languages/yaml";import curl from"highlightjs-curl/src/languages/curl";const registry=[{label:"Text",key:"text",module:plaintext},{label:"JS",key:"javascript",module:javascript},{label:"TS",key:"typescript",module:typescript},{label:"Java",key:"java",module:java},{label:"Ruby",key:"ruby",module:ruby},{label:"Python",key:"python",module:python},{label:"PHP",key:"php",module:php},{label:"Shell",key:"bash",module:bash},{label:"C#",key:"cs",module:csharp},{label:"CSS",key:"css",module:css},{label:"Go",key:"go",module:go},{label:"HTML",key:"xml",module:xml},{label:"HTTP",key:"http",module:http},{label:"C++",key:"cpp",module:cpp},{label:"Dart",key:"dart",module:dart},{label:"Swift",key:"swift",module:swift},{label:"Kotlin",key:"kotlin",module:kotlin},{label:"Objective C",key:"objectivec",module:objectivec},{label:"Node.js",key:"javascript",module:javascript},{label:"JSON",key:"json",module:json},{label:"DOS",key:"dos",module:dos},{label:"YAML",key:"yaml",module:yaml},{label:"Erlang",key:"erlang",module:erlang},{label:"Elixir",key:"elixir",module:elixir},{label:"Diff",key:"diff",module:diff},{label:"SQL",key:"sql",module:sql},{label:"cURL",key:"curl",module:curl},{label:"HTML",key:"html",module:xml},{label:"XML",key:"xml",module:xml}];export default registry;
1
+ import bash from"highlight.js/lib/languages/bash";import cpp from"highlight.js/lib/languages/cpp";import csharp from"highlight.js/lib/languages/csharp";import css from"highlight.js/lib/languages/css";import dart from"highlight.js/lib/languages/dart";import dos from"highlight.js/lib/languages/dos";import diff from"highlight.js/lib/languages/diff";import erlang from"highlight.js/lib/languages/erlang";import elixir from"highlight.js/lib/languages/elixir";import plaintext from"highlight.js/lib/languages/plaintext";import go from"highlight.js/lib/languages/go";import http from"highlight.js/lib/languages/http";import java from"highlight.js/lib/languages/java";import javascript from"highlight.js/lib/languages/javascript";import typescript from"highlight.js/lib/languages/typescript";import json from"highlight.js/lib/languages/json";import objectivec from"highlight.js/lib/languages/objectivec";import php from"highlight.js/lib/languages/php";import python from"highlight.js/lib/languages/python";import ruby from"highlight.js/lib/languages/ruby";import swift from"highlight.js/lib/languages/swift";import kotlin from"highlight.js/lib/languages/kotlin";import sql from"highlight.js/lib/languages/sql";import xml from"highlight.js/lib/languages/xml";import yaml from"highlight.js/lib/languages/yaml";import curl from"highlightjs-curl/src/languages/curl";const registry=[{label:"Text",key:"text",module:plaintext},{label:"JS",key:"javascript",module:javascript},{label:"TS",key:"typescript",module:typescript},{label:"Java",key:"java",module:java},{label:"Ruby",key:"ruby",module:ruby},{label:"Python",key:"python",module:python},{label:"PHP",key:"php",module:php},{label:"Shell",key:"bash",module:bash},{label:"C#",key:"cs",module:csharp},{label:"CSS",key:"css",module:css},{label:"Go",key:"go",module:go},{label:"HTML",key:"xml",module:xml},{label:"HTTP",key:"http",module:http},{label:"C++",key:"cpp",module:cpp},{label:"Dart",key:"dart",module:dart},{label:"Swift",key:"swift",module:swift},{label:"Kotlin",key:"kotlin",module:kotlin},{label:"Objective C",key:"objectivec",module:objectivec},{label:"Node.js",key:"javascript",module:javascript},{label:"JSON",key:"json",module:json},{label:"DOS",key:"dos",module:dos},{label:"YAML",key:"yaml",module:yaml},{label:"Erlang",key:"erlang",module:erlang},{label:"Elixir",key:"elixir",module:elixir},{label:"Diff",key:"diff",module:diff},{label:"SQL",key:"sql",module:sql},{label:"cURL",key:"curl",module:curl},{label:"HTML",key:"html",module:xml},{label:"XML",key:"xml",module:xml}];export default registry;
2
+ //# sourceMappingURL=syntax-highlighter-registry.js.map