ingred-ui 37.1.3 → 37.2.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.
@@ -1,5 +1,6 @@
1
1
  export { Shadow } from "./shadow";
2
2
  export { Radius } from "./radius";
3
+ export type { Radii, RadiiKey } from "./radius";
3
4
  export { Space } from "./space";
4
5
  export { breakpointPrimitives, BreakPoint, ContainerBreakPoint, } from "./breakPoint";
5
6
  export type { BreakpointPrimitive } from "./breakPoint";
@@ -1 +1,27 @@
1
+ /**
2
+ * @deprecated `theme.radii` の段階を使う。
3
+ */
1
4
  export declare const Radius = 8;
5
+ /**
6
+ * 角丸の段階。名前は Figma の Variables(radius)に合わせている。
7
+ * `full` は円やピル型など、形として丸くしたいときに使う。
8
+ */
9
+ export type Radii = {
10
+ none: number;
11
+ xs: number;
12
+ small: number;
13
+ medium: number;
14
+ large: number;
15
+ xl: number;
16
+ full: number;
17
+ };
18
+ export type RadiiKey = keyof Radii;
19
+ export type RadiiOptions = Partial<Radii>;
20
+ /**
21
+ * `radius` を基準に段階を作る。
22
+ * 段階ができる前は `theme.radius` を 1/4・1/2・3/4 倍して使っていたため、同じ比率にしている。
23
+ * `xl` は Figma の値(large 8 に対して 10)に合わせて 1.25 倍、`full` は `radius` によらず 9999 にしている。
24
+ * デフォルトの `Radius`(8)では 0 / 2 / 4 / 6 / 8 / 10 / 9999 になる。
25
+ */
26
+ export declare const createRadii: (radius: number) => Radii;
27
+ export declare const radii: Radii;
@@ -1,5 +1,6 @@
1
1
  import { Palette } from "./palette";
2
2
  import { Depth } from "../styles";
3
+ import { Radii, RadiiOptions } from "../styles/radius";
3
4
  import { DepthOptions } from "../styles/depth";
4
5
  import { DeepPartial } from "../types";
5
6
  export type ThemeOptions = {
@@ -8,7 +9,12 @@ export type ThemeOptions = {
8
9
  [key: string]: string;
9
10
  };
10
11
  spacing?: number;
12
+ /**
13
+ * @deprecated `radii` を使う。
14
+ * `radii` を渡さなかったときは、この値から `radii` の各段階を作る。
15
+ */
11
16
  radius?: number;
17
+ radii?: RadiiOptions;
12
18
  depth?: DepthOptions;
13
19
  interaction?: {
14
20
  focus: (isError?: boolean) => string;
@@ -20,7 +26,11 @@ export type Theme = {
20
26
  [key: string]: string;
21
27
  };
22
28
  spacing: number;
29
+ /**
30
+ * @deprecated `radii` を使う。
31
+ */
23
32
  radius: number;
33
+ radii: Radii;
24
34
  depth: Depth;
25
35
  interaction: {
26
36
  focus: (isError?: boolean) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ingred-ui",
3
- "version": "37.1.3",
3
+ "version": "37.2.0",
4
4
  "description": "",
5
5
  "author": "CARTA HOLDINGS, Inc.",
6
6
  "license": "MIT",