@agentscope-ai/design 1.0.5 → 1.0.6

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.
@@ -3,7 +3,12 @@
3
3
  "cssVar": true,
4
4
  "hashed": false,
5
5
  "token": {
6
+ "borderRadiusXS": 2,
7
+ "borderRadiusSM": 4,
6
8
  "borderRadius": 6,
9
+ "borderRadiusLG": 8,
10
+ "borderRadiusXL": 12,
11
+ "borderRadiusFull": 999,
7
12
  "wireframe": false,
8
13
  "colorPrimaryBg": "#202041",
9
14
  "colorPrimaryBgHover": "#202041",
@@ -59,7 +64,33 @@
59
64
  "colorErrorBorderHover": "rgba(255, 163, 158, 0.2)",
60
65
  "colorLink": "#5551CC",
61
66
  "boxShadow": "0px 4px 6px 0px rgba(255, 255, 255, 0.08)",
62
- "boxShadowSecondary": "0px 12px 24px -16px rgba(255, 255, 255, 0.04),0px 8px 40px 0px rgba(255, 255, 255, 0.06),0px 0px 1px 0px rgba(255, 255, 255, 0.02)"
67
+ "boxShadowSecondary": "0px 12px 24px -16px rgba(255, 255, 255, 0.04),0px 8px 40px 0px rgba(255, 255, 255, 0.06),0px 0px 1px 0px rgba(255, 255, 255, 0.02)",
68
+ "colorTextWhite": "#fff",
69
+ "colorFillDisable": "#8D8C98",
70
+ "colorPurple": "#5551CC",
71
+ "colorPurpleHover": "#8383F0",
72
+ "colorPurpleBg": "rgba(226, 222, 255, 0.2)",
73
+ "colorPink": "#EC4899",
74
+ "colorPinkHover": "#E494BC",
75
+ "colorPinkBg": "rgba(251, 220, 239, 0.2)",
76
+ "colorYellow": "#EAB308",
77
+ "colorYellowHover": "#DBBE62",
78
+ "colorYellowBg": "rgba(255, 250, 184, 0.2)",
79
+ "colorOrange": "#FA8125",
80
+ "colorOrangeHover": "#F7A25F",
81
+ "colorOrangeBg": "rgba(255, 232, 201, 0.2)",
82
+ "colorTeal": "#14B8A6",
83
+ "colorTealHover": "#7BC7BE",
84
+ "colorTealBg": "rgba(200, 244, 233, 0.2)",
85
+ "colorBlue": "#0090FF",
86
+ "colorBlueHover": "#83BFED",
87
+ "colorBlueBg": "rgba(194, 229, 255, 0.2)",
88
+ "colorMauve": "#8E8C99",
89
+ "colorMauveHover": "#BBB8CA",
90
+ "colorMauveBg": "rgba(239, 240, 243, 0.2)",
91
+ "boxShadowTertiary": "0px 12px 32px -16px rgba(255, 255, 255, 0.16),0px 12px 60px 0px rgba(255, 255, 255, 0.08),0px 0px 1px 0px rgba(255, 255, 255, 0.02)",
92
+ "boxShadowTertiaryLeft": "-12px 0px 32px -16px rgba(255, 255, 255, 0.16),-12px 0px 60px 0px rgba(255, 255, 255, 0.08),0px 0px 1px 0px rgba(255, 255, 255, 0.02);",
93
+ "boxShadowInput": "0px 12px 24px -16px rgba(255, 255, 255, 0.08),0px 12px 40px 0px rgba(255, 255, 255, 0.16),0px 0px 1px 0px rgba(255, 255, 255, 0.04)"
63
94
  },
