musae 0.2.10 → 0.2.12

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 (268) hide show
  1. package/dist/components/avatar/avatar.js +86 -78
  2. package/dist/components/avatar/context.js +1 -1
  3. package/dist/components/avatar/group.js +37 -31
  4. package/dist/components/avatar/index.js +2 -2
  5. package/dist/components/badge/badge.js +45 -44
  6. package/dist/components/breadcrumb/breadcrumb.js +24 -25
  7. package/dist/components/breadcrumb/item.js +51 -48
  8. package/dist/components/button/button.js +149 -139
  9. package/dist/components/button/hooks.js +13 -10
  10. package/dist/components/button/types.d.ts +1 -1
  11. package/dist/components/calendar/calendar.js +56 -59
  12. package/dist/components/calendar/hooks.js +117 -90
  13. package/dist/components/cascader/cascader.js +49 -35
  14. package/dist/components/cascader/hooks.js +113 -81
  15. package/dist/components/cascader/utils.js +71 -53
  16. package/dist/components/checkbox/checkbox.js +191 -182
  17. package/dist/components/checkbox/context.d.ts +1 -1
  18. package/dist/components/checkbox/context.js +1 -1
  19. package/dist/components/checkbox/group.js +39 -27
  20. package/dist/components/checkbox/index.js +2 -2
  21. package/dist/components/checkbox/types.d.ts +2 -2
  22. package/dist/components/clock/clock.js +16 -19
  23. package/dist/components/clock/column.js +55 -48
  24. package/dist/components/clock/hooks.js +6 -9
  25. package/dist/components/clock/types.js +3 -3
  26. package/dist/components/collapse/collapse.js +75 -72
  27. package/dist/components/collapse/context.js +3 -3
  28. package/dist/components/collapse/hooks.js +41 -33
  29. package/dist/components/collapse/item.js +90 -72
  30. package/dist/components/config/context.js +3 -3
  31. package/dist/components/config/hooks.js +2 -2
  32. package/dist/components/config/provider.js +14 -13
  33. package/dist/components/config/types.d.ts +2 -2
  34. package/dist/components/{countable/countable.d.ts → countdown/countdown.d.ts} +2 -2
  35. package/dist/components/countdown/countdown.js +84 -0
  36. package/dist/components/countdown/index.d.ts +2 -0
  37. package/dist/components/date-picker/date-picker.js +12 -12
  38. package/dist/components/date-picker/hooks.js +21 -12
  39. package/dist/components/date-range-picker/date-range-picker.js +19 -17
  40. package/dist/components/date-range-picker/hooks.js +31 -20
  41. package/dist/components/dialog/dialog.js +30 -11
  42. package/dist/components/dialog/hooks.js +16 -6
  43. package/dist/components/dialog/popup.js +135 -110
  44. package/dist/components/divider/divider.js +89 -74
  45. package/dist/components/divider/hooks.js +7 -9
  46. package/dist/components/drawer/drawer.js +36 -11
  47. package/dist/components/drawer/hooks.js +5 -5
  48. package/dist/components/drawer/popup.js +172 -130
  49. package/dist/components/empty/empty.js +12 -12
  50. package/dist/components/floating-action-button/floatable.js +70 -53
  51. package/dist/components/floating-action-button/floating-action-button.js +27 -15
  52. package/dist/components/form/context.js +4 -4
  53. package/dist/components/form/field/error.js +40 -34
  54. package/dist/components/form/field/field.js +45 -47
  55. package/dist/components/form/field/layout.js +31 -29
  56. package/dist/components/form/form.js +38 -30
  57. package/dist/components/form/hooks.js +5 -5
  58. package/dist/components/form/index.js +3 -3
  59. package/dist/components/form/item.js +20 -5
  60. package/dist/components/grid/col.js +24 -23
  61. package/dist/components/grid/index.js +3 -3
  62. package/dist/components/grid/row.js +47 -38
  63. package/dist/components/icon/hoc.js +7 -7
  64. package/dist/components/icon/icon.js +33 -33
  65. package/dist/components/icon/icons/action/check-circle-outline.js +12 -3
  66. package/dist/components/icon/icons/action/check-circle.js +12 -3
  67. package/dist/components/icon/icons/action/done-outline.js +12 -3
  68. package/dist/components/icon/icons/action/done.js +12 -3
  69. package/dist/components/icon/icons/action/swap-horiz.js +12 -3
  70. package/dist/components/icon/icons/action/swap-vert.js +12 -3
  71. package/dist/components/icon/icons/action/visibility-off.js +12 -3
  72. package/dist/components/icon/icons/action/visibility.js +12 -3
  73. package/dist/components/icon/icons/action/zoom-in.js +12 -3
  74. package/dist/components/icon/icons/action/zoom-out.js +12 -3
  75. package/dist/components/icon/icons/alert/add-alert.d.ts +3 -0
  76. package/dist/components/icon/icons/alert/add-alert.js +19 -0
  77. package/dist/components/icon/icons/alert/auto-delete.d.ts +3 -0
  78. package/dist/components/icon/icons/alert/auto-delete.js +25 -0
  79. package/dist/components/icon/icons/alert/error-outline.js +12 -3
  80. package/dist/components/icon/icons/alert/error.d.ts +3 -0
  81. package/dist/components/icon/icons/alert/error.js +19 -0
  82. package/dist/components/icon/icons/alert/index.d.ts +7 -1
  83. package/dist/components/icon/icons/alert/index.js +6 -0
  84. package/dist/components/icon/icons/alert/notification-important.d.ts +3 -0
  85. package/dist/components/icon/icons/alert/notification-important.js +19 -0
  86. package/dist/components/icon/icons/alert/warning-amber.d.ts +3 -0
  87. package/dist/components/icon/icons/alert/warning-amber.js +19 -0
  88. package/dist/components/icon/icons/alert/warning.d.ts +3 -0
  89. package/dist/components/icon/icons/alert/warning.js +19 -0
  90. package/dist/components/icon/icons/content/clear.js +12 -3
  91. package/dist/components/icon/icons/hardware/keyboard-arrow-down.js +11 -3
  92. package/dist/components/icon/icons/hardware/keyboard-arrow-left.js +12 -3
  93. package/dist/components/icon/icons/hardware/keyboard-arrow-right.js +12 -3
  94. package/dist/components/icon/icons/hardware/keyboard-arrow-up.js +12 -3
  95. package/dist/components/icon/icons/hardware/keyboard-double-arrow-left.js +15 -4
  96. package/dist/components/icon/icons/hardware/keyboard-double-arrow-right.js +15 -4
  97. package/dist/components/icon/icons/image/bedtime.js +12 -3
  98. package/dist/components/icon/icons/image/rotate-left.js +12 -3
  99. package/dist/components/icon/icons/image/rotate-right.js +12 -3
  100. package/dist/components/icon/icons/image/wb-sunny.js +12 -3
  101. package/dist/components/icon/icons/index.js +6 -0
  102. package/dist/components/icon/icons/mock/github.js +13 -3
  103. package/dist/components/icon/icons/mock/loading.js +4 -4
  104. package/dist/components/icon/icons/navigation/cancel.js +12 -3
  105. package/dist/components/icon/icons/navigation/check.js +12 -3
  106. package/dist/components/icon/icons/navigation/close.js +12 -3
  107. package/dist/components/icon/icons/navigation/more-horiz.js +12 -3
  108. package/dist/components/icon/icons/navigation/unfold-more.js +12 -3
  109. package/dist/components/icon/icons/toggle/star-half.js +12 -3
  110. package/dist/components/icon/icons/toggle/star-outline.js +12 -3
  111. package/dist/components/icon/icons/toggle/star.js +12 -3
  112. package/dist/components/image/hooks.js +49 -41
  113. package/dist/components/image/image.js +37 -17
  114. package/dist/components/image/index.js +2 -2
  115. package/dist/components/image/preview/context.js +1 -1
  116. package/dist/components/image/preview/group.js +52 -29
  117. package/dist/components/image/preview/operations.js +87 -83
  118. package/dist/components/image/preview/preview.js +70 -44
  119. package/dist/components/input/hooks.js +54 -46
  120. package/dist/components/input/input.js +126 -113
  121. package/dist/components/layout/footer.js +2 -2
  122. package/dist/components/layout/header.js +30 -31
  123. package/dist/components/layout/hooks.js +44 -37
  124. package/dist/components/layout/index.js +5 -5
  125. package/dist/components/layout/layout.js +32 -35
  126. package/dist/components/layout/main.js +3 -2
  127. package/dist/components/layout/sider.js +5 -7
  128. package/dist/components/loading/loading.js +64 -61
  129. package/dist/components/menu/context.js +8 -8
  130. package/dist/components/menu/group.js +98 -78
  131. package/dist/components/menu/hooks.js +109 -76
  132. package/dist/components/menu/item.js +212 -190
  133. package/dist/components/menu/menu.js +47 -46
  134. package/dist/components/message/hooks.js +36 -27
  135. package/dist/components/message/index.d.ts +2 -1
  136. package/dist/components/message/messager.d.ts +3 -0
  137. package/dist/components/message/messager.js +21 -0
  138. package/dist/components/message/types.d.ts +15 -5
  139. package/dist/components/notification/holder.d.ts +2 -2
  140. package/dist/components/notification/holder.js +83 -51
  141. package/dist/components/notification/hooks.js +71 -48
  142. package/dist/components/notification/index.d.ts +4 -3
  143. package/dist/components/notification/notification.d.ts +2 -2
  144. package/dist/components/notification/notification.js +161 -127
  145. package/dist/components/notification/notifier.d.ts +8 -0
  146. package/dist/components/notification/notifier.js +71 -0
  147. package/dist/components/notification/types.d.ts +32 -36
  148. package/dist/components/number-input/hooks.js +35 -0
  149. package/dist/components/number-input/number-input.js +39 -0
  150. package/dist/components/otp-input/hooks.js +64 -45
  151. package/dist/components/otp-input/otp-input.js +45 -40
  152. package/dist/components/pagination/hooks.js +57 -46
  153. package/dist/components/pagination/item.js +26 -23
  154. package/dist/components/pagination/pagination.js +51 -43
  155. package/dist/components/pagination/types.js +4 -4
  156. package/dist/components/picker/context.js +4 -4
  157. package/dist/components/picker/picker.js +68 -61
  158. package/dist/components/popconfirm/index.d.ts +2 -0
  159. package/dist/components/popconfirm/popconfirm.d.ts +2 -2
  160. package/dist/components/popconfirm/popconfirm.js +143 -0
  161. package/dist/components/popconfirm/types.d.ts +12 -1
  162. package/dist/components/popover/hooks.d.ts +11 -0
  163. package/dist/components/popover/hooks.js +52 -0
  164. package/dist/components/popover/popover.js +90 -80
  165. package/dist/components/popover/types.d.ts +1 -1
  166. package/dist/components/popper/dropdown.js +141 -109
  167. package/dist/components/popper/hooks.js +14 -11
  168. package/dist/components/popper/popper.js +15 -3
  169. package/dist/components/portal/portal.js +29 -16
  170. package/dist/components/progress/circular.js +47 -46
  171. package/dist/components/progress/hooks.js +32 -21
  172. package/dist/components/progress/linear.js +57 -55
  173. package/dist/components/progress/progress.js +13 -5
  174. package/dist/components/radio/context.js +1 -1
  175. package/dist/components/radio/group.js +28 -14
  176. package/dist/components/radio/index.js +2 -2
  177. package/dist/components/radio/radio.js +159 -144
  178. package/dist/components/rate/hooks.js +43 -30
  179. package/dist/components/rate/rate.js +34 -34
  180. package/dist/components/rate/star.js +81 -74
  181. package/dist/components/ripple/hooks.js +46 -29
  182. package/dist/components/ripple/ripple.js +49 -29
  183. package/dist/components/select/hooks.js +131 -88
  184. package/dist/components/select/select.js +51 -49
  185. package/dist/components/select/selections.js +18 -4
  186. package/dist/components/select/selector.js +38 -32
  187. package/dist/components/select/utils.js +44 -40
  188. package/dist/components/skeleton/skeleton.js +76 -14
  189. package/dist/components/skeleton/types.d.ts +1 -1
  190. package/dist/components/space/space.js +37 -28
  191. package/dist/components/steps/context.js +4 -4
  192. package/dist/components/steps/item.d.ts +1 -1
  193. package/dist/components/steps/item.js +133 -121
  194. package/dist/components/steps/steps.js +35 -32
  195. package/dist/components/steps/types.d.ts +0 -5
  196. package/dist/components/switch/switch.js +188 -177
  197. package/dist/components/table/body.js +64 -44
  198. package/dist/components/table/context.js +4 -4
  199. package/dist/components/table/header/cell.js +57 -53
  200. package/dist/components/table/header/header.js +75 -68
  201. package/dist/components/table/hooks.js +55 -32
  202. package/dist/components/table/table.js +22 -21
  203. package/dist/components/tabs/context.js +1 -1
  204. package/dist/components/tabs/hooks.js +103 -70
  205. package/dist/components/tabs/navigation.js +73 -66
  206. package/dist/components/tabs/panels.js +36 -28
  207. package/dist/components/tabs/tab.js +23 -10
  208. package/dist/components/tabs/tabs.js +41 -21
  209. package/dist/components/tag/tag.js +31 -30
  210. package/dist/components/theme/hooks.js +56 -35
  211. package/dist/components/theme/theme-provider.js +20 -6
  212. package/dist/components/theme/theme.js +11 -11
  213. package/dist/components/theme/tokens.stylex.js +6 -2
  214. package/dist/components/theme/types.d.ts +4 -6
  215. package/dist/components/time-picker/hooks.js +20 -10
  216. package/dist/components/time-picker/panel.js +45 -38
  217. package/dist/components/time-picker/time-picker.js +32 -22
  218. package/dist/components/timeline/context.js +3 -3
  219. package/dist/components/timeline/item.js +88 -79
  220. package/dist/components/timeline/timeline.js +19 -17
  221. package/dist/components/tooltip/tooltip.js +12 -4
  222. package/dist/components/tour/hooks.js +37 -25
  223. package/dist/components/tour/spotlight.js +30 -29
  224. package/dist/components/tour/tour.js +89 -75
  225. package/dist/components/transfer/context.js +2 -2
  226. package/dist/components/transfer/hooks.js +62 -39
  227. package/dist/components/transfer/item.js +7 -8
  228. package/dist/components/transfer/list.js +83 -81
  229. package/dist/components/transfer/transfer.js +34 -36
  230. package/dist/components/tree/context.js +5 -5
  231. package/dist/components/tree/hooks.js +50 -27
  232. package/dist/components/tree/list.js +59 -42
  233. package/dist/components/tree/node.js +103 -95
  234. package/dist/components/tree/tree.js +57 -29
  235. package/dist/components/upload/upload.js +37 -37
  236. package/dist/components/upload/uploadeds.js +83 -46
  237. package/dist/components/visually-hidden/visually-hidden.js +19 -0
  238. package/dist/components/waterfall/hooks.js +50 -35
  239. package/dist/components/waterfall/sequential.js +46 -34
  240. package/dist/components/waterfall/waterfall.js +100 -85
  241. package/dist/components/watermark/hooks.js +132 -99
  242. package/dist/components/watermark/watermark.js +51 -42
  243. package/dist/hooks/use-class-names.d.ts +13 -7
  244. package/dist/hooks/use-class-names.js +2 -2
  245. package/dist/hooks/use-closable.js +18 -19
  246. package/dist/hooks/use-container.d.ts +1 -1
  247. package/dist/hooks/use-container.js +13 -13
  248. package/dist/hooks/use-expandable.js +64 -27
  249. package/dist/hooks/use-gutters.js +8 -5
  250. package/dist/hooks/use-image.js +32 -24
  251. package/dist/index.d.ts +6 -3
  252. package/dist/index.js +6 -1
  253. package/dist/node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js +52 -40
  254. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js +20 -0
  255. package/dist/stylex.css +15 -2
  256. package/dist/utils/class-name.d.ts +40 -21
  257. package/dist/utils/class-name.js +225 -452
  258. package/dist/utils/colors.d.ts +3 -1
  259. package/dist/utils/colors.js +53 -94
  260. package/dist/utils/keyboard.js +9 -9
  261. package/dist/utils/layer.js +16 -19
  262. package/dist/utils/styles.js +2 -1
  263. package/dist/utils/timespan.js +46 -19
  264. package/package.json +24 -21
  265. package/dist/components/countable/countable.js +0 -48
  266. package/dist/components/countable/index.d.ts +0 -2
  267. /package/dist/components/{countable → countdown}/types.d.ts +0 -0
  268. /package/dist/node_modules/.pnpm/{@aiszlab_relax@1.2.64_react-dom@18.3.1_react@18.3.1__react@18.3.1 → @aiszlab_relax@1.2.68_react-dom@18.3.1_react@18.3.1__react@18.3.1}/node_modules/@aiszlab/relax/dist/dom/contains.js +0 -0
