@bifrostui/react 1.3.1-beta.1 → 1.3.3
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/ActionSheet/ActionSheet.css +3 -6
- package/dist/ActionSheet/ActionSheetItem.css +6 -10
- package/dist/Alert/index.css +8 -14
- package/dist/Avatar/Avatar.css +9 -13
- package/dist/Avatar/AvatarGroup.css +8 -15
- package/dist/Backdrop/Backdrop.css +1 -2
- package/dist/Badge/Badge.css +17 -27
- package/dist/Button/Button.css +17 -26
- package/dist/Calendar/Calendar.css +18 -33
- package/dist/Calendar/Calendar.d.ts +1 -1
- package/dist/Calendar/Calendar.js +17 -38
- package/dist/Calendar/Calendar.types.d.ts +0 -21
- package/dist/Card/CardFooter.css +1 -2
- package/dist/Card/CardHeader.css +1 -3
- package/dist/Checkbox/Checkbox.css +5 -7
- package/dist/CitySelector/CitySelector.css +15 -29
- package/dist/CitySelector/CitySelectorCore.js +16 -25
- package/dist/CitySelector/Selector/index.css +4 -4
- package/dist/Countdown/Countdown.css +1 -2
- package/dist/Dialog/Dialog.d.ts +2 -2
- package/dist/Dialog/Dialog.js +8 -20
- package/dist/Dialog/Dialog.types.d.ts +1 -12
- package/dist/Dialog/FunctionalDialog.js +2 -38
- package/dist/Dialog/index.css +18 -27
- package/dist/Divider/Divider.css +4 -6
- package/dist/IconButton/IconButton.css +7 -9
- package/dist/Image/index.css +1 -2
- package/dist/Input/Input.css +5 -10
- package/dist/List/List.css +0 -3
- package/dist/List/ListItem.css +3 -3
- package/dist/List/ListItemContent.css +1 -1
- package/dist/Loading/Loading.css +2 -4
- package/dist/Modal/Modal.miniapp.d.ts +1 -1
- package/dist/NavBar/NavBar.css +5 -9
- package/dist/Picker/Picker.css +29 -25
- package/dist/Picker/Picker.js +11 -31
- package/dist/Picker/Picker.types.d.ts +0 -4
- package/dist/Picker/PickerPanel.css +8 -8
- package/dist/Picker/PickerPanel.js +8 -14
- package/dist/Picker/utils.d.ts +0 -16
- package/dist/Picker/utils.js +2 -32
- package/dist/Portal/Portal.types.d.ts +0 -4
- package/dist/Portal/PortalCore.js +1 -8
- package/dist/Progress/Progress.css +6 -8
- package/dist/Radio/Radio.css +1 -2
- package/dist/Rating/Rating.css +4 -8
- package/dist/Select/Select.css +10 -21
- package/dist/Select/Select.js +1 -1
- package/dist/Select/SelectOption.js +0 -3
- package/dist/Skeleton/Skeleton.css +2 -3
- package/dist/Slider/Slider.css +13 -24
- package/dist/Steps/Step.css +11 -11
- package/dist/Steps/Steps.css +5 -14
- package/dist/Swiper/Swiper.css +1 -2
- package/dist/Switch/Switch.css +16 -31
- package/dist/TabBar/TabBar.css +3 -7
- package/dist/TabBar/TabBarItem.css +1 -0
- package/dist/Tabs/Tab.css +6 -2
- package/dist/Tabs/Tabs.css +4 -7
- package/dist/Tag/Tag.css +10 -7
- package/dist/Tag/TagGroup.css +1 -9
- package/dist/TextArea/TextArea.css +8 -14
- package/dist/Toast/FunctionalToast.js +0 -18
- package/dist/Toast/Toast.css +14 -15
- package/dist/Toast/Toast.d.ts +2 -2
- package/dist/Toast/Toast.js +48 -52
- package/dist/Toast/Toast.types.d.ts +1 -15
- package/dist/index.d.ts +0 -7
- package/dist/index.js +1 -15
- package/es/ActionSheet/ActionSheet.css +3 -6
- package/es/ActionSheet/ActionSheetItem.css +6 -10
- package/es/Alert/index.css +8 -14
- package/es/Avatar/Avatar.css +9 -13
- package/es/Avatar/AvatarGroup.css +8 -15
- package/es/Backdrop/Backdrop.css +1 -2
- package/es/Badge/Badge.css +17 -27
- package/es/Button/Button.css +17 -26
- package/es/Calendar/Calendar.css +18 -33
- package/es/Calendar/Calendar.d.ts +1 -1
- package/es/Calendar/Calendar.js +17 -38
- package/es/Calendar/Calendar.types.d.ts +0 -21
- package/es/Card/CardFooter.css +1 -2
- package/es/Card/CardHeader.css +1 -3
- package/es/Checkbox/Checkbox.css +5 -7
- package/es/CitySelector/CitySelector.css +15 -29
- package/es/CitySelector/CitySelectorCore.js +16 -25
- package/es/CitySelector/Selector/index.css +4 -4
- package/es/Countdown/Countdown.css +1 -2
- package/es/Dialog/Dialog.d.ts +2 -2
- package/es/Dialog/Dialog.js +8 -20
- package/es/Dialog/Dialog.types.d.ts +1 -12
- package/es/Dialog/FunctionalDialog.js +2 -38
- package/es/Dialog/index.css +18 -27
- package/es/Divider/Divider.css +4 -6
- package/es/IconButton/IconButton.css +7 -9
- package/es/Image/index.css +1 -2
- package/es/Input/Input.css +5 -10
- package/es/List/List.css +0 -3
- package/es/List/ListItem.css +3 -3
- package/es/List/ListItemContent.css +1 -1
- package/es/Loading/Loading.css +2 -4
- package/es/Modal/Modal.miniapp.d.ts +1 -1
- package/es/NavBar/NavBar.css +5 -9
- package/es/Picker/Picker.css +29 -25
- package/es/Picker/Picker.js +12 -32
- package/es/Picker/Picker.types.d.ts +0 -4
- package/es/Picker/PickerPanel.css +8 -8
- package/es/Picker/PickerPanel.js +8 -14
- package/es/Picker/utils.d.ts +0 -16
- package/es/Picker/utils.js +1 -29
- package/es/Portal/Portal.types.d.ts +0 -4
- package/es/Portal/PortalCore.js +1 -8
- package/es/Progress/Progress.css +6 -8
- package/es/Radio/Radio.css +1 -2
- package/es/Rating/Rating.css +4 -8
- package/es/Select/Select.css +10 -21
- package/es/Select/Select.js +1 -1
- package/es/Select/SelectOption.js +0 -3
- package/es/Skeleton/Skeleton.css +2 -3
- package/es/Slider/Slider.css +13 -24
- package/es/Steps/Step.css +11 -11
- package/es/Steps/Steps.css +5 -14
- package/es/Swiper/Swiper.css +1 -2
- package/es/Switch/Switch.css +16 -31
- package/es/TabBar/TabBar.css +3 -7
- package/es/TabBar/TabBarItem.css +1 -0
- package/es/Tabs/Tab.css +6 -2
- package/es/Tabs/Tabs.css +4 -7
- package/es/Tag/Tag.css +10 -7
- package/es/Tag/TagGroup.css +1 -9
- package/es/TextArea/TextArea.css +8 -14
- package/es/Toast/FunctionalToast.js +0 -18
- package/es/Toast/Toast.css +14 -15
- package/es/Toast/Toast.d.ts +2 -2
- package/es/Toast/Toast.js +49 -53
- package/es/Toast/Toast.types.d.ts +1 -15
- package/es/index.d.ts +0 -7
- package/es/index.js +0 -7
- package/package.json +5 -5
- package/dist/Breadcrumb/Breadcrumb.css +0 -34
- package/dist/Breadcrumb/Breadcrumb.d.ts +0 -5
- package/dist/Breadcrumb/Breadcrumb.js +0 -128
- package/dist/Breadcrumb/Breadcrumb.types.d.ts +0 -49
- package/dist/Breadcrumb/Breadcrumb.types.js +0 -15
- package/dist/Breadcrumb/BreadcrumbItem.d.ts +0 -4
- package/dist/Breadcrumb/BreadcrumbItem.js +0 -78
- package/dist/Breadcrumb/index.d.ts +0 -4
- package/dist/Breadcrumb/index.js +0 -45
- package/dist/Collapse/Collapse.css +0 -6
- package/dist/Collapse/Collapse.d.ts +0 -5
- package/dist/Collapse/Collapse.js +0 -165
- package/dist/Collapse/Collapse.types.d.ts +0 -16
- package/dist/Collapse/Collapse.types.js +0 -15
- package/dist/Collapse/index.d.ts +0 -2
- package/dist/Collapse/index.js +0 -41
- package/dist/CollapsePanel/CollapsePanel.css +0 -32
- package/dist/CollapsePanel/CollapsePanel.d.ts +0 -5
- package/dist/CollapsePanel/CollapsePanel.js +0 -159
- package/dist/CollapsePanel/CollapsePanel.types.d.ts +0 -64
- package/dist/CollapsePanel/CollapsePanel.types.js +0 -15
- package/dist/CollapsePanel/CollapsePanelItem.d.ts +0 -4
- package/dist/CollapsePanel/CollapsePanelItem.js +0 -112
- package/dist/CollapsePanel/index.d.ts +0 -4
- package/dist/CollapsePanel/index.js +0 -45
- package/dist/Popover/Popover.css +0 -97
- package/dist/Popover/Popover.d.ts +0 -5
- package/dist/Popover/Popover.js +0 -186
- package/dist/Popover/Popover.types.d.ts +0 -59
- package/dist/Popover/Popover.types.js +0 -15
- package/dist/Popover/index.d.ts +0 -2
- package/dist/Popover/index.js +0 -41
- package/dist/ThemeProvider/ThemeProvider.d.ts +0 -4
- package/dist/ThemeProvider/ThemeProvider.js +0 -91
- package/dist/ThemeProvider/ThemeProvider.types.d.ts +0 -127
- package/dist/ThemeProvider/ThemeProvider.types.js +0 -27
- package/dist/ThemeProvider/hooks/ThemeContext.d.ts +0 -4
- package/dist/ThemeProvider/hooks/ThemeContext.js +0 -35
- package/dist/ThemeProvider/hooks/createTheme.d.ts +0 -2
- package/dist/ThemeProvider/hooks/createTheme.js +0 -55
- package/dist/ThemeProvider/hooks/index.d.ts +0 -4
- package/dist/ThemeProvider/hooks/index.js +0 -43
- package/dist/ThemeProvider/hooks/useTheme.d.ts +0 -1
- package/dist/ThemeProvider/hooks/useTheme.js +0 -39
- package/dist/ThemeProvider/index.d.ts +0 -4
- package/dist/ThemeProvider/index.js +0 -45
- package/dist/ThemeProvider/utils/constants.d.ts +0 -38
- package/dist/ThemeProvider/utils/constants.js +0 -65
- package/dist/ThemeProvider/utils/index.d.ts +0 -2
- package/dist/ThemeProvider/utils/index.js +0 -23
- package/dist/ThemeProvider/utils/mountTokens.d.ts +0 -26
- package/dist/ThemeProvider/utils/mountTokens.js +0 -123
- package/dist/Tooltip/Tooltip.css +0 -91
- package/dist/Tooltip/Tooltip.d.ts +0 -5
- package/dist/Tooltip/Tooltip.js +0 -175
- package/dist/Tooltip/Tooltip.types.d.ts +0 -50
- package/dist/Tooltip/Tooltip.types.js +0 -15
- package/dist/Tooltip/index.d.ts +0 -2
- package/dist/Tooltip/index.js +0 -41
- package/dist/locales/base.d.ts +0 -40
- package/dist/locales/base.js +0 -15
- package/dist/locales/en-US.d.ts +0 -3
- package/dist/locales/en-US.js +0 -69
- package/dist/locales/hooks/useLocaleText.d.ts +0 -3
- package/dist/locales/hooks/useLocaleText.js +0 -43
- package/dist/locales/index.d.ts +0 -5
- package/dist/locales/index.js +0 -49
- package/dist/locales/zh-CN.d.ts +0 -3
- package/dist/locales/zh-CN.js +0 -51
- package/dist/locales/zh-TW.d.ts +0 -3
- package/dist/locales/zh-TW.js +0 -51
- package/es/Breadcrumb/Breadcrumb.css +0 -34
- package/es/Breadcrumb/Breadcrumb.d.ts +0 -5
- package/es/Breadcrumb/Breadcrumb.js +0 -101
- package/es/Breadcrumb/Breadcrumb.types.d.ts +0 -49
- package/es/Breadcrumb/Breadcrumb.types.js +0 -1
- package/es/Breadcrumb/BreadcrumbItem.d.ts +0 -4
- package/es/Breadcrumb/BreadcrumbItem.js +0 -51
- package/es/Breadcrumb/index.d.ts +0 -4
- package/es/Breadcrumb/index.js +0 -9
- package/es/Collapse/Collapse.css +0 -6
- package/es/Collapse/Collapse.d.ts +0 -5
- package/es/Collapse/Collapse.js +0 -144
- package/es/Collapse/Collapse.types.d.ts +0 -16
- package/es/Collapse/Collapse.types.js +0 -1
- package/es/Collapse/index.d.ts +0 -2
- package/es/Collapse/index.js +0 -6
- package/es/CollapsePanel/CollapsePanel.css +0 -32
- package/es/CollapsePanel/CollapsePanel.d.ts +0 -5
- package/es/CollapsePanel/CollapsePanel.js +0 -132
- package/es/CollapsePanel/CollapsePanel.types.d.ts +0 -64
- package/es/CollapsePanel/CollapsePanel.types.js +0 -1
- package/es/CollapsePanel/CollapsePanelItem.d.ts +0 -4
- package/es/CollapsePanel/CollapsePanelItem.js +0 -85
- package/es/CollapsePanel/index.d.ts +0 -4
- package/es/CollapsePanel/index.js +0 -9
- package/es/Popover/Popover.css +0 -97
- package/es/Popover/Popover.d.ts +0 -5
- package/es/Popover/Popover.js +0 -163
- package/es/Popover/Popover.types.d.ts +0 -59
- package/es/Popover/Popover.types.js +0 -1
- package/es/Popover/index.d.ts +0 -2
- package/es/Popover/index.js +0 -6
- package/es/ThemeProvider/ThemeProvider.d.ts +0 -4
- package/es/ThemeProvider/ThemeProvider.js +0 -62
- package/es/ThemeProvider/ThemeProvider.types.d.ts +0 -127
- package/es/ThemeProvider/ThemeProvider.types.js +0 -1
- package/es/ThemeProvider/hooks/ThemeContext.d.ts +0 -4
- package/es/ThemeProvider/hooks/ThemeContext.js +0 -6
- package/es/ThemeProvider/hooks/createTheme.d.ts +0 -2
- package/es/ThemeProvider/hooks/createTheme.js +0 -38
- package/es/ThemeProvider/hooks/index.d.ts +0 -4
- package/es/ThemeProvider/hooks/index.js +0 -8
- package/es/ThemeProvider/hooks/useTheme.d.ts +0 -1
- package/es/ThemeProvider/hooks/useTheme.js +0 -10
- package/es/ThemeProvider/index.d.ts +0 -4
- package/es/ThemeProvider/index.js +0 -8
- package/es/ThemeProvider/utils/constants.d.ts +0 -38
- package/es/ThemeProvider/utils/constants.js +0 -40
- package/es/ThemeProvider/utils/index.d.ts +0 -2
- package/es/ThemeProvider/utils/index.js +0 -2
- package/es/ThemeProvider/utils/mountTokens.d.ts +0 -26
- package/es/ThemeProvider/utils/mountTokens.js +0 -88
- package/es/Tooltip/Tooltip.css +0 -91
- package/es/Tooltip/Tooltip.d.ts +0 -5
- package/es/Tooltip/Tooltip.js +0 -152
- package/es/Tooltip/Tooltip.types.d.ts +0 -50
- package/es/Tooltip/Tooltip.types.js +0 -1
- package/es/Tooltip/index.d.ts +0 -2
- package/es/Tooltip/index.js +0 -6
- package/es/locales/base.d.ts +0 -40
- package/es/locales/base.js +0 -0
- package/es/locales/en-US.d.ts +0 -3
- package/es/locales/en-US.js +0 -50
- package/es/locales/hooks/useLocaleText.d.ts +0 -3
- package/es/locales/hooks/useLocaleText.js +0 -26
- package/es/locales/index.d.ts +0 -5
- package/es/locales/index.js +0 -11
- package/es/locales/zh-CN.d.ts +0 -3
- package/es/locales/zh-CN.js +0 -32
- package/es/locales/zh-TW.d.ts +0 -3
- package/es/locales/zh-TW.js +0 -32
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var ThemeProvider_exports = {};
|
|
29
|
-
__export(ThemeProvider_exports, {
|
|
30
|
-
default: () => ThemeProvider_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(ThemeProvider_exports);
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_utils = require("@bifrostui/utils");
|
|
35
|
-
var import_hooks = require("./hooks");
|
|
36
|
-
var import_constants = require("./utils/constants");
|
|
37
|
-
var import_mountTokens = require("./utils/mountTokens");
|
|
38
|
-
const ThemeProvider = /* @__PURE__ */ import_react.default.forwardRef(
|
|
39
|
-
(props, ref) => {
|
|
40
|
-
var _a;
|
|
41
|
-
const {
|
|
42
|
-
isRoot,
|
|
43
|
-
locale,
|
|
44
|
-
responsive,
|
|
45
|
-
defaultLightToken,
|
|
46
|
-
defaultDarkToken,
|
|
47
|
-
dmLightToken,
|
|
48
|
-
dmDarkToken,
|
|
49
|
-
token,
|
|
50
|
-
children
|
|
51
|
-
} = props;
|
|
52
|
-
let containerId = (0, import_utils.useUniqueId)();
|
|
53
|
-
containerId = `${import_constants.BUI_VAR_PREFIX}${containerId}`;
|
|
54
|
-
const theme = (0, import_react.useMemo)(() => {
|
|
55
|
-
return { locale };
|
|
56
|
-
}, [locale]);
|
|
57
|
-
let childrenNode = children;
|
|
58
|
-
if (!isRoot && import_react.default.isValidElement(children)) {
|
|
59
|
-
childrenNode = import_react.default.cloneElement(children, {
|
|
60
|
-
className: `${containerId} ${((_a = children == null ? void 0 : children.props) == null ? void 0 : _a.className) || ""}`.trim()
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
(0, import_react.useEffect)(() => {
|
|
64
|
-
if (responsive || defaultLightToken || defaultDarkToken || dmLightToken || dmDarkToken || token) {
|
|
65
|
-
(0, import_mountTokens.mountTokens)({
|
|
66
|
-
isRoot,
|
|
67
|
-
containerId,
|
|
68
|
-
container: children,
|
|
69
|
-
responsive,
|
|
70
|
-
defaultLightToken,
|
|
71
|
-
defaultDarkToken,
|
|
72
|
-
dmLightToken,
|
|
73
|
-
dmDarkToken,
|
|
74
|
-
token
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}, [
|
|
78
|
-
isRoot,
|
|
79
|
-
containerId,
|
|
80
|
-
responsive,
|
|
81
|
-
defaultLightToken,
|
|
82
|
-
defaultDarkToken,
|
|
83
|
-
dmLightToken,
|
|
84
|
-
dmDarkToken,
|
|
85
|
-
token
|
|
86
|
-
]);
|
|
87
|
-
return /* @__PURE__ */ import_react.default.createElement(import_hooks.ThemeContext.Provider, { value: theme }, childrenNode);
|
|
88
|
-
}
|
|
89
|
-
);
|
|
90
|
-
ThemeProvider.displayName = "BuiThemeProvider";
|
|
91
|
-
var ThemeProvider_default = ThemeProvider;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { OverrideProps } from '@bifrostui/types';
|
|
3
|
-
import { BaseLang } from '../locales/base';
|
|
4
|
-
export type ThemeProviderProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
5
|
-
props: P & ThemeProps;
|
|
6
|
-
defaultComponent: D;
|
|
7
|
-
}, D>;
|
|
8
|
-
export interface Breakpoints {
|
|
9
|
-
/**
|
|
10
|
-
* 超小屏幕 (小于 576px,实际为了处理临界值,断点值为 575.98px)
|
|
11
|
-
* @default '575.98px'
|
|
12
|
-
*/
|
|
13
|
-
xs?: string;
|
|
14
|
-
/**
|
|
15
|
-
* 小屏幕
|
|
16
|
-
* @default '576px'
|
|
17
|
-
*/
|
|
18
|
-
sm?: string;
|
|
19
|
-
/**
|
|
20
|
-
* 中等屏幕
|
|
21
|
-
* @default '768px'
|
|
22
|
-
*/
|
|
23
|
-
md?: string;
|
|
24
|
-
/**
|
|
25
|
-
* 大屏幕
|
|
26
|
-
* @default '992px'
|
|
27
|
-
*/
|
|
28
|
-
lg?: string;
|
|
29
|
-
/**
|
|
30
|
-
* 超大屏幕
|
|
31
|
-
* @default '1200px'
|
|
32
|
-
*/
|
|
33
|
-
xl?: string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* 响应式屏幕断点配置
|
|
37
|
-
*/
|
|
38
|
-
interface ResponsiveTokenOptions {
|
|
39
|
-
/**
|
|
40
|
-
* 超小屏幕 (小于 576px,实际为了处理临界值,断点值为 575.98px)
|
|
41
|
-
*/
|
|
42
|
-
xs?: Record<string, string>;
|
|
43
|
-
/**
|
|
44
|
-
* 小屏幕 (≥ 576px)
|
|
45
|
-
*/
|
|
46
|
-
sm?: Record<string, string>;
|
|
47
|
-
/**
|
|
48
|
-
* 中等屏幕 (≥ 768px)
|
|
49
|
-
*/
|
|
50
|
-
md?: Record<string, string>;
|
|
51
|
-
/**
|
|
52
|
-
* 大屏幕 (≥ 992px)
|
|
53
|
-
*/
|
|
54
|
-
lg?: Record<string, string>;
|
|
55
|
-
/**
|
|
56
|
-
* 超大屏幕 (≥ 1200px)
|
|
57
|
-
*/
|
|
58
|
-
xl?: Record<string, string>;
|
|
59
|
-
}
|
|
60
|
-
interface ThemeProps {
|
|
61
|
-
/**
|
|
62
|
-
* 当前ThemeProvider是否为最顶层
|
|
63
|
-
* 若当前应用会出现嵌套的ThemeProvider,则需要将最外层的ThemeProvider isRoot属性设置为true
|
|
64
|
-
* TODO 不通过属性判断
|
|
65
|
-
* @default false
|
|
66
|
-
*/
|
|
67
|
-
isRoot?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* 挂载的容器
|
|
70
|
-
* @default root
|
|
71
|
-
*/
|
|
72
|
-
container?: ReactNode;
|
|
73
|
-
/**
|
|
74
|
-
* 挂载容器的id
|
|
75
|
-
*/
|
|
76
|
-
containerId?: string;
|
|
77
|
-
/**
|
|
78
|
-
* 语言
|
|
79
|
-
*/
|
|
80
|
-
locale?: BaseLang;
|
|
81
|
-
/**
|
|
82
|
-
* 响应式屏幕断点配置
|
|
83
|
-
*/
|
|
84
|
-
responsive?: ResponsiveTokenOptions;
|
|
85
|
-
/**
|
|
86
|
-
* 默认高亮主题Token
|
|
87
|
-
*/
|
|
88
|
-
defaultLightToken?: Record<string, string>;
|
|
89
|
-
/**
|
|
90
|
-
* 默认暗黑主题Token
|
|
91
|
-
*/
|
|
92
|
-
defaultDarkToken?: Record<string, string>;
|
|
93
|
-
/**
|
|
94
|
-
* 大麦高亮主题Token
|
|
95
|
-
*/
|
|
96
|
-
dmLightToken?: Record<string, string>;
|
|
97
|
-
/**
|
|
98
|
-
* 大麦暗黑主题Token
|
|
99
|
-
*/
|
|
100
|
-
dmDarkToken?: Record<string, string>;
|
|
101
|
-
/**
|
|
102
|
-
* 组件全局Token
|
|
103
|
-
*/
|
|
104
|
-
token?: Record<string, string>;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* 复写内置主题Tokens
|
|
108
|
-
*/
|
|
109
|
-
type BuiltInThemesTokenOptions = Pick<ThemeProps, 'defaultLightToken' | 'defaultDarkToken' | 'dmLightToken' | 'dmDarkToken'>;
|
|
110
|
-
/**
|
|
111
|
-
* 挂载组件自定义Tokens参数
|
|
112
|
-
*/
|
|
113
|
-
export type MountComponentsTokenOptions = Pick<ThemeProps, 'isRoot' | 'container' | 'containerId' | 'token'>;
|
|
114
|
-
/**
|
|
115
|
-
* 挂载响应式Tokens参数
|
|
116
|
-
*/
|
|
117
|
-
type componentsTokenOptions = Pick<ThemeProps, 'token'>;
|
|
118
|
-
export type MountResponsiveTokenOptions = Pick<ThemeProps, 'responsive'> & {
|
|
119
|
-
breakpoints?: Breakpoints;
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* 更新Tokens
|
|
123
|
-
*/
|
|
124
|
-
export type UpdateTokensOptions = Pick<ThemeProps, 'isRoot' | 'containerId' | 'container'> & {
|
|
125
|
-
rootString: string;
|
|
126
|
-
};
|
|
127
|
-
export { BaseLang, ResponsiveTokenOptions, ThemeProps, BuiltInThemesTokenOptions, componentsTokenOptions, };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var ThemeProvider_types_exports = {};
|
|
19
|
-
__export(ThemeProvider_types_exports, {
|
|
20
|
-
BaseLang: () => import_base.BaseLang
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(ThemeProvider_types_exports);
|
|
23
|
-
var import_base = require("../locales/base");
|
|
24
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
25
|
-
0 && (module.exports = {
|
|
26
|
-
BaseLang
|
|
27
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var ThemeContext_exports = {};
|
|
29
|
-
__export(ThemeContext_exports, {
|
|
30
|
-
default: () => ThemeContext_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(ThemeContext_exports);
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
const ThemeContext = import_react.default.createContext(null);
|
|
35
|
-
var ThemeContext_default = ThemeContext;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __objRest = (source, exclude) => {
|
|
20
|
-
var target = {};
|
|
21
|
-
for (var prop in source)
|
|
22
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
23
|
-
target[prop] = source[prop];
|
|
24
|
-
if (source != null && __getOwnPropSymbols)
|
|
25
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
26
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
27
|
-
target[prop] = source[prop];
|
|
28
|
-
}
|
|
29
|
-
return target;
|
|
30
|
-
};
|
|
31
|
-
var __export = (target, all) => {
|
|
32
|
-
for (var name in all)
|
|
33
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
34
|
-
};
|
|
35
|
-
var __copyProps = (to, from, except, desc) => {
|
|
36
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
37
|
-
for (let key of __getOwnPropNames(from))
|
|
38
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
39
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
40
|
-
}
|
|
41
|
-
return to;
|
|
42
|
-
};
|
|
43
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
44
|
-
var createTheme_exports = {};
|
|
45
|
-
__export(createTheme_exports, {
|
|
46
|
-
default: () => createTheme
|
|
47
|
-
});
|
|
48
|
-
module.exports = __toCommonJS(createTheme_exports);
|
|
49
|
-
function createTheme(options) {
|
|
50
|
-
const _a = options || {}, { locale } = _a, others = __objRest(_a, ["locale"]);
|
|
51
|
-
const buiTheme = __spreadValues({
|
|
52
|
-
locale
|
|
53
|
-
}, others);
|
|
54
|
-
return buiTheme;
|
|
55
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var hooks_exports = {};
|
|
29
|
-
__export(hooks_exports, {
|
|
30
|
-
ThemeContext: () => import_ThemeContext.default,
|
|
31
|
-
createTheme: () => import_createTheme.default,
|
|
32
|
-
useTheme: () => import_useTheme.default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(hooks_exports);
|
|
35
|
-
var import_createTheme = __toESM(require("./createTheme"));
|
|
36
|
-
var import_ThemeContext = __toESM(require("./ThemeContext"));
|
|
37
|
-
var import_useTheme = __toESM(require("./useTheme"));
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
ThemeContext,
|
|
41
|
-
createTheme,
|
|
42
|
-
useTheme
|
|
43
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useTheme(defaultTheme?: import("../ThemeProvider.types").ThemeProps): import("../ThemeProvider.types").ThemeProps;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var useTheme_exports = {};
|
|
29
|
-
__export(useTheme_exports, {
|
|
30
|
-
default: () => useTheme
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(useTheme_exports);
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_createTheme = __toESM(require("./createTheme"));
|
|
35
|
-
var import_ThemeContext = __toESM(require("./ThemeContext"));
|
|
36
|
-
function useTheme(defaultTheme = (0, import_createTheme.default)(null)) {
|
|
37
|
-
const contextTheme = import_react.default.useContext(import_ThemeContext.default);
|
|
38
|
-
return !contextTheme || Object.keys(contextTheme).length === 0 ? defaultTheme : contextTheme;
|
|
39
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var ThemeProvider_exports = {};
|
|
30
|
-
__export(ThemeProvider_exports, {
|
|
31
|
-
ThemeProvider: () => import_ThemeProvider.default,
|
|
32
|
-
default: () => import_ThemeProvider.default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(ThemeProvider_exports);
|
|
35
|
-
var import_ThemeProvider = __toESM(require("./ThemeProvider"));
|
|
36
|
-
__reExport(ThemeProvider_exports, require("./hooks"), module.exports);
|
|
37
|
-
__reExport(ThemeProvider_exports, require("./utils"), module.exports);
|
|
38
|
-
__reExport(ThemeProvider_exports, require("./ThemeProvider.types"), module.exports);
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
ThemeProvider,
|
|
42
|
-
...require("./hooks"),
|
|
43
|
-
...require("./utils"),
|
|
44
|
-
...require("./ThemeProvider.types")
|
|
45
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 响应式屏幕断点
|
|
3
|
-
*/
|
|
4
|
-
export declare const breakpoints: {
|
|
5
|
-
/**
|
|
6
|
-
* 超小屏幕 (小于 576px,实际为了处理临界值,断点值为 575.98px)
|
|
7
|
-
*/
|
|
8
|
-
xs: string;
|
|
9
|
-
/**
|
|
10
|
-
* 小屏幕 (≥ 576px)
|
|
11
|
-
*/
|
|
12
|
-
sm: string;
|
|
13
|
-
/**
|
|
14
|
-
* 中等屏幕 (≥ 768px)
|
|
15
|
-
*/
|
|
16
|
-
md: string;
|
|
17
|
-
/**
|
|
18
|
-
* 大屏幕 (≥ 992px)
|
|
19
|
-
*/
|
|
20
|
-
lg: string;
|
|
21
|
-
/**
|
|
22
|
-
* 超大屏幕 (≥ 1200px)
|
|
23
|
-
*/
|
|
24
|
-
xl: string;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* 根节点选择器,用于挂载全局Tokens
|
|
28
|
-
*/
|
|
29
|
-
export declare const rootSelector: {
|
|
30
|
-
defaultLight: string[];
|
|
31
|
-
defaultDark: string[];
|
|
32
|
-
dmLight: string[];
|
|
33
|
-
dmDark: string[];
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* BUI css变量前缀
|
|
37
|
-
*/
|
|
38
|
-
export declare const BUI_VAR_PREFIX = "bui-var-";
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var constants_exports = {};
|
|
19
|
-
__export(constants_exports, {
|
|
20
|
-
BUI_VAR_PREFIX: () => BUI_VAR_PREFIX,
|
|
21
|
-
breakpoints: () => breakpoints,
|
|
22
|
-
rootSelector: () => rootSelector
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(constants_exports);
|
|
25
|
-
const breakpoints = {
|
|
26
|
-
/**
|
|
27
|
-
* 超小屏幕 (小于 576px,实际为了处理临界值,断点值为 575.98px)
|
|
28
|
-
*/
|
|
29
|
-
xs: "575.98px",
|
|
30
|
-
/**
|
|
31
|
-
* 小屏幕 (≥ 576px)
|
|
32
|
-
*/
|
|
33
|
-
sm: "576px",
|
|
34
|
-
/**
|
|
35
|
-
* 中等屏幕 (≥ 768px)
|
|
36
|
-
*/
|
|
37
|
-
md: "768px",
|
|
38
|
-
/**
|
|
39
|
-
* 大屏幕 (≥ 992px)
|
|
40
|
-
*/
|
|
41
|
-
lg: "992px",
|
|
42
|
-
/**
|
|
43
|
-
* 超大屏幕 (≥ 1200px)
|
|
44
|
-
*/
|
|
45
|
-
xl: "1200px"
|
|
46
|
-
};
|
|
47
|
-
const rootSelector = {
|
|
48
|
-
defaultLight: [
|
|
49
|
-
":root",
|
|
50
|
-
"page",
|
|
51
|
-
"xhs-page",
|
|
52
|
-
".bui-default-light",
|
|
53
|
-
'[data-color-mode="light"][data-theme="default"]'
|
|
54
|
-
],
|
|
55
|
-
defaultDark: [".bui-dark", '[data-color-mode="dark"][data-theme="default"]'],
|
|
56
|
-
dmLight: [".bui-dm-light", '[data-color-mode="light"][data-theme="dm"]'],
|
|
57
|
-
dmDark: [".bui-dm-dark", '[data-color-mode="dark"][data-theme="dm"]']
|
|
58
|
-
};
|
|
59
|
-
const BUI_VAR_PREFIX = "bui-var-";
|
|
60
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
-
0 && (module.exports = {
|
|
62
|
-
BUI_VAR_PREFIX,
|
|
63
|
-
breakpoints,
|
|
64
|
-
rootSelector
|
|
65
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var utils_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(utils_exports);
|
|
17
|
-
__reExport(utils_exports, require("./constants"), module.exports);
|
|
18
|
-
__reExport(utils_exports, require("./mountTokens"), module.exports);
|
|
19
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
-
0 && (module.exports = {
|
|
21
|
-
...require("./constants"),
|
|
22
|
-
...require("./mountTokens")
|
|
23
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ThemeProps, MountResponsiveTokenOptions, BuiltInThemesTokenOptions } from '../ThemeProvider.types';
|
|
2
|
-
/**
|
|
3
|
-
* 挂载响应式自定义Tokens
|
|
4
|
-
* 响应式相关的Tokens挂载在全局根节点上,暗黑模式或大麦高亮主题下可自定义额外Toekns复写响应式Tokens
|
|
5
|
-
*/
|
|
6
|
-
export declare const mountResponsiveTokens: (options: MountResponsiveTokenOptions) => void;
|
|
7
|
-
/**
|
|
8
|
-
* 复写内置主题Tokens,复写的自定义token应为对应主题css变量的子集
|
|
9
|
-
* BUI内置主题包括以下4种:
|
|
10
|
-
* 1. 默认高亮模式(defaultLightToken 复写 default-light.less)
|
|
11
|
-
* 2. 默认暗黑模式(defaultDarkToken 复写 default-dark.less)
|
|
12
|
-
* 3. 大麦高亮模式(dmLightToken 复写 dm-light.less)
|
|
13
|
-
* 4. 大麦暗黑模式(dmDarkToken 复写 dm-dark.less)
|
|
14
|
-
*/
|
|
15
|
-
export declare const overrideBuiltInThemes: (tokenOptions: BuiltInThemesTokenOptions) => void;
|
|
16
|
-
/**
|
|
17
|
-
* 挂载Design Tokens
|
|
18
|
-
* Tokens的优先级:
|
|
19
|
-
* 1. 通常情况:组件的Tokens > 响应式Tokens > BUI内置Tokens(挂载顺序控制)
|
|
20
|
-
* 2. 暗黑模式:组件的Tokens > BUI内置的两种暗黑模式Tokens > 响应式Tokens (选择器权重控制)
|
|
21
|
-
*
|
|
22
|
-
* - 挂载顺序决定BUI内置Tokens(暗黑模式除外)和响应式Tokens的优先级
|
|
23
|
-
* - 选择器权重决定暗黑模式的Tokens和响应式Tokens的优先级
|
|
24
|
-
* - 命名规则决定组件的Tokens(如:--bui-button-xxx)
|
|
25
|
-
*/
|
|
26
|
-
export declare const mountTokens: (tokenOptions?: ThemeProps) => void;
|