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.
- package/dist/components/avatar/avatar.js +86 -78
- package/dist/components/avatar/context.js +1 -1
- package/dist/components/avatar/group.js +37 -31
- package/dist/components/avatar/index.js +2 -2
- package/dist/components/badge/badge.js +45 -44
- package/dist/components/breadcrumb/breadcrumb.js +24 -25
- package/dist/components/breadcrumb/item.js +51 -48
- package/dist/components/button/button.js +149 -139
- package/dist/components/button/hooks.js +13 -10
- package/dist/components/button/types.d.ts +1 -1
- package/dist/components/calendar/calendar.js +56 -59
- package/dist/components/calendar/hooks.js +117 -90
- package/dist/components/cascader/cascader.js +49 -35
- package/dist/components/cascader/hooks.js +113 -81
- package/dist/components/cascader/utils.js +71 -53
- package/dist/components/checkbox/checkbox.js +191 -182
- package/dist/components/checkbox/context.d.ts +1 -1
- package/dist/components/checkbox/context.js +1 -1
- package/dist/components/checkbox/group.js +39 -27
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/checkbox/types.d.ts +2 -2
- package/dist/components/clock/clock.js +16 -19
- package/dist/components/clock/column.js +55 -48
- package/dist/components/clock/hooks.js +6 -9
- package/dist/components/clock/types.js +3 -3
- package/dist/components/collapse/collapse.js +75 -72
- package/dist/components/collapse/context.js +3 -3
- package/dist/components/collapse/hooks.js +41 -33
- package/dist/components/collapse/item.js +90 -72
- package/dist/components/config/context.js +3 -3
- package/dist/components/config/hooks.js +2 -2
- package/dist/components/config/provider.js +14 -13
- package/dist/components/config/types.d.ts +2 -2
- package/dist/components/{countable/countable.d.ts → countdown/countdown.d.ts} +2 -2
- package/dist/components/countdown/countdown.js +84 -0
- package/dist/components/countdown/index.d.ts +2 -0
- package/dist/components/date-picker/date-picker.js +12 -12
- package/dist/components/date-picker/hooks.js +21 -12
- package/dist/components/date-range-picker/date-range-picker.js +19 -17
- package/dist/components/date-range-picker/hooks.js +31 -20
- package/dist/components/dialog/dialog.js +30 -11
- package/dist/components/dialog/hooks.js +16 -6
- package/dist/components/dialog/popup.js +135 -110
- package/dist/components/divider/divider.js +89 -74
- package/dist/components/divider/hooks.js +7 -9
- package/dist/components/drawer/drawer.js +36 -11
- package/dist/components/drawer/hooks.js +5 -5
- package/dist/components/drawer/popup.js +172 -130
- package/dist/components/empty/empty.js +12 -12
- package/dist/components/floating-action-button/floatable.js +70 -53
- package/dist/components/floating-action-button/floating-action-button.js +27 -15
- package/dist/components/form/context.js +4 -4
- package/dist/components/form/field/error.js +40 -34
- package/dist/components/form/field/field.js +45 -47
- package/dist/components/form/field/layout.js +31 -29
- package/dist/components/form/form.js +38 -30
- package/dist/components/form/hooks.js +5 -5
- package/dist/components/form/index.js +3 -3
- package/dist/components/form/item.js +20 -5
- package/dist/components/grid/col.js +24 -23
- package/dist/components/grid/index.js +3 -3
- package/dist/components/grid/row.js +47 -38
- package/dist/components/icon/hoc.js +7 -7
- package/dist/components/icon/icon.js +33 -33
- package/dist/components/icon/icons/action/check-circle-outline.js +12 -3
- package/dist/components/icon/icons/action/check-circle.js +12 -3
- package/dist/components/icon/icons/action/done-outline.js +12 -3
- package/dist/components/icon/icons/action/done.js +12 -3
- package/dist/components/icon/icons/action/swap-horiz.js +12 -3
- package/dist/components/icon/icons/action/swap-vert.js +12 -3
- package/dist/components/icon/icons/action/visibility-off.js +12 -3
- package/dist/components/icon/icons/action/visibility.js +12 -3
- package/dist/components/icon/icons/action/zoom-in.js +12 -3
- package/dist/components/icon/icons/action/zoom-out.js +12 -3
- package/dist/components/icon/icons/alert/add-alert.d.ts +3 -0
- package/dist/components/icon/icons/alert/add-alert.js +19 -0
- package/dist/components/icon/icons/alert/auto-delete.d.ts +3 -0
- package/dist/components/icon/icons/alert/auto-delete.js +25 -0
- package/dist/components/icon/icons/alert/error-outline.js +12 -3
- package/dist/components/icon/icons/alert/error.d.ts +3 -0
- package/dist/components/icon/icons/alert/error.js +19 -0
- package/dist/components/icon/icons/alert/index.d.ts +7 -1
- package/dist/components/icon/icons/alert/index.js +6 -0
- package/dist/components/icon/icons/alert/notification-important.d.ts +3 -0
- package/dist/components/icon/icons/alert/notification-important.js +19 -0
- package/dist/components/icon/icons/alert/warning-amber.d.ts +3 -0
- package/dist/components/icon/icons/alert/warning-amber.js +19 -0
- package/dist/components/icon/icons/alert/warning.d.ts +3 -0
- package/dist/components/icon/icons/alert/warning.js +19 -0
- package/dist/components/icon/icons/content/clear.js +12 -3
- package/dist/components/icon/icons/hardware/keyboard-arrow-down.js +11 -3
- package/dist/components/icon/icons/hardware/keyboard-arrow-left.js +12 -3
- package/dist/components/icon/icons/hardware/keyboard-arrow-right.js +12 -3
- package/dist/components/icon/icons/hardware/keyboard-arrow-up.js +12 -3
- package/dist/components/icon/icons/hardware/keyboard-double-arrow-left.js +15 -4
- package/dist/components/icon/icons/hardware/keyboard-double-arrow-right.js +15 -4
- package/dist/components/icon/icons/image/bedtime.js +12 -3
- package/dist/components/icon/icons/image/rotate-left.js +12 -3
- package/dist/components/icon/icons/image/rotate-right.js +12 -3
- package/dist/components/icon/icons/image/wb-sunny.js +12 -3
- package/dist/components/icon/icons/index.js +6 -0
- package/dist/components/icon/icons/mock/github.js +13 -3
- package/dist/components/icon/icons/mock/loading.js +4 -4
- package/dist/components/icon/icons/navigation/cancel.js +12 -3
- package/dist/components/icon/icons/navigation/check.js +12 -3
- package/dist/components/icon/icons/navigation/close.js +12 -3
- package/dist/components/icon/icons/navigation/more-horiz.js +12 -3
- package/dist/components/icon/icons/navigation/unfold-more.js +12 -3
- package/dist/components/icon/icons/toggle/star-half.js +12 -3
- package/dist/components/icon/icons/toggle/star-outline.js +12 -3
- package/dist/components/icon/icons/toggle/star.js +12 -3
- package/dist/components/image/hooks.js +49 -41
- package/dist/components/image/image.js +37 -17
- package/dist/components/image/index.js +2 -2
- package/dist/components/image/preview/context.js +1 -1
- package/dist/components/image/preview/group.js +52 -29
- package/dist/components/image/preview/operations.js +87 -83
- package/dist/components/image/preview/preview.js +70 -44
- package/dist/components/input/hooks.js +54 -46
- package/dist/components/input/input.js +126 -113
- package/dist/components/layout/footer.js +2 -2
- package/dist/components/layout/header.js +30 -31
- package/dist/components/layout/hooks.js +44 -37
- package/dist/components/layout/index.js +5 -5
- package/dist/components/layout/layout.js +32 -35
- package/dist/components/layout/main.js +3 -2
- package/dist/components/layout/sider.js +5 -7
- package/dist/components/loading/loading.js +64 -61
- package/dist/components/menu/context.js +8 -8
- package/dist/components/menu/group.js +98 -78
- package/dist/components/menu/hooks.js +109 -76
- package/dist/components/menu/item.js +212 -190
- package/dist/components/menu/menu.js +47 -46
- package/dist/components/message/hooks.js +36 -27
- package/dist/components/message/index.d.ts +2 -1
- package/dist/components/message/messager.d.ts +3 -0
- package/dist/components/message/messager.js +21 -0
- package/dist/components/message/types.d.ts +15 -5
- package/dist/components/notification/holder.d.ts +2 -2
- package/dist/components/notification/holder.js +83 -51
- package/dist/components/notification/hooks.js +71 -48
- package/dist/components/notification/index.d.ts +4 -3
- package/dist/components/notification/notification.d.ts +2 -2
- package/dist/components/notification/notification.js +161 -127
- package/dist/components/notification/notifier.d.ts +8 -0
- package/dist/components/notification/notifier.js +71 -0
- package/dist/components/notification/types.d.ts +32 -36
- package/dist/components/number-input/hooks.js +35 -0
- package/dist/components/number-input/number-input.js +39 -0
- package/dist/components/otp-input/hooks.js +64 -45
- package/dist/components/otp-input/otp-input.js +45 -40
- package/dist/components/pagination/hooks.js +57 -46
- package/dist/components/pagination/item.js +26 -23
- package/dist/components/pagination/pagination.js +51 -43
- package/dist/components/pagination/types.js +4 -4
- package/dist/components/picker/context.js +4 -4
- package/dist/components/picker/picker.js +68 -61
- package/dist/components/popconfirm/index.d.ts +2 -0
- package/dist/components/popconfirm/popconfirm.d.ts +2 -2
- package/dist/components/popconfirm/popconfirm.js +143 -0
- package/dist/components/popconfirm/types.d.ts +12 -1
- package/dist/components/popover/hooks.d.ts +11 -0
- package/dist/components/popover/hooks.js +52 -0
- package/dist/components/popover/popover.js +90 -80
- package/dist/components/popover/types.d.ts +1 -1
- package/dist/components/popper/dropdown.js +141 -109
- package/dist/components/popper/hooks.js +14 -11
- package/dist/components/popper/popper.js +15 -3
- package/dist/components/portal/portal.js +29 -16
- package/dist/components/progress/circular.js +47 -46
- package/dist/components/progress/hooks.js +32 -21
- package/dist/components/progress/linear.js +57 -55
- package/dist/components/progress/progress.js +13 -5
- package/dist/components/radio/context.js +1 -1
- package/dist/components/radio/group.js +28 -14
- package/dist/components/radio/index.js +2 -2
- package/dist/components/radio/radio.js +159 -144
- package/dist/components/rate/hooks.js +43 -30
- package/dist/components/rate/rate.js +34 -34
- package/dist/components/rate/star.js +81 -74
- package/dist/components/ripple/hooks.js +46 -29
- package/dist/components/ripple/ripple.js +49 -29
- package/dist/components/select/hooks.js +131 -88
- package/dist/components/select/select.js +51 -49
- package/dist/components/select/selections.js +18 -4
- package/dist/components/select/selector.js +38 -32
- package/dist/components/select/utils.js +44 -40
- package/dist/components/skeleton/skeleton.js +76 -14
- package/dist/components/skeleton/types.d.ts +1 -1
- package/dist/components/space/space.js +37 -28
- package/dist/components/steps/context.js +4 -4
- package/dist/components/steps/item.d.ts +1 -1
- package/dist/components/steps/item.js +133 -121
- package/dist/components/steps/steps.js +35 -32
- package/dist/components/steps/types.d.ts +0 -5
- package/dist/components/switch/switch.js +188 -177
- package/dist/components/table/body.js +64 -44
- package/dist/components/table/context.js +4 -4
- package/dist/components/table/header/cell.js +57 -53
- package/dist/components/table/header/header.js +75 -68
- package/dist/components/table/hooks.js +55 -32
- package/dist/components/table/table.js +22 -21
- package/dist/components/tabs/context.js +1 -1
- package/dist/components/tabs/hooks.js +103 -70
- package/dist/components/tabs/navigation.js +73 -66
- package/dist/components/tabs/panels.js +36 -28
- package/dist/components/tabs/tab.js +23 -10
- package/dist/components/tabs/tabs.js +41 -21
- package/dist/components/tag/tag.js +31 -30
- package/dist/components/theme/hooks.js +56 -35
- package/dist/components/theme/theme-provider.js +20 -6
- package/dist/components/theme/theme.js +11 -11
- package/dist/components/theme/tokens.stylex.js +6 -2
- package/dist/components/theme/types.d.ts +4 -6
- package/dist/components/time-picker/hooks.js +20 -10
- package/dist/components/time-picker/panel.js +45 -38
- package/dist/components/time-picker/time-picker.js +32 -22
- package/dist/components/timeline/context.js +3 -3
- package/dist/components/timeline/item.js +88 -79
- package/dist/components/timeline/timeline.js +19 -17
- package/dist/components/tooltip/tooltip.js +12 -4
- package/dist/components/tour/hooks.js +37 -25
- package/dist/components/tour/spotlight.js +30 -29
- package/dist/components/tour/tour.js +89 -75
- package/dist/components/transfer/context.js +2 -2
- package/dist/components/transfer/hooks.js +62 -39
- package/dist/components/transfer/item.js +7 -8
- package/dist/components/transfer/list.js +83 -81
- package/dist/components/transfer/transfer.js +34 -36
- package/dist/components/tree/context.js +5 -5
- package/dist/components/tree/hooks.js +50 -27
- package/dist/components/tree/list.js +59 -42
- package/dist/components/tree/node.js +103 -95
- package/dist/components/tree/tree.js +57 -29
- package/dist/components/upload/upload.js +37 -37
- package/dist/components/upload/uploadeds.js +83 -46
- package/dist/components/visually-hidden/visually-hidden.js +19 -0
- package/dist/components/waterfall/hooks.js +50 -35
- package/dist/components/waterfall/sequential.js +46 -34
- package/dist/components/waterfall/waterfall.js +100 -85
- package/dist/components/watermark/hooks.js +132 -99
- package/dist/components/watermark/watermark.js +51 -42
- package/dist/hooks/use-class-names.d.ts +13 -7
- package/dist/hooks/use-class-names.js +2 -2
- package/dist/hooks/use-closable.js +18 -19
- package/dist/hooks/use-container.d.ts +1 -1
- package/dist/hooks/use-container.js +13 -13
- package/dist/hooks/use-expandable.js +64 -27
- package/dist/hooks/use-gutters.js +8 -5
- package/dist/hooks/use-image.js +32 -24
- package/dist/index.d.ts +6 -3
- package/dist/index.js +6 -1
- package/dist/node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.js +52 -40
- package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js +20 -0
- package/dist/stylex.css +15 -2
- package/dist/utils/class-name.d.ts +40 -21
- package/dist/utils/class-name.js +225 -452
- package/dist/utils/colors.d.ts +3 -1
- package/dist/utils/colors.js +53 -94
- package/dist/utils/keyboard.js +9 -9
- package/dist/utils/layer.js +16 -19
- package/dist/utils/styles.js +2 -1
- package/dist/utils/timespan.js +46 -19
- package/package.json +24 -21
- package/dist/components/countable/countable.js +0 -48
- package/dist/components/countable/index.d.ts +0 -2
- /package/dist/components/{countable → countdown}/types.d.ts +0 -0
- /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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
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
|
|
175
|
+
})) : alt === null || alt === void 0 ? void 0 : alt.slice(0, 2).toUpperCase());
|
|
168
176
|
});
|
|
169
177
|
|
|
170
178
|
export { Avatar as default };
|
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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:
|
|
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,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
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
88
|
-
className,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
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
|
-
|
|
12
|
-
breadcrumb: props
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
20
|
-
items =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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
|
-
|
|
43
|
-
|
|
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
|
-
|
|
9
|
+
var styles = {
|
|
10
10
|
navigation: {
|
|
11
|
-
default: props
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
54
|
-
href,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
|
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 };
|