musae 1.2.0 → 1.3.1-beta.1

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 (96) hide show
  1. package/dist/components/card/actions.cjs +31 -0
  2. package/dist/components/card/actions.d.ts +31 -0
  3. package/dist/components/card/actions.mjs +27 -0
  4. package/dist/components/card/body.cjs +30 -0
  5. package/dist/components/card/body.d.ts +18 -0
  6. package/dist/components/card/body.mjs +26 -0
  7. package/dist/components/card/card.cjs +76 -140
  8. package/dist/components/card/card.d.ts +23 -150
  9. package/dist/components/card/card.mjs +67 -135
  10. package/dist/components/card/content.cjs +33 -0
  11. package/dist/components/card/content.d.ts +33 -0
  12. package/dist/components/card/content.mjs +29 -0
  13. package/dist/components/card/context.cjs +14 -1
  14. package/dist/components/card/context.d.ts +15 -1
  15. package/dist/components/card/context.mjs +13 -2
  16. package/dist/components/card/header.cjs +79 -0
  17. package/dist/components/card/header.d.ts +58 -0
  18. package/dist/components/card/header.mjs +75 -0
  19. package/dist/components/card/headline.cjs +30 -0
  20. package/dist/components/card/headline.d.ts +18 -0
  21. package/dist/components/card/headline.mjs +26 -0
  22. package/dist/components/card/index.d.ts +1 -1
  23. package/dist/components/card/media.cjs +50 -0
  24. package/dist/components/card/media.d.ts +42 -0
  25. package/dist/components/card/media.mjs +46 -0
  26. package/dist/components/card/styles.cjs +133 -14
  27. package/dist/components/card/styles.d.ts +88 -28
  28. package/dist/components/card/styles.mjs +133 -14
  29. package/dist/components/card/subhead.cjs +30 -0
  30. package/dist/components/card/subhead.d.ts +18 -0
  31. package/dist/components/card/subhead.mjs +26 -0
  32. package/dist/components/card/title.cjs +30 -0
  33. package/dist/components/card/title.d.ts +18 -0
  34. package/dist/components/card/title.mjs +26 -0
  35. package/dist/components/search/search.cjs +3 -1
  36. package/dist/components/search/search.d.ts +1 -0
  37. package/dist/components/search/search.mjs +3 -1
  38. package/dist/components/sheet/sheet.cjs +13 -3
  39. package/dist/components/sheet/sheet.d.ts +1 -1
  40. package/dist/components/sheet/sheet.mjs +13 -3
  41. package/dist/components/side-sheet/__test__/index.test.d.ts +1 -0
  42. package/dist/components/side-sheet/context.cjs +15 -0
  43. package/dist/components/side-sheet/context.d.ts +11 -0
  44. package/dist/components/side-sheet/context.mjs +13 -0
  45. package/dist/components/side-sheet/index.d.ts +2 -0
  46. package/dist/components/side-sheet/side-sheet.cjs +140 -0
  47. package/dist/components/side-sheet/side-sheet.d.ts +16 -0
  48. package/dist/components/side-sheet/side-sheet.mjs +136 -0
  49. package/dist/components/side-sheet/styles.cjs +106 -0
  50. package/dist/components/side-sheet/styles.d.ts +83 -0
  51. package/dist/components/side-sheet/styles.mjs +104 -0
  52. package/dist/components/theme/theme.cjs +31 -0
  53. package/dist/components/theme/theme.mjs +31 -1
  54. package/dist/components/theme/tokens.stylex.cjs +4 -1
  55. package/dist/components/theme/tokens.stylex.d.ts +16 -1
  56. package/dist/components/theme/tokens.stylex.mjs +4 -1
  57. package/dist/components/typography/body.cjs +31 -0
  58. package/dist/components/typography/body.d.ts +8 -0
  59. package/dist/components/typography/body.mjs +27 -0
  60. package/dist/components/typography/context.cjs +15 -0
  61. package/dist/components/typography/context.d.ts +11 -0
  62. package/dist/components/typography/context.mjs +13 -0
  63. package/dist/components/typography/display.cjs +31 -0
  64. package/dist/components/typography/display.d.ts +8 -0
  65. package/dist/components/typography/display.mjs +27 -0
  66. package/dist/components/typography/headline.cjs +31 -0
  67. package/dist/components/typography/headline.d.ts +8 -0
  68. package/dist/components/typography/headline.mjs +27 -0
  69. package/dist/components/typography/index.d.ts +2 -0
  70. package/dist/components/typography/label.cjs +31 -0
  71. package/dist/components/typography/label.d.ts +8 -0
  72. package/dist/components/typography/label.mjs +27 -0
  73. package/dist/components/typography/title.cjs +31 -0
  74. package/dist/components/typography/title.d.ts +8 -0
  75. package/dist/components/typography/title.mjs +27 -0
  76. package/dist/components/typography/typography.cjs +24 -0
  77. package/dist/components/typography/typography.d.ts +14 -0
  78. package/dist/components/typography/typography.mjs +15 -0
  79. package/dist/index.cjs +4 -2
  80. package/dist/index.d.ts +2 -1
  81. package/dist/index.mjs +2 -1
  82. package/dist/styles.css +118 -23
  83. package/dist/types/card.d.ts +39 -2
  84. package/dist/types/search.d.ts +6 -0
  85. package/dist/types/sheet.d.ts +6 -0
  86. package/dist/types/side-sheet.d.ts +90 -0
  87. package/dist/types/typography.d.ts +15 -0
  88. package/package.json +2 -4
  89. package/dist/components/drawer/context.cjs +0 -14
  90. package/dist/components/drawer/context.d.ts +0 -10
  91. package/dist/components/drawer/context.mjs +0 -12
  92. package/dist/components/drawer/drawer.cjs +0 -92
  93. package/dist/components/drawer/drawer.d.ts +0 -9
  94. package/dist/components/drawer/drawer.mjs +0 -88
  95. package/dist/components/drawer/index.d.ts +0 -2
  96. package/dist/types/drawer.d.ts +0 -74
