@charcoal-ui/react-sandbox 4.0.0-beta.2 → 4.0.0-beta.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.
Files changed (41) hide show
  1. package/package.json +8 -9
  2. package/dist/components/Carousel/index.story.d.ts +0 -7
  3. package/dist/components/Carousel/index.story.d.ts.map +0 -1
  4. package/dist/components/CarouselButton/index.story.d.ts +0 -10
  5. package/dist/components/CarouselButton/index.story.d.ts.map +0 -1
  6. package/dist/components/Filter/index.story.d.ts +0 -9
  7. package/dist/components/Filter/index.story.d.ts.map +0 -1
  8. package/dist/components/HintText/index.story.d.ts +0 -12
  9. package/dist/components/HintText/index.story.d.ts.map +0 -1
  10. package/dist/components/Layout/index.story.d.ts +0 -14
  11. package/dist/components/Layout/index.story.d.ts.map +0 -1
  12. package/dist/components/MenuListItem/index.story.d.ts +0 -18
  13. package/dist/components/MenuListItem/index.story.d.ts.map +0 -1
  14. package/dist/components/Pager/index.story.d.ts +0 -39
  15. package/dist/components/Pager/index.story.d.ts.map +0 -1
  16. package/dist/components/SwitchCheckbox/index.story.d.ts +0 -10
  17. package/dist/components/SwitchCheckbox/index.story.d.ts.map +0 -1
  18. package/dist/components/TextEllipsis/index.story.d.ts +0 -9
  19. package/dist/components/TextEllipsis/index.story.d.ts.map +0 -1
  20. package/dist/components/WithIcon/index.story.d.ts +0 -15
  21. package/dist/components/WithIcon/index.story.d.ts.map +0 -1
  22. package/src/components/Carousel/__snapshots__/index.story.storyshot +0 -360
  23. package/src/components/Carousel/index.story.tsx +0 -85
  24. package/src/components/CarouselButton/__snapshots__/index.story.storyshot +0 -168
  25. package/src/components/CarouselButton/index.story.tsx +0 -43
  26. package/src/components/Filter/__snapshots__/index.story.storyshot +0 -239
  27. package/src/components/Filter/index.story.tsx +0 -82
  28. package/src/components/HintText/__snapshots__/index.story.storyshot +0 -119
  29. package/src/components/HintText/index.story.tsx +0 -18
  30. package/src/components/Layout/__snapshots__/index.story.storyshot +0 -1297
  31. package/src/components/Layout/index.story.tsx +0 -121
  32. package/src/components/MenuListItem/__snapshots__/index.story.storyshot +0 -1389
  33. package/src/components/MenuListItem/index.story.tsx +0 -142
  34. package/src/components/Pager/__snapshots__/index.story.storyshot +0 -1894
  35. package/src/components/Pager/index.story.tsx +0 -153
  36. package/src/components/SwitchCheckbox/__snapshots__/index.story.storyshot +0 -507
  37. package/src/components/SwitchCheckbox/index.story.tsx +0 -31
  38. package/src/components/TextEllipsis/__snapshots__/index.story.storyshot +0 -32
  39. package/src/components/TextEllipsis/index.story.tsx +0 -40
  40. package/src/components/WithIcon/__snapshots__/index.story.storyshot +0 -852
  41. package/src/components/WithIcon/index.story.tsx +0 -145
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charcoal-ui/react-sandbox",
3
- "version": "4.0.0-beta.2",
3
+ "version": "4.0.0-beta.4",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",
@@ -20,7 +20,7 @@
20
20
  "clean": "rimraf dist .tsbuildinfo"
21
21
  },
