musae 1.2.0 → 1.3.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 (44) 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/theme/tokens.stylex.cjs +4 -1
  39. package/dist/components/theme/tokens.stylex.d.ts +9 -1
  40. package/dist/components/theme/tokens.stylex.mjs +4 -1
  41. package/dist/styles.css +68 -23
  42. package/dist/types/card.d.ts +39 -2
  43. package/dist/types/search.d.ts +6 -0
  44. package/package.json +1 -3
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musae",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "description": "musae-ui",
5
5
  "author": "tutu@fantufantu.com",
6
6
  "license": "MIT",
@@ -135,8 +135,6 @@
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
138
  "storybook": "pnpm run build && storybook dev -p 6006",
141
139
  "build-storybook": "storybook build",
142
140
  "lint": "eslint ."