@entry-ui/qwik 0.8.0 → 0.9.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/lib/_internal/components/collapsible-panel/collapsible-panel.d.ts +13 -0
- package/lib/_internal/components/collapsible-panel/collapsible-panel.qwik.mjs +195 -0
- package/lib/_internal/components/collapsible-panel/collapsible-panel.types.d.ts +62 -0
- package/lib/_internal/components/collapsible-panel/index.d.ts +2 -0
- package/lib/_internal/components/index.d.ts +2 -0
- package/lib/_internal/components/indicator/index.d.ts +2 -0
- package/lib/_internal/components/indicator/indicator.d.ts +11 -0
- package/lib/_internal/components/indicator/indicator.qwik.mjs +27 -0
- package/lib/_internal/components/indicator/indicator.types.d.ts +15 -0
- package/lib/components/accordion/parts/accordion-item-indicator/accordion-item-indicator.qwik.mjs +4 -12
- package/lib/components/accordion/parts/accordion-item-panel/accordion-item-panel.qwik.mjs +10 -169
- package/lib/components/accordion/parts/accordion-root/accordion-root.qwik.mjs +6 -19
- package/lib/components/collapsible/parts/collapsible-indicator/collapsible-indicator.qwik.mjs +4 -12
- package/lib/components/collapsible/parts/collapsible-panel/collapsible-panel.qwik.mjs +10 -164
- package/lib/components/collapsible/parts/collapsible-root/collapsible-root.qwik.mjs +1 -18
- package/lib/components/copy-button/parts/copy-button-indicator/copy-button-indicator.qwik.mjs +3 -12
- package/lib/components/index.d.ts +2 -0
- package/lib/components/roving-focus-group/contexts/index.d.ts +2 -0
- package/lib/components/roving-focus-group/contexts/roving-focus-group-item-context/index.d.ts +2 -0
- package/lib/components/roving-focus-group/contexts/roving-focus-group-item-context/roving-focus-group-item-context.d.ts +6 -0
- package/lib/components/roving-focus-group/contexts/roving-focus-group-item-context/roving-focus-group-item-context.qwik.mjs +5 -0
- package/lib/components/roving-focus-group/contexts/roving-focus-group-item-context/roving-focus-group-item-context.types.d.ts +22 -0
- package/lib/components/roving-focus-group/contexts/roving-focus-group-root-context/index.d.ts +2 -0
- package/lib/components/roving-focus-group/contexts/roving-focus-group-root-context/roving-focus-group-root-context.d.ts +11 -0
- package/lib/components/roving-focus-group/contexts/roving-focus-group-root-context/roving-focus-group-root-context.qwik.mjs +10 -0
- package/lib/components/roving-focus-group/contexts/roving-focus-group-root-context/roving-focus-group-root-context.types.d.ts +37 -0
- package/lib/components/roving-focus-group/hooks/index.d.ts +2 -0
- package/lib/components/roving-focus-group/hooks/use-roving-focus-group-item-context/index.d.ts +2 -0
- package/lib/components/roving-focus-group/hooks/use-roving-focus-group-item-context/use-roving-focus-group-item-context.d.ts +7 -0
- package/lib/components/roving-focus-group/hooks/use-roving-focus-group-item-context/use-roving-focus-group-item-context.qwik.mjs +13 -0
- package/lib/components/roving-focus-group/hooks/use-roving-focus-group-item-context/use-roving-focus-group-item-context.types.d.ts +22 -0
- package/lib/components/roving-focus-group/hooks/use-roving-focus-group-root-context/index.d.ts +2 -0
- package/lib/components/roving-focus-group/hooks/use-roving-focus-group-root-context/use-roving-focus-group-root-context.d.ts +8 -0
- package/lib/components/roving-focus-group/hooks/use-roving-focus-group-root-context/use-roving-focus-group-root-context.qwik.mjs +13 -0
- package/lib/components/roving-focus-group/hooks/use-roving-focus-group-root-context/use-roving-focus-group-root-context.types.d.ts +22 -0
- package/lib/components/roving-focus-group/index.d.ts +2 -0
- package/lib/components/roving-focus-group/index.qwik.mjs +8 -0
- package/lib/components/roving-focus-group/parts/index.d.ts +4 -0
- package/lib/components/roving-focus-group/parts/index.qwik.mjs +6 -0
- package/lib/components/roving-focus-group/parts/roving-focus-group-item/index.d.ts +2 -0
- package/lib/components/roving-focus-group/parts/roving-focus-group-item/roving-focus-group-item.d.ts +7 -0
- package/lib/components/roving-focus-group/parts/roving-focus-group-item/roving-focus-group-item.qwik.mjs +160 -0
- package/lib/components/roving-focus-group/parts/roving-focus-group-item/roving-focus-group-item.types.d.ts +29 -0
- package/lib/components/roving-focus-group/parts/roving-focus-group-root/index.d.ts +2 -0
- package/lib/components/roving-focus-group/parts/roving-focus-group-root/roving-focus-group-root.d.ts +7 -0
- package/lib/components/roving-focus-group/parts/roving-focus-group-root/roving-focus-group-root.qwik.mjs +49 -0
- package/lib/components/roving-focus-group/parts/roving-focus-group-root/roving-focus-group-root.types.d.ts +59 -0
- package/lib/components/tabs/contexts/index.d.ts +4 -0
- package/lib/components/tabs/contexts/tabs-list-context/index.d.ts +2 -0
- package/lib/components/tabs/contexts/tabs-list-context/tabs-list-context.d.ts +11 -0
- package/lib/components/tabs/contexts/tabs-list-context/tabs-list-context.qwik.mjs +10 -0
- package/lib/components/tabs/contexts/tabs-list-context/tabs-list-context.types.d.ts +12 -0
- package/lib/components/tabs/contexts/tabs-panel-context/index.d.ts +2 -0
- package/lib/components/tabs/contexts/tabs-panel-context/tabs-panel-context.d.ts +6 -0
- package/lib/components/tabs/contexts/tabs-panel-context/tabs-panel-context.qwik.mjs +5 -0
- package/lib/components/tabs/contexts/tabs-panel-context/tabs-panel-context.types.d.ts +12 -0
- package/lib/components/tabs/contexts/tabs-root-context/index.d.ts +2 -0
- package/lib/components/tabs/contexts/tabs-root-context/tabs-root-context.d.ts +11 -0
- package/lib/components/tabs/contexts/tabs-root-context/tabs-root-context.qwik.mjs +10 -0
- package/lib/components/tabs/contexts/tabs-root-context/tabs-root-context.types.d.ts +33 -0
- package/lib/components/tabs/contexts/tabs-tab-context/index.d.ts +2 -0
- package/lib/components/tabs/contexts/tabs-tab-context/tabs-tab-context.d.ts +6 -0
- package/lib/components/tabs/contexts/tabs-tab-context/tabs-tab-context.qwik.mjs +5 -0
- package/lib/components/tabs/contexts/tabs-tab-context/tabs-tab-context.types.d.ts +22 -0
- package/lib/components/tabs/hooks/index.d.ts +3 -0
- package/lib/components/tabs/hooks/use-tabs-panel-context/index.d.ts +2 -0
- package/lib/components/tabs/hooks/use-tabs-panel-context/use-tabs-panel-context.d.ts +8 -0
- package/lib/components/tabs/hooks/use-tabs-panel-context/use-tabs-panel-context.qwik.mjs +11 -0
- package/lib/components/tabs/hooks/use-tabs-panel-context/use-tabs-panel-context.types.d.ts +12 -0
- package/lib/components/tabs/hooks/use-tabs-root-context/index.d.ts +2 -0
- package/lib/components/tabs/hooks/use-tabs-root-context/use-tabs-root-context.d.ts +8 -0
- package/lib/components/tabs/hooks/use-tabs-root-context/use-tabs-root-context.qwik.mjs +13 -0
- package/lib/components/tabs/hooks/use-tabs-root-context/use-tabs-root-context.types.d.ts +22 -0
- package/lib/components/tabs/hooks/use-tabs-tab-context/index.d.ts +2 -0
- package/lib/components/tabs/hooks/use-tabs-tab-context/use-tabs-tab-context.d.ts +7 -0
- package/lib/components/tabs/hooks/use-tabs-tab-context/use-tabs-tab-context.qwik.mjs +13 -0
- package/lib/components/tabs/hooks/use-tabs-tab-context/use-tabs-tab-context.types.d.ts +22 -0
- package/lib/components/tabs/index.d.ts +2 -0
- package/lib/components/tabs/index.qwik.mjs +10 -0
- package/lib/components/tabs/parts/index.d.ts +8 -0
- package/lib/components/tabs/parts/index.qwik.mjs +10 -0
- package/lib/components/tabs/parts/tabs-list/index.d.ts +2 -0
- package/lib/components/tabs/parts/tabs-list/tabs-list.d.ts +7 -0
- package/lib/components/tabs/parts/tabs-list/tabs-list.qwik.mjs +37 -0
- package/lib/components/tabs/parts/tabs-list/tabs-list.types.d.ts +30 -0
- package/lib/components/tabs/parts/tabs-panel/index.d.ts +2 -0
- package/lib/components/tabs/parts/tabs-panel/tabs-panel.d.ts +7 -0
- package/lib/components/tabs/parts/tabs-panel/tabs-panel.qwik.mjs +39 -0
- package/lib/components/tabs/parts/tabs-panel/tabs-panel.types.d.ts +27 -0
- package/lib/components/tabs/parts/tabs-root/index.d.ts +2 -0
- package/lib/components/tabs/parts/tabs-root/tabs-root.d.ts +7 -0
- package/lib/components/tabs/parts/tabs-root/tabs-root.qwik.mjs +34 -0
- package/lib/components/tabs/parts/tabs-root/tabs-root.types.d.ts +50 -0
- package/lib/components/tabs/parts/tabs-tab/index.d.ts +2 -0
- package/lib/components/tabs/parts/tabs-tab/tabs-tab.d.ts +7 -0
- package/lib/components/tabs/parts/tabs-tab/tabs-tab.qwik.mjs +87 -0
- package/lib/components/tabs/parts/tabs-tab/tabs-tab.types.d.ts +25 -0
- package/lib/hooks/use-clipboard/use-clipboard.qwik.mjs +8 -2
- package/lib/index.qwik.mjs +18 -4
- package/package.json +10 -2
|
@@ -1,188 +1,34 @@
|
|
|
1
1
|
import { jsx } from "@qwik.dev/core/jsx-runtime";
|
|
2
|
-
import { component$, useSignal,
|
|
3
|
-
import { getComputedStyle } from "@entry-ui/utilities/get-computed-style";
|
|
4
|
-
import { getHiddenElementHeight } from "@entry-ui/utilities/get-hidden-element-height";
|
|
5
|
-
import { addEventListenerOnce } from "@entry-ui/utilities/add-event-listener-once";
|
|
2
|
+
import { component$, useSignal, $, Slot } from "@qwik.dev/core";
|
|
6
3
|
import { useLifecycle } from "../../../../hooks/use-lifecycle/use-lifecycle.qwik.mjs";
|
|
7
|
-
import { mergeStyles } from "../../../../utilities/merge-styles/merge-styles.qwik.mjs";
|
|
8
4
|
import { mergeRefs } from "../../../../utilities/merge-refs/merge-refs.qwik.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import { Primitive } from "../../../../_internal/components/primitive/primitive.qwik.mjs";
|
|
5
|
+
import { CollapsiblePanel as CollapsiblePanel$1 } from "../../../../_internal/components/collapsible-panel/collapsible-panel.qwik.mjs";
|
|
11
6
|
import { useCollapsibleRootContext } from "../../contexts/collapsible-root-context/collapsible-root-context.qwik.mjs";
|
|
12
7
|
const CollapsiblePanel = component$((props) => {
|
|
13
|
-
const { as = "div", ref: _ref, id, hiddenUntilFound
|
|
8
|
+
const { as = "div", ref: _ref, id, hiddenUntilFound = false, ...others } = props;
|
|
14
9
|
const { open, setOpen$, disabled, panelId, triggerId } = useCollapsibleRootContext();
|
|
15
10
|
const ref = useSignal(void 0);
|
|
16
|
-
const hidden = useSignal(!open.value);
|
|
17
|
-
const state = useSignal(open.value ? "open" : "closed");
|
|
18
|
-
const height = useSignal(open.value ? "auto" : _hiddenUntilFound ? disabled.value ? "0px" : "none" : "0px");
|
|
19
|
-
const isBeforeMatch = useSignal(false);
|
|
20
|
-
const preventInitialAnimation = useSignal(true);
|
|
21
|
-
const hiddenUntilFound = useComputed$(() => disabled.value ? false : _hiddenUntilFound);
|
|
22
|
-
const mergedStyles = useComputed$(() => mergeStyles([
|
|
23
|
-
{
|
|
24
|
-
display: hidden.value ? hiddenUntilFound.value ? void 0 : "none !important" : void 0,
|
|
25
|
-
transitionDuration: preventInitialAnimation.value ? "0s" : void 0,
|
|
26
|
-
animationDuration: preventInitialAnimation.value ? "0s" : void 0,
|
|
27
|
-
"--entry-ui-qwik-collapsible-panel-height": height.value
|
|
28
|
-
},
|
|
29
|
-
style
|
|
30
|
-
]));
|
|
31
11
|
useLifecycle({
|
|
32
12
|
element: ref,
|
|
33
13
|
onMount$: $(() => panelId.set$(id)),
|
|
34
14
|
onUnmount$: $(() => panelId.delete$())
|
|
35
15
|
});
|
|
36
|
-
|
|
37
|
-
const isHiddenUntilFound = track(() => hiddenUntilFound.value);
|
|
38
|
-
const panelRef = ref.value;
|
|
39
|
-
if (isBrowser && panelRef) {
|
|
40
|
-
const panelHeight = open.value ? "auto" : isHiddenUntilFound ? "none" : "0px";
|
|
41
|
-
height.value = panelHeight;
|
|
42
|
-
panelRef.style.setProperty("--entry-ui-qwik-collapsible-panel-height", panelHeight);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
useTask$(({ track, cleanup }) => {
|
|
46
|
-
const isOpen = track(() => open.value);
|
|
47
|
-
const panelRef = ref.value;
|
|
48
|
-
if (isBrowser && panelRef) {
|
|
49
|
-
if (preventInitialAnimation.value && !isBeforeMatch.value) {
|
|
50
|
-
preventInitialAnimation.value = false;
|
|
51
|
-
panelRef.style.removeProperty("transition-duration");
|
|
52
|
-
panelRef.style.removeProperty("animation-duration");
|
|
53
|
-
}
|
|
54
|
-
if (isOpen) {
|
|
55
|
-
hidden.value = false;
|
|
56
|
-
panelRef.removeAttribute("hidden");
|
|
57
|
-
if (hiddenUntilFound.value) {
|
|
58
|
-
isBeforeMatch.value = false;
|
|
59
|
-
} else {
|
|
60
|
-
panelRef.style.removeProperty("display");
|
|
61
|
-
}
|
|
62
|
-
state.value = "open";
|
|
63
|
-
panelRef.setAttribute("data-state", "open");
|
|
64
|
-
const { animationDuration: animationDuration2, transitionDuration: transitionDuration2 } = getComputedStyle(panelRef);
|
|
65
|
-
const panelHeight = getHiddenElementHeight(panelRef);
|
|
66
|
-
if (animationDuration2 === "0s" && transitionDuration2 !== "0s") {
|
|
67
|
-
if (height.value === "none") {
|
|
68
|
-
height.value = "0px";
|
|
69
|
-
panelRef.style.setProperty("--entry-ui-qwik-collapsible-panel-height", "0px");
|
|
70
|
-
setTimeout(() => {
|
|
71
|
-
height.value = `${panelHeight}px`;
|
|
72
|
-
panelRef.style.setProperty("--entry-ui-qwik-collapsible-panel-height", `${panelHeight}px`);
|
|
73
|
-
}, 0);
|
|
74
|
-
} else {
|
|
75
|
-
height.value = `${panelHeight}px`;
|
|
76
|
-
panelRef.style.setProperty("--entry-ui-qwik-collapsible-panel-height", `${panelHeight}px`);
|
|
77
|
-
}
|
|
78
|
-
} else {
|
|
79
|
-
height.value = `${panelHeight}px`;
|
|
80
|
-
panelRef.style.setProperty("--entry-ui-qwik-collapsible-panel-height", `${panelHeight}px`);
|
|
81
|
-
}
|
|
82
|
-
} else {
|
|
83
|
-
state.value = "closed";
|
|
84
|
-
panelRef.setAttribute("data-state", "closed");
|
|
85
|
-
const { animationDuration: animationDuration2, transitionDuration: transitionDuration2 } = getComputedStyle(panelRef);
|
|
86
|
-
const panelHeight = getHiddenElementHeight(panelRef);
|
|
87
|
-
if (animationDuration2 === "0s" && transitionDuration2 !== "0s") {
|
|
88
|
-
if (height.value === "auto") {
|
|
89
|
-
height.value = `${panelHeight}px`;
|
|
90
|
-
panelRef.style.setProperty("--entry-ui-qwik-collapsible-panel-height", `${panelHeight}px`);
|
|
91
|
-
setTimeout(() => {
|
|
92
|
-
height.value = "0px";
|
|
93
|
-
panelRef.style.setProperty("--entry-ui-qwik-collapsible-panel-height", "0px");
|
|
94
|
-
}, 0);
|
|
95
|
-
} else {
|
|
96
|
-
height.value = "0px";
|
|
97
|
-
panelRef.style.setProperty("--entry-ui-qwik-collapsible-panel-height", "0px");
|
|
98
|
-
}
|
|
99
|
-
} else {
|
|
100
|
-
height.value = `${panelHeight}px`;
|
|
101
|
-
panelRef.style.setProperty("--entry-ui-qwik-collapsible-panel-height", `${panelHeight}px`);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
const applyFinalState = () => {
|
|
105
|
-
if (isOpen) {
|
|
106
|
-
height.value = "auto";
|
|
107
|
-
panelRef.style.setProperty("--entry-ui-qwik-collapsible-panel-height", "auto");
|
|
108
|
-
} else {
|
|
109
|
-
hidden.value = true;
|
|
110
|
-
if (hiddenUntilFound.value) {
|
|
111
|
-
height.value = "none";
|
|
112
|
-
panelRef.style.setProperty("--entry-ui-qwik-collapsible-panel-height", "none");
|
|
113
|
-
} else {
|
|
114
|
-
height.value = "0px";
|
|
115
|
-
panelRef.style.setProperty("--entry-ui-qwik-collapsible-panel-height", "0px");
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (onOpenChangeComplete$) {
|
|
119
|
-
onOpenChangeComplete$(isOpen);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
const { transitionDuration, animationDuration } = getComputedStyle(panelRef);
|
|
123
|
-
if (isDev && transitionDuration !== "0s" && animationDuration !== "0s") {
|
|
124
|
-
warn([
|
|
125
|
-
`Both CSS transitions and CSS animations are detected on 'Collapsible.Panel' component.`,
|
|
126
|
-
`Using both at the same time may cause unpredictable behavior.`,
|
|
127
|
-
`Please use only one animation method.`
|
|
128
|
-
]);
|
|
129
|
-
applyFinalState();
|
|
130
|
-
} else if (transitionDuration !== "0s") {
|
|
131
|
-
const removeTransitionEndListener = addEventListenerOnce({
|
|
132
|
-
target: panelRef,
|
|
133
|
-
type: "transitionend",
|
|
134
|
-
listener: applyFinalState
|
|
135
|
-
});
|
|
136
|
-
cleanup(() => {
|
|
137
|
-
removeTransitionEndListener();
|
|
138
|
-
});
|
|
139
|
-
} else if (animationDuration !== "0s") {
|
|
140
|
-
const removeAnimationEndListener = addEventListenerOnce({
|
|
141
|
-
target: panelRef,
|
|
142
|
-
type: "animationend",
|
|
143
|
-
listener: applyFinalState
|
|
144
|
-
});
|
|
145
|
-
cleanup(() => {
|
|
146
|
-
removeAnimationEndListener();
|
|
147
|
-
});
|
|
148
|
-
} else {
|
|
149
|
-
applyFinalState();
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
const handleBeforeMatchSync$ = sync$((event) => {
|
|
154
|
-
const entryUIQwikEvent = event;
|
|
155
|
-
if (!entryUIQwikEvent.entryUIQwikHandlerPrevented) {
|
|
156
|
-
event.preventDefault();
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
const handleBeforeMatch$ = $((event) => {
|
|
160
|
-
const entryUIQwikEvent = event;
|
|
161
|
-
if (!entryUIQwikEvent.entryUIQwikHandlerPrevented) {
|
|
162
|
-
isBeforeMatch.value = true;
|
|
163
|
-
preventInitialAnimation.value = true;
|
|
164
|
-
setOpen$(true);
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
16
|
+
return /* @__PURE__ */ jsx(CollapsiblePanel$1, {
|
|
168
17
|
as,
|
|
18
|
+
componentName: "Collapsible.Panel",
|
|
19
|
+
heightVariableName: "--entry-ui-qwik-collapsible-panel-height",
|
|
20
|
+
open: open.value,
|
|
21
|
+
setOpen$,
|
|
22
|
+
hiddenUntilFound,
|
|
23
|
+
disabled: disabled.value,
|
|
169
24
|
ref: mergeRefs([
|
|
170
25
|
_ref,
|
|
171
26
|
ref
|
|
172
27
|
]),
|
|
173
28
|
id: panelId.id.value,
|
|
174
29
|
role: triggerId.id.value ? "group" : void 0,
|
|
175
|
-
hidden: hidden.value ? hiddenUntilFound.value ? "until-found" : "hidden" : void 0,
|
|
176
30
|
"aria-labelledby": triggerId.id.value,
|
|
177
31
|
"data-entry-ui-qwik-collapsible-panel": "",
|
|
178
|
-
"data-state": state.value,
|
|
179
|
-
"data-disabled": disabled.value ? "" : void 0,
|
|
180
|
-
onBeforematch$: [
|
|
181
|
-
onBeforematch$,
|
|
182
|
-
handleBeforeMatchSync$,
|
|
183
|
-
handleBeforeMatch$
|
|
184
|
-
],
|
|
185
|
-
style: mergedStyles.value,
|
|
186
32
|
...others,
|
|
187
33
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
188
34
|
});
|
|
@@ -2,11 +2,10 @@ import { jsx } from "@qwik.dev/core/jsx-runtime";
|
|
|
2
2
|
import { component$, useComputed$, useContextProvider, Slot } from "@qwik.dev/core";
|
|
3
3
|
import { useControllable } from "../../../../hooks/use-controllable/use-controllable.qwik.mjs";
|
|
4
4
|
import { useIdManager } from "../../../../_internal/hooks/use-id-manager/use-id-manager.qwik.mjs";
|
|
5
|
-
import { mergeStyles } from "../../../../utilities/merge-styles/merge-styles.qwik.mjs";
|
|
6
5
|
import { Primitive } from "../../../../_internal/components/primitive/primitive.qwik.mjs";
|
|
7
6
|
import { CollapsibleRootContext } from "../../contexts/collapsible-root-context/collapsible-root-context.qwik.mjs";
|
|
8
7
|
const CollapsibleRoot = component$((props) => {
|
|
9
|
-
const { as = "div", defaultOpen, open: _open, onOpenChange$, disabled: _disabled = false,
|
|
8
|
+
const { as = "div", defaultOpen, open: _open, onOpenChange$, disabled: _disabled = false, ...others } = props;
|
|
10
9
|
const { state: open, setState$: setOpen$ } = useControllable({
|
|
11
10
|
defaultValue: defaultOpen ?? false,
|
|
12
11
|
controlledSignal: _open,
|
|
@@ -31,22 +30,6 @@ const CollapsibleRoot = component$((props) => {
|
|
|
31
30
|
"data-entry-ui-qwik-collapsible-root": "",
|
|
32
31
|
"data-state": open.value ? "open" : "closed",
|
|
33
32
|
"data-disabled": disabled.value ? "" : void 0,
|
|
34
|
-
style: mergeStyles([
|
|
35
|
-
{
|
|
36
|
-
// Performance optimization
|
|
37
|
-
// The `contain: layout style;` CSS property is used here to improve rendering performance.
|
|
38
|
-
// `contain: layout;` tells the browser that the internal layout of this component
|
|
39
|
-
// is self-contained and does not affect the layout of elements outside of it. This prevents
|
|
40
|
-
// costly re-calculations of the entire page layout when the collapsible panel expands or collapses,
|
|
41
|
-
// which is especially beneficial during animations.
|
|
42
|
-
// `contain: style;` ensures that CSS properties that can affect the rest of the page,
|
|
43
|
-
// like counters, are isolated to this element.
|
|
44
|
-
// Together, these properties create a performance "bubble," allowing the browser to optimize
|
|
45
|
-
// rendering by treating the collapsible component as an independent unit.
|
|
46
|
-
contain: "layout style"
|
|
47
|
-
},
|
|
48
|
-
style
|
|
49
|
-
]),
|
|
50
33
|
...others,
|
|
51
34
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
52
35
|
});
|
package/lib/components/copy-button/parts/copy-button-indicator/copy-button-indicator.qwik.mjs
CHANGED
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
import { jsx } from "@qwik.dev/core/jsx-runtime";
|
|
2
2
|
import { component$, Slot } from "@qwik.dev/core";
|
|
3
|
-
import {
|
|
4
|
-
import { Primitive } from "../../../../_internal/components/primitive/primitive.qwik.mjs";
|
|
3
|
+
import { Indicator } from "../../../../_internal/components/indicator/indicator.qwik.mjs";
|
|
5
4
|
import { useCopyButtonRootContext } from "../../contexts/copy-button-root-context/copy-button-root-context.qwik.mjs";
|
|
6
5
|
const CopyButtonIndicator = component$((props) => {
|
|
7
|
-
const { as = "span",
|
|
6
|
+
const { as = "span", ...others } = props;
|
|
8
7
|
const { copied, error, disabled } = useCopyButtonRootContext();
|
|
9
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
+
return /* @__PURE__ */ jsx(Indicator, {
|
|
10
9
|
as,
|
|
11
|
-
"aria-hidden": "true",
|
|
12
10
|
"data-entry-ui-qwik-copy-button-indicator": "",
|
|
13
11
|
"data-copied": copied.value ? "" : void 0,
|
|
14
12
|
"data-error": error.value ? "" : void 0,
|
|
15
13
|
"data-disabled": disabled.value ? "" : void 0,
|
|
16
|
-
style: mergeStyles([
|
|
17
|
-
{
|
|
18
|
-
pointerEvents: "none",
|
|
19
|
-
userSelect: "none"
|
|
20
|
-
},
|
|
21
|
-
style
|
|
22
|
-
]),
|
|
23
14
|
...others,
|
|
24
15
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
25
16
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RovingFocusGroupItemContextValue } from './roving-focus-group-item-context.types';
|
|
2
|
+
/**
|
|
3
|
+
* Provides the context for the `RovingFocusGroup.Item` component, allowing descendant
|
|
4
|
+
* components to access readonly signals without prop drilling.
|
|
5
|
+
*/
|
|
6
|
+
export declare const RovingFocusGroupItemContext: import("@qwik.dev/core").ContextId<RovingFocusGroupItemContextValue>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReadonlySignal } from '@qwik.dev/core';
|
|
2
|
+
/**
|
|
3
|
+
* The value provided by the `RovingFocusGroupItemContext` context.
|
|
4
|
+
* Contains the readonly signals shared with descendant components.
|
|
5
|
+
*/
|
|
6
|
+
export interface RovingFocusGroupItemContextValue {
|
|
7
|
+
/**
|
|
8
|
+
* A readonly signal whose value is the unique identifier for the specific roving focus item.
|
|
9
|
+
* This ID is used to track and manage the item's active state within the group.
|
|
10
|
+
*/
|
|
11
|
+
tabStopId: ReadonlySignal<string>;
|
|
12
|
+
/**
|
|
13
|
+
* A readonly signal whose value indicates whether this specific item is currently the active tab stop.
|
|
14
|
+
* When `true`, the item's `tabIndex` is set to `0`, allowing it to receive keyboard focus.
|
|
15
|
+
*/
|
|
16
|
+
active: ReadonlySignal<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* A readonly signal specifying if the item is capable of receiving focus.
|
|
19
|
+
* When `false`, the item is skipped during navigation and cannot be activated by the user.
|
|
20
|
+
*/
|
|
21
|
+
focusable: ReadonlySignal<boolean>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RovingFocusGroupRootContextValue } from './roving-focus-group-root-context.types';
|
|
2
|
+
/**
|
|
3
|
+
* Provides the context for the `RovingFocusGroup.Root` component, allowing descendant
|
|
4
|
+
* components to access readonly signals and `QRL` functions without prop drilling.
|
|
5
|
+
*/
|
|
6
|
+
export declare const RovingFocusGroupRootContext: import("@qwik.dev/core").ContextId<RovingFocusGroupRootContextValue>;
|
|
7
|
+
/**
|
|
8
|
+
* A hook that provides access to the `RovingFocusGroup.Root` component's internal state.
|
|
9
|
+
* It exposes readonly signals and `QRL` functions to interact with the component's state,
|
|
10
|
+
*/
|
|
11
|
+
export declare const useRovingFocusGroupRootContext: () => RovingFocusGroupRootContextValue;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContextId, useContext } from "@qwik.dev/core";
|
|
2
|
+
const RovingFocusGroupRootContext = createContextId("entry-ui-qwik-roving-focus-group-root-context");
|
|
3
|
+
const useRovingFocusGroupRootContext = () => {
|
|
4
|
+
const context = useContext(RovingFocusGroupRootContext);
|
|
5
|
+
return context;
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
RovingFocusGroupRootContext,
|
|
9
|
+
useRovingFocusGroupRootContext
|
|
10
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReadonlySignal, QRL } from '@qwik.dev/core';
|
|
2
|
+
/**
|
|
3
|
+
* The value provided by the `RovingFocusGroupRootContext` context.
|
|
4
|
+
* Contains the readonly signals and `QRL` functions shared with descendant components.
|
|
5
|
+
*/
|
|
6
|
+
export interface RovingFocusGroupRootContextValue {
|
|
7
|
+
/**
|
|
8
|
+
* A readonly signal whose value is a string representing the ID of the item that is currently active.
|
|
9
|
+
* This signal reflects the internal state of which item within the group holds the tab stop.
|
|
10
|
+
*/
|
|
11
|
+
currentTabStopId: ReadonlySignal<string>;
|
|
12
|
+
/**
|
|
13
|
+
* A `QRL` function used to programmatically set the active tab stop.
|
|
14
|
+
* This function takes a string representing the ID of the item that should become focusable.
|
|
15
|
+
*/
|
|
16
|
+
setCurrentTabStopId$: QRL<(tabStopId: string) => void>;
|
|
17
|
+
/**
|
|
18
|
+
* A `QRL` function that retrieves an ordered array of focusable HTML elements within the group.
|
|
19
|
+
* This is used to calculate the next or previous item during keyboard navigation, filtering out disabled elements.
|
|
20
|
+
*/
|
|
21
|
+
getItems$: QRL<() => HTMLElement[]>;
|
|
22
|
+
/**
|
|
23
|
+
* A readonly signal indicating whether the keyboard navigation should wrap around
|
|
24
|
+
* when reaching the first or last item in the group.
|
|
25
|
+
*/
|
|
26
|
+
loopFocus: ReadonlySignal<boolean>;
|
|
27
|
+
/**
|
|
28
|
+
* A readonly signal representing the reading direction of the group.
|
|
29
|
+
* This affects how horizontal arrow keys navigate through the items.
|
|
30
|
+
*/
|
|
31
|
+
dir: ReadonlySignal<'ltr' | 'rtl'>;
|
|
32
|
+
/**
|
|
33
|
+
* A readonly signal specifying the allowed navigation axes.
|
|
34
|
+
* It determines whether the group responds to horizontal, vertical, or both sets of arrow keys.
|
|
35
|
+
*/
|
|
36
|
+
orientation: ReadonlySignal<'horizontal' | 'vertical' | 'both'>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UseRovingFocusGroupItemContextReturnValue } from './use-roving-focus-group-item-context.types';
|
|
2
|
+
/**
|
|
3
|
+
* A hook that provides access to the `RovingFocusGroup.Item` component's internal state.
|
|
4
|
+
* It exposes readonly signals that allow descendant components to react to the item's
|
|
5
|
+
* active state, its identifier, and whether it is currently focusable within the group.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useRovingFocusGroupItemContext: () => UseRovingFocusGroupItemContextReturnValue;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useContext } from "@qwik.dev/core";
|
|
2
|
+
import { RovingFocusGroupItemContext } from "../../contexts/roving-focus-group-item-context/roving-focus-group-item-context.qwik.mjs";
|
|
3
|
+
const useRovingFocusGroupItemContext = () => {
|
|
4
|
+
const { tabStopId, active, focusable } = useContext(RovingFocusGroupItemContext);
|
|
5
|
+
return {
|
|
6
|
+
tabStopId,
|
|
7
|
+
active,
|
|
8
|
+
focusable
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
useRovingFocusGroupItemContext
|
|
13
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReadonlySignal } from '@qwik.dev/core';
|
|
2
|
+
/**
|
|
3
|
+
* The value returned by the `useRovingFocusGroupItemContext` hook.
|
|
4
|
+
* Provides access to the roving focus item's readonly signals for descendant components.
|
|
5
|
+
*/
|
|
6
|
+
export interface UseRovingFocusGroupItemContextReturnValue {
|
|
7
|
+
/**
|
|
8
|
+
* A readonly signal whose value is the unique identifier for the specific roving focus item.
|
|
9
|
+
* This ID is used to track and manage the item's active state within the group.
|
|
10
|
+
*/
|
|
11
|
+
tabStopId: ReadonlySignal<string>;
|
|
12
|
+
/**
|
|
13
|
+
* A readonly signal whose value indicates whether this specific item is currently the active tab stop.
|
|
14
|
+
* When `true`, the item's `tabIndex` is set to `0`, allowing it to receive keyboard focus.
|
|
15
|
+
*/
|
|
16
|
+
active: ReadonlySignal<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* A readonly signal specifying if the item is capable of receiving focus.
|
|
19
|
+
* When `false`, the item is skipped during navigation and cannot be activated by the user.
|
|
20
|
+
*/
|
|
21
|
+
focusable: ReadonlySignal<boolean>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UseRovingFocusGroupRootContextReturnValue } from './use-roving-focus-group-root-context.types';
|
|
2
|
+
/**
|
|
3
|
+
* A hook that provides access to the `RovingFocusGroup.Root` component's internal state.
|
|
4
|
+
* It exposes readonly signals and a `QRL` function to interact with the roving focus state,
|
|
5
|
+
* allowing descendant components to synchronize with or programmatically control
|
|
6
|
+
* which item currently holds the tab stop and is eligible for focus.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useRovingFocusGroupRootContext: () => UseRovingFocusGroupRootContextReturnValue;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useContext } from "@qwik.dev/core";
|
|
2
|
+
import { RovingFocusGroupRootContext } from "../../contexts/roving-focus-group-root-context/roving-focus-group-root-context.qwik.mjs";
|
|
3
|
+
const useRovingFocusGroupRootContext = () => {
|
|
4
|
+
const { currentTabStopId, setCurrentTabStopId$, orientation } = useContext(RovingFocusGroupRootContext);
|
|
5
|
+
return {
|
|
6
|
+
currentTabStopId,
|
|
7
|
+
setCurrentTabStopId$,
|
|
8
|
+
orientation
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
useRovingFocusGroupRootContext
|
|
13
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReadonlySignal, QRL } from '@qwik.dev/core';
|
|
2
|
+
/**
|
|
3
|
+
* The value returned by the `useRovingFocusGroupRootContext` hook.
|
|
4
|
+
* Provides access to the roving focus group's readonly signals and `QRL` function for descendant components.
|
|
5
|
+
*/
|
|
6
|
+
export interface UseRovingFocusGroupRootContextReturnValue {
|
|
7
|
+
/**
|
|
8
|
+
* A readonly signal whose value is a string representing the ID of the item that is currently active.
|
|
9
|
+
* This signal reflects the internal state of which item within the group holds the tab stop.
|
|
10
|
+
*/
|
|
11
|
+
currentTabStopId: ReadonlySignal<string>;
|
|
12
|
+
/**
|
|
13
|
+
* A `QRL` function used to programmatically set the active tab stop.
|
|
14
|
+
* This function takes a string representing the ID of the item that should become focusable.
|
|
15
|
+
*/
|
|
16
|
+
setCurrentTabStopId$: QRL<(tabStopId: string) => void>;
|
|
17
|
+
/**
|
|
18
|
+
* A readonly signal specifying the allowed navigation axes.
|
|
19
|
+
* It determines whether the group responds to horizontal, vertical, or both sets of arrow keys.
|
|
20
|
+
*/
|
|
21
|
+
orientation: ReadonlySignal<'horizontal' | 'vertical' | 'both'>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as index from "./parts/index.qwik.mjs";
|
|
2
|
+
import { useRovingFocusGroupRootContext } from "./hooks/use-roving-focus-group-root-context/use-roving-focus-group-root-context.qwik.mjs";
|
|
3
|
+
import { useRovingFocusGroupItemContext } from "./hooks/use-roving-focus-group-item-context/use-roving-focus-group-item-context.qwik.mjs";
|
|
4
|
+
export {
|
|
5
|
+
index as RovingFocusGroup,
|
|
6
|
+
useRovingFocusGroupItemContext,
|
|
7
|
+
useRovingFocusGroupRootContext
|
|
8
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { RovingFocusGroupRootProps as RootProps } from './roving-focus-group-root';
|
|
2
|
+
export type { RovingFocusGroupItemProps as ItemProps } from './roving-focus-group-item';
|
|
3
|
+
export { RovingFocusGroupRoot as Root } from './roving-focus-group-root';
|
|
4
|
+
export { RovingFocusGroupItem as Item } from './roving-focus-group-item';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RovingFocusGroupRoot } from "./roving-focus-group-root/roving-focus-group-root.qwik.mjs";
|
|
2
|
+
import { RovingFocusGroupItem } from "./roving-focus-group-item/roving-focus-group-item.qwik.mjs";
|
|
3
|
+
export {
|
|
4
|
+
RovingFocusGroupItem as Item,
|
|
5
|
+
RovingFocusGroupRoot as Root
|
|
6
|
+
};
|
package/lib/components/roving-focus-group/parts/roving-focus-group-item/roving-focus-group-item.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RovingFocusGroupItemProps } from './roving-focus-group-item.types';
|
|
2
|
+
/**
|
|
3
|
+
* An individual item within the roving focus group.
|
|
4
|
+
*
|
|
5
|
+
* Renders a `<div>` element.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RovingFocusGroupItem: import("@qwik.dev/core").Component<RovingFocusGroupItemProps>;
|