@funstack/ui 0.1.0-alpha.5 → 0.1.0-alpha.6
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/accordion/accordion-item.mjs +2 -2
- package/dist/accordion/accordion-panel.mjs +2 -2
- package/dist/accordion/accordion-root.mjs +3 -3
- package/dist/accordion/accordion-trigger.mjs +2 -2
- package/dist/button/button.d.mts +78 -0
- package/dist/button/button.d.mts.map +1 -0
- package/dist/button/button.mjs +77 -0
- package/dist/button/button.mjs.map +1 -0
- package/dist/button/index.d.mts +3 -0
- package/dist/button/index.mjs +1 -0
- package/dist/checkbox/checkbox.mjs +2 -2
- package/dist/checkbox-group/checkbox-group-item.mjs +1 -1
- package/dist/checkbox-group/checkbox-group-parent.mjs +1 -1
- package/dist/checkbox-group/checkbox-group-root.mjs +1 -1
- package/dist/combobox/combobox-group.mjs +1 -1
- package/dist/combobox/combobox-list.mjs +1 -1
- package/dist/combobox/combobox-option.mjs +1 -1
- package/dist/combobox/combobox-popup.mjs +2 -2
- package/dist/combobox/combobox-root.mjs +3 -3
- package/dist/dialog/dialog-close.mjs +1 -1
- package/dist/dialog/dialog-form.mjs +1 -1
- package/dist/dialog/dialog-popup.mjs +3 -3
- package/dist/dialog/dialog-root.mjs +2 -2
- package/dist/field/field-root.mjs +3 -3
- package/dist/form/form-root.mjs +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +2 -1
- package/dist/internal/render-element.mjs +18 -5
- package/dist/internal/render-element.mjs.map +1 -1
- package/dist/internal/use-action-trigger.mjs +15 -6
- package/dist/internal/use-action-trigger.mjs.map +1 -1
- package/dist/internal/use-field-control.mjs +1 -1
- package/dist/internal/use-popover-root.mjs +1 -1
- package/dist/internal/use-render.mjs +2 -2
- package/dist/internal/use-render.mjs.map +1 -1
- package/dist/menu/menu-checkbox-item.mjs +2 -2
- package/dist/menu/menu-group.mjs +1 -1
- package/dist/menu/menu-item.mjs +1 -1
- package/dist/menu/menu-popup.mjs +1 -1
- package/dist/menu/menu-radio-group.mjs +1 -1
- package/dist/menu/menu-root.mjs +1 -1
- package/dist/menu/menu-submenu-trigger.mjs +1 -1
- package/dist/menu/menu-trigger.mjs +1 -1
- package/dist/number-field/number-field-increment.mjs +1 -1
- package/dist/number-field/number-field-input.mjs +1 -1
- package/dist/number-field/number-field-root.mjs +4 -4
- package/dist/popover/popover-close.mjs +1 -1
- package/dist/popover/popover-popup.mjs +2 -2
- package/dist/radio-group/radio-group-item.mjs +1 -1
- package/dist/radio-group/radio-group-root.mjs +1 -1
- package/dist/select/select-root.mjs +1 -1
- package/dist/slider/slider-root.mjs +5 -5
- package/dist/slider/slider-thumb.mjs +1 -1
- package/dist/slider/slider-value.mjs +1 -1
- package/dist/switch/switch.mjs +2 -2
- package/dist/tabs/tabs-list.mjs +1 -1
- package/dist/tabs/tabs-panel.mjs +1 -1
- package/dist/tabs/tabs-root.mjs +2 -2
- package/dist/tabs/tabs-tab.mjs +1 -1
- package/dist/toast/toast-action.mjs +1 -1
- package/dist/toast/toast-root.mjs +1 -1
- package/dist/toast/toast-viewport.mjs +3 -3
- package/dist/toggle/toggle.mjs +3 -3
- package/dist/toggle-group/toggle-group-item.mjs +1 -1
- package/dist/toggle-group/toggle-group-root.mjs +3 -3
- package/dist/toolbar/index.d.mts +4 -5
- package/dist/toolbar/index.d.mts.map +1 -1
- package/dist/toolbar/index.mjs +3 -4
- package/dist/toolbar/index.mjs.map +1 -1
- package/dist/toolbar/toolbar-root.mjs +1 -1
- package/dist/toolbar/toolbar-separator.mjs +1 -1
- package/package.json +2 -1
- package/dist/toolbar/toolbar-button.d.mts +0 -42
- package/dist/toolbar/toolbar-button.d.mts.map +0 -1
- package/dist/toolbar/toolbar-button.mjs +0 -50
- package/dist/toolbar/toolbar-button.mjs.map +0 -1
|
@@ -7,19 +7,23 @@ function report(error) {
|
|
|
7
7
|
else console.error(error);
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* The transition of a pure-trigger part: an `action` with no state of its own (`
|
|
11
|
-
* `Popover.Close`, `Menu.Item`; conventions 3.4). Same superseded-rejection
|
|
12
|
-
* `useControllableAction`: React keeps only the newest thenable per `useTransition`,
|
|
13
|
-
* rejection of a run that a later run superseded would be dropped. The hook catches it and
|
|
14
|
-
* it from render, so it reaches the same boundary as the latest run's rejection does.
|
|
10
|
+
* The transition of a pure-trigger part: an `action` with no state of its own (`Button`,
|
|
11
|
+
* `Dialog.Close`, `Popover.Close`, `Menu.Item`; conventions 3.4). Same superseded-rejection
|
|
12
|
+
* surfacing as `useControllableAction`: React keeps only the newest thenable per `useTransition`,
|
|
13
|
+
* so the rejection of a run that a later run superseded would be dropped. The hook catches it and
|
|
14
|
+
* throws it from render, so it reaches the same boundary as the latest run's rejection does.
|
|
15
|
+
*
|
|
16
|
+
* The argument is the options object, or (the older positional form) `openGeneration` alone.
|
|
15
17
|
*/
|
|
16
|
-
function useActionTrigger(
|
|
18
|
+
function useActionTrigger(options) {
|
|
19
|
+
const { openGeneration, ignoreWhilePending = false } = typeof options === "function" ? { openGeneration: options } : options ?? {};
|
|
17
20
|
const [supersededError, setSupersededError] = useState(null);
|
|
18
21
|
const hasSupersededError = useRef(false);
|
|
19
22
|
if (supersededError !== null) throw supersededError.error;
|
|
20
23
|
const [pending, startOwnTransition] = useTransition();
|
|
21
24
|
const latest = useRef(0);
|
|
22
25
|
const mounted = useRef(false);
|
|
26
|
+
const inFlight = useRef(0);
|
|
23
27
|
useEffect(() => {
|
|
24
28
|
mounted.current = true;
|
|
25
29
|
return () => {
|
|
@@ -27,12 +31,15 @@ function useActionTrigger(openGeneration) {
|
|
|
27
31
|
};
|
|
28
32
|
}, []);
|
|
29
33
|
const run = (work, then) => {
|
|
34
|
+
if (ignoreWhilePending && inFlight.current > 0) return false;
|
|
35
|
+
inFlight.current++;
|
|
30
36
|
const id = ++latest.current;
|
|
31
37
|
const generation = openGeneration?.();
|
|
32
38
|
startOwnTransition(async () => {
|
|
33
39
|
try {
|
|
34
40
|
await work();
|
|
35
41
|
} catch (error) {
|
|
42
|
+
inFlight.current--;
|
|
36
43
|
if (id === latest.current) throw error;
|
|
37
44
|
if (!mounted.current) return;
|
|
38
45
|
if (hasSupersededError.current) {
|
|
@@ -43,9 +50,11 @@ function useActionTrigger(openGeneration) {
|
|
|
43
50
|
setSupersededError({ error });
|
|
44
51
|
return;
|
|
45
52
|
}
|
|
53
|
+
inFlight.current--;
|
|
46
54
|
if (openGeneration !== void 0 && openGeneration() !== generation) return;
|
|
47
55
|
then?.();
|
|
48
56
|
});
|
|
57
|
+
return true;
|
|
49
58
|
};
|
|
50
59
|
return {
|
|
51
60
|
pending,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-action-trigger.mjs","names":[],"sources":["../../src/internal/use-action-trigger.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, useRef, useState, useTransition } from \"react\";\n\nexport interface ActionTrigger {\n /** A run started through this hook is in flight (the part's own transition). */\n readonly pending: boolean;\n /**\n * Runs `work` inside the part's own transition and, once it resolves, `then` (still inside the\n * transition: a Close part's close, a menu item's close). A rejection skips `then` and reaches\n * the nearest Error Boundary above the part, also when a later run superseded this one. With\n * `openGeneration
|
|
1
|
+
{"version":3,"file":"use-action-trigger.mjs","names":[],"sources":["../../src/internal/use-action-trigger.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, useRef, useState, useTransition } from \"react\";\n\nexport interface ActionTriggerOptions {\n /**\n * Open generation of the overlay a `then` belongs to: `then` is skipped when a newer open of\n * the overlay started after the run began.\n */\n readonly openGeneration?: (() => number) | undefined;\n /**\n * Ignore `run` while a run is in flight (conventions 2.5): `run` returns `false` and starts\n * nothing. In flight means the hook's synchronous in-flight counter is non-zero (it also sees\n * two activations in one task, before React re-rendered); the last render's `pending` is not\n * consulted, so a click in a settled-but-held commit window runs. Default `false`; on for\n * `Button` (#79) until #81 makes it the only behaviour.\n */\n readonly ignoreWhilePending?: boolean | undefined;\n}\n\nexport interface ActionTrigger {\n /** A run started through this hook is in flight (the part's own transition). */\n readonly pending: boolean;\n /**\n * Runs `work` inside the part's own transition and, once it resolves, `then` (still inside the\n * transition: a Close part's close, a menu item's close). A rejection skips `then` and reaches\n * the nearest Error Boundary above the part, also when a later run superseded this one. With\n * `openGeneration`, `then` is skipped when a newer open of the overlay started after the run\n * began. Returns `false` when the run was ignored (`ignoreWhilePending`), so the part can\n * `preventDefault()` the activation, and `true` otherwise.\n */\n readonly run: (work: () => unknown, then?: () => void) => boolean;\n}\n\n/** Reports an error that cannot reach a boundary (conventions 2.4: never swallow). */\nfunction report(error: unknown): void {\n if (typeof reportError === \"function\") reportError(error);\n else console.error(error);\n}\n\n/**\n * The transition of a pure-trigger part: an `action` with no state of its own (`Button`,\n * `Dialog.Close`, `Popover.Close`, `Menu.Item`; conventions 3.4). Same superseded-rejection\n * surfacing as `useControllableAction`: React keeps only the newest thenable per `useTransition`,\n * so the rejection of a run that a later run superseded would be dropped. The hook catches it and\n * throws it from render, so it reaches the same boundary as the latest run's rejection does.\n *\n * The argument is the options object, or (the older positional form) `openGeneration` alone.\n */\nexport function useActionTrigger(options?: ActionTriggerOptions | (() => number)): ActionTrigger {\n const { openGeneration, ignoreWhilePending = false }: ActionTriggerOptions =\n typeof options === \"function\" ? { openGeneration: options } : (options ?? {});\n\n // Thrown before `useTransition` on purpose (see use-controllable-action.ts): in the retry of\n // an errored render `useTransition` would suspend on the newer run's pending thenable.\n const [supersededError, setSupersededError] = useState<{ readonly error: unknown } | null>(null);\n const hasSupersededError = useRef(false);\n if (supersededError !== null) throw supersededError.error;\n\n const [pending, startOwnTransition] = useTransition();\n const latest = useRef(0);\n const mounted = useRef(false);\n // Runs whose work has not settled yet. Updated synchronously, so a second activation in the\n // same task (React's `pending` is still the stale render value) is seen (conventions 2.5).\n const inFlight = useRef(0);\n\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n const run = (work: () => unknown, then?: () => void): boolean => {\n // The own counter only, not the rendered `pending` (design/components/button.md 5.2): after\n // the work settled, a commit held by entanglement must not drop a new activation.\n if (ignoreWhilePending && inFlight.current > 0) return false;\n inFlight.current++;\n const id = ++latest.current;\n // The open this run belongs to (design/components/popover.md, review M2 / PO rule): if the\n // user dismisses and re-opens while the action runs, its close must not close the new open.\n const generation = openGeneration?.();\n startOwnTransition(async () => {\n try {\n await work();\n } catch (error) {\n inFlight.current--;\n // The latest run's rejection takes React's own route to the boundary.\n if (id === latest.current) throw error;\n if (!mounted.current) return;\n if (hasSupersededError.current) {\n report(error);\n return;\n }\n hasSupersededError.current = true;\n // After an await, outside the transition: urgent, so the part re-renders and throws.\n setSupersededError({ error });\n return;\n }\n inFlight.current--;\n if (openGeneration !== undefined && openGeneration() !== generation) return;\n then?.();\n });\n return true;\n };\n\n return { pending, run };\n}\n"],"mappings":";;;;AAkCA,SAAS,OAAO,OAAsB;CACpC,IAAI,OAAO,gBAAgB,YAAY,YAAY,KAAK;MACnD,QAAQ,MAAM,KAAK;AAC1B;;;;;;;;;;AAWA,SAAgB,iBAAiB,SAAgE;CAC/F,MAAM,EAAE,gBAAgB,qBAAqB,UAC3C,OAAO,YAAY,aAAa,EAAE,gBAAgB,QAAQ,IAAK,WAAW,CAAC;CAI7E,MAAM,CAAC,iBAAiB,sBAAsB,SAA6C,IAAI;CAC/F,MAAM,qBAAqB,OAAO,KAAK;CACvC,IAAI,oBAAoB,MAAM,MAAM,gBAAgB;CAEpD,MAAM,CAAC,SAAS,sBAAsB,cAAc;CACpD,MAAM,SAAS,OAAO,CAAC;CACvB,MAAM,UAAU,OAAO,KAAK;CAG5B,MAAM,WAAW,OAAO,CAAC;CAEzB,gBAAgB;EACd,QAAQ,UAAU;EAClB,aAAa;GACX,QAAQ,UAAU;EACpB;CACF,GAAG,CAAC,CAAC;CAEL,MAAM,OAAO,MAAqB,SAA+B;EAG/D,IAAI,sBAAsB,SAAS,UAAU,GAAG,OAAO;EACvD,SAAS;EACT,MAAM,KAAK,EAAE,OAAO;EAGpB,MAAM,aAAa,iBAAiB;EACpC,mBAAmB,YAAY;GAC7B,IAAI;IACF,MAAM,KAAK;GACb,SAAS,OAAO;IACd,SAAS;IAET,IAAI,OAAO,OAAO,SAAS,MAAM;IACjC,IAAI,CAAC,QAAQ,SAAS;IACtB,IAAI,mBAAmB,SAAS;KAC9B,OAAO,KAAK;KACZ;IACF;IACA,mBAAmB,UAAU;IAE7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B;GACF;GACA,SAAS;GACT,IAAI,mBAAmB,KAAA,KAAa,eAAe,MAAM,YAAY;GACrE,OAAO;EACT,CAAC;EACD,OAAO;CACT;CAEA,OAAO;EAAE;EAAS;CAAI;AACxB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { dataAttr } from "./data-attr.mjs";
|
|
3
|
-
import { mergeRefs } from "./merge-props.mjs";
|
|
4
3
|
import { useDevWarning } from "./use-dev-warning.mjs";
|
|
4
|
+
import { mergeRefs } from "./merge-props.mjs";
|
|
5
5
|
import { FieldContext } from "./field-context.mjs";
|
|
6
6
|
import { use, useCallback, useLayoutEffect, useMemo, useRef } from "react";
|
|
7
7
|
//#region src/internal/use-field-control.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "./action-details.mjs";
|
|
3
|
+
import { useDevWarning } from "./use-dev-warning.mjs";
|
|
3
4
|
import { transitionTypes } from "./transition-types.mjs";
|
|
4
5
|
import { useLatest } from "./use-latest.mjs";
|
|
5
6
|
import { useControllableAction } from "./use-controllable-action.mjs";
|
|
6
|
-
import { useDevWarning } from "./use-dev-warning.mjs";
|
|
7
7
|
import { useCallback, useId, useMemo, useRef, useState } from "react";
|
|
8
8
|
//#region src/internal/use-popover-root.ts
|
|
9
9
|
function isPopoverOpen(element) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { mergeRefs } from "./merge-props.mjs";
|
|
3
|
-
import { renderElement, rendersButton, resolveStateValue } from "./render-element.mjs";
|
|
3
|
+
import { isHostButton, renderElement, rendersButton, resolveStateValue } from "./render-element.mjs";
|
|
4
4
|
import { isValidElement, useMemo } from "react";
|
|
5
5
|
//#region src/internal/use-render.tsx
|
|
6
6
|
/**
|
|
@@ -23,6 +23,6 @@ function useRender(options) {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
|
-
export { rendersButton, resolveStateValue, useRender };
|
|
26
|
+
export { isHostButton, rendersButton, resolveStateValue, useRender };
|
|
27
27
|
|
|
28
28
|
//# sourceMappingURL=use-render.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-render.mjs","names":[],"sources":["../../src/internal/use-render.tsx"],"sourcesContent":["\"use client\";\nimport { isValidElement, useMemo } from \"react\";\nimport type { ReactNode, Ref } from \"react\";\nimport { mergeRefs } from \"./merge-props.js\";\nimport { renderElement } from \"./render-element.js\";\nimport type { ElementLikeProps, RenderElementOptions } from \"./render-element.js\";\n\nexport { rendersButton, resolveStateValue } from \"./render-element.js\";\nexport type { DataAttributes } from \"./render-element.js\";\n\nexport interface UseRenderOptions<Props extends ElementLikeProps, State> extends Omit<\n RenderElementOptions<Props, State>,\n \"ref\"\n> {\n /** The library's own ref, if the part needs the DOM node. */\n ref?: Ref<unknown> | undefined;\n}\n\n/**\n * Resolves `render` and the function-form `className` / `style` / `children` of a part against\n * its state and produces the element (conventions 1.2, 1.3, 1.4). The pure work is\n * `renderElement` (`render-element.ts`); this hook adds the memoised ref merge.\n */\nexport function useRender<Props extends ElementLikeProps, State>(\n options: UseRenderOptions<Props, State>,\n): ReactNode {\n const { render, props, ref } = options;\n\n const consumerRef = (props as ElementLikeProps).ref;\n const elementRef = isValidElement<ElementLikeProps>(render) ? render.props.ref : undefined;\n // Memoised so that the callback ref keeps its identity across renders and React does not\n // detach and re-attach the node every time.\n const mergedRef = useMemo(\n () => mergeRefs(ref, consumerRef, elementRef),\n [ref, consumerRef, elementRef],\n );\n\n return renderElement<Props, State>({ ...options, ref: mergedRef });\n}\n"],"mappings":";;;;;;;;;;AAuBA,SAAgB,UACd,SACW;CACX,MAAM,EAAE,QAAQ,OAAO,QAAQ;CAE/B,MAAM,cAAe,MAA2B;CAChD,MAAM,aAAa,eAAiC,MAAM,IAAI,OAAO,MAAM,MAAM,KAAA;CAGjF,MAAM,YAAY,cACV,UAAU,KAAK,aAAa,UAAU,GAC5C;EAAC;EAAK;EAAa;CAAU,CAC/B;CAEA,OAAO,cAA4B;EAAE,GAAG;EAAS,KAAK;CAAU,CAAC;AACnE"}
|
|
1
|
+
{"version":3,"file":"use-render.mjs","names":[],"sources":["../../src/internal/use-render.tsx"],"sourcesContent":["\"use client\";\nimport { isValidElement, useMemo } from \"react\";\nimport type { ReactNode, Ref } from \"react\";\nimport { mergeRefs } from \"./merge-props.js\";\nimport { renderElement } from \"./render-element.js\";\nimport type { ElementLikeProps, RenderElementOptions } from \"./render-element.js\";\n\nexport { isHostButton, rendersButton, resolveStateValue } from \"./render-element.js\";\nexport type { DataAttributes } from \"./render-element.js\";\n\nexport interface UseRenderOptions<Props extends ElementLikeProps, State> extends Omit<\n RenderElementOptions<Props, State>,\n \"ref\"\n> {\n /** The library's own ref, if the part needs the DOM node. */\n ref?: Ref<unknown> | undefined;\n}\n\n/**\n * Resolves `render` and the function-form `className` / `style` / `children` of a part against\n * its state and produces the element (conventions 1.2, 1.3, 1.4). The pure work is\n * `renderElement` (`render-element.ts`); this hook adds the memoised ref merge.\n */\nexport function useRender<Props extends ElementLikeProps, State>(\n options: UseRenderOptions<Props, State>,\n): ReactNode {\n const { render, props, ref } = options;\n\n const consumerRef = (props as ElementLikeProps).ref;\n const elementRef = isValidElement<ElementLikeProps>(render) ? render.props.ref : undefined;\n // Memoised so that the callback ref keeps its identity across renders and React does not\n // detach and re-attach the node every time.\n const mergedRef = useMemo(\n () => mergeRefs(ref, consumerRef, elementRef),\n [ref, consumerRef, elementRef],\n );\n\n return renderElement<Props, State>({ ...options, ref: mergedRef });\n}\n"],"mappings":";;;;;;;;;;AAuBA,SAAgB,UACd,SACW;CACX,MAAM,EAAE,QAAQ,OAAO,QAAQ;CAE/B,MAAM,cAAe,MAA2B;CAChD,MAAM,aAAa,eAAiC,MAAM,IAAI,OAAO,MAAM,MAAM,KAAA;CAGjF,MAAM,YAAY,cACV,UAAU,KAAK,aAAa,UAAU,GAC5C;EAAC;EAAK;EAAa;CAAU,CAC/B;CAEA,OAAO,cAA4B;EAAE,GAAG;EAAS,KAAK;CAAU,CAAC;AACnE"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
3
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
-
import { transitionTypes } from "../internal/transition-types.mjs";
|
|
5
|
-
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
6
4
|
import { rendersButton } from "../internal/render-element.mjs";
|
|
7
5
|
import { useRender } from "../internal/use-render.mjs";
|
|
6
|
+
import { transitionTypes } from "../internal/transition-types.mjs";
|
|
7
|
+
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
8
8
|
import { closeStackLater, useMenuContext } from "./menu-context.mjs";
|
|
9
9
|
import { useMenuItem } from "./use-menu-item.mjs";
|
|
10
10
|
import { useRef } from "react";
|
package/dist/menu/menu-group.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
3
2
|
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
3
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
4
4
|
import { MenuGroupContext } from "./menu-context.mjs";
|
|
5
5
|
import { use, useId, useMemo } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
package/dist/menu/menu-item.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
3
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
+
import { useActionTrigger } from "../internal/use-action-trigger.mjs";
|
|
4
5
|
import { rendersButton } from "../internal/render-element.mjs";
|
|
5
6
|
import { useRender } from "../internal/use-render.mjs";
|
|
6
|
-
import { useActionTrigger } from "../internal/use-action-trigger.mjs";
|
|
7
7
|
import { useMenuContext } from "./menu-context.mjs";
|
|
8
8
|
import { useMenuItem } from "./use-menu-item.mjs";
|
|
9
9
|
//#region src/menu/menu-item.tsx
|
package/dist/menu/menu-popup.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { ToolbarContext } from "../internal/toolbar-context.mjs";
|
|
2
3
|
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
3
4
|
import { mergeRefs } from "../internal/merge-props.mjs";
|
|
4
5
|
import { resolveStateValue } from "../internal/render-element.mjs";
|
|
5
6
|
import { useRender } from "../internal/use-render.mjs";
|
|
6
|
-
import { ToolbarContext } from "../internal/toolbar-context.mjs";
|
|
7
7
|
import { POSITION_TRY_FALLBACKS, positionArea } from "../internal/anchor-position.mjs";
|
|
8
8
|
import { usePopoverPopup } from "../internal/use-popover-popup.mjs";
|
|
9
9
|
import { MenuListContext, useMenuContext } from "./menu-context.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
3
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
4
5
|
import { transitionTypes } from "../internal/transition-types.mjs";
|
|
5
6
|
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
6
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
7
7
|
import { MenuGroupContext, MenuRadioGroupContext } from "./menu-context.mjs";
|
|
8
8
|
import { useId, useMemo, useRef } from "react";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
package/dist/menu/menu-root.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { resolveStateValue } from "../internal/render-element.mjs";
|
|
3
2
|
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
3
|
+
import { resolveStateValue } from "../internal/render-element.mjs";
|
|
4
4
|
import { useDelayedPair } from "../internal/use-delayed-pair.mjs";
|
|
5
5
|
import { usePopoverRoot } from "../internal/use-popover-root.mjs";
|
|
6
6
|
import { MenuContext, MenuListContext } from "./menu-context.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
3
2
|
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
3
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
4
4
|
import { usePopoverTrigger } from "../internal/use-popover-trigger.mjs";
|
|
5
5
|
import { useMenuContext } from "./menu-context.mjs";
|
|
6
6
|
import { hasModifier, isRtl } from "./menu-dom.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
3
2
|
import { useToolbarContext } from "../internal/toolbar-context.mjs";
|
|
4
3
|
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
4
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
5
5
|
import { usePopoverTrigger } from "../internal/use-popover-trigger.mjs";
|
|
6
6
|
import { useMenuContext } from "./menu-context.mjs";
|
|
7
7
|
import { edgeItem, focusItem, hasModifier, isRtl } from "./menu-dom.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
3
|
+
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
3
4
|
import { rendersButton } from "../internal/render-element.mjs";
|
|
4
5
|
import { useRender } from "../internal/use-render.mjs";
|
|
5
|
-
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
6
6
|
import { isAtBound } from "./number-field-arithmetic.mjs";
|
|
7
7
|
import { useNumberFieldContext } from "./number-field-context.mjs";
|
|
8
8
|
import { useStepButton } from "./use-step-button.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
3
|
+
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
3
4
|
import { mergeRefs } from "../internal/merge-props.mjs";
|
|
4
5
|
import { useRender } from "../internal/use-render.mjs";
|
|
5
|
-
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
6
6
|
import { useFieldControl, useMergedRef } from "../internal/use-field-control.mjs";
|
|
7
7
|
import { useNumberFieldContext } from "./number-field-context.mjs";
|
|
8
8
|
import { hiddenText } from "./number-field-root.mjs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
3
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
+
import { useActionTrigger } from "../internal/use-action-trigger.mjs";
|
|
5
|
+
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
6
|
+
import { mergeTokenLists } from "../internal/merge-props.mjs";
|
|
7
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
4
8
|
import { transitionTypes } from "../internal/transition-types.mjs";
|
|
5
9
|
import { useLatest } from "../internal/use-latest.mjs";
|
|
6
10
|
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
7
|
-
import { mergeTokenLists } from "../internal/merge-props.mjs";
|
|
8
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
9
|
-
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
10
|
-
import { useActionTrigger } from "../internal/use-action-trigger.mjs";
|
|
11
11
|
import { FieldContext } from "../internal/field-context.mjs";
|
|
12
12
|
import { useFieldValueChange } from "../internal/use-field-control.mjs";
|
|
13
13
|
import { useNativeGroupReconciliation } from "../internal/use-native-group-reconciliation.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
3
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
+
import { useActionTrigger } from "../internal/use-action-trigger.mjs";
|
|
4
5
|
import { rendersButton } from "../internal/render-element.mjs";
|
|
5
6
|
import { useRender } from "../internal/use-render.mjs";
|
|
6
|
-
import { useActionTrigger } from "../internal/use-action-trigger.mjs";
|
|
7
7
|
import { usePopoverContext } from "./popover-context.mjs";
|
|
8
8
|
import { useCallback } from "react";
|
|
9
9
|
//#region src/popover/popover-close.tsx
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { ToolbarContext } from "../internal/toolbar-context.mjs";
|
|
2
3
|
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
4
|
+
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
3
5
|
import { resolveStateValue } from "../internal/render-element.mjs";
|
|
4
6
|
import { useRender } from "../internal/use-render.mjs";
|
|
5
|
-
import { ToolbarContext } from "../internal/toolbar-context.mjs";
|
|
6
|
-
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
7
7
|
import { POSITION_TRY_FALLBACKS, positionArea } from "../internal/anchor-position.mjs";
|
|
8
8
|
import { PopoverPopupContext, usePopoverContext } from "./popover-context.mjs";
|
|
9
9
|
import { usePopoverPopup } from "../internal/use-popover-popup.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
3
2
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
3
|
+
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
4
4
|
import { useRender } from "../internal/use-render.mjs";
|
|
5
5
|
import { guardCheckableChange, useNativeChecked } from "../internal/use-native-checked.mjs";
|
|
6
6
|
import { syncPresence } from "../internal/sync-presence.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
3
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
4
5
|
import { transitionTypes } from "../internal/transition-types.mjs";
|
|
5
6
|
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
6
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
7
7
|
import { useFieldControl, useFieldValueChange, useMergedRef } from "../internal/use-field-control.mjs";
|
|
8
8
|
import { RadioGroupContext } from "./radio-group-context.mjs";
|
|
9
9
|
import { useNativeGroupReconciliation } from "../internal/use-native-group-reconciliation.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
3
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
4
5
|
import { transitionTypes } from "../internal/transition-types.mjs";
|
|
5
6
|
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
6
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
7
7
|
import { fieldInputProps, useFieldControl, useFieldValueChange, useMergedRef } from "../internal/use-field-control.mjs";
|
|
8
8
|
import { SelectContext } from "./select-context.mjs";
|
|
9
9
|
import { useSelectPartRef } from "./select-dom.mjs";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
3
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
4
|
+
import { useActionTrigger } from "../internal/use-action-trigger.mjs";
|
|
5
|
+
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
7
6
|
import { mergeTokenLists } from "../internal/merge-props.mjs";
|
|
8
7
|
import { resolveStateValue } from "../internal/render-element.mjs";
|
|
9
8
|
import { useRender } from "../internal/use-render.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { transitionTypes } from "../internal/transition-types.mjs";
|
|
10
|
+
import { useLatest } from "../internal/use-latest.mjs";
|
|
11
|
+
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
12
12
|
import { FieldContext } from "../internal/field-context.mjs";
|
|
13
13
|
import { useFieldControl, useFieldValueChange, useMergedRef } from "../internal/use-field-control.mjs";
|
|
14
14
|
import { useNativeGroupReconciliation } from "../internal/use-native-group-reconciliation.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
3
|
+
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
3
4
|
import { mergeRefs, mergeTokenLists } from "../internal/merge-props.mjs";
|
|
4
5
|
import { resolveStateValue } from "../internal/render-element.mjs";
|
|
5
6
|
import { useRender } from "../internal/use-render.mjs";
|
|
6
|
-
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
7
7
|
import { useSliderContext } from "./slider-context.mjs";
|
|
8
8
|
import { percent, thumbBounds } from "./slider-arithmetic.mjs";
|
|
9
9
|
import { useEffectEvent, useLayoutEffect, useMemo, useRef } from "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
3
2
|
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
3
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
4
4
|
import { useSliderContext } from "./slider-context.mjs";
|
|
5
5
|
//#region src/slider/slider-value.tsx
|
|
6
6
|
/**
|
package/dist/switch/switch.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
3
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
4
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
+
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
5
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
5
6
|
import { transitionTypes } from "../internal/transition-types.mjs";
|
|
6
7
|
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
7
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
8
8
|
import { fieldInputProps, useFieldControl, useFieldValueChange, useMergedRef } from "../internal/use-field-control.mjs";
|
|
9
9
|
import { guardCheckableChange, useNativeChecked } from "../internal/use-native-checked.mjs";
|
|
10
10
|
//#region src/switch/switch.tsx
|
package/dist/tabs/tabs-list.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
3
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
4
3
|
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
4
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
5
5
|
import { TabsListContext, useTabsContext } from "./tabs-context.mjs";
|
|
6
6
|
import { useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
package/dist/tabs/tabs-panel.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
3
2
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
3
|
+
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
4
4
|
import { useRender } from "../internal/use-render.mjs";
|
|
5
5
|
import { useTabsContext } from "./tabs-context.mjs";
|
|
6
6
|
import { panelId, tabId } from "./tabs-ids.mjs";
|
package/dist/tabs/tabs-root.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
3
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
+
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
5
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
4
6
|
import { transitionTypes } from "../internal/transition-types.mjs";
|
|
5
7
|
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
6
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
7
|
-
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
8
8
|
import { TabsContext } from "./tabs-context.mjs";
|
|
9
9
|
import { tabId } from "./tabs-ids.mjs";
|
|
10
10
|
import { useId, useMemo, useRef } from "react";
|
package/dist/tabs/tabs-tab.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
3
2
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
3
|
+
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
4
4
|
import { rendersButton, resolveStateValue } from "../internal/render-element.mjs";
|
|
5
5
|
import { useRender } from "../internal/use-render.mjs";
|
|
6
6
|
import { TabsListContext, useTabsContext } from "./tabs-context.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
3
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
+
import { useActionTrigger } from "../internal/use-action-trigger.mjs";
|
|
4
5
|
import { rendersButton } from "../internal/render-element.mjs";
|
|
5
6
|
import { useRender } from "../internal/use-render.mjs";
|
|
6
|
-
import { useActionTrigger } from "../internal/use-action-trigger.mjs";
|
|
7
7
|
import { useToastRootContext } from "./toast-context.mjs";
|
|
8
8
|
import { useLayoutEffect, useState } from "react";
|
|
9
9
|
//#region src/toast/toast-action.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
3
|
-
import { useLatest } from "../internal/use-latest.mjs";
|
|
4
3
|
import { resolveStateValue } from "../internal/render-element.mjs";
|
|
5
4
|
import { useRender } from "../internal/use-render.mjs";
|
|
5
|
+
import { useLatest } from "../internal/use-latest.mjs";
|
|
6
6
|
import { exitAnimations } from "../internal/use-exit-animation.mjs";
|
|
7
7
|
import { ToastRootContext, useToastRootContext, useToastViewportContext } from "./toast-context.mjs";
|
|
8
8
|
import { Suspense, useCallback, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
3
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
-
import { useLatest } from "../internal/use-latest.mjs";
|
|
5
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
6
4
|
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
5
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
6
|
+
import { useLatest } from "../internal/use-latest.mjs";
|
|
7
7
|
import { DialogContext } from "../dialog/dialog-context.mjs";
|
|
8
8
|
import { animationBaseline } from "../internal/use-exit-animation.mjs";
|
|
9
9
|
import { getServerTopmostModal, getTopmostModal, subscribeModals } from "../internal/modal-registry.mjs";
|
|
10
10
|
import { ToastViewportContext } from "./toast-context.mjs";
|
|
11
11
|
import { toast, toastManagerInternals } from "./toast.mjs";
|
|
12
12
|
import { use, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, useTransition } from "react";
|
|
13
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
13
|
import { createPortal } from "react-dom";
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
//#region src/toast/toast-viewport.tsx
|
|
16
16
|
const isDev = process.env.NODE_ENV !== "production";
|
|
17
17
|
const DEFAULT_HOTKEY = ["F8"];
|
package/dist/toggle/toggle.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
3
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
4
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
4
|
+
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
7
5
|
import { rendersButton } from "../internal/render-element.mjs";
|
|
8
6
|
import { useRender } from "../internal/use-render.mjs";
|
|
7
|
+
import { transitionTypes } from "../internal/transition-types.mjs";
|
|
8
|
+
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
9
9
|
//#region src/toggle/toggle.tsx
|
|
10
10
|
/**
|
|
11
11
|
* A two-state button (WAI-ARIA "Button" pattern, toggle variant). Renders
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
3
2
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
3
|
+
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
4
4
|
import { rendersButton } from "../internal/render-element.mjs";
|
|
5
5
|
import { useRender } from "../internal/use-render.mjs";
|
|
6
6
|
import { useToggleGroupContext } from "./toggle-group-context.mjs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionDetails } from "../internal/action-details.mjs";
|
|
3
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
4
|
+
import { useToolbarContext } from "../internal/toolbar-context.mjs";
|
|
5
|
+
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
6
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
4
7
|
import { transitionTypes } from "../internal/transition-types.mjs";
|
|
5
8
|
import { useLatest } from "../internal/use-latest.mjs";
|
|
6
9
|
import { useControllableAction } from "../internal/use-controllable-action.mjs";
|
|
7
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
8
10
|
import { ToggleGroupContext } from "./toggle-group-context.mjs";
|
|
9
|
-
import { useToolbarContext } from "../internal/toolbar-context.mjs";
|
|
10
|
-
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
11
11
|
import { useRovingFocus } from "../internal/use-roving-focus.mjs";
|
|
12
12
|
import { useCallback, useEffectEvent, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
package/dist/toolbar/index.d.mts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import "../internal/platform-attributes.mjs";
|
|
2
|
-
import { ToolbarButton, ToolbarButtonActionDetails, ToolbarButtonProps, ToolbarButtonState } from "./toolbar-button.mjs";
|
|
3
2
|
import { ToolbarOrientation, ToolbarRoot, ToolbarRootProps, ToolbarRootState } from "./toolbar-root.mjs";
|
|
4
3
|
import { ToolbarSeparator, ToolbarSeparatorProps, ToolbarSeparatorState } from "./toolbar-separator.mjs";
|
|
5
4
|
//#region src/toolbar/index.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Toolbar (WAI-ARIA APG Toolbar pattern): `Root` (div role="toolbar") with one Tab stop and
|
|
8
|
-
* arrow keys over its focusable descendants, `
|
|
9
|
-
*
|
|
7
|
+
* arrow keys over its focusable descendants, and `Separator` (hr). Any focusable element is an
|
|
8
|
+
* item: no wrapper parts. A command button is `Button` from `@funstack/ui/button`, which stays
|
|
9
|
+
* focusable when disabled inside a Toolbar (design/components/button.md 7.3).
|
|
10
10
|
*/
|
|
11
11
|
export declare const Toolbar: {
|
|
12
12
|
readonly Root: typeof ToolbarRoot;
|
|
13
|
-
readonly Button: typeof ToolbarButton;
|
|
14
13
|
readonly Separator: typeof ToolbarSeparator;
|
|
15
14
|
};
|
|
16
15
|
//#endregion
|
|
17
|
-
export type {
|
|
16
|
+
export type { ToolbarOrientation, ToolbarRootProps, ToolbarRootState, ToolbarSeparatorProps, ToolbarSeparatorState };
|
|
18
17
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/toolbar/index.ts"],"mappings":";;;;;;;;;;qBAWa;WACX,aAAI;WACJ,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/toolbar/index.ts"],"mappings":";;;;;;;;;;qBAWa;WACX,aAAI;WACJ,kBAAS"}
|
package/dist/toolbar/index.mjs
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { ToolbarButton } from "./toolbar-button.mjs";
|
|
2
1
|
import { ToolbarRoot } from "./toolbar-root.mjs";
|
|
3
2
|
import { ToolbarSeparator } from "./toolbar-separator.mjs";
|
|
4
3
|
//#region src/toolbar/index.ts
|
|
5
4
|
/**
|
|
6
5
|
* Toolbar (WAI-ARIA APG Toolbar pattern): `Root` (div role="toolbar") with one Tab stop and
|
|
7
|
-
* arrow keys over its focusable descendants, `
|
|
8
|
-
*
|
|
6
|
+
* arrow keys over its focusable descendants, and `Separator` (hr). Any focusable element is an
|
|
7
|
+
* item: no wrapper parts. A command button is `Button` from `@funstack/ui/button`, which stays
|
|
8
|
+
* focusable when disabled inside a Toolbar (design/components/button.md 7.3).
|
|
9
9
|
*/
|
|
10
10
|
const Toolbar = {
|
|
11
11
|
Root: ToolbarRoot,
|
|
12
|
-
Button: ToolbarButton,
|
|
13
12
|
Separator: ToolbarSeparator
|
|
14
13
|
};
|
|
15
14
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/toolbar/index.ts"],"sourcesContent":["// Ships the platform attribute typings with this subpath (conventions 7.4). Type-only.\nimport \"../internal/platform-attributes.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/toolbar/index.ts"],"sourcesContent":["// Ships the platform attribute typings with this subpath (conventions 7.4). Type-only.\nimport \"../internal/platform-attributes.js\";\nimport { ToolbarRoot } from \"./toolbar-root.js\";\nimport { ToolbarSeparator } from \"./toolbar-separator.js\";\n\n/**\n * Toolbar (WAI-ARIA APG Toolbar pattern): `Root` (div role=\"toolbar\") with one Tab stop and\n * arrow keys over its focusable descendants, and `Separator` (hr). Any focusable element is an\n * item: no wrapper parts. A command button is `Button` from `@funstack/ui/button`, which stays\n * focusable when disabled inside a Toolbar (design/components/button.md 7.3).\n */\nexport const Toolbar = {\n Root: ToolbarRoot,\n Separator: ToolbarSeparator,\n} as const;\n\nexport type { ToolbarRootProps, ToolbarRootState, ToolbarOrientation } from \"./toolbar-root.js\";\nexport type { ToolbarSeparatorProps, ToolbarSeparatorState } from \"./toolbar-separator.js\";\n"],"mappings":";;;;;;;;;AAWA,MAAa,UAAU;CACrB,MAAM;CACN,WAAW;AACb"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
3
2
|
import { ToolbarContext } from "../internal/toolbar-context.mjs";
|
|
3
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
4
4
|
import { useRovingFocus } from "../internal/use-roving-focus.mjs";
|
|
5
5
|
import { useMemo, useRef, useSyncExternalStore } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
3
2
|
import { useToolbarContext } from "../internal/toolbar-context.mjs";
|
|
3
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
4
4
|
//#region src/toolbar/toolbar-separator.tsx
|
|
5
5
|
/**
|
|
6
6
|
* `<hr aria-orientation>` between toolbar items: vertical in a horizontal Toolbar, horizontal in
|