package/dist/index.mjs CHANGED
@@ -26,7 +26,6 @@ export { default as DatePicker } from './components/date-picker/date-picker.mjs'
26
26
  export { default as DateRangePicker } from './components/date-range-picker/date-range-picker.mjs';
27
27
  export { default as Dialog } from './components/dialog/dialog.mjs';
28
28
  export { default as Divider } from './components/divider/divider.mjs';
29
- export { default as Drawer } from './components/drawer/drawer.mjs';
30
29
  export { default as Ellipsis } from './components/ellipsis/ellipsis.mjs';
31
30
  export { default as Empty } from './components/empty/empty.mjs';
32
31
  export { default as Fab } from './components/fab/fab.mjs';
@@ -50,6 +49,7 @@ export { default as Rate } from './components/rate/rate.mjs';
50
49
  export { default as Search } from './components/search/search.mjs';
51
50
  export { default as Select } from './components/select/select.mjs';
52
51
  export { default as SessionStorage } from './components/session-storage/session-storage.mjs';
52
+ export { default as SideSheet } from './components/side-sheet/side-sheet.mjs';
53
53
  export { default as Skeleton } from './components/skeleton/skeleton.mjs';
54
54
  export { default as Space } from './components/space/space.mjs';
55
55
  export { default as SplitPanel } from './components/split-panel/split-panel.mjs';
@@ -66,6 +66,7 @@ export { default as Tooltip } from './components/tooltip/tooltip.mjs';
66
66
  export { default as Tour } from './components/tour/tour.mjs';
67
67
  export { default as Transfer } from './components/transfer/transfer.mjs';
68
68
  export { default as Tree } from './components/tree/tree.mjs';
69
+ export { default as Typography } from './components/typography/typography.mjs';
69
70
  export { default as Upload } from './components/upload/upload.mjs';
70
71
  export { default as VisuallyHidden } from './components/visually-hidden/visually-hidden.mjs';
71
72
  export { default as Waterfall } from './components/waterfall/waterfall.mjs';
package/dist/styles.css CHANGED
@@ -235,6 +235,10 @@
235
235
  border-style: solid;
236
236
  }
237
237
 
238
+ .musaex-c342km {
239
+ border-width: 0;
240
+ }
241
+
238
242
  .musaex-1litavf {
239
243
  border-width: var(--border-width);
240
244
  }
@@ -251,6 +255,10 @@
251
255
  border-width: var(--musaex-mw242b);
252
256
  }
253
257
 
258
+ .musaex-3psx0u {
259
+ flex: none;
260
+ }
261
+
254
262
  .musaex-aovyj7 {
255
263
  flex: 0 0 var(--span);
256
264
  }
