@ariakit/solid-core 0.0.1 → 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.
Files changed (149) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/as/as/package.json +8 -0
  3. package/cjs/__chunks/53WPOLZU.cjs +7 -0
  4. package/cjs/__chunks/AUGTJ473.cjs +7 -0
  5. package/cjs/__chunks/GVOD7RTZ.cjs +21 -0
  6. package/cjs/__chunks/JFCGWMZC.cjs +35 -0
  7. package/cjs/__chunks/RLO4RIGL.cjs +42 -0
  8. package/cjs/__chunks/T5IUBZJK.cjs +39 -0
  9. package/cjs/__chunks/V3ZEI37L.cjs +61 -0
  10. package/cjs/__chunks/V5YR7HBG.cjs +37 -0
  11. package/cjs/as/as.cjs +7 -0
  12. package/cjs/as/as.d.cts +30 -0
  13. package/cjs/as/as.d.ts +30 -0
  14. package/cjs/focus-trap/focus-trap-region.cjs +68 -0
  15. package/cjs/focus-trap/focus-trap-region.d.cts +38 -0
  16. package/cjs/focus-trap/focus-trap-region.d.ts +38 -0
  17. package/cjs/focus-trap/focus-trap.cjs +11 -0
  18. package/cjs/focus-trap/focus-trap.d.cts +27 -0
  19. package/cjs/focus-trap/focus-trap.d.ts +27 -0
  20. package/cjs/group/group-label-context.cjs +6 -0
  21. package/cjs/group/group-label-context.d.cts +2 -0
  22. package/cjs/group/group-label-context.d.ts +2 -0
  23. package/cjs/group/group-label.cjs +41 -0
  24. package/cjs/group/group-label.d.cts +34 -0
  25. package/cjs/group/group-label.d.ts +34 -0
  26. package/cjs/group/group.cjs +43 -0
  27. package/cjs/group/group.d.cts +28 -0
  28. package/cjs/group/group.d.ts +28 -0
  29. package/cjs/heading/heading-context.cjs +6 -0
  30. package/cjs/heading/heading-context.d.cts +3 -0
  31. package/cjs/heading/heading-context.d.ts +3 -0
  32. package/cjs/heading/heading-level.cjs +23 -0
  33. package/cjs/heading/heading-level.d.cts +27 -0
  34. package/cjs/heading/heading-level.d.ts +27 -0
  35. package/cjs/heading/heading.cjs +45 -0
  36. package/cjs/heading/heading.d.cts +39 -0
  37. package/cjs/heading/heading.d.ts +39 -0
  38. package/cjs/heading/utils.cjs +1 -0
  39. package/cjs/heading/utils.d.cts +1 -0
  40. package/cjs/heading/utils.d.ts +1 -0
  41. package/cjs/role/role.cjs +26 -0
  42. package/cjs/role/role.d.cts +33 -0
  43. package/cjs/role/role.d.ts +33 -0
  44. package/cjs/separator/separator.cjs +30 -0
  45. package/cjs/separator/separator.d.cts +32 -0
  46. package/cjs/separator/separator.d.ts +32 -0
  47. package/cjs/utils/misc.cjs +8 -0
  48. package/cjs/utils/misc.d.cts +16 -0
  49. package/cjs/utils/misc.d.ts +16 -0
  50. package/cjs/utils/reactivity.cjs +12 -0
  51. package/cjs/utils/reactivity.d.cts +109 -0
  52. package/cjs/utils/reactivity.d.ts +109 -0
  53. package/cjs/utils/system.cjs +13 -0
  54. package/cjs/utils/system.d.cts +45 -0
  55. package/cjs/utils/system.d.ts +45 -0
  56. package/cjs/utils/types.cjs +1 -0
  57. package/cjs/utils/types.d.cts +56 -0
  58. package/cjs/utils/types.d.ts +56 -0
  59. package/cjs/visually-hidden/visually-hidden.cjs +10 -0
  60. package/cjs/visually-hidden/visually-hidden.d.cts +34 -0
  61. package/cjs/visually-hidden/visually-hidden.d.ts +34 -0
  62. package/esm/__chunks/I7JSIDPD.js +7 -0
  63. package/esm/__chunks/ILGMKAYU.js +37 -0
  64. package/esm/__chunks/NX66AMGW.js +39 -0
  65. package/esm/__chunks/OKOFCLOZ.js +61 -0
  66. package/esm/__chunks/QKOHDUFI.js +42 -0
  67. package/esm/__chunks/SFKMELHD.js +35 -0
  68. package/esm/__chunks/UKDBTPK5.js +21 -0
  69. package/esm/__chunks/VOWRNGOM.js +7 -0
  70. package/esm/as/as.d.ts +30 -0
  71. package/esm/as/as.js +7 -0
  72. package/esm/focus-trap/focus-trap-region.d.ts +38 -0
  73. package/esm/focus-trap/focus-trap-region.js +68 -0
  74. package/esm/focus-trap/focus-trap.d.ts +27 -0
  75. package/esm/focus-trap/focus-trap.js +11 -0
  76. package/esm/group/group-label-context.d.ts +2 -0
  77. package/esm/group/group-label-context.js +6 -0
  78. package/esm/group/group-label.d.ts +34 -0
  79. package/esm/group/group-label.js +41 -0
  80. package/esm/group/group.d.ts +28 -0
  81. package/esm/group/group.js +43 -0
  82. package/esm/heading/heading-context.d.ts +3 -0
  83. package/esm/heading/heading-context.js +6 -0
  84. package/esm/heading/heading-level.d.ts +27 -0
  85. package/esm/heading/heading-level.js +23 -0
  86. package/esm/heading/heading.d.ts +39 -0
  87. package/esm/heading/heading.js +45 -0
  88. package/esm/heading/utils.d.ts +1 -0
  89. package/esm/heading/utils.js +0 -0
  90. package/esm/role/role.d.ts +33 -0
  91. package/esm/role/role.js +26 -0
  92. package/esm/separator/separator.d.ts +32 -0
  93. package/esm/separator/separator.js +30 -0
  94. package/esm/utils/misc.d.ts +16 -0
  95. package/esm/utils/misc.js +8 -0
  96. package/esm/utils/reactivity.d.ts +109 -0
  97. package/esm/utils/reactivity.js +12 -0
  98. package/esm/utils/system.d.ts +45 -0
  99. package/esm/utils/system.js +13 -0
  100. package/esm/utils/types.d.ts +56 -0
  101. package/esm/utils/types.js +0 -0
  102. package/esm/visually-hidden/visually-hidden.d.ts +34 -0
  103. package/esm/visually-hidden/visually-hidden.js +10 -0
  104. package/focus-trap/focus-trap/package.json +8 -0
  105. package/focus-trap/focus-trap-region/package.json +8 -0
  106. package/group/group/package.json +8 -0
  107. package/group/group-label/package.json +8 -0
  108. package/group/group-label-context/package.json +8 -0
  109. package/heading/heading/package.json +8 -0
  110. package/heading/heading-context/package.json +8 -0
  111. package/heading/heading-level/package.json +8 -0
  112. package/heading/utils/package.json +8 -0
  113. package/index.ts +1 -0
  114. package/license +21 -0
  115. package/package.json +181 -6
  116. package/readme.md +19 -0
  117. package/role/role/package.json +8 -0
  118. package/separator/separator/package.json +8 -0
  119. package/solid/__chunks/ALJQAVR2.jsx +42 -0
  120. package/solid/__chunks/HBI7B4XO.jsx +52 -0
  121. package/solid/__chunks/HUX7TBVM.jsx +37 -0
  122. package/solid/__chunks/KXVBEYOF.jsx +21 -0
  123. package/solid/__chunks/O5QTZ2VS.jsx +42 -0
  124. package/solid/__chunks/PIGECGWJ.jsx +40 -0
  125. package/solid/__chunks/TCHPU5P4.jsx +7 -0
  126. package/solid/__chunks/VAA446IN.jsx +7 -0
  127. package/solid/as/as.jsx +7 -0
  128. package/solid/focus-trap/focus-trap-region.jsx +63 -0
  129. package/solid/focus-trap/focus-trap.jsx +11 -0
  130. package/solid/group/group-label-context.jsx +6 -0
  131. package/solid/group/group-label.jsx +50 -0
  132. package/solid/group/group.jsx +45 -0
  133. package/solid/heading/heading-context.jsx +6 -0
  134. package/solid/heading/heading-level.jsx +22 -0
  135. package/solid/heading/heading.jsx +52 -0
  136. package/solid/heading/utils.jsx +0 -0
  137. package/solid/role/role.jsx +59 -0
  138. package/solid/separator/separator.jsx +36 -0
  139. package/solid/utils/misc.jsx +8 -0
  140. package/solid/utils/reactivity.jsx +12 -0
  141. package/solid/utils/system.jsx +13 -0
  142. package/solid/utils/types.jsx +0 -0
  143. package/solid/visually-hidden/visually-hidden.jsx +10 -0
  144. package/tsconfig.build.json +4 -0
  145. package/utils/misc/package.json +8 -0
  146. package/utils/reactivity/package.json +8 -0
  147. package/utils/system/package.json +8 -0
  148. package/utils/types/package.json +8 -0
  149. 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
