@mathwiz/ui-components 0.1.28 → 0.1.30

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 (130) hide show
  1. package/README.md +1 -1
  2. package/dist/components/Button/Button.css +100 -32
  3. package/dist/components/Button/Button.d.ts.map +1 -1
  4. package/dist/components/Button/types.d.ts +19 -0
  5. package/dist/components/Button/types.d.ts.map +1 -1
  6. package/dist/components/HundredChart/HundredChart.css +8 -0
  7. package/dist/components/HundredChart/HundredChart.d.ts.map +1 -1
  8. package/dist/components/HundredChart/HundredChart.types.d.ts +29 -0
  9. package/dist/components/HundredChart/HundredChart.types.d.ts.map +1 -1
  10. package/dist/components/HundredChart/HundredChart.utils.d.ts +13 -1
  11. package/dist/components/HundredChart/HundredChart.utils.d.ts.map +1 -1
  12. package/dist/components/HundredChart/index.d.ts +2 -2
  13. package/dist/components/HundredChart/index.d.ts.map +1 -1
  14. package/dist/components/MathCardV2/DecimalNumberRecognitionSessionStore.d.ts +2 -2
  15. package/dist/components/MathCardV2/DecimalNumberRecognitionSessionStore.d.ts.map +1 -1
  16. package/dist/components/MathCardV2/ExplanationStep.d.ts +9 -0
  17. package/dist/components/MathCardV2/ExplanationStep.d.ts.map +1 -1
  18. package/dist/components/MathCardV2/MathCardV2.css +11 -4
  19. package/dist/components/MathCardV2/MathCardV2.d.ts.map +1 -1
  20. package/dist/components/MathCardV2/MathCardV2.types.d.ts +51 -1
  21. package/dist/components/MathCardV2/MathCardV2.types.d.ts.map +1 -1
  22. package/dist/components/MathCardV2/MathPracticeSessionStore.d.ts +3 -3
  23. package/dist/components/MathCardV2/MathPracticeSessionStore.d.ts.map +1 -1
  24. package/dist/components/MathCardV2/MathPracticeSessionTypes.d.ts +38 -18
  25. package/dist/components/MathCardV2/MathPracticeSessionTypes.d.ts.map +1 -1
  26. package/dist/components/MathCardV2/MathPracticeStoreContext.d.ts +3 -9
  27. package/dist/components/MathCardV2/MathPracticeStoreContext.d.ts.map +1 -1
  28. package/dist/components/MathCardV2/MathPracticeStoreHooks.d.ts +3 -2
  29. package/dist/components/MathCardV2/MathPracticeStoreHooks.d.ts.map +1 -1
  30. package/dist/components/MathCardV2/components/content/OptionGroupContent.d.ts +10 -0
  31. package/dist/components/MathCardV2/components/content/OptionGroupContent.d.ts.map +1 -0
  32. package/dist/components/MathCardV2/components/renderers/ContentRenderer.d.ts.map +1 -1
  33. package/dist/components/MathCardV2/hooks/useDataAdapter.d.ts.map +1 -1
  34. package/dist/components/MathCardV2/hooks/useMeetingProblemAdapter.d.ts.map +1 -1
  35. package/dist/components/MathCardV2/modules/ReviewModule/ReviewModule.d.ts.map +1 -1
  36. package/dist/components/MathCardV2/modules/SolveModule/SolveModule.d.ts.map +1 -1
  37. package/dist/components/MathCardV2/scenes/ExplanationScene/ExplanationScene.d.ts.map +1 -1
  38. package/dist/components/MathCardV2/scenes/QuestionScene/QuestionScene.css +18 -18
  39. package/dist/components/MathCardV2/scenes/QuestionScene/QuestionScene.d.ts.map +1 -1
  40. package/dist/components/MathCardV2/scenes/SuccessScene/SuccessScene.d.ts.map +1 -1
  41. package/dist/components/OptionGroup/OptionCard.d.ts +11 -0
  42. package/dist/components/OptionGroup/OptionCard.d.ts.map +1 -0
  43. package/dist/components/OptionGroup/OptionCard.styles.d.ts +87 -0
  44. package/dist/components/OptionGroup/OptionCard.styles.d.ts.map +1 -0
  45. package/dist/components/OptionGroup/OptionGroup.d.ts +11 -0
  46. package/dist/components/OptionGroup/OptionGroup.d.ts.map +1 -0
  47. package/dist/components/OptionGroup/OptionGroup.types.d.ts +71 -0
  48. package/dist/components/OptionGroup/OptionGroup.types.d.ts.map +1 -0
  49. package/dist/components/OptionGroup/index.d.ts +5 -0
  50. package/dist/components/OptionGroup/index.d.ts.map +1 -0
  51. package/dist/components/StatBlock/StatBlock.css +331 -0
  52. package/dist/components/StatBlock/StatBlock.d.ts +7 -0
  53. package/dist/components/StatBlock/StatBlock.d.ts.map +1 -0
  54. package/dist/components/StatBlock/index.d.ts +5 -0
  55. package/dist/components/StatBlock/index.d.ts.map +1 -0
  56. package/dist/components/StatBlock/types.d.ts +116 -0
  57. package/dist/components/StatBlock/types.d.ts.map +1 -0
  58. package/dist/components/Table/Table.d.ts +14 -0
  59. package/dist/components/Table/Table.d.ts.map +1 -0
  60. package/dist/components/Table/hooks/useTableCore.d.ts +13 -0
  61. package/dist/components/Table/hooks/useTableCore.d.ts.map +1 -0
  62. package/dist/components/Table/hooks/useTableState.d.ts +10 -0
  63. package/dist/components/Table/hooks/useTableState.d.ts.map +1 -0
  64. package/dist/components/Table/index.d.ts +7 -0
  65. package/dist/components/Table/index.d.ts.map +1 -0
  66. package/dist/components/Table/types.d.ts +179 -0
  67. package/dist/components/Table/types.d.ts.map +1 -0
  68. package/dist/components/Table/utils/flattenData.d.ts +15 -0
  69. package/dist/components/Table/utils/flattenData.d.ts.map +1 -0
  70. package/dist/components/Table/utils/mergeClass.d.ts +6 -0
  71. package/dist/components/Table/utils/mergeClass.d.ts.map +1 -0
  72. package/dist/data/GeometryProblemAdapterV4/geometry-types.d.ts +119 -4
  73. package/dist/data/GeometryProblemAdapterV4/geometry-types.d.ts.map +1 -1
  74. package/dist/data/GeometryProblemAdapterV4/jsondata/parallelogram-revised.json +721 -721
  75. package/dist/data/GeometryProblemAdapterV4/jsondata/right-triangle-v4.json +595 -0
  76. package/dist/data/GeometryProblemAdapterV4/jsondata/trapezoid-v4-final.json +469 -469
  77. package/dist/data/GeometryProblemAdapterV4/jsondata/triangle-v4-final.json +3 -3
  78. package/dist/data/GeometryProblemAdapterV4/types.d.ts +2 -0
  79. package/dist/data/GeometryProblemAdapterV4/types.d.ts.map +1 -1
  80. package/dist/data/TriangleAdapterV3/config/embeddedConfigs.d.ts +96 -18
  81. package/dist/data/TriangleAdapterV3/config/embeddedConfigs.d.ts.map +1 -1
  82. package/dist/data/TriangleAdapterV3/config/index.d.ts +64 -12
  83. package/dist/data/TriangleAdapterV3/config/index.d.ts.map +1 -1
  84. package/dist/data/TriangleAdapterV3/core/syncAdapter.d.ts +5 -0
  85. package/dist/data/TriangleAdapterV3/core/syncAdapter.d.ts.map +1 -1
  86. package/dist/data/TriangleAdapterV3/resolvers/transformRefResolver.d.ts +4 -0
  87. package/dist/data/TriangleAdapterV3/resolvers/transformRefResolver.d.ts.map +1 -1
  88. package/dist/data/TriangleAdapterV3/transformers/geometryTransformTransformer.d.ts.map +1 -1
  89. package/dist/data/TriangleAdapterV3/transformers/hundredChartTransformer.d.ts +58 -0
  90. package/dist/data/TriangleAdapterV3/transformers/hundredChartTransformer.d.ts.map +1 -0
  91. package/dist/data/TriangleAdapterV3/transformers/index.d.ts +2 -0
  92. package/dist/data/TriangleAdapterV3/transformers/index.d.ts.map +1 -1
  93. package/dist/data/TriangleAdapterV3/transformers/optionGroupTransformer.d.ts +29 -0
  94. package/dist/data/TriangleAdapterV3/transformers/optionGroupTransformer.d.ts.map +1 -0
  95. package/dist/data/TriangleAdapterV3/types.d.ts +3 -0
  96. package/dist/data/TriangleAdapterV3/types.d.ts.map +1 -1
  97. package/dist/data/config/style-presets.json +27 -3
  98. package/dist/data/dataSchema/OpenAPI/openapi.json +5777 -5777
  99. package/dist/data/problems/factorProblemV4-backup.json +427 -0
  100. package/dist/data/problems/factorProblemV4.json +462 -0
  101. package/dist/data/problems/factorProblemV4_backup_20260311.json +436 -0
  102. package/dist/index.cjs +103 -100
  103. package/dist/index.cjs.map +1 -1
  104. package/dist/index.d.ts +8 -2
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.mjs +12144 -6014
  107. package/dist/index.mjs.map +1 -1
  108. package/dist/mathwiz-ui.css +1 -1
  109. package/dist/pages/AreaGeometrySessionPage/AreaGeometrySessionPageIXL.css +385 -0
  110. package/dist/pages/AreaGeometrySessionPage/AreaGeometrySessionPageIXL.d.ts +29 -0
  111. package/dist/pages/AreaGeometrySessionPage/AreaGeometrySessionPageIXL.d.ts.map +1 -0
  112. package/dist/pages/AreaGeometrySessionPage/components/LearningDashboardPlaceholder.css +219 -0
  113. package/dist/pages/AreaGeometrySessionPage/components/LearningDashboardPlaceholder.d.ts +15 -0
  114. package/dist/pages/AreaGeometrySessionPage/components/LearningDashboardPlaceholder.d.ts.map +1 -0
  115. package/dist/pages/AreaGeometrySessionPage/components/ReviewSectionPlaceholder.css +64 -0
  116. package/dist/pages/AreaGeometrySessionPage/components/ReviewSectionPlaceholder.d.ts +11 -0
  117. package/dist/pages/AreaGeometrySessionPage/components/ReviewSectionPlaceholder.d.ts.map +1 -0
  118. package/dist/pages/AreaGeometrySessionPage/components/ScaffoldingPlaceholder.css +59 -0
  119. package/dist/pages/AreaGeometrySessionPage/components/ScaffoldingPlaceholder.d.ts +14 -0
  120. package/dist/pages/AreaGeometrySessionPage/components/ScaffoldingPlaceholder.d.ts.map +1 -0
  121. package/dist/pages/AreaGeometrySessionPage/index.d.ts +3 -1
  122. package/dist/pages/AreaGeometrySessionPage/index.d.ts.map +1 -1
  123. package/dist/pages/AreaGeometrySessionPage/types.d.ts +25 -0
  124. package/dist/pages/AreaGeometrySessionPage/types.d.ts.map +1 -1
  125. package/dist/pages/GradeUnitBrowserPage/GradeUnitBrowserPage.d.ts.map +1 -1
  126. package/dist/pages/MathSessionPage/MathSessionPage.d.ts.map +1 -1
  127. package/dist/style.css +1 -1
  128. package/dist/styles/index.css +34 -0
  129. package/dist/styles/mathcard-tokens.css +47 -5
  130. package/package.json +5 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionGroup.types.d.ts","sourceRoot":"","sources":["../../../src/components/OptionGroup/OptionGroup.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;CACtD;AAED;;GA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AAC;IACnC,WAAW;IACX,OAAO,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IAC5B,YAAY;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY;IACZ,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B"}