64
95
  "components": {
65
96
  "Alert": {
@@ -134,35 +165,6 @@
134
165
  "Form": {
135
166
  "itemMarginBottom": 16
136
167
  }
137
- },
138
- "extraCssVariables": {
139
- "border-radius-full": 999,
140
- "color-text-white": "#fff",
141
- "color-fill-disable": "#8D8C98",
142
- "color-purple": "#5551CC",
143
- "color-purple-hover": "#8383F0",
144
- "color-purple-bg": "rgba(226, 222, 255, 0.2)",
145
- "color-pink": "#EC4899",
146
- "color-pink-hover": "#E494BC",
147
- "color-pink-bg": "rgba(251, 220, 239, 0.2)",
148
- "color-yellow": "#EAB308",
149
- "color-yellow-hover": "#DBBE62",
150
- "color-yellow-bg": "rgba(255, 250, 184, 0.2)",
151
- "color-orange": "#FA8125",
152
- "color-orange-hover": "#F7A25F",
153
- "color-orange-bg": "rgba(255, 232, 201, 0.2)",
154
- "color-teal": "#14B8A6",
155
- "color-teal-hover": "#7BC7BE",
156
- "color-teal-bg": "rgba(200, 244, 233, 0.2)",
157
- "color-blue": "#0090FF",
158
- "color-blue-hover": "#83BFED",
159
- "color-blue-bg": "rgba(194, 229, 255, 0.2)",
160
- "color-mauve": "#8E8C99",
161
- "color-mauve-hover": "#BBB8CA",
162
- "color-mauve-bg": "rgba(239, 240, 243, 0.2)",
163
- "box-shadow-tertiary": "0px 12px 32px -16px rgba(255, 255, 255, 0.16),0px 12px 60px 0px rgba(255, 255, 255, 0.08),0px 0px 1px 0px rgba(255, 255, 255, 0.02)",
164
- "box-shadow-tertiary-left": "-12px 0px 32px -16px rgba(255, 255, 255, 0.16),-12px 0px 60px 0px rgba(255, 255, 255, 0.08),0px 0px 1px 0px rgba(255, 255, 255, 0.02);",
165
- "box-shadow-input": "0px 12px 24px -16px rgba(255, 255, 255, 0.08),0px 12px 40px 0px rgba(255, 255, 255, 0.16),0px 0px 1px 0px rgba(255, 255, 255, 0.04)"
166
168
  }
167
169
  },