@@ -784,10 +792,26 @@
784
792
  box-shadow: var(--musaex-124bxhv);
785
793
  }
786
794
 
795
+ .musaex-1ltemje {
796
+ box-shadow: var(--musaex-14r7dmv);
797
+ }
798
+
787
799
  .musaex-bapks6 {
788
800
  box-shadow: var(--musaex-1ax77re);
789
801
  }
790
802
 
803
+ .musaex-vkh6yx {
804
+ box-shadow: var(--musaex-1bann2b);
805
+ }
806
+
807
+ .musaex-1tw10uf {
808
+ box-shadow: var(--musaex-1dem7f);
809
+ }
810
+
811
+ .musaex-15krw24 {
812
+ box-shadow: var(--musaex-1xue9qe);
813
+ }
814
+
791
815
  .musaex-9f619 {
792
816
  box-sizing: border-box;
793
817
  }
@@ -1372,6 +1396,10 @@
1372
1396
  padding-inline-end: var(--musaex-16072l3);
1373
1397
  }
1374
1398
 
1399
+ .musaex-1max5gj {
1400
+ padding-inline-end: var(--musaex-1vpnstl);
1401
+ }
1402
+
1375
1403
  .musaex-4qvwnj {
1376
1404
  padding-inline-start: calc(var(--musaex-16suft8) / 2 - var(--musaex-1035pbm));
1377
1405
  }
@@ -1380,10 +1408,18 @@
1380
1408
  padding-inline-start: calc(var(--musaex-qe7ci9) + var(--musaex-1035pbm) * 4);
1381
1409
  }
1382
1410
 
1411
+ .musaex-1ox7qdy {
1412
+ padding-inline-start: var(--musaex-14eq97i);
1413
+ }
1414
+
1383
1415
  .musaex-1rl4tsp {
1384
1416
  padding-inline-start: var(--musaex-16072l3);
1385
1417
  }
1386
1418
 
1419
+ .musaex-150i2hq {
1420
+ padding-inline-start: var(--musaex-1bvtfky);
1421
+ }
1422
+
1387
1423
  .musaex-1yyv1zj {
1388
1424
  padding-inline-start: var(--musaex-1vpnstl);
1389
1425
  }
@@ -1580,10 +1616,6 @@
1580
1616
  transition-property: background-color, border, color;
1581
1617
  }
1582
1618
 
1583
- .musaex-1ijdko7 {
1584
- transition-property: background-color, box-shadow, border-color;
1585
- }
1586
-
1587
1619
  .musaex-1yyhn7k {
1588
1620
  transition-property: background-color, color, box-shadow;
1589
1621
  }
@@ -1592,6 +1624,10 @@
1592
1624
  transition-property: background-color;
1593
1625
  }
1594
1626
 
1627
+ .musaex-f1bglv {
1628
+ transition-property: box-shadow, background-color, border-color;
1629
+ }
1630
+
1595
1631
  .musaex-15wldfd {
1596
1632
  transition-property: box-shadow, background-color;
1597
1633
  }
@@ -1881,6 +1917,26 @@
1881
1917
  border-bottom-width: var(--musaex-1xf102v);
1882
1918
  }
1883
1919
 
1920
+ .musaex-svd4c5 {
1921
+ border-left-color: var(--color-outline-variant);
1922
+ }
1923
+
1924
+ .musaex-19ypqd9 {
1925
+ border-left-style: solid;
1926
+ }
1927
+
1928
+ .musaex-6vwjc {
1929
+ border-left-width: var(--musaex-1xf102v);
1930
+ }
1931
+
1932
+ .musaex-imfbgf {
1933
+ border-right-color: var(--color-outline-variant);
1934
+ }
1935
+
1936
+ .musaex-32b0ac {
1937
+ border-right-style: solid;
1938
+ }
1939
+
1884
1940
  .musaex-a640vs {
1885
1941
  border-right-width: var(--musaex-1xf102v);
1886
1942
  }
@@ -1969,6 +2025,10 @@
1969
2025
  height: 24px;
1970
2026
  }
1971
2027
 
2028
+ .musaex-sdox4t {
2029
+ height: 48px;
2030
+ }
2031
+
1972
2032
  .musaex-t7dq6l {
1973
2033
  height: auto;
1974
2034
  }
@@ -2189,10 +2249,6 @@
2189
2249
  min-height: 0;
2190
2250
  }
