@blockle/blocks 0.2.0 → 0.2.1

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.
@@ -1,3 +1,4 @@
1
+ import { ForwardRefComponent } from '@radix-ui/react-polymorphic';
1
2
  import * as _vanilla_extract_sprinkles from '@vanilla-extract/sprinkles';
2
3
 
3
4
  type BlocksProviderProps = {
@@ -20,6 +21,7 @@ declare const atoms: ((props: {
20
21
  readonly fontWeight?: ("medium" | "regular" | "strong") | undefined;
21
22
  readonly height?: "auto" | "full" | undefined;
22
23
  readonly left?: 0 | undefined;
24
+ readonly lineHeight?: ("xsmall" | "small" | "medium" | "large" | "xlarge") | undefined;
23
25
  readonly maxHeight?: "full" | undefined;
24
26
  readonly maxWidth?: "full" | undefined;
25
27
  readonly opacity?: 0 | 1 | undefined;
@@ -31,20 +33,20 @@ declare const atoms: ((props: {
31
33
  readonly textDecoration?: "none" | "overline" | "line-through" | "underline" | undefined;
32
34
  readonly textTransform?: "lowercase" | "uppercase" | "capitalize" | undefined;
33
35
  readonly top?: 0 | undefined;
36
+ readonly transition?: ("slow" | "normal" | "fast") | undefined;
34
37
  readonly userSelect?: "none" | undefined;
35
38
  readonly whiteSpace?: "pre-wrap" | "nowrap" | "pre" | "pre-line" | undefined;
36
39
  readonly width?: "auto" | "fit-content" | "full" | undefined;
37
40
  readonly wordBreak?: "break-word" | undefined;
38
41
  readonly wordWrap?: "break-word" | undefined;
39
- readonly transition?: ("slow" | "normal" | "fast") | undefined;
40
42
  inset?: 0 | undefined;
41
43
  } & {
42
- readonly alignItems?: ("center" | "stretch" | "flex-start" | "flex-end" | {
43
- mobile?: "center" | "stretch" | "flex-start" | "flex-end" | undefined;
44
- tablet?: "center" | "stretch" | "flex-start" | "flex-end" | undefined;
45
- desktop?: "center" | "stretch" | "flex-start" | "flex-end" | undefined;
46
- wide?: "center" | "stretch" | "flex-start" | "flex-end" | undefined;
47
- } | undefined) | _vanilla_extract_sprinkles.ResponsiveArray<1 | 2 | 3 | 4, "center" | "stretch" | "flex-start" | "flex-end" | null>;
44
+ readonly alignItems?: ("stretch" | "center" | "flex-start" | "flex-end" | {
45
+ mobile?: "stretch" | "center" | "flex-start" | "flex-end" | undefined;
46
+ tablet?: "stretch" | "center" | "flex-start" | "flex-end" | undefined;
47
+ desktop?: "stretch" | "center" | "flex-start" | "flex-end" | undefined;
48
+ wide?: "stretch" | "center" | "flex-start" | "flex-end" | undefined;
49
+ } | undefined) | _vanilla_extract_sprinkles.ResponsiveArray<1 | 2 | 3 | 4, "stretch" | "center" | "flex-start" | "flex-end" | null>;
48
50
  readonly columnGap?: (("none" | "gutter" | "xsmall" | "small" | "medium" | "large" | "xlarge") | {
49
51
  mobile?: ("none" | "gutter" | "xsmall" | "small" | "medium" | "large" | "xlarge") | undefined;
50
52
  tablet?: ("none" | "gutter" | "xsmall" | "small" | "medium" | "large" | "xlarge") | undefined;
@@ -159,12 +161,12 @@ declare const atoms: ((props: {
159
161
  desktop?: ("none" | "gutter" | "xsmall" | "small" | "medium" | "large" | "xlarge") | undefined;
160
162
  wide?: ("none" | "gutter" | "xsmall" | "small" | "medium" | "large" | "xlarge") | undefined;
161
163
  } | undefined) | _vanilla_extract_sprinkles.ResponsiveArray<1 | 2 | 3 | 4, ("none" | "gutter" | "xsmall" | "small" | "medium" | "large" | "xlarge") | null>;
162
- readonly position?: ("fixed" | "relative" | "absolute" | "sticky" | "static" | {
163
- mobile?: "fixed" | "relative" | "absolute" | "sticky" | "static" | undefined;
164
- tablet?: "fixed" | "relative" | "absolute" | "sticky" | "static" | undefined;
165
- desktop?: "fixed" | "relative" | "absolute" | "sticky" | "static" | undefined;
166
- wide?: "fixed" | "relative" | "absolute" | "sticky" | "static" | undefined;
167
- } | undefined) | _vanilla_extract_sprinkles.ResponsiveArray<1 | 2 | 3 | 4, "fixed" | "relative" | "absolute" | "sticky" | "static" | null>;
164
+ readonly position?: ("relative" | "fixed" | "absolute" | "sticky" | "static" | {
165
+ mobile?: "relative" | "fixed" | "absolute" | "sticky" | "static" | undefined;
166
+ tablet?: "relative" | "fixed" | "absolute" | "sticky" | "static" | undefined;
167
+ desktop?: "relative" | "fixed" | "absolute" | "sticky" | "static" | undefined;
168
+ wide?: "relative" | "fixed" | "absolute" | "sticky" | "static" | undefined;
169
+ } | undefined) | _vanilla_extract_sprinkles.ResponsiveArray<1 | 2 | 3 | 4, "relative" | "fixed" | "absolute" | "sticky" | "static" | null>;
168
170
  readonly rowGap?: (("none" | "gutter" | "xsmall" | "small" | "medium" | "large" | "xlarge") | {
169
171
  mobile?: ("none" | "gutter" | "xsmall" | "small" | "medium" | "large" | "xlarge") | undefined;
170
172
  tablet?: ("none" | "gutter" | "xsmall" | "small" | "medium" | "large" | "xlarge") | undefined;
@@ -220,8 +222,91 @@ declare const atoms: ((props: {
220
222
  wide?: "center" | "flex-start" | "flex-end" | undefined;
221
223
  } | undefined) | _vanilla_extract_sprinkles.ResponsiveArray<1 | 2 | 3 | 4, "center" | "flex-start" | "flex-end" | null>;
222
224
  }) => string) & {
223
- properties: Set<"borderRadius" | "color" | "fontFamily" | "fontSize" | "fontWeight" | "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">;
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">;
226
+ };
227
+
228
+ type Atoms = Parameters<typeof atoms>[0];
229
+ type ResponsiveValue<T> = T | [T] | [T, T] | [T, T, T] | [T, T, T, T];
230
+ type ResponsiveDisplayFlex = ResponsiveValue<'none' | 'flex' | 'inline-flex'>;
231
+ type MarginAtoms = {
232
+ margin?: Atoms['margin'];
233
+ marginLeft?: Atoms['marginLeft'];
234
+ marginRight?: Atoms['marginRight'];
235
+ marginTop?: Atoms['marginTop'];
236
+ marginBottom?: Atoms['marginBottom'];
237
+ marginX?: Atoms['marginX'];
238
+ marginY?: Atoms['marginY'];
239
+ };
240
+ type PaddingAtoms = {
241
+ padding?: Atoms['padding'];
242
+ paddingLeft?: Atoms['paddingLeft'];
243
+ paddingRight?: Atoms['paddingRight'];
244
+ paddingTop?: Atoms['paddingTop'];
245
+ paddingBottom?: Atoms['paddingBottom'];
246
+ paddingX?: Atoms['paddingX'];
247
+ paddingY?: Atoms['paddingY'];
224
248
  };
249
+ type MarginAndPaddingAtoms = MarginAtoms & PaddingAtoms;
250
+
251
+ type BoxProps = {
252
+ children?: React.ReactNode;
253
+ className?: string;
254
+ } & Atoms;
255
+ type PolymorphicBox = ForwardRefComponent<'div', BoxProps>;
256
+ declare const Box: PolymorphicBox;
257
+
258
+ declare const justifyContentMap: {
259
+ readonly left: "flex-start";
260
+ readonly right: "flex-end";
261
+ readonly center: "center";
262
+ readonly between: "space-between";
263
+ readonly around: "space-around";
264
+ };
265
+ type JustifyContentMap = typeof justifyContentMap;
266
+ declare const alignItemsMap: {
267
+ readonly left: "flex-start";
268
+ readonly right: "flex-end";
269
+ readonly center: "center";
270
+ readonly stretch: "stretch";
271
+ };
272
+ type AlignItemsMap = typeof alignItemsMap;
273
+
274
+ type InlineProps = {
275
+ as?: 'div' | 'ul' | 'ol' | 'nav';
276
+ children: React.ReactNode;
277
+ alignX?: keyof JustifyContentMap;
278
+ alignY?: keyof AlignItemsMap;
279
+ gap: Atoms['gap'];
280
+ display?: ResponsiveDisplayFlex;
281
+ } & MarginAndPaddingAtoms;
282
+ declare const Inline: React.FC<InlineProps>;
283
+
284
+ type StackProps = {
285
+ as?: 'div' | 'section' | 'ul' | 'ol';
286
+ children: React.ReactNode;
287
+ alignX?: keyof AlignItemsMap;
288
+ gap: Atoms['gap'];
289
+ display?: ResponsiveDisplayFlex;
290
+ className?: string;
291
+ } & MarginAndPaddingAtoms;
292
+ declare const Stack: React.FC<StackProps>;
293
+
294
+ type TextProps = {
295
+ children: React.ReactNode;
296
+ as?: 'span' | 'p' | 'strong' | 'em' | 'small' | 's' | 'del' | 'ins' | 'sub' | 'sup';
297
+ color?: Atoms['color'];
298
+ fontSize?: Atoms['fontSize'];
299
+ fontWeight?: Atoms['fontWeight'];
300
+ fontFamily?: Atoms['fontFamily'];
301
+ textAlign?: Atoms['textAlign'];
302
+ fontStyle?: Atoms['fontStyle'];
303
+ textDecoration?: Atoms['textDecoration'];
304
+ lineHeight?: Atoms['lineHeight'];
305
+ whiteSpace?: Atoms['whiteSpace'];
306
+ wordWrap?: Atoms['wordWrap'];
307
+ wordBreak?: Atoms['wordBreak'];
308
+ } & MarginAndPaddingAtoms;
309
+ declare const Text: React.FC<TextProps>;
225
310
 
226
311
  declare const vars: {
227
312
  space: {
@@ -276,6 +361,13 @@ declare const vars: {
276
361
  regular: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
277
362
  strong: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
278
363
  };
364
+ lineHeight: {
365
+ xsmall: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
366
+ small: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
367
+ medium: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
368
+ large: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
369
+ xlarge: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
370
+ };
279
371
  transition: {
280
372
  slow: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
281
373
  normal: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
@@ -288,8 +380,11 @@ declare const vars: {
288
380
  };
289
381
  };
290
382
 
383
+ type Args = null | undefined | boolean | string;
384
+ declare const classnames: (...args: Args[]) => string | undefined;
385
+
291
386
  declare const theme: {
292
387
  vars: string;
293
388
  };
294
389
 
295
- export { BlocksProvider, atoms, theme, vars };
390
+ export { BlocksProvider, BlocksProviderProps, Box, BoxProps, Inline, InlineProps, Stack, StackProps, Text, TextProps, atoms, classnames, theme, vars };
@@ -12,6 +12,7 @@ const unresponsiveProperties = {
12
12
  fontWeight: styles_lib_css_theme_vars_css_cjs.vars.fontWeight,
13
13
  height: { auto: "auto", full: "100%" },
14
14
  left: [0],
15
+ lineHeight: styles_lib_css_theme_vars_css_cjs.vars.lineHeight,
15
16
  maxHeight: { full: "100%" },
16
17
  maxWidth: { full: "100%" },
17
18
  opacity: [0, 1],
@@ -23,12 +24,12 @@ const unresponsiveProperties = {
23
24
  textDecoration: ["overline", "line-through", "underline", "none"],
24
25
  textTransform: ["lowercase", "uppercase", "capitalize"],
25
26
  top: [0],
27
+ transition: styles_lib_css_theme_vars_css_cjs.vars.transition,
26
28
  userSelect: ["none"],
27
29
  whiteSpace: ["nowrap", "pre", "pre-line", "pre-wrap"],
28
30
  width: { auto: "auto", full: "100%", "fit-content": "fit-content" },
29
31
  wordBreak: ["break-word"],
30
- wordWrap: ["break-word"],
31
- transition: styles_lib_css_theme_vars_css_cjs.vars.transition
32
+ wordWrap: ["break-word"]
32
33
  };
33
34
  const marginSpace = { auto: "auto", ...styles_lib_css_theme_vars_css_cjs.vars.space };
34
35
  const responsiveProperties = {
@@ -11,6 +11,7 @@ const unresponsiveProperties = {
11
11
  fontWeight: vars.fontWeight,
12
12
  height: { auto: "auto", full: "100%" },
13
13
  left: [0],
14
+ lineHeight: vars.lineHeight,
14
15
  maxHeight: { full: "100%" },
15
16
  maxWidth: { full: "100%" },
16
17
  opacity: [0, 1],
@@ -22,12 +23,12 @@ const unresponsiveProperties = {
22
23
  textDecoration: ["overline", "line-through", "underline", "none"],
23
24
  textTransform: ["lowercase", "uppercase", "capitalize"],
24
25
  top: [0],
26
+ transition: vars.transition,
25
27
  userSelect: ["none"],
26
28
  whiteSpace: ["nowrap", "pre", "pre-line", "pre-wrap"],
27
29
  width: { auto: "auto", full: "100%", "fit-content": "fit-content" },
28
30
  wordBreak: ["break-word"],
29
- wordWrap: ["break-word"],
30
- transition: vars.transition
31
+ wordWrap: ["break-word"]
31
32
  };
32
33
  const marginSpace = { auto: "auto", ...vars.space };
33
34
  const responsiveProperties = {
@@ -6,8 +6,9 @@ css.globalStyle(":where(*, *::before, *::after)", {
6
6
  boxSizing: "inherit"
7
7
  });
8
8
  css.globalStyle(":where(html)", {
9
- lineHeight: 1.15,
10
- boxSizing: "border-box"
9
+ lineHeight: 1.5,
10
+ boxSizing: "border-box",
11
+ WebkitFontSmoothing: "antialiased"
11
12
  });
12
13
  css.globalStyle(":where(body)", {
13
14
  margin: 0,
@@ -5,8 +5,9 @@ globalStyle(":where(*, *::before, *::after)", {
5
5
  boxSizing: "inherit"
6
6
  });
7
7
  globalStyle(":where(html)", {
8
- lineHeight: 1.15,
9
- boxSizing: "border-box"
8
+ lineHeight: 1.5,
9
+ boxSizing: "border-box",
10
+ WebkitFontSmoothing: "antialiased"
10
11
  });
11
12
  globalStyle(":where(body)", {
12
13
  margin: 0,
@@ -8,6 +8,7 @@ const makeVanillaTheme = (tokens) => {
8
8
  fontFamily: tokens.typography.fontFamily,
9
9
  fontSize: tokens.typography.fontSize,
10
10
  fontWeight: tokens.typography.fontWeight,
11
+ lineHeight: tokens.typography.lineHeight,
11
12
  transition: tokens.transition,
12
13
  shadow: tokens.shadow
13
14
  };
@@ -7,6 +7,7 @@ const makeVanillaTheme = (tokens) => {
7
7
  fontFamily: tokens.typography.fontFamily,
8
8
  fontSize: tokens.typography.fontSize,
9
9
  fontWeight: tokens.typography.fontWeight,
10
+ lineHeight: tokens.typography.lineHeight,
10
11
  transition: tokens.transition,
11
12
  shadow: tokens.shadow
12
13
  };
@@ -16,6 +16,13 @@ const tokens = {
16
16
  regular: 400,
17
17
  medium: 500,
18
18
  strong: 700
19
+ },
20
+ lineHeight: {
21
+ xsmall: "1rem",
22
+ small: "1.25rem",
23
+ medium: "1.5rem",
24
+ large: "1.75rem",
25
+ xlarge: "2rem"
19
26
  }
20
27
  },
21
28
  space: {
@@ -15,6 +15,13 @@ const tokens = {
15
15
  regular: 400,
16
16
  medium: 500,
17
17
  strong: 700
18
+ },
19
+ lineHeight: {
20
+ xsmall: "1rem",
21
+ small: "1.25rem",
22
+ medium: "1.5rem",
23
+ large: "1.75rem",
24
+ xlarge: "2rem"
18
25
  }
19
26
  },
20
27
  space: {
@@ -50,8 +50,8 @@ const tokens = {
50
50
  },
51
51
  typography: {
52
52
  fontFamily: {
53
- standard: "Noto Sans JP",
54
- secondary: "Noto Sans JP"
53
+ standard: '"Rubik", sans-serif',
54
+ secondary: '"Rubik", sans-serif'
55
55
  },
56
56
  fontSize: {
57
57
  xsmall: "12px",
@@ -64,6 +64,13 @@ const tokens = {
64
64
  regular: 400,
65
65
  medium: 500,
66
66
  strong: 700
67
+ },
68
+ lineHeight: {
69
+ xsmall: "1rem",
70
+ small: "1.25rem",
71
+ medium: "1.5rem",
72
+ large: "1.75rem",
73
+ xlarge: "2rem"
67
74
  }
68
75
  }
69
76
  };
@@ -49,8 +49,8 @@ const tokens = {
49
49
  },
50
50
  typography: {
51
51
  fontFamily: {
52
- standard: "Noto Sans JP",
53
- secondary: "Noto Sans JP"
52
+ standard: '"Rubik", sans-serif',
53
+ secondary: '"Rubik", sans-serif'
54
54
  },
55
55
  fontSize: {
56
56
  xsmall: "12px",
@@ -63,6 +63,13 @@ const tokens = {
63
63
  regular: 400,
64
64
  medium: 500,
65
65
  strong: 700
66
+ },
67
+ lineHeight: {
68
+ xsmall: "1rem",
69
+ small: "1.25rem",
70
+ medium: "1.5rem",
71
+ large: "1.75rem",
72
+ xlarge: "2rem"
66
73
  }
67
74
  }
68
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockle/blocks",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Blocks design system",
5
5
  "repository": "git@github.com:Blockle/blocks.git",
6
6
  "license": "MIT",
@@ -33,34 +33,36 @@
33
33
  ],
34
34
  "scripts": {
35
35
  "build": "crackle package",
36
- "fix": "crackle fix"
36
+ "fix": "crackle fix",
37
+ "ts": "tsc --noemit --project ./tsconfig.json"
37
38
  },
38
39
  "dependencies": {
39
- "@vanilla-extract/css": "^1.11.0",
40
+ "@radix-ui/react-polymorphic": "^0.0.14",
41
+ "@vanilla-extract/css": "^1.11.1",
40
42
  "@vanilla-extract/css-utils": "^0.1.3",
41
- "@vanilla-extract/sprinkles": "^1.6.0"
43
+ "@vanilla-extract/sprinkles": "^1.6.0",
44
+ "react": "^18.2.0",
45
+ "react-dom": "^18.2.0"
42
46
  },
43
47
  "devDependencies": {
44
- "@crackle/cli": "^0.11.5",
45
- "@crackle/core": "^0.24.1",
46
- "@types/react": "^18.2.7",
47
- "@types/react-dom": "^18.2.4",
48
- "@typescript-eslint/eslint-plugin": "^5.59.7",
49
- "@typescript-eslint/parser": "^5.59.7",
48
+ "@crackle/cli": "^0.12.0",
49
+ "@crackle/core": "^0.25.0",
50
+ "@types/react": "^18.2.13",
51
+ "@types/react-dom": "^18.2.6",
52
+ "@typescript-eslint/eslint-plugin": "^5.60.0",
53
+ "@typescript-eslint/parser": "^5.60.0",
50
54
  "cross-env": "^7.0.3",
51
- "eslint": "^8.41.0",
55
+ "eslint": "^8.43.0",
52
56
  "eslint-config-prettier": "^8.8.0",
53
- "eslint-plugin-jest": "^27.2.1",
57
+ "eslint-plugin-jest": "^27.2.2",
54
58
  "eslint-plugin-prettier": "^4.2.1",
55
59
  "eslint-plugin-react": "^7.32.2",
56
60
  "eslint-plugin-react-hooks": "^4.6.0",
57
61
  "eslint-plugin-storybook": "^0.6.12",
58
62
  "eslint-plugin-unicorn": "^47.0.0",
59
63
  "prettier": "^2.8.8",
60
- "react": "^18.2.0",
61
- "react-dom": "^18.2.0",
62
- "typescript": "^5.0.4",
63
- "vitest": "^0.31.1"
64
+ "typescript": "^5.1.3",
65
+ "vitest": "^0.32.2"
64
66
  },
65
67
  "packageManager": "yarn@1.22.19"
66
68
  }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- require("../../../../styles/lib/css/atoms/sprinkles.css.cjs");
@@ -1 +0,0 @@
1
- import "../../../../styles/lib/css/atoms/sprinkles.css.mjs";
@@ -1,2 +0,0 @@
1
- "use strict";
2
- require("../../../styles/themes/momotaro/momotaroTheme.css.cjs");
@@ -1 +0,0 @@
1
- import "../../../styles/themes/momotaro/momotaroTheme.css.mjs";