@intlayer/design-system 5.5.10 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/.vite/manifest.json +86 -51
- package/dist/components/Auth/AuthModal/index.cjs +2 -2
- package/dist/components/Auth/AuthModal/index.mjs +2 -2
- package/dist/components/Auth/useAuth/useCSRF.d.ts +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.d.ts +1 -1
- package/dist/components/Auth/useUser/index.cjs +2 -2
- package/dist/components/Auth/useUser/index.mjs +2 -2
- package/dist/components/Container/index.cjs +2 -1
- package/dist/components/Container/index.cjs.map +1 -1
- package/dist/components/Container/index.d.ts +2 -3
- package/dist/components/Container/index.d.ts.map +1 -1
- package/dist/components/Container/index.mjs +3 -2
- package/dist/components/Container/index.mjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs +2 -2
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs +2 -2
- package/dist/components/{IDE/CopyButton.cjs → CopyButton/index.cjs} +6 -5
- package/dist/components/CopyButton/index.cjs.map +1 -0
- package/dist/components/{IDE/CopyButton.d.ts → CopyButton/index.d.ts} +3 -2
- package/dist/components/CopyButton/index.d.ts.map +1 -0
- package/dist/components/{IDE/CopyButton.mjs → CopyButton/index.mjs} +6 -5
- package/dist/components/CopyButton/index.mjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +2 -2
- package/dist/components/EditableField/EditableFieldTextArea.cjs +2 -2
- package/dist/components/EditableField/EditableFieldTextArea.mjs +2 -2
- package/dist/components/IDE/Code.cjs +3 -3
- package/dist/components/IDE/Code.cjs.map +1 -1
- package/dist/components/IDE/Code.d.ts +1 -1
- package/dist/components/IDE/Code.d.ts.map +1 -1
- package/dist/components/IDE/Code.mjs +3 -3
- package/dist/components/IDE/Code.mjs.map +1 -1
- package/dist/components/IDE/CodeContext.cjs +2 -2
- package/dist/components/IDE/CodeContext.mjs +2 -2
- package/dist/components/IDE/CopyCode.cjs +28 -0
- package/dist/components/IDE/CopyCode.cjs.map +1 -0
- package/dist/components/IDE/CopyCode.d.ts +7 -0
- package/dist/components/IDE/CopyCode.d.ts.map +1 -0
- package/dist/components/IDE/CopyCode.mjs +28 -0
- package/dist/components/IDE/CopyCode.mjs.map +1 -0
- package/dist/components/IDE/MonacoCode.cjs +2 -2
- package/dist/components/IDE/MonacoCode.cjs.map +1 -1
- package/dist/components/IDE/MonacoCode.mjs +1 -1
- package/dist/components/IDE/MonacoCode.mjs.map +1 -1
- package/dist/components/IDE/code.content.cjs +39 -0
- package/dist/components/IDE/code.content.cjs.map +1 -0
- package/dist/components/IDE/code.content.d.ts +73 -0
- package/dist/components/IDE/code.content.d.ts.map +1 -0
- package/dist/components/IDE/code.content.mjs +40 -0
- package/dist/components/IDE/code.content.mjs.map +1 -0
- package/dist/components/IDE/copyCode.content.cjs +39 -0
- package/dist/components/IDE/copyCode.content.cjs.map +1 -0
- package/dist/components/IDE/copyCode.content.d.ts +73 -0
- package/dist/components/IDE/copyCode.content.d.ts.map +1 -0
- package/dist/components/IDE/copyCode.content.mjs +40 -0
- package/dist/components/IDE/copyCode.content.mjs.map +1 -0
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.d.ts.map +1 -1
- package/dist/components/Link/Link.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +2 -2
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +2 -2
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +2 -2
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +2 -2
- package/dist/components/MarkDownRender/index.cjs +27 -1
- package/dist/components/MarkDownRender/index.cjs.map +1 -1
- package/dist/components/MarkDownRender/index.d.ts +2 -2
- package/dist/components/MarkDownRender/index.d.ts.map +1 -1
- package/dist/components/MarkDownRender/index.mjs +27 -1
- package/dist/components/MarkDownRender/index.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +4 -4
- package/dist/components/Modal/Modal.mjs +4 -4
- package/dist/components/Navbar/MobileNavbar.cjs +3 -3
- package/dist/components/Navbar/MobileNavbar.mjs +3 -3
- package/dist/components/Navbar/index.cjs +5 -5
- package/dist/components/Navbar/index.mjs +5 -5
- package/dist/components/Popover/index.cjs +59 -15
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.ts +32 -6
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.mjs +60 -16
- package/dist/components/Popover/index.mjs.map +1 -1
- package/dist/components/SocialNetworks/index.cjs +1 -1
- package/dist/components/SocialNetworks/index.cjs.map +1 -1
- package/dist/components/SocialNetworks/index.mjs +1 -1
- package/dist/components/SocialNetworks/index.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs +3 -3
- package/dist/components/SwitchSelector/index.mjs +3 -3
- package/dist/components/TabSelector/TabSelector.cjs +3 -3
- package/dist/components/TabSelector/TabSelector.mjs +3 -3
- package/dist/components/TextArea/AutocompleteTextArea.cjs +2 -2
- package/dist/components/TextArea/AutocompleteTextArea.mjs +2 -2
- package/dist/components/index.cjs +3 -0
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.mjs +4 -1
- package/dist/components/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +25 -23
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +8 -7
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.mjs +10 -8
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +54 -54
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsync.cjs +10 -11
- package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.mjs +10 -11
- package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.cjs +5 -4
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts +66 -65
- package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
- package/dist/hooks/useIntlayerAPI.mjs +5 -4
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/hooks/useScreenWidth.cjs +18 -0
- package/dist/hooks/useScreenWidth.cjs.map +1 -0
- package/dist/hooks/useScreenWidth.d.ts +4 -0
- package/dist/hooks/useScreenWidth.d.ts.map +1 -0
- package/dist/hooks/useScreenWidth.mjs +18 -0
- package/dist/hooks/useScreenWidth.mjs.map +1 -0
- package/dist/tailwind.css +1 -1
- package/package.json +18 -18
- package/dist/components/IDE/CopyButton.cjs.map +0 -1
- package/dist/components/IDE/CopyButton.d.ts.map +0 -1
- package/dist/components/IDE/CopyButton.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/MarkDownRender/index.tsx"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/MarkDownRender/index.tsx"],"sourcesContent":["import type { LocalesValues } from '@intlayer/config/client';\nimport Markdown, { type MarkdownToJSX } from 'markdown-to-jsx';\nimport type { FC } from 'react';\nimport { cn } from '../../utils/cn';\nimport { H1, H2, H3, H4 } from '../Headers';\nimport { SectionScroller } from '../Headers/SectionScroller';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\n\ntype MarkdownRendererProps = {\n children: string;\n isDarkMode?: boolean;\n locale?: LocalesValues;\n options?: MarkdownToJSX.Options;\n};\n\n/**\n * Removes frontmatter from markdown content\n * Frontmatter is the YAML metadata block at the beginning of markdown files\n * delimited by --- at the start and end\n */\nconst stripFrontmatter = (markdown: string): string => {\n const lines = markdown.split(/\\r?\\n/);\n\n // Check if the very first non-empty line is the metadata start delimiter\n const firstNonEmptyLine = lines.find((line) => line.trim() !== '');\n\n if (!firstNonEmptyLine || firstNonEmptyLine.trim() !== '---') {\n // No frontmatter, return original content\n return markdown;\n }\n\n let inMetadataBlock = false;\n let endOfMetadataIndex = -1;\n\n for (let i = 0; i < lines.length; i++) {\n const trimmedLine = lines[i].trim();\n\n // Toggle metadata block on encountering the delimiter\n if (trimmedLine === '---') {\n if (!inMetadataBlock) {\n // Begin metadata block\n inMetadataBlock = true;\n continue;\n } else {\n // End of metadata block\n endOfMetadataIndex = i;\n break;\n }\n }\n }\n\n if (endOfMetadataIndex > -1) {\n // Return content after the frontmatter\n return lines.slice(endOfMetadataIndex + 1).join('\\n');\n }\n\n // If we couldn't find the end delimiter, return original content\n return markdown;\n};\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n locale,\n options,\n}) => {\n const { overrides, ...restOptions } = options ?? {};\n\n // Strip frontmatter from the markdown content before rendering\n const cleanMarkdown = stripFrontmatter(children);\n\n return (\n <CodeProvider>\n <Markdown\n options={{\n overrides: {\n h1: (props) => <H1 isClickable={true} {...props} />,\n h2: (props) => <H2 isClickable={true} {...props} />,\n h3: (props) => <H3 isClickable={true} {...props} />,\n h4: (props) => <H4 isClickable={true} {...props} />,\n\n code: (props) =>\n typeof props.className === 'undefined' ? (\n <strong className=\"bg-card/60 rounded p-1 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur\">\n {props.children}\n </strong>\n ) : (\n <Code\n isDarkMode={isDarkMode}\n language={props.className?.replace('lang-', '')}\n {...props}\n />\n ),\n\n blockquote: ({ className, ...props }) => (\n <blockquote\n className={cn(\n 'border-card text-neutral mt-5 flex flex-col gap-3 border-l-4 pl-5',\n className\n )}\n {...props}\n />\n ),\n ul: ({ className, ...props }) => (\n <ul\n className={cn('mt-5 flex flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n ol: ({ className, ...props }) => (\n <ol\n className={cn('mt-5 flex flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n li: ({ className, ...props }) => (\n <li className={cn('list-disc', className)} {...props} />\n ),\n img: ({ className, ...props }) => (\n <img\n {...props}\n loading=\"lazy\"\n className={cn('max-w-full rounded-md', className)}\n src={`${props.src}?raw=true`}\n />\n ),\n a: (props) => (\n <Link\n color=\"neutral\"\n isExternalLink={props.href?.startsWith('http')}\n underlined={true}\n locale={locale}\n {...props}\n />\n ),\n pre: (props) => props.children,\n table: ({ className, ...props }) => (\n <div className=\"grid w-full max-w-full overflow-auto rounded\">\n <table\n className={cn(\n 'max-w-full table-auto overflow-hidden text-left',\n className\n )}\n {...props}\n />\n </div>\n ),\n th: ({ className, ...props }) => (\n <th\n className={cn(\n 'border-neutral bg-neutral/10 border-b p-4',\n className\n )}\n {...props}\n />\n ),\n tr: ({ className, ...props }) => (\n <tr\n className={cn('hover:bg-neutral/10 hover:/10', className)}\n {...props}\n />\n ),\n td: ({ className, ...props }) => (\n <td\n className={cn('border-b border-neutral-500/50 p-4', className)}\n {...props}\n />\n ),\n ...overrides,\n },\n wrapper: ({ className, ...props }) => (\n <>\n <SectionScroller />\n <div\n className={cn('flex flex-col gap-8 p-10', className)}\n {...props}\n />\n </>\n ),\n ...restOptions,\n }}\n >\n {cleanMarkdown ?? ''}\n </Markdown>\n </CodeProvider>\n );\n};\n"],"names":["CodeProvider","jsx","H1","H2","H3","H4","Code","cn","Link","jsxs","Fragment","SectionScroller"],"mappings":";;;;;;;;;;AAsBA,MAAM,mBAAmB,CAAC,aAA6B;AAC/C,QAAA,QAAQ,SAAS,MAAM,OAAO;AAG9B,QAAA,oBAAoB,MAAM,KAAK,CAAC,SAAS,KAAK,WAAW,EAAE;AAEjE,MAAI,CAAC,qBAAqB,kBAAkB,KAAA,MAAW,OAAO;AAErD,WAAA;AAAA,EAAA;AAGT,MAAI,kBAAkB;AACtB,MAAI,qBAAqB;AAEzB,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,cAAc,MAAM,CAAC,EAAE,KAAK;AAGlC,QAAI,gBAAgB,OAAO;AACzB,UAAI,CAAC,iBAAiB;AAEF,0BAAA;AAClB;AAAA,MAAA,OACK;AAEgB,6BAAA;AACrB;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAGF,MAAI,qBAAqB,IAAI;AAE3B,WAAO,MAAM,MAAM,qBAAqB,CAAC,EAAE,KAAK,IAAI;AAAA,EAAA;AAI/C,SAAA;AACT;AAEO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,WAAW,GAAG,YAAY,IAAI,WAAW,CAAC;AAG5C,QAAA,gBAAgB,iBAAiB,QAAQ;AAE/C,w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C;AAAA,YAAA;AAAA,cACC,WAAWM,SAAAA,GAAG,sCAAsC,SAAS;AAAA,cAC5D,GAAG;AAAA,YAAA;AAAA,UACN;AAAA,UAEF,GAAG;AAAA,QACL;AAAA,QACA,SAAS,CAAC,EAAE,WAAW,GAAG,YAEtBE,gCAAAC,WAAAA,UAAA,EAAA,UAAA;AAAA,UAAAT,2BAAA,IAACU,mCAAgB,iBAAA,EAAA;AAAA,UACjBV,2BAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWM,SAAAA,GAAG,4BAA4B,SAAS;AAAA,cAClD,GAAG;AAAA,YAAA;AAAA,UAAA;AAAA,QACN,GACF;AAAA,QAEF,GAAG;AAAA,MACL;AAAA,MAEC,UAAiB,iBAAA;AAAA,IAAA;AAAA,EAAA,GAEtB;AAEJ;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LocalesValues } from '@intlayer/config/client';
|
|
2
2
|
import { MarkdownToJSX } from 'markdown-to-jsx';
|
|
3
3
|
import { FC } from 'react';
|
|
4
4
|
type MarkdownRendererProps = {
|
|
5
5
|
children: string;
|
|
6
6
|
isDarkMode?: boolean;
|
|
7
|
-
locale?:
|
|
7
|
+
locale?: LocalesValues;
|
|
8
8
|
options?: MarkdownToJSX.Options;
|
|
9
9
|
};
|
|
10
10
|
export declare const MarkdownRenderer: FC<MarkdownRendererProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MarkDownRender/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MarkDownRender/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAQhC,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC;CACjC,CAAC;AA+CF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA8HtD,CAAC"}
|
|
@@ -6,6 +6,31 @@ import { SectionScroller } from "../Headers/SectionScroller.mjs";
|
|
|
6
6
|
import { Code } from "../IDE/Code.mjs";
|
|
7
7
|
import { CodeProvider } from "../IDE/CodeContext.mjs";
|
|
8
8
|
import { Link } from "../Link/Link.mjs";
|
|
9
|
+
const stripFrontmatter = (markdown) => {
|
|
10
|
+
const lines = markdown.split(/\r?\n/);
|
|
11
|
+
const firstNonEmptyLine = lines.find((line) => line.trim() !== "");
|
|
12
|
+
if (!firstNonEmptyLine || firstNonEmptyLine.trim() !== "---") {
|
|
13
|
+
return markdown;
|
|
14
|
+
}
|
|
15
|
+
let inMetadataBlock = false;
|
|
16
|
+
let endOfMetadataIndex = -1;
|
|
17
|
+
for (let i = 0; i < lines.length; i++) {
|
|
18
|
+
const trimmedLine = lines[i].trim();
|
|
19
|
+
if (trimmedLine === "---") {
|
|
20
|
+
if (!inMetadataBlock) {
|
|
21
|
+
inMetadataBlock = true;
|
|
22
|
+
continue;
|
|
23
|
+
} else {
|
|
24
|
+
endOfMetadataIndex = i;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (endOfMetadataIndex > -1) {
|
|
30
|
+
return lines.slice(endOfMetadataIndex + 1).join("\n");
|
|
31
|
+
}
|
|
32
|
+
return markdown;
|
|
33
|
+
};
|
|
9
34
|
const MarkdownRenderer = ({
|
|
10
35
|
children,
|
|
11
36
|
isDarkMode,
|
|
@@ -13,6 +38,7 @@ const MarkdownRenderer = ({
|
|
|
13
38
|
options
|
|
14
39
|
}) => {
|
|
15
40
|
const { overrides, ...restOptions } = options ?? {};
|
|
41
|
+
const cleanMarkdown = stripFrontmatter(children);
|
|
16
42
|
return /* @__PURE__ */ jsx(CodeProvider, { children: /* @__PURE__ */ jsx(
|
|
17
43
|
Markdown,
|
|
18
44
|
{
|
|
@@ -123,7 +149,7 @@ const MarkdownRenderer = ({
|
|
|
123
149
|
] }),
|
|
124
150
|
...restOptions
|
|
125
151
|
},
|
|
126
|
-
children:
|
|
152
|
+
children: cleanMarkdown ?? ""
|
|
127
153
|
}
|
|
128
154
|
) });
|
|
129
155
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/components/MarkDownRender/index.tsx"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/MarkDownRender/index.tsx"],"sourcesContent":["import type { LocalesValues } from '@intlayer/config/client';\nimport Markdown, { type MarkdownToJSX } from 'markdown-to-jsx';\nimport type { FC } from 'react';\nimport { cn } from '../../utils/cn';\nimport { H1, H2, H3, H4 } from '../Headers';\nimport { SectionScroller } from '../Headers/SectionScroller';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\n\ntype MarkdownRendererProps = {\n children: string;\n isDarkMode?: boolean;\n locale?: LocalesValues;\n options?: MarkdownToJSX.Options;\n};\n\n/**\n * Removes frontmatter from markdown content\n * Frontmatter is the YAML metadata block at the beginning of markdown files\n * delimited by --- at the start and end\n */\nconst stripFrontmatter = (markdown: string): string => {\n const lines = markdown.split(/\\r?\\n/);\n\n // Check if the very first non-empty line is the metadata start delimiter\n const firstNonEmptyLine = lines.find((line) => line.trim() !== '');\n\n if (!firstNonEmptyLine || firstNonEmptyLine.trim() !== '---') {\n // No frontmatter, return original content\n return markdown;\n }\n\n let inMetadataBlock = false;\n let endOfMetadataIndex = -1;\n\n for (let i = 0; i < lines.length; i++) {\n const trimmedLine = lines[i].trim();\n\n // Toggle metadata block on encountering the delimiter\n if (trimmedLine === '---') {\n if (!inMetadataBlock) {\n // Begin metadata block\n inMetadataBlock = true;\n continue;\n } else {\n // End of metadata block\n endOfMetadataIndex = i;\n break;\n }\n }\n }\n\n if (endOfMetadataIndex > -1) {\n // Return content after the frontmatter\n return lines.slice(endOfMetadataIndex + 1).join('\\n');\n }\n\n // If we couldn't find the end delimiter, return original content\n return markdown;\n};\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n locale,\n options,\n}) => {\n const { overrides, ...restOptions } = options ?? {};\n\n // Strip frontmatter from the markdown content before rendering\n const cleanMarkdown = stripFrontmatter(children);\n\n return (\n <CodeProvider>\n <Markdown\n options={{\n overrides: {\n h1: (props) => <H1 isClickable={true} {...props} />,\n h2: (props) => <H2 isClickable={true} {...props} />,\n h3: (props) => <H3 isClickable={true} {...props} />,\n h4: (props) => <H4 isClickable={true} {...props} />,\n\n code: (props) =>\n typeof props.className === 'undefined' ? (\n <strong className=\"bg-card/60 rounded p-1 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur\">\n {props.children}\n </strong>\n ) : (\n <Code\n isDarkMode={isDarkMode}\n language={props.className?.replace('lang-', '')}\n {...props}\n />\n ),\n\n blockquote: ({ className, ...props }) => (\n <blockquote\n className={cn(\n 'border-card text-neutral mt-5 flex flex-col gap-3 border-l-4 pl-5',\n className\n )}\n {...props}\n />\n ),\n ul: ({ className, ...props }) => (\n <ul\n className={cn('mt-5 flex flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n ol: ({ className, ...props }) => (\n <ol\n className={cn('mt-5 flex flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n li: ({ className, ...props }) => (\n <li className={cn('list-disc', className)} {...props} />\n ),\n img: ({ className, ...props }) => (\n <img\n {...props}\n loading=\"lazy\"\n className={cn('max-w-full rounded-md', className)}\n src={`${props.src}?raw=true`}\n />\n ),\n a: (props) => (\n <Link\n color=\"neutral\"\n isExternalLink={props.href?.startsWith('http')}\n underlined={true}\n locale={locale}\n {...props}\n />\n ),\n pre: (props) => props.children,\n table: ({ className, ...props }) => (\n <div className=\"grid w-full max-w-full overflow-auto rounded\">\n <table\n className={cn(\n 'max-w-full table-auto overflow-hidden text-left',\n className\n )}\n {...props}\n />\n </div>\n ),\n th: ({ className, ...props }) => (\n <th\n className={cn(\n 'border-neutral bg-neutral/10 border-b p-4',\n className\n )}\n {...props}\n />\n ),\n tr: ({ className, ...props }) => (\n <tr\n className={cn('hover:bg-neutral/10 hover:/10', className)}\n {...props}\n />\n ),\n td: ({ className, ...props }) => (\n <td\n className={cn('border-b border-neutral-500/50 p-4', className)}\n {...props}\n />\n ),\n ...overrides,\n },\n wrapper: ({ className, ...props }) => (\n <>\n <SectionScroller />\n <div\n className={cn('flex flex-col gap-8 p-10', className)}\n {...props}\n />\n </>\n ),\n ...restOptions,\n }}\n >\n {cleanMarkdown ?? ''}\n </Markdown>\n </CodeProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAsBA,MAAM,mBAAmB,CAAC,aAA6B;AAC/C,QAAA,QAAQ,SAAS,MAAM,OAAO;AAG9B,QAAA,oBAAoB,MAAM,KAAK,CAAC,SAAS,KAAK,WAAW,EAAE;AAEjE,MAAI,CAAC,qBAAqB,kBAAkB,KAAA,MAAW,OAAO;AAErD,WAAA;AAAA,EAAA;AAGT,MAAI,kBAAkB;AACtB,MAAI,qBAAqB;AAEzB,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,cAAc,MAAM,CAAC,EAAE,KAAK;AAGlC,QAAI,gBAAgB,OAAO;AACzB,UAAI,CAAC,iBAAiB;AAEF,0BAAA;AAClB;AAAA,MAAA,OACK;AAEgB,6BAAA;AACrB;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAGF,MAAI,qBAAqB,IAAI;AAE3B,WAAO,MAAM,MAAM,qBAAq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YAAC;AAAA,YAAA;AAAA,cACC,WAAW,GAAG,sCAAsC,SAAS;AAAA,cAC5D,GAAG;AAAA,YAAA;AAAA,UACN;AAAA,UAEF,GAAG;AAAA,QACL;AAAA,QACA,SAAS,CAAC,EAAE,WAAW,GAAG,YAEtB,qBAAA,UAAA,EAAA,UAAA;AAAA,UAAA,oBAAC,iBAAgB,EAAA;AAAA,UACjB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,GAAG,4BAA4B,SAAS;AAAA,cAClD,GAAG;AAAA,YAAA;AAAA,UAAA;AAAA,QACN,GACF;AAAA,QAEF,GAAG;AAAA,MACL;AAAA,MAEC,UAAiB,iBAAA;AAAA,IAAA;AAAA,EAAA,GAEtB;AAEJ;"}
|
|
@@ -6,15 +6,15 @@ const classVarianceAuthority = require("class-variance-authority");
|
|
|
6
6
|
const framerMotion = require("framer-motion");
|
|
7
7
|
const lucideReact = require("lucide-react");
|
|
8
8
|
const reactDom = require("react-dom");
|
|
9
|
-
require("react");
|
|
10
|
-
const hooks_useGetElementOrWindow = require("../../hooks/useGetElementOrWindow.cjs");
|
|
11
|
-
const hooks_useScrollBlockage_index = require("../../index-BYzBot7l.cjs");
|
|
12
|
-
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
13
9
|
require("@intlayer/editor-react");
|
|
14
10
|
require("@intlayer/api");
|
|
15
11
|
require("@intlayer/config/built");
|
|
12
|
+
require("react");
|
|
13
|
+
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
16
14
|
require("../Toaster/Toast.cjs");
|
|
17
15
|
require("deepmerge");
|
|
16
|
+
const hooks_useGetElementOrWindow = require("../../hooks/useGetElementOrWindow.cjs");
|
|
17
|
+
const hooks_useScrollBlockage_index = require("../../index-BYzBot7l.cjs");
|
|
18
18
|
const utils_cn = require("../../utils/cn.cjs");
|
|
19
19
|
const components_Button_Button = require("../Button/Button.cjs");
|
|
20
20
|
const components_Container_index = require("../Container/index.cjs");
|
|
@@ -4,15 +4,15 @@ import { cva } from "class-variance-authority";
|
|
|
4
4
|
import { motion } from "framer-motion";
|
|
5
5
|
import { X } from "lucide-react";
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
7
|
-
import "react";
|
|
8
|
-
import { useGetElementOrWindow } from "../../hooks/useGetElementOrWindow.mjs";
|
|
9
|
-
import { u as useScrollBlockage } from "../../index-BCuMWKyy.js";
|
|
10
|
-
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
11
7
|
import "@intlayer/editor-react";
|
|
12
8
|
import "@intlayer/api";
|
|
13
9
|
import "@intlayer/config/built";
|
|
10
|
+
import "react";
|
|
11
|
+
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
14
12
|
import "../Toaster/Toast.mjs";
|
|
15
13
|
import "deepmerge";
|
|
14
|
+
import { useGetElementOrWindow } from "../../hooks/useGetElementOrWindow.mjs";
|
|
15
|
+
import { u as useScrollBlockage } from "../../index-BCuMWKyy.js";
|
|
16
16
|
import { cn } from "../../utils/cn.mjs";
|
|
17
17
|
import { Button } from "../Button/Button.mjs";
|
|
18
18
|
import { Container } from "../Container/index.mjs";
|
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const framerMotion = require("framer-motion");
|
|
6
6
|
const ReactExports = require("react");
|
|
7
|
-
const hooks_useScrollBlockage_index = require("../../index-BYzBot7l.cjs");
|
|
8
|
-
const hooks_useScrollDetection = require("../../hooks/useScrollDetection.cjs");
|
|
9
|
-
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
10
7
|
require("@intlayer/editor-react");
|
|
11
8
|
require("@intlayer/api");
|
|
12
9
|
require("@intlayer/config/built");
|
|
10
|
+
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
13
11
|
require("../Toaster/Toast.cjs");
|
|
14
12
|
require("deepmerge");
|
|
13
|
+
const hooks_useScrollBlockage_index = require("../../index-BYzBot7l.cjs");
|
|
14
|
+
const hooks_useScrollDetection = require("../../hooks/useScrollDetection.cjs");
|
|
15
15
|
const utils_cn = require("../../utils/cn.cjs");
|
|
16
16
|
const components_MaxHeightSmoother_index = require("../MaxHeightSmoother/index.cjs");
|
|
17
17
|
const components_Navbar_Burger = require("./Burger.cjs");
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { m } from "framer-motion";
|
|
4
4
|
import { useState, useRef } from "react";
|
|
5
|
-
import { u as useScrollBlockage } from "../../index-BCuMWKyy.js";
|
|
6
|
-
import { useScrollDetection } from "../../hooks/useScrollDetection.mjs";
|
|
7
|
-
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
8
5
|
import "@intlayer/editor-react";
|
|
9
6
|
import "@intlayer/api";
|
|
10
7
|
import "@intlayer/config/built";
|
|
8
|
+
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
11
9
|
import "../Toaster/Toast.mjs";
|
|
12
10
|
import "deepmerge";
|
|
11
|
+
import { u as useScrollBlockage } from "../../index-BCuMWKyy.js";
|
|
12
|
+
import { useScrollDetection } from "../../hooks/useScrollDetection.mjs";
|
|
13
13
|
import { cn } from "../../utils/cn.mjs";
|
|
14
14
|
import { MaxHeightSmoother } from "../MaxHeightSmoother/index.mjs";
|
|
15
15
|
import { Burger } from "./Burger.mjs";
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const hooks_useDevice = require("../../hooks/useDevice.cjs");
|
|
6
|
-
require("react");
|
|
7
|
-
require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
8
|
-
const hooks_useIsMounted = require("../../hooks/useIsMounted.cjs");
|
|
9
|
-
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
10
5
|
require("@intlayer/editor-react");
|
|
11
6
|
require("@intlayer/api");
|
|
12
7
|
require("@intlayer/config/built");
|
|
8
|
+
require("react");
|
|
9
|
+
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
13
10
|
require("../Toaster/Toast.cjs");
|
|
11
|
+
const hooks_useDevice = require("../../hooks/useDevice.cjs");
|
|
14
12
|
require("deepmerge");
|
|
13
|
+
const hooks_useIsMounted = require("../../hooks/useIsMounted.cjs");
|
|
14
|
+
require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
15
15
|
const components_Navbar_DesktopNavbar = require("./DesktopNavbar.cjs");
|
|
16
16
|
const components_Navbar_MobileNavbar = require("./MobileNavbar.cjs");
|
|
17
17
|
const Navbar = ({
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useDevice } from "../../hooks/useDevice.mjs";
|
|
4
|
-
import "react";
|
|
5
|
-
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
6
|
-
import { useIsMounted } from "../../hooks/useIsMounted.mjs";
|
|
7
|
-
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
8
3
|
import "@intlayer/editor-react";
|
|
9
4
|
import "@intlayer/api";
|
|
10
5
|
import "@intlayer/config/built";
|
|
6
|
+
import "react";
|
|
7
|
+
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
11
8
|
import "../Toaster/Toast.mjs";
|
|
9
|
+
import { useDevice } from "../../hooks/useDevice.mjs";
|
|
12
10
|
import "deepmerge";
|
|
11
|
+
import { useIsMounted } from "../../hooks/useIsMounted.mjs";
|
|
12
|
+
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
13
13
|
import { DesktopNavbar } from "./DesktopNavbar.mjs";
|
|
14
14
|
import { MobileNavbar } from "./MobileNavbar.mjs";
|
|
15
15
|
const Navbar = ({
|
|
@@ -1,25 +1,69 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const
|
|
4
|
+
const utils_cn = require("../../utils/cn.cjs");
|
|
5
|
+
const components_Container_index = require("../Container/index.cjs");
|
|
6
|
+
const Popover = ({
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
identifier,
|
|
10
|
+
...props
|
|
11
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5
12
|
"div",
|
|
6
13
|
{
|
|
7
|
-
className: "group relative",
|
|
14
|
+
className: utils_cn.cn("group/popover relative flex cursor-pointer", className),
|
|
15
|
+
"aria-label": `Popover ${identifier}`,
|
|
16
|
+
id: `unrollable-panel-button-${identifier}`,
|
|
8
17
|
"aria-haspopup": true,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
children: [
|
|
12
|
-
children,
|
|
13
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14
|
-
"div",
|
|
15
|
-
{
|
|
16
|
-
className: "bg-card absolute bottom-0 left-5 z-50 translate-y-[150%] rounded-md p-1 text-xs text-opacity-75 opacity-0 ring-2 ring-current transition-all delay-200 duration-200 ease-in-out hover:delay-0 group-hover:opacity-100",
|
|
17
|
-
"aria-hidden": true,
|
|
18
|
-
children: content
|
|
19
|
-
}
|
|
20
|
-
)
|
|
21
|
-
]
|
|
18
|
+
...props,
|
|
19
|
+
children
|
|
22
20
|
}
|
|
23
21
|
);
|
|
22
|
+
const Detail = ({
|
|
23
|
+
children,
|
|
24
|
+
isHidden = void 0,
|
|
25
|
+
isOverable = true,
|
|
26
|
+
isFocusable = false,
|
|
27
|
+
xAlign = "start",
|
|
28
|
+
yAlign = "bellow",
|
|
29
|
+
identifier,
|
|
30
|
+
className,
|
|
31
|
+
displayArrow = true,
|
|
32
|
+
...props
|
|
33
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
34
|
+
components_Container_index.Container,
|
|
35
|
+
{
|
|
36
|
+
transparency: "sm",
|
|
37
|
+
"aria-hidden": isHidden,
|
|
38
|
+
"aria-labelledby": `unrollable-panel-button-${identifier}`,
|
|
39
|
+
id: `unrollable-panel-${identifier}`,
|
|
40
|
+
className: utils_cn.cn(
|
|
41
|
+
"absolute z-[1000] min-w-full ring-neutral ring-1 rounded-md",
|
|
42
|
+
/* Positioning */
|
|
43
|
+
xAlign === "start" && "left-0",
|
|
44
|
+
xAlign === "end" && "right-0",
|
|
45
|
+
yAlign === "bellow" && "top-[calc(100%+1rem)]",
|
|
46
|
+
yAlign === "above" && "bottom-[calc(100%+1rem)]",
|
|
47
|
+
/* Arrow indicator */
|
|
48
|
+
displayArrow && 'before:absolute before:z-[999] before:content-[""] before:w-0 before:h-0',
|
|
49
|
+
/* Horizontal positioning */
|
|
50
|
+
displayArrow && xAlign === "start" && "before:left-2",
|
|
51
|
+
displayArrow && xAlign === "end" && "before:right-2",
|
|
52
|
+
/* Arrow pointing up (when popover is below trigger) */
|
|
53
|
+
displayArrow && yAlign === "bellow" && "before:-top-[10px] before:border-l-[10px] before:border-l-transparent before:border-r-[10px] before:border-r-transparent before:border-b-[10px] before:border-b-neutral",
|
|
54
|
+
/* Arrow pointing down (when popover is above trigger) */
|
|
55
|
+
displayArrow && yAlign === "above" && "before:-bottom-[10px] before:border-l-[10px] before:border-l-transparent before:border-r-[10px] before:border-r-transparent before:border-t-[10px] before:border-t-neutral",
|
|
56
|
+
/* Visibility management */
|
|
57
|
+
"overflow-x-visible transition-all duration-400 ease-in-out opacity-0",
|
|
58
|
+
isHidden !== false ? "invisible" : "delay-800 visible opacity-100",
|
|
59
|
+
isOverable && "group-hover/popover:visible group-hover/popover:opacity-100 group-hover/popover:delay-800",
|
|
60
|
+
isFocusable && "group-focus-within/popover:visible group-focus-within/popover:opacity-100 group-focus-within/popover:delay-800",
|
|
61
|
+
className
|
|
62
|
+
),
|
|
63
|
+
...props,
|
|
64
|
+
children
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
Popover.Detail = Detail;
|
|
24
68
|
exports.Popover = Popover;
|
|
25
69
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/Popover/index.tsx"],"sourcesContent":["import type { FC,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/Popover/index.tsx"],"sourcesContent":["import type { DetailedHTMLProps, FC, HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Container } from '../Container';\n\nexport type PopoverProps = DetailedHTMLProps<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n> & {\n identifier: string;\n};\n\nexport type PopoverType = FC<PopoverProps> & {\n Detail: FC<DetailProps>;\n};\n\n/**\n * Trigger allowing to open a popover menu.\n *\n * Example:\n * ```jsx\n * <Popover identifier=\"popover\">\n * Open popover\n *\n * <Popover.Detail identifier=\"popover\">\n * <div>Content</div>\n * </Popover.Detail>\n * </Popover>\n * ```\n *\n * > Note Popover.Trigger can be replaced by a button. Don't add a button inside the trigger.\n */\nexport const Popover: PopoverType = ({\n children,\n className,\n identifier,\n ...props\n}) => (\n <div\n className={cn('group/popover relative flex cursor-pointer', className)}\n aria-label={`Popover ${identifier}`}\n id={`unrollable-panel-button-${identifier}`}\n aria-haspopup\n {...props}\n >\n {children}\n </div>\n);\n\nexport type DetailProps = HTMLAttributes<HTMLDivElement> & {\n isFocusable?: boolean;\n isHidden?: boolean;\n isOverable?: boolean;\n identifier: string;\n xAlign?: 'start' | 'end';\n yAlign?: 'bellow' | 'above';\n displayArrow?: boolean;\n};\n\n/**\n * Component that opens a popover menu when the trigger is clicked.\n *\n * Example:\n * ```jsx\n * <Popover.Detail identifier=\"popover\">\n * <div>Content</div>\n * </Popover.Detail>\n * ```\n */\nconst Detail: FC<DetailProps> = ({\n children,\n isHidden = undefined,\n isOverable = true,\n isFocusable = false,\n xAlign = 'start',\n yAlign = 'bellow',\n identifier,\n className,\n displayArrow = true,\n ...props\n}) => (\n <Container\n transparency=\"sm\"\n aria-hidden={isHidden}\n aria-labelledby={`unrollable-panel-button-${identifier}`}\n id={`unrollable-panel-${identifier}`}\n className={cn(\n 'absolute z-[1000] min-w-full ring-neutral ring-1 rounded-md',\n\n /* Positioning */\n xAlign === 'start' && 'left-0',\n xAlign === 'end' && 'right-0',\n yAlign === 'bellow' && 'top-[calc(100%+1rem)]',\n yAlign === 'above' && 'bottom-[calc(100%+1rem)]',\n\n /* Arrow indicator */\n displayArrow &&\n 'before:absolute before:z-[999] before:content-[\"\"] before:w-0 before:h-0',\n\n /* Horizontal positioning */\n displayArrow && xAlign === 'start' && 'before:left-2',\n displayArrow && xAlign === 'end' && 'before:right-2',\n\n /* Arrow pointing up (when popover is below trigger) */\n displayArrow &&\n yAlign === 'bellow' &&\n 'before:-top-[10px] before:border-l-[10px] before:border-l-transparent before:border-r-[10px] before:border-r-transparent before:border-b-[10px] before:border-b-neutral',\n\n /* Arrow pointing down (when popover is above trigger) */\n displayArrow &&\n yAlign === 'above' &&\n 'before:-bottom-[10px] before:border-l-[10px] before:border-l-transparent before:border-r-[10px] before:border-r-transparent before:border-t-[10px] before:border-t-neutral',\n\n /* Visibility management */\n 'overflow-x-visible transition-all duration-400 ease-in-out opacity-0',\n isHidden !== false ? 'invisible' : 'delay-800 visible opacity-100',\n isOverable &&\n 'group-hover/popover:visible group-hover/popover:opacity-100 group-hover/popover:delay-800',\n isFocusable &&\n 'group-focus-within/popover:visible group-focus-within/popover:opacity-100 group-focus-within/popover:delay-800',\n className\n )}\n {...props}\n >\n {children}\n </Container>\n);\n\nPopover.Detail = Detail;\n"],"names":["jsx","cn","Container"],"mappings":";;;;;AA+BO,MAAM,UAAuB,CAAC;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACEA,2BAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,SAAAA,GAAG,8CAA8C,SAAS;AAAA,IACrE,cAAY,WAAW,UAAU;AAAA,IACjC,IAAI,2BAA2B,UAAU;AAAA,IACzC,iBAAa;AAAA,IACZ,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;AAuBF,MAAM,SAA0B,CAAC;AAAA,EAC/B;AAAA,EACA,WAAW;AAAA,EACX,aAAa;AAAA,EACb,cAAc;AAAA,EACd,SAAS;AAAA,EACT,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,GAAG;AACL,MACED,2BAAA;AAAA,EAACE,2BAAA;AAAA,EAAA;AAAA,IACC,cAAa;AAAA,IACb,eAAa;AAAA,IACb,mBAAiB,2BAA2B,UAAU;AAAA,IACtD,IAAI,oBAAoB,UAAU;AAAA,IAClC,WAAWD,SAAA;AAAA,MACT;AAAA;AAAA,MAGA,WAAW,WAAW;AAAA,MACtB,WAAW,SAAS;AAAA,MACpB,WAAW,YAAY;AAAA,MACvB,WAAW,WAAW;AAAA;AAAA,MAGtB,gBACE;AAAA;AAAA,MAGF,gBAAgB,WAAW,WAAW;AAAA,MACtC,gBAAgB,WAAW,SAAS;AAAA;AAAA,MAGpC,gBACE,WAAW,YACX;AAAA;AAAA,MAGF,gBACE,WAAW,WACX;AAAA;AAAA,MAGF;AAAA,MACA,aAAa,QAAQ,cAAc;AAAA,MACnC,cACE;AAAA,MACF,eACE;AAAA,MACF;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;AAGF,QAAQ,SAAS;;"}
|
|
@@ -1,8 +1,34 @@
|
|
|
1
|
-
import { FC,
|
|
2
|
-
type PopoverProps = {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { DetailedHTMLProps, FC, HTMLAttributes } from 'react';
|
|
2
|
+
export type PopoverProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
|
3
|
+
identifier: string;
|
|
4
|
+
};
|
|
5
|
+
export type PopoverType = FC<PopoverProps> & {
|
|
6
|
+
Detail: FC<DetailProps>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Trigger allowing to open a popover menu.
|
|
10
|
+
*
|
|
11
|
+
* Example:
|
|
12
|
+
* ```jsx
|
|
13
|
+
* <Popover identifier="popover">
|
|
14
|
+
* Open popover
|
|
15
|
+
*
|
|
16
|
+
* <Popover.Detail identifier="popover">
|
|
17
|
+
* <div>Content</div>
|
|
18
|
+
* </Popover.Detail>
|
|
19
|
+
* </Popover>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* > Note Popover.Trigger can be replaced by a button. Don't add a button inside the trigger.
|
|
23
|
+
*/
|
|
24
|
+
export declare const Popover: PopoverType;
|
|
25
|
+
export type DetailProps = HTMLAttributes<HTMLDivElement> & {
|
|
26
|
+
isFocusable?: boolean;
|
|
27
|
+
isHidden?: boolean;
|
|
28
|
+
isOverable?: boolean;
|
|
29
|
+
identifier: string;
|
|
30
|
+
xAlign?: 'start' | 'end';
|
|
31
|
+
yAlign?: 'bellow' | 'above';
|
|
32
|
+
displayArrow?: boolean;
|
|
5
33
|
};
|
|
6
|
-
export declare const Popover: FC<PopoverProps>;
|
|
7
|
-
export {};
|
|
8
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAInE,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAC1C,cAAc,CAAC,cAAc,CAAC,EAC9B,cAAc,CACf,GAAG;IACF,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG;IAC3C,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO,EAAE,WAerB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACzD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACzB,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC"}
|
|
@@ -1,24 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../utils/cn.mjs";
|
|
3
|
+
import { Container } from "../Container/index.mjs";
|
|
4
|
+
const Popover = ({
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
identifier,
|
|
8
|
+
...props
|
|
9
|
+
}) => /* @__PURE__ */ jsx(
|
|
3
10
|
"div",
|
|
4
11
|
{
|
|
5
|
-
className: "group relative",
|
|
12
|
+
className: cn("group/popover relative flex cursor-pointer", className),
|
|
13
|
+
"aria-label": `Popover ${identifier}`,
|
|
14
|
+
id: `unrollable-panel-button-${identifier}`,
|
|
6
15
|
"aria-haspopup": true,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
children: [
|
|
10
|
-
children,
|
|
11
|
-
/* @__PURE__ */ jsx(
|
|
12
|
-
"div",
|
|
13
|
-
{
|
|
14
|
-
className: "bg-card absolute bottom-0 left-5 z-50 translate-y-[150%] rounded-md p-1 text-xs text-opacity-75 opacity-0 ring-2 ring-current transition-all delay-200 duration-200 ease-in-out hover:delay-0 group-hover:opacity-100",
|
|
15
|
-
"aria-hidden": true,
|
|
16
|
-
children: content
|
|
17
|
-
}
|
|
18
|
-
)
|
|
19
|
-
]
|
|
16
|
+
...props,
|
|
17
|
+
children
|
|
20
18
|
}
|
|
21
19
|
);
|
|
20
|
+
const Detail = ({
|
|
21
|
+
children,
|
|
22
|
+
isHidden = void 0,
|
|
23
|
+
isOverable = true,
|
|
24
|
+
isFocusable = false,
|
|
25
|
+
xAlign = "start",
|
|
26
|
+
yAlign = "bellow",
|
|
27
|
+
identifier,
|
|
28
|
+
className,
|
|
29
|
+
displayArrow = true,
|
|
30
|
+
...props
|
|
31
|
+
}) => /* @__PURE__ */ jsx(
|
|
32
|
+
Container,
|
|
33
|
+
{
|
|
34
|
+
transparency: "sm",
|
|
35
|
+
"aria-hidden": isHidden,
|
|
36
|
+
"aria-labelledby": `unrollable-panel-button-${identifier}`,
|
|
37
|
+
id: `unrollable-panel-${identifier}`,
|
|
38
|
+
className: cn(
|
|
39
|
+
"absolute z-[1000] min-w-full ring-neutral ring-1 rounded-md",
|
|
40
|
+
/* Positioning */
|
|
41
|
+
xAlign === "start" && "left-0",
|
|
42
|
+
xAlign === "end" && "right-0",
|
|
43
|
+
yAlign === "bellow" && "top-[calc(100%+1rem)]",
|
|
44
|
+
yAlign === "above" && "bottom-[calc(100%+1rem)]",
|
|
45
|
+
/* Arrow indicator */
|
|
46
|
+
displayArrow && 'before:absolute before:z-[999] before:content-[""] before:w-0 before:h-0',
|
|
47
|
+
/* Horizontal positioning */
|
|
48
|
+
displayArrow && xAlign === "start" && "before:left-2",
|
|
49
|
+
displayArrow && xAlign === "end" && "before:right-2",
|
|
50
|
+
/* Arrow pointing up (when popover is below trigger) */
|
|
51
|
+
displayArrow && yAlign === "bellow" && "before:-top-[10px] before:border-l-[10px] before:border-l-transparent before:border-r-[10px] before:border-r-transparent before:border-b-[10px] before:border-b-neutral",
|
|
52
|
+
/* Arrow pointing down (when popover is above trigger) */
|
|
53
|
+
displayArrow && yAlign === "above" && "before:-bottom-[10px] before:border-l-[10px] before:border-l-transparent before:border-r-[10px] before:border-r-transparent before:border-t-[10px] before:border-t-neutral",
|
|
54
|
+
/* Visibility management */
|
|
55
|
+
"overflow-x-visible transition-all duration-400 ease-in-out opacity-0",
|
|
56
|
+
isHidden !== false ? "invisible" : "delay-800 visible opacity-100",
|
|
57
|
+
isOverable && "group-hover/popover:visible group-hover/popover:opacity-100 group-hover/popover:delay-800",
|
|
58
|
+
isFocusable && "group-focus-within/popover:visible group-focus-within/popover:opacity-100 group-focus-within/popover:delay-800",
|
|
59
|
+
className
|
|
60
|
+
),
|
|
61
|
+
...props,
|
|
62
|
+
children
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
Popover.Detail = Detail;
|
|
22
66
|
export {
|
|
23
67
|
Popover
|
|
24
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/components/Popover/index.tsx"],"sourcesContent":["import type { FC,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/Popover/index.tsx"],"sourcesContent":["import type { DetailedHTMLProps, FC, HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Container } from '../Container';\n\nexport type PopoverProps = DetailedHTMLProps<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n> & {\n identifier: string;\n};\n\nexport type PopoverType = FC<PopoverProps> & {\n Detail: FC<DetailProps>;\n};\n\n/**\n * Trigger allowing to open a popover menu.\n *\n * Example:\n * ```jsx\n * <Popover identifier=\"popover\">\n * Open popover\n *\n * <Popover.Detail identifier=\"popover\">\n * <div>Content</div>\n * </Popover.Detail>\n * </Popover>\n * ```\n *\n * > Note Popover.Trigger can be replaced by a button. Don't add a button inside the trigger.\n */\nexport const Popover: PopoverType = ({\n children,\n className,\n identifier,\n ...props\n}) => (\n <div\n className={cn('group/popover relative flex cursor-pointer', className)}\n aria-label={`Popover ${identifier}`}\n id={`unrollable-panel-button-${identifier}`}\n aria-haspopup\n {...props}\n >\n {children}\n </div>\n);\n\nexport type DetailProps = HTMLAttributes<HTMLDivElement> & {\n isFocusable?: boolean;\n isHidden?: boolean;\n isOverable?: boolean;\n identifier: string;\n xAlign?: 'start' | 'end';\n yAlign?: 'bellow' | 'above';\n displayArrow?: boolean;\n};\n\n/**\n * Component that opens a popover menu when the trigger is clicked.\n *\n * Example:\n * ```jsx\n * <Popover.Detail identifier=\"popover\">\n * <div>Content</div>\n * </Popover.Detail>\n * ```\n */\nconst Detail: FC<DetailProps> = ({\n children,\n isHidden = undefined,\n isOverable = true,\n isFocusable = false,\n xAlign = 'start',\n yAlign = 'bellow',\n identifier,\n className,\n displayArrow = true,\n ...props\n}) => (\n <Container\n transparency=\"sm\"\n aria-hidden={isHidden}\n aria-labelledby={`unrollable-panel-button-${identifier}`}\n id={`unrollable-panel-${identifier}`}\n className={cn(\n 'absolute z-[1000] min-w-full ring-neutral ring-1 rounded-md',\n\n /* Positioning */\n xAlign === 'start' && 'left-0',\n xAlign === 'end' && 'right-0',\n yAlign === 'bellow' && 'top-[calc(100%+1rem)]',\n yAlign === 'above' && 'bottom-[calc(100%+1rem)]',\n\n /* Arrow indicator */\n displayArrow &&\n 'before:absolute before:z-[999] before:content-[\"\"] before:w-0 before:h-0',\n\n /* Horizontal positioning */\n displayArrow && xAlign === 'start' && 'before:left-2',\n displayArrow && xAlign === 'end' && 'before:right-2',\n\n /* Arrow pointing up (when popover is below trigger) */\n displayArrow &&\n yAlign === 'bellow' &&\n 'before:-top-[10px] before:border-l-[10px] before:border-l-transparent before:border-r-[10px] before:border-r-transparent before:border-b-[10px] before:border-b-neutral',\n\n /* Arrow pointing down (when popover is above trigger) */\n displayArrow &&\n yAlign === 'above' &&\n 'before:-bottom-[10px] before:border-l-[10px] before:border-l-transparent before:border-r-[10px] before:border-r-transparent before:border-t-[10px] before:border-t-neutral',\n\n /* Visibility management */\n 'overflow-x-visible transition-all duration-400 ease-in-out opacity-0',\n isHidden !== false ? 'invisible' : 'delay-800 visible opacity-100',\n isOverable &&\n 'group-hover/popover:visible group-hover/popover:opacity-100 group-hover/popover:delay-800',\n isFocusable &&\n 'group-focus-within/popover:visible group-focus-within/popover:opacity-100 group-focus-within/popover:delay-800',\n className\n )}\n {...props}\n >\n {children}\n </Container>\n);\n\nPopover.Detail = Detail;\n"],"names":[],"mappings":";;;AA+BO,MAAM,UAAuB,CAAC;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,8CAA8C,SAAS;AAAA,IACrE,cAAY,WAAW,UAAU;AAAA,IACjC,IAAI,2BAA2B,UAAU;AAAA,IACzC,iBAAa;AAAA,IACZ,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;AAuBF,MAAM,SAA0B,CAAC;AAAA,EAC/B;AAAA,EACA,WAAW;AAAA,EACX,aAAa;AAAA,EACb,cAAc;AAAA,EACd,SAAS;AAAA,EACT,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,cAAa;AAAA,IACb,eAAa;AAAA,IACb,mBAAiB,2BAA2B,UAAU;AAAA,IACtD,IAAI,oBAAoB,UAAU;AAAA,IAClC,WAAW;AAAA,MACT;AAAA;AAAA,MAGA,WAAW,WAAW;AAAA,MACtB,WAAW,SAAS;AAAA,MACpB,WAAW,YAAY;AAAA,MACvB,WAAW,WAAW;AAAA;AAAA,MAGtB,gBACE;AAAA;AAAA,MAGF,gBAAgB,WAAW,WAAW;AAAA,MACtC,gBAAgB,WAAW,SAAS;AAAA;AAAA,MAGpC,gBACE,WAAW,YACX;AAAA;AAAA,MAGF,gBACE,WAAW,WACX;AAAA;AAAA,MAGF;AAAA,MACA,aAAa,QAAQ,cAAc;AAAA,MACnC,cACE;AAAA,MACF,eACE;AAAA,MACF;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;AAGF,QAAQ,SAAS;"}
|
|
@@ -36,7 +36,7 @@ const socialNetworks = [
|
|
|
36
36
|
label: "TikTok"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
href: "https://www.instagram.com/
|
|
39
|
+
href: "https://www.instagram.com/intlayer/",
|
|
40
40
|
component: /* @__PURE__ */ jsxRuntime.jsx(components_SocialNetworks_InstagramLogo.InstagramLogo, { className: "max-w-full max-h-full h-auto" }),
|
|
41
41
|
label: "Instagram"
|
|
42
42
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/SocialNetworks/index.tsx"],"sourcesContent":["import { AnchorHTMLAttributes, DetailedHTMLProps, FC, ReactNode } from 'react';\nimport { FacebookLogo } from './FacebookLogo';\nimport { InstagramLogo } from './InstagramLogo';\nimport { LinkedInLogo } from './LinkedInLogo';\nimport { ProductHuntLogo } from './ProductHuntLogo';\nimport { TiktokLogo } from './TiktokLogo';\nimport { XLogo } from './XLogo';\nimport { YoutubeLogo } from './YoutubeLogo';\n\nconst socialNetworks = [\n {\n href: 'https://www.producthunt.com/posts/intlayer?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-intlayer',\n component: <ProductHuntLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'Product Hunt',\n },\n {\n href: 'https://x.com/Intlayer183096',\n component: <XLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'X',\n },\n {\n href: 'https://www.youtube.com/@intlayer',\n component: <YoutubeLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'YouTube',\n },\n {\n href: 'https://www.linkedin.com/company/intlayerorg',\n component: <LinkedInLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'LinkedIn',\n },\n {\n href: 'https://www.tiktok.com/@intlayer',\n component: <TiktokLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'TikTok',\n },\n {\n href: 'https://www.instagram.com/
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/SocialNetworks/index.tsx"],"sourcesContent":["import { AnchorHTMLAttributes, DetailedHTMLProps, FC, ReactNode } from 'react';\nimport { FacebookLogo } from './FacebookLogo';\nimport { InstagramLogo } from './InstagramLogo';\nimport { LinkedInLogo } from './LinkedInLogo';\nimport { ProductHuntLogo } from './ProductHuntLogo';\nimport { TiktokLogo } from './TiktokLogo';\nimport { XLogo } from './XLogo';\nimport { YoutubeLogo } from './YoutubeLogo';\n\nconst socialNetworks = [\n {\n href: 'https://www.producthunt.com/posts/intlayer?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-intlayer',\n component: <ProductHuntLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'Product Hunt',\n },\n {\n href: 'https://x.com/Intlayer183096',\n component: <XLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'X',\n },\n {\n href: 'https://www.youtube.com/@intlayer',\n component: <YoutubeLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'YouTube',\n },\n {\n href: 'https://www.linkedin.com/company/intlayerorg',\n component: <LinkedInLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'LinkedIn',\n },\n {\n href: 'https://www.tiktok.com/@intlayer',\n component: <TiktokLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'TikTok',\n },\n {\n href: 'https://www.instagram.com/intlayer/',\n component: <InstagramLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'Instagram',\n },\n {\n href: 'https://www.facebook.com/intlayer',\n component: <FacebookLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'Facebook',\n },\n];\n\ntype SocialNetworksProps = {\n renderItem?: (item: (typeof socialNetworks)[number]) => ReactNode;\n} & DetailedHTMLProps<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n HTMLAnchorElement\n>;\n\ntype DefaultRenderItemProps = DetailedHTMLProps<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n HTMLAnchorElement\n> & {\n component: ReactNode;\n label: string;\n};\n\nconst DefaultRenderItem: FC<DefaultRenderItemProps> = ({\n href,\n component,\n label,\n ...iconProps\n}) => (\n <a\n key={href}\n href={href}\n aria-label={label}\n className=\"max-w-4 max-h-4\"\n {...iconProps}\n >\n {component}\n </a>\n);\n\nexport const SocialNetworks = ({\n renderItem,\n ...iconProps\n}: SocialNetworksProps) =>\n socialNetworks.map(\n renderItem ??\n ((props) => (\n <DefaultRenderItem {...props} {...iconProps} key={props.label} />\n ))\n );\n\nexport * from './FacebookLogo';\nexport * from './InstagramLogo';\nexport * from './LinkedInLogo';\nexport * from './ProductHuntLogo';\nexport * from './TiktokLogo';\nexport * from './XLogo';\nexport * from './YoutubeLogo';\n"],"names":["jsx","ProductHuntLogo","XLogo","YoutubeLogo","LinkedInLogo","TiktokLogo","InstagramLogo","FacebookLogo","createElement"],"mappings":";;;;;;;;;;;AASA,MAAM,iBAAiB;AAAA,EACrB;AAAA,IACE,MAAM;AAAA,IACN,WAAWA,2BAAAA,IAACC,0CAAAA,iBAAgB,EAAA,WAAU,+BAA+B,CAAA;AAAA,IACrE,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,WAAWD,2BAAAA,IAACE,gCAAAA,OAAM,EAAA,WAAU,+BAA+B,CAAA;AAAA,IAC3D,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,WAAWF,2BAAAA,IAACG,sCAAAA,aAAY,EAAA,WAAU,+BAA+B,CAAA;AAAA,IACjE,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,WAAWH,2BAAAA,IAACI,uCAAAA,cAAa,EAAA,WAAU,+BAA+B,CAAA;AAAA,IAClE,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,WAAWJ,2BAAAA,IAACK,qCAAAA,YAAW,EAAA,WAAU,+BAA+B,CAAA;AAAA,IAChE,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,WAAWL,2BAAAA,IAACM,wCAAAA,eAAc,EAAA,WAAU,+BAA+B,CAAA;AAAA,IACnE,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,WAAWN,2BAAAA,IAACO,uCAAAA,cAAa,EAAA,WAAU,+BAA+B,CAAA;AAAA,IAClE,OAAO;AAAA,EAAA;AAEX;AAiBA,MAAM,oBAAgD,CAAC;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACEP,2BAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IAEC;AAAA,IACA,cAAY;AAAA,IACZ,WAAU;AAAA,IACT,GAAG;AAAA,IAEH,UAAA;AAAA,EAAA;AAAA,EANI;AAOP;AAGK,MAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA,GAAG;AACL,MACE,eAAe;AAAA,EACb,eACG,CAAC,UACCQ,6BAAA,cAAA,mBAAA,EAAmB,GAAG,OAAQ,GAAG,WAAW,KAAK,MAAM,MAAO,CAAA;AAErE;;;;;;;;;"}
|
|
@@ -34,7 +34,7 @@ const socialNetworks = [
|
|
|
34
34
|
label: "TikTok"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
href: "https://www.instagram.com/
|
|
37
|
+
href: "https://www.instagram.com/intlayer/",
|
|
38
38
|
component: /* @__PURE__ */ jsx(InstagramLogo, { className: "max-w-full max-h-full h-auto" }),
|
|
39
39
|
label: "Instagram"
|
|
40
40
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/components/SocialNetworks/index.tsx"],"sourcesContent":["import { AnchorHTMLAttributes, DetailedHTMLProps, FC, ReactNode } from 'react';\nimport { FacebookLogo } from './FacebookLogo';\nimport { InstagramLogo } from './InstagramLogo';\nimport { LinkedInLogo } from './LinkedInLogo';\nimport { ProductHuntLogo } from './ProductHuntLogo';\nimport { TiktokLogo } from './TiktokLogo';\nimport { XLogo } from './XLogo';\nimport { YoutubeLogo } from './YoutubeLogo';\n\nconst socialNetworks = [\n {\n href: 'https://www.producthunt.com/posts/intlayer?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-intlayer',\n component: <ProductHuntLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'Product Hunt',\n },\n {\n href: 'https://x.com/Intlayer183096',\n component: <XLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'X',\n },\n {\n href: 'https://www.youtube.com/@intlayer',\n component: <YoutubeLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'YouTube',\n },\n {\n href: 'https://www.linkedin.com/company/intlayerorg',\n component: <LinkedInLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'LinkedIn',\n },\n {\n href: 'https://www.tiktok.com/@intlayer',\n component: <TiktokLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'TikTok',\n },\n {\n href: 'https://www.instagram.com/
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/SocialNetworks/index.tsx"],"sourcesContent":["import { AnchorHTMLAttributes, DetailedHTMLProps, FC, ReactNode } from 'react';\nimport { FacebookLogo } from './FacebookLogo';\nimport { InstagramLogo } from './InstagramLogo';\nimport { LinkedInLogo } from './LinkedInLogo';\nimport { ProductHuntLogo } from './ProductHuntLogo';\nimport { TiktokLogo } from './TiktokLogo';\nimport { XLogo } from './XLogo';\nimport { YoutubeLogo } from './YoutubeLogo';\n\nconst socialNetworks = [\n {\n href: 'https://www.producthunt.com/posts/intlayer?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-intlayer',\n component: <ProductHuntLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'Product Hunt',\n },\n {\n href: 'https://x.com/Intlayer183096',\n component: <XLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'X',\n },\n {\n href: 'https://www.youtube.com/@intlayer',\n component: <YoutubeLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'YouTube',\n },\n {\n href: 'https://www.linkedin.com/company/intlayerorg',\n component: <LinkedInLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'LinkedIn',\n },\n {\n href: 'https://www.tiktok.com/@intlayer',\n component: <TiktokLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'TikTok',\n },\n {\n href: 'https://www.instagram.com/intlayer/',\n component: <InstagramLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'Instagram',\n },\n {\n href: 'https://www.facebook.com/intlayer',\n component: <FacebookLogo className=\"max-w-full max-h-full h-auto\" />,\n label: 'Facebook',\n },\n];\n\ntype SocialNetworksProps = {\n renderItem?: (item: (typeof socialNetworks)[number]) => ReactNode;\n} & DetailedHTMLProps<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n HTMLAnchorElement\n>;\n\ntype DefaultRenderItemProps = DetailedHTMLProps<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n HTMLAnchorElement\n> & {\n component: ReactNode;\n label: string;\n};\n\nconst DefaultRenderItem: FC<DefaultRenderItemProps> = ({\n href,\n component,\n label,\n ...iconProps\n}) => (\n <a\n key={href}\n href={href}\n aria-label={label}\n className=\"max-w-4 max-h-4\"\n {...iconProps}\n >\n {component}\n </a>\n);\n\nexport const SocialNetworks = ({\n renderItem,\n ...iconProps\n}: SocialNetworksProps) =>\n socialNetworks.map(\n renderItem ??\n ((props) => (\n <DefaultRenderItem {...props} {...iconProps} key={props.label} />\n ))\n );\n\nexport * from './FacebookLogo';\nexport * from './InstagramLogo';\nexport * from './LinkedInLogo';\nexport * from './ProductHuntLogo';\nexport * from './TiktokLogo';\nexport * from './XLogo';\nexport * from './YoutubeLogo';\n"],"names":[],"mappings":";;;;;;;;;AASA,MAAM,iBAAiB;AAAA,EACrB;AAAA,IACE,MAAM;AAAA,IACN,WAAW,oBAAC,iBAAgB,EAAA,WAAU,+BAA+B,CAAA;AAAA,IACrE,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AA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