@@ -0,0 +1,5 @@
1
+ export { OptionCard } from './OptionCard';
2
+ export { OptionGroup } from './OptionGroup';
3
+ export type { OptionAnswerItem, OptionItem, OptionCardProps, OptionGroupProps, } from './OptionGroup.types';
4
+ export { optionCardStyles, optionGroupStyles } from './OptionCard.styles';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/OptionGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,331 @@
1
+ /*
2
+ * StatBlock 组件样式文件
3
+ * 注意:组件不内置样式体系,业务项目控制实际样式
4
+ * 以下提供CSS变量定义和类名结构,以及可选的默认主题示例
5
+ * 业务项目可以完全覆盖这些变量或使用默认主题
6
+ */
7
+
8
+ /* ========================
9
+ * CSS 变量定义(设计令牌)- 核心主题化变量
10
+ * ======================== */
11
+
12
+ .mathwiz-statblock {
13
+ /* 主题色控制 - 通过行内样式覆盖实现主题切换 */
14
+ --statblock-current-theme-color: var(--mathwiz-statblock-theme-green, #90c842);
15
+
16
+ /* 背景与容器 */
17
+ --statblock-bg: var(--mathwiz-statblock-bg-base, #f4f4f4);
18
+ --statblock-header-bg: var(--statblock-current-theme-color);
19
+ --statblock-border: var(--mathwiz-statblock-border-light, #e6e6e6);
20
+ --statblock-shadow: none;
21
+
22
+ /* 文本颜色 */
23
+ --statblock-text-inverse: var(--mathwiz-statblock-text-inverse, #ffffff);
24
+ --statblock-text-main: var(--mathwiz-statblock-text-main, #737068);
25
+ --statblock-text-muted: var(--mathwiz-statblock-text-muted, #c1c1c1);
26
+ --statblock-label: var(--statblock-text-inverse);
27
+ --statblock-value: var(--statblock-text-main);
28
+ --statblock-unit: var(--statblock-text-muted);
29
+
30
+ /* 排版 */
31
+ --statblock-font-family-header: var(--mathwiz-statblock-font-family-header, 'Zilla Slab', serif);
32
+ --statblock-font-family-number: var(--mathwiz-statblock-font-family-number, 'Open Sans', sans-serif);
33
+ --statblock-font-size-title-main: var(--mathwiz-statblock-font-size-title-main, 18px);
34
+ --statblock-font-size-title-sub: var(--mathwiz-statblock-font-size-title-sub, 14px);
35
+ --statblock-font-size-value-large: var(--mathwiz-statblock-font-size-value-large, 48px);
36
+ --statblock-font-size-time-value: var(--mathwiz-statblock-font-size-time-value, 16px);
37
+ --statblock-font-size-time-label: var(--mathwiz-statblock-font-size-time-label, 11px);
38
+
39
+ /* 尺寸与间距 */
40
+ --statblock-sidebar-width: var(--mathwiz-statblock-sidebar-width, 140px);
41
+ --statblock-spacing-xs: var(--mathwiz-statblock-spacing-xs, 4px);
42
+ --statblock-spacing-sm: var(--mathwiz-statblock-spacing-sm, 8px);
43
+ --statblock-spacing-md: var(--mathwiz-statblock-spacing-md, 16px);
44
+ --statblock-spacing-lg: var(--mathwiz-statblock-spacing-lg, 24px);
45
+ --statblock-spacing-xl: var(--mathwiz-statblock-spacing-xl, 32px);
46
+ --statblock-padding: var(--statblock-spacing-sm) var(--statblock-spacing-xs);
47
+ --statblock-gap: var(--statblock-spacing-md);
48
+ --statblock-icon-gap: var(--statblock-spacing-sm);
49
+
50
+ /* 圆角 */
51
+ --statblock-radius: 0;
52
+
53
+ /* 交互状态 */
54
+ --statblock-hover-bg: rgba(255, 255, 255, 0.1);
55
+ --statblock-active-bg: rgba(255, 255, 255, 0.2);
56
+ --statblock-focus-ring: #3b82f6;
57
+
58
+ /* 时间显示专用 */
59
+ --statblock-time-bg: var(--mathwiz-statblock-bg-white, #ffffff);
60
+ --statblock-time-border: var(--statblock-border);
61
+ --statblock-time-value-color: var(--mathwiz-statblock-theme-blue, #4cb2d4);
62
+ }
63
+
64
+ /* ========================
65
+ * 预定义主题色变量 - 业务项目可覆盖
66
+ * ======================== */
67
+
68
+ :root {
69
+ /* 主题色系 - 用于StatBlock头部背景 */
70
+ --mathwiz-statblock-theme-green: #90c842;
71
+ --mathwiz-statblock-theme-blue: #4cb2d4;
72
+ --mathwiz-statblock-theme-orange: #d96338;
73
+
74
+ /* 基础色系 */
75
+ --mathwiz-statblock-bg-base: #f4f4f4;
76
+ --mathwiz-statblock-bg-white: #ffffff;
77
+ --mathwiz-statblock-text-inverse: #ffffff;
78
+ --mathwiz-statblock-text-main: #737068;
79
+ --mathwiz-statblock-text-muted: #c1c1c1;
80
+ --mathwiz-statblock-border-light: #e6e6e6;
81
+
82
+ /* 字体排版 */
83
+ --mathwiz-statblock-font-family-header: 'Zilla Slab', serif;
84
+ --mathwiz-statblock-font-family-number: 'Open Sans', sans-serif;
85
+ --mathwiz-statblock-font-size-title-main: 18px;
86
+ --mathwiz-statblock-font-size-title-sub: 14px;
87
+ --mathwiz-statblock-font-size-value-large: 48px;
88
+ --mathwiz-statblock-font-size-time-value: 16px;
89
+ --mathwiz-statblock-font-size-time-label: 11px;
90
+
91
+ /* 尺寸与间距 */
92
+ --mathwiz-statblock-sidebar-width: 140px;
93
+ --mathwiz-statblock-spacing-xs: 4px;
94
+ --mathwiz-statblock-spacing-sm: 8px;
95
+ --mathwiz-statblock-spacing-md: 16px;
96
+ --mathwiz-statblock-spacing-lg: 24px;
97
+ --mathwiz-statblock-spacing-xl: 32px;
98
+ }
99
+
100
+ /* ========================
101
+ * 默认样式实现 - 可选的完整样式示例
102
+ * 业务项目可以选择使用这些样式,或完全覆盖
103
+ * ======================== */
104
+
105
+ /* 根容器 - 基于demo.html的stat-block设计 */
106
+ .mathwiz-statblock {
107
+ width: var(--statblock-sidebar-width);
108
+ display: flex;
109
+ flex-direction: column;
110
+ background-color: var(--statblock-bg);
111
+ position: relative;
112
+ box-sizing: border-box;
113
+ }
114
+
115
+ /* 头部容器 - 主题色背景 */
116
+ .mathwiz-statblock-header {
117
+ background-color: var(--statblock-header-bg);
118
+ padding: var(--statblock-padding);
119
+ text-align: center;
120
+ color: var(--statblock-label);
121
+ font-family: var(--statblock-font-family-header);
122
+ display: flex;
123
+ flex-direction: column;
124
+ justify-content: center;
125
+ min-height: 60px;
126
+ }
127
+
128
+ /* 头部标题文本 */
129
+ .mathwiz-statblock-title {
130
+ font-size: var(--statblock-font-size-title-main);
131
+ font-weight: 700;
132
+ line-height: 1.1;
133
+ }
134
+
135
+ .mathwiz-statblock-subtitle {
136
+ font-size: var(--statblock-font-size-title-sub);
137
+ font-weight: 600;
138
+ margin-top: 2px;
139
+ display: flex;
140
+ align-items: center;
141
+ justify-content: center;
142
+ gap: 4px;
143
+ }
144
+
145
+ /* 帮助图标 */
146
+ .mathwiz-statblock-help-icon {
147
+ display: inline-flex;
148
+ align-items: center;
149
+ justify-content: center;
150
+ width: 14px;
151
+ height: 14px;
152
+ background-color: var(--statblock-text-inverse);
153
+ color: var(--statblock-current-theme-color);
154
+ border-radius: 50%;
155
+ font-family: var(--statblock-font-family-number);
156
+ font-size: 10px;
157
+ font-weight: bold;
158
+ cursor: help;
159
+ }
160
+
161
+ /* 主体容器 */
162
+ .mathwiz-statblock-body {
163
+ padding: var(--statblock-spacing-xl) 0;
164
+ display: flex;
165
+ justify-content: center;
166
+ align-items: center;
167
+ min-height: 100px;
168
+ }
169
+
170
+ /* 单一巨大数字样式 */
171
+ .mathwiz-statblock-value-large {
172
+ font-family: var(--statblock-font-family-number);
173
+ font-size: var(--statblock-font-size-value-large);
174
+ font-weight: 700;
175
+ color: var(--statblock-value);
176
+ line-height: 1;
177
+ }
178
+
179
+ /* ========================
180
+ * 时间显示子组件样式
181
+ * 当contentType为'time'时使用
182
+ * ======================== */
183
+
184
+ .mathwiz-statblock-time-display {
185
+ display: flex;
186
+ gap: var(--statblock-spacing-xs);
187
+ padding: 0 var(--statblock-spacing-xs);
188
+ }
189
+
190
+ .mathwiz-statblock-time-unit {
191
+ display: flex;
192
+ flex-direction: column;
193
+ align-items: center;
194
+ gap: 2px;
195
+ }
196
+
197
+ .mathwiz-statblock-time-unit-box {
198
+ background: var(--statblock-time-bg);
199
+ border: 1px solid var(--statblock-time-border);
200
+ width: 38px;
201
+ height: 38px;
202
+ display: flex;
203
+ justify-content: center;
204
+ align-items: center;
205
+ font-family: var(--statblock-font-family-number);
206
+ font-size: var(--statblock-font-size-time-value);
207
+ color: var(--statblock-time-value-color);
208
+ font-weight: 700;
209
+ }
210
+
211
+ .mathwiz-statblock-time-unit-label {
212
+ font-family: var(--statblock-font-family-header);
213
+ font-size: var(--statblock-font-size-time-label);
214
+ color: var(--statblock-text-muted);
215
+ font-weight: 700;
216
+ }
217
+
218
+ /* ========================
219
+ * 容器复合组件 - ProgressPanel
220
+ * 用于容纳多个StatBlock无缝垂直拼合
221
+ * ======================== */
222
+
223
+ .mathwiz-statblock-progress-panel {
224
+ display: flex;
225
+ flex-direction: column;
226
+ }
227
+
228
+ /* 给除了最后的子元素加一条微妙的分割线 */
229
+ .mathwiz-statblock-progress-panel .mathwiz-statblock + .mathwiz-statblock .mathwiz-statblock-header {
230
+ border-top: 1px solid rgba(255, 255, 255, 0.2);
231
+ }
232
+
233
+ /* ========================
234
+ * 交互模式样式
235
+ * ======================== */
236
+
237
+ .mathwiz-statblock-interactive {
238
+ cursor: pointer;
239
+ user-select: none;
240
+ }
241
+
242
+ .mathwiz-statblock-interactive:hover .mathwiz-statblock-header {
243
+ background-color: color-mix(in srgb, var(--statblock-header-bg) 90%, black);
244
+ }
245
+
246
+ .mathwiz-statblock-interactive:active .mathwiz-statblock-header {
247
+ background-color: color-mix(in srgb, var(--statblock-header-bg) 80%, black);
248
+ }
249
+
250
+ .mathwiz-statblock-interactive:focus-visible {
251
+ outline: 2px solid var(--statblock-focus-ring);
252
+ outline-offset: 2px;
253
+ }
254
+
255
+ /* ========================
256
+ * 响应式设计
257
+ * ======================== */
258
+
259
+ @media (max-width: 768px) {
260
+ .mathwiz-statblock {
261
+ width: 100%;
262
+ max-width: var(--statblock-sidebar-width);
263
+ }
264
+
265
+ .mathwiz-statblock-title {
266
+ font-size: calc(var(--statblock-font-size-title-main) * 0.9);
267
+ }
268
+
269
+ .mathwiz-statblock-value-large {
270
+ font-size: calc(var(--statblock-font-size-value-large) * 0.8);
271
+ }
272
+ }
273
+
274
+ /* ========================
275
+ * 向后兼容层 - 保留旧的类名结构供现有代码使用
276
+ * ======================== */
277
+
278
+ /* 旧版类名兼容 */
279
+ .mathwiz-statblock-content {
280
+ composes: mathwiz-statblock-body;
281
+ }
282
+
283
+ .mathwiz-statblock-text {
284
+ display: flex;
285
+ flex-direction: column;
286
+ flex: 1;
287
+ }
288
+
289
+ .mathwiz-statblock-label {
290
+ composes: mathwiz-statblock-title;
291
+ }
292
+
293
+ .mathwiz-statblock-value-container {
294
+ display: flex;
295
+ align-items: baseline;
296
+ gap: 0.25em;
297
+ }
298
+
299
+ .mathwiz-statblock-value {
300
+ composes: mathwiz-statblock-value-large;
301
+ }
302
+
303
+ .mathwiz-statblock-unit {
304
+ font-size: var(--statblock-font-size-title-sub);
305
+ color: var(--statblock-unit);
306
+ }
307
+
308
+ /* 图标位置容器 - 旧版兼容 */
309
+ .mathwiz-statblock-icon-top {
310
+ display: flex;
311
+ justify-content: center;
312
+ margin-bottom: var(--statblock-icon-gap, 0.5rem);
313
+ }
314
+
315
+ .mathwiz-statblock-icon-left {
316
+ display: flex;
317
+ align-items: center;
318
+ margin-right: var(--statblock-icon-gap, 0.75rem);
319
+ }
320
+
321
+ .mathwiz-statblock-icon-right {
322
+ display: flex;
323
+ align-items: center;
324
+ margin-left: var(--statblock-icon-gap, 0.75rem);
325
+ }
326
+
327
+ .mathwiz-statblock-icon-bottom {
328
+ display: flex;
329
+ justify-content: center;
330
+ margin-top: var(--statblock-icon-gap, 0.5rem);
331
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './StatBlock.css';
3
+ import type { StatBlockProps } from './types';
4
+ export declare const StatBlock: React.FC<StatBlockProps>;
5
+ declare const _default: React.NamedExoticComponent<StatBlockProps>;
6
+ export default _default;
7
+ //# sourceMappingURL=StatBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatBlock.d.ts","sourceRoot":"","sources":["../../../src/components/StatBlock/StatBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,cAAc,EAA0B,MAAM,SAAS,CAAC;AAGtE,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA0K9C,CAAC;;AAGF,wBAAqC"}
@@ -0,0 +1,5 @@
1
+ export { StatBlock } from './StatBlock';
2
+ export type { StatBlockProps, RenderProps, TimeValue } from './types';
3
+ export { IconPosition, ContentType, StatBlockDefaults } from './types';
4
+ export type { IconPositionType, ContentTypeType } from './types';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StatBlock/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,116 @@
1
+ import { ReactNode, CSSProperties } from 'react';
2
+ /**
3
+ * 图标位置常量定义
4
+ * 符合 erasableSyntaxOnly 约束,不使用 enum
5
+ */
6
+ export declare const IconPosition: {
7
+ readonly LEFT: "left";
8
+ readonly RIGHT: "right";
9
+ readonly TOP: "top";
10
+ readonly BOTTOM: "bottom";
11
+ };
12
+ export type IconPositionType = typeof IconPosition[keyof typeof IconPosition];
13
+ /**
14
+ * 内容类型常量定义
15
+ * 支持不同的内容展示模式
16
+ */
17
+ export declare const ContentType: {
18
+ readonly NUMBER: "number";
19
+ readonly TIME: "time";
20
+ readonly CUSTOM: "custom";
21
+ };
22
+ export type ContentTypeType = typeof ContentType[keyof typeof ContentType];
23
+ /**
24
+ * 时间值对象接口
25
+ * 用于时间显示模式
26
+ */
27
+ export interface TimeValue {
28
+ hours: number;
29
+ minutes: number;
30
+ seconds: number;
31
+ }
32
+ /**
33
+ * 渲染函数接收的参数接口
34
+ */
35
+ export interface RenderProps {
36
+ /** 组件标签 */
37
+ label: ReactNode;
38
+ /** 主数值 */
39
+ value: ReactNode;
40
+ /** 单位 */
41
+ unit?: ReactNode;
42
+ /** 图标 */
43
+ icon?: ReactNode;
44
+ /** 图标位置 */
45
+ iconPosition: IconPositionType;
46
+ /** 背景颜色 */
47
+ color?: string;
48
+ /** 是否可交互 */
49
+ interactive: boolean;
50
+ /** 自定义类名 */
51
+ className?: string;
52
+ /** 自定义样式 */
53
+ style?: CSSProperties;
54
+ /** 副标题(可选) */
55
+ subtitle?: ReactNode;
56
+ /** 是否显示帮助图标 */
57
+ showHelpIcon?: boolean;
58
+ /** 内容类型 */
59
+ contentType?: ContentTypeType;
60
+ /** 时间值(当contentType为'time'时使用) */
61
+ timeValue?: TimeValue;
62
+ }
63
+ /**
64
+ * StatBlock 组件属性接口
65
+ */
66
+ export interface StatBlockProps {
67
+ /** 标签/标题文本 */
68
+ label: ReactNode;
69
+ /** 主数值内容 */
70
+ value: ReactNode;
71
+ /** 单位文本(可选) */
72
+ unit?: ReactNode;
73
+ /** 背景颜色(支持CSS颜色值、Tailwind类名) */
74
+ color?: string;
75
+ /** 图标组件(React节点) */
76
+ icon?: ReactNode;
77
+ /** 图标位置(默认左侧) */
78
+ iconPosition?: IconPositionType;
79
+ /** 自定义渲染函数,传入渲染参数返回自定义UI */
80
+ render?: (props: RenderProps) => ReactNode;
81
+ /** 点击事件处理器 */
82
+ onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
83
+ /** 自定义CSS类名 */
84
+ className?: string;
85
+ /** 自定义内联样式 */
86
+ style?: CSSProperties;
87
+ /** 是否启用点击交互(显示为可点击样式) */
88
+ interactive?: boolean;
89
+ /** ARIA标签(无障碍访问) */
90
+ 'aria-label'?: string;
91
+ /** ARIA角色 */
92
+ 'aria-role'?: string;
93
+ /** 测试标识符 */
94
+ 'data-testid'?: string;
95
+ /** 副标题(可选) */
96
+ subtitle?: ReactNode;
97
+ /** 是否显示帮助图标 */
98
+ showHelpIcon?: boolean;
99
+ /** 帮助图标提示文本 */
100
+ helpIconTitle?: string;
101
+ /** 内容类型 */
102
+ contentType?: ContentTypeType;
103
+ /** 时间值(当contentType为'time'时使用) */
104
+ timeValue?: TimeValue;
105
+ /** 主题色CSS变量名(如:--mathwiz-statblock-theme-blue) */
106
+ themeColorVar?: string;
107
+ }
108
+ /**
109
+ * 组件默认配置
110
+ */
111
+ export declare const StatBlockDefaults: {
112
+ readonly iconPosition: "left";
113
+ readonly interactive: false;
114
+ readonly contentType: "number";
115
+ };
116
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/StatBlock/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE9E;;;GAGG;AACH,eA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C,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,SAAS,CAAC;IAC3C,cAAc;IACd,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC5D,eAAe;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc;IACd,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,yBAAyB;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oBAAoB;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,eAAe;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW;IACX,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,kCAAkC;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;CAIpB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { TableProps } from './types';
3
+ /**
4
+ * Table 主组件
5
+ * 采用"数据遍历 + 渲染委托"模式
6
+ *
7
+ * @template T - 行数据类型
8
+ * @param props - TableProps<T>
9
+ * @returns React.ReactElement
10
+ */
11
+ export declare function Table<T>({ data, renderGroupHeader, renderCategoryHeader, renderRow, renderCell, onCellClick, onRowClick, columns, enableTanStack, className, getRowKey, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, }: TableProps<T>): React.ReactElement;
12
+ declare const _default: typeof Table;
13
+ export default _default;
14
+ //# sourceMappingURL=Table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EACV,UAAU,EAIX,MAAM,SAAS,CAAC;AAGjB;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,EACvB,IAAI,EACJ,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,WAAW,EACX,UAAU,EACV,OAAO,EACP,cAAsB,EACtB,SAAS,EACT,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,GAClC,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAgJpC;wBAG6B,OAAO,KAAK;AAA1C,wBAA2C"}
@@ -0,0 +1,13 @@
1
+ import type { ColumnDef } from '../types';
2
+ interface UseTableCoreOptions<T> {
3
+ data: T[];
4
+ columns?: ColumnDef<T>[];
5
+ enabled?: boolean;
6
+ }
7
+ /**
8
+ * TanStack Table 核心集成 Hook
9
+ * 提供排序、分页、过滤等数据处理能力
10
+ */
11
+ export declare function useTableCore<T>({ data, columns, enabled }: UseTableCoreOptions<T>): import("@tanstack/table-core").Table<T> | null;
12
+ export {};
13
+ //# sourceMappingURL=useTableCore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableCore.d.ts","sourceRoot":"","sources":["../../../../src/components/Table/hooks/useTableCore.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,UAAU,mBAAmB,CAAC,CAAC;IAC7B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAe,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,kDAezF"}
@@ -0,0 +1,10 @@
1
+ import type { TableState, TableStateActions, TableGroup } from '../types';
2
+ /**
3
+ * 表格状态管理 Hook
4
+ * 管理分组/分类的展开收起状态
5
+ */
6
+ export declare function useTableState<T>(data: TableGroup<T>[]): {
7
+ state: TableState;
8
+ actions: TableStateActions;
9
+ };
10
+ //# sourceMappingURL=useTableState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableState.d.ts","sourceRoot":"","sources":["../../../../src/components/Table/hooks/useTableState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE1E;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE;;;EAkGrD"}
@@ -0,0 +1,7 @@
1
+ export { Table } from './Table';
2
+ export { useTableState } from './hooks/useTableState';
3
+ export { useTableCore } from './hooks/useTableCore';
4
+ export { flattenData, getTotalRowCount, findGroupByCategory } from './utils/flattenData';
5
+ export { mergeClass } from './utils/mergeClass';
6
+ export type { TableProps, TableGroup, TableCategory, RowContext, TableState, TableStateActions, ColumnDef, RowKeyGenerator, HeaderRenderContext, TableGroupHeaderProps, TableCategoryHeaderProps, } from './types';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,YAAY,EACV,UAAU,EACV,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,SAAS,CAAC"}