File tree Expand file tree Collapse file tree 3 files changed +15
-21
lines changed
packages/component-library/src Expand file tree Collapse file tree 3 files changed +15
-21
lines changed Original file line number Diff line number Diff line change 1
- import * as icons from "@phosphor-icons/react/dist/ssr" ;
2
1
import type { Meta , StoryObj } from "@storybook/react" ;
3
2
4
3
import { Button as ButtonComponent , VARIANTS , SIZES } from "./index.jsx" ;
5
-
6
- const iconControl = {
7
- control : "select" ,
8
- options : Object . keys ( icons ) ,
9
- mapping : Object . fromEntries (
10
- Object . entries ( icons ) . map ( ( [ iconName , Icon ] ) => [
11
- iconName ,
12
- < Icon key = { iconName } weights = { new Map ( ) } /> ,
13
- ] ) ,
14
- ) ,
15
- } as const ;
4
+ import { iconControl } from "../icon-control.jsx" ;
16
5
17
6
const meta = {
18
7
component : ButtonComponent ,
Original file line number Diff line number Diff line change 1
- import * as Icon from "@phosphor-icons/react/dist/ssr" ;
2
1
import type { Meta , StoryObj } from "@storybook/react" ;
3
2
4
3
import { Card as CardComponent , VARIANTS } from "./index.jsx" ;
4
+ import { iconControl } from "../icon-control.jsx" ;
5
5
6
6
const meta = {
7
7
component : CardComponent ,
@@ -44,14 +44,7 @@ const meta = {
44
44
} ,
45
45
} ,
46
46
icon : {
47
- control : "select" ,
48
- options : Object . keys ( Icon ) ,
49
- mapping : Object . fromEntries (
50
- Object . entries ( Icon ) . map ( ( [ key , Icon ] ) => [
51
- key ,
52
- < Icon weights = { new Map ( ) } key = { key } /> ,
53
- ] ) ,
54
- ) ,
47
+ ...iconControl ,
55
48
table : {
56
49
category : "Contents" ,
57
50
} ,
Original file line number Diff line number Diff line change
1
+ import * as icons from "@phosphor-icons/react/dist/ssr" ;
2
+
3
+ export const iconControl = {
4
+ control : "select" ,
5
+ options : Object . keys ( icons ) ,
6
+ mapping : Object . fromEntries (
7
+ Object . entries ( icons ) . map ( ( [ iconName , Icon ] ) => [
8
+ iconName ,
9
+ < Icon key = { iconName } weights = { new Map ( ) } /> ,
10
+ ] ) ,
11
+ ) ,
12
+ } as const ;
You can’t perform that action at this time.
0 commit comments