musae 0.3.3 → 0.3.6
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.cjs +10 -2
- package/dist/components/avatar/avatar.mjs +10 -2
- package/dist/components/button/button.cjs +11 -10
- package/dist/components/button/button.mjs +7 -6
- package/dist/components/calendar/contribution.cjs +251 -0
- package/dist/components/calendar/contribution.d.ts +13 -0
- package/dist/components/calendar/contribution.mjs +249 -0
- package/dist/components/calendar/index.d.ts +2 -1
- package/dist/components/config/provider.cjs +2 -2
- package/dist/components/config/provider.mjs +2 -2
- package/dist/components/drawer/popup.cjs +51 -17
- package/dist/components/drawer/popup.d.ts +1 -1
- package/dist/components/drawer/popup.mjs +51 -17
- package/dist/components/fab/floatable.d.ts +1 -1
- package/dist/components/icon/icons/action/delete.cjs +20 -0
- package/dist/components/icon/icons/action/delete.d.ts +3 -0
- package/dist/components/icon/icons/action/delete.mjs +18 -0
- package/dist/components/icon/icons/action/index.cjs +7 -1
- package/dist/components/icon/icons/action/index.d.ts +5 -1
- package/dist/components/icon/icons/action/index.mjs +6 -2
- package/dist/components/icon/icons/action/three-d-rotation.cjs +28 -0
- package/dist/components/icon/icons/action/three-d-rotation.d.ts +3 -0
- package/dist/components/icon/icons/action/three-d-rotation.mjs +26 -0
- package/dist/components/icon/icons/editor/attch-file.cjs +20 -0
- package/dist/components/icon/icons/editor/attch-file.d.ts +3 -0
- package/dist/components/icon/icons/editor/attch-file.mjs +18 -0
- package/dist/components/icon/icons/editor/index.cjs +4 -1
- package/dist/components/icon/icons/editor/index.d.ts +3 -1
- package/dist/components/icon/icons/editor/index.mjs +4 -2
- package/dist/components/icon/icons/index.cjs +6 -0
- package/dist/components/icon/icons/index.mjs +3 -0
- package/dist/components/image/image.cjs +49 -2
- package/dist/components/image/image.d.ts +1 -1
- package/dist/components/image/image.mjs +50 -3
- package/dist/components/image/index.d.ts +1 -1
- package/dist/components/image/preview/preview.cjs +8 -3
- package/dist/components/image/preview/preview.mjs +8 -3
- package/dist/components/menu/hooks.d.ts +1 -2
- package/dist/components/menu/item.d.ts +2 -3
- package/dist/components/pagination/pagination.cjs +1 -1
- package/dist/components/pagination/pagination.mjs +2 -2
- package/dist/components/popover/popover.cjs +1 -1
- package/dist/components/popover/popover.mjs +1 -1
- package/dist/components/popper/dropdown.cjs +44 -19
- package/dist/components/popper/dropdown.mjs +46 -21
- package/dist/components/popper/hooks.cjs +88 -89
- package/dist/components/popper/hooks.d.ts +7 -13
- package/dist/components/popper/hooks.mjs +91 -91
- package/dist/components/rich-text-editor/plugins/controlled-state/index.cjs +1 -2
- package/dist/components/rich-text-editor/plugins/controlled-state/index.mjs +1 -2
- package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.cjs +5 -4
- package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.d.ts +3 -3
- package/dist/components/rich-text-editor/plugins/markdown-shortcut/index.mjs +3 -4
- package/dist/components/rich-text-editor/rich-text-editor.cjs +5 -5
- package/dist/components/rich-text-editor/rich-text-editor.mjs +3 -3
- package/dist/components/select/utils.cjs +1 -3
- package/dist/components/select/utils.d.ts +1 -1
- package/dist/components/select/utils.mjs +2 -4
- package/dist/components/skeleton/skeleton.cjs +5 -48
- package/dist/components/skeleton/skeleton.d.ts +1 -1
- package/dist/components/skeleton/skeleton.mjs +5 -48
- package/dist/components/steps/context.d.ts +1 -1
- package/dist/components/steps/item.d.ts +1 -1
- package/dist/components/steps/steps.d.ts +1 -1
- package/dist/components/switch/switch.cjs +7 -6
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.mjs +8 -7
- package/dist/components/table/body.cjs +3 -1
- package/dist/components/table/body.mjs +3 -1
- package/dist/components/tabs/context.d.ts +1 -1
- package/dist/components/tabs/hooks.d.ts +2 -2
- package/dist/components/tabs/navigation.d.ts +1 -1
- package/dist/components/tabs/panels.d.ts +1 -1
- package/dist/components/tabs/tab.d.ts +1 -1
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tag/tag.d.ts +1 -1
- package/dist/components/theme/hooks.cjs +6 -6
- package/dist/components/theme/hooks.d.ts +1 -1
- package/dist/components/theme/hooks.mjs +6 -6
- package/dist/components/theme/theme-provider.cjs +12 -6
- package/dist/components/theme/theme-provider.d.ts +2 -2
- package/dist/components/theme/theme-provider.mjs +12 -6
- package/dist/components/time-picker/hooks.d.ts +1 -1
- package/dist/components/time-picker/panel.d.ts +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/timeline/context.d.ts +1 -1
- package/dist/components/timeline/item.d.ts +1 -1
- package/dist/components/timeline/timeline.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/transfer/context.d.ts +1 -1
- package/dist/components/transfer/hooks.d.ts +1 -1
- package/dist/components/transfer/item.d.ts +1 -1
- package/dist/components/transfer/list.d.ts +1 -1
- package/dist/components/transfer/transfer.d.ts +1 -1
- package/dist/components/upload/upload.cjs +31 -6
- package/dist/components/upload/upload.d.ts +2 -2
- package/dist/components/upload/upload.mjs +31 -6
- package/dist/components/upload/uploadeds.cjs +119 -55
- package/dist/components/upload/uploadeds.d.ts +1 -1
- package/dist/components/upload/uploadeds.mjs +121 -57
- package/dist/components/upload/utils.cjs +9 -0
- package/dist/components/upload/utils.d.ts +6 -0
- package/dist/components/upload/utils.mjs +9 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts +1 -1
- package/dist/components/waterfall/sequential.d.ts +1 -1
- package/dist/components/waterfall/waterfall.d.ts +1 -1
- package/dist/components/watermark/hooks.d.ts +1 -1
- package/dist/components/watermark/watermark.d.ts +1 -1
- package/dist/hooks/use-class-names.d.ts +4 -0
- package/dist/hooks/use-closable.cjs +0 -8
- package/dist/hooks/use-closable.mjs +0 -8
- package/dist/hooks/use-container.d.ts +1 -1
- package/dist/hooks/use-lazy-boolean.cjs +2 -2
- package/dist/hooks/use-lazy-boolean.mjs +2 -2
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -0
- package/dist/locale/locales/en_US.cjs +5 -1
- package/dist/locale/locales/en_US.mjs +5 -1
- package/dist/locale/locales/zh_CN.cjs +5 -1
- package/dist/locale/locales/zh_CN.mjs +5 -1
- package/dist/styles.css +16 -7
- package/dist/types/drawer.d.ts +5 -0
- package/dist/types/element.d.ts +1 -56
- package/dist/types/form.d.ts +39 -1
- package/dist/types/image.d.ts +1 -0
- package/dist/types/locale.d.ts +6 -0
- package/dist/types/menu.d.ts +8 -3
- package/dist/types/popper.d.ts +1 -1
- package/dist/types/skeleton.d.ts +0 -7
- package/dist/{components/theme/types.d.ts → types/theme.d.ts} +1 -1
- package/dist/types/tree.d.ts +7 -2
- package/dist/{components/upload/types.d.ts → types/upload.d.ts} +59 -22
- package/dist/{components/waterfall/types.d.ts → types/waterfall.d.ts} +3 -3
- package/dist/utils/class-name.cjs +5 -1
- package/dist/utils/class-name.d.ts +12 -1
- package/dist/utils/class-name.mjs +6 -2
- package/dist/utils/colors.cjs +0 -10
- package/dist/utils/colors.d.ts +1 -4
- package/dist/utils/colors.mjs +1 -10
- package/dist/utils/component-token.cjs +2 -0
- package/dist/utils/component-token.d.ts +3 -1
- package/dist/utils/component-token.mjs +2 -0
- package/dist/utils/date.cjs +13 -0
- package/dist/utils/date.d.ts +6 -0
- package/dist/utils/date.mjs +13 -0
- package/package.json +25 -25
- package/dist/components/icon/icons/three-dimension-rotation.d.ts +0 -3
- /package/dist/{components/steps/types.d.ts → types/steps.d.ts} +0 -0
- /package/dist/{components/switch/types.d.ts → types/switch.d.ts} +0 -0
- /package/dist/{components/tabs/types.d.ts → types/tabs.d.ts} +0 -0
- /package/dist/{components/tag/types.d.ts → types/tag.d.ts} +0 -0
- /package/dist/{components/time-picker/types.d.ts → types/time-picker.d.ts} +0 -0
- /package/dist/{components/timeline/types.d.ts → types/timeline.d.ts} +0 -0
- /package/dist/{components/tooltip/types.d.ts → types/tooltip.d.ts} +0 -0
- /package/dist/{components/transfer/types.d.ts → types/transfer.d.ts} +0 -0
- /package/dist/{components/visually-hidden/types.d.ts → types/visually-hidden.d.ts} +0 -0
- /package/dist/{components/watermark/types.d.ts → types/watermark.d.ts} +0 -0
|
@@ -24,10 +24,10 @@ import { HorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
|
|
|
24
24
|
import { CodeNode } from '@lexical/code';
|
|
25
25
|
import { CheckableListItemNode, replacement } from './nodes/checkable-list-item.mjs';
|
|
26
26
|
import ToolbarPlugin from './plugins/toolbar/index.mjs';
|
|
27
|
-
import MarkdownShortcutPlugin
|
|
27
|
+
import MarkdownShortcutPlugin from './plugins/markdown-shortcut/index.mjs';
|
|
28
28
|
import { typography } from '../theme/theme.mjs';
|
|
29
29
|
import '../checkbox/index.mjs';
|
|
30
|
-
import { $convertFromMarkdownString } from '@lexical/markdown';
|
|
30
|
+
import { $convertFromMarkdownString, TRANSFORMERS } from '@lexical/markdown';
|
|
31
31
|
import styles$1 from '../checkbox/styles.mjs';
|
|
32
32
|
|
|
33
33
|
var _excluded = ["placeholder", "disabled", "defaultValue", "onChange", "value", "className", "style"];
|
|
@@ -176,7 +176,7 @@ var RichTextEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
176
176
|
// different value usage, use different serialization
|
|
177
177
|
switch (_use) {
|
|
178
178
|
case "markdown":
|
|
179
|
-
$convertFromMarkdownString(defaultValue, TRANSFORMERS);
|
|
179
|
+
$convertFromMarkdownString(defaultValue, TRANSFORMERS, void 0, true);
|
|
180
180
|
break;
|
|
181
181
|
default:
|
|
182
182
|
editor.setEditorState(editor.parseEditorState(defaultValue));
|
|
@@ -11,10 +11,8 @@ var relax = require('@aiszlab/relax');
|
|
|
11
11
|
var toValues = function toValues(valueOrValues) {
|
|
12
12
|
// empty
|
|
13
13
|
if (relax.isVoid(valueOrValues)) return [];
|
|
14
|
-
// already array
|
|
15
|
-
if (relax.isArray(valueOrValues)) return valueOrValues;
|
|
16
14
|
// convert to array
|
|
17
|
-
return
|
|
15
|
+
return relax.toArray(valueOrValues);
|
|
18
16
|
};
|
|
19
17
|
/**
|
|
20
18
|
* @description
|
|
@@ -5,7 +5,7 @@ import type { MenuItem } from "musae/types/menu";
|
|
|
5
5
|
* @description
|
|
6
6
|
* convert to value array
|
|
7
7
|
*/
|
|
8
|
-
export declare const toValues: (valueOrValues?: ValueOrValues) =>
|
|
8
|
+
export declare const toValues: (valueOrValues?: ValueOrValues) => (string | number | bigint | Pick<Option, "value" | "label">)[];
|
|
9
9
|
/**
|
|
10
10
|
* @description
|
|
11
11
|
* convert to key
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
2
2
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
5
|
-
import { isVoid,
|
|
5
|
+
import { isVoid, toArray } from '@aiszlab/relax';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @description
|
|
@@ -11,10 +11,8 @@ import { isVoid, isArray } from '@aiszlab/relax';
|
|
|
11
11
|
var toValues = function toValues(valueOrValues) {
|
|
12
12
|
// empty
|
|
13
13
|
if (isVoid(valueOrValues)) return [];
|
|
14
|
-
// already array
|
|
15
|
-
if (isArray(valueOrValues)) return valueOrValues;
|
|
16
14
|
// convert to array
|
|
17
|
-
return
|
|
15
|
+
return toArray(valueOrValues);
|
|
18
16
|
};
|
|
19
17
|
/**
|
|
20
18
|
* @description
|
|
@@ -9,7 +9,7 @@ var relax = require('@aiszlab/relax');
|
|
|
9
9
|
var tokens_stylex = require('../theme/tokens.stylex.cjs');
|
|
10
10
|
var componentToken = require('../../utils/component-token.cjs');
|
|
11
11
|
var hooks = require('../theme/hooks.cjs');
|
|
12
|
-
var
|
|
12
|
+
var color = require('@aiszlab/fuzzy/color');
|
|
13
13
|
|
|
14
14
|
var styles = {
|
|
15
15
|
variables: function variables(props) {
|
|
@@ -22,48 +22,6 @@ var styles = {
|
|
|
22
22
|
"----lighter-shadow": props.lighterShadow != null ? props.lighterShadow : "initial"
|
|
23
23
|
}];
|
|
24
24
|
},
|
|
25
|
-
title: {
|
|
26
|
-
width: "musaex-1fvqbsf",
|
|
27
|
-
height: "musaex-1bti5vo",
|
|
28
|
-
borderRadius: "musaex-ok3b7d",
|
|
29
|
-
borderStartStartRadius: null,
|
|
30
|
-
borderStartEndRadius: null,
|
|
31
|
-
borderEndStartRadius: null,
|
|
32
|
-
borderEndEndRadius: null,
|
|
33
|
-
borderTopLeftRadius: null,
|
|
34
|
-
borderTopRightRadius: null,
|
|
35
|
-
borderBottomLeftRadius: null,
|
|
36
|
-
borderBottomRightRadius: null,
|
|
37
|
-
$$css: true
|
|
38
|
-
},
|
|
39
|
-
button: {
|
|
40
|
-
width: "musaex-1lwsb27",
|
|
41
|
-
height: "musaex-1bti5vo",
|
|
42
|
-
borderRadius: "musaex-z7qqyb",
|
|
43
|
-
borderStartStartRadius: null,
|
|
44
|
-
borderStartEndRadius: null,
|
|
45
|
-
borderEndStartRadius: null,
|
|
46
|
-
borderEndEndRadius: null,
|
|
47
|
-
borderTopLeftRadius: null,
|
|
48
|
-
borderTopRightRadius: null,
|
|
49
|
-
borderBottomLeftRadius: null,
|
|
50
|
-
borderBottomRightRadius: null,
|
|
51
|
-
$$css: true
|
|
52
|
-
},
|
|
53
|
-
avatar: {
|
|
54
|
-
width: "musaex-rdd3y",
|
|
55
|
-
height: "musaex-1bti5vo",
|
|
56
|
-
borderRadius: "musaex-z7qqyb",
|
|
57
|
-
borderStartStartRadius: null,
|
|
58
|
-
borderStartEndRadius: null,
|
|
59
|
-
borderEndStartRadius: null,
|
|
60
|
-
borderEndEndRadius: null,
|
|
61
|
-
borderTopLeftRadius: null,
|
|
62
|
-
borderTopRightRadius: null,
|
|
63
|
-
borderBottomLeftRadius: null,
|
|
64
|
-
borderBottomRightRadius: null,
|
|
65
|
-
$$css: true
|
|
66
|
-
},
|
|
67
25
|
skeleton: {
|
|
68
26
|
background: "musaex-uwpeme",
|
|
69
27
|
backgroundAttachment: null,
|
|
@@ -99,16 +57,15 @@ var styles = {
|
|
|
99
57
|
};
|
|
100
58
|
var Skeleton = function Skeleton(_ref) {
|
|
101
59
|
var _ref$animation = _ref.animation,
|
|
102
|
-
animation = _ref$animation === void 0 ?
|
|
103
|
-
variant = _ref.variant,
|
|
60
|
+
animation = _ref$animation === void 0 ? true : _ref$animation,
|
|
104
61
|
className$1 = _ref.className,
|
|
105
62
|
style = _ref.style;
|
|
106
63
|
var classNames = useClassNames.useClassNames(componentToken.ComponentToken.Skeleton);
|
|
107
64
|
var theme = hooks.useTheme();
|
|
108
65
|
var styled = stylex.default.props(styles.variables({
|
|
109
|
-
shadow:
|
|
110
|
-
lighterShadow:
|
|
111
|
-
}),
|
|
66
|
+
shadow: color.hexToRgba(theme.colors.shadow, tokens_stylex.OPACITY.thin),
|
|
67
|
+
lighterShadow: color.hexToRgba(theme.colors.shadow, tokens_stylex.OPACITY.thick)
|
|
68
|
+
}), styles.skeleton, animation && styles.animation);
|
|
112
69
|
return /*#__PURE__*/React.createElement("div", {
|
|
113
70
|
className: relax.clsx(classNames[className.SkeletonClassToken.Skeleton], className$1, styled.className),
|
|
114
71
|
style: _objectSpread(_objectSpread({}, styled.style), style)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SkeletonProps } from "musae/types/skeleton";
|
|
2
2
|
import React from "react";
|
|
3
|
-
declare const Skeleton: ({ animation,
|
|
3
|
+
declare const Skeleton: ({ animation, className, style }: SkeletonProps) => React.JSX.Element;
|
|
4
4
|
export default Skeleton;
|
|
@@ -7,7 +7,7 @@ import { clsx } from '@aiszlab/relax';
|
|
|
7
7
|
import { OPACITY } from '../theme/tokens.stylex.mjs';
|
|
8
8
|
import { ComponentToken } from '../../utils/component-token.mjs';
|
|
9
9
|
import { useTheme } from '../theme/hooks.mjs';
|
|
10
|
-
import {
|
|
10
|
+
import { hexToRgba } from '@aiszlab/fuzzy/color';
|
|
11
11
|
|
|
12
12
|
var styles = {
|
|
13
13
|
variables: function variables(props) {
|
|
@@ -20,48 +20,6 @@ var styles = {
|
|
|
20
20
|
"----lighter-shadow": props.lighterShadow != null ? props.lighterShadow : "initial"
|
|
21
21
|
}];
|
|
22
22
|
},
|
|
23
|
-
title: {
|
|
24
|
-
width: "musaex-1fvqbsf",
|
|
25
|
-
height: "musaex-1bti5vo",
|
|
26
|
-
borderRadius: "musaex-ok3b7d",
|
|
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
|
-
$$css: true
|
|
36
|
-
},
|
|
37
|
-
button: {
|
|
38
|
-
width: "musaex-1lwsb27",
|
|
39
|
-
height: "musaex-1bti5vo",
|
|
40
|
-
borderRadius: "musaex-z7qqyb",
|
|
41
|
-
borderStartStartRadius: null,
|
|
42
|
-
borderStartEndRadius: null,
|
|
43
|
-
borderEndStartRadius: null,
|
|
44
|
-
borderEndEndRadius: null,
|
|
45
|
-
borderTopLeftRadius: null,
|
|
46
|
-
borderTopRightRadius: null,
|
|
47
|
-
borderBottomLeftRadius: null,
|
|
48
|
-
borderBottomRightRadius: null,
|
|
49
|
-
$$css: true
|
|
50
|
-
},
|
|
51
|
-
avatar: {
|
|
52
|
-
width: "musaex-rdd3y",
|
|
53
|
-
height: "musaex-1bti5vo",
|
|
54
|
-
borderRadius: "musaex-z7qqyb",
|
|
55
|
-
borderStartStartRadius: null,
|
|
56
|
-
borderStartEndRadius: null,
|
|
57
|
-
borderEndStartRadius: null,
|
|
58
|
-
borderEndEndRadius: null,
|
|
59
|
-
borderTopLeftRadius: null,
|
|
60
|
-
borderTopRightRadius: null,
|
|
61
|
-
borderBottomLeftRadius: null,
|
|
62
|
-
borderBottomRightRadius: null,
|
|
63
|
-
$$css: true
|
|
64
|
-
},
|
|
65
23
|
skeleton: {
|
|
66
24
|
background: "musaex-uwpeme",
|
|
67
25
|
backgroundAttachment: null,
|
|
@@ -97,16 +55,15 @@ var styles = {
|
|
|
97
55
|
};
|
|
98
56
|
var Skeleton = function Skeleton(_ref) {
|
|
99
57
|
var _ref$animation = _ref.animation,
|
|
100
|
-
animation = _ref$animation === void 0 ?
|
|
101
|
-
variant = _ref.variant,
|
|
58
|
+
animation = _ref$animation === void 0 ? true : _ref$animation,
|
|
102
59
|
className = _ref.className,
|
|
103
60
|
style = _ref.style;
|
|
104
61
|
var classNames = useClassNames(ComponentToken.Skeleton);
|
|
105
62
|
var theme = useTheme();
|
|
106
63
|
var styled = _stylex.props(styles.variables({
|
|
107
|
-
shadow:
|
|
108
|
-
lighterShadow:
|
|
109
|
-
}),
|
|
64
|
+
shadow: hexToRgba(theme.colors.shadow, OPACITY.thin),
|
|
65
|
+
lighterShadow: hexToRgba(theme.colors.shadow, OPACITY.thick)
|
|
66
|
+
}), styles.skeleton, animation && styles.animation);
|
|
110
67
|
return /*#__PURE__*/React.createElement("div", {
|
|
111
68
|
className: clsx(classNames[SkeletonClassToken.Skeleton], className, styled.className),
|
|
112
69
|
style: _objectSpread(_objectSpread({}, styled.style), style)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ContextValue } from "
|
|
1
|
+
import type { ContextValue } from "musae/types/steps";
|
|
2
2
|
export declare const Context: import("react").Context<ContextValue>;
|
|
@@ -11,6 +11,7 @@ var colors = require('../../utils/colors.cjs');
|
|
|
11
11
|
var useClassNames = require('../../hooks/use-class-names.cjs');
|
|
12
12
|
var className = require('../../utils/class-name.cjs');
|
|
13
13
|
var componentToken = require('../../utils/component-token.cjs');
|
|
14
|
+
var color = require('@aiszlab/fuzzy/color');
|
|
14
15
|
var check = require('../icon/icons/navigation/check.cjs');
|
|
15
16
|
var close = require('../icon/icons/navigation/close.cjs');
|
|
16
17
|
|
|
@@ -258,28 +259,28 @@ var Switch = function Switch(_ref) {
|
|
|
258
259
|
backgroundColor: theme.colors[colors.ColorToken.SurfaceContainerHighest],
|
|
259
260
|
color: theme.colors[colors.ColorToken.OnSurfaceVariant]
|
|
260
261
|
}, disabled && {
|
|
261
|
-
borderColor:
|
|
262
|
-
backgroundColor:
|
|
263
|
-
color:
|
|
262
|
+
borderColor: color.hexToRgba(theme.colors[colors.ColorToken.OnSurface], tokens_stylex.OPACITY.medium),
|
|
263
|
+
backgroundColor: color.hexToRgba(theme.colors[colors.ColorToken.SurfaceVariant], tokens_stylex.OPACITY.medium),
|
|
264
|
+
color: color.hexToRgba(theme.colors[colors.ColorToken.OnSurface], tokens_stylex.OPACITY.thicker)
|
|
264
265
|
})), isChecked && styles["switch"].checked(_objectSpread({
|
|
265
266
|
backgroundColor: theme.colors[colors.ColorToken.Primary],
|
|
266
267
|
color: theme.colors[colors.ColorToken.OnPrimary]
|
|
267
268
|
}, disabled && {
|
|
268
|
-
backgroundColor:
|
|
269
|
+
backgroundColor: color.hexToRgba(theme.colors[colors.ColorToken.OnSurface], tokens_stylex.OPACITY.medium),
|
|
269
270
|
color: theme.colors[colors.ColorToken.Surface]
|
|
270
271
|
})), disabled && styles["switch"].disabled),
|
|
271
272
|
slider: stylex.default.props(styles.slider.normal(_objectSpread({
|
|
272
273
|
backgroundColor: theme.colors[colors.ColorToken.OnSurfaceVariant],
|
|
273
274
|
color: theme.colors[colors.ColorToken.SurfaceContainerHighest]
|
|
274
275
|
}, disabled && {
|
|
275
|
-
backgroundColor:
|
|
276
|
+
backgroundColor: color.hexToRgba(theme.colors[colors.ColorToken.OnSurface], tokens_stylex.OPACITY.thicker),
|
|
276
277
|
color: theme.colors[colors.ColorToken.SurfaceContainerHighest]
|
|
277
278
|
})), icon && styles.slider.icon, disabled && styles.slider.disabled, isChecked && styles.slider.checked(_objectSpread({
|
|
278
279
|
backgroundColor: theme.colors[colors.ColorToken.OnPrimary],
|
|
279
280
|
color: theme.colors[colors.ColorToken.OnPrimaryContainer]
|
|
280
281
|
}, disabled && {
|
|
281
282
|
backgroundColor: theme.colors[colors.ColorToken.Surface],
|
|
282
|
-
color:
|
|
283
|
+
color: color.hexToRgba(theme.colors[colors.ColorToken.OnSurface], tokens_stylex.OPACITY.thicker)
|
|
283
284
|
}))),
|
|
284
285
|
supporting: stylex.default.props(styles.supporting["default"], isChecked && styles.supporting.checked),
|
|
285
286
|
leading: stylex.default.props(styles.supporting.child, styles.leading["default"], isChecked && styles.leading.checked),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { SwitchProps } from "
|
|
2
|
+
import type { SwitchProps } from "musae/types/switch";
|
|
3
3
|
declare const Switch: ({ value, style, className, icon, checkedChildren, uncheckedChildren, disabled, onChange, }: SwitchProps) => React.JSX.Element;
|
|
4
4
|
export default Switch;
|
|
@@ -5,10 +5,11 @@ import { useControlledState, useEvent, clsx } from '@aiszlab/relax';
|
|
|
5
5
|
import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.7.5/node_modules/@stylexjs/stylex/lib/es/stylex.mjs';
|
|
6
6
|
import { OPACITY } from '../theme/tokens.stylex.mjs';
|
|
7
7
|
import { useTheme } from '../theme/hooks.mjs';
|
|
8
|
-
import { ColorToken
|
|
8
|
+
import { ColorToken } from '../../utils/colors.mjs';
|
|
9
9
|
import { useClassNames } from '../../hooks/use-class-names.mjs';
|
|
10
10
|
import { SwitchClassToken } from '../../utils/class-name.mjs';
|
|
11
11
|
import { ComponentToken } from '../../utils/component-token.mjs';
|
|
12
|
+
import { hexToRgba } from '@aiszlab/fuzzy/color';
|
|
12
13
|
import Check from '../icon/icons/navigation/check.mjs';
|
|
13
14
|
import Close from '../icon/icons/navigation/close.mjs';
|
|
14
15
|
|
|
@@ -256,28 +257,28 @@ var Switch = function Switch(_ref) {
|
|
|
256
257
|
backgroundColor: theme.colors[ColorToken.SurfaceContainerHighest],
|
|
257
258
|
color: theme.colors[ColorToken.OnSurfaceVariant]
|
|
258
259
|
}, disabled && {
|
|
259
|
-
borderColor:
|
|
260
|
-
backgroundColor:
|
|
261
|
-
color:
|
|
260
|
+
borderColor: hexToRgba(theme.colors[ColorToken.OnSurface], OPACITY.medium),
|
|
261
|
+
backgroundColor: hexToRgba(theme.colors[ColorToken.SurfaceVariant], OPACITY.medium),
|
|
262
|
+
color: hexToRgba(theme.colors[ColorToken.OnSurface], OPACITY.thicker)
|
|
262
263
|
})), isChecked && styles["switch"].checked(_objectSpread({
|
|
263
264
|
backgroundColor: theme.colors[ColorToken.Primary],
|
|
264
265
|
color: theme.colors[ColorToken.OnPrimary]
|
|
265
266
|
}, disabled && {
|
|
266
|
-
backgroundColor:
|
|
267
|
+
backgroundColor: hexToRgba(theme.colors[ColorToken.OnSurface], OPACITY.medium),
|
|
267
268
|
color: theme.colors[ColorToken.Surface]
|
|
268
269
|
})), disabled && styles["switch"].disabled),
|
|
269
270
|
slider: _stylex.props(styles.slider.normal(_objectSpread({
|
|
270
271
|
backgroundColor: theme.colors[ColorToken.OnSurfaceVariant],
|
|
271
272
|
color: theme.colors[ColorToken.SurfaceContainerHighest]
|
|
272
273
|
}, disabled && {
|
|
273
|
-
backgroundColor:
|
|
274
|
+
backgroundColor: hexToRgba(theme.colors[ColorToken.OnSurface], OPACITY.thicker),
|
|
274
275
|
color: theme.colors[ColorToken.SurfaceContainerHighest]
|
|
275
276
|
})), icon && styles.slider.icon, disabled && styles.slider.disabled, isChecked && styles.slider.checked(_objectSpread({
|
|
276
277
|
backgroundColor: theme.colors[ColorToken.OnPrimary],
|
|
277
278
|
color: theme.colors[ColorToken.OnPrimaryContainer]
|
|
278
279
|
}, disabled && {
|
|
279
280
|
backgroundColor: theme.colors[ColorToken.Surface],
|
|
280
|
-
color:
|
|
281
|
+
color: hexToRgba(theme.colors[ColorToken.OnSurface], OPACITY.thicker)
|
|
281
282
|
}))),
|
|
282
283
|
supporting: _stylex.props(styles.supporting["default"], isChecked && styles.supporting.checked),
|
|
283
284
|
leading: _stylex.props(styles.supporting.child, styles.leading["default"], isChecked && styles.leading.checked),
|
|
@@ -76,7 +76,9 @@ var Body = function Body() {
|
|
|
76
76
|
}));
|
|
77
77
|
var rows = table.getRowModel().rows;
|
|
78
78
|
var _isEmpty = relax.isEmpty(rows);
|
|
79
|
-
return /*#__PURE__*/React.createElement("tbody", null, _isEmpty && (/*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td",
|
|
79
|
+
return /*#__PURE__*/React.createElement("tbody", null, _isEmpty && (/*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
80
|
+
colSpan: table.getAllColumns().length
|
|
81
|
+
}, /*#__PURE__*/React.createElement(empty.default, null)))), !_isEmpty && table.getRowModel().rows.map(function (row) {
|
|
80
82
|
return /*#__PURE__*/React.createElement("tr", {
|
|
81
83
|
key: row.id
|
|
82
84
|
}, row.getVisibleCells().map(function (cell) {
|
|
@@ -74,7 +74,9 @@ var Body = function Body() {
|
|
|
74
74
|
}));
|
|
75
75
|
var rows = table.getRowModel().rows;
|
|
76
76
|
var _isEmpty = isEmpty(rows);
|
|
77
|
-
return /*#__PURE__*/React.createElement("tbody", null, _isEmpty && (/*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td",
|
|
77
|
+
return /*#__PURE__*/React.createElement("tbody", null, _isEmpty && (/*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
78
|
+
colSpan: table.getAllColumns().length
|
|
79
|
+
}, /*#__PURE__*/React.createElement(Empty, null)))), !_isEmpty && table.getRowModel().rows.map(function (row) {
|
|
78
80
|
return /*#__PURE__*/React.createElement("tr", {
|
|
79
81
|
key: row.id
|
|
80
82
|
}, row.getVisibleCells().map(function (cell) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type Key, type RefObject } from "react";
|
|
2
|
-
import type { TabItem } from "
|
|
2
|
+
import type { TabItem } from "musae/types/tabs";
|
|
3
3
|
import type { Partialable } from "@aiszlab/relax/types";
|
|
4
4
|
/**
|
|
5
5
|
* @description
|
|
6
6
|
* use tab context
|
|
7
7
|
*/
|
|
8
|
-
export declare const useTabsContext: () => import("
|
|
8
|
+
export declare const useTabsContext: () => import("musae/types/tabs").ContextValue;
|
|
9
9
|
/**
|
|
10
10
|
* @description
|
|
11
11
|
* tabs
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { TabsProps } from "
|
|
2
|
+
import type { TabsProps } from "musae/types/tabs";
|
|
3
3
|
declare const Tabs: ({ items, className, style, activeKey: _activeKey, defaultActiveKey, forceRender, destroyable, }: TabsProps) => React.JSX.Element | null;
|
|
4
4
|
export default Tabs;
|
|
@@ -8,7 +8,7 @@ var rxjs = require('rxjs');
|
|
|
8
8
|
|
|
9
9
|
var PALETTE = {
|
|
10
10
|
primary: {
|
|
11
|
-
"0": "#
|
|
11
|
+
"0": "#000000",
|
|
12
12
|
"10": "#21005D",
|
|
13
13
|
"20": "#381E72",
|
|
14
14
|
"30": "#4F378B",
|
|
@@ -23,7 +23,7 @@ var PALETTE = {
|
|
|
23
23
|
"100": "#FFF"
|
|
24
24
|
},
|
|
25
25
|
secondary: {
|
|
26
|
-
"0": "#
|
|
26
|
+
"0": "#000000",
|
|
27
27
|
"10": "#1D192B",
|
|
28
28
|
"20": "#332D41",
|
|
29
29
|
"30": "#4A4458",
|
|
@@ -38,7 +38,7 @@ var PALETTE = {
|
|
|
38
38
|
"100": "#FFF"
|
|
39
39
|
},
|
|
40
40
|
tertiary: {
|
|
41
|
-
"0": "#
|
|
41
|
+
"0": "#000000",
|
|
42
42
|
"10": "#31111D",
|
|
43
43
|
"20": "#492532",
|
|
44
44
|
"30": "#633B48",
|
|
@@ -53,7 +53,7 @@ var PALETTE = {
|
|
|
53
53
|
"100": "#FFF"
|
|
54
54
|
},
|
|
55
55
|
error: {
|
|
56
|
-
"0": "#
|
|
56
|
+
"0": "#000000",
|
|
57
57
|
"10": "#410E0B",
|
|
58
58
|
"20": "#601410",
|
|
59
59
|
"30": "#8C1D18",
|
|
@@ -68,7 +68,7 @@ var PALETTE = {
|
|
|
68
68
|
"100": "#FFF"
|
|
69
69
|
},
|
|
70
70
|
neutral: {
|
|
71
|
-
"0": "#
|
|
71
|
+
"0": "#000000",
|
|
72
72
|
"10": "#1D1B20",
|
|
73
73
|
"20": "#48464C",
|
|
74
74
|
"30": "#48464C",
|
|
@@ -83,7 +83,7 @@ var PALETTE = {
|
|
|
83
83
|
"100": "#FFF"
|
|
84
84
|
},
|
|
85
85
|
neutralVariant: {
|
|
86
|
-
"0": "#
|
|
86
|
+
"0": "#000000",
|
|
87
87
|
"10": "#1D1A22",
|
|
88
88
|
"20": "#322F37",
|
|
89
89
|
"30": "#49454F",
|
|
@@ -8,7 +8,7 @@ import { Observable, distinctUntilChanged } from 'rxjs';
|
|
|
8
8
|
|
|
9
9
|
var PALETTE = {
|
|
10
10
|
primary: {
|
|
11
|
-
"0": "#
|
|
11
|
+
"0": "#000000",
|
|
12
12
|
"10": "#21005D",
|
|
13
13
|
"20": "#381E72",
|
|
14
14
|
"30": "#4F378B",
|
|
@@ -23,7 +23,7 @@ var PALETTE = {
|
|
|
23
23
|
"100": "#FFF"
|
|
24
24
|
},
|
|
25
25
|
secondary: {
|
|
26
|
-
"0": "#
|
|
26
|
+
"0": "#000000",
|
|
27
27
|
"10": "#1D192B",
|
|
28
28
|
"20": "#332D41",
|
|
29
29
|
"30": "#4A4458",
|
|
@@ -38,7 +38,7 @@ var PALETTE = {
|
|
|
38
38
|
"100": "#FFF"
|
|
39
39
|
},
|
|
40
40
|
tertiary: {
|
|
41
|
-
"0": "#
|
|
41
|
+
"0": "#000000",
|
|
42
42
|
"10": "#31111D",
|
|
43
43
|
"20": "#492532",
|
|
44
44
|
"30": "#633B48",
|
|
@@ -53,7 +53,7 @@ var PALETTE = {
|
|
|
53
53
|
"100": "#FFF"
|
|
54
54
|
},
|
|
55
55
|
error: {
|
|
56
|
-
"0": "#
|
|
56
|
+
"0": "#000000",
|
|
57
57
|
"10": "#410E0B",
|
|
58
58
|
"20": "#601410",
|
|
59
59
|
"30": "#8C1D18",
|
|
@@ -68,7 +68,7 @@ var PALETTE = {
|
|
|
68
68
|
"100": "#FFF"
|
|
69
69
|
},
|
|
70
70
|
neutral: {
|
|
71
|
-
"0": "#
|
|
71
|
+
"0": "#000000",
|
|
72
72
|
"10": "#1D1B20",
|
|
73
73
|
"20": "#48464C",
|
|
74
74
|
"30": "#48464C",
|
|
@@ -83,7 +83,7 @@ var PALETTE = {
|
|
|
83
83
|
"100": "#FFF"
|
|
84
84
|
},
|
|
85
85
|
neutralVariant: {
|
|
86
|
-
"0": "#
|
|
86
|
+
"0": "#000000",
|
|
87
87
|
"10": "#1D1A22",
|
|
88
88
|
"20": "#322F37",
|
|
89
89
|
"30": "#49454F",
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var hooks = require('./hooks.cjs');
|
|
5
|
-
var
|
|
5
|
+
var relax = require('@aiszlab/relax');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @author murukal
|
|
@@ -11,13 +11,19 @@ var deepmerge = require('deepmerge');
|
|
|
11
11
|
* theme provider
|
|
12
12
|
* if user provider theme, we will merge it with presets theme
|
|
13
13
|
*/
|
|
14
|
-
var ThemeProvider = function ThemeProvider(
|
|
14
|
+
var ThemeProvider = function ThemeProvider(_ref) {
|
|
15
|
+
var _theme = _ref.theme,
|
|
16
|
+
children = _ref.children;
|
|
15
17
|
var theme = React.useMemo(function () {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
if (!_theme) {
|
|
19
|
+
return {
|
|
20
|
+
palette: hooks.PALETTE
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return relax.merge(_theme, {
|
|
18
24
|
palette: hooks.PALETTE
|
|
19
25
|
});
|
|
20
|
-
}, [
|
|
26
|
+
}, [_theme]);
|
|
21
27
|
var _useSwitchable = hooks.useSwitchable({
|
|
22
28
|
theme: theme
|
|
23
29
|
}),
|
|
@@ -30,7 +36,7 @@ var ThemeProvider = function ThemeProvider(props) {
|
|
|
30
36
|
mode: mode,
|
|
31
37
|
toggle: toggle
|
|
32
38
|
}
|
|
33
|
-
},
|
|
39
|
+
}, children);
|
|
34
40
|
};
|
|
35
41
|
|
|
36
42
|
exports.default = ThemeProvider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { Props } from "
|
|
2
|
+
import type { Props } from "musae/types/theme";
|
|
3
3
|
/**
|
|
4
4
|
* @author murukal
|
|
5
5
|
*
|
|
@@ -7,5 +7,5 @@ import type { Props } from "./types";
|
|
|
7
7
|
* theme provider
|
|
8
8
|
* if user provider theme, we will merge it with presets theme
|
|
9
9
|
*/
|
|
10
|
-
declare const ThemeProvider: (
|
|
10
|
+
declare const ThemeProvider: ({ theme: _theme, children }: Props) => React.JSX.Element;
|
|
11
11
|
export default ThemeProvider;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { PALETTE, useSwitchable, Context } from './hooks.mjs';
|
|
3
|
-
import
|
|
3
|
+
import { merge } from '@aiszlab/relax';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @author murukal
|
|
@@ -9,13 +9,19 @@ import deepmerge from 'deepmerge';
|
|
|
9
9
|
* theme provider
|
|
10
10
|
* if user provider theme, we will merge it with presets theme
|
|
11
11
|
*/
|
|
12
|
-
var ThemeProvider = function ThemeProvider(
|
|
12
|
+
var ThemeProvider = function ThemeProvider(_ref) {
|
|
13
|
+
var _theme = _ref.theme,
|
|
14
|
+
children = _ref.children;
|
|
13
15
|
var theme = useMemo(function () {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
if (!_theme) {
|
|
17
|
+
return {
|
|
18
|
+
palette: PALETTE
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return merge(_theme, {
|
|
16
22
|
palette: PALETTE
|
|
17
23
|
});
|
|
18
|
-
}, [
|
|
24
|
+
}, [_theme]);
|
|
19
25
|
var _useSwitchable = useSwitchable({
|
|
20
26
|
theme: theme
|
|
21
27
|
}),
|
|
@@ -28,7 +34,7 @@ var ThemeProvider = function ThemeProvider(props) {
|
|
|
28
34
|
mode: mode,
|
|
29
35
|
toggle: toggle
|
|
30
36
|
}
|
|
31
|
-
},
|
|
37
|
+
}, children);
|
|
32
38
|
};
|
|
33
39
|
|
|
34
40
|
export { ThemeProvider as default };
|