168
170
  "checkbox": {
@@ -3,7 +3,12 @@
3
3
  "cssVar": true,
4
4
  "hashed": false,
5
5
  "token": {
6
+ "borderRadiusXS": 2,
7
+ "borderRadiusSM": 4,
6
8
  "borderRadius": 6,
9
+ "borderRadiusLG": 8,
10
+ "borderRadiusXL": 12,
11
+ "borderRadiusFull": 999,
7
12
  "wireframe": false,
8
13
  "colorPrimaryBg": "#F2F0FF",
9
14
  "colorPrimaryBgHover": "#F2F0FF",
@@ -59,7 +64,33 @@
59
64
  "colorErrorBorderHover": "#FFA39E",
60
65
  "colorLink": "#615CED",
61
66
  "boxShadow": "0px 4px 6px 0px rgba(0, 0, 0, 0.08)",
62
- "boxShadowSecondary": "0px 12px 24px -16px rgba(0, 0, 0, 0.06),0px 8px 40px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)"
67
+ "boxShadowSecondary": "0px 12px 24px -16px rgba(0, 0, 0, 0.06),0px 8px 40px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
68
+ "colorTextWhite": "#fff",
69
+ "colorFillDisable": "#DBDAE7",
70
+ "colorPurple": "#615CED",
71
+ "colorPurpleHover": "#8080FF",
72
+ "colorPurpleBg": "rgba(226, 222, 255, 0.8)",
73
+ "colorPink": "#EC4899",
74
+ "colorPinkHover": "#E593BC",
75
+ "colorPinkBg": "rgba(251, 220, 239, 0.8)",
76
+ "colorYellow": "#EAB308",
77
+ "colorYellowHover": "#F1D372",
78
+ "colorYellowBg": "rgba(255, 250, 184, 0.8)",
79
+ "colorOrange": "#FA8125",
80
+ "colorOrangeHover": "#E88C45",
81
+ "colorOrangeBg": "rgba(255, 232, 201, 0.8)",
82
+ "colorTeal": "#14B8A6",
83
+ "colorTealHover": "#5FB3A9",
84
+ "colorTealBg": "rgba(200, 244, 233, 0.8)",
85
+ "colorBlue": "#0090FF",
86
+ "colorBlueHover": "#72BCF5",
87
+ "colorBlueBg": "rgba(194, 229, 255, 0.8)",
88
+ "colorMauve": "#8E8C99",
89
+ "colorMauveHover": "#C0BFC8",
90
+ "colorMauveBg": "rgba(239, 240, 243, 0.8)",
91
+ "boxShadowTertiary": "0px 12px 32px -16px rgba(0, 0, 0, 0.24),0px 12px 60px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
92
+ "boxShadowTertiaryLeft": "-12px 0px 32px -16px rgba(0, 0, 0, 0.24),-12px 0px 60px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
93
+ "boxShadowInput": "0px 12px 24px -16px rgba(54, 54, 73, 0.04),0px 12px 40px 0px rgba(51, 51, 71, 0.08),0px 0px 1px 0px rgba(44, 44, 54, 0.02)"
63
94
  },
64
95
  "components": {
65
96
  "Alert": {
@@ -131,35 +162,6 @@
131
162
  "Form": {
132
163
  "itemMarginBottom": 16
133
164
  }
134
- },
135
- "extraCssVariables": {
136
- "border-radius-full": 999,
137
- "color-text-white": "#fff",
138
- "color-fill-disable": "#DBDAE7",
139
- "color-purple": "#615CED",
140
- "color-purple-hover": "#8080FF",
141
- "color-purple-bg": "rgba(226, 222, 255, 0.8)",
142
- "color-pink": "#EC4899",
143
- "color-pink-hover": "#E593BC",
144
- "color-pink-bg": "rgba(251, 220, 239, 0.8)",
145
- "color-yellow": "#EAB308",
146
- "color-yellow-hover": "#F1D372",
147
- "color-yellow-bg": "rgba(255, 250, 184, 0.8)",
148
- "color-orange": "#FA8125",
149
- "color-orange-hover": "#E88C45",
150
- "color-orange-bg": "rgba(255, 232, 201, 0.8)",
151
- "color-teal": "#14B8A6",
152
- "color-teal-hover": "#5FB3A9",
153
- "color-teal-bg": "rgba(200, 244, 233, 0.8)",
154
- "color-blue": "#0090FF",
155
- "color-blue-hover": "#72BCF5",
156
- "color-blue-bg": "rgba(194, 229, 255, 0.8)",
157
- "color-mauve": "#8E8C99",
158
- "color-mauve-hover": "#C0BFC8",
159
- "color-mauve-bg": "rgba(239, 240, 243, 0.8)",
160
- "box-shadow-tertiary": "0px 12px 32px -16px rgba(0, 0, 0, 0.24),0px 12px 60px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
161
- "box-shadow-tertiary-left": "-12px 0px 32px -16px rgba(0, 0, 0, 0.24),-12px 0px 60px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
162
- "box-shadow-input": "0px 12px 24px -16px rgba(54, 54, 73, 0.04),0px 12px 40px 0px rgba(51, 51, 71, 0.08),0px 0px 1px 0px rgba(44, 44, 54, 0.02)"
163
165
  }
164
166
  },
165
167
  "checkbox": {
@@ -3,7 +3,12 @@
3
3
  "cssVar": true,
4
4
  "hashed": false,
5
5
  "token": {
6
+ "borderRadiusXS": 2,
7
+ "borderRadiusSM": 4,
6
8
  "borderRadius": 6,
9
+ "borderRadiusLG": 8,
10
+ "borderRadiusXL": 12,
11
+ "borderRadiusFull": 999,
7
12
  "wireframe": false,
8
13
  "colorPrimaryBg": "#181818",
9
14
  "colorPrimaryBgHover": "#2e2e2e",
@@ -59,7 +64,33 @@
59
64
  "colorErrorBorderHover": "rgba(255, 163, 158, 0.2)",
60
65
  "colorLink": "rgba(22, 87, 238, 1)",
61
66
  "boxShadow": "0px 4px 6px 0px rgba(255, 255, 255, 0.08)",
62
- "boxShadowSecondary": "0px 12px 24px -16px rgba(255, 255, 255, 0.06),0px 8px 40px 0px rgba(255, 255, 255, 0.12),0px 0px 1px 0px rgba(255, 255, 255, 0.04)"
67
+ "boxShadowSecondary": "0px 12px 24px -16px rgba(255, 255, 255, 0.06),0px 8px 40px 0px rgba(255, 255, 255, 0.12),0px 0px 1px 0px rgba(255, 255, 255, 0.04)",
68
+ "colorTextWhite": "#fff",
69
+ "colorFillDisable": "rgba(137, 137, 137, 1)",
70
+ "colorPurple": "#5551CC",
71
+ "colorPurpleHover": "#8383F0",
72
+ "colorPurpleBg": "rgba(226, 222, 255, 0.2)",
73
+ "colorPink": "#EC4899",
74
+ "colorPinkHover": "#E494BC",
75
+ "colorPinkBg": "rgba(251, 220, 239, 0.2)",
76
+ "colorYellow": "#EAB308",
77
+ "colorYellowHover": "#DBBE62",
78
+ "colorYellowBg": "rgba(255, 250, 184, 0.2)",
79
+ "colorOrange": "#FA8125",
80
+ "colorOrangeHover": "#F7A25F",
81
+ "colorOrangeBg": "rgba(255, 232, 201, 0.2)",
82
+ "colorTeal": "#14B8A6",
83
+ "colorTealHover": "#7BC7BE",
84
+ "colorTealBg": "rgba(200, 244, 233, 0.2)",
85
+ "colorBlue": "#0090FF",
86
+ "colorBlueHover": "#83BFED",
87
+ "colorBlueBg": "rgba(194, 229, 255, 0.2)",
88
+ "colorMauve": "#8E8C99",
89
+ "colorMauveHover": "#BBB8CA",
90
+ "colorMauveBg": "rgba(239, 240, 243, 0.2)",
91
+ "boxShadowTertiary": "0px 12px 32px -16px rgba(255, 255, 255, 0.24),0px 12px 60px 0px rgba(255, 255, 255, 0.12),0px 0px 1px 0px rgba(255, 255, 255, 0.04)",
92
+ "boxShadowTertiaryLeft": "-12px 0px 32px -16px rgba(255, 255, 255, 0.24),-12px 0px 60px 0px rgba(255, 255, 255, 0.12),0px 0px 1px 0px rgba(255, 255, 255, 0.04)",
93
+ "boxShadowInput": "0px 12px 24px -16px rgba(255, 255, 255, 0.08),0px 12px 40px 0px rgba(255, 255, 255, 0.16),0px 0px 1px 0px rgba(255, 255, 255, 0.04)"
63
94
  },
64
95
  "components": {
65
96
  "Alert": {
@@ -133,35 +164,6 @@
133
164
  "Form": {
134
165
  "itemMarginBottom": 16
135
166
  }
136
- },
137
- "extraCssVariables": {
138
- "border-radius-full": 999,
139
- "color-text-white": "#fff",
140
- "color-fill-disable": "rgba(137, 137, 137, 1)",
141
- "color-purple": "#5551CC",
142
- "color-purple-hover": "#8383F0",
143
- "color-purple-bg": "rgba(226, 222, 255, 0.2)",
144
- "color-pink": "#EC4899",
145
- "color-pink-hover": "#E494BC",
146
- "color-pink-bg": "rgba(251, 220, 239, 0.2)",
147
- "color-yellow": "#EAB308",
148
- "color-yellow-hover": "#DBBE62",
149
- "color-yellow-bg": "rgba(255, 250, 184, 0.2)",
150
- "color-orange": "#FA8125",
151
- "color-orange-hover": "#F7A25F",
152
- "color-orange-bg": "rgba(255, 232, 201, 0.2)",
153
- "color-teal": "#14B8A6",
154
- "color-teal-hover": "#7BC7BE",
155
- "color-teal-bg": "rgba(200, 244, 233, 0.2)",
156
- "color-blue": "#0090FF",
157
- "color-blue-hover": "#83BFED",
158
- "color-blue-bg": "rgba(194, 229, 255, 0.2)",
159
- "color-mauve": "#8E8C99",
160
- "color-mauve-hover": "#BBB8CA",
161
- "color-mauve-bg": "rgba(239, 240, 243, 0.2)",
162
- "box-shadow-tertiary": "0px 12px 32px -16px rgba(255, 255, 255, 0.24),0px 12px 60px 0px rgba(255, 255, 255, 0.12),0px 0px 1px 0px rgba(255, 255, 255, 0.04)",
163
- "box-shadow-tertiary-left": "-12px 0px 32px -16px rgba(255, 255, 255, 0.24),-12px 0px 60px 0px rgba(255, 255, 255, 0.12),0px 0px 1px 0px rgba(255, 255, 255, 0.04)",
164
- "box-shadow-input": "0px 12px 24px -16px rgba(255, 255, 255, 0.08),0px 12px 40px 0px rgba(255, 255, 255, 0.16),0px 0px 1px 0px rgba(255, 255, 255, 0.04)"
165
167
  }
166
168
  },
167
169
  "checkbox": {
@@ -3,7 +3,12 @@
3
3
  "cssVar": true,
4
4
  "hashed": false,
5
5
  "token": {
6
+ "borderRadiusXS": 2,
7
+ "borderRadiusSM": 4,
6
8
  "borderRadius": 6,
9
+ "borderRadiusLG": 8,
10
+ "borderRadiusXL": 12,
11
+ "borderRadiusFull": 999,
7
12
  "wireframe": false,
8
13
  "colorPrimaryBg": "rgba(244, 244, 247, 1)",
9
14
  "colorPrimaryBgHover": "rgba(239, 239, 244, 1)",
@@ -59,7 +64,33 @@
59
64
  "colorErrorBorderHover": "#FFA39E",
60
65
  "colorLink": "#615CED",
61
66
  "boxShadow": "0px 4px 6px 0px rgba(0, 0, 0, 0.08)",
62
- "boxShadowSecondary": "0px 12px 24px -16px rgba(0, 0, 0, 0.06),0px 8px 40px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)"
67
+ "boxShadowSecondary": "0px 12px 24px -16px rgba(0, 0, 0, 0.06),0px 8px 40px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
68
+ "colorTextWhite": "#fff",
69
+ "colorFillDisable": "#E8E8EB",
70
+ "colorPurple": "#615CED",
71
+ "colorPurpleHover": "#8080FF",
72
+ "colorPurpleBg": "rgba(226, 222, 255, 0.8)",
73
+ "colorPink": "#EC4899",
74
+ "colorPinkHover": "#E593BC",
75
+ "colorPinkBg": "rgba(251, 220, 239, 0.8)",
76
+ "colorYellow": "#EAB308",
77
+ "colorYellowHover": "#F1D372",
78
+ "colorYellowBg": "rgba(255, 250, 184, 0.8)",
79
+ "colorOrange": "#FA8125",
80
+ "colorOrangeHover": "#E88C45",
81
+ "colorOrangeBg": "rgba(255, 232, 201, 0.8)",
82
+ "colorTeal": "#14B8A6",
83
+ "colorTealHover": "#5FB3A9",
84
+ "colorTealBg": "rgba(200, 244, 233, 0.8)",
85
+ "colorBlue": "#0090FF",
86
+ "colorBlueHover": "#72BCF5",
87
+ "colorBlueBg": "rgba(194, 229, 255, 0.8)",
88
+ "colorMauve": "#8E8C99",
89
+ "colorMauveHover": "#C0BFC8",
90
+ "colorMauveBg": "rgba(239, 240, 243, 0.8)",
91
+ "boxShadowTertiary": "0px 12px 32px -16px rgba(0, 0, 0, 0.24),0px 12px 60px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
92
+ "boxShadowTertiaryLeft": "-12px 0px 32px -16px rgba(0, 0, 0, 0.24),-12px 0px 60px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
93
+ "boxShadowInput": "0px 12px 24px -16px rgba(54, 54, 73, 0.04),0px 12px 40px 0px rgba(51, 51, 71, 0.08),0px 0px 1px 0px rgba(44, 44, 54, 0.02)"
63
94
  },
64
95
  "components": {
65
96
  "Alert": {
@@ -131,35 +162,6 @@
131
162
  "Form": {
132
163
  "itemMarginBottom": 16
133
164
  }
134
- },
135
- "extraCssVariables": {
136
- "border-radius-full": 999,
137
- "color-text-white": "#fff",
138
- "color-fill-disable": "#E8E8EB",
139
- "color-purple": "#615CED",
140
- "color-purple-hover": "#8080FF",
141
- "color-purple-bg": "rgba(226, 222, 255, 0.8)",
142
- "color-pink": "#EC4899",
143
- "color-pink-hover": "#E593BC",
144
- "color-pink-bg": "rgba(251, 220, 239, 0.8)",
145
- "color-yellow": "#EAB308",
146
- "color-yellow-hover": "#F1D372",
147
- "color-yellow-bg": "rgba(255, 250, 184, 0.8)",
148
- "color-orange": "#FA8125",
149
- "color-orange-hover": "#E88C45",
150
- "color-orange-bg": "rgba(255, 232, 201, 0.8)",
151
- "color-teal": "#14B8A6",
152
- "color-teal-hover": "#5FB3A9",
153
- "color-teal-bg": "rgba(200, 244, 233, 0.8)",
154
- "color-blue": "#0090FF",
155
- "color-blue-hover": "#72BCF5",
156
- "color-blue-bg": "rgba(194, 229, 255, 0.8)",
157
- "color-mauve": "#8E8C99",
158
- "color-mauve-hover": "#C0BFC8",
159
- "color-mauve-bg": "rgba(239, 240, 243, 0.8)",
160
- "box-shadow-tertiary": "0px 12px 32px -16px rgba(0, 0, 0, 0.24),0px 12px 60px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
161
- "box-shadow-tertiary-left": "-12px 0px 32px -16px rgba(0, 0, 0, 0.24),-12px 0px 60px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
162
- "box-shadow-input": "0px 12px 24px -16px rgba(54, 54, 73, 0.04),0px 12px 40px 0px rgba(51, 51, 71, 0.08),0px 0px 1px 0px rgba(44, 44, 54, 0.02)"
163
165
  }
164
166
  },
165
167
  "checkbox": {
@@ -11,13 +11,11 @@ export type SparkConfigProviderProps = ConfigProviderProps & {
11
11
  children?: React.ReactNode;
12
12
  className?: string;
13
13
  style?: React.CSSProperties;
14
- theme?: ConfigProviderProps['theme'] & {
15
- extraCssVariables?: Record<string, string | number>;
16
- };
14
+ theme?: ConfigProviderProps['theme'];
17
15
  };
18
16
  declare function SparkConfigProvider(props: SparkConfigProviderProps): import("react/jsx-runtime").JSX.Element;
19
17
  declare namespace SparkConfigProvider {
20
- var ConfigContext: import("react").Context<import("antd/es/config-provider").ConfigConsumerProps>;
18
+ var ConfigContext: import("react").Context<import("antd/es/config-provider/context").ConfigConsumerProps>;
21
19
  var config: (props: any) => void;
22
20
  var useConfig: typeof import("antd/es/config-provider/hooks/useConfig").default;
23
21
  }
@@ -15,8 +15,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
15
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
16
  import $i18n from "../../../i18n";
17
17
  import { App, ConfigProvider, message, theme } from 'antd';
18
+ import { ConfigContext } from 'antd/es/config-provider/context';
19
+ import useTheme from 'antd/es/config-provider/hooks/useTheme';
18
20
  import classNames from 'classnames';
19
- import { useLayoutEffect, useMemo, useState } from 'react';
21
+ import { useContext, useLayoutEffect, useMemo, useState } from 'react';
20
22
  import { DEFAULT_SPARK_PREFIX, getCommonConfig, setCommonConfig } from "../../../config";
21
23
  import useSparkStyle from "../spark.style";
22
24
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -40,21 +42,24 @@ function SparkConfigProvider(props) {
40
42
  _useState2 = _slicedToArray(_useState, 2),
41
43
  hasInit = _useState2[0],
42
44
  setHasInit = _useState2[1];
43
- var _useState3 = useState({}),
45
+ var _useState3 = useState(((_props$locale = props.locale) === null || _props$locale === void 0 ? void 0 : _props$locale.locale) || 'defaultKey'),
44
46
  _useState4 = _slicedToArray(_useState3, 2),
45
- variables = _useState4[0],
46
- setVariables = _useState4[1];
47
- var _useState5 = useState(((_props$locale = props.locale) === null || _props$locale === void 0 ? void 0 : _props$locale.locale) || 'defaultKey'),
48
- _useState6 = _slicedToArray(_useState5, 2),
49
- key = _useState6[0],
50
- setKey = _useState6[1];
47
+ key = _useState4[0],
48
+ setKey = _useState4[1];
51
49
  // 更新antd的class prefix
52
50
  var _getCommonConfig = getCommonConfig(),
53
51
  antPrefix = _getCommonConfig.antPrefix,
54
52
  sparkPrefix = _getCommonConfig.sparkPrefix;
53
+ var _useContext = useContext(ConfigContext),
54
+ parentTheme = _useContext.theme; // 父级ConfigProvider的theme(如有)
55
55
  var mergedPrefixCls = useMemo(function () {
56
56
  return prefixCls || (prefix ? "".concat(prefix, "-ant") : antPrefix);
57
57
  }, [prefixCls, prefix]);
58
+
59
+ // 融合父ConfigProvider的theme(如有),供给静态方法使用
60
+ var mergedTheme = useTheme(props.theme, parentTheme, {
61
+ prefixCls: mergedPrefixCls
62
+ });
58
63
  useLayoutEffect(function () {
59
64
  var newCommonConfig = {
60
65
  antPrefix: mergedPrefixCls,
@@ -88,44 +93,22 @@ function SparkConfigProvider(props) {
88
93
  }, []);
89
94
  useLayoutEffect(function () {
90
95
  // 给 message 、modal 、notification 静态方法设置 Provider
96
+ // 注意这里的theme不会集成父ConfigProvider的theme,所以需要手动合并
91
97
  ConfigProvider.config({
92
98
  // 5.13.0+
93
99
  holderRender: function holderRender(children) {
94
100
  return /*#__PURE__*/_jsx(ConfigProvider, _objectSpread(_objectSpread({}, restProps), {}, {
95
101
  prefixCls: mergedPrefixCls,
102
+ theme: mergedTheme,
96
103
  children: /*#__PURE__*/_jsx(App, {
97
104
  className: classNames("spark"),
98
- style: _objectSpread(_objectSpread({}, variables), props.style),
105
+ style: _objectSpread({}, props.style),
99
106
  children: children
100
107
  }, key)
101
108
  }));
102
109
  }
103
110
  });
104
111
  }, [restProps, mergedPrefixCls, hasInit]);
105
- useLayoutEffect(function () {
106
- // 从theme从提取出extraCssVariables,作为额外补充、覆盖的css变量
107
- if (!props.theme) return;
108
- var _getCommonConfig2 = getCommonConfig(),
109
- antPrefix = _getCommonConfig2.antPrefix;
110
- var _variables = {};
111
- var extraCssVariables = props.theme.extraCssVariables;
112
- if (extraCssVariables) {
113
- Object.keys(props.theme.extraCssVariables).forEach(function (key) {
114
- _variables["--".concat(antPrefix, "-").concat(key)] = extraCssVariables[key];
115
- });
116
- setVariables(_variables);
117
- setCommonConfig(_objectSpread(_objectSpread({}, getCommonConfig()), {}, {
118
- variables: _variables,
119
- isDarkMode: function () {
120
- try {
121
- return restProps.theme.algorithm == theme.darkAlgorithm;
122
- } catch (error) {
123
- return false;
124
- }
125
- }()
126
- }));
127
- }
128
- }, [props.theme]);
129
112
  useLayoutEffect(function () {
130
113
  var _props$locale2, _props$locale3;
131
114
  $i18n.updateLocale(((_props$locale2 = props.locale) === null || _props$locale2 === void 0 ? void 0 : _props$locale2.locale) || 'zh-cn'); // 默认为中文
@@ -138,7 +121,7 @@ function SparkConfigProvider(props) {
138
121
  sparkPrefix: sparkPrefix
139
122
  }), /*#__PURE__*/_jsx(App, {
140
123
  className: classNames("spark", props.className),
141
- style: _objectSpread(_objectSpread({}, variables), props.style),
124
+ style: _objectSpread({}, props.style),
142
125
  children: hasInit ? children : null
143
126
  }, key)]
144
127
  }));
@@ -21,7 +21,6 @@ export default (function (props) {
21
21
  useIndexStyle();
22
22
  var commonConfig = getCommonConfig();
23
23
  var sparkPrefix = commonConfig.sparkPrefix;
24
- var variables = commonConfig.variables;
25
24
  return /*#__PURE__*/_jsx(Drawer, _objectSpread(_objectSpread({
26
25
  closeIcon: /*#__PURE__*/_jsx(IconFont, {
27
26
  type: "spark-false-line",
@@ -30,7 +29,7 @@ export default (function (props) {
30
29
  }
31
30
  }),
32
31
  className: classNames("".concat(sparkPrefix, "-drawer"), className),
33
- style: _objectSpread(_objectSpread({}, style), variables)
32
+ style: _objectSpread({}, style)
34
33
  }, restProps), {}, {
35
34
  children: children
36
35
  }));
@@ -4,17 +4,14 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import { getCommonConfig } from "../../../config";
8
7
  import { Dropdown } from 'antd';
9
8
  import { forwardRef } from 'react';
10
9
  import useIndexStyle from "./index.style";
11
10
  import { jsx as _jsx } from "react/jsx-runtime";
12
- var SparkDropdown = /*#__PURE__*/forwardRef(function (props, ref) {
11
+ var SparkDropdown = /*#__PURE__*/forwardRef(function (props) {
13
12
  useIndexStyle();
14
- var _getCommonConfig = getCommonConfig(),
15
- variables = _getCommonConfig.variables;
16
13
  return /*#__PURE__*/_jsx(Dropdown, _objectSpread(_objectSpread({}, props), {}, {
17
- overlayStyle: _objectSpread(_objectSpread({}, variables), props.overlayStyle)
14
+ overlayStyle: _objectSpread({}, props.overlayStyle)
18
15
  }));
19
16
  });
20
17
  export default SparkDropdown;
@@ -30,7 +30,7 @@ var SparkTextArea = /*#__PURE__*/React.forwardRef(function (props, ref) {
30
30
  antPrefix = _getCommonConfig2.antPrefix;
31
31
  useIndexStyle();
32
32
  return /*#__PURE__*/_jsx(Input.TextArea, _objectSpread(_objectSpread({}, props), {}, {
33
- className: "".concat(antPrefix, "-text-area"),
33
+ className: classNames("".concat(antPrefix, "-text-area"), props.className),
34
34
  ref: ref
35
35
  }));
36
36
  });
@@ -1,9 +1,12 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["showDivider", "closable"];
2
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
7
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
7
10
  import { getCommonConfig } from "../../../config";
8
11
  import { CloseOutlined } from '@agentscope-ai/icons-override-antd';
9
12
  import { Modal } from 'antd';
@@ -14,12 +17,12 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
14
17
  var SparkModal = function SparkModal(props) {
15
18
  useIndexStyle();
16
19
  var _getCommonConfig = getCommonConfig(),
17
- sparkPrefix = _getCommonConfig.sparkPrefix,
18
- variables = _getCommonConfig.variables;
20
+ sparkPrefix = _getCommonConfig.sparkPrefix;
19
21
  var _props$showDivider = props.showDivider,
20
22
  showDivider = _props$showDivider === void 0 ? true : _props$showDivider,
21
23
  _props$closable = props.closable,
22
- closable = _props$closable === void 0 ? true : _props$closable;
24
+ closable = _props$closable === void 0 ? true : _props$closable,
25
+ restProps = _objectWithoutProperties(props, _excluded);
23
26
  var renderFooter = function renderFooter(originNode) {
24
27
  return props.info ? /*#__PURE__*/_jsxs("div", {
25
28
  className: "".concat(sparkPrefix, "-modal-footer-wrapper"),
@@ -40,7 +43,7 @@ var SparkModal = function SparkModal(props) {
40
43
  }
41
44
  }) : null;
42
45
  var mergedFooter = props.footer === undefined ? renderFooter : props.footer;
43
- return /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({}, props), {}, {
46
+ return /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({}, restProps), {}, {
44
47
  closeIcon: null,
45
48
  title: /*#__PURE__*/_jsxs("div", {
46
49
  className: "".concat(sparkPrefix, "-modal-title-wrapper"),
@@ -50,7 +53,7 @@ var SparkModal = function SparkModal(props) {
50
53
  }), mergedCloseIcon]
51
54
  }),
52
55
  wrapClassName: classNames("".concat(sparkPrefix, "-modal"), _defineProperty({}, "".concat(sparkPrefix, "-show-divider"), showDivider), props.wrapClassName, 'animate-in'),
53
- wrapStyle: _objectSpread(_objectSpread({}, variables), props.wrapStyle),
56
+ wrapStyle: _objectSpread({}, props.wrapStyle),
54
57
  footer: mergedFooter,
55
58
  transitionName: ""
56
59
  }));
package/dist/config.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ConfigProviderProps } from 'antd';
3
2
  import { Locale } from 'antd/es/locale';
4
3
  export declare const DEFAULT_ANT_PREFIX = "ant";
@@ -18,8 +17,6 @@ export interface CommonConfig {
18
17
  locale?: Locale;
19
18
  /** iconfont 地址 */
20
19
  iconfont?: string;
21
- /** css variables style */
22
- variables?: React.CSSProperties;
23
20
  isDarkMode?: boolean;
24
21
  }
25
22
  export declare function setCommonConfig(newConf: CommonConfig): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentscope-ai/design",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Basic components for the best experience of LLM",
5
5
  "license": "MIT",
6
6
  "sideEffects": [