@blockle/blocks 0.2.1 → 0.2.2
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/index.cjs
CHANGED
|
@@ -25,6 +25,33 @@ const Box = react.forwardRef(function Box2({ className, as, ...restProps }, ref)
|
|
|
25
25
|
}
|
|
26
26
|
return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: classnames(className, styles_lib_css_atoms_sprinkles_css_cjs.atoms(atomProps)), ...otherProps });
|
|
27
27
|
});
|
|
28
|
+
const Heading = ({
|
|
29
|
+
className,
|
|
30
|
+
level = 1,
|
|
31
|
+
children,
|
|
32
|
+
align,
|
|
33
|
+
fontSize,
|
|
34
|
+
fontWeight = "strong",
|
|
35
|
+
fontFamily,
|
|
36
|
+
...restProps
|
|
37
|
+
}) => {
|
|
38
|
+
const as = `h${level}`;
|
|
39
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
40
|
+
Box,
|
|
41
|
+
{
|
|
42
|
+
as,
|
|
43
|
+
className,
|
|
44
|
+
fontFamily,
|
|
45
|
+
fontWeight,
|
|
46
|
+
fontSize,
|
|
47
|
+
textAlign: align,
|
|
48
|
+
padding: "none",
|
|
49
|
+
margin: "none",
|
|
50
|
+
...restProps,
|
|
51
|
+
children
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
28
55
|
const justifyContentMap = {
|
|
29
56
|
left: "flex-start",
|
|
30
57
|
right: "flex-end",
|
|
@@ -70,6 +97,9 @@ const Stack = ({
|
|
|
70
97
|
alignX,
|
|
71
98
|
...restProps
|
|
72
99
|
}) => {
|
|
100
|
+
if (process.env.NODE_ENV === "development" && restProps.start !== void 0 && as !== "ol") {
|
|
101
|
+
console.warn('Stack: start prop is only valid when as="ol"');
|
|
102
|
+
}
|
|
73
103
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
74
104
|
Box,
|
|
75
105
|
{
|
|
@@ -113,6 +143,7 @@ exports.atoms = styles_lib_css_atoms_sprinkles_css_cjs.atoms;
|
|
|
113
143
|
exports.vars = styles_lib_css_theme_vars_css_cjs.vars;
|
|
114
144
|
exports.BlocksProvider = BlocksProvider;
|
|
115
145
|
exports.Box = Box;
|
|
146
|
+
exports.Heading = Heading;
|
|
116
147
|
exports.Inline = Inline;
|
|
117
148
|
exports.Stack = Stack;
|
|
118
149
|
exports.Text = Text;
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { BlocksProvider, BlocksProviderProps, Box, BoxProps, Inline, InlineProps, Stack, StackProps, Text, TextProps, atoms, classnames, vars } from './reset.css.js';
|
|
1
|
+
export { BlocksProvider, BlocksProviderProps, Box, BoxProps, Heading, HeadingProps, Inline, InlineProps, Stack, StackProps, Text, TextProps, atoms, classnames, vars } from './reset.css.js';
|
package/dist/index.mjs
CHANGED
|
@@ -23,6 +23,33 @@ const Box = forwardRef(function Box2({ className, as, ...restProps }, ref) {
|
|
|
23
23
|
}
|
|
24
24
|
return /* @__PURE__ */ jsx(Component, { ref, className: classnames(className, atoms(atomProps)), ...otherProps });
|
|
25
25
|
});
|
|
26
|
+
const Heading = ({
|
|
27
|
+
className,
|
|
28
|
+
level = 1,
|
|
29
|
+
children,
|
|
30
|
+
align,
|
|
31
|
+
fontSize,
|
|
32
|
+
fontWeight = "strong",
|
|
33
|
+
fontFamily,
|
|
34
|
+
...restProps
|
|
35
|
+
}) => {
|
|
36
|
+
const as = `h${level}`;
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
Box,
|
|
39
|
+
{
|
|
40
|
+
as,
|
|
41
|
+
className,
|
|
42
|
+
fontFamily,
|
|
43
|
+
fontWeight,
|
|
44
|
+
fontSize,
|
|
45
|
+
textAlign: align,
|
|
46
|
+
padding: "none",
|
|
47
|
+
margin: "none",
|
|
48
|
+
...restProps,
|
|
49
|
+
children
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
};
|
|
26
53
|
const justifyContentMap = {
|
|
27
54
|
left: "flex-start",
|
|
28
55
|
right: "flex-end",
|
|
@@ -68,6 +95,9 @@ const Stack = ({
|
|
|
68
95
|
alignX,
|
|
69
96
|
...restProps
|
|
70
97
|
}) => {
|
|
98
|
+
if (process.env.NODE_ENV === "development" && restProps.start !== void 0 && as !== "ol") {
|
|
99
|
+
console.warn('Stack: start prop is only valid when as="ol"');
|
|
100
|
+
}
|
|
71
101
|
return /* @__PURE__ */ jsx(
|
|
72
102
|
Box,
|
|
73
103
|
{
|
|
@@ -110,6 +140,7 @@ const Text = ({
|
|
|
110
140
|
export {
|
|
111
141
|
BlocksProvider,
|
|
112
142
|
Box,
|
|
143
|
+
Heading,
|
|
113
144
|
Inline,
|
|
114
145
|
Stack,
|
|
115
146
|
Text,
|
package/dist/reset.css.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ForwardRefComponent } from '@radix-ui/react-polymorphic';
|
|
2
2
|
import * as _vanilla_extract_sprinkles from '@vanilla-extract/sprinkles';
|
|
3
|
+
import { HTMLProps } from 'react';
|
|
3
4
|
|
|
4
5
|
type BlocksProviderProps = {
|
|
5
6
|
children: React.ReactNode;
|
|
@@ -32,6 +33,7 @@ declare const atoms: ((props: {
|
|
|
32
33
|
readonly right?: 0 | undefined;
|
|
33
34
|
readonly textDecoration?: "none" | "overline" | "line-through" | "underline" | undefined;
|
|
34
35
|
readonly textTransform?: "lowercase" | "uppercase" | "capitalize" | undefined;
|
|
36
|
+
readonly textWrap?: "balance" | "wrap" | undefined;
|
|
35
37
|
readonly top?: 0 | undefined;
|
|
36
38
|
readonly transition?: ("slow" | "normal" | "fast") | undefined;
|
|
37
39
|
readonly userSelect?: "none" | undefined;
|
|
@@ -222,7 +224,7 @@ declare const atoms: ((props: {
|
|
|
222
224
|
wide?: "center" | "flex-start" | "flex-end" | undefined;
|
|
223
225
|
} | undefined) | _vanilla_extract_sprinkles.ResponsiveArray<1 | 2 | 3 | 4, "center" | "flex-start" | "flex-end" | null>;
|
|
224
226
|
}) => string) & {
|
|
225
|
-
properties: Set<"borderRadius" | "color" | "fontFamily" | "fontSize" | "fontWeight" | "lineHeight" | "transition" | "alignItems" | "backgroundColor" | "bottom" | "boxShadow" | "columnGap" | "cursor" | "display" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "height" | "justifyContent" | "left" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "opacity" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "position" | "right" | "rowGap" | "textAlign" | "textTransform" | "top" | "userSelect" | "whiteSpace" | "width" | "wordBreak" | "wordWrap" | "flex" | "gap" | "inset" | "margin" | "outline" | "overflow" | "padding" | "placeItems" | "textDecoration" | "marginX" | "marginY" | "paddingX" | "paddingY">;
|
|
227
|
+
properties: Set<"borderRadius" | "color" | "fontFamily" | "fontSize" | "fontWeight" | "lineHeight" | "transition" | "alignItems" | "backgroundColor" | "bottom" | "boxShadow" | "columnGap" | "cursor" | "display" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "height" | "justifyContent" | "left" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "opacity" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "position" | "right" | "rowGap" | "textAlign" | "textTransform" | "top" | "userSelect" | "whiteSpace" | "width" | "wordBreak" | "wordWrap" | "flex" | "gap" | "inset" | "margin" | "outline" | "overflow" | "padding" | "placeItems" | "textDecoration" | "textWrap" | "marginX" | "marginY" | "paddingX" | "paddingY">;
|
|
226
228
|
};
|
|
227
229
|
|
|
228
230
|
type Atoms = Parameters<typeof atoms>[0];
|
|
@@ -255,6 +257,19 @@ type BoxProps = {
|
|
|
255
257
|
type PolymorphicBox = ForwardRefComponent<'div', BoxProps>;
|
|
256
258
|
declare const Box: PolymorphicBox;
|
|
257
259
|
|
|
260
|
+
type HTMLElementProps<E extends Element> = Omit<HTMLProps<E>, keyof Atoms | 'as' | 'ref'>;
|
|
261
|
+
|
|
262
|
+
type HeadingProps = {
|
|
263
|
+
className?: string;
|
|
264
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
265
|
+
children: React.ReactNode;
|
|
266
|
+
align?: Atoms['textAlign'];
|
|
267
|
+
fontSize?: Atoms['fontSize'];
|
|
268
|
+
fontWeight?: Atoms['fontWeight'];
|
|
269
|
+
fontFamily?: Atoms['fontFamily'];
|
|
270
|
+
} & MarginAndPaddingAtoms & HTMLElementProps<HTMLHeadingElement>;
|
|
271
|
+
declare const Heading: React.FC<HeadingProps>;
|
|
272
|
+
|
|
258
273
|
declare const justifyContentMap: {
|
|
259
274
|
readonly left: "flex-start";
|
|
260
275
|
readonly right: "flex-end";
|
|
@@ -288,6 +303,10 @@ type StackProps = {
|
|
|
288
303
|
gap: Atoms['gap'];
|
|
289
304
|
display?: ResponsiveDisplayFlex;
|
|
290
305
|
className?: string;
|
|
306
|
+
/**
|
|
307
|
+
* Start prop is only valid when as="ol"
|
|
308
|
+
*/
|
|
309
|
+
start?: number;
|
|
291
310
|
} & MarginAndPaddingAtoms;
|
|
292
311
|
declare const Stack: React.FC<StackProps>;
|
|
293
312
|
|
|
@@ -387,4 +406,4 @@ declare const theme: {
|
|
|
387
406
|
vars: string;
|
|
388
407
|
};
|
|
389
408
|
|
|
390
|
-
export { BlocksProvider, BlocksProviderProps, Box, BoxProps, Inline, InlineProps, Stack, StackProps, Text, TextProps, atoms, classnames, theme, vars };
|
|
409
|
+
export { BlocksProvider, BlocksProviderProps, Box, BoxProps, Heading, HeadingProps, Inline, InlineProps, Stack, StackProps, Text, TextProps, atoms, classnames, theme, vars };
|
|
@@ -23,6 +23,7 @@ const unresponsiveProperties = {
|
|
|
23
23
|
right: [0],
|
|
24
24
|
textDecoration: ["overline", "line-through", "underline", "none"],
|
|
25
25
|
textTransform: ["lowercase", "uppercase", "capitalize"],
|
|
26
|
+
textWrap: ["balance", "wrap"],
|
|
26
27
|
top: [0],
|
|
27
28
|
transition: styles_lib_css_theme_vars_css_cjs.vars.transition,
|
|
28
29
|
userSelect: ["none"],
|
|
@@ -22,6 +22,7 @@ const unresponsiveProperties = {
|
|
|
22
22
|
right: [0],
|
|
23
23
|
textDecoration: ["overline", "line-through", "underline", "none"],
|
|
24
24
|
textTransform: ["lowercase", "uppercase", "capitalize"],
|
|
25
|
+
textWrap: ["balance", "wrap"],
|
|
25
26
|
top: [0],
|
|
26
27
|
transition: vars.transition,
|
|
27
28
|
userSelect: ["none"],
|