22
22
  "devDependencies": {
23
- "@charcoal-ui/esbuild-plugin-styled-components": "^4.0.0-beta.2",
23
+ "@charcoal-ui/esbuild-plugin-styled-components": "^4.0.0-beta.4",
24
24
  "@storybook/addon-actions": "^7.4.1",
25
25
  "@storybook/addon-knobs": "^7.0.2",
26
26
  "@storybook/addons": "^7.4.1",
@@ -44,17 +44,16 @@
44
44
  "react-dom": "^17.0.2",
45
45
  "react-router-dom": "^6.2.1",
46
46
  "rimraf": "^3.0.2",
47
- "storybook": "^7.4.1",
48
47
  "styled-components": "^5.3.3",
49
48
  "tsup": "^6.5.0",
50
49
  "typescript": "^4.9.5"
51
50
  },
52
51
  "dependencies": {
53
- "@charcoal-ui/foundation": "^4.0.0-beta.2",
54
- "@charcoal-ui/react": "^4.0.0-beta.2",
55
- "@charcoal-ui/styled": "^4.0.0-beta.2",
56
- "@charcoal-ui/theme": "^4.0.0-beta.2",
57
- "@charcoal-ui/utils": "^4.0.0-beta.2",
52
+ "@charcoal-ui/foundation": "^4.0.0-beta.4",
53
+ "@charcoal-ui/react": "^4.0.0-beta.4",
54
+ "@charcoal-ui/styled": "^4.0.0-beta.4",
55
+ "@charcoal-ui/theme": "^4.0.0-beta.4",
56
+ "@charcoal-ui/utils": "^4.0.0-beta.4",
58
57
  "polished": "^4.1.4",
59
58
  "react-spring": "^9.0.0",
60
59
  "warning": "^4.0.3"
@@ -76,5 +75,5 @@
76
75
  "url": "https://github.com/pixiv/charcoal.git",
77
76
  "directory": "packages/react-sandbox"
78
77
  },
79
- "gitHead": "21a8c3ad738b69cfc849a3a7ec75dbae71eb9e97"
78
+ "gitHead": "788f785fe5cc2bfbf784d10cd603eb027b430c92"
80
79
  }
