@blockle/blocks-react 1.0.1 → 1.0.3
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/display/Divider/Divider.d.ts +2 -2
- package/dist/components/feedback/Spinner/Spinner.d.ts +2 -2
- package/dist/components/form/Button/Button.cjs +1 -1
- package/dist/components/form/Button/Button.d.ts +4 -4
- package/dist/components/form/Button/Button.js +2 -2
- package/dist/components/form/Label/Label.cjs +1 -5
- package/dist/components/form/Label/Label.d.ts +2 -2
- package/dist/components/form/Label/Label.js +2 -6
- package/dist/components/layout/Box/Box.cjs +1 -1
- package/dist/components/layout/Box/Box.d.ts +2 -2
- package/dist/components/layout/Box/Box.js +2 -2
- package/dist/components/layout/Inline/Inline.d.ts +4 -4
- package/dist/components/layout/Stack/Stack.d.ts +4 -4
- package/dist/components/navigation/Link/Link.d.ts +2 -2
- package/dist/components/providers/BlocksProvider/BlocksProvider.cjs +1 -1
- package/dist/components/providers/BlocksProvider/BlocksProvider.js +2 -2
- package/dist/components/typography/Heading/Heading.d.ts +2 -2
- package/dist/components/typography/Heading/heading.stories.d.ts +1 -5
- package/dist/components/typography/Text/Text.d.ts +2 -2
- package/package.json +7 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Atoms } from '@blockle/blocks-core';
|
|
2
2
|
export type DividerProps = {
|
|
3
3
|
className?: string;
|
|
4
|
-
color?:
|
|
4
|
+
color?: Atoms['backgroundColor'];
|
|
5
5
|
style?: React.CSSProperties;
|
|
6
6
|
};
|
|
7
7
|
export declare const Divider: React.FC<DividerProps>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ComponentThemes,
|
|
1
|
+
import { ComponentThemes, MarginAtoms } from '@blockle/blocks-core';
|
|
2
2
|
type SpinnerTheme = ComponentThemes['spinner'];
|
|
3
3
|
export type SpinnerProps = {
|
|
4
4
|
className?: string;
|
|
5
5
|
color?: SpinnerTheme['variants']['color'];
|
|
6
6
|
size?: SpinnerTheme['variants']['size'];
|
|
7
7
|
style?: React.CSSProperties;
|
|
8
|
-
} &
|
|
8
|
+
} & MarginAtoms;
|
|
9
9
|
export declare const Spinner: React.FC<SpinnerProps>;
|
|
10
10
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ComponentThemes, HTMLElementProps,
|
|
2
|
+
import { Atoms, ComponentThemes, HTMLElementProps, MarginAtoms } from '@blockle/blocks-core';
|
|
3
3
|
type ButtonTheme = ComponentThemes['button'];
|
|
4
4
|
export type ButtonProps = {
|
|
5
|
-
alignSelf?:
|
|
5
|
+
alignSelf?: Atoms['alignSelf'];
|
|
6
6
|
asChild?: boolean;
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
endSlot?: React.ReactNode;
|
|
10
|
-
inlineSize?:
|
|
10
|
+
inlineSize?: Atoms['inlineSize'];
|
|
11
11
|
intent?: ButtonTheme['variants']['intent'];
|
|
12
12
|
loading?: boolean;
|
|
13
13
|
popovertarget?: string;
|
|
@@ -16,6 +16,6 @@ export type ButtonProps = {
|
|
|
16
16
|
startSlot?: React.ReactNode;
|
|
17
17
|
type?: 'button' | 'submit' | 'reset';
|
|
18
18
|
variant?: ButtonTheme['variants']['variant'];
|
|
19
|
-
} & Omit<HTMLElementProps<HTMLButtonElement>, 'size'> &
|
|
19
|
+
} & Omit<HTMLElementProps<HTMLButtonElement>, 'size'> & MarginAtoms;
|
|
20
20
|
export declare const Button: React.FC<ButtonProps>;
|
|
21
21
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
-
import { getAtomsAndProps, classnames,
|
|
3
|
+
import { getAtomsAndProps, classnames, atoms } from "@blockle/blocks-core";
|
|
4
4
|
import { createSlottable } from "@blockle/blocks-react-slot";
|
|
5
5
|
import { buttonReset } from "./Button.css.js";
|
|
6
6
|
import { useComponentStyles } from "../../../hooks/useComponentStyles/useComponentStyles.js";
|
|
@@ -40,7 +40,7 @@ const Button = ({
|
|
|
40
40
|
className: classnames(
|
|
41
41
|
buttonReset,
|
|
42
42
|
buttonClassName,
|
|
43
|
-
|
|
43
|
+
atoms(atomsProps),
|
|
44
44
|
className
|
|
45
45
|
),
|
|
46
46
|
...otherProps,
|
|
@@ -21,11 +21,7 @@ const Label = ({
|
|
|
21
21
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22
22
|
Component,
|
|
23
23
|
{
|
|
24
|
-
className: blocksCore.classnames(
|
|
25
|
-
containerClassName,
|
|
26
|
-
className,
|
|
27
|
-
blocksCore.sprinkles({ cursor })
|
|
28
|
-
),
|
|
24
|
+
className: blocksCore.classnames(containerClassName, className, blocksCore.atoms({ cursor })),
|
|
29
25
|
...restProps,
|
|
30
26
|
children
|
|
31
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentThemes, HTMLElementProps
|
|
1
|
+
import { Atoms, ComponentThemes, HTMLElementProps } from '@blockle/blocks-core';
|
|
2
2
|
type LabelTheme = ComponentThemes['label'];
|
|
3
3
|
export type LabelProps = {
|
|
4
4
|
/**
|
|
@@ -12,7 +12,7 @@ export type LabelProps = {
|
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
required?: boolean;
|
|
14
14
|
size?: LabelTheme['variants']['size'];
|
|
15
|
-
cursor?:
|
|
15
|
+
cursor?: Atoms['cursor'];
|
|
16
16
|
} & HTMLElementProps<HTMLLabelElement>;
|
|
17
17
|
export declare const Label: React.FC<LabelProps>;
|
|
18
18
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { classnames,
|
|
3
|
+
import { classnames, atoms } from "@blockle/blocks-core";
|
|
4
4
|
import { useComponentStyles } from "../../../hooks/useComponentStyles/useComponentStyles.js";
|
|
5
5
|
const Label = ({
|
|
6
6
|
asSpan,
|
|
@@ -19,11 +19,7 @@ const Label = ({
|
|
|
19
19
|
return /* @__PURE__ */ jsx(
|
|
20
20
|
Component,
|
|
21
21
|
{
|
|
22
|
-
className: classnames(
|
|
23
|
-
containerClassName,
|
|
24
|
-
className,
|
|
25
|
-
sprinkles({ cursor })
|
|
26
|
-
),
|
|
22
|
+
className: classnames(containerClassName, className, atoms({ cursor })),
|
|
27
23
|
...restProps,
|
|
28
24
|
children
|
|
29
25
|
}
|
|
@@ -17,7 +17,7 @@ const Box = ({
|
|
|
17
17
|
{
|
|
18
18
|
ref,
|
|
19
19
|
asChild,
|
|
20
|
-
className: blocksCore.classnames(className, blocksCore.
|
|
20
|
+
className: blocksCore.classnames(className, blocksCore.atoms(atomsProps)),
|
|
21
21
|
...otherProps,
|
|
22
22
|
children: /* @__PURE__ */ jsxRuntime.jsx(Slot, { children })
|
|
23
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Atoms, HTMLElementProps } from '@blockle/blocks-core';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
export type BoxProps = {
|
|
4
4
|
asChild?: boolean;
|
|
@@ -6,5 +6,5 @@ export type BoxProps = {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
ref?: React.Ref<HTMLDivElement>;
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
|
-
} &
|
|
9
|
+
} & Atoms & HTMLElementProps<HTMLDivElement>;
|
|
10
10
|
export declare const Box: React.FC<BoxProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getAtomsAndProps, classnames,
|
|
2
|
+
import { getAtomsAndProps, classnames, atoms } from "@blockle/blocks-core";
|
|
3
3
|
import { createSlottable } from "@blockle/blocks-react-slot";
|
|
4
4
|
const [Template, Slot] = createSlottable("div");
|
|
5
5
|
const Box = ({
|
|
@@ -15,7 +15,7 @@ const Box = ({
|
|
|
15
15
|
{
|
|
16
16
|
ref,
|
|
17
17
|
asChild,
|
|
18
|
-
className: classnames(className,
|
|
18
|
+
className: classnames(className, atoms(atomsProps)),
|
|
19
19
|
...otherProps,
|
|
20
20
|
children: /* @__PURE__ */ jsx(Slot, { children })
|
|
21
21
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AlignItemsMap,
|
|
1
|
+
import { AlignItemsMap, Atoms, JustifyContentMap, MarginAtoms, PaddingAtoms } from '@blockle/blocks-core';
|
|
2
2
|
export type InlineProps = {
|
|
3
3
|
alignX?: keyof JustifyContentMap;
|
|
4
4
|
alignY?: keyof AlignItemsMap;
|
|
5
5
|
tag?: 'div' | 'ul' | 'ol' | 'nav';
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
className?: string;
|
|
8
|
-
display?:
|
|
9
|
-
spacing:
|
|
8
|
+
display?: Atoms['display'];
|
|
9
|
+
spacing: Atoms['gap'];
|
|
10
10
|
style?: React.CSSProperties;
|
|
11
|
-
} &
|
|
11
|
+
} & MarginAtoms & PaddingAtoms;
|
|
12
12
|
export declare const Inline: React.FC<InlineProps>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { AlignItemsMap,
|
|
1
|
+
import { AlignItemsMap, Atoms, MarginAtoms, PaddingAtoms } from '@blockle/blocks-core';
|
|
2
2
|
export type StackProps = {
|
|
3
3
|
alignX?: keyof AlignItemsMap;
|
|
4
4
|
tag?: 'div' | 'section' | 'ul' | 'ol';
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
className?: string;
|
|
7
|
-
display?:
|
|
8
|
-
spacing:
|
|
7
|
+
display?: Atoms['display'];
|
|
8
|
+
spacing: Atoms['gap'];
|
|
9
9
|
style?: React.CSSProperties;
|
|
10
10
|
role?: React.AriaRole;
|
|
11
11
|
/**
|
|
12
12
|
* Start prop is only valid when tag="ol"
|
|
13
13
|
*/
|
|
14
14
|
start?: number;
|
|
15
|
-
} &
|
|
15
|
+
} & MarginAtoms & PaddingAtoms;
|
|
16
16
|
export declare const Stack: React.FC<StackProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentThemes, HTMLElementProps,
|
|
1
|
+
import { ComponentThemes, HTMLElementProps, MarginAtoms } from '@blockle/blocks-core';
|
|
2
2
|
type LinkTheme = ComponentThemes['link'];
|
|
3
3
|
export type LinkProps = {
|
|
4
4
|
asChild?: boolean;
|
|
@@ -6,6 +6,6 @@ export type LinkProps = {
|
|
|
6
6
|
ref?: React.Ref<HTMLAnchorElement>;
|
|
7
7
|
underline?: LinkTheme['variants']['underline'];
|
|
8
8
|
variant?: LinkTheme['variants']['variant'];
|
|
9
|
-
} &
|
|
9
|
+
} & MarginAtoms & HTMLElementProps<HTMLAnchorElement>;
|
|
10
10
|
export declare const Link: React.FC<LinkProps>;
|
|
11
11
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
|
-
import { classnames,
|
|
4
|
+
import { classnames, atoms } from "@blockle/blocks-core";
|
|
5
5
|
import { createSlottable } from "@blockle/blocks-react-slot";
|
|
6
6
|
import { BlocksProviderContext } from "./context.js";
|
|
7
7
|
const [Template, Slot] = createSlottable("div");
|
|
@@ -22,7 +22,7 @@ const BlocksProvider = ({
|
|
|
22
22
|
{
|
|
23
23
|
className: classnames(
|
|
24
24
|
theme.vars,
|
|
25
|
-
|
|
25
|
+
atoms({ fontFamily: "primary" }),
|
|
26
26
|
className
|
|
27
27
|
),
|
|
28
28
|
...restProps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { HTMLElementProps,
|
|
1
|
+
import { HTMLElementProps, MarginAtoms, PaddingAtoms, TextAtoms } from '@blockle/blocks-core';
|
|
2
2
|
export type HeadingProps = {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
className?: string;
|
|
5
5
|
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
-
} &
|
|
6
|
+
} & TextAtoms & MarginAtoms & PaddingAtoms & HTMLElementProps<HTMLHeadingElement>;
|
|
7
7
|
export declare const Heading: React.FC<HeadingProps>;
|
|
@@ -4,9 +4,5 @@ declare const _default: Meta<typeof Heading>;
|
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Default: StoryObj<HeadingProps>;
|
|
6
6
|
export declare const All: {
|
|
7
|
-
render:
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
className?: string;
|
|
10
|
-
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
11
|
-
} & import('@blockle/blocks-core').TextSprinkles & import('@blockle/blocks-core').MarginSprinkles & import('@blockle/blocks-core').PaddingSprinkles & import('@blockle/blocks-core').HTMLElementProps<HTMLHeadingElement>>;
|
|
7
|
+
render: any;
|
|
12
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLElementProps,
|
|
1
|
+
import { HTMLElementProps, MarginAtoms, PaddingAtoms, TextAtoms } from '@blockle/blocks-core';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
type Tags = 'del' | 'em' | 'ins' | 'label' | 'p' | 's' | 'small' | 'span' | 'strong' | 'sub' | 'sup';
|
|
4
4
|
export type TextProps<Tag extends Tags = 'span'> = {
|
|
@@ -6,6 +6,6 @@ export type TextProps<Tag extends Tags = 'span'> = {
|
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
ref?: React.Ref<HTMLElementTagNameMap[Tag]>;
|
|
8
8
|
tag?: Tag;
|
|
9
|
-
} &
|
|
9
|
+
} & TextAtoms & MarginAtoms & PaddingAtoms & HTMLElementProps<HTMLSpanElement>;
|
|
10
10
|
export declare const Text: <T extends Tags = "span">({ asChild, children, className, ref, tag, ...restProps }: TextProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockle/blocks-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "React hooks and components for Blockle",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -37,11 +37,13 @@
|
|
|
37
37
|
"url": "https://github.com/Blockle/blocks/issues"
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/Blockle/blocks#readme",
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@vanilla-extract/css": "^1.17.1"
|
|
42
|
+
},
|
|
40
43
|
"peerDependencies": {
|
|
41
|
-
"react": "
|
|
42
|
-
"react-dom": "
|
|
44
|
+
"react": "^19",
|
|
45
|
+
"react-dom": "^19",
|
|
43
46
|
"@blockle/blocks-core": "^0.21.0",
|
|
44
|
-
"@blockle/blocks-react-slot": "^1.0.0"
|
|
45
|
-
"@vanilla-extract/css": "^1.17.1"
|
|
47
|
+
"@blockle/blocks-react-slot": "^1.0.0"
|
|
46
48
|
}
|
|
47
49
|
}
|