@ariakit/solid-core 0.0.1 → 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/CHANGELOG.md +5 -0
- package/as/as/package.json +8 -0
- package/cjs/__chunks/53WPOLZU.cjs +7 -0
- package/cjs/__chunks/AUGTJ473.cjs +7 -0
- package/cjs/__chunks/GVOD7RTZ.cjs +21 -0
- package/cjs/__chunks/JFCGWMZC.cjs +35 -0
- package/cjs/__chunks/RLO4RIGL.cjs +42 -0
- package/cjs/__chunks/T5IUBZJK.cjs +39 -0
- package/cjs/__chunks/V3ZEI37L.cjs +61 -0
- package/cjs/__chunks/V5YR7HBG.cjs +37 -0
- package/cjs/as/as.cjs +7 -0
- package/cjs/as/as.d.cts +30 -0
- package/cjs/as/as.d.ts +30 -0
- package/cjs/focus-trap/focus-trap-region.cjs +68 -0
- package/cjs/focus-trap/focus-trap-region.d.cts +38 -0
- package/cjs/focus-trap/focus-trap-region.d.ts +38 -0
- package/cjs/focus-trap/focus-trap.cjs +11 -0
- package/cjs/focus-trap/focus-trap.d.cts +27 -0
- package/cjs/focus-trap/focus-trap.d.ts +27 -0
- package/cjs/group/group-label-context.cjs +6 -0
- package/cjs/group/group-label-context.d.cts +2 -0
- package/cjs/group/group-label-context.d.ts +2 -0
- package/cjs/group/group-label.cjs +41 -0
- package/cjs/group/group-label.d.cts +34 -0
- package/cjs/group/group-label.d.ts +34 -0
- package/cjs/group/group.cjs +43 -0
- package/cjs/group/group.d.cts +28 -0
- package/cjs/group/group.d.ts +28 -0
- package/cjs/heading/heading-context.cjs +6 -0
- package/cjs/heading/heading-context.d.cts +3 -0
- package/cjs/heading/heading-context.d.ts +3 -0
- package/cjs/heading/heading-level.cjs +23 -0
- package/cjs/heading/heading-level.d.cts +27 -0
- package/cjs/heading/heading-level.d.ts +27 -0
- package/cjs/heading/heading.cjs +45 -0
- package/cjs/heading/heading.d.cts +39 -0
- package/cjs/heading/heading.d.ts +39 -0
- package/cjs/heading/utils.cjs +1 -0
- package/cjs/heading/utils.d.cts +1 -0
- package/cjs/heading/utils.d.ts +1 -0
- package/cjs/role/role.cjs +26 -0
- package/cjs/role/role.d.cts +33 -0
- package/cjs/role/role.d.ts +33 -0
- package/cjs/separator/separator.cjs +30 -0
- package/cjs/separator/separator.d.cts +32 -0
- package/cjs/separator/separator.d.ts +32 -0
- package/cjs/utils/misc.cjs +8 -0
- package/cjs/utils/misc.d.cts +16 -0
- package/cjs/utils/misc.d.ts +16 -0
- package/cjs/utils/reactivity.cjs +12 -0
- package/cjs/utils/reactivity.d.cts +109 -0
- package/cjs/utils/reactivity.d.ts +109 -0
- package/cjs/utils/system.cjs +13 -0
- package/cjs/utils/system.d.cts +45 -0
- package/cjs/utils/system.d.ts +45 -0
- package/cjs/utils/types.cjs +1 -0
- package/cjs/utils/types.d.cts +56 -0
- package/cjs/utils/types.d.ts +56 -0
- package/cjs/visually-hidden/visually-hidden.cjs +10 -0
- package/cjs/visually-hidden/visually-hidden.d.cts +34 -0
- package/cjs/visually-hidden/visually-hidden.d.ts +34 -0
- package/esm/__chunks/I7JSIDPD.js +7 -0
- package/esm/__chunks/ILGMKAYU.js +37 -0
- package/esm/__chunks/NX66AMGW.js +39 -0
- package/esm/__chunks/OKOFCLOZ.js +61 -0
- package/esm/__chunks/QKOHDUFI.js +42 -0
- package/esm/__chunks/SFKMELHD.js +35 -0
- package/esm/__chunks/UKDBTPK5.js +21 -0
- package/esm/__chunks/VOWRNGOM.js +7 -0
- package/esm/as/as.d.ts +30 -0
- package/esm/as/as.js +7 -0
- package/esm/focus-trap/focus-trap-region.d.ts +38 -0
- package/esm/focus-trap/focus-trap-region.js +68 -0
- package/esm/focus-trap/focus-trap.d.ts +27 -0
- package/esm/focus-trap/focus-trap.js +11 -0
- package/esm/group/group-label-context.d.ts +2 -0
- package/esm/group/group-label-context.js +6 -0
- package/esm/group/group-label.d.ts +34 -0
- package/esm/group/group-label.js +41 -0
- package/esm/group/group.d.ts +28 -0
- package/esm/group/group.js +43 -0
- package/esm/heading/heading-context.d.ts +3 -0
- package/esm/heading/heading-context.js +6 -0
- package/esm/heading/heading-level.d.ts +27 -0
- package/esm/heading/heading-level.js +23 -0
- package/esm/heading/heading.d.ts +39 -0
- package/esm/heading/heading.js +45 -0
- package/esm/heading/utils.d.ts +1 -0
- package/esm/heading/utils.js +0 -0
- package/esm/role/role.d.ts +33 -0
- package/esm/role/role.js +26 -0
- package/esm/separator/separator.d.ts +32 -0
- package/esm/separator/separator.js +30 -0
- package/esm/utils/misc.d.ts +16 -0
- package/esm/utils/misc.js +8 -0
- package/esm/utils/reactivity.d.ts +109 -0
- package/esm/utils/reactivity.js +12 -0
- package/esm/utils/system.d.ts +45 -0
- package/esm/utils/system.js +13 -0
- package/esm/utils/types.d.ts +56 -0
- package/esm/utils/types.js +0 -0
- package/esm/visually-hidden/visually-hidden.d.ts +34 -0
- package/esm/visually-hidden/visually-hidden.js +10 -0
- package/focus-trap/focus-trap/package.json +8 -0
- package/focus-trap/focus-trap-region/package.json +8 -0
- package/group/group/package.json +8 -0
- package/group/group-label/package.json +8 -0
- package/group/group-label-context/package.json +8 -0
- package/heading/heading/package.json +8 -0
- package/heading/heading-context/package.json +8 -0
- package/heading/heading-level/package.json +8 -0
- package/heading/utils/package.json +8 -0
- package/index.ts +1 -0
- package/license +21 -0
- package/package.json +181 -6
- package/readme.md +22 -0
- package/role/role/package.json +8 -0
- package/separator/separator/package.json +8 -0
- package/solid/__chunks/ALJQAVR2.jsx +42 -0
- package/solid/__chunks/HBI7B4XO.jsx +52 -0
- package/solid/__chunks/HUX7TBVM.jsx +37 -0
- package/solid/__chunks/KXVBEYOF.jsx +21 -0
- package/solid/__chunks/O5QTZ2VS.jsx +42 -0
- package/solid/__chunks/PIGECGWJ.jsx +40 -0
- package/solid/__chunks/TCHPU5P4.jsx +7 -0
- package/solid/__chunks/VAA446IN.jsx +7 -0
- package/solid/as/as.jsx +7 -0
- package/solid/focus-trap/focus-trap-region.jsx +63 -0
- package/solid/focus-trap/focus-trap.jsx +11 -0
- package/solid/group/group-label-context.jsx +6 -0
- package/solid/group/group-label.jsx +50 -0
- package/solid/group/group.jsx +45 -0
- package/solid/heading/heading-context.jsx +6 -0
- package/solid/heading/heading-level.jsx +22 -0
- package/solid/heading/heading.jsx +52 -0
- package/solid/heading/utils.jsx +0 -0
- package/solid/role/role.jsx +59 -0
- package/solid/separator/separator.jsx +36 -0
- package/solid/utils/misc.jsx +8 -0
- package/solid/utils/reactivity.jsx +12 -0
- package/solid/utils/system.jsx +13 -0
- package/solid/utils/types.jsx +0 -0
- package/solid/visually-hidden/visually-hidden.jsx +10 -0
- package/tsconfig.build.json +4 -0
- package/utils/misc/package.json +8 -0
- package/utils/reactivity/package.json +8 -0
- package/utils/system/package.json +8 -0
- package/utils/types/package.json +8 -0
- package/visually-hidden/visually-hidden/package.json +8 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HeadingContext
|
|
3
|
+
} from "../__chunks/VAA446IN.jsx";
|
|
4
|
+
|
|
5
|
+
// src/heading/heading-level.tsx
|
|
6
|
+
import { useContext } from "solid-js";
|
|
7
|
+
function HeadingLevel(props) {
|
|
8
|
+
const contextLevel = useContext(HeadingContext);
|
|
9
|
+
const nextLevel = () => {
|
|
10
|
+
var _a;
|
|
11
|
+
return Math.max(
|
|
12
|
+
Math.min(props.level || ((_a = contextLevel == null ? void 0 : contextLevel()) != null ? _a : 0) + 1, 6),
|
|
13
|
+
1
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
return <HeadingContext.Provider value={nextLevel}>
|
|
17
|
+
{props.children}
|
|
18
|
+
</HeadingContext.Provider>;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
HeadingLevel
|
|
22
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HeadingContext
|
|
3
|
+
} from "../__chunks/VAA446IN.jsx";
|
|
4
|
+
import {
|
|
5
|
+
extractTagName
|
|
6
|
+
} from "../__chunks/KXVBEYOF.jsx";
|
|
7
|
+
import {
|
|
8
|
+
createHook,
|
|
9
|
+
createInstance
|
|
10
|
+
} from "../__chunks/HBI7B4XO.jsx";
|
|
11
|
+
import {
|
|
12
|
+
createRef,
|
|
13
|
+
mergeProps
|
|
14
|
+
} from "../__chunks/ALJQAVR2.jsx";
|
|
15
|
+
|
|
16
|
+
// src/heading/heading.tsx
|
|
17
|
+
import { createMemo, useContext } from "solid-js";
|
|
18
|
+
var TagName = "h1";
|
|
19
|
+
var useHeading = createHook(
|
|
20
|
+
function useHeading2(props) {
|
|
21
|
+
const ref = createRef();
|
|
22
|
+
const level = useContext(HeadingContext) || (() => 1);
|
|
23
|
+
const Element = () => `h${level()}`;
|
|
24
|
+
const tagName = extractTagName(ref.get);
|
|
25
|
+
const isNativeHeading = createMemo(
|
|
26
|
+
() => !!tagName() && /^h\d$/.test(tagName())
|
|
27
|
+
);
|
|
28
|
+
props = mergeProps(
|
|
29
|
+
{
|
|
30
|
+
// TODO: replace with LazyDynamic
|
|
31
|
+
render: Element(),
|
|
32
|
+
get role() {
|
|
33
|
+
return !isNativeHeading() ? "heading" : void 0;
|
|
34
|
+
},
|
|
35
|
+
get "aria-level"() {
|
|
36
|
+
return !isNativeHeading() ? level() : void 0;
|
|
37
|
+
},
|
|
38
|
+
ref: ref.set
|
|
39
|
+
},
|
|
40
|
+
props
|
|
41
|
+
);
|
|
42
|
+
return props;
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
var Heading = function Heading2(props) {
|
|
46
|
+
const htmlProps = useHeading(props);
|
|
47
|
+
return createInstance(TagName, htmlProps);
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
Heading,
|
|
51
|
+
useHeading
|
|
52
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createHook,
|
|
3
|
+
createInstance
|
|
4
|
+
} from "../__chunks/HBI7B4XO.jsx";
|
|
5
|
+
import "../__chunks/ALJQAVR2.jsx";
|
|
6
|
+
|
|
7
|
+
// src/role/role.tsx
|
|
8
|
+
var TagName = "div";
|
|
9
|
+
var elements = [
|
|
10
|
+
"a",
|
|
11
|
+
"button",
|
|
12
|
+
"details",
|
|
13
|
+
"dialog",
|
|
14
|
+
"div",
|
|
15
|
+
"form",
|
|
16
|
+
"h1",
|
|
17
|
+
"h2",
|
|
18
|
+
"h3",
|
|
19
|
+
"h4",
|
|
20
|
+
"h5",
|
|
21
|
+
"h6",
|
|
22
|
+
"header",
|
|
23
|
+
"img",
|
|
24
|
+
"input",
|
|
25
|
+
"label",
|
|
26
|
+
"li",
|
|
27
|
+
"nav",
|
|
28
|
+
"ol",
|
|
29
|
+
"p",
|
|
30
|
+
"section",
|
|
31
|
+
"select",
|
|
32
|
+
"span",
|
|
33
|
+
"summary",
|
|
34
|
+
"textarea",
|
|
35
|
+
"ul",
|
|
36
|
+
"svg"
|
|
37
|
+
];
|
|
38
|
+
var useRole = createHook(
|
|
39
|
+
function useRole2(props) {
|
|
40
|
+
return props;
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
var Role = function Role2(props) {
|
|
44
|
+
return createInstance(TagName, props);
|
|
45
|
+
};
|
|
46
|
+
Object.assign(
|
|
47
|
+
Role,
|
|
48
|
+
elements.reduce((acc, element) => {
|
|
49
|
+
acc[element] = function Role3(props) {
|
|
50
|
+
return createInstance(element, props);
|
|
51
|
+
};
|
|
52
|
+
return acc;
|
|
53
|
+
}, {})
|
|
54
|
+
);
|
|
55
|
+
export {
|
|
56
|
+
Role,
|
|
57
|
+
elements,
|
|
58
|
+
useRole
|
|
59
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createHook,
|
|
3
|
+
createInstance,
|
|
4
|
+
withOptions
|
|
5
|
+
} from "../__chunks/HBI7B4XO.jsx";
|
|
6
|
+
import {
|
|
7
|
+
mergeProps
|
|
8
|
+
} from "../__chunks/ALJQAVR2.jsx";
|
|
9
|
+
|
|
10
|
+
// src/separator/separator.tsx
|
|
11
|
+
var TagName = "hr";
|
|
12
|
+
var useSeparator = createHook(
|
|
13
|
+
withOptions(
|
|
14
|
+
{ orientation: "horizontal" },
|
|
15
|
+
function useSeparator2(props, options) {
|
|
16
|
+
props = mergeProps(
|
|
17
|
+
{
|
|
18
|
+
role: "separator",
|
|
19
|
+
get "aria-orientation"() {
|
|
20
|
+
return options.orientation;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
props
|
|
24
|
+
);
|
|
25
|
+
return props;
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
var Separator = function Separator2(props) {
|
|
30
|
+
const htmlProps = useSeparator(props);
|
|
31
|
+
return createInstance(TagName, htmlProps);
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
Separator,
|
|
35
|
+
useSeparator
|
|
36
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ariakit/solid-core/visually-hidden/visually-hidden",
|
|
3
|
+
"private": true,
|
|
4
|
+
"sideEffects": false,
|
|
5
|
+
"main": "../../cjs/visually-hidden/visually-hidden.cjs",
|
|
6
|
+
"module": "../../esm/visually-hidden/visually-hidden.js",
|
|
7
|
+
"types": "../../cjs/visually-hidden/visually-hidden.d.ts"
|
|
8
|
+
}
|