@@ -1,7 +0,0 @@
1
- declare const _default: {
2
- title: string;
3
- decorators: any[];
4
- };
5
- export default _default;
6
- export declare const _Carousel: () => JSX.Element;
7
- //# sourceMappingURL=index.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/index.story.tsx"],"names":[],"mappings":";;;;AAmBA,wBAGC;AAED,eAAO,MAAM,SAAS,mBAyCrB,CAAA"}
@@ -1,10 +0,0 @@
1
- import CarouselButton from '.';
2
- declare const _default: {
3
- title: string;
4
- decorators: any[];
5
- component: typeof CarouselButton;
6
- };
7
- export default _default;
8
- export declare const _CarouselButton: () => JSX.Element;
9
- export declare const _ScrollHintButton: () => JSX.Element;
10
- //# sourceMappingURL=index.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/CarouselButton/index.story.tsx"],"names":[],"mappings":"AAEA,OAAO,cAA+C,MAAM,GAAG,CAAA;;;;;;AAE/D,wBAIC;AAED,eAAO,MAAM,eAAe,mBAmB3B,CAAA;AAMD,eAAO,MAAM,iBAAiB,mBAO7B,CAAA"}
@@ -1,9 +0,0 @@
1
- declare const _default: {
2
- title: string;
3
- component: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
- };
5
- export default _default;
6
- export declare function Default(): JSX.Element;
7
- export declare function Button(): JSX.Element;
8
- export declare function Link(): JSX.Element;
9
- //# sourceMappingURL=index.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/index.story.tsx"],"names":[],"mappings":";;;;AAaA,wBAGC;AAID,wBAAgB,OAAO,gBAetB;AA4BD,wBAAgB,MAAM,gBAQrB;AAED,wBAAgB,IAAI,gBAQnB"}
@@ -1,12 +0,0 @@
1
- import { Story } from '../../_lib/compat';
2
- import HintText from '.';
3
- declare const _default: {
4
- title: string;
5
- component: typeof HintText;
6
- };
7
- export default _default;
8
- export declare const Default: Story<{
9
- hintText: string;
10
- context: 'page' | 'section';
11
- }>;
12
- //# sourceMappingURL=index.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/HintText/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,QAAQ,MAAM,GAAG,CAAA;;;;;AAExB,wBAGC;AAMD,eAAO,MAAM,OAAO;cAJc,MAAM;aAAW,MAAM,GAAG,SAAS;EAI7B,CAAA"}
@@ -1,14 +0,0 @@
1
- import Layout from '.';
2
- declare const _default: {
3
- title: string;
4
- component: typeof Layout;
5
- parameters: {
6
- layout: string;
7
- };
8
- };
9
- export default _default;
10
- export declare function Basic(): JSX.Element;
11
- export declare function NoMenu(): JSX.Element;
12
- export declare function Wide(): JSX.Element;
13
- export declare function Center(): JSX.Element;
14
- //# sourceMappingURL=index.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/index.story.tsx"],"names":[],"mappings":"AAKA,OAAO,MAAwD,MAAM,GAAG,CAAA;;;;;;;;AAExE,wBAMC;AAED,wBAAgB,KAAK,gBAapB;AAED,wBAAgB,MAAM,gBAYrB;AAED,wBAAgB,IAAI,gBAanB;AAED,wBAAgB,MAAM,gBAYrB"}
@@ -1,18 +0,0 @@
1
- import MenuListItem from '.';
2
- declare const _default: {
3
- title: string;
4
- component: typeof MenuListItem;
5
- };
6
- export default _default;
7
- export declare const Default: () => JSX.Element;
8
- export declare const Simple: () => JSX.Element;
9
- export declare const Disabled: () => JSX.Element;
10
- export declare const Link: () => JSX.Element;
11
- export declare const HardLink: () => JSX.Element;
12
- export declare const InlineIcon: () => JSX.Element;
13
- export declare const Icon: () => JSX.Element;
14
- export declare const NoHoverEffect: () => JSX.Element;
15
- export declare const Spacer: () => JSX.Element;
16
- export declare const Label: () => JSX.Element;
17
- export declare const TextEllipsis: () => JSX.Element;
18
- //# sourceMappingURL=index.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/MenuListItem/index.story.tsx"],"names":[],"mappings":"AAKA,OAAO,YAMN,MAAM,GAAG,CAAA;;;;;AAEV,wBAGC;AAED,eAAO,MAAM,OAAO,mBAiBnB,CAAA;AAED,eAAO,MAAM,MAAM,mBAMlB,CAAA;AAED,eAAO,MAAM,QAAQ,mBAMpB,CAAA;AAED,eAAO,MAAM,IAAI,mBAMhB,CAAA;AAED,eAAO,MAAM,QAAQ,mBAQpB,CAAA;AAED,eAAO,MAAM,UAAU,mBAOtB,CAAA;AAED,eAAO,MAAM,IAAI,mBAMhB,CAAA;AAED,eAAO,MAAM,aAAa,mBAQzB,CAAA;AAED,eAAO,MAAM,MAAM,mBAMlB,CAAA;AAED,eAAO,MAAM,KAAK,mBAKjB,CAAA;AAED,eAAO,MAAM,YAAY,mBAQxB,CAAA"}
@@ -1,39 +0,0 @@
1
- import { Story } from '../../_lib/compat';
2
- declare const _default: {
3
- title: string;
4
- component: import("react").NamedExoticComponent<import(".").PagerProps>;
5
- argTypes: {
6
- page: {
7
- control: {
8
- type: string;
9
- disable: boolean;
10
- };
11
- };
12
- pageCount: {
13
- control: {
14
- type: string;
15
- min: number;
16
- };
17
- };
18
- pageRangeDisplayed: {
19
- control: {
20
- type: string;
21
- min: number;
22
- };
23
- };
24
- };
25
- };
26
- export default _default;
27
- interface Props {
28
- page: number;
29
- pageCount: number;
30
- pageRangeDisplayed?: number;
31
- }
32
- export declare const Default: Story<Props>;
33
- export declare const Link: Story<Props>;
34
- export declare const NotCollapsed: Story<Props>;
35
- export declare const CollapsedWithDots: Story<Props>;
36
- export declare const LastPage: Story<Props>;
37
- export declare const One: Story<Props>;
38
- export declare const LittlePageRangeDisplayed: Story<Props>;
39
- //# sourceMappingURL=index.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/Pager/index.story.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAIzC,wBAuBC;AAED,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAkBD,eAAO,MAAM,OAAO,cAAwB,CAAA;AA0D5C,eAAO,MAAM,IAAI,cAAqB,CAAA;AAMtC,eAAO,MAAM,YAAY,cAAqB,CAAA;AAM9C,eAAO,MAAM,iBAAiB,cAAqB,CAAA;AAMnD,eAAO,MAAM,QAAQ,cAAqB,CAAA;AAM1C,eAAO,MAAM,GAAG,cAAqB,CAAA;AAMrC,eAAO,MAAM,wBAAwB,cAAqB,CAAA"}
@@ -1,10 +0,0 @@
1
- declare const _default: {
2
- title: string;
3
- component: import("react").ForwardRefExoticComponent<import(".").Props & import("react").RefAttributes<HTMLInputElement>>;
4
- };
5
- export default _default;
6
- export declare const Default: () => JSX.Element;
7
- export declare const On: () => JSX.Element;
8
- export declare const Off: () => JSX.Element;
9
- export declare const Disabled: () => JSX.Element;
10
- //# sourceMappingURL=index.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/SwitchCheckbox/index.story.tsx"],"names":[],"mappings":";;;;AAIA,wBAGC;AAED,eAAO,MAAM,OAAO,mBAiBnB,CAAA;AAED,eAAO,MAAM,EAAE,mBAAmC,CAAA;AAClD,eAAO,MAAM,GAAG,mBAA2C,CAAA;AAC3D,eAAO,MAAM,QAAQ,mBAA4C,CAAA"}
@@ -1,9 +0,0 @@
1
- declare const _default: {
2
- title: string;
3
- component: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
4
- title: string | undefined;
5
- } & import(".").Props, "title">;
6
- };
7
- export default _default;
8
- export declare const Default: () => JSX.Element;
9
- //# sourceMappingURL=index.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/TextEllipsis/index.story.tsx"],"names":[],"mappings":";;;;;;AAIA,wBAGC;AAED,eAAO,MAAM,OAAO,mBA0BnB,CAAA"}
@@ -1,15 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: {
3
- title: string;
4
- component: React.NamedExoticComponent<import(".").Props>;
5
- };
6
- export default _default;
7
- export declare const Default: () => JSX.Element;
8
- export declare const Performance: () => JSX.Element;
9
- export declare const Naive: () => JSX.Element;
10
- export declare const Prefix: () => JSX.Element;
11
- export declare const Hide: () => JSX.Element;
12
- export declare const Collapse: () => JSX.Element;
13
- export declare const LongText: () => JSX.Element;
14
- export declare const LongTextOverflow: () => JSX.Element;
15
- //# sourceMappingURL=index.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/WithIcon/index.story.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;;;;;AAM9B,wBAGC;AAED,eAAO,MAAM,OAAO,mBAoBnB,CAAA;AAED,eAAO,MAAM,WAAW,mBAYvB,CAAA;AAED,eAAO,MAAM,KAAK,mBAOjB,CAAA;AAED,eAAO,MAAM,MAAM,mBAMlB,CAAA;AAqBD,eAAO,MAAM,IAAI,mBAMhB,CAAA;AAED,eAAO,MAAM,QAAQ,mBAMpB,CAAA;AAED,eAAO,MAAM,QAAQ,mBAUpB,CAAA;AAED,eAAO,MAAM,gBAAgB,mBAU5B,CAAA"}
@@ -1,360 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Storybook Tests Sandbox/Carousel _Carousel 1`] = `
4
- .c12 {
5
- stroke: none;
6
- fill: currentColor;
7
- width: 24px;
8
- height: 24px;
9
- line-height: 0;
10
- font-size: 0;
11
- vertical-align: middle;
12
- }
13
-
14
- .c11 {
15
- display: -webkit-box;
16
- display: -webkit-flex;
17
- display: -ms-flexbox;
18
- display: flex;
19
- -webkit-align-items: center;
20
- -webkit-box-align: center;
21
- -ms-flex-align: center;
22
- align-items: center;
23
- -webkit-box-pack: center;
24
- -webkit-justify-content: center;
25
- -ms-flex-pack: center;
26
- justify-content: center;
27
- width: 40px;
28
- height: 40px;
29
- border-radius: 50%;
30
- background-color: rgba(0,0,0,0.32);
31
- -webkit-transition: 0.4s visibility,0.4s opacity,0.2s background-color,0.2s color;
32
- transition: 0.4s visibility,0.4s opacity,0.2s background-color,0.2s color;
33
- color: #ffffff;
34
- }
35
-
36
- .c9 {
37
- position: absolute;
38
- top: 0;
39
- bottom: 0;
40
- display: -webkit-box;
41
- display: -webkit-flex;
42
- display: -ms-flexbox;
43
- display: flex;
44
- -webkit-align-items: center;
45
- -webkit-box-align: center;
46
- -ms-flex-align: center;
47
- align-items: center;
48
- padding: 0;
49
- min-width: 40px;
50
- border: none;
51
- outline: 0;
52
- background: transparent;
53
- cursor: pointer;
54
- -webkit-transition: 0.4s visibility,0.4s opacity;
55
- transition: 0.4s visibility,0.4s opacity;
56
- z-index: 1;
57
- visibility: hidden;
58
- opacity: 0;
59
- pointer-events: none;
60
- }
61
-
62
- .c9:hover .c10 {
63
- background-color: rgba(0,0,0,0.3472);
64
- color: #f5f5f5;
65
- }
66
-
67
- .c9:active .c10 {
68
- background-color: rgba(0,0,0,0.4288);
69
- color: #d6d6d6;
70
- }
71
-
72
- .c3 {
73
- vertical-align: top;
74
- overflow: hidden;
75
- list-style: none;
76
- padding: 0;
77
- min-width: 100%;
78
- box-sizing: border-box;
79
- display: -webkit-inline-box;
80
- display: -webkit-inline-flex;
81
- display: -ms-inline-flexbox;
82
- display: inline-flex;
83
- margin: 0;
84
- }
85
-
86
- .c8 {
87
- opacity: 0;
88
- -webkit-transition: 0.4s opacity;
89
- transition: 0.4s opacity;
90
- }
91
-
92
- .c1 {
93
- position: relative;
94
- z-index: 0;
95
- }
96
-
97
- .c1:hover .c7 {
98
- opacity: 1;
99
- }
100
-
101
- .c2 {
102
- overflow-x: auto;
103
- padding: 0;
104
- margin: 0;
105
- -webkit-scrollbar-width: none;
106
- -moz-scrollbar-width: none;
107
- -ms-scrollbar-width: none;
108
- scrollbar-width: none;
109
- }
110
-
111
- .c2::-webkit-scrollbar {
112
- display: none;
113
- }
114
-
115
- .c5 {
116
- background-color: rgba(0,0,0,0.02);
117
- border-radius: 8px;
118
- color: #adadad;
119
- display: -webkit-box;
120
- display: -webkit-flex;
121
- display: -ms-flexbox;
122
- display: flex;
123
- -webkit-align-items: center;
124
- -webkit-box-align: center;
125
- -ms-flex-align: center;
126
- align-items: center;
127
- -webkit-box-pack: center;
128
- -webkit-justify-content: center;
129
- -ms-flex-pack: center;
130
- justify-content: center;
131
- font-size: 14px;
132
- font-weight: bold;
133
- }
134
-
135
- .c0 {
136
- width: 100%;
137
- padding: 0 108px;
138
- box-sizing: border-box;
139
- }
140
-
141
- .c4 {
142
- display: -webkit-box;
143
- display: -webkit-flex;
144
- display: -ms-flexbox;
145
- display: flex;
146
- padding: 0 16px;
147
- }
148
-
149
- .c4 > * + * {
150
- margin-left: 4px;
151
- }
152
-
153
- .c6 {
154
- width: 118px;
155
- height: 118px;
156
- }
157
-
158
- <div
159
- data-dark={false}
160
- >
161
- <div
162
- className="c0"
163
- >
164
- <div
165
- className="c1"
166
- >
167
- <div
168
- className="c2"
169
- onScroll={[Function]}
170
- >
171
- <ul
172
- className="c3"
173
- >
174
- <div
175
- className="c4"
176
- >
177
- <div
178
- className="c5 c6"
179
- size={118}
180
- >
181
- Dummy
182
- </div>
183
- <div
184
- className="c5 c6"
185
- size={118}
186
- >
187
- Dummy
188
- </div>
189
- <div
190
- className="c5 c6"
191
- size={118}
192
- >
193
- Dummy
194
- </div>
195
- <div
196
- className="c5 c6"
197
- size={118}
198
- >
199
- Dummy
200
- </div>
201
- <div
202
- className="c5 c6"
203
- size={118}
204
- >
205
- Dummy
206
- </div>
207
- <div
208
- className="c5 c6"
209
- size={118}
210
- >
211
- Dummy
212
- </div>
213
- <div
214
- className="c5 c6"
215
- size={118}
216
- >
217
- Dummy
218
- </div>
219
- <div
220
- className="c5 c6"
221
- size={118}
222
- >
223
- Dummy
224
- </div>
225
- <div
226
- className="c5 c6"
227
- size={118}
228
- >
229
- Dummy
230
- </div>
231
- <div
232
- className="c5 c6"
233
- size={118}
234
- >
235
- Dummy
236
- </div>
237
- <div
238
- className="c5 c6"
239
- size={118}
240
- >
241
- Dummy
242
- </div>
243
- <div
244
- className="c5 c6"
245
- size={118}
246
- >
247
- Dummy
248
- </div>
249
- <div
250
- className="c5 c6"
251
- size={118}
252
- >
253
- Dummy
254
- </div>
255
- <div
256
- className="c5 c6"
257
- size={118}
258
- >
259
- Dummy
260
- </div>
261
- <div
262
- className="c5 c6"
263
- size={118}
264
- >
265
- Dummy
266
- </div>
267
- <div
268
- className="c5 c6"
269
- size={118}
270
- >
271
- Dummy
272
- </div>
273
- <div
274
- className="c5 c6"
275
- size={118}
276
- >
277
- Dummy
278
- </div>
279
- <div
280
- className="c5 c6"
281
- size={118}
282
- >
283
- Dummy
284
- </div>
285
- <div
286
- className="c5 c6"
287
- size={118}
288
- >
289
- Dummy
290
- </div>
291
- <div
292
- className="c5 c6"
293
- size={118}
294
- >
295
- Dummy
296
- </div>
297
- </div>
298
- </ul>
299
- </div>
300
- <div
301
- className="c7 c8"
302
- >
303
- <button
304
- className="c9"
305
- onClick={[Function]}
306
- style={
307
- Object {
308
- "left": 0,
309
- "paddingBottom": 0,
310
- "paddingLeft": 16,
311
- }
312
- }
313
- type="button"
314
- >
315
- <div
316
- className="c10 c11"
317
- >
318
- <svg
319
- className="c12"
320
- size={24}
321
- viewBox="0 0 24 24"
322
- >
323
- <path
324
- d="M8.08579 16.5858C7.30474 17.3668 7.30474 18.6332 8.08579 19.4142C8.86684 20.1953 10.1332 20.1953 10.9142 19.4142L18.3284 12L10.9142 4.58579C10.1332 3.80474 8.86684 3.80474 8.08579 4.58579C7.30474 5.36684 7.30474 6.63317 8.08579 7.41421L12.6716 12L8.08579 16.5858Z"
325
- transform="rotate(180 12 12)"
326
- />
327
- </svg>
328
- </div>
329
- </button>
330
- <button
331
- className="c9"
332
- onClick={[Function]}
333
- style={
334
- Object {
335
- "paddingBottom": 0,
336
- "paddingRight": 16,
337
- "right": 0,
338
- }
339
- }
340
- type="button"
341
- >
342
- <div
343
- className="c10 c11"
344
- >
345
- <svg
346
- className="c12"
347
- size={24}
348
- viewBox="0 0 24 24"
349
- >
350
- <path
351
- d="M8.08579 16.5858C7.30474 17.3668 7.30474 18.6332 8.08579 19.4142C8.86684 20.1953 10.1332 20.1953 10.9142 19.4142L18.3284 12L10.9142 4.58579C10.1332 3.80474 8.86684 3.80474 8.08579 4.58579C7.30474 5.36684 7.30474 6.63317 8.08579 7.41421L12.6716 12L8.08579 16.5858Z"
352
- />
353
- </svg>
354
- </div>
355
- </button>
356
- </div>
357
- </div>
358
- </div>
359
- </div>
360
- `;
@@ -1,85 +0,0 @@
1
- import { boolean, number, select, withKnobs } from '@storybook/addon-knobs'
2
- import styled, { css } from 'styled-components'
3
- import Carousel from '.'
4
-
5
- const dummyText = css`
6
- color: ${({ theme }) => theme.color.text4};
7
- display: flex;
8
- align-items: center;
9
- justify-content: center;
10
- font-size: 14px;
11
- font-weight: bold;
12
- `
13
-
14
- const Dummy = styled.div`
15
- background-color: ${({ theme }) => theme.color.surface2};
16
- border-radius: 8px;
17
-
18
- ${dummyText}
19
- `
20
- export default {
21
- title: 'Sandbox/Carousel',
22
- decorators: [withKnobs],
23
- }
24
-
25
- export const _Carousel = () => {
26
- const hasGradient = boolean('Gradient', false)
27
- const fadeInGradient = boolean('FadeInGradient', false)
28
- const buttonOffset = number('buttonOffset', 0)
29
- const buttonPadding = number('buttonPadding', 16)
30
- const defaultScrollAlign = select(
31
- 'scrollAlign',
32
- {
33
- Left: 'left',
34
- Center: 'center',
35
- Right: 'right',
36
- },
37
- 'left'
38
- )
39
- const defaultScrollOffset = number('scrollOffset', 0)
40
- const itemCount = number('Item count', 20)
41
- const itemSize = number('Item size', 118)
42
-
43
- const items = Array.from({ length: itemCount })
44
- return (
45
- <Base>
46
- <Carousel
47
- buttonOffset={buttonOffset}
48
- buttonPadding={buttonPadding}
49
- defaultScroll={{
50
- align: defaultScrollAlign,
51
- offset: defaultScrollOffset,
52
- }}
53
- hasGradient={hasGradient}
54
- fadeInGradient={fadeInGradient}
55
- >
56
- <Container>
57
- {items.map((_value, index) => (
58
- <Box size={itemSize} key={index}>
59
- Dummy
60
- </Box>
61
- ))}
62
- </Container>
63
- </Carousel>
64
- </Base>
65
- )
66
- }
67
- const Base = styled.div`
68
- width: 100%;
69
- padding: 0 108px;
70
- box-sizing: border-box;
71
- `
72
-
73
- const Container = styled.div`
74
- display: flex;
75
- padding: 0 16px;
76
-
77
- > * + * {
78
- margin-left: 4px;
79
- }
80
- `
81
-
82
- const Box = styled(Dummy)<{ size: number }>`
83
- width: ${(props) => `${props.size}px`};
84
- height: ${(props) => `${props.size}px`};
85
- `