2191
2251
 
2192
- .musaex-1qafhyn {
2193
- min-height: 72px;
2194
- }
2195
-
2196
2252
  .musaex-epu74c {
2197
2253
  min-height: var(--musaex-10wwlfh);
2198
2254
  }
@@ -2325,10 +2381,6 @@
2325
2381
  padding-right: var(--musaex-14eq97i);
2326
2382
  }
2327
2383
 
2328
- .musaex-15ebt9c {
2329
- padding-right: var(--musaex-16072l3);
2330
- }
2331
-
2332
2384
  .musaex-9y2cgd {
2333
2385
  padding-right: var(--musaex-1vpnstl);
2334
2386
  }
@@ -2349,6 +2401,10 @@
2349
2401
  padding-top: var(--musaex-1fxazvh);
2350
2402
  }
2351
2403
 
2404
+ .musaex-h1u3e4 {
2405
+ padding-top: var(--musaex-1vpnstl);
2406
+ }
2407
+
2352
2408
  .musaex-3nylsr {
2353
2409
  padding-top: var(--musaex-48i97p);
2354
2410
  }
@@ -2397,10 +2453,18 @@
2397
2453
  width: 24px;
2398
2454
  }
2399
2455
 
2456
+ .musaex-1useyqa {
2457
+ width: 48px;
2458
+ }
2459
+
2400
2460
  .musaex-14rvwrp {
2401
2461
  width: 600px;
2402
2462
  }
2403
2463
 
2464
+ .musaex-1dmp6jm {
2465
+ width: 80px;
2466
+ }
2467
+
2404
2468
  .musaex-o4cs04 {
2405
2469
  width: calc((100% - (var(--columns) - 1) * var(--column-gap)) / var(--columns));
2406
2470
  }
@@ -2553,6 +2617,32 @@
2553
2617
  border-bottom-width: 0;
2554
2618
  }
2555
2619
 
