@radix-solid-js/id 0.1.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/dist/index.cjs +13 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var solidJs = require('solid-js');
|
|
4
|
+
|
|
5
|
+
// src/id.ts
|
|
6
|
+
function createId(deterministicId) {
|
|
7
|
+
if (deterministicId) return deterministicId;
|
|
8
|
+
return `radix-${solidJs.createUniqueId()}`;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports.createId = createId;
|
|
12
|
+
//# sourceMappingURL=index.cjs.map
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/id.ts"],"names":["createUniqueId"],"mappings":";;;;;AAYA,SAAS,SAAS,eAAA,EAAkC;AAClD,EAAA,IAAI,iBAAiB,OAAO,eAAA;AAC5B,EAAA,OAAO,CAAA,MAAA,EAASA,wBAAgB,CAAA,CAAA;AAClC","file":"index.cjs","sourcesContent":["import { createUniqueId } from 'solid-js';\n\n/**\n * Creates a unique ID for use in accessibility attributes.\n * Wraps SolidJS's `createUniqueId()` with optional deterministic ID support.\n *\n * In React's Radix, this was `useId()`. In SolidJS we use `createUniqueId()`\n * which is already SSR-safe.\n *\n * @param deterministicId - If provided, returns this ID directly.\n * @returns A unique ID string prefixed with \"radix-\".\n */\nfunction createId(deterministicId?: string): string {\n if (deterministicId) return deterministicId;\n return `radix-${createUniqueId()}`;\n}\n\nexport { createId };\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a unique ID for use in accessibility attributes.
|
|
3
|
+
* Wraps SolidJS's `createUniqueId()` with optional deterministic ID support.
|
|
4
|
+
*
|
|
5
|
+
* In React's Radix, this was `useId()`. In SolidJS we use `createUniqueId()`
|
|
6
|
+
* which is already SSR-safe.
|
|
7
|
+
*
|
|
8
|
+
* @param deterministicId - If provided, returns this ID directly.
|
|
9
|
+
* @returns A unique ID string prefixed with "radix-".
|
|
10
|
+
*/
|
|
11
|
+
declare function createId(deterministicId?: string): string;
|
|
12
|
+
|
|
13
|
+
export { createId };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a unique ID for use in accessibility attributes.
|
|
3
|
+
* Wraps SolidJS's `createUniqueId()` with optional deterministic ID support.
|
|
4
|
+
*
|
|
5
|
+
* In React's Radix, this was `useId()`. In SolidJS we use `createUniqueId()`
|
|
6
|
+
* which is already SSR-safe.
|
|
7
|
+
*
|
|
8
|
+
* @param deterministicId - If provided, returns this ID directly.
|
|
9
|
+
* @returns A unique ID string prefixed with "radix-".
|
|
10
|
+
*/
|
|
11
|
+
declare function createId(deterministicId?: string): string;
|
|
12
|
+
|
|
13
|
+
export { createId };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createUniqueId } from 'solid-js';
|
|
2
|
+
|
|
3
|
+
// src/id.ts
|
|
4
|
+
function createId(deterministicId) {
|
|
5
|
+
if (deterministicId) return deterministicId;
|
|
6
|
+
return `radix-${createUniqueId()}`;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { createId };
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/id.ts"],"names":[],"mappings":";;;AAYA,SAAS,SAAS,eAAA,EAAkC;AAClD,EAAA,IAAI,iBAAiB,OAAO,eAAA;AAC5B,EAAA,OAAO,CAAA,MAAA,EAAS,gBAAgB,CAAA,CAAA;AAClC","file":"index.js","sourcesContent":["import { createUniqueId } from 'solid-js';\n\n/**\n * Creates a unique ID for use in accessibility attributes.\n * Wraps SolidJS's `createUniqueId()` with optional deterministic ID support.\n *\n * In React's Radix, this was `useId()`. In SolidJS we use `createUniqueId()`\n * which is already SSR-safe.\n *\n * @param deterministicId - If provided, returns this ID directly.\n * @returns A unique ID string prefixed with \"radix-\".\n */\nfunction createId(deterministicId?: string): string {\n if (deterministicId) return deterministicId;\n return `radix-${createUniqueId()}`;\n}\n\nexport { createId };\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@radix-solid-js/id",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
17
|
+
"default": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup",
|
|
27
|
+
"clean": "rm -rf dist",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"test": "vitest run"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"solid-js": "^1.8.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@repo/tsconfig": "workspace:*",
|
|
36
|
+
"tsup": "^8.3.6",
|
|
37
|
+
"typescript": "^5.7.3",
|
|
38
|
+
"solid-js": "^1.9.3",
|
|
39
|
+
"vitest": "^2.1.8"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "https://github.com/ljho01/shadcn-solid-js.git",
|
|
47
|
+
"directory": "packages/solid/id"
|
|
48
|
+
}
|
|
49
|
+
}
|