@channel.io/bezier-react 4.0.0-next.2 → 4.0.0-next.4
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/cjs/components/Button/Button.module.scss.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/cjs/types/props-helpers.js +8 -0
- package/dist/cjs/types/props-helpers.js.map +1 -1
- package/dist/cjs/v3/BaseStack/BaseStack.js +46 -0
- package/dist/cjs/v3/BaseStack/BaseStack.js.map +1 -0
- package/dist/cjs/v3/BaseStack/BaseStack.module.scss.js +8 -0
- package/dist/cjs/v3/BaseStack/BaseStack.module.scss.js.map +1 -0
- package/dist/cjs/v3/Box/Box.js +56 -0
- package/dist/cjs/v3/Box/Box.js.map +1 -0
- package/dist/cjs/v3/Box/Box.module.scss.js +8 -0
- package/dist/cjs/v3/Box/Box.module.scss.js.map +1 -0
- package/dist/cjs/v3/Divider/Divider.js +32 -0
- package/dist/cjs/v3/Divider/Divider.js.map +1 -0
- package/dist/cjs/v3/Divider/Divider.module.scss.js +8 -0
- package/dist/cjs/v3/Divider/Divider.module.scss.js.map +1 -0
- package/dist/cjs/v3/HStack/HStack.js +19 -0
- package/dist/cjs/v3/HStack/HStack.js.map +1 -0
- package/dist/cjs/v3/Icon/Icon.js +51 -0
- package/dist/cjs/v3/Icon/Icon.js.map +1 -0
- package/dist/cjs/v3/Icon/Icon.module.scss.js +8 -0
- package/dist/cjs/v3/Icon/Icon.module.scss.js.map +1 -0
- package/dist/cjs/v3/SmoothCornersBox/SmoothCornersBox.js +53 -0
- package/dist/cjs/v3/SmoothCornersBox/SmoothCornersBox.js.map +1 -0
- package/dist/cjs/v3/SmoothCornersBox/SmoothCornersBox.module.scss.js +8 -0
- package/dist/cjs/v3/SmoothCornersBox/SmoothCornersBox.module.scss.js.map +1 -0
- package/dist/cjs/v3/Spinner/Spinner.js +45 -0
- package/dist/cjs/v3/Spinner/Spinner.js.map +1 -0
- package/dist/cjs/v3/Spinner/Spinner.module.scss.js +8 -0
- package/dist/cjs/v3/Spinner/Spinner.module.scss.js.map +1 -0
- package/dist/cjs/v3/Text/Text.js +60 -0
- package/dist/cjs/v3/Text/Text.js.map +1 -0
- package/dist/cjs/v3/Text/Text.module.scss.js +8 -0
- package/dist/cjs/v3/Text/Text.module.scss.js.map +1 -0
- package/dist/cjs/v3/VStack/VStack.js +19 -0
- package/dist/cjs/v3/VStack/VStack.js.map +1 -0
- package/dist/cjs/v3/index.js +22 -0
- package/dist/cjs/v3/index.js.map +1 -0
- package/dist/esm/components/Button/Button.module.scss.mjs +1 -1
- package/dist/esm/styles.css +1 -1
- package/dist/esm/types/props-helpers.mjs +5 -1
- package/dist/esm/types/props-helpers.mjs.map +1 -1
- package/dist/esm/v3/BaseStack/BaseStack.mjs +44 -0
- package/dist/esm/v3/BaseStack/BaseStack.mjs.map +1 -0
- package/dist/esm/v3/BaseStack/BaseStack.module.scss.mjs +4 -0
- package/dist/esm/v3/BaseStack/BaseStack.module.scss.mjs.map +1 -0
- package/dist/esm/v3/Box/Box.mjs +54 -0
- package/dist/esm/v3/Box/Box.mjs.map +1 -0
- package/dist/esm/v3/Box/Box.module.scss.mjs +4 -0
- package/dist/esm/v3/Box/Box.module.scss.mjs.map +1 -0
- package/dist/esm/v3/Divider/Divider.mjs +30 -0
- package/dist/esm/v3/Divider/Divider.mjs.map +1 -0
- package/dist/esm/v3/Divider/Divider.module.scss.mjs +4 -0
- package/dist/esm/v3/Divider/Divider.module.scss.mjs.map +1 -0
- package/dist/esm/v3/HStack/HStack.mjs +17 -0
- package/dist/esm/v3/HStack/HStack.mjs.map +1 -0
- package/dist/esm/v3/Icon/Icon.mjs +49 -0
- package/dist/esm/v3/Icon/Icon.mjs.map +1 -0
- package/dist/esm/v3/Icon/Icon.module.scss.mjs +4 -0
- package/dist/esm/v3/Icon/Icon.module.scss.mjs.map +1 -0
- package/dist/esm/v3/SmoothCornersBox/SmoothCornersBox.mjs +51 -0
- package/dist/esm/v3/SmoothCornersBox/SmoothCornersBox.mjs.map +1 -0
- package/dist/esm/v3/SmoothCornersBox/SmoothCornersBox.module.scss.mjs +4 -0
- package/dist/esm/v3/SmoothCornersBox/SmoothCornersBox.module.scss.mjs.map +1 -0
- package/dist/esm/v3/Spinner/Spinner.mjs +43 -0
- package/dist/esm/v3/Spinner/Spinner.mjs.map +1 -0
- package/dist/esm/v3/Spinner/Spinner.module.scss.mjs +4 -0
- package/dist/esm/v3/Spinner/Spinner.module.scss.mjs.map +1 -0
- package/dist/esm/v3/Text/Text.mjs +58 -0
- package/dist/esm/v3/Text/Text.mjs.map +1 -0
- package/dist/esm/v3/Text/Text.module.scss.mjs +4 -0
- package/dist/esm/v3/Text/Text.module.scss.mjs.map +1 -0
- package/dist/esm/v3/VStack/VStack.mjs +17 -0
- package/dist/esm/v3/VStack/VStack.mjs.map +1 -0
- package/dist/esm/v3/index.mjs +9 -0
- package/dist/esm/v3/index.mjs.map +1 -0
- package/dist/types/types/beta-tokens.d.ts +4 -0
- package/dist/types/types/beta-tokens.d.ts.map +1 -1
- package/dist/types/types/props-helpers.d.ts +48 -1
- package/dist/types/types/props-helpers.d.ts.map +1 -1
- package/dist/types/types/props.d.ts +44 -0
- package/dist/types/types/props.d.ts.map +1 -1
- package/dist/types/v3/BaseStack/BaseStack.d.ts +6 -0
- package/dist/types/v3/BaseStack/BaseStack.d.ts.map +1 -0
- package/dist/types/v3/BaseStack/BaseStack.types.d.ts +45 -0
- package/dist/types/v3/BaseStack/BaseStack.types.d.ts.map +1 -0
- package/dist/types/v3/Box/Box.d.ts +19 -0
- package/dist/types/v3/Box/Box.d.ts.map +1 -0
- package/dist/types/v3/Box/Box.types.d.ts +12 -0
- package/dist/types/v3/Box/Box.types.d.ts.map +1 -0
- package/dist/types/v3/Box/index.d.ts +3 -0
- package/dist/types/v3/Box/index.d.ts.map +1 -0
- package/dist/types/v3/Divider/Divider.d.ts +13 -0
- package/dist/types/v3/Divider/Divider.d.ts.map +1 -0
- package/dist/types/v3/Divider/Divider.types.d.ts +27 -0
- package/dist/types/v3/Divider/Divider.types.d.ts.map +1 -0
- package/dist/types/v3/Divider/index.d.ts +3 -0
- package/dist/types/v3/Divider/index.d.ts.map +1 -0
- package/dist/types/v3/HStack/HStack.d.ts +7 -0
- package/dist/types/v3/HStack/HStack.d.ts.map +1 -0
- package/dist/types/v3/HStack/HStack.types.d.ts +2 -0
- package/dist/types/v3/HStack/HStack.types.d.ts.map +1 -0
- package/dist/types/v3/HStack/index.d.ts +3 -0
- package/dist/types/v3/HStack/index.d.ts.map +1 -0
- package/dist/types/v3/Icon/Icon.d.ts +19 -0
- package/dist/types/v3/Icon/Icon.d.ts.map +1 -0
- package/dist/types/v3/Icon/Icon.types.d.ts +21 -0
- package/dist/types/v3/Icon/Icon.types.d.ts.map +1 -0
- package/dist/types/v3/Icon/index.d.ts +3 -0
- package/dist/types/v3/Icon/index.d.ts.map +1 -0
- package/dist/types/v3/SmoothCornersBox/SmoothCornersBox.d.ts +15 -0
- package/dist/types/v3/SmoothCornersBox/SmoothCornersBox.d.ts.map +1 -0
- package/dist/types/v3/SmoothCornersBox/SmoothCornersBox.types.d.ts +61 -0
- package/dist/types/v3/SmoothCornersBox/SmoothCornersBox.types.d.ts.map +1 -0
- package/dist/types/v3/SmoothCornersBox/index.d.ts +3 -0
- package/dist/types/v3/SmoothCornersBox/index.d.ts.map +1 -0
- package/dist/types/v3/Spinner/Spinner.d.ts +15 -0
- package/dist/types/v3/Spinner/Spinner.d.ts.map +1 -0
- package/dist/types/v3/Spinner/Spinner.types.d.ts +5 -0
- package/dist/types/v3/Spinner/Spinner.types.d.ts.map +1 -0
- package/dist/types/v3/Spinner/index.d.ts +3 -0
- package/dist/types/v3/Spinner/index.d.ts.map +1 -0
- package/dist/types/v3/Text/Text.d.ts +16 -0
- package/dist/types/v3/Text/Text.d.ts.map +1 -0
- package/dist/types/v3/Text/Text.types.d.ts +44 -0
- package/dist/types/v3/Text/Text.types.d.ts.map +1 -0
- package/dist/types/v3/Text/index.d.ts +3 -0
- package/dist/types/v3/Text/index.d.ts.map +1 -0
- package/dist/types/v3/VStack/VStack.d.ts +7 -0
- package/dist/types/v3/VStack/VStack.d.ts.map +1 -0
- package/dist/types/v3/VStack/VStack.types.d.ts +2 -0
- package/dist/types/v3/VStack/VStack.types.d.ts.map +1 -0
- package/dist/types/v3/VStack/index.d.ts +3 -0
- package/dist/types/v3/VStack/index.d.ts.map +1 -0
- package/dist/types/v3/index.d.ts +9 -0
- package/dist/types/v3/index.d.ts.map +1 -0
- package/package.json +6 -1
- package/src/components/AlphaButton/Button.module.scss +1 -1
- package/src/components/AlphaFloatingButton/FloatingButton.module.scss +1 -1
- package/src/components/Button/Button.module.scss +9 -1
- package/src/types/beta-tokens.ts +8 -0
- package/src/types/props-helpers.ts +22 -1
- package/src/types/props.ts +52 -0
- package/src/v3/BaseStack/BaseStack.module.scss +73 -0
- package/src/v3/BaseStack/BaseStack.test.tsx +83 -0
- package/src/v3/BaseStack/BaseStack.tsx +72 -0
- package/src/v3/BaseStack/BaseStack.types.ts +59 -0
- package/src/v3/Box/Box.module.scss +13 -0
- package/src/v3/Box/Box.stories.tsx +27 -0
- package/src/v3/Box/Box.test.tsx +57 -0
- package/src/v3/Box/Box.tsx +77 -0
- package/src/v3/Box/Box.types.ts +24 -0
- package/src/v3/Box/index.ts +2 -0
- package/src/v3/Divider/Divider.module.scss +52 -0
- package/src/v3/Divider/Divider.stories.tsx +95 -0
- package/src/v3/Divider/Divider.test.tsx +47 -0
- package/src/v3/Divider/Divider.tsx +57 -0
- package/src/v3/Divider/Divider.types.ts +32 -0
- package/src/v3/Divider/index.ts +2 -0
- package/src/v3/HStack/HStack.stories.tsx +58 -0
- package/src/v3/HStack/HStack.test.tsx +14 -0
- package/src/v3/HStack/HStack.tsx +21 -0
- package/src/v3/HStack/HStack.types.ts +1 -0
- package/src/v3/HStack/index.ts +2 -0
- package/src/v3/Icon/Icon.module.scss +20 -0
- package/src/v3/Icon/Icon.stories.tsx +173 -0
- package/src/v3/Icon/Icon.test.tsx +64 -0
- package/src/v3/Icon/Icon.tsx +67 -0
- package/src/v3/Icon/Icon.types.ts +32 -0
- package/src/v3/Icon/index.ts +2 -0
- package/src/v3/SmoothCornersBox/SmoothCornersBox.module.scss +48 -0
- package/src/v3/SmoothCornersBox/SmoothCornersBox.stories.tsx +41 -0
- package/src/v3/SmoothCornersBox/SmoothCornersBox.test.tsx +83 -0
- package/src/v3/SmoothCornersBox/SmoothCornersBox.tsx +84 -0
- package/src/v3/SmoothCornersBox/SmoothCornersBox.types.ts +69 -0
- package/src/v3/SmoothCornersBox/index.ts +2 -0
- package/src/v3/Spinner/Spinner.module.scss +58 -0
- package/src/v3/Spinner/Spinner.stories.tsx +28 -0
- package/src/v3/Spinner/Spinner.test.tsx +65 -0
- package/src/v3/Spinner/Spinner.tsx +61 -0
- package/src/v3/Spinner/Spinner.types.ts +12 -0
- package/src/v3/Spinner/index.ts +2 -0
- package/src/v3/Text/Text.module.scss +69 -0
- package/src/v3/Text/Text.stories.tsx +52 -0
- package/src/v3/Text/Text.test.tsx +84 -0
- package/src/v3/Text/Text.tsx +81 -0
- package/src/v3/Text/Text.types.ts +70 -0
- package/src/v3/Text/index.ts +2 -0
- package/src/v3/VStack/VStack.stories.tsx +58 -0
- package/src/v3/VStack/VStack.test.tsx +14 -0
- package/src/v3/VStack/VStack.tsx +21 -0
- package/src/v3/VStack/VStack.types.ts +1 -0
- package/src/v3/VStack/index.ts +2 -0
- package/src/v3/index.ts +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v3/SmoothCornersBox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { SpinnerProps } from './Spinner.types';
|
|
3
|
+
/**
|
|
4
|
+
* `Spinner` is a component for indicating loading state.
|
|
5
|
+
* @example
|
|
6
|
+
*
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <Spinner
|
|
9
|
+
* size="m"
|
|
10
|
+
* color="icon-neutral"
|
|
11
|
+
* />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//# sourceMappingURL=Spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../../src/v3/Spinner/Spinner.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAMnD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,qFAiCnB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BezierComponentProps, SizeProps, V3ColorProps } from "../../types/props";
|
|
2
|
+
export type SpinnerSize = 'xl' | 'l' | 'm' | 's' | 'xs';
|
|
3
|
+
export interface SpinnerProps extends Omit<BezierComponentProps<'div'>, keyof V3ColorProps>, SizeProps<SpinnerSize>, V3ColorProps {
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=Spinner.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.types.d.ts","sourceRoot":"","sources":["../../../../src/v3/Spinner/Spinner.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,SAAS,EACT,YAAY,EACb,0BAAyB;AAE1B,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAA;AAEvD,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,MAAM,YAAY,CAAC,EAC3D,SAAS,CAAC,WAAW,CAAC,EACtB,YAAY;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v3/Spinner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type TextProps } from './Text.types';
|
|
2
|
+
/**
|
|
3
|
+
* `Text` is a component for representing the typography of a design system.
|
|
4
|
+
* @example
|
|
5
|
+
*
|
|
6
|
+
* ```tsx
|
|
7
|
+
* <Text
|
|
8
|
+
* typo="15"
|
|
9
|
+
* color="text-neutral"
|
|
10
|
+
* >
|
|
11
|
+
* Hello, Channel!
|
|
12
|
+
* </Text>
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const Text: import("react").ForwardRefExoticComponent<TextProps & import("react").RefAttributes<HTMLElement>>;
|
|
16
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../src/v3/Text/Text.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAQ7C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,IAAI,mGAiDhB,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type BetaTextSemanticColor, type BetaTypographyFontWeight } from "../../types/beta-tokens";
|
|
2
|
+
import { type BezierComponentProps, type ChildrenProps, type PolymorphicProps, type V3MarginProps } from "../../types/props";
|
|
3
|
+
type Typography = '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '22' | '24' | '30' | '36';
|
|
4
|
+
type TextAlign = 'left' | 'center' | 'right';
|
|
5
|
+
interface TextOwnProps {
|
|
6
|
+
/**
|
|
7
|
+
* Typography style of the text.
|
|
8
|
+
* @default '15'
|
|
9
|
+
*/
|
|
10
|
+
typo?: Typography;
|
|
11
|
+
/**
|
|
12
|
+
* Color of the text. If no value is specified, it inherits the color of the parent element.
|
|
13
|
+
*/
|
|
14
|
+
color?: BetaTextSemanticColor;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the text is bold.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
bold?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Font weight of the text.
|
|
22
|
+
* If `bold` and `fontWeight` are used together, `fontWeight` takes precedence.
|
|
23
|
+
*/
|
|
24
|
+
fontWeight?: BetaTypographyFontWeight;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the text is italic.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
italic?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the text is truncated.
|
|
32
|
+
* If it is a positive integer, it means the maximum number of lines.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
truncated?: boolean | number;
|
|
36
|
+
/**
|
|
37
|
+
* Horizontal alignment of the text.
|
|
38
|
+
*/
|
|
39
|
+
align?: TextAlign;
|
|
40
|
+
}
|
|
41
|
+
export interface TextProps extends Omit<BezierComponentProps, keyof TextOwnProps>, PolymorphicProps, ChildrenProps, V3MarginProps, TextOwnProps {
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=Text.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.types.d.ts","sourceRoot":"","sources":["../../../../src/v3/Text/Text.types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC9B,gCAA+B;AAChC,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EACnB,0BAAyB;AAE1B,KAAK,UAAU,GACX,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CAAA;AAER,KAAK,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE5C,UAAU,YAAY;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,qBAAqB,CAAA;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;OAGG;IACH,UAAU,CAAC,EAAE,wBAAwB,CAAA;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,YAAY,CAAC,EACpD,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,YAAY;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v3/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { VStackProps } from './VStack.types';
|
|
2
|
+
/**
|
|
3
|
+
* `VStack` is a shorthand component equivalent to `Stack` with a vertical direction property.
|
|
4
|
+
* @see BaseStack
|
|
5
|
+
*/
|
|
6
|
+
export declare const VStack: import("react").ForwardRefExoticComponent<VStackProps & import("react").RefAttributes<HTMLElement>>;
|
|
7
|
+
//# sourceMappingURL=VStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VStack.d.ts","sourceRoot":"","sources":["../../../../src/v3/VStack/VStack.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD;;;GAGG;AACH,eAAO,MAAM,MAAM,qGAQlB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VStack.types.d.ts","sourceRoot":"","sources":["../../../../src/v3/VStack/VStack.types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,qCAA0C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v3/VStack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './Box';
|
|
2
|
+
export * from './Divider';
|
|
3
|
+
export * from './HStack';
|
|
4
|
+
export * from './Icon';
|
|
5
|
+
export * from './SmoothCornersBox';
|
|
6
|
+
export * from './Spinner';
|
|
7
|
+
export * from './Text';
|
|
8
|
+
export * from './VStack';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v3/index.ts"],"names":[],"mappings":"AAEA,cAAc,OAAO,CAAA;AACrB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@channel.io/bezier-react",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.4",
|
|
4
4
|
"description": "React components library that implements Bezier design system.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
"require": "./dist/cjs/index.js",
|
|
17
17
|
"import": "./dist/esm/index.mjs"
|
|
18
18
|
},
|
|
19
|
+
"./v3": {
|
|
20
|
+
"types": "./dist/types/v3/index.d.ts",
|
|
21
|
+
"require": "./dist/cjs/v3/index.js",
|
|
22
|
+
"import": "./dist/esm/v3/index.mjs"
|
|
23
|
+
},
|
|
19
24
|
"./styles.css": {
|
|
20
25
|
"require": "./dist/cjs/styles.css",
|
|
21
26
|
"import": "./dist/esm/styles.css"
|
|
@@ -44,6 +44,14 @@ $active-selector: ':where(.active, :hover):where(:not(:disabled))';
|
|
|
44
44
|
padding: 0 14px;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
& :where(.ButtonContent) {
|
|
48
|
+
gap: 2px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
& .ButtonText {
|
|
52
|
+
padding: 0 3px;
|
|
53
|
+
}
|
|
54
|
+
|
|
47
55
|
& :is(.ButtonIcon, .ButtonSpinner) {
|
|
48
56
|
width: 18px;
|
|
49
57
|
height: 18px;
|
|
@@ -81,7 +89,7 @@ $active-selector: ':where(.active, :hover):where(:not(:disabled))';
|
|
|
81
89
|
}
|
|
82
90
|
}
|
|
83
91
|
|
|
84
|
-
&:where(.size-
|
|
92
|
+
&:where(.size-l, .size-xl) {
|
|
85
93
|
& :where(.ButtonContent) {
|
|
86
94
|
gap: 2px;
|
|
87
95
|
}
|
package/src/types/beta-tokens.ts
CHANGED
|
@@ -32,6 +32,14 @@ export type BetaGlobalColor = RemovePrefix<
|
|
|
32
32
|
keyof BetaGlobalToken['color']
|
|
33
33
|
>
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Global typography font weight tokens
|
|
37
|
+
*/
|
|
38
|
+
export type BetaTypographyFontWeight = RemovePrefix<
|
|
39
|
+
'typography-font-weight',
|
|
40
|
+
Extract<keyof BetaGlobalToken['typography'], string>
|
|
41
|
+
>
|
|
42
|
+
|
|
35
43
|
/**
|
|
36
44
|
* Semantic color tokens (for props)
|
|
37
45
|
*/
|
|
@@ -17,7 +17,13 @@ import {
|
|
|
17
17
|
type BetaRadius,
|
|
18
18
|
type BetaZIndex,
|
|
19
19
|
} from './beta-tokens'
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
type FormFieldSize,
|
|
22
|
+
type LayoutProps,
|
|
23
|
+
type MarginProps,
|
|
24
|
+
type V3LayoutProps,
|
|
25
|
+
type V3MarginProps,
|
|
26
|
+
} from './props'
|
|
21
27
|
import { type Elevation, type Radius, type ZIndex } from './tokens'
|
|
22
28
|
|
|
23
29
|
export const splitByMarginProps = <Props extends MarginProps>({
|
|
@@ -120,6 +126,16 @@ export const splitByLayoutProps = <Props extends LayoutProps>({
|
|
|
120
126
|
rest,
|
|
121
127
|
]
|
|
122
128
|
|
|
129
|
+
export const splitByV3MarginProps = <Props extends V3MarginProps>(
|
|
130
|
+
props: Props
|
|
131
|
+
): [V3MarginProps, Omit<Props, keyof V3MarginProps>] =>
|
|
132
|
+
splitByMarginProps(props)
|
|
133
|
+
|
|
134
|
+
export const splitByV3LayoutProps = <Props extends V3LayoutProps>(
|
|
135
|
+
props: Props
|
|
136
|
+
): [V3LayoutProps, Omit<Props, keyof V3LayoutProps>] =>
|
|
137
|
+
splitByLayoutProps(props) as [V3LayoutProps, Omit<Props, keyof V3LayoutProps>]
|
|
138
|
+
|
|
123
139
|
function getElevationClassName(elevation: Elevation | BetaElevation) {
|
|
124
140
|
return elevationStyles[`elevation-${elevation}`]
|
|
125
141
|
}
|
|
@@ -232,6 +248,11 @@ export const getLayoutStyles = ({
|
|
|
232
248
|
),
|
|
233
249
|
})
|
|
234
250
|
|
|
251
|
+
export const getV3MarginStyles = getMarginStyles
|
|
252
|
+
|
|
253
|
+
export const getV3LayoutStyles = (props: V3LayoutProps) =>
|
|
254
|
+
getLayoutStyles(props)
|
|
255
|
+
|
|
235
256
|
export function getFormFieldSizeClassName(size: FormFieldSize) {
|
|
236
257
|
return formFieldSizeStyles[`size-${size}`]
|
|
237
258
|
}
|
package/src/types/props.ts
CHANGED
|
@@ -272,6 +272,9 @@ export interface MarginProps {
|
|
|
272
272
|
type Position = 'absolute' | 'fixed' | 'relative' | 'sticky'
|
|
273
273
|
type Overflow = 'auto' | 'hidden' | 'scroll' | 'visible'
|
|
274
274
|
|
|
275
|
+
export type V3Position = Position
|
|
276
|
+
export type V3Overflow = Overflow
|
|
277
|
+
|
|
275
278
|
/**
|
|
276
279
|
* Props for defining layout-related properties of a component, such as padding, size, and position.
|
|
277
280
|
*/
|
|
@@ -458,6 +461,55 @@ export interface LayoutProps {
|
|
|
458
461
|
overflowY?: Overflow
|
|
459
462
|
}
|
|
460
463
|
|
|
464
|
+
export type V3MarginProps = MarginProps
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* v3 color props mirror ColorProps but only allow beta (v3) semantic color tokens.
|
|
468
|
+
* TODO: Fold this into ColorProps when legacy token unions are removed for 4.0.0.
|
|
469
|
+
*/
|
|
470
|
+
export interface V3ColorProps {
|
|
471
|
+
/**
|
|
472
|
+
* Color from the design system's semantic color.
|
|
473
|
+
*/
|
|
474
|
+
color?: BetaSemanticColor
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* v3 layout props mirror LayoutProps while keeping token-typed fields narrow.
|
|
479
|
+
* TODO: Fold this into LayoutProps when legacy token unions are removed for 4.0.0.
|
|
480
|
+
*/
|
|
481
|
+
export interface V3LayoutProps
|
|
482
|
+
extends Omit<
|
|
483
|
+
LayoutProps,
|
|
484
|
+
'backgroundColor' | 'borderColor' | 'borderRadius' | 'elevation' | 'zIndex'
|
|
485
|
+
> {
|
|
486
|
+
/**
|
|
487
|
+
* the background color of an element.
|
|
488
|
+
* @default initial
|
|
489
|
+
*/
|
|
490
|
+
backgroundColor?: BetaBackgroundSemanticColor
|
|
491
|
+
/**
|
|
492
|
+
* the border color of an element.
|
|
493
|
+
* @default initial
|
|
494
|
+
*/
|
|
495
|
+
borderColor?: BetaBorderSemanticColor
|
|
496
|
+
/**
|
|
497
|
+
* the border radius of an element.
|
|
498
|
+
* @default initial
|
|
499
|
+
*/
|
|
500
|
+
borderRadius?: BetaRadius
|
|
501
|
+
/**
|
|
502
|
+
* the elevation of an element. (box-shadow)
|
|
503
|
+
* @default initial
|
|
504
|
+
*/
|
|
505
|
+
elevation?: BetaElevation
|
|
506
|
+
/**
|
|
507
|
+
* the z-index of an element.
|
|
508
|
+
* @default initial
|
|
509
|
+
*/
|
|
510
|
+
zIndex?: BetaZIndex
|
|
511
|
+
}
|
|
512
|
+
|
|
461
513
|
/**
|
|
462
514
|
* Enumeration of form field sizes. (TextField, Select)
|
|
463
515
|
*/
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.BaseStack {
|
|
2
|
+
--b-stack-spacing: initial;
|
|
3
|
+
|
|
4
|
+
gap: var(--b-stack-spacing);
|
|
5
|
+
|
|
6
|
+
&:where(.display-flex) {
|
|
7
|
+
display: flex;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&:where(.display-inline-flex) {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&:where(.direction-horizontal) {
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
|
|
17
|
+
&:where(.reverse) {
|
|
18
|
+
flex-direction: row-reverse;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:where(.direction-vertical) {
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
|
|
25
|
+
&:where(.reverse) {
|
|
26
|
+
flex-direction: column-reverse;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:where(.justify-start) {
|
|
31
|
+
justify-content: flex-start;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:where(.justify-end) {
|
|
35
|
+
justify-content: flex-end;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:where(.justify-center) {
|
|
39
|
+
justify-content: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:where(.justify-stretch) {
|
|
43
|
+
justify-content: stretch;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:where(.justify-between) {
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:where(.align-start) {
|
|
51
|
+
align-items: flex-start;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:where(.align-end) {
|
|
55
|
+
align-items: flex-end;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:where(.align-center) {
|
|
59
|
+
align-items: center;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&:where(.align-stretch) {
|
|
63
|
+
align-items: stretch;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:where(.align-baseline) {
|
|
67
|
+
align-items: baseline;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:where(.wrap) {
|
|
71
|
+
flex-wrap: wrap;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
|
|
3
|
+
import { render } from '~/src/utils/test'
|
|
4
|
+
|
|
5
|
+
import { BaseStack } from './BaseStack'
|
|
6
|
+
import { type BaseStackProps } from './BaseStack.types'
|
|
7
|
+
|
|
8
|
+
import styles from './BaseStack.module.scss'
|
|
9
|
+
|
|
10
|
+
describe('BaseStack', () => {
|
|
11
|
+
const renderBaseStack = (props?: Partial<BaseStackProps>) =>
|
|
12
|
+
render(
|
|
13
|
+
<BaseStack
|
|
14
|
+
direction="horizontal"
|
|
15
|
+
{...props}
|
|
16
|
+
>
|
|
17
|
+
Hello, Channel!
|
|
18
|
+
</BaseStack>
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
it('should render with default flex style', () => {
|
|
22
|
+
const { getByText } = renderBaseStack()
|
|
23
|
+
const rendered = getByText('Hello, Channel!')
|
|
24
|
+
|
|
25
|
+
expect(rendered).toHaveClass(styles.BaseStack)
|
|
26
|
+
expect(rendered).toHaveClass(styles['display-flex'])
|
|
27
|
+
expect(rendered).toHaveClass(styles['direction-horizontal'])
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it('should render as the given element', () => {
|
|
31
|
+
const { getByText } = renderBaseStack({ as: 'section' })
|
|
32
|
+
const rendered = getByText('Hello, Channel!')
|
|
33
|
+
|
|
34
|
+
expect(rendered.tagName).toBe('SECTION')
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('should forward ref', () => {
|
|
38
|
+
const ref = React.createRef<HTMLElement>()
|
|
39
|
+
|
|
40
|
+
render(
|
|
41
|
+
<BaseStack
|
|
42
|
+
ref={ref}
|
|
43
|
+
direction="horizontal"
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
expect(ref.current).toBeInTheDocument()
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it('should receive layout styles', () => {
|
|
51
|
+
const { getByText } = renderBaseStack({
|
|
52
|
+
direction: 'vertical',
|
|
53
|
+
justify: 'center',
|
|
54
|
+
align: 'end',
|
|
55
|
+
spacing: 10,
|
|
56
|
+
reverse: true,
|
|
57
|
+
wrap: true,
|
|
58
|
+
className: 'test-class',
|
|
59
|
+
})
|
|
60
|
+
const rendered = getByText('Hello, Channel!')
|
|
61
|
+
|
|
62
|
+
expect(rendered).toHaveClass(styles['direction-vertical'])
|
|
63
|
+
expect(rendered).toHaveClass(styles['justify-center'])
|
|
64
|
+
expect(rendered).toHaveClass(styles['align-end'])
|
|
65
|
+
expect(rendered).toHaveClass(styles.reverse)
|
|
66
|
+
expect(rendered).toHaveClass(styles.wrap)
|
|
67
|
+
expect(rendered).toHaveClass('test-class')
|
|
68
|
+
expect(rendered).toHaveStyle('--b-stack-spacing: 10px')
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
it('should receive margin and layout props', () => {
|
|
72
|
+
const { getByText } = renderBaseStack({
|
|
73
|
+
width: '100px',
|
|
74
|
+
marginTop: 10,
|
|
75
|
+
style: { backgroundColor: 'red' },
|
|
76
|
+
})
|
|
77
|
+
const rendered = getByText('Hello, Channel!')
|
|
78
|
+
|
|
79
|
+
expect(rendered).toHaveStyle('--b-width: 100px')
|
|
80
|
+
expect(rendered).toHaveStyle('--b-margin-top: 10px')
|
|
81
|
+
expect(rendered).toHaveStyle('background-color: red')
|
|
82
|
+
})
|
|
83
|
+
})
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { createElement, forwardRef } from 'react'
|
|
4
|
+
|
|
5
|
+
import classNames from 'classnames'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
getV3LayoutStyles,
|
|
9
|
+
getV3MarginStyles,
|
|
10
|
+
splitByV3LayoutProps,
|
|
11
|
+
splitByV3MarginProps,
|
|
12
|
+
} from '~/src/types/props-helpers'
|
|
13
|
+
import { cssDimension } from '~/src/utils/style'
|
|
14
|
+
|
|
15
|
+
import type { BaseStackProps } from './BaseStack.types'
|
|
16
|
+
|
|
17
|
+
import styles from './BaseStack.module.scss'
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* `BaseStack` is a layout component used internally to group elements together and apply a space between them.
|
|
21
|
+
*/
|
|
22
|
+
export const BaseStack = forwardRef<HTMLElement, BaseStackProps>(
|
|
23
|
+
function BaseStack(props, forwardedRef) {
|
|
24
|
+
const [marginProps, marginRest] = splitByV3MarginProps(props)
|
|
25
|
+
const [layoutProps, layoutRest] = splitByV3LayoutProps(marginRest)
|
|
26
|
+
const marginStyles = getV3MarginStyles(marginProps)
|
|
27
|
+
const layoutStyles = getV3LayoutStyles(layoutProps)
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
children,
|
|
31
|
+
style,
|
|
32
|
+
className,
|
|
33
|
+
as = 'div',
|
|
34
|
+
display = 'flex',
|
|
35
|
+
direction,
|
|
36
|
+
justify,
|
|
37
|
+
align,
|
|
38
|
+
spacing,
|
|
39
|
+
reverse,
|
|
40
|
+
wrap,
|
|
41
|
+
...rest
|
|
42
|
+
} = layoutRest
|
|
43
|
+
|
|
44
|
+
return createElement(
|
|
45
|
+
as,
|
|
46
|
+
{
|
|
47
|
+
ref: forwardedRef,
|
|
48
|
+
style: {
|
|
49
|
+
'--b-stack-spacing': cssDimension(spacing),
|
|
50
|
+
...marginStyles.style,
|
|
51
|
+
...layoutStyles.style,
|
|
52
|
+
...style,
|
|
53
|
+
},
|
|
54
|
+
className: classNames(
|
|
55
|
+
styles.BaseStack,
|
|
56
|
+
display && styles[`display-${display}`],
|
|
57
|
+
direction && styles[`direction-${direction}`],
|
|
58
|
+
justify && styles[`justify-${justify}`],
|
|
59
|
+
align && styles[`align-${align}`],
|
|
60
|
+
reverse && styles.reverse,
|
|
61
|
+
wrap && styles.wrap,
|
|
62
|
+
marginStyles.className,
|
|
63
|
+
layoutStyles.className,
|
|
64
|
+
className
|
|
65
|
+
),
|
|
66
|
+
'data-testid': 'bezier-stack',
|
|
67
|
+
...rest,
|
|
68
|
+
},
|
|
69
|
+
children
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type BezierComponentProps,
|
|
3
|
+
type ChildrenProps,
|
|
4
|
+
type PolymorphicProps,
|
|
5
|
+
type V3LayoutProps,
|
|
6
|
+
type V3MarginProps,
|
|
7
|
+
} from '~/src/types/props'
|
|
8
|
+
|
|
9
|
+
type Display = 'flex' | 'inline-flex'
|
|
10
|
+
|
|
11
|
+
type Direction = 'horizontal' | 'vertical'
|
|
12
|
+
|
|
13
|
+
type BaseAlignment = 'start' | 'center' | 'end' | 'stretch'
|
|
14
|
+
type Align = BaseAlignment | 'baseline'
|
|
15
|
+
type Justify = BaseAlignment | 'between'
|
|
16
|
+
|
|
17
|
+
interface BaseStackOwnProps {
|
|
18
|
+
/**
|
|
19
|
+
* Display type of the stack.
|
|
20
|
+
* @default 'flex'
|
|
21
|
+
*/
|
|
22
|
+
display?: Display
|
|
23
|
+
/**
|
|
24
|
+
* Direction of the stack.
|
|
25
|
+
*/
|
|
26
|
+
direction: Direction
|
|
27
|
+
/**
|
|
28
|
+
* Determines the default aligning of children along the main axis.
|
|
29
|
+
*/
|
|
30
|
+
justify?: Justify
|
|
31
|
+
/**
|
|
32
|
+
* Determines the default aligning of children along the cross axis.
|
|
33
|
+
*/
|
|
34
|
+
align?: Align
|
|
35
|
+
/**
|
|
36
|
+
* Spacing between children.
|
|
37
|
+
*/
|
|
38
|
+
spacing?: string | number
|
|
39
|
+
/**
|
|
40
|
+
* Whether to reverse the order of children.
|
|
41
|
+
*/
|
|
42
|
+
reverse?: boolean
|
|
43
|
+
/**
|
|
44
|
+
* Whether to wrap children to additional rows as needed on small screens.
|
|
45
|
+
*/
|
|
46
|
+
wrap?: boolean
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface BaseStackProps
|
|
50
|
+
extends BezierComponentProps,
|
|
51
|
+
PolymorphicProps,
|
|
52
|
+
ChildrenProps,
|
|
53
|
+
V3LayoutProps,
|
|
54
|
+
V3MarginProps,
|
|
55
|
+
BaseStackOwnProps {}
|
|
56
|
+
|
|
57
|
+
export interface HStackProps extends Omit<BaseStackProps, 'direction'> {}
|
|
58
|
+
|
|
59
|
+
export interface VStackProps extends Omit<BaseStackProps, 'direction'> {}
|