@@ -1,3 +1,5 @@
1
+ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
1
3
  import React, { forwardRef, useContext } from 'react';
2
4
  import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
5
  import { Context } from './context.js';
@@ -9,47 +11,50 @@ import clsx from 'clsx';
9
11
  import { typography } from '../theme/theme.js';
10
12
  import { useImage } from '../../hooks/use-image.js';
11
13
 
12
- const styles = {
13
- avatar: props => [{
14
- borderWidth: "musae-1i8jmgv",
15
- borderInlineWidth: null,
16
- borderInlineStartWidth: null,
17
- borderLeftWidth: null,
18
- borderInlineEndWidth: null,
19
- borderRightWidth: null,
20
- borderBlockWidth: null,
21
- borderTopWidth: null,
22
- borderBottomWidth: null,
23
- borderStyle: "musae-1y0btm7",
24
- borderInlineStyle: null,
25
- borderInlineStartStyle: null,
26
- borderLeftStyle: null,
27
- borderInlineEndStyle: null,
28
- borderRightStyle: null,
29
- borderBlockStyle: null,
30
- borderTopStyle: null,
31
- borderBottomStyle: null,
32
- borderColor: "musae-9r1u3d",
33
- borderInlineColor: null,
34
- borderInlineStartColor: null,
35
- borderLeftColor: null,
36
- borderInlineEndColor: null,
37
- borderRightColor: null,
38
- borderBlockColor: null,
39
- borderTopColor: null,
40
- borderBottomColor: null,
41
- boxSizing: "musae-9f619",
42
- display: "musae-3nfvp2",
43
- backgroundColor: "musae-q1mx2j",
44
- color: "musae-19dipnz",
45
- alignItems: "musae-6s0dn4",
46
- justifyContent: "musae-l56j7k",
47
- userSelect: "musae-87ps6o",
48
- $$css: true
49
- }, {
50
- "--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial",
51
- "--color": props.color != null ? props.color : "initial"
52
- }],
14
+ var _excluded = ["src", "alt", "shape", "size"];
15
+ var styles = {
16
+ avatar: function avatar(props) {
17
+ return [{
18
+ borderWidth: "musae-1i8jmgv",
19
+ borderInlineWidth: null,
20
+ borderInlineStartWidth: null,
21
+ borderLeftWidth: null,
22
+ borderInlineEndWidth: null,
23
+ borderRightWidth: null,
24
+ borderBlockWidth: null,
25
+ borderTopWidth: null,
26
+ borderBottomWidth: null,
27
+ borderStyle: "musae-1y0btm7",
28
+ borderInlineStyle: null,
29
+ borderInlineStartStyle: null,
30
+ borderLeftStyle: null,
31
+ borderInlineEndStyle: null,
32
+ borderRightStyle: null,
33
+ borderBlockStyle: null,
34
+ borderTopStyle: null,
35
+ borderBottomStyle: null,
36
+ borderColor: "musae-9r1u3d",
37
+ borderInlineColor: null,
38
+ borderInlineStartColor: null,
39
+ borderLeftColor: null,
40
+ borderInlineEndColor: null,
41
+ borderRightColor: null,
42
+ borderBlockColor: null,
43
+ borderTopColor: null,
44
+ borderBottomColor: null,
45
+ boxSizing: "musae-9f619",
46
+ display: "musae-3nfvp2",
47
+ backgroundColor: "musae-q1mx2j",
48
+ color: "musae-19dipnz",
49
+ alignItems: "musae-6s0dn4",
50
+ justifyContent: "musae-l56j7k",
51
+ userSelect: "musae-87ps6o",
52
+ $$css: true
53
+ }, {
54
+ "--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial",
55
+ "--color": props.color != null ? props.color : "initial"
56
+ }];
57
+ },
53
58
  image: {
54
59
  width: "musae-wfgd1y",
55
60
  height: "musae-b27hse",
@@ -65,23 +70,25 @@ const styles = {
65
70
  borderBottomRightRadius: null,
66
71
  $$css: true
67
72
  },
68
- overlapping: props => [{
69
- ":not(:first-child)_marginInlineStart": "musae-1i5rff9",
70
- ":not(:first-child)_marginLeft": null,
71
- ":not(:first-child)_marginRight": null,
72
- borderColor: "musae-eqt46j",
73
- borderInlineColor: null,
74
- borderInlineStartColor: null,
75
- borderLeftColor: null,
76
- borderInlineEndColor: null,
77
- borderRightColor: null,
78
- borderBlockColor: null,
79
- borderTopColor: null,
80
- borderBottomColor: null,
81
- $$css: true
82
- }, {
83
- "--borderColor": props.outlineColor != null ? props.outlineColor : "initial"
84
- }],
73
+ overlapping: function overlapping(props) {
74
+ return [{
75
+ ":not(:first-child)_marginInlineStart": "musae-1i5rff9",
76
+ ":not(:first-child)_marginLeft": null,
77
+ ":not(:first-child)_marginRight": null,
78
+ borderColor: "musae-eqt46j",
79
+ borderInlineColor: null,
80
+ borderInlineStartColor: null,
81
+ borderLeftColor: null,
82
+ borderInlineEndColor: null,
83
+ borderRightColor: null,
84
+ borderBlockColor: null,
85
+ borderTopColor: null,
86
+ borderBottomColor: null,
87
+ $$css: true
88
+ }, {
89
+ "--borderColor": props.outlineColor != null ? props.outlineColor : "initial"
90
+ }];
91
+ },
85
92
  circular: {
86
93
  borderRadius: "musae-iipnba",
87
94
  borderStartStartRadius: null,
@@ -126,23 +133,25 @@ const styles = {
126
133
  * @description
127
134
  * `Avatar`
128
135
  */
129
- const Avatar = forwardRef(({
130
- src,
131
- alt,
132
- shape: _shape = "circular",
133
- size: _size = "medium",
134
- ...props$1
135
- }, ref) => {
136
- const theme = useTheme();
137
- const group = useContext(Context);
138
- const isInGroup = !!group;
139
- const size = group?.size ?? _size;
140
- const shape = group?.shape ?? _shape;
141
- const classNames = useClassNames(ComponentToken.Avatar);
142
- const isLoaded = useImage({
143
- src
136
+ var Avatar = /*#__PURE__*/forwardRef(function (_ref, ref) {
137
+ var _group$size, _group$shape;
138
+ var src = _ref.src,
139
+ alt = _ref.alt,
140
+ _ref$shape = _ref.shape,
141
+ _shape = _ref$shape === void 0 ? "circular" : _ref$shape,
142
+ _ref$size = _ref.size,
143
+ _size = _ref$size === void 0 ? "medium" : _ref$size,
144
+ props$1 = _objectWithoutProperties(_ref, _excluded);
145
+ var theme = useTheme();
146
+ var group = useContext(Context);
147
+ var isInGroup = !!group;
148
+ var size = (_group$size = group === null || group === void 0 ? void 0 : group.size) !== null && _group$size !== void 0 ? _group$size : _size;
149
+ var shape = (_group$shape = group === null || group === void 0 ? void 0 : group.shape) !== null && _group$shape !== void 0 ? _group$shape : _shape;
150
+ var classNames = useClassNames(ComponentToken.Avatar);
151
+ var isLoaded = useImage({
152
+ src: src
144
153
  });
145
- const styled = {
154
+ var styled = {
146
155
  avatar: props(typography.label[size], styles.avatar({
147
156
  backgroundColor: theme.colors[ColorToken.PrimaryContainer],
148
157
  color: theme.colors[ColorToken.Primary]
@@ -153,18 +162,17 @@ const Avatar = forwardRef(({
153
162
  className: "musae-wfgd1y musae-b27hse musae-l1xv1r musae-1pjcqnp"
154
163
  }
155
164
  };
156
- return React.createElement("span", {
157
- ...props$1,
165
+ return /*#__PURE__*/React.createElement("span", _objectSpread(_objectSpread({}, props$1), {}, {
158
166
  className: clsx(classNames[AvatarClassToken.Avatar], styled.avatar.className),
159
167
  style: styled.avatar.style,
160
168
  ref: ref
161
- }, isLoaded === "loaded" ? React.createElement("img", {
169
+ }), isLoaded === "loaded" ? ( /*#__PURE__*/React.createElement("img", {
162
170
  draggable: false,
163
171
  src: src,
164
172
  alt: alt,
165
173
  className: styled.image.className,
166
174
  style: styled.image.style
167
- }) : alt?.slice(0, 2).toUpperCase());
175
+ })) : alt === null || alt === void 0 ? void 0 : alt.slice(0, 2).toUpperCase());
168
176
  });
169
177
 
170
178
  export { Avatar as default };
@@ -4,6 +4,6 @@ import { createContext } from 'react';
4
4
  * @description
5
5
  * context
6
6
  */
7
- const Context = createContext(null);
7
+ var Context = /*#__PURE__*/createContext(null);
8
8
 
9
9
  export { Context };
@@ -1,3 +1,4 @@
1
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
1
2
  import React, { useMemo, Children, cloneElement } from 'react';
2
3
  import { Context } from './context.js';
3
4
  import { useClassNames } from '../../hooks/use-class-names.js';
@@ -5,49 +6,54 @@ import { ComponentToken, AvatarClassToken } from '../../utils/class-name.js';
5
6
  import Popover from '../popover/popover.js';
6
7
  import Avatar from './avatar.js';
7
8
 
8
- const Group = ({
9
- children: _children,
10
- shape = "circular",
11
- size = "medium",
12
- max = 3
13
- }) => {
14
- const styled = {
9
+ var Group = function Group(_ref) {
10
+ var _children = _ref.children,
11
+ _ref$shape = _ref.shape,
12
+ shape = _ref$shape === void 0 ? "circular" : _ref$shape,
13
+ _ref$size = _ref.size,
14
+ size = _ref$size === void 0 ? "medium" : _ref$size,
15
+ _ref$max = _ref.max,
16
+ max = _ref$max === void 0 ? 3 : _ref$max;
17
+ var styled = {
15
18
  className: "musae-3nfvp2 musae-87ps6o"
16
19
  };
17
- const classNames = useClassNames(ComponentToken.Avatar);
18
- const children = useMemo(() => {
19
- const __children = Children.toArray(_children);
20
- const [visible, hidden] = __children.reduce((prev, child, index) => {
21
- // @ts-ignore
22
- const element = cloneElement(child, {
23
- key: `avatars-${index}`
24
- });
25
- // great than max, hide current node
26
- if (index >= max) {
27
- prev[1].push(element);
28
- } else {
29
- prev[0].push(element);
30
- }
31
- return prev;
32
- }, [[], []]);
20
+ var classNames = useClassNames(ComponentToken.Avatar);
21
+ var children = useMemo(function () {
22
+ var __children = Children.toArray(_children);
23
+ var _children$reduce = __children.reduce(function (prev, child, index) {
24
+ // @ts-ignore
25
+ var element = /*#__PURE__*/cloneElement(child, {
26
+ key: "avatars-".concat(index)
27
+ });
28
+ // great than max, hide current node
29
+ if (index >= max) {
30
+ prev[1].push(element);
31
+ } else {
32
+ prev[0].push(element);
33
+ }
34
+ return prev;
35
+ }, [[], []]),
36
+ _children$reduce2 = _slicedToArray(_children$reduce, 2),
37
+ visible = _children$reduce2[0],
38
+ hidden = _children$reduce2[1];
33
39
  // got hidden nodes, show ellipse node
34
40
  if (hidden.length > 0) {
35
- visible.push(React.createElement(Popover, {
36
- description: React.createElement(Group, null, hidden),
41
+ visible.push( /*#__PURE__*/React.createElement(Popover, {
42
+ description: /*#__PURE__*/React.createElement(Group, null, hidden),
37
43
  key: "avatars-hidden",
38
44
  placement: "top"
39
- }, React.createElement(Avatar, {
40
- alt: `+${hidden.length}`
45
+ }, /*#__PURE__*/React.createElement(Avatar, {
46
+ alt: "+".concat(hidden.length)
41
47
  })));
42
48
  }
43
49
  return visible;
44
50
  }, [_children, max]);
45
- return React.createElement(Context.Provider, {
51
+ return /*#__PURE__*/React.createElement(Context.Provider, {
46
52
  value: {
47
- shape,
48
- size
53
+ shape: shape,
54
+ size: size
49
55
  }
50
- }, React.createElement("div", {
56
+ }, /*#__PURE__*/React.createElement("div", {
51
57
  className: (classNames[AvatarClassToken.Group], styled.className),
52
58
  style: styled.style
53
59
  }, children));
@@ -1,8 +1,8 @@
1
1
  import Avatar$1 from './avatar.js';
2
2
  import Group from './group.js';
3
3
 
4
- const Avatar = Object.assign(Avatar$1, {
5
- Group,
4
+ var Avatar = Object.assign(Avatar$1, {
5
+ Group: Group
6
6
  });
7
7
 
8
8
  export { Avatar };
@@ -1,3 +1,4 @@
1
+ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
1
2
  import React from 'react';
2
3
  import { useClassNames } from '../../hooks/use-class-names.js';
3
4
  import { ComponentToken, BadgeClassToken } from '../../utils/class-name.js';
@@ -9,37 +10,39 @@ import { useTheme } from '../theme/hooks.js';
9
10
  import { ColorToken } from '../../utils/colors.js';
10
11
  import { isVoid } from '@aiszlab/relax';
11
12
 
12
- const styles = {
13
+ var styles = {
13
14
  badge: {
14
- default: {
15
+ "default": {
15
16
  position: "musae-1n2onr6",
16
17
  display: "musae-3nfvp2",
17
18
  $$css: true
18
19
  }
19
20
  },
20
21
  tail: {
21
- default: props => [{
22
- position: "musae-10l6tqk",
23
- borderRadius: "musae-iipnba",
24
- borderStartStartRadius: null,
25
- borderStartEndRadius: null,
26
- borderEndStartRadius: null,
27
- borderEndEndRadius: null,
28
- borderTopLeftRadius: null,
29
- borderTopRightRadius: null,
30
- borderBottomLeftRadius: null,
31
- borderBottomRightRadius: null,
32
- minWidth: "musae-70jws7",
33
- textAlign: "musae-2b8uid",
34
- boxShadow: "musae-igitpm",
35
- backgroundColor: "musae-q1mx2j",
36
- color: "musae-19dipnz",
37
- $$css: true
38
- }, {
39
- "--boxShadow": `0 0 0 ${sizes.smallest} ${props.color}` != null ? `0 0 0 ${sizes.smallest} ${props.color}` : "initial",
40
- "--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial",
41
- "--color": props.color != null ? props.color : "initial"
42
- }],
22
+ "default": function _default(props) {
23
+ return [{
24
+ position: "musae-10l6tqk",
25
+ borderRadius: "musae-iipnba",
26
+ borderStartStartRadius: null,
27
+ borderStartEndRadius: null,
28
+ borderEndStartRadius: null,
29
+ borderEndEndRadius: null,
30
+ borderTopLeftRadius: null,
31
+ borderTopRightRadius: null,
32
+ borderBottomLeftRadius: null,
33
+ borderBottomRightRadius: null,
34
+ minWidth: "musae-70jws7",
35
+ textAlign: "musae-2b8uid",
36
+ boxShadow: "musae-igitpm",
37
+ backgroundColor: "musae-q1mx2j",
38
+ color: "musae-19dipnz",
39
+ $$css: true
40
+ }, {
41
+ "--boxShadow": "0 0 0 ".concat(sizes.smallest, " ").concat(props.color) != null ? "0 0 0 ".concat(sizes.smallest, " ").concat(props.color) : "initial",
42
+ "--backgroundColor": props.backgroundColor != null ? props.backgroundColor : "initial",
43
+ "--color": props.color != null ? props.color : "initial"
44
+ }];
45
+ },
43
46
  dot: {
44
47
  minWidth: null,
45
48
  width: "musae-2jq81",
@@ -84,31 +87,29 @@ const styles = {
84
87
  }
85
88
  }
86
89
  };
87
- const Badge = ({
88
- className,
89
- style,
90
- children,
91
- content,
92
- invisible = false,
93
- placement = "top-right"
94
- }) => {
95
- const classNames = useClassNames(ComponentToken.Badge);
96
- const theme = useTheme();
97
- const isDot = isVoid(content);
98
- const styled = {
99
- badge: _stylex.props(styles.badge.default),
100
- tail: _stylex.props(styles.tail.default({
90
+ var Badge = function Badge(_ref) {
91
+ var className = _ref.className,
92
+ style = _ref.style,
93
+ children = _ref.children,
94
+ content = _ref.content,
95
+ _ref$invisible = _ref.invisible,
96
+ invisible = _ref$invisible === void 0 ? false : _ref$invisible,
97
+ _ref$placement = _ref.placement,
98
+ placement = _ref$placement === void 0 ? "top-right" : _ref$placement;
99
+ var classNames = useClassNames(ComponentToken.Badge);
100
+ var theme = useTheme();
101
+ var isDot = isVoid(content);
102
+ var styled = {
103
+ badge: _stylex.props(styles.badge["default"]),
104
+ tail: _stylex.props(styles.tail["default"]({
101
105
  backgroundColor: theme.colors[ColorToken.Primary],
102
106
  color: theme.colors[ColorToken.OnPrimary]
103
107
  }), isDot && styles.tail.dot, typography.label.small, invisible && styles.tail.invisible, styles.tail[placement])
104
108
  };
105
- return React.createElement("span", {
109
+ return /*#__PURE__*/React.createElement("span", {
106
110
  className: clsx(classNames[BadgeClassToken.Badge], className, styled.badge.className),
107
- style: {
108
- ...styled.badge.style,
109
- ...style
110
- }
111
- }, children, React.createElement("span", {
111
+ style: _objectSpread(_objectSpread({}, styled.badge.style), style)
112
+ }, children, /*#__PURE__*/React.createElement("span", {
112
113
  className: clsx(classNames[BadgeClassToken.Tail], styled.tail.className),
113
114
  style: styled.tail.style
114
115
  }, content));
@@ -1,3 +1,4 @@
1
+ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
1
2
  import React from 'react';
2
3
  import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
4
  import { typography } from '../theme/theme.js';
@@ -8,27 +9,30 @@ import { ComponentToken, BreadcrumbClassToken } from '../../utils/class-name.js'
8
9
  import clsx from 'clsx';
9
10
  import Item from './item.js';
10
11
 
11
- const styles = {
12
- breadcrumb: props => [{
13
- color: "musae-19dipnz",
14
- $$css: true
15
- }, {
16
- "--color": props.color != null ? props.color : "initial"
17
- }]
12
+ var styles = {
13
+ breadcrumb: function breadcrumb(props) {
14
+ return [{
15
+ color: "musae-19dipnz",
16
+ $$css: true
17
+ }, {
18
+ "--color": props.color != null ? props.color : "initial"
19
+ }];
20
+ }
18
21
  };
19
- const Breadcrumb = ({
20
- items = [],
21
- className,
22
- separator = "/",
23
- style
24
- }) => {
25
- const theme = useTheme();
26
- const classNames = useClassNames(ComponentToken.Breadcrumb);
22
+ var Breadcrumb = function Breadcrumb(_ref) {
23
+ var _ref$items = _ref.items,
24
+ items = _ref$items === void 0 ? [] : _ref$items,
25
+ className = _ref.className,
26
+ _ref$separator = _ref.separator,
27
+ separator = _ref$separator === void 0 ? "/" : _ref$separator,
28
+ style = _ref.style;
29
+ var theme = useTheme();
30
+ var classNames = useClassNames(ComponentToken.Breadcrumb);
27
31
  /// there is no need to render the breadcrumb when there is no items
28
32
  if (items.length === 0) {
29
33
  return null;
30
34
  }
31
- const styled = {
35
+ var styled = {
32
36
  breadcrumb: props(typography.label.large, styles.breadcrumb({
33
37
  color: theme.colors[ColorToken.OnSurfaceVariant]
34
38
  })),
@@ -36,16 +40,11 @@ const Breadcrumb = ({
36
40
  className: "musae-e8uvvx musae-78zum5 musae-1a02dak"
37
41
  }
38
42
  };
39
- return React.createElement("nav", {
43
+ return /*#__PURE__*/React.createElement("nav", {
40
44
  className: clsx(classNames[BreadcrumbClassToken.Breadcrumb], className, styled.breadcrumb.className),
41
- style: {
42
- ...styled.breadcrumb.style,
43
- ...style
44
- }
45
- }, React.createElement("ol", {
46
- ...styled.navigations
47
- }, items.map((item, index) => {
48
- return React.createElement(Item, {
45
+ style: _objectSpread(_objectSpread({}, styled.breadcrumb.style), style)
46
+ }, /*#__PURE__*/React.createElement("ol", _objectSpread({}, styled.navigations), items.map(function (item, index) {
47
+ return /*#__PURE__*/React.createElement(Item, {
49
48
  key: index,
50
49
  label: item.label,
51
50
  max: index === items.length - 1,
@@ -6,41 +6,45 @@ import { useClassNames } from '../../hooks/use-class-names.js';
6
6
  import { ComponentToken, BreadcrumbClassToken } from '../../utils/class-name.js';
7
7
  import clsx from 'clsx';
8
8
 
9
- const styles = {
9
+ var styles = {
10
10
  navigation: {
11
- default: props => [{
12
- ":last-of-type_color": "musae-1befqep",
13
- $$css: true
14
- }, {
15
- "--h3adkr": props.color != null ? props.color : "initial"
16
- }],
17
- link: props => [{
18
- paddingInline: "musae-381k9q",
19
- paddingStart: null,
20
- paddingLeft: null,
21
- paddingEnd: null,
22
- paddingRight: null,
23
- borderRadius: "musae-7bdoj",
24
- borderStartStartRadius: null,
25
- borderStartEndRadius: null,
26
- borderEndStartRadius: null,
27
- borderEndEndRadius: null,
28
- borderTopLeftRadius: null,
29
- borderTopRightRadius: null,
30
- borderBottomLeftRadius: null,
31
- borderBottomRightRadius: null,
32
- backgroundColor: "musae-rl4t6d",
33
- color: "musae-vm0q45",
34
- transitionProperty: "musae-fagghw",
35
- transitionDuration: "musae-13dflua",
36
- $$css: true
37
- }, {
38
- "--1e2mv7m": props.hoveredBackgroundColor != null ? props.hoveredBackgroundColor : "initial",
39
- "--1113oo7": props.hoveredColor != null ? props.hoveredColor : "initial"
40
- }]
11
+ "default": function _default(props) {
12
+ return [{
13
+ ":last-of-type_color": "musae-1befqep",
14
+ $$css: true
15
+ }, {
16
+ "--h3adkr": props.color != null ? props.color : "initial"
17
+ }];
18
+ },
19
+ link: function link(props) {
20
+ return [{
21
+ paddingInline: "musae-381k9q",
22
+ paddingStart: null,
23
+ paddingLeft: null,
24
+ paddingEnd: null,
25
+ paddingRight: null,
26
+ borderRadius: "musae-7bdoj",
27
+ borderStartStartRadius: null,
28
+ borderStartEndRadius: null,
29
+ borderEndStartRadius: null,
30
+ borderEndEndRadius: null,
31
+ borderTopLeftRadius: null,
32
+ borderTopRightRadius: null,
33
+ borderBottomLeftRadius: null,
34
+ borderBottomRightRadius: null,
35
+ backgroundColor: "musae-rl4t6d",
36
+ color: "musae-vm0q45",
37
+ transitionProperty: "musae-fagghw",
38
+ transitionDuration: "musae-13dflua",
39
+ $$css: true
40
+ }, {
41
+ "--1e2mv7m": props.hoveredBackgroundColor != null ? props.hoveredBackgroundColor : "initial",
42
+ "--1113oo7": props.hoveredColor != null ? props.hoveredColor : "initial"
43
+ }];
44
+ }
41
45
  },
42
46
  separator: {
43
- default: {
47
+ "default": {
44
48
  marginInline: "musae-19s5fsp",
45
49
  marginInlineStart: null,
46
50
  marginLeft: null,
@@ -50,33 +54,32 @@ const styles = {
50
54
  }
51
55
  }
52
56
  };
53
- const Item = ({
54
- href,
55
- label,
56
- max,
57
- separator
58
- }) => {
59
- const theme = useTheme();
60
- const isLink = !!href;
61
- const classNames = useClassNames(ComponentToken.Breadcrumb);
62
- const styled = {
63
- navigation: _stylex.props(styles.navigation.default({
57
+ var Item = function Item(_ref) {
58
+ var href = _ref.href,
59
+ label = _ref.label,
60
+ max = _ref.max,
61
+ separator = _ref.separator;
62
+ var theme = useTheme();
63
+ var isLink = !!href;
64
+ var classNames = useClassNames(ComponentToken.Breadcrumb);
65
+ var styled = {
66
+ navigation: _stylex.props(styles.navigation["default"]({
64
67
  color: theme.colors[ColorToken.OnSurface]
65
68
  }), isLink && styles.navigation.link({
66
69
  hoveredBackgroundColor: theme.colors[ColorToken.Surface],
67
70
  hoveredColor: theme.colors[ColorToken.OnSurface]
68
71
  })),
69
- separator: _stylex.props(styles.separator.default)
72
+ separator: _stylex.props(styles.separator["default"])
70
73
  };
71
- return React.createElement(React.Fragment, null, React.createElement("li", {
74
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("li", {
72
75
  className: classNames[BreadcrumbClassToken.Item]
73
- }, isLink && React.createElement("a", {
76
+ }, isLink && /*#__PURE__*/React.createElement("a", {
74
77
  href: href
75
- }, label), !isLink && label), !max && React.createElement("li", {
78
+ }, label), !isLink && label), !max && ( /*#__PURE__*/React.createElement("li", {
76
79
  role: "separator",
77
80
  className: clsx(classNames[BreadcrumbClassToken.Separator], styled.separator.className),
78
81
  style: styled.separator.style
79
- }, separator));
82
+ }, separator)));
80
83
  };
81
84
 
82
85
  export { Item as default };