2620
+ @media (width <= 904px) {
2621
+ .musaex-1m33i82.musaex-1m33i82 {
2622
+ border-bottom-left-radius: 0;
2623
+ }
2624
+
2625
+ .musaex-1uogugb.musaex-1uogugb {
2626
+ border-bottom-right-radius: 0;
2627
+ }
2628
+
2629
+ .musaex-1se81xg.musaex-1se81xg {
2630
+ border-top-left-radius: 0;
2631
+ }
2632
+
2633
+ .musaex-19wv56r.musaex-19wv56r {
2634
+ border-top-right-radius: 0;
2635
+ }
2636
+
2637
+ .musaex-1pzvw0h.musaex-1pzvw0h {
2638
+ height: 100vh;
2639
+ }
2640
+
2641
+ .musaex-1ej3teu.musaex-1ej3teu {
2642
+ width: 100vw;
2643
+ }
2644
+ }
2645
+
2556
2646
  @media (hover: hover) {
2557
2647
  .musaex-1fjziz3.musaex-1fjziz3:hover {
2558
2648
  overflow-y: auto;
@@ -2629,8 +2719,8 @@
2629
2719
  animation-timing-function: linear;
2630
2720
  }
2631
2721
 
2632
- .musaex-yhc2n1:after {
2633
- background-color: #0000;
2722
+ .musaex-86grr:after {
2723
+ background-color: var(--card-state-layer, transparent);
2634
2724
  }
2635
2725
 
2636
2726
  .musaex-1l043wi:before {
@@ -3273,15 +3363,6 @@
3273
3363
  --musaex-1aqg0g1: 1s;
3274
3364
  }
3275
3365
 
3276
- :root, .musaex-gtkjbd {
3277
- --musaex-1ueuqz2: none;
3278
- --musaex-1ax77re: #0003 0px 2px 1px -1px, #00000024 0px 1px 1px 0px, #0000001f 0px 1px 3px 0px;
3279
- --musaex-124bxhv: #0003 0px 3px 3px -2px, #00000024 0px 3px 4px 0px, #0000001f 0px 1px 8px 0px;
3280
- --musaex-blb018: #0003 0px 3px 5px -1px, #00000024 0px 6px 10px 0px, #0000001f 0px 1px 18px 0px;
3281
- --musaex-j9kthj: #0003 0px 5px 5px -3px, #00000024 0px 8px 10px 1px, #0000001f 0px 3px 14px 2px;
3282
- --musaex-1h5b470: #0003 0px 7px 8px -4px, #00000024 0px 12px 17px 2px, #0000001f 0px 5px 22px 4px;
3283
- }
3284
-
3285
3366
  :root, .musaex-kg7w83 {
3286
3367
  --musaex-mw242b: 0px;
3287
3368
  --musaex-1xf102v: 1px;
@@ -3317,6 +3398,20 @@
3317
3398
  --musaex-eliz3k: fit-content;
3318
3399
  }
3319
3400
 
3401
+ :root, .musaex-gtkjbd {
3402
+ --musaex-t6xqpa: none;
3403
+ --musaex-1dem7f: 0px 1px 2px 0px #0000004d, 0px 1px 3px 1px #00000026;
3404
+ --musaex-1bann2b: 0px 1px 2px 0px #0000004d, 0px 2px 6px 2px #00000026;
3405
+ --musaex-1xue9qe: 0px 1px 3px 0px #0000004d, 0px 4px 8px 3px #00000026;
3406
+ --musaex-14r7dmv: 0px 2px 3px 0px #0000004d, 0px 6px 10px 4px #00000026;
3407
+ --musaex-1ueuqz2: none;
3408
+ --musaex-1ax77re: #0003 0px 2px 1px -1px, #00000024 0px 1px 1px 0px, #0000001f 0px 1px 3px 0px;
3409
+ --musaex-124bxhv: #0003 0px 3px 3px -2px, #00000024 0px 3px 4px 0px, #0000001f 0px 1px 8px 0px;
3410
+ --musaex-blb018: #0003 0px 3px 5px -1px, #00000024 0px 6px 10px 0px, #0000001f 0px 1px 18px 0px;
3411
+ --musaex-j9kthj: #0003 0px 5px 5px -3px, #00000024 0px 8px 10px 1px, #0000001f 0px 3px 14px 2px;
3412
+ --musaex-1h5b470: #0003 0px 7px 8px -4px, #00000024 0px 12px 17px 2px, #0000001f 0px 5px 22px 4px;
3413
+ }
3414
+
3320
3415
  .musaex-omsca5 {
3321
3416
  --border-width: var(--musaex-1035pbm);
3322
3417
  }
@@ -1,10 +1,19 @@
1
- import type { ReactNode, MouseEvent } from "react";
1
+ import type { ReactNode, MouseEvent, DragEvent } from "react";
2
2
  import type { ComponentProps } from "./element";
3
3
  /**
4
4
  * @zh 卡片样式变体
5
5
  * @en Card style variant
6
6
  */
7
7
  export type CardVariant = "outlined" | "elevated" | "filled";
8
+ /**
9
+ * @zh 卡片布局变体
10
+ * - `stacked`: 垂直堆叠(Header 在上,Media 在中,Content/Actions 在下)
11
+ * - `horizontal`: 水平排布(Header 在左,Media 在右,固定 80px 高)
12
+ * @en Card layout variant
13
+ * - `stacked`: vertical stack (Header on top, Media in middle, Content/Actions at bottom)
14
+ * - `horizontal`: horizontal layout (Header on left, Media on right, fixed 80px height)
15
+ */
16
+ export type CardLayout = "stacked" | "horizontal";
8
17
  /**
9
18
  * @zh 卡片组件属性
10
19
  * @en Card component props
@@ -16,13 +25,19 @@ export interface CardProps extends ComponentProps {
16
25
  * @default "outlined"
17
26
  */
18
27
  variant?: CardVariant;
28
+ /**
29
+ * @zh 卡片布局变体
30
+ * @en Card layout variant
31
+ * @default "stacked"
32
+ */
33
+ layout?: CardLayout;
19
34
  /**
20
35
  * @zh 卡片内容
21
36
  * @en Card content
22
37
  */
23
38
  children?: ReactNode;
24
39
  /**
25
- * @zh 点击事件处理函数,设置后卡片将展示交互状态层
40
+ * @zh 点击事件处理函数,设置后卡片将展示交互状态层
26
41
  * @en Click handler, when set the card will show interaction state layers
27
42
  */
28
43
  onClick?: (event: MouseEvent<HTMLDivElement>) => void;
@@ -32,4 +47,26 @@ export interface CardProps extends ComponentProps {
32
47
  * @default false
33
48
  */
34
49
  disabled?: boolean;
50
+ /**
51
+ * @zh 拖拽中状态(16% state layer + 提升 elevation),可通过 `draggable` 自动检测或手动控制
52
+ * @en Dragged state (16% state layer + raised elevation), can be auto-detected via `draggable` or controlled manually
53
+ * @default false
54
+ */
55
+ dragged?: boolean;
56
+ /**
57
+ * @zh 启用 HTML5 拖拽事件自动检测 dragged 状态。设置为 true 时,组件会监听 onDragStart/onDragEnd 自动切换 dragged。
58
+ * @en Enable HTML5 drag events to auto-detect dragged state. When true, the component listens to onDragStart/onDragEnd to toggle dragged.
59
+ * @default false
60
+ */
61
+ draggable?: boolean;
62
+ /**
63
+ * @zh 拖拽开始事件
64
+ * @en Drag start event handler
65
+ */
66
+ onDragStart?: (event: DragEvent<HTMLDivElement>) => void;
67
+ /**
68
+ * @zh 拖拽结束事件
69
+ * @en Drag end event handler
70
+ */
71
+ onDragEnd?: (event: DragEvent<HTMLDivElement>) => void;
35
72
  }
@@ -79,4 +79,10 @@ export type SearchProps = ComponentProps & {
79
79
  * @default undefined
80
80
  */
81
81
  onSearch?: (keyword?: string) => void;
82
+ /**
83
+ * @zh 点击清除按钮时的回调函数
84
+ * @en Callback when the clear button is clicked
85
+ * @default undefined
86
+ */
87
+ onClear?: () => void;
82
88
  };
@@ -72,4 +72,10 @@ export interface SheetProps extends ComponentProps {
72
72
  * @en Body content rendered below the header.
73
73
  */
74
74
  children?: ReactNode;
75
+ /**
76
+ * @zh 渲染在主体下方的底部内容。使用此插槽注入操作按钮栏或任意自定义底部。
77
+ * @en Content rendered below the body. Use this slot to inject an action bar
78
+ * or any custom footer.
79
+ */
80
+ footer?: ReactNode;
75
81
  }
@@ -0,0 +1,90 @@
1
+ import type { ReactNode } from "react";
2
+ import type { Closable } from "../hooks/use-closable";
3
+ import type { ComponentProps } from "./element";
4
+ /**
5
+ * @zh Side Sheet 类型。`standard` 内嵌在布局中展示(无遮罩层),`modal` 以带遮罩层的模态形式展示。
6
+ * @en Side sheet type. `standard` renders inline alongside layout content (no scrim);
7
+ * `modal` renders above content with a scrim.
8
+ */
9
+ export type SideSheetType = "standard" | "modal";
10
+ /**
11
+ * @zh Side Sheet 停靠方向。
12
+ * @en The edge the side sheet is anchored to.
13
+ */
14
+ export type SideSheetPlacement = "left" | "right" | "top" | "bottom";
15
+ /**
16
+ * @zh SideSheet 组件属性。
17
+ * @en Props for the SideSheet component.
18
+ */
19
+ export interface SideSheetProps extends ComponentProps {
20
+ /**
21
+ * @zh 是否打开。
22
+ * @en Whether the side sheet is open.
23
+ */
24
+ open: boolean;
25
+ /**
26
+ * @zh 类型。`standard` 与主内容并排展示,`modal` 覆盖在主内容之上并带有遮罩层。
27
+ * @en Type. `standard` sits alongside the main content;
28
+ * `modal` overlays the main content with a scrim.
29
+ * @default "modal"
30
+ */
31
+ type?: SideSheetType;
32
+ /**
33
+ * @zh 头部标题。
34
+ * @en Headline rendered in the header.
35
+ * @default void 0
36
+ */
37
+ title?: ReactNode;
38
+ /**
39
+ * @zh 返回回调。传入后头部展示返回按钮。
40
+ * @en Back handler. When provided, a back button is rendered in the header.
41
+ * @default void 0
42
+ */
43
+ onBack?: VoidFunction;
44
+ /**
45
+ * @zh 是否可关闭。控制关闭按钮的展示,以及是否可以通过点击遮罩层或按 Esc 键关闭(仅 `modal` 生效)。
46
+ * 传入 `Closable` 数组以启用特定的关闭触发器。
47
+ * @en Whether the side sheet is closable. Controls the close button, and whether it can be
48
+ * closed by clicking on the overlay or pressing the Esc key (`modal` only).
49
+ * Pass an array of `Closable` values to enable specific close triggers.
50
+ * @default true
51
+ */
52
+ closable?: boolean | Closable[];
53
+ /**
54
+ * @zh 确认回调。传入后头部展示确认按钮。
55
+ * @en Confirm handler. When provided, a confirm button is rendered in the header.
56
+ * @default void 0
57
+ */
58
+ onConfirm?: VoidFunction;
59
+ /**
60
+ * @zh 关闭回调。
61
+ * @en Called when the side sheet requests to close.
62
+ * @default void 0
63
+ */
64
+ onClose?: VoidFunction;
65
+ /**
66
+ * @zh 底部操作区内容。传入后在主体下方渲染分割线和操作按钮行。
67
+ * @en Footer actions. When provided, a divider and an actions row are rendered below the body.
68
+ * @default void 0
69
+ */
70
+ actions?: ReactNode;
71
+ /**
72
+ * @zh 面板宽度。接受数字(px)或任意 CSS 尺寸字符串。
73
+ * @en Panel width. Accepts a number (px) or any CSS dimension string.
74
+ * @default 400
75
+ */
76
+ size?: number | string;
77
+ /**
78
+ * @zh 停靠方向。`left` / `right` 水平滑入,`top` / `bottom` 垂直滑入。
79
+ * @en The edge the side sheet is anchored to.
80
+ * `left` / `right` slides horizontally, `top` / `bottom` slides vertically.
81
+ * @default "right"
82
+ */
83
+ placement?: SideSheetPlacement;
84
+ /**
85
+ * @zh 主体内容。
86
+ * @en Body content.
87
+ * @default void 0
88
+ */
89
+ children?: ReactNode;
90
+ }
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from "react";
2
+ import type { ComponentProps } from "./element";
3
+ export interface TypographyProps extends ComponentProps {
4
+ /**
5
+ * @zh 字体尺寸等级
6
+ * @en Font size level
7
+ * @default "medium"
8
+ */
9
+ size?: "large" | "medium" | "small";
10
+ /**
11
+ * @zh 文本内容
12
+ * @en Text content
13
+ */
14
+ children?: ReactNode;
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musae",
3
- "version": "1.2.0",
3
+ "version": "1.3.1-beta.1",
4
4
  "description": "musae-ui",
5
5
  "author": "tutu@fantufantu.com",
6
6
  "license": "MIT",
@@ -135,9 +135,7 @@
135
135
  "dev": "rollup -c -w --environment NODE_ENV:development",
136
136
  "build": "z rm dist && rollup -c --environment NODE_ENV:production",
137
137
  "authors": "zx scripts/contributors.mjs",
138
- "changesets": "z cs",
139
- "version": "z cs version",
140
- "storybook": "pnpm run build && storybook dev -p 6006",
138
+ "storybook": "pnpm run build && storybook dev",
141
139
  "build-storybook": "storybook build",
142
140
  "lint": "eslint ."
143
141
  }
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * @zh Drawer 的 class 名称
5
- * @en class names for Drawer
6
- */
7
- var CLASS_NAMES = {
8
- drawer: "drawer",
9
- header: "drawer__header",
10
- body: "drawer__body",
11
- actions: "drawer__actions"
12
- };
13
-
14
- exports.CLASS_NAMES = CLASS_NAMES;
@@ -1,10 +0,0 @@
1
- /**
2
- * @zh Drawer 的 class 名称
3
- * @en class names for Drawer
4
- */
5
- export declare const CLASS_NAMES: {
6
- readonly drawer: "drawer";
7
- readonly header: "drawer__header";
8
- readonly body: "drawer__body";
9
- readonly actions: "drawer__actions";
10
- };
@@ -1,12 +0,0 @@
1
- /**
2
- * @zh Drawer 的 class 名称
3
- * @en class names for Drawer
4
- */
5
- var CLASS_NAMES = {
6
- drawer: "drawer",
7
- header: "drawer__header",
8
- body: "drawer__body",
9
- actions: "drawer__actions"
10
- };
11
-
12
- export { CLASS_NAMES };
@@ -1,92 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
6
- var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
7
- var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
8
- var React = require('react');
9
- var sheet = require('../sheet/sheet.cjs');
10
- var button = require('../button/button.cjs');
11
- var space = require('../space/space.cjs');
12
- var useLocale = require('../../locale/use-locale.cjs');
13
- var useClosable = require('../../hooks/use-closable.cjs');
14
- var useClassNames = require('../../hooks/use-class-names.cjs');
15
- var stylex = require('../../node_modules/.pnpm/@stylexjs_stylex@0.19.0/node_modules/@stylexjs/stylex/lib/es/stylex.cjs');
16
- var className = require('@aiszlab/relax/class-name');
17
- var useThemeColorVars = require('../../hooks/use-theme-color-vars.cjs');
18
- var theme = require('../theme/theme.cjs');
19
- var context = require('./context.cjs');
20
-
21
- var _excluded = ["open", "size", "closable", "placement"];
22
- /**
23
- * @zh Drawer 专用样式:包含关闭按钮、标题和确认按钮的头部栏,以及面板背景。
24
- * @en Drawer-specific styles: header bar with closer, title, confirm button, and panel background.
25
- */
26
- var styles = {
27
- header: {
28
- k1xSpc: "musaex-78zum5",
29
- kg3NbH: "musaex-1v4gb6w",
30
- k8WAf4: "musaex-1aur8i7",
31
- kGNEyG: "musaex-6s0dn4",
32
- kOIVth: "musaex-wcf3z5",
33
- kt9PQ7: "musaex-d1xpcx",
34
- kfdmCh: "musaex-1q0q8m5",
35
- kL6WhQ: "musaex-quqrak",
36
- $$css: true
37
- }
38
- };
39
- /**
40
- * @zh Drawer 组件。从屏幕任意边缘滑入的模态面板。基于共享的 Sheet 基础组件构建。
41
- * @en Drawer component. A modal panel that slides in from any screen edge.
42
- * Built on the shared Sheet base component.
43
- */
44
- var Drawer = function Drawer(_ref) {
45
- var open = _ref.open,
46
- _ref$size = _ref.size,
47
- size = _ref$size === void 0 ? 400 : _ref$size,
48
- _ref$closable = _ref.closable,
49
- closable = _ref$closable === void 0 ? true : _ref$closable,
50
- _ref$placement = _ref.placement,
51
- placement = _ref$placement === void 0 ? "right" : _ref$placement,
52
- props = _objectWithoutProperties(_ref, _excluded);
53
- var classNames = useClassNames.useClassNames(context.CLASS_NAMES);
54
- var _useLocale = useLocale.useLocale("drawer"),
55
- _useLocale2 = _slicedToArray(_useLocale, 1),
56
- locale = _useLocale2[0];
57
- var themeColorVars = useThemeColorVars.useThemeColorVars(["outline-variant"]);
58
- var _useClosable = useClosable.useClosable({
59
- closable: closable,
60
- onClose: props.onClose
61
- }),
62
- closer = _useClosable.closer;
63
- var styled = {
64
- header: stylex.props(theme.$body.large, styles.header),
65
- actions: {
66
- className: "musaex-vc5jky"
67
- },
68
- panel: {
69
- className: "musaex-1q2mt7c"
70
- }
71
- };
72
- return /*#__PURE__*/React.createElement(sheet.default, {
73
- visible: open,
74
- placement: placement,
75
- size: size,
76
- closable: closable,
77
- onClose: props.onClose,
78
- className: classNames.drawer,
79
- header: /*#__PURE__*/React.createElement("div", {
80
- className: className.stringify(classNames.header, styled.header.className),
81
- style: _objectSpread(_objectSpread({}, styled.header.style), themeColorVars)
82
- }, closer, props.title, props.onConfirm && (/*#__PURE__*/React.createElement(space.default, {
83
- className: styled.actions.className,
84
- style: styled.actions.style
85
- }, /*#__PURE__*/React.createElement(button.Button, {
86
- onClick: props.onConfirm
87
- }, locale.confirm)))),
88
- panelClassName: styled.panel.className
89
- }, props.children);
90
- };
91
-
92
- exports.default = Drawer;
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- import type { DrawerProps } from "../../types/drawer";
3
- /**
4
- * @zh Drawer 组件。从屏幕任意边缘滑入的模态面板。基于共享的 Sheet 基础组件构建。
5
- * @en Drawer component. A modal panel that slides in from any screen edge.
6
- * Built on the shared Sheet base component.
7
- */
8
- declare const Drawer: ({ open, size, closable, placement, ...props }: DrawerProps) => React.JSX.Element;
9
- export default Drawer;