@blockle/blocks-react 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/form/Button/Button.d.ts +1 -1
- package/dist/components/form/Button/Button.js +1 -1
- package/dist/components/form/Input/Input.js +1 -1
- package/dist/components/overlay/Dialog/Dialog.js +4 -5
- package/dist/components/overlay/Popover/Popover.js +1 -2
- package/dist/components/providers/BlocksProvider/BlocksProvider.js +1 -1
- package/dist/hooks/useRestoreFocus/useRestoreFocus.js +1 -2
- package/dist/testUtils/testTheme.css.d.ts +1 -0
- package/dist/testUtils/testUtils.d.ts +3 -0
- package/package.json +1 -1
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.spec.d.ts +0 -1
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.stories.d.ts +0 -6
- package/dist/components/display/Divider/Divider.spec.d.ts +0 -1
- package/dist/components/display/Divider/Divider.stories.d.ts +0 -6
- package/dist/components/feedback/Progress/Progress.stories.d.ts +0 -5
- package/dist/components/feedback/Spinner/Spinner.stories.d.ts +0 -5
- package/dist/components/feedback/Spinner/Spinner.test.d.ts +0 -1
- package/dist/components/form/Button/Button.spec.d.ts +0 -1
- package/dist/components/form/Button/Button.stories.d.ts +0 -7
- package/dist/components/form/Checkbox/Checkbox.spec.d.ts +0 -1
- package/dist/components/form/Checkbox/Checkbox.stories.d.ts +0 -5
- package/dist/components/form/Input/Input.spec.d.ts +0 -1
- package/dist/components/form/Input/Input.stories.d.ts +0 -5
- package/dist/components/form/Label/Label.spec.d.ts +0 -1
- package/dist/components/form/Label/Label.stories.d.ts +0 -6
- package/dist/components/form/Radio/Radio.spec.d.ts +0 -1
- package/dist/components/form/Radio/Radio.stories.d.ts +0 -6
- package/dist/components/form/Radio/RadioGroup.test.d.ts +0 -1
- package/dist/components/form/Select/Select.stories.d.ts +0 -5
- package/dist/components/form/Slider/Slider.spec.d.ts +0 -1
- package/dist/components/form/Slider/Slider.stories.d.ts +0 -7
- package/dist/components/form/Switch/Switch.stories.d.ts +0 -5
- package/dist/components/layout/Box/Box.spec.d.ts +0 -1
- package/dist/components/layout/Box/Box.stories.d.ts +0 -6
- package/dist/components/layout/Inline/Inline.stories.d.ts +0 -6
- package/dist/components/layout/Stack/Stack.stories.d.ts +0 -6
- package/dist/components/navigation/Link/Link.stories.d.ts +0 -6
- package/dist/components/navigation/Link/Link.test.d.ts +0 -1
- package/dist/components/overlay/Dialog/Dialog.stories.d.ts +0 -8
- package/dist/components/overlay/Dialog/Dialog.test.d.ts +0 -1
- package/dist/components/overlay/Popover/Popover.stories.d.ts +0 -6
- package/dist/components/overlay/Popover/Popover.test.d.ts +0 -1
- package/dist/components/overlay/Tooltip/Tooltip.stories.d.ts +0 -5
- package/dist/components/providers/BlocksProvider/BlocksProvider.test.d.ts +0 -1
- package/dist/components/typography/Heading/Heading.test.d.ts +0 -1
- package/dist/components/typography/Heading/heading.stories.d.ts +0 -8
- package/dist/components/typography/Text/Text.stories.d.ts +0 -5
- package/dist/components/typography/Text/Text.test.d.ts +0 -1
- package/dist/hooks/useControlledValue/useControlledValue.test.d.ts +0 -1
- package/dist/hooks/useRestoreFocus/useRestoreFocus.test.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { Atoms, ComponentThemes, HTMLElementProps, MarginAtoms } from '@blockle/blocks-core';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
3
|
type ButtonTheme = ComponentThemes['button'];
|
|
4
4
|
export type ButtonProps = {
|
|
5
5
|
alignSelf?: Atoms['alignSelf'];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useComponentStyles } from "../../../hooks/useComponentStyles/useComponentStyles.js";
|
|
4
3
|
import { getAtomsAndProps, classnames, atoms } from "@blockle/blocks-core";
|
|
5
4
|
import { createSlottable } from "@blockle/blocks-react-slot";
|
|
5
|
+
import { useComponentStyles } from "../../../hooks/useComponentStyles/useComponentStyles.js";
|
|
6
6
|
import { Spinner } from "../../feedback/Spinner/Spinner.js";
|
|
7
7
|
import { buttonReset } from "./Button.css.js";
|
|
8
8
|
const [Template, Slot] = createSlottable("button");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { classnames } from "@blockle/blocks-core";
|
|
3
4
|
import { useId } from "react";
|
|
4
5
|
import { useComponentStyles } from "../../../hooks/useComponentStyles/useComponentStyles.js";
|
|
5
|
-
import { classnames } from "@blockle/blocks-core";
|
|
6
6
|
import { Box } from "../../layout/Box/Box.js";
|
|
7
7
|
import { input } from "./input.css.js";
|
|
8
8
|
const Input = ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { hasAnimationDuration, classnames } from "@blockle/blocks-core";
|
|
4
4
|
import { useRef, useState, useCallback } from "react";
|
|
5
5
|
import { useClickOutside } from "../../../hooks/useClickOutside/useClickOutside.js";
|
|
@@ -38,7 +38,6 @@ const Dialog = ({
|
|
|
38
38
|
useKeyboard("Escape", onEscape, { enabled: open && enabled });
|
|
39
39
|
useClickOutside(dialogRef, onRequestClose, { enabled: open && enabled });
|
|
40
40
|
useIsomorphicLayoutEffect(() => {
|
|
41
|
-
var _a;
|
|
42
41
|
if (open && visible) {
|
|
43
42
|
if (!dialogRef.current || !dialogRef.current.showModal) {
|
|
44
43
|
return;
|
|
@@ -50,7 +49,7 @@ const Dialog = ({
|
|
|
50
49
|
if (!hasAnimationDuration(dialogRef.current)) {
|
|
51
50
|
setVisible(false);
|
|
52
51
|
}
|
|
53
|
-
if (
|
|
52
|
+
if (dialogRef.current?.close) {
|
|
54
53
|
dialogRef.current.close();
|
|
55
54
|
}
|
|
56
55
|
}
|
|
@@ -64,7 +63,7 @@ const Dialog = ({
|
|
|
64
63
|
return null;
|
|
65
64
|
}
|
|
66
65
|
const dataOpen = typeof window === "undefined" && open ? true : void 0;
|
|
67
|
-
return /* @__PURE__ */ jsx(
|
|
66
|
+
return /* @__PURE__ */ jsx(DialogContext.Provider, { value: { setEnabled }, children: /* @__PURE__ */ jsx(
|
|
68
67
|
"dialog",
|
|
69
68
|
{
|
|
70
69
|
ref: dialogRef,
|
|
@@ -75,7 +74,7 @@ const Dialog = ({
|
|
|
75
74
|
...restProps,
|
|
76
75
|
children
|
|
77
76
|
}
|
|
78
|
-
) })
|
|
77
|
+
) });
|
|
79
78
|
};
|
|
80
79
|
export {
|
|
81
80
|
Dialog
|
|
@@ -26,7 +26,6 @@ const Popover = ({
|
|
|
26
26
|
useKeyboard("Escape", onRequestClose, { enabled: open });
|
|
27
27
|
useClickOutside(popoverRef, onRequestClose, { enabled: open });
|
|
28
28
|
useIsomorphicLayoutEffect(() => {
|
|
29
|
-
var _a;
|
|
30
29
|
const element = popoverRef.current;
|
|
31
30
|
if (open && visible) {
|
|
32
31
|
if (!element || typeof element.showPopover !== "function") {
|
|
@@ -44,7 +43,7 @@ const Popover = ({
|
|
|
44
43
|
if (!hasAnimationDuration(popoverRef.current)) {
|
|
45
44
|
setVisible(false);
|
|
46
45
|
}
|
|
47
|
-
|
|
46
|
+
popoverRef.current?.hidePopover();
|
|
48
47
|
}
|
|
49
48
|
}, [open, visible]);
|
|
50
49
|
useEffect(() => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo } from "react";
|
|
4
3
|
import { classnames, atoms } from "@blockle/blocks-core";
|
|
5
4
|
import { createSlottable } from "@blockle/blocks-react-slot";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
6
|
import { BlocksProviderContext } from "./context.js";
|
|
7
7
|
const [Template, Slot] = createSlottable("div");
|
|
8
8
|
const BlocksProvider = ({
|
|
@@ -7,9 +7,8 @@ const useRestoreFocus = (active) => {
|
|
|
7
7
|
target.current = document.activeElement;
|
|
8
8
|
}
|
|
9
9
|
useEffect(() => {
|
|
10
|
-
var _a;
|
|
11
10
|
if (target.current && !active && target.current instanceof HTMLElement) {
|
|
12
|
-
|
|
11
|
+
target.current?.focus();
|
|
13
12
|
target.current = null;
|
|
14
13
|
}
|
|
15
14
|
}, [active]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const testingTheme: any;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { render as rtlRender } from '@testing-library/react';
|
|
2
|
+
export * from '@testing-library/react';
|
|
3
|
+
export declare const render: (ui: Parameters<typeof rtlRender>[0], options?: Parameters<typeof rtlRender>[1]) => import('@testing-library/react').RenderResult<typeof import("@testing-library/dom/types/queries.js"), HTMLElement, HTMLElement>;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { VisuallyHidden, VisuallyHiddenProps } from './VisuallyHidden.js';
|
|
3
|
-
declare const meta: Meta<typeof VisuallyHidden>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<VisuallyHiddenProps>;
|
|
6
|
-
export declare const Default: Story;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { ButtonProps } from './Button.js';
|
|
3
|
-
declare const _default: Meta;
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const Default: StoryObj<ButtonProps>;
|
|
6
|
-
export declare const LinkButton: StoryObj<ButtonProps>;
|
|
7
|
-
export declare const Play: StoryObj<ButtonProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Slider, SliderProps } from './Slider.js';
|
|
3
|
-
declare const _default: Meta<typeof Slider>;
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const Default: StoryObj<SliderProps>;
|
|
6
|
-
export declare const WithState: StoryObj<SliderProps>;
|
|
7
|
-
export declare const WithStepSize: StoryObj<SliderProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Inline, InlineProps } from './Inline.js';
|
|
3
|
-
declare const _default: Meta<typeof Inline>;
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const Default: StoryObj<InlineProps>;
|
|
6
|
-
export declare const List: StoryObj<InlineProps>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Stack, StackProps } from './Stack.js';
|
|
3
|
-
declare const _default: Meta<typeof Stack>;
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const Default: StoryObj<StackProps>;
|
|
6
|
-
export declare const List: StoryObj<StackProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { DialogProps } from './Dialog.js';
|
|
3
|
-
declare const _default: Meta;
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const Default: StoryObj<DialogProps>;
|
|
6
|
-
export declare const Nested: StoryObj<DialogProps>;
|
|
7
|
-
export declare const WithAriaMarkup: StoryObj<DialogProps>;
|
|
8
|
-
export declare const Play: StoryObj<DialogProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { PopoverProps } from './Popover.js';
|
|
3
|
-
declare const _default: Meta;
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const Default: StoryObj<PopoverProps>;
|
|
6
|
-
export declare const Interactive: StoryObj<PopoverProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Heading, HeadingProps } from './Heading.js';
|
|
3
|
-
declare const _default: Meta<typeof Heading>;
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const Default: StoryObj<HeadingProps>;
|
|
6
|
-
export declare const All: {
|
|
7
|
-
render: any;
|
|
8
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|