@hyddenlabs/hydn-ui 0.3.11 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data-display/code-block/code-block.js +1 -1
- package/dist/components/data-display/code-block/code-block.js.map +1 -1
- package/dist/components/data-display/data-grid/data-grid.d.ts +16 -0
- package/dist/components/data-display/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/data-display/data-grid/data-grid.js +19 -3
- package/dist/components/data-display/data-grid/data-grid.js.map +1 -1
- package/dist/components/data-display/empty-state/empty-state.d.ts +11 -1
- package/dist/components/data-display/empty-state/empty-state.d.ts.map +1 -1
- package/dist/components/data-display/empty-state/empty-state.js +23 -2
- package/dist/components/data-display/empty-state/empty-state.js.map +1 -1
- package/dist/components/layout/left-nav-layout/left-nav-item.d.ts.map +1 -1
- package/dist/components/layout/left-nav-layout/left-nav-item.js +1 -4
- package/dist/components/layout/left-nav-layout/left-nav-item.js.map +1 -1
- package/dist/components/typography/code/code.js +2 -2
- package/dist/components/typography/code/code.js.map +1 -1
- package/dist/fonts/Gilmer-Heavy.otf +0 -0
- package/dist/fonts/Gilmer-Light.otf +0 -0
- package/dist/fonts/Gilmer-Medium.otf +0 -0
- package/dist/fonts/Gilmer-Outline.otf +0 -0
- package/dist/fonts/Gilmer-Regular.otf +0 -0
- package/dist/style.css +1 -1
- package/dist/theme/tokens.d.ts +8 -1
- package/dist/theme/tokens.d.ts.map +1 -1
- package/dist/theme/tokens.js +7 -0
- package/dist/theme/tokens.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ function Code({ children, block = false, variant = "default", copy = false, clas
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
const variantClasses = {
|
|
19
|
-
default: "bg-muted text-foreground",
|
|
19
|
+
default: "bg-muted-active text-foreground",
|
|
20
20
|
primary: "text-primary",
|
|
21
21
|
muted: "text-muted-foreground"
|
|
22
22
|
};
|
|
@@ -31,7 +31,7 @@ function Code({ children, block = false, variant = "default", copy = false, clas
|
|
|
31
31
|
{
|
|
32
32
|
type: "button",
|
|
33
33
|
onClick: handleCopy,
|
|
34
|
-
className: "absolute top-2 right-2 inline-flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity focus:opacity-100 cursor-pointer bg-background/80 backdrop-blur-sm p-1.5 rounded border border-border hover:bg-muted",
|
|
34
|
+
className: "absolute top-2 right-2 inline-flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity focus:opacity-100 cursor-pointer bg-background/80 backdrop-blur-sm p-1.5 rounded border border-border hover:bg-muted-hover",
|
|
35
35
|
"aria-label": "Copy to clipboard",
|
|
36
36
|
children: /* @__PURE__ */ jsx(
|
|
37
37
|
Icon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.js","sources":["../../../../src/components/typography/code/code.tsx"],"sourcesContent":["import { ReactNode, useRef, useState } from 'react';\nimport Icon from '../../system/icon/icon';\n\nexport type CodeProps = {\n /** Code content to be displayed */\n children: ReactNode;\n /** Whether to render as a code block (pre + code) or inline code\n * @default false\n */\n block?: boolean;\n /** Visual style variant\n * @default 'default'\n */\n variant?: 'default' | 'primary' | 'muted';\n /** Show copy-to-clipboard button\n * @default false\n */\n copy?: boolean;\n /** Additional CSS classes for custom styling */\n className?: string;\n};\n\n/**\n * Code - Styled code snippets (inline or block)\n */\nfunction Code({ children, block = false, variant = 'default', copy = false, className = '' }: Readonly<CodeProps>) {\n const codeRef = useRef<HTMLElement>(null);\n const [copied, setCopied] = useState(false);\n\n const handleCopy = async () => {\n if (!codeRef.current) return;\n\n try {\n const textContent = codeRef.current.textContent || '';\n await navigator.clipboard.writeText(textContent);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Failed to copy code:', err);\n }\n };\n\n const variantClasses = {\n default: 'bg-muted text-foreground',\n primary: 'text-primary',\n muted: 'text-muted-foreground'\n };\n\n const baseClasses = `font-mono ${variantClasses[variant]}`;\n\n if (block) {\n const blockElement = (\n <pre className={`${baseClasses} p-4 rounded-lg overflow-x-auto border border-border ${className}`} ref={codeRef}>\n <code>{children}</code>\n </pre>\n );\n\n if (copy) {\n return (\n <div className=\"relative group\">\n {blockElement}\n <button\n type=\"button\"\n onClick={handleCopy}\n className=\"absolute top-2 right-2 inline-flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity focus:opacity-100 cursor-pointer bg-background/80 backdrop-blur-sm p-1.5 rounded border border-border hover:bg-muted\"\n aria-label=\"Copy to clipboard\"\n >\n <Icon\n name={copied ? 'check' : 'copy'}\n size=\"sm\"\n color={copied ? 'success' : 'currentColor'}\n className=\"transition-all\"\n />\n </button>\n </div>\n );\n }\n\n return blockElement;\n }\n\n const inlineElement = (\n <code className={`${baseClasses} px-1.5 py-0.5 rounded text-sm ${className}`} ref={codeRef}>\n {children}\n </code>\n );\n\n if (copy) {\n return (\n <span className=\"inline-flex items-center gap-2 group\">\n {inlineElement}\n <button\n type=\"button\"\n onClick={handleCopy}\n className=\"inline-flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity focus:opacity-100 cursor-pointer\"\n aria-label=\"Copy to clipboard\"\n >\n <Icon\n name={copied ? 'check' : 'copy'}\n size=\"sm\"\n color={copied ? 'success' : 'currentColor'}\n className=\"transition-all\"\n />\n </button>\n </span>\n );\n }\n\n return inlineElement;\n}\n\nCode.displayName = 'Code';\n\nexport default Code;\n"],"names":[],"mappings":";;;AAyBA,SAAS,KAAK,EAAE,UAAU,QAAQ,OAAO,UAAU,WAAW,OAAO,OAAO,YAAY,GAAA,GAA2B;AACjH,QAAM,UAAU,OAAoB,IAAI;AACxC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAE1C,QAAM,aAAa,YAAY;AAC7B,QAAI,CAAC,QAAQ,QAAS;AAEtB,QAAI;AACF,YAAM,cAAc,QAAQ,QAAQ,eAAe;AACnD,YAAM,UAAU,UAAU,UAAU,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,YAAY;AAAA,cAC5B,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA;AAAA,IACF,GACF;AAAA,EAEJ;AAEA,SAAO;AACT;AAEA,KAAK,cAAc;"}
|
|
1
|
+
{"version":3,"file":"code.js","sources":["../../../../src/components/typography/code/code.tsx"],"sourcesContent":["import { ReactNode, useRef, useState } from 'react';\nimport Icon from '../../system/icon/icon';\n\nexport type CodeProps = {\n /** Code content to be displayed */\n children: ReactNode;\n /** Whether to render as a code block (pre + code) or inline code\n * @default false\n */\n block?: boolean;\n /** Visual style variant\n * @default 'default'\n */\n variant?: 'default' | 'primary' | 'muted';\n /** Show copy-to-clipboard button\n * @default false\n */\n copy?: boolean;\n /** Additional CSS classes for custom styling */\n className?: string;\n};\n\n/**\n * Code - Styled code snippets (inline or block)\n */\nfunction Code({ children, block = false, variant = 'default', copy = false, className = '' }: Readonly<CodeProps>) {\n const codeRef = useRef<HTMLElement>(null);\n const [copied, setCopied] = useState(false);\n\n const handleCopy = async () => {\n if (!codeRef.current) return;\n\n try {\n const textContent = codeRef.current.textContent || '';\n await navigator.clipboard.writeText(textContent);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Failed to copy code:', err);\n }\n };\n\n const variantClasses = {\n default: 'bg-muted-active text-foreground',\n primary: 'text-primary',\n muted: 'text-muted-foreground'\n };\n\n const baseClasses = `font-mono ${variantClasses[variant]}`;\n\n if (block) {\n const blockElement = (\n <pre className={`${baseClasses} p-4 rounded-lg overflow-x-auto border border-border ${className}`} ref={codeRef}>\n <code>{children}</code>\n </pre>\n );\n\n if (copy) {\n return (\n <div className=\"relative group\">\n {blockElement}\n <button\n type=\"button\"\n onClick={handleCopy}\n className=\"absolute top-2 right-2 inline-flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity focus:opacity-100 cursor-pointer bg-background/80 backdrop-blur-sm p-1.5 rounded border border-border hover:bg-muted-hover\"\n aria-label=\"Copy to clipboard\"\n >\n <Icon\n name={copied ? 'check' : 'copy'}\n size=\"sm\"\n color={copied ? 'success' : 'currentColor'}\n className=\"transition-all\"\n />\n </button>\n </div>\n );\n }\n\n return blockElement;\n }\n\n const inlineElement = (\n <code className={`${baseClasses} px-1.5 py-0.5 rounded text-sm ${className}`} ref={codeRef}>\n {children}\n </code>\n );\n\n if (copy) {\n return (\n <span className=\"inline-flex items-center gap-2 group\">\n {inlineElement}\n <button\n type=\"button\"\n onClick={handleCopy}\n className=\"inline-flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity focus:opacity-100 cursor-pointer\"\n aria-label=\"Copy to clipboard\"\n >\n <Icon\n name={copied ? 'check' : 'copy'}\n size=\"sm\"\n color={copied ? 'success' : 'currentColor'}\n className=\"transition-all\"\n />\n </button>\n </span>\n );\n }\n\n return inlineElement;\n}\n\nCode.displayName = 'Code';\n\nexport default Code;\n"],"names":[],"mappings":";;;AAyBA,SAAS,KAAK,EAAE,UAAU,QAAQ,OAAO,UAAU,WAAW,OAAO,OAAO,YAAY,GAAA,GAA2B;AACjH,QAAM,UAAU,OAAoB,IAAI;AACxC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAE1C,QAAM,aAAa,YAAY;AAC7B,QAAI,CAAC,QAAQ,QAAS;AAEtB,QAAI;AACF,YAAM,cAAc,QAAQ,QAAQ,eAAe;AACnD,YAAM,UAAU,UAAU,UAAU,WAAW;AAC/C,gBAAU,IAAI;AACd,iBAAW,MAAM,UAAU,KAAK,GAAG,GAAI;AAAA,IACzC,SAAS,KAAK;AAEZ,cAAQ,MAAM,wBAAwB,GAAG;AAAA,IAC3C;AAAA,EACF;AAEA,QAAM,iBAAiB;AAAA,IACrB,SAAS;AAAA,IACT,SAAS;AAAA,IACT,OAAO;AAAA,EAAA;AAGT,QAAM,cAAc,aAAa,eAAe,OAAO,CAAC;AAExD,MAAI,OAAO;AACT,UAAM,eACJ,oBAAC,OAAA,EAAI,WAAW,G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