@opudoc/opicon-shared 0.1.1

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/LICENSE.md ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026 OpuDoc and Opicon
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const toPascalCase = (str) => str.split(/[-_/]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
4
+ const toKebabCase = (str) => str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
5
+ const mergeClasses = (...classes) => classes.filter(Boolean).join(" ");
6
+ const hasA11yProp = (props) => "aria-label" in props || "aria-labelledby" in props || "title" in props;
7
+
8
+ exports.hasA11yProp = hasA11yProp;
9
+ exports.mergeClasses = mergeClasses;
10
+ exports.toKebabCase = toKebabCase;
11
+ exports.toPascalCase = toPascalCase;
12
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sources":["../../src/index.ts"],"sourcesContent":["export const toPascalCase = (str: string): string =>\r\n str\r\n .split(/[-_/]/)\r\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\r\n .join('');\r\n\r\nexport const toKebabCase = (str: string): string =>\r\n str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\r\n\r\nexport const mergeClasses = (...classes: (string | undefined | false)[]): string =>\r\n classes.filter(Boolean).join(' ');\r\n\r\nexport const hasA11yProp = (props: Record<string, unknown>): boolean =>\r\n 'aria-label' in props || 'aria-labelledby' in props || 'title' in props;\r\n"],"names":[],"mappings":";;AAAO,MAAM,YAAA,GAAe,CAAC,GAAA,KAC3B,GAAA,CACG,MAAM,OAAO,CAAA,CACb,GAAA,CAAI,CAAC,IAAA,KAAS,IAAA,CAAK,OAAO,CAAC,CAAA,CAAE,aAAY,GAAI,IAAA,CAAK,MAAM,CAAC,CAAC,CAAA,CAC1D,IAAA,CAAK,EAAE;AAEL,MAAM,WAAA,GAAc,CAAC,GAAA,KAC1B,GAAA,CAAI,QAAQ,oBAAA,EAAsB,OAAO,EAAE,WAAA;AAEtC,MAAM,YAAA,GAAe,IAAI,OAAA,KAC9B,OAAA,CAAQ,OAAO,OAAO,CAAA,CAAE,KAAK,GAAG;AAE3B,MAAM,cAAc,CAAC,KAAA,KAC1B,gBAAgB,KAAA,IAAS,iBAAA,IAAqB,SAAS,OAAA,IAAW;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ const toPascalCase = (str) => str.split(/[-_/]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
2
+ const toKebabCase = (str) => str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3
+ const mergeClasses = (...classes) => classes.filter(Boolean).join(" ");
4
+ const hasA11yProp = (props) => "aria-label" in props || "aria-labelledby" in props || "title" in props;
5
+
6
+ export { hasA11yProp, mergeClasses, toKebabCase, toPascalCase };
7
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["export const toPascalCase = (str: string): string =>\r\n str\r\n .split(/[-_/]/)\r\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\r\n .join('');\r\n\r\nexport const toKebabCase = (str: string): string =>\r\n str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\r\n\r\nexport const mergeClasses = (...classes: (string | undefined | false)[]): string =>\r\n classes.filter(Boolean).join(' ');\r\n\r\nexport const hasA11yProp = (props: Record<string, unknown>): boolean =>\r\n 'aria-label' in props || 'aria-labelledby' in props || 'title' in props;\r\n"],"names":[],"mappings":"AAAO,MAAM,YAAA,GAAe,CAAC,GAAA,KAC3B,GAAA,CACG,MAAM,OAAO,CAAA,CACb,GAAA,CAAI,CAAC,IAAA,KAAS,IAAA,CAAK,OAAO,CAAC,CAAA,CAAE,aAAY,GAAI,IAAA,CAAK,MAAM,CAAC,CAAC,CAAA,CAC1D,IAAA,CAAK,EAAE;AAEL,MAAM,WAAA,GAAc,CAAC,GAAA,KAC1B,GAAA,CAAI,QAAQ,oBAAA,EAAsB,OAAO,EAAE,WAAA;AAEtC,MAAM,YAAA,GAAe,IAAI,OAAA,KAC9B,OAAA,CAAQ,OAAO,OAAO,CAAA,CAAE,KAAK,GAAG;AAE3B,MAAM,cAAc,CAAC,KAAA,KAC1B,gBAAgB,KAAA,IAAS,iBAAA,IAAqB,SAAS,OAAA,IAAW;;;;"}
@@ -0,0 +1,6 @@
1
+ declare const toPascalCase: (str: string) => string;
2
+ declare const toKebabCase: (str: string) => string;
3
+ declare const mergeClasses: (...classes: (string | undefined | false)[]) => string;
4
+ declare const hasA11yProp: (props: Record<string, unknown>) => boolean;
5
+
6
+ export { hasA11yProp, mergeClasses, toKebabCase, toPascalCase };
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@opudoc/opicon-shared",
3
+ "version": "0.1.1",
4
+ "license": "ISC",
5
+ "description": "Shared utilities for Opicon icon packages.",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/opudoc/opicon.git",
9
+ "directory": "packages/shared"
10
+ },
11
+ "homepage": "https://github.com/opudoc/opicon",
12
+ "bugs": "https://github.com/opudoc/opicon/issues",
13
+ "author": "opudoc (https://github.com/opudoc)",
14
+ "contributors": [
15
+ "RafaelK-F (https://github.com/RafaelK-F)"
16
+ ],
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "sideEffects": false,
21
+ "main": "dist/cjs/shared.js",
22
+ "module": "dist/esm/shared.mjs",
23
+ "types": "dist/shared.d.ts",
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "devDependencies": {
28
+ "@rollup/plugin-node-resolve": "^16.0.0",
29
+ "rollup": "^4.59.0",
30
+ "rollup-plugin-dts": "^6.2.3",
31
+ "rollup-plugin-esbuild": "^6.2.1",
32
+ "typescript": "^5.8.3"
33
+ },
34
+ "scripts": {
35
+ "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
36
+ "build": "pnpm clean && rollup -c rollup.config.mjs"
37
+ }
38
+ }