@blockle/blocks-react 1.3.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.
Files changed (50) hide show
  1. package/dist/components/form/Button/Button.d.ts +1 -1
  2. package/dist/components/form/Button/Button.js +1 -1
  3. package/dist/components/form/Input/Input.js +1 -1
  4. package/dist/components/overlay/Dialog/Dialog.js +4 -5
  5. package/dist/components/overlay/Popover/Popover.js +1 -2
  6. package/dist/components/providers/BlocksProvider/BlocksProvider.js +1 -1
  7. package/dist/hooks/useRestoreFocus/useRestoreFocus.js +1 -2
  8. package/dist/testUtils/testTheme.css.d.ts +1 -0
  9. package/dist/testUtils/testUtils.d.ts +3 -0
  10. package/package.json +6 -6
  11. package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.spec.d.ts +0 -1
  12. package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.stories.d.ts +0 -6
  13. package/dist/components/display/Divider/Divider.spec.d.ts +0 -1
  14. package/dist/components/display/Divider/Divider.stories.d.ts +0 -6
  15. package/dist/components/feedback/Progress/Progress.stories.d.ts +0 -5
  16. package/dist/components/feedback/Spinner/Spinner.stories.d.ts +0 -5
  17. package/dist/components/feedback/Spinner/Spinner.test.d.ts +0 -1
  18. package/dist/components/form/Button/Button.spec.d.ts +0 -1
  19. package/dist/components/form/Button/Button.stories.d.ts +0 -7
  20. package/dist/components/form/Checkbox/Checkbox.spec.d.ts +0 -1
  21. package/dist/components/form/Checkbox/Checkbox.stories.d.ts +0 -5
  22. package/dist/components/form/Input/Input.spec.d.ts +0 -1
  23. package/dist/components/form/Input/Input.stories.d.ts +0 -5
  24. package/dist/components/form/Label/Label.spec.d.ts +0 -1
  25. package/dist/components/form/Label/Label.stories.d.ts +0 -6
  26. package/dist/components/form/Radio/Radio.spec.d.ts +0 -1
  27. package/dist/components/form/Radio/Radio.stories.d.ts +0 -6
  28. package/dist/components/form/Radio/RadioGroup.test.d.ts +0 -1
  29. package/dist/components/form/Select/Select.stories.d.ts +0 -5
  30. package/dist/components/form/Slider/Slider.spec.d.ts +0 -1
  31. package/dist/components/form/Slider/Slider.stories.d.ts +0 -7
  32. package/dist/components/form/Switch/Switch.stories.d.ts +0 -5
  33. package/dist/components/layout/Box/Box.spec.d.ts +0 -1
  34. package/dist/components/layout/Box/Box.stories.d.ts +0 -6
  35. package/dist/components/layout/Inline/Inline.stories.d.ts +0 -6
  36. package/dist/components/layout/Stack/Stack.stories.d.ts +0 -6
  37. package/dist/components/navigation/Link/Link.stories.d.ts +0 -6
  38. package/dist/components/navigation/Link/Link.test.d.ts +0 -1
  39. package/dist/components/overlay/Dialog/Dialog.stories.d.ts +0 -8
  40. package/dist/components/overlay/Dialog/Dialog.test.d.ts +0 -1
  41. package/dist/components/overlay/Popover/Popover.stories.d.ts +0 -6
  42. package/dist/components/overlay/Popover/Popover.test.d.ts +0 -1
  43. package/dist/components/overlay/Tooltip/Tooltip.stories.d.ts +0 -5
  44. package/dist/components/providers/BlocksProvider/BlocksProvider.test.d.ts +0 -1
  45. package/dist/components/typography/Heading/Heading.test.d.ts +0 -1
  46. package/dist/components/typography/Heading/heading.stories.d.ts +0 -8
  47. package/dist/components/typography/Text/Text.stories.d.ts +0 -5
  48. package/dist/components/typography/Text/Text.test.d.ts +0 -1
  49. package/dist/hooks/useControlledValue/useControlledValue.test.d.ts +0 -1
  50. 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, Fragment } from "react/jsx-runtime";
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 ((_a = dialogRef.current) == null ? void 0 : _a.close) {
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(Fragment, { children: /* @__PURE__ */ jsx(DialogContext.Provider, { value: { setEnabled }, children: /* @__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
- (_a = popoverRef.current) == null ? void 0 : _a.hidePopover();
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
- (_a = target.current) == null ? void 0 : _a.focus();
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockle/blocks-react",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "React hooks and components for Blockle",
5
5
  "type": "module",
6
6
  "exports": {
@@ -34,10 +34,10 @@
34
34
  "@vanilla-extract/css": "^1.17.1"
35
35
  },
36
36
  "peerDependencies": {
37
- "react": ">= 18 || >= 19",
38
- "react-dom": ">= 18 || >= 19",
39
- "@vanilla-extract/css": ">= 1.17.1",
40
- "@blockle/blocks-core": ">= 0.x",
41
- "@blockle/blocks-react-slot": ">= 1.x"
37
+ "react": ">=19",
38
+ "react-dom": ">=19",
39
+ "@vanilla-extract/css": ">=1.17.1",
40
+ "@blockle/blocks-core": ">=0.x",
41
+ "@blockle/blocks-react-slot": ">=1.x"
42
42
  }
43
43
  }
@@ -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,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { Divider, DividerProps } from './Divider.js';
3
- declare const meta: Meta<typeof Divider>;
4
- export default meta;
5
- type Story = StoryObj<DividerProps>;
6
- export declare const Default: Story;
@@ -1,5 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { ProgressProps } from './Progress.js';
3
- declare const _default: Meta;
4
- export default _default;
5
- export declare const Default: StoryObj<ProgressProps>;
@@ -1,5 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { SpinnerProps } from './Spinner.js';
3
- declare const _default: Meta;
4
- export default _default;
5
- export declare const Default: StoryObj<SpinnerProps>;
@@ -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,5 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { CheckboxProps } from './Checkbox.js';
3
- declare const _default: Meta;
4
- export default _default;
5
- export declare const Default: StoryObj<CheckboxProps>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { Input, InputProps } from './Input.js';
3
- declare const _default: Meta<typeof Input>;
4
- export default _default;
5
- export declare const Default: StoryObj<InputProps>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { LabelProps } from './Label.js';
3
- declare const _default: Meta;
4
- export default _default;
5
- export declare const Default: StoryObj<LabelProps>;
6
- export declare const WithInput: StoryObj<LabelProps>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { RadioProps } from './Radio.js';
3
- declare const _default: Meta;
4
- export default _default;
5
- export declare const Default: StoryObj<RadioProps>;
6
- export declare const WithRadioGroup: StoryObj<RadioProps>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { Select, SelectProps } from './Select.js';
3
- declare const _default: Meta<typeof Select>;
4
- export default _default;
5
- export declare const Default: StoryObj<SelectProps>;
@@ -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,5 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { SwitchProps } from './Switch.js';
3
- declare const _default: Meta;
4
- export default _default;
5
- export declare const Default: StoryObj<SwitchProps>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { BoxProps } from './Box.js';
3
- declare const _default: Meta;
4
- export default _default;
5
- export declare const Default: StoryObj<BoxProps>;
6
- export declare const AsChild: StoryObj<BoxProps>;
@@ -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,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { LinkProps } from './Link.js';
3
- declare const _default: Meta;
4
- export default _default;
5
- export declare const Default: StoryObj<LinkProps>;
6
- export declare const Play: StoryObj<LinkProps>;
@@ -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,5 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { TooltipProps } from './Tooltip.js';
3
- declare const _default: Meta;
4
- export default _default;
5
- export declare const Default: StoryObj<TooltipProps>;
@@ -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,5 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { Text, TextProps } from './Text.js';
3
- declare const _default: Meta<typeof Text>;
4
- export default _default;
5
- export declare const Default: StoryObj<TextProps>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};