+ extractTagName
3
+ } from "../__chunks/KXVBEYOF.jsx";
4
+ import {
5
+ createHook,
6
+ createInstance
7
+ } from "../__chunks/HBI7B4XO.jsx";
8
+ import {
9
+ createRef,
10
+ mergeProps
11
+ } from "../__chunks/ALJQAVR2.jsx";
12
+ import {
13
+ HeadingContext
14
+ } from "../__chunks/VAA446IN.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
+ };
@@ -0,0 +1,8 @@
1
+ import {
2
+ createId,
3
+ extractTagName
4
+ } from "../__chunks/KXVBEYOF.jsx";
5
+ export {
6
+ createId,
7
+ extractTagName
8
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ createRef,
3
+ extractPropsWithDefaults,
4
+ mergeProps,
5
+ stableAccessor
6
+ } from "../__chunks/ALJQAVR2.jsx";
7
+ export {
8
+ createRef,
9
+ extractPropsWithDefaults,
10
+ mergeProps,
11
+ stableAccessor
12
+ };
@@ -0,0 +1,13 @@
1
+ import {
2
+ createHook,
3
+ createInstance,
4
+ withOptions,
5
+ wrapInstance
6
+ } from "../__chunks/HBI7B4XO.jsx";
7
+ import "../__chunks/ALJQAVR2.jsx";
8
+ export {
9
+ createHook,
10
+ createInstance,
11
+ withOptions,
12
+ wrapInstance
13
+ };
File without changes
@@ -0,0 +1,10 @@
1
+ import {
2
+ VisuallyHidden,
3
+ useVisuallyHidden
4
+ } from "../__chunks/PIGECGWJ.jsx";
5
+ import "../__chunks/HBI7B4XO.jsx";
6
+ import "../__chunks/ALJQAVR2.jsx";
7
+ export {
8
+ VisuallyHidden,
9
+ useVisuallyHidden
10
+ };
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../tsconfig.solid.json",
3
+ "include": ["src"]
4
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@ariakit/solid-core/utils/misc",
3
+ "private": true,
4
+ "sideEffects": false,
5
+ "main": "../../cjs/utils/misc.cjs",
6
+ "module": "../../esm/utils/misc.js",
7
+ "types": "../../cjs/utils/misc.d.ts"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@ariakit/solid-core/utils/reactivity",
3
+ "private": true,
4
+ "sideEffects": false,
5
+ "main": "../../cjs/utils/reactivity.cjs",
6
+ "module": "../../esm/utils/reactivity.js",
7
+ "types": "../../cjs/utils/reactivity.d.ts"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@ariakit/solid-core/utils/system",
3
+ "private": true,
4
+ "sideEffects": false,
5
+ "main": "../../cjs/utils/system.cjs",
6
+ "module": "../../esm/utils/system.js",
7
+ "types": "../../cjs/utils/system.d.ts"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@ariakit/solid-core/utils/types",
3
+ "private": true,
4
+ "sideEffects": false,
5
+ "main": "../../cjs/utils/types.cjs",
6
+ "module": "../../esm/utils/types.js",
7
+ "types": "../../cjs/utils/types.d.ts"
8
+ }
@@ -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
+ }