@bifrostui/react 1.3.2 → 1.4.0-beta.0
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 +6 -3
- package/dist/ActionSheet/ActionSheetItem.css +10 -6
- package/dist/Alert/index.css +14 -8
- package/dist/Avatar/Avatar.css +13 -9
- package/dist/Avatar/AvatarGroup.css +15 -8
- package/dist/Backdrop/Backdrop.css +2 -1
- package/dist/Badge/Badge.css +27 -17
- package/dist/Breadcrumb/Breadcrumb.css +34 -0
- package/dist/Breadcrumb/Breadcrumb.d.ts +5 -0
- package/dist/Breadcrumb/Breadcrumb.js +128 -0
- package/dist/Breadcrumb/Breadcrumb.types.d.ts +49 -0
- package/dist/Breadcrumb/Breadcrumb.types.js +15 -0
- package/dist/Breadcrumb/BreadcrumbItem.d.ts +4 -0
- package/dist/Breadcrumb/BreadcrumbItem.js +78 -0
- package/dist/Breadcrumb/index.d.ts +4 -0
- package/dist/Breadcrumb/index.js +45 -0
- package/dist/Button/Button.css +37 -25
- package/dist/Calendar/Calendar.css +33 -18
- package/dist/Calendar/Calendar.d.ts +1 -1
- package/dist/Calendar/Calendar.js +38 -17
- package/dist/Calendar/Calendar.types.d.ts +21 -0
- package/dist/Card/CardFooter.css +2 -1
- package/dist/Card/CardHeader.css +3 -1
- package/dist/Checkbox/Checkbox.css +7 -5
- package/dist/CitySelector/CitySelector.css +29 -15
- package/dist/CitySelector/CitySelectorCore.js +25 -16
- package/dist/CitySelector/Selector/index.css +4 -4
- package/dist/Collapse/Collapse.css +6 -0
- package/dist/Collapse/Collapse.d.ts +5 -0
- package/dist/Collapse/Collapse.js +165 -0
- package/dist/Collapse/Collapse.types.d.ts +16 -0
- package/dist/Collapse/Collapse.types.js +15 -0
- package/dist/Collapse/index.d.ts +2 -0
- package/dist/Collapse/index.js +41 -0
- package/dist/CollapsePanel/CollapsePanel.css +32 -0
- package/dist/CollapsePanel/CollapsePanel.d.ts +5 -0
- package/dist/CollapsePanel/CollapsePanel.js +159 -0
- package/dist/CollapsePanel/CollapsePanel.types.d.ts +64 -0
- package/dist/CollapsePanel/CollapsePanel.types.js +15 -0
- package/dist/CollapsePanel/CollapsePanelItem.d.ts +4 -0
- package/dist/CollapsePanel/CollapsePanelItem.js +112 -0
- package/dist/CollapsePanel/index.d.ts +4 -0
- package/dist/CollapsePanel/index.js +45 -0
- package/dist/Countdown/Countdown.css +2 -1
- package/dist/Dialog/Dialog.d.ts +2 -2
- package/dist/Dialog/Dialog.js +20 -8
- package/dist/Dialog/Dialog.types.d.ts +12 -1
- package/dist/Dialog/FunctionalDialog.js +38 -2
- package/dist/Dialog/index.css +27 -18
- package/dist/Divider/Divider.css +6 -4
- package/dist/IconButton/IconButton.css +9 -7
- package/dist/Image/index.css +2 -1
- package/dist/Input/Input.css +14 -7
- package/dist/List/List.css +3 -0
- package/dist/List/ListItem.css +3 -3
- package/dist/List/ListItemContent.css +1 -1
- package/dist/Loading/Loading.css +4 -2
- package/dist/NavBar/NavBar.css +9 -5
- package/dist/Picker/Picker.css +25 -29
- package/dist/Picker/Picker.js +31 -11
- package/dist/Picker/Picker.types.d.ts +4 -0
- package/dist/Picker/PickerPanel.css +8 -8
- package/dist/Picker/PickerPanel.js +14 -8
- package/dist/Picker/utils.d.ts +16 -0
- package/dist/Picker/utils.js +32 -2
- package/dist/Popover/Popover.css +97 -0
- package/dist/Popover/Popover.d.ts +5 -0
- package/dist/Popover/Popover.js +195 -0
- package/dist/Popover/Popover.types.d.ts +58 -0
- package/dist/Popover/Popover.types.js +15 -0
- package/dist/Popover/index.d.ts +2 -0
- package/dist/Popover/index.js +41 -0
- package/dist/Portal/Portal.types.d.ts +4 -0
- package/dist/Portal/PortalCore.js +8 -1
- package/dist/Progress/Progress.css +9 -7
- package/dist/Radio/Radio.css +5 -4
- package/dist/Rating/Rating.css +8 -4
- package/dist/Select/Select.css +21 -10
- package/dist/Select/Select.js +1 -1
- package/dist/Select/SelectOption.js +3 -0
- package/dist/Skeleton/Skeleton.css +5 -5
- package/dist/Slider/Slider.css +29 -18
- package/dist/Steps/Step.css +13 -13
- package/dist/Steps/Steps.css +14 -7
- package/dist/Swiper/Swiper.css +2 -1
- package/dist/Switch/Switch.css +31 -16
- package/dist/TabBar/TabBar.css +7 -3
- package/dist/TabBar/TabBarItem.css +0 -1
- package/dist/Tabs/Tab.css +6 -10
- package/dist/Tabs/Tabs.css +10 -9
- package/dist/Tag/Tag.css +7 -10
- package/dist/Tag/TagGroup.css +9 -1
- package/dist/TextArea/TextArea.css +23 -13
- package/dist/ThemeProvider/ThemeProvider.d.ts +4 -0
- package/dist/ThemeProvider/ThemeProvider.js +91 -0
- package/dist/ThemeProvider/ThemeProvider.types.d.ts +127 -0
- package/dist/ThemeProvider/ThemeProvider.types.js +27 -0
- package/dist/ThemeProvider/hooks/ThemeContext.d.ts +4 -0
- package/dist/ThemeProvider/hooks/ThemeContext.js +35 -0
- package/dist/ThemeProvider/hooks/createTheme.d.ts +2 -0
- package/dist/ThemeProvider/hooks/createTheme.js +55 -0
- package/dist/ThemeProvider/hooks/index.d.ts +4 -0
- package/dist/ThemeProvider/hooks/index.js +43 -0
- package/dist/ThemeProvider/hooks/useTheme.d.ts +1 -0
- package/dist/ThemeProvider/hooks/useTheme.js +39 -0
- package/dist/ThemeProvider/index.d.ts +4 -0
- package/dist/ThemeProvider/index.js +45 -0
- package/dist/ThemeProvider/utils/constants.d.ts +38 -0
- package/dist/ThemeProvider/utils/constants.js +65 -0
- package/dist/ThemeProvider/utils/index.d.ts +2 -0
- package/dist/ThemeProvider/utils/index.js +23 -0
- package/dist/ThemeProvider/utils/mountTokens.d.ts +26 -0
- package/dist/ThemeProvider/utils/mountTokens.js +123 -0
- package/dist/Toast/FunctionalToast.js +18 -0
- package/dist/Toast/Toast.css +18 -20
- package/dist/Toast/Toast.d.ts +2 -2
- package/dist/Toast/Toast.js +52 -48
- package/dist/Toast/Toast.types.d.ts +15 -1
- package/dist/Tooltip/Tooltip.css +91 -0
- package/dist/Tooltip/Tooltip.d.ts +5 -0
- package/dist/Tooltip/Tooltip.js +184 -0
- package/dist/Tooltip/Tooltip.types.d.ts +49 -0
- package/dist/Tooltip/Tooltip.types.js +15 -0
- package/dist/Tooltip/index.d.ts +2 -0
- package/dist/Tooltip/index.js +41 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +15 -1
- package/dist/locales/base.d.ts +40 -0
- package/dist/locales/base.js +15 -0
- package/dist/locales/en-US.d.ts +3 -0
- package/dist/locales/en-US.js +69 -0
- package/dist/locales/hooks/useLocaleText.d.ts +3 -0
- package/dist/locales/hooks/useLocaleText.js +43 -0
- package/dist/locales/index.d.ts +5 -0
- package/dist/locales/index.js +49 -0
- package/dist/locales/zh-CN.d.ts +3 -0
- package/dist/locales/zh-CN.js +51 -0
- package/dist/locales/zh-TW.d.ts +3 -0
- package/dist/locales/zh-TW.js +51 -0
- package/es/ActionSheet/ActionSheet.css +6 -3
- package/es/ActionSheet/ActionSheetItem.css +10 -6
- package/es/Alert/index.css +14 -8
- package/es/Avatar/Avatar.css +13 -9
- package/es/Avatar/AvatarGroup.css +15 -8
- package/es/Backdrop/Backdrop.css +2 -1
- package/es/Badge/Badge.css +27 -17
- package/es/Breadcrumb/Breadcrumb.css +34 -0
- package/es/Breadcrumb/Breadcrumb.d.ts +5 -0
- package/es/Breadcrumb/Breadcrumb.js +101 -0
- package/es/Breadcrumb/Breadcrumb.types.d.ts +49 -0
- package/es/Breadcrumb/Breadcrumb.types.js +1 -0
- package/es/Breadcrumb/BreadcrumbItem.d.ts +4 -0
- package/es/Breadcrumb/BreadcrumbItem.js +51 -0
- package/es/Breadcrumb/index.d.ts +4 -0
- package/es/Breadcrumb/index.js +9 -0
- package/es/Button/Button.css +37 -25
- package/es/Calendar/Calendar.css +33 -18
- package/es/Calendar/Calendar.d.ts +1 -1
- package/es/Calendar/Calendar.js +38 -17
- package/es/Calendar/Calendar.types.d.ts +21 -0
- package/es/Card/CardFooter.css +2 -1
- package/es/Card/CardHeader.css +3 -1
- package/es/Checkbox/Checkbox.css +7 -5
- package/es/CitySelector/CitySelector.css +29 -15
- package/es/CitySelector/CitySelectorCore.js +25 -16
- package/es/CitySelector/Selector/index.css +4 -4
- package/es/Collapse/Collapse.css +6 -0
- package/es/Collapse/Collapse.d.ts +5 -0
- package/es/Collapse/Collapse.js +144 -0
- package/es/Collapse/Collapse.types.d.ts +16 -0
- package/es/Collapse/Collapse.types.js +1 -0
- package/es/Collapse/index.d.ts +2 -0
- package/es/Collapse/index.js +6 -0
- package/es/CollapsePanel/CollapsePanel.css +32 -0
- package/es/CollapsePanel/CollapsePanel.d.ts +5 -0
- package/es/CollapsePanel/CollapsePanel.js +132 -0
- package/es/CollapsePanel/CollapsePanel.types.d.ts +64 -0
- package/es/CollapsePanel/CollapsePanel.types.js +1 -0
- package/es/CollapsePanel/CollapsePanelItem.d.ts +4 -0
- package/es/CollapsePanel/CollapsePanelItem.js +85 -0
- package/es/CollapsePanel/index.d.ts +4 -0
- package/es/CollapsePanel/index.js +9 -0
- package/es/Countdown/Countdown.css +2 -1
- package/es/Dialog/Dialog.d.ts +2 -2
- package/es/Dialog/Dialog.js +20 -8
- package/es/Dialog/Dialog.types.d.ts +12 -1
- package/es/Dialog/FunctionalDialog.js +38 -2
- package/es/Dialog/index.css +27 -18
- package/es/Divider/Divider.css +6 -4
- package/es/IconButton/IconButton.css +9 -7
- package/es/Image/index.css +2 -1
- package/es/Input/Input.css +14 -7
- package/es/List/List.css +3 -0
- package/es/List/ListItem.css +3 -3
- package/es/List/ListItemContent.css +1 -1
- package/es/Loading/Loading.css +4 -2
- package/es/Modal/Modal.miniapp.d.ts +1 -1
- package/es/NavBar/NavBar.css +9 -5
- package/es/Picker/Picker.css +25 -29
- package/es/Picker/Picker.js +32 -12
- package/es/Picker/Picker.types.d.ts +4 -0
- package/es/Picker/PickerPanel.css +8 -8
- package/es/Picker/PickerPanel.js +14 -8
- package/es/Picker/utils.d.ts +16 -0
- package/es/Picker/utils.js +29 -1
- package/es/Popover/Popover.css +97 -0
- package/es/Popover/Popover.d.ts +5 -0
- package/es/Popover/Popover.js +172 -0
- package/es/Popover/Popover.types.d.ts +58 -0
- package/es/Popover/Popover.types.js +1 -0
- package/es/Popover/index.d.ts +2 -0
- package/es/Popover/index.js +6 -0
- package/es/Portal/Portal.types.d.ts +4 -0
- package/es/Portal/PortalCore.js +8 -1
- package/es/Progress/Progress.css +9 -7
- package/es/Radio/Radio.css +5 -4
- package/es/Rating/Rating.css +8 -4
- package/es/Select/Select.css +21 -10
- package/es/Select/Select.js +1 -1
- package/es/Select/SelectOption.js +3 -0
- package/es/Skeleton/Skeleton.css +5 -5
- package/es/Slider/Slider.css +29 -18
- package/es/Steps/Step.css +13 -13
- package/es/Steps/Steps.css +14 -7
- package/es/Swiper/Swiper.css +2 -1
- package/es/Switch/Switch.css +31 -16
- package/es/TabBar/TabBar.css +7 -3
- package/es/TabBar/TabBarItem.css +0 -1
- package/es/Tabs/Tab.css +6 -10
- package/es/Tabs/Tabs.css +10 -9
- package/es/Tag/Tag.css +7 -10
- package/es/Tag/TagGroup.css +9 -1
- package/es/TextArea/TextArea.css +23 -13
- package/es/ThemeProvider/ThemeProvider.d.ts +4 -0
- package/es/ThemeProvider/ThemeProvider.js +62 -0
- package/es/ThemeProvider/ThemeProvider.types.d.ts +127 -0
- package/es/ThemeProvider/ThemeProvider.types.js +1 -0
- package/es/ThemeProvider/hooks/ThemeContext.d.ts +4 -0
- package/es/ThemeProvider/hooks/ThemeContext.js +6 -0
- package/es/ThemeProvider/hooks/createTheme.d.ts +2 -0
- package/es/ThemeProvider/hooks/createTheme.js +38 -0
- package/es/ThemeProvider/hooks/index.d.ts +4 -0
- package/es/ThemeProvider/hooks/index.js +8 -0
- package/es/ThemeProvider/hooks/useTheme.d.ts +1 -0
- package/es/ThemeProvider/hooks/useTheme.js +10 -0
- package/es/ThemeProvider/index.d.ts +4 -0
- package/es/ThemeProvider/index.js +8 -0
- package/es/ThemeProvider/utils/constants.d.ts +38 -0
- package/es/ThemeProvider/utils/constants.js +40 -0
- package/es/ThemeProvider/utils/index.d.ts +2 -0
- package/es/ThemeProvider/utils/index.js +2 -0
- package/es/ThemeProvider/utils/mountTokens.d.ts +26 -0
- package/es/ThemeProvider/utils/mountTokens.js +88 -0
- package/es/Toast/FunctionalToast.js +18 -0
- package/es/Toast/Toast.css +18 -20
- package/es/Toast/Toast.d.ts +2 -2
- package/es/Toast/Toast.js +53 -49
- package/es/Toast/Toast.types.d.ts +15 -1
- package/es/Tooltip/Tooltip.css +91 -0
- package/es/Tooltip/Tooltip.d.ts +5 -0
- package/es/Tooltip/Tooltip.js +161 -0
- package/es/Tooltip/Tooltip.types.d.ts +49 -0
- package/es/Tooltip/Tooltip.types.js +1 -0
- package/es/Tooltip/index.d.ts +2 -0
- package/es/Tooltip/index.js +6 -0
- package/es/index.d.ts +7 -0
- package/es/index.js +7 -0
- package/es/locales/base.d.ts +40 -0
- package/es/locales/base.js +0 -0
- package/es/locales/en-US.d.ts +3 -0
- package/es/locales/en-US.js +50 -0
- package/es/locales/hooks/useLocaleText.d.ts +3 -0
- package/es/locales/hooks/useLocaleText.js +26 -0
- package/es/locales/index.d.ts +5 -0
- package/es/locales/index.js +11 -0
- package/es/locales/zh-CN.d.ts +3 -0
- package/es/locales/zh-CN.js +32 -0
- package/es/locales/zh-TW.d.ts +3 -0
- package/es/locales/zh-TW.js +32 -0
- package/package.json +5 -5
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
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;
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useTheme(defaultTheme?: import("../ThemeProvider.types").ThemeProps): import("../ThemeProvider.types").ThemeProps;
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
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-";
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
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;
|
|
@@ -0,0 +1,123 @@
|
|
|
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 mountTokens_exports = {};
|
|
29
|
+
__export(mountTokens_exports, {
|
|
30
|
+
mountResponsiveTokens: () => mountResponsiveTokens,
|
|
31
|
+
mountTokens: () => mountTokens,
|
|
32
|
+
overrideBuiltInThemes: () => overrideBuiltInThemes
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(mountTokens_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@bifrostui/utils");
|
|
37
|
+
var import_constants = require("./constants");
|
|
38
|
+
const updateTokens = (options) => {
|
|
39
|
+
const { isRoot, rootString, container, containerId } = options || {};
|
|
40
|
+
if (import_utils.isMini)
|
|
41
|
+
return;
|
|
42
|
+
const style = document.createElement("style");
|
|
43
|
+
style.type = "text/css";
|
|
44
|
+
style.appendChild(document.createTextNode(rootString));
|
|
45
|
+
let containerNode;
|
|
46
|
+
if (isRoot) {
|
|
47
|
+
containerNode = document.head;
|
|
48
|
+
} else if (containerId && container && import_react.default.isValidElement(container)) {
|
|
49
|
+
containerNode = document.querySelector(`.${containerId}`);
|
|
50
|
+
}
|
|
51
|
+
if (containerNode) {
|
|
52
|
+
containerNode.appendChild(style);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const mountResponsiveTokens = (options) => {
|
|
56
|
+
const { responsive, breakpoints = import_constants.breakpoints } = options || {};
|
|
57
|
+
if (!responsive)
|
|
58
|
+
return;
|
|
59
|
+
const modeSelector = import_constants.rootSelector.defaultLight;
|
|
60
|
+
let rootString = `${modeSelector.join(",")} { `;
|
|
61
|
+
Object.entries(responsive).forEach((config) => {
|
|
62
|
+
const [size, tokenConfig] = config || [];
|
|
63
|
+
if (!size || !tokenConfig)
|
|
64
|
+
return;
|
|
65
|
+
const cssVariablesString = Object.entries(tokenConfig || {}).reduce(
|
|
66
|
+
(acc, [key, value]) => {
|
|
67
|
+
return `${acc} ${key}: ${value};`;
|
|
68
|
+
},
|
|
69
|
+
""
|
|
70
|
+
);
|
|
71
|
+
const mediaQuery = size === "xs" ? "max-width" : "min-width";
|
|
72
|
+
rootString += `@media (${mediaQuery}: ${breakpoints[size]}) { ${cssVariablesString} }`;
|
|
73
|
+
});
|
|
74
|
+
rootString = `${rootString} }`;
|
|
75
|
+
updateTokens({ isRoot: true, rootString });
|
|
76
|
+
};
|
|
77
|
+
const overrideBuiltInThemes = (tokenOptions) => {
|
|
78
|
+
if (!tokenOptions)
|
|
79
|
+
return;
|
|
80
|
+
Object.keys(import_constants.rootSelector).forEach((selectorKey) => {
|
|
81
|
+
const modeSelector = import_constants.rootSelector[selectorKey];
|
|
82
|
+
const token = tokenOptions[`${selectorKey}Token`];
|
|
83
|
+
if (token) {
|
|
84
|
+
let rootString = `${modeSelector.join(",")} { `;
|
|
85
|
+
const cssVariablesString = Object.entries(token).reduce(
|
|
86
|
+
(acc, [key, value]) => {
|
|
87
|
+
return `${acc} ${key}: ${value};`;
|
|
88
|
+
},
|
|
89
|
+
""
|
|
90
|
+
);
|
|
91
|
+
rootString = `${rootString} ${cssVariablesString} }`;
|
|
92
|
+
updateTokens({ isRoot: true, rootString });
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
const mountComponentsTokens = (options) => {
|
|
97
|
+
const { isRoot = false, token, container, containerId } = options || {};
|
|
98
|
+
if (!token)
|
|
99
|
+
return;
|
|
100
|
+
const modeSelector = isRoot ? import_constants.rootSelector.defaultLight : [`.${containerId}`];
|
|
101
|
+
let rootString = `${modeSelector.join(",")} { `;
|
|
102
|
+
const cssVariablesString = Object.entries(token).reduce(
|
|
103
|
+
(acc, [key, value]) => {
|
|
104
|
+
return `${acc} ${key}: ${value};`;
|
|
105
|
+
},
|
|
106
|
+
""
|
|
107
|
+
);
|
|
108
|
+
rootString = `${rootString} ${cssVariablesString} }`;
|
|
109
|
+
updateTokens({ isRoot, rootString, container, containerId });
|
|
110
|
+
};
|
|
111
|
+
const mountTokens = (tokenOptions) => {
|
|
112
|
+
if (import_utils.isMini)
|
|
113
|
+
return;
|
|
114
|
+
overrideBuiltInThemes(tokenOptions);
|
|
115
|
+
mountResponsiveTokens(tokenOptions);
|
|
116
|
+
mountComponentsTokens(tokenOptions);
|
|
117
|
+
};
|
|
118
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
119
|
+
0 && (module.exports = {
|
|
120
|
+
mountResponsiveTokens,
|
|
121
|
+
mountTokens,
|
|
122
|
+
overrideBuiltInThemes
|
|
123
|
+
});
|
|
@@ -155,5 +155,23 @@ functionalToast.clear = () => {
|
|
|
155
155
|
destroyAll();
|
|
156
156
|
});
|
|
157
157
|
};
|
|
158
|
+
const useToast = () => {
|
|
159
|
+
const holderRef = import_react.default.useRef(null);
|
|
160
|
+
["warning", "loading", "success", "fail"].forEach((methodName) => {
|
|
161
|
+
functionalToast[methodName] = (options) => functionalToast(__spreadProps(__spreadValues({
|
|
162
|
+
type: methodName
|
|
163
|
+
}, formatProps(options)), {
|
|
164
|
+
theme: holderRef.current.theme
|
|
165
|
+
}));
|
|
166
|
+
});
|
|
167
|
+
functionalToast.clear = () => {
|
|
168
|
+
setTimeout(() => {
|
|
169
|
+
destroyAll();
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
const wrapAPI = functionalToast;
|
|
173
|
+
return [wrapAPI, /* @__PURE__ */ import_react.default.createElement(import_Toast.default, { key: "toast-holder", ref: holderRef })];
|
|
174
|
+
};
|
|
175
|
+
functionalToast.useToast = useToast;
|
|
158
176
|
const Toast = functionalToast;
|
|
159
177
|
var FunctionalToast_default = Toast;
|
package/dist/Toast/Toast.css
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
.bui-toast {
|
|
2
|
-
--min-width: 86px;
|
|
3
|
-
--max-width: 80
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
--
|
|
8
|
-
--
|
|
9
|
-
--
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--border-radius: var(--bui-shape-radius-default);
|
|
13
|
-
--text-align: center;
|
|
2
|
+
--min-width: var(--bui-toast-min-width, 86px);
|
|
3
|
+
--max-width: var(--bui-toast-max-width, 80%);
|
|
4
|
+
--flex-direction: var(--bui-toast-flex-direction, column);
|
|
5
|
+
--padding: var(--bui-toast-padding, var(--bui-spacing-xl));
|
|
6
|
+
--position-top: var(--bui-toast-position-top, 15%);
|
|
7
|
+
--position-bottom: var(--bui-toast-position-bottom, 85%);
|
|
8
|
+
--background-color: var(--bui-toast-bg-color, rgba(0, 0, 0, 0.8));
|
|
9
|
+
--border-radius: var(--bui-toast-border-radius, --bui-shape-radius-default);
|
|
10
|
+
--icon-margin: var(--bui-toast-icon-margin-bottom, 8px);
|
|
11
|
+
--icon-font-size: var(--bui-toast-icon-font-size, 30px);
|
|
14
12
|
position: fixed;
|
|
15
13
|
left: 50%;
|
|
16
|
-
z-index: var(--z-index);
|
|
14
|
+
z-index: var(--bui-z-index-toast);
|
|
17
15
|
width: fit-content;
|
|
18
16
|
min-width: var(--min-width);
|
|
19
17
|
max-width: var(--max-width);
|
|
20
18
|
padding: var(--padding);
|
|
21
|
-
font-size: var(--
|
|
22
|
-
color: var(--color);
|
|
19
|
+
font-size: var(--bui-text-size-1);
|
|
20
|
+
color: var(--bui-color-white);
|
|
23
21
|
border-radius: var(--border-radius);
|
|
24
|
-
word-break:
|
|
22
|
+
word-break: break-all;
|
|
25
23
|
white-space: pre-wrap;
|
|
26
24
|
background-color: var(--background-color);
|
|
27
|
-
text-align:
|
|
25
|
+
text-align: center;
|
|
28
26
|
font-family: var(--bui-font-family);
|
|
29
27
|
}
|
|
30
28
|
.bui-toast.bui-toast-allow-click {
|
|
@@ -46,10 +44,10 @@
|
|
|
46
44
|
}
|
|
47
45
|
.bui-toast-icon {
|
|
48
46
|
display: flex;
|
|
49
|
-
flex-direction:
|
|
47
|
+
flex-direction: var(--flex-direction);
|
|
50
48
|
align-items: center;
|
|
51
49
|
}
|
|
52
50
|
.bui-toast-icon .bui-svg-icon {
|
|
53
|
-
margin
|
|
54
|
-
font-size:
|
|
51
|
+
margin: 0 0 var(--icon-margin);
|
|
52
|
+
font-size: var(--icon-font-size);
|
|
55
53
|
}
|
package/dist/Toast/Toast.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ToastProps } from './Toast.types';
|
|
2
|
+
import { ToastProps, ToastRef } from './Toast.types';
|
|
3
3
|
import './Toast.less';
|
|
4
|
-
declare const ToastComponent: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<
|
|
4
|
+
declare const ToastComponent: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<ToastRef>>;
|
|
5
5
|
export default ToastComponent;
|