hazo_ui 4.8.0 → 4.10.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.
@@ -0,0 +1,20 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ /**
4
+ * Merges class names using clsx and tailwind-merge
5
+ * @param inputs - Class values to merge
6
+ * @returns Merged class string
7
+ */
8
+ declare function cn(...inputs: ClassValue[]): string;
9
+ /**
10
+ * Sanitizes a user/admin-supplied href against a scheme allowlist to prevent
11
+ * `javascript:`/`data:`/`vbscript:` URI XSS when the value is rendered into an
12
+ * `<a href>`. Allows http(s), mailto, and same-origin absolute paths (`/…` but
13
+ * not protocol-relative `//…`). Returns `undefined` for anything else, so the
14
+ * anchor renders with no href rather than an active malicious one.
15
+ * @param url - Candidate href (may be undefined)
16
+ * @returns The original url if allowed, otherwise undefined
17
+ */
18
+ declare function safeHref(url?: string): string | undefined;
19
+
20
+ export { cn as c, safeHref as s };
@@ -0,0 +1,20 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ /**
4
+ * Merges class names using clsx and tailwind-merge
5
+ * @param inputs - Class values to merge
6
+ * @returns Merged class string
7
+ */
8
+ declare function cn(...inputs: ClassValue[]): string;
9
+ /**
10
+ * Sanitizes a user/admin-supplied href against a scheme allowlist to prevent
11
+ * `javascript:`/`data:`/`vbscript:` URI XSS when the value is rendered into an
12
+ * `<a href>`. Allows http(s), mailto, and same-origin absolute paths (`/…` but
13
+ * not protocol-relative `//…`). Returns `undefined` for anything else, so the
14
+ * anchor renders with no href rather than an active malicious one.
15
+ * @param url - Candidate href (may be undefined)
16
+ * @returns The original url if allowed, otherwise undefined
17
+ */
18
+ declare function safeHref(url?: string): string | undefined;
19
+
20
+ export { cn as c, safeHref as s };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/utils.ts"],"names":["twMerge","clsx"],"mappings":";;;;;AAWO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B","file":"index.utils.cjs","sourcesContent":["// Utility functions for hazo_ui component library\n// Provides className merging utility (cn function)\n\nimport { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merges class names using clsx and tailwind-merge\n * @param inputs - Class values to merge\n * @returns Merged class string\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n"]}
1
+ {"version":3,"sources":["../src/lib/utils.ts"],"names":["twMerge","clsx"],"mappings":";;;;;AAWO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B","file":"index.utils.cjs","sourcesContent":["// Utility functions for hazo_ui component library\n// Provides className merging utility (cn function)\n\nimport { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merges class names using clsx and tailwind-merge\n * @param inputs - Class values to merge\n * @returns Merged class string\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * Sanitizes a user/admin-supplied href against a scheme allowlist to prevent\n * `javascript:`/`data:`/`vbscript:` URI XSS when the value is rendered into an\n * `<a href>`. Allows http(s), mailto, and same-origin absolute paths (`/…` but\n * not protocol-relative `//…`). Returns `undefined` for anything else, so the\n * anchor renders with no href rather than an active malicious one.\n * @param url - Candidate href (may be undefined)\n * @returns The original url if allowed, otherwise undefined\n */\nexport function safeHref(url?: string): string | undefined {\n if (!url) return undefined;\n const trimmed = url.trim();\n const lower = trimmed.toLowerCase();\n if (\n lower.startsWith(\"http://\") ||\n lower.startsWith(\"https://\") ||\n lower.startsWith(\"mailto:\")\n ) {\n return trimmed;\n }\n // Same-origin absolute path, but not protocol-relative \"//host\".\n if (trimmed.startsWith(\"/\") && !trimmed.startsWith(\"//\")) {\n return trimmed;\n }\n return undefined;\n}\n\n"]}
@@ -1,10 +1,2 @@
1
- import { ClassValue } from 'clsx';
2
-
3
- /**
4
- * Merges class names using clsx and tailwind-merge
5
- * @param inputs - Class values to merge
6
- * @returns Merged class string
7
- */
8
- declare function cn(...inputs: ClassValue[]): string;
9
-
10
- export { cn };
1
+ export { c as cn } from './index.utils-DZVbQXFR.cjs';
2
+ import 'clsx';
@@ -1,10 +1,2 @@
1
- import { ClassValue } from 'clsx';
2
-
3
- /**
4
- * Merges class names using clsx and tailwind-merge
5
- * @param inputs - Class values to merge
6
- * @returns Merged class string
7
- */
8
- declare function cn(...inputs: ClassValue[]): string;
9
-
10
- export { cn };
1
+ export { c as cn } from './index.utils-DZVbQXFR.js';
2
+ import 'clsx';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/utils.ts"],"names":[],"mappings":";;;AAWO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B","file":"index.utils.js","sourcesContent":["// Utility functions for hazo_ui component library\n// Provides className merging utility (cn function)\n\nimport { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merges class names using clsx and tailwind-merge\n * @param inputs - Class values to merge\n * @returns Merged class string\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n"]}
1
+ {"version":3,"sources":["../src/lib/utils.ts"],"names":[],"mappings":";;;AAWO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B","file":"index.utils.js","sourcesContent":["// Utility functions for hazo_ui component library\n// Provides className merging utility (cn function)\n\nimport { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merges class names using clsx and tailwind-merge\n * @param inputs - Class values to merge\n * @returns Merged class string\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * Sanitizes a user/admin-supplied href against a scheme allowlist to prevent\n * `javascript:`/`data:`/`vbscript:` URI XSS when the value is rendered into an\n * `<a href>`. Allows http(s), mailto, and same-origin absolute paths (`/…` but\n * not protocol-relative `//…`). Returns `undefined` for anything else, so the\n * anchor renders with no href rather than an active malicious one.\n * @param url - Candidate href (may be undefined)\n * @returns The original url if allowed, otherwise undefined\n */\nexport function safeHref(url?: string): string | undefined {\n if (!url) return undefined;\n const trimmed = url.trim();\n const lower = trimmed.toLowerCase();\n if (\n lower.startsWith(\"http://\") ||\n lower.startsWith(\"https://\") ||\n lower.startsWith(\"mailto:\")\n ) {\n return trimmed;\n }\n // Same-origin absolute path, but not protocol-relative \"//host\".\n if (trimmed.startsWith(\"/\") && !trimmed.startsWith(\"//\")) {\n return trimmed;\n }\n return undefined;\n}\n\n"]}