@bifrostui/react 1.3.2 → 1.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/dist/ActionSheet/ActionSheet.css +6 -3
  2. package/dist/ActionSheet/ActionSheetItem.css +10 -6
  3. package/dist/Alert/index.css +14 -8
  4. package/dist/Avatar/Avatar.css +13 -9
  5. package/dist/Avatar/AvatarGroup.css +15 -8
  6. package/dist/Backdrop/Backdrop.css +2 -1
  7. package/dist/Badge/Badge.css +27 -17
  8. package/dist/Breadcrumb/Breadcrumb.css +34 -0
  9. package/dist/Breadcrumb/Breadcrumb.d.ts +5 -0
  10. package/dist/Breadcrumb/Breadcrumb.js +128 -0
  11. package/dist/Breadcrumb/Breadcrumb.types.d.ts +49 -0
  12. package/dist/Breadcrumb/Breadcrumb.types.js +15 -0
  13. package/dist/Breadcrumb/BreadcrumbItem.d.ts +4 -0
  14. package/dist/Breadcrumb/BreadcrumbItem.js +78 -0
  15. package/dist/Breadcrumb/index.d.ts +4 -0
  16. package/dist/Breadcrumb/index.js +45 -0
  17. package/dist/Button/Button.css +37 -25
  18. package/dist/Calendar/Calendar.css +33 -18
  19. package/dist/Calendar/Calendar.d.ts +1 -1
  20. package/dist/Calendar/Calendar.js +38 -17
  21. package/dist/Calendar/Calendar.types.d.ts +21 -0
  22. package/dist/Card/CardFooter.css +2 -1
  23. package/dist/Card/CardHeader.css +3 -1
  24. package/dist/Checkbox/Checkbox.css +7 -5
  25. package/dist/CitySelector/CitySelector.css +29 -15
  26. package/dist/CitySelector/CitySelectorCore.js +25 -16
  27. package/dist/CitySelector/Selector/index.css +4 -4
  28. package/dist/Collapse/Collapse.css +6 -0
  29. package/dist/Collapse/Collapse.d.ts +5 -0
  30. package/dist/Collapse/Collapse.js +165 -0
  31. package/dist/Collapse/Collapse.types.d.ts +16 -0
  32. package/dist/Collapse/Collapse.types.js +15 -0
  33. package/dist/Collapse/index.d.ts +2 -0
  34. package/dist/Collapse/index.js +41 -0
  35. package/dist/CollapsePanel/CollapsePanel.css +32 -0
  36. package/dist/CollapsePanel/CollapsePanel.d.ts +5 -0
  37. package/dist/CollapsePanel/CollapsePanel.js +159 -0
  38. package/dist/CollapsePanel/CollapsePanel.types.d.ts +64 -0
  39. package/dist/CollapsePanel/CollapsePanel.types.js +15 -0
  40. package/dist/CollapsePanel/CollapsePanelItem.d.ts +4 -0
  41. package/dist/CollapsePanel/CollapsePanelItem.js +112 -0
  42. package/dist/CollapsePanel/index.d.ts +4 -0
  43. package/dist/CollapsePanel/index.js +45 -0
  44. package/dist/Countdown/Countdown.css +2 -1
  45. package/dist/Dialog/Dialog.d.ts +2 -2
  46. package/dist/Dialog/Dialog.js +20 -8
  47. package/dist/Dialog/Dialog.types.d.ts +12 -1
  48. package/dist/Dialog/FunctionalDialog.js +38 -2
  49. package/dist/Dialog/index.css +27 -18
  50. package/dist/Divider/Divider.css +6 -4
  51. package/dist/IconButton/IconButton.css +9 -7
  52. package/dist/Image/index.css +2 -1
  53. package/dist/Input/Input.css +14 -7
  54. package/dist/List/List.css +3 -0
  55. package/dist/List/ListItem.css +3 -3
  56. package/dist/List/ListItemContent.css +1 -1
  57. package/dist/Loading/Loading.css +4 -2
  58. package/dist/NavBar/NavBar.css +9 -5
  59. package/dist/Picker/Picker.css +25 -29
  60. package/dist/Picker/Picker.js +31 -11
  61. package/dist/Picker/Picker.types.d.ts +4 -0
  62. package/dist/Picker/PickerPanel.css +8 -8
  63. package/dist/Picker/PickerPanel.js +14 -8
  64. package/dist/Picker/utils.d.ts +16 -0
  65. package/dist/Picker/utils.js +32 -2
  66. package/dist/Popover/Popover.css +94 -0
  67. package/dist/Popover/Popover.d.ts +5 -0
  68. package/dist/Popover/Popover.js +209 -0
  69. package/dist/Popover/Popover.types.d.ts +58 -0
  70. package/dist/Popover/Popover.types.js +15 -0
  71. package/dist/Popover/index.d.ts +2 -0
  72. package/dist/Popover/index.js +41 -0
  73. package/dist/Portal/Portal.types.d.ts +5 -1
  74. package/dist/Portal/PortalCore.js +8 -1
  75. package/dist/Progress/Progress.css +9 -7
  76. package/dist/Radio/Radio.css +5 -4
  77. package/dist/Rating/Rating.css +8 -4
  78. package/dist/Select/Select.css +21 -10
  79. package/dist/Select/Select.js +1 -1
  80. package/dist/Select/SelectOption.js +3 -0
  81. package/dist/Skeleton/Skeleton.css +5 -5
  82. package/dist/Slider/Slider.css +29 -18
  83. package/dist/Steps/Step.css +13 -13
  84. package/dist/Steps/Steps.css +14 -7
  85. package/dist/Swiper/Swiper.css +2 -1
  86. package/dist/Switch/Switch.css +31 -16
  87. package/dist/TabBar/TabBar.css +7 -3
  88. package/dist/TabBar/TabBarItem.css +0 -1
  89. package/dist/Tabs/Tab.css +6 -10
  90. package/dist/Tabs/Tabs.css +10 -9
  91. package/dist/Tag/Tag.css +7 -10
  92. package/dist/Tag/TagGroup.css +9 -1
  93. package/dist/TextArea/TextArea.css +23 -13
  94. package/dist/ThemeProvider/ThemeProvider.d.ts +4 -0
  95. package/dist/ThemeProvider/ThemeProvider.js +91 -0
  96. package/dist/ThemeProvider/ThemeProvider.types.d.ts +127 -0
  97. package/dist/ThemeProvider/ThemeProvider.types.js +27 -0
  98. package/dist/ThemeProvider/hooks/ThemeContext.d.ts +4 -0
  99. package/dist/ThemeProvider/hooks/ThemeContext.js +35 -0
  100. package/dist/ThemeProvider/hooks/createTheme.d.ts +2 -0
  101. package/dist/ThemeProvider/hooks/createTheme.js +55 -0
  102. package/dist/ThemeProvider/hooks/index.d.ts +4 -0
  103. package/dist/ThemeProvider/hooks/index.js +43 -0
  104. package/dist/ThemeProvider/hooks/useTheme.d.ts +1 -0
  105. package/dist/ThemeProvider/hooks/useTheme.js +39 -0
  106. package/dist/ThemeProvider/index.d.ts +4 -0
  107. package/dist/ThemeProvider/index.js +45 -0
  108. package/dist/ThemeProvider/utils/constants.d.ts +38 -0
  109. package/dist/ThemeProvider/utils/constants.js +65 -0
  110. package/dist/ThemeProvider/utils/index.d.ts +2 -0
  111. package/dist/ThemeProvider/utils/index.js +23 -0
  112. package/dist/ThemeProvider/utils/mountTokens.d.ts +26 -0
  113. package/dist/ThemeProvider/utils/mountTokens.js +123 -0
  114. package/dist/Toast/FunctionalToast.js +18 -0
  115. package/dist/Toast/Toast.css +18 -20
  116. package/dist/Toast/Toast.d.ts +2 -2
  117. package/dist/Toast/Toast.js +52 -48
  118. package/dist/Toast/Toast.types.d.ts +15 -1
  119. package/dist/Tooltip/Tooltip.css +91 -0
  120. package/dist/Tooltip/Tooltip.d.ts +5 -0
  121. package/dist/Tooltip/Tooltip.js +198 -0
  122. package/dist/Tooltip/Tooltip.types.d.ts +49 -0
  123. package/dist/Tooltip/Tooltip.types.js +15 -0
  124. package/dist/Tooltip/index.d.ts +2 -0
  125. package/dist/Tooltip/index.js +41 -0
  126. package/dist/index.d.ts +7 -0
  127. package/dist/index.js +15 -1
  128. package/dist/locales/base.d.ts +40 -0
  129. package/dist/locales/base.js +15 -0
  130. package/dist/locales/en-US.d.ts +3 -0
  131. package/dist/locales/en-US.js +69 -0
  132. package/dist/locales/hooks/useLocaleText.d.ts +3 -0
  133. package/dist/locales/hooks/useLocaleText.js +43 -0
  134. package/dist/locales/index.d.ts +5 -0
  135. package/dist/locales/index.js +49 -0
  136. package/dist/locales/zh-CN.d.ts +3 -0
  137. package/dist/locales/zh-CN.js +51 -0
  138. package/dist/locales/zh-TW.d.ts +3 -0
  139. package/dist/locales/zh-TW.js +51 -0
  140. package/es/ActionSheet/ActionSheet.css +6 -3
  141. package/es/ActionSheet/ActionSheetItem.css +10 -6
  142. package/es/Alert/index.css +14 -8
  143. package/es/Avatar/Avatar.css +13 -9
  144. package/es/Avatar/AvatarGroup.css +15 -8
  145. package/es/Backdrop/Backdrop.css +2 -1
  146. package/es/Badge/Badge.css +27 -17
  147. package/es/Breadcrumb/Breadcrumb.css +34 -0
  148. package/es/Breadcrumb/Breadcrumb.d.ts +5 -0
  149. package/es/Breadcrumb/Breadcrumb.js +101 -0
  150. package/es/Breadcrumb/Breadcrumb.types.d.ts +49 -0
  151. package/es/Breadcrumb/Breadcrumb.types.js +1 -0
  152. package/es/Breadcrumb/BreadcrumbItem.d.ts +4 -0
  153. package/es/Breadcrumb/BreadcrumbItem.js +51 -0
  154. package/es/Breadcrumb/index.d.ts +4 -0
  155. package/es/Breadcrumb/index.js +9 -0
  156. package/es/Button/Button.css +37 -25
  157. package/es/Calendar/Calendar.css +33 -18
  158. package/es/Calendar/Calendar.d.ts +1 -1
  159. package/es/Calendar/Calendar.js +38 -17
  160. package/es/Calendar/Calendar.types.d.ts +21 -0
  161. package/es/Card/CardFooter.css +2 -1
  162. package/es/Card/CardHeader.css +3 -1
  163. package/es/Checkbox/Checkbox.css +7 -5
  164. package/es/CitySelector/CitySelector.css +29 -15
  165. package/es/CitySelector/CitySelectorCore.js +25 -16
  166. package/es/CitySelector/Selector/index.css +4 -4
  167. package/es/Collapse/Collapse.css +6 -0
  168. package/es/Collapse/Collapse.d.ts +5 -0
  169. package/es/Collapse/Collapse.js +144 -0
  170. package/es/Collapse/Collapse.types.d.ts +16 -0
  171. package/es/Collapse/Collapse.types.js +1 -0
  172. package/es/Collapse/index.d.ts +2 -0
  173. package/es/Collapse/index.js +6 -0
  174. package/es/CollapsePanel/CollapsePanel.css +32 -0
  175. package/es/CollapsePanel/CollapsePanel.d.ts +5 -0
  176. package/es/CollapsePanel/CollapsePanel.js +132 -0
  177. package/es/CollapsePanel/CollapsePanel.types.d.ts +64 -0
  178. package/es/CollapsePanel/CollapsePanel.types.js +1 -0
  179. package/es/CollapsePanel/CollapsePanelItem.d.ts +4 -0
  180. package/es/CollapsePanel/CollapsePanelItem.js +85 -0
  181. package/es/CollapsePanel/index.d.ts +4 -0
  182. package/es/CollapsePanel/index.js +9 -0
  183. package/es/Countdown/Countdown.css +2 -1
  184. package/es/Dialog/Dialog.d.ts +2 -2
  185. package/es/Dialog/Dialog.js +20 -8
  186. package/es/Dialog/Dialog.types.d.ts +12 -1
  187. package/es/Dialog/FunctionalDialog.js +38 -2
  188. package/es/Dialog/index.css +27 -18
  189. package/es/Divider/Divider.css +6 -4
  190. package/es/IconButton/IconButton.css +9 -7
  191. package/es/Image/index.css +2 -1
  192. package/es/Input/Input.css +14 -7
  193. package/es/List/List.css +3 -0
  194. package/es/List/ListItem.css +3 -3
  195. package/es/List/ListItemContent.css +1 -1
  196. package/es/Loading/Loading.css +4 -2
  197. package/es/Modal/Modal.miniapp.d.ts +1 -1
  198. package/es/NavBar/NavBar.css +9 -5
  199. package/es/Picker/Picker.css +25 -29
  200. package/es/Picker/Picker.js +32 -12
  201. package/es/Picker/Picker.types.d.ts +4 -0
  202. package/es/Picker/PickerPanel.css +8 -8
  203. package/es/Picker/PickerPanel.js +14 -8
  204. package/es/Picker/utils.d.ts +16 -0
  205. package/es/Picker/utils.js +29 -1
  206. package/es/Popover/Popover.css +94 -0
  207. package/es/Popover/Popover.d.ts +5 -0
  208. package/es/Popover/Popover.js +186 -0
  209. package/es/Popover/Popover.types.d.ts +58 -0
  210. package/es/Popover/Popover.types.js +1 -0
  211. package/es/Popover/index.d.ts +2 -0
  212. package/es/Popover/index.js +6 -0
  213. package/es/Portal/Portal.types.d.ts +5 -1
  214. package/es/Portal/PortalCore.js +8 -1
  215. package/es/Progress/Progress.css +9 -7
  216. package/es/Radio/Radio.css +5 -4
  217. package/es/Rating/Rating.css +8 -4
  218. package/es/Select/Select.css +21 -10
  219. package/es/Select/Select.js +1 -1
  220. package/es/Select/SelectOption.js +3 -0
  221. package/es/Skeleton/Skeleton.css +5 -5
  222. package/es/Slider/Slider.css +29 -18
  223. package/es/Steps/Step.css +13 -13
  224. package/es/Steps/Steps.css +14 -7
  225. package/es/Swiper/Swiper.css +2 -1
  226. package/es/Switch/Switch.css +31 -16
  227. package/es/TabBar/TabBar.css +7 -3
  228. package/es/TabBar/TabBarItem.css +0 -1
  229. package/es/Tabs/Tab.css +6 -10
  230. package/es/Tabs/Tabs.css +10 -9
  231. package/es/Tag/Tag.css +7 -10
  232. package/es/Tag/TagGroup.css +9 -1
  233. package/es/TextArea/TextArea.css +23 -13
  234. package/es/ThemeProvider/ThemeProvider.d.ts +4 -0
  235. package/es/ThemeProvider/ThemeProvider.js +62 -0
  236. package/es/ThemeProvider/ThemeProvider.types.d.ts +127 -0
  237. package/es/ThemeProvider/ThemeProvider.types.js +1 -0
  238. package/es/ThemeProvider/hooks/ThemeContext.d.ts +4 -0
  239. package/es/ThemeProvider/hooks/ThemeContext.js +6 -0
  240. package/es/ThemeProvider/hooks/createTheme.d.ts +2 -0
  241. package/es/ThemeProvider/hooks/createTheme.js +38 -0
  242. package/es/ThemeProvider/hooks/index.d.ts +4 -0
  243. package/es/ThemeProvider/hooks/index.js +8 -0
  244. package/es/ThemeProvider/hooks/useTheme.d.ts +1 -0
  245. package/es/ThemeProvider/hooks/useTheme.js +10 -0
  246. package/es/ThemeProvider/index.d.ts +4 -0
  247. package/es/ThemeProvider/index.js +8 -0
  248. package/es/ThemeProvider/utils/constants.d.ts +38 -0
  249. package/es/ThemeProvider/utils/constants.js +40 -0
  250. package/es/ThemeProvider/utils/index.d.ts +2 -0
  251. package/es/ThemeProvider/utils/index.js +2 -0
  252. package/es/ThemeProvider/utils/mountTokens.d.ts +26 -0
  253. package/es/ThemeProvider/utils/mountTokens.js +88 -0
  254. package/es/Toast/FunctionalToast.js +18 -0
  255. package/es/Toast/Toast.css +18 -20
  256. package/es/Toast/Toast.d.ts +2 -2
  257. package/es/Toast/Toast.js +53 -49
  258. package/es/Toast/Toast.types.d.ts +15 -1
  259. package/es/Tooltip/Tooltip.css +91 -0
  260. package/es/Tooltip/Tooltip.d.ts +5 -0
  261. package/es/Tooltip/Tooltip.js +175 -0
  262. package/es/Tooltip/Tooltip.types.d.ts +49 -0
  263. package/es/Tooltip/Tooltip.types.js +1 -0
  264. package/es/Tooltip/index.d.ts +2 -0
  265. package/es/Tooltip/index.js +6 -0
  266. package/es/index.d.ts +7 -0
  267. package/es/index.js +7 -0
  268. package/es/locales/base.d.ts +40 -0
  269. package/es/locales/base.js +0 -0
  270. package/es/locales/en-US.d.ts +3 -0
  271. package/es/locales/en-US.js +50 -0
  272. package/es/locales/hooks/useLocaleText.d.ts +3 -0
  273. package/es/locales/hooks/useLocaleText.js +26 -0
  274. package/es/locales/index.d.ts +5 -0
  275. package/es/locales/index.js +11 -0
  276. package/es/locales/zh-CN.d.ts +3 -0
  277. package/es/locales/zh-CN.js +32 -0
  278. package/es/locales/zh-TW.d.ts +3 -0
  279. package/es/locales/zh-TW.js +32 -0
  280. package/package.json +5 -5
@@ -0,0 +1,112 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
21
+ var __objRest = (source, exclude) => {
22
+ var target = {};
23
+ for (var prop in source)
24
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
+ target[prop] = source[prop];
26
+ if (source != null && __getOwnPropSymbols)
27
+ for (var prop of __getOwnPropSymbols(source)) {
28
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
+ target[prop] = source[prop];
30
+ }
31
+ return target;
32
+ };
33
+ var __export = (target, all) => {
34
+ for (var name in all)
35
+ __defProp(target, name, { get: all[name], enumerable: true });
36
+ };
37
+ var __copyProps = (to, from, except, desc) => {
38
+ if (from && typeof from === "object" || typeof from === "function") {
39
+ for (let key of __getOwnPropNames(from))
40
+ if (!__hasOwnProp.call(to, key) && key !== except)
41
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
42
+ }
43
+ return to;
44
+ };
45
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
46
+ // If the importer is in node compatibility mode or this is not an ESM
47
+ // file that has been converted to a CommonJS file using a Babel-
48
+ // compatible transform (i.e. "__esModule" has not been set), then set
49
+ // "default" to the CommonJS "module.exports" for node compatibility.
50
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
51
+ mod
52
+ ));
53
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
54
+ var CollapsePanelItem_exports = {};
55
+ __export(CollapsePanelItem_exports, {
56
+ default: () => CollapsePanelItem_default
57
+ });
58
+ module.exports = __toCommonJS(CollapsePanelItem_exports);
59
+ var import_react = __toESM(require("react"));
60
+ var import_clsx = __toESM(require("clsx"));
61
+ var import_Collapse = require("../Collapse");
62
+ const prefixCls = "bui-collapse-panel-item";
63
+ const CollapsePanelItem = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
64
+ const _a = props, {
65
+ className,
66
+ style,
67
+ label,
68
+ children,
69
+ icon,
70
+ active,
71
+ onClick
72
+ } = _a, others = __objRest(_a, [
73
+ "className",
74
+ "style",
75
+ "label",
76
+ "children",
77
+ "icon",
78
+ "active",
79
+ "onClick"
80
+ ]);
81
+ const isControlledIcon = typeof icon === "function";
82
+ const getIcon = () => {
83
+ return typeof icon === "function" ? icon(active) : icon;
84
+ };
85
+ return /* @__PURE__ */ import_react.default.createElement(
86
+ "div",
87
+ __spreadValues({
88
+ className: (0, import_clsx.default)(prefixCls, active && `${prefixCls}-active`, className),
89
+ style,
90
+ ref
91
+ }, others),
92
+ /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-header`, onClick }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-header-label` }, label), /* @__PURE__ */ import_react.default.createElement(
93
+ "div",
94
+ {
95
+ className: (0, import_clsx.default)(
96
+ `${prefixCls}-header-icon`,
97
+ `${prefixCls}-header-icon-arrow`,
98
+ {
99
+ [`${prefixCls}-header-icon-arrow-active`]: !isControlledIcon && active
100
+ }
101
+ )
102
+ },
103
+ getIcon()
104
+ )),
105
+ /* @__PURE__ */ import_react.default.createElement(import_Collapse.Collapse, { in: active, direction: "vertical", timeout: 300 }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-content` }, children))
106
+ );
107
+ });
108
+ CollapsePanelItem.displayName = "BuiCollapsePanelItem";
109
+ CollapsePanelItem.defaultProps = {
110
+ active: false
111
+ };
112
+ var CollapsePanelItem_default = CollapsePanelItem;
@@ -0,0 +1,4 @@
1
+ export { default } from './CollapsePanel';
2
+ export { default as CollapsePanel } from './CollapsePanel';
3
+ export { default as CollapsePanelItem } from './CollapsePanelItem';
4
+ export * from './CollapsePanel.types';
@@ -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 CollapsePanel_exports = {};
30
+ __export(CollapsePanel_exports, {
31
+ CollapsePanel: () => import_CollapsePanel2.default,
32
+ CollapsePanelItem: () => import_CollapsePanelItem.default,
33
+ default: () => import_CollapsePanel.default
34
+ });
35
+ module.exports = __toCommonJS(CollapsePanel_exports);
36
+ var import_CollapsePanel = __toESM(require("./CollapsePanel"));
37
+ var import_CollapsePanel2 = __toESM(require("./CollapsePanel"));
38
+ var import_CollapsePanelItem = __toESM(require("./CollapsePanelItem"));
39
+ __reExport(CollapsePanel_exports, require("./CollapsePanel.types"), module.exports);
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ CollapsePanel,
43
+ CollapsePanelItem,
44
+ ...require("./CollapsePanel.types")
45
+ });
@@ -2,6 +2,7 @@
2
2
  --font-size: var(--bui-countdown-font-size, var(--bui-text-size-1));
3
3
  --color: var(--bui-countdown-color, var(--bui-color-fg-default));
4
4
  --font-weight: var(--bui-countdown-font-weight, var(--bui-font-weight-normal));
5
+ --slice-unit-margin: var(--bui-countdown-slice-unit-margin, 0 2px);
5
6
  display: flex;
6
7
  flex-direction: row;
7
8
  align-items: center;
@@ -34,5 +35,5 @@
34
35
  sans-serif;
35
36
  }
36
37
  .bui-countdown-slice-unit {
37
- margin: 0 2px;
38
+ margin: var(--slice-unit-margin);
38
39
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DialogProps } from './Dialog.types';
2
+ import { DialogProps, DialogRef } from './Dialog.types';
3
3
  import './index.less';
4
- declare const Dialog: React.ForwardRefExoticComponent<Omit<DialogProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const Dialog: React.ForwardRefExoticComponent<Omit<DialogProps, "ref"> & React.RefAttributes<DialogRef>>;
5
5
  export default Dialog;
@@ -59,11 +59,13 @@ __export(Dialog_exports, {
59
59
  default: () => Dialog_default
60
60
  });
61
61
  module.exports = __toCommonJS(Dialog_exports);
62
- var import_react = __toESM(require("react"));
63
62
  var import_clsx = __toESM(require("clsx"));
63
+ var import_react = __toESM(require("react"));
64
64
  var import_Input = require("../Input");
65
65
  var import_Button = require("../Button");
66
+ var import_locales = require("../locales");
66
67
  var import_Modal = __toESM(require("../Modal"));
68
+ var import_ThemeProvider = require("../ThemeProvider");
67
69
  var import_index = require("./index.css");
68
70
  const prefixCls = "bui-dialog";
69
71
  const Dialog = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
@@ -78,7 +80,8 @@ const Dialog = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
78
80
  cancelText,
79
81
  placeholder,
80
82
  InputProps,
81
- className
83
+ className,
84
+ theme
82
85
  } = _a, others = __objRest(_a, [
83
86
  "open",
84
87
  "onOk",
@@ -90,9 +93,19 @@ const Dialog = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
90
93
  "cancelText",
91
94
  "placeholder",
92
95
  "InputProps",
93
- "className"
96
+ "className",
97
+ "theme"
94
98
  ]);
95
99
  const InputRef = (0, import_react.useRef)(null);
100
+ const themeConfig = (0, import_ThemeProvider.useTheme)(theme);
101
+ const {
102
+ cancel,
103
+ confirm,
104
+ placeholder: placeholderLocaleName
105
+ } = (0, import_locales.useLocaleText)("dialog", themeConfig);
106
+ (0, import_react.useImperativeHandle)(ref, () => {
107
+ return { theme: themeConfig };
108
+ });
96
109
  const footerNode = /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-body-footer` }, /* @__PURE__ */ import_react.default.createElement(
97
110
  import_Button.Button,
98
111
  {
@@ -100,7 +113,7 @@ const Dialog = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
100
113
  onClick: onClose,
101
114
  className: `${prefixCls}-body-button`
102
115
  },
103
- cancelText || "\u53D6\u6D88"
116
+ cancelText || cancel
104
117
  ), /* @__PURE__ */ import_react.default.createElement(
105
118
  import_Button.Button,
106
119
  {
@@ -112,14 +125,14 @@ const Dialog = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
112
125
  },
113
126
  className: `${prefixCls}-body-button`
114
127
  },
115
- confirmText || "\u786E\u5B9A"
128
+ confirmText || confirm
116
129
  ));
117
130
  const inputNode = type === "prompt" && /* @__PURE__ */ import_react.default.createElement(
118
131
  import_Input.Input,
119
132
  __spreadProps(__spreadValues({}, InputProps), {
120
133
  inputRef: InputRef,
121
134
  className: `${prefixCls}-body-input`,
122
- placeholder: `${placeholder || "\u8BF7\u5728\u6B64\u5904\u8F93\u5165"}`
135
+ placeholder: `${placeholder || placeholderLocaleName}`
123
136
  })
124
137
  );
125
138
  if (!open)
@@ -130,8 +143,7 @@ const Dialog = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
130
143
  open: true,
131
144
  className: (0, import_clsx.default)(prefixCls, className),
132
145
  disablePortal: true,
133
- onClose,
134
- ref
146
+ onClose
135
147
  }),
136
148
  /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-body` }, header && /* @__PURE__ */ import_react.default.createElement("h1", { className: `${prefixCls}-body-title` }, header), message && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-body-desc` }, message), inputNode, footerNode)
137
149
  );
@@ -1,11 +1,15 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { ModalProps } from '../Modal/Modal.types';
3
3
  import { InputProps } from '../Input/Input.types';
4
+ import { ThemeProps } from '../ThemeProvider/ThemeProvider.types';
4
5
  /**
5
6
  * 对话框类型
6
7
  */
7
8
  export type DialogType = 'confirm' | 'prompt';
8
9
  export type Dispatch = (action: boolean, val?: string) => void;
10
+ export type DialogRef = {
11
+ theme?: ThemeProps;
12
+ };
9
13
  export interface DialogProps extends ModalProps {
10
14
  /**
11
15
  * 对话框类型
@@ -36,6 +40,10 @@ export interface DialogProps extends ModalProps {
36
40
  * 取消文本内容
37
41
  */
38
42
  cancelText?: ReactNode;
43
+ /**
44
+ * theme 主题定制
45
+ */
46
+ theme?: ThemeProps;
39
47
  /**
40
48
  * 确认回调
41
49
  */
@@ -82,7 +90,7 @@ export type DialogPromise = Promise<boolean | string>;
82
90
  /**
83
91
  * Dialog Instance
84
92
  */
85
- export interface DialogInstance {
93
+ export interface DialogFunction {
86
94
  /**
87
95
  * 直接调用显示确认框 Dialog
88
96
  */
@@ -96,3 +104,6 @@ export interface DialogInstance {
96
104
  */
97
105
  prompt?: (options: PromptOptions, val?: string) => DialogPromise;
98
106
  }
107
+ export interface DialogInstance extends DialogFunction {
108
+ useDialog: () => [DialogFunction, React.JSX.Element];
109
+ }
@@ -94,7 +94,7 @@ const DialogGenerator = (options) => {
94
94
  const rootElement = (0, import_utils.getRootElement)();
95
95
  rootElement.appendChild(rootWrapper);
96
96
  const DialogComponent = () => {
97
- const _a = options, { onConfirm, onCancel } = _a, others = __objRest(_a, ["onConfirm", "onCancel"]);
97
+ const _a = options, { onConfirm, onCancel, ref } = _a, others = __objRest(_a, ["onConfirm", "onCancel", "ref"]);
98
98
  const [visible, setVisible] = (0, import_react.useState)(false);
99
99
  const close = (0, import_react.useCallback)(() => {
100
100
  setVisible(false);
@@ -124,7 +124,9 @@ const DialogGenerator = (options) => {
124
124
  });
125
125
  return /* @__PURE__ */ import_react.default.createElement(
126
126
  import_Dialog.default,
127
- __spreadProps(__spreadValues({}, others), {
127
+ __spreadProps(__spreadValues({
128
+ ref
129
+ }, others), {
128
130
  open: visible,
129
131
  onOk: (val) => dispatch(true, val),
130
132
  onClose: () => dispatch(false)
@@ -163,6 +165,40 @@ const prompt = (options) => {
163
165
  type: "prompt"
164
166
  }, formatProps(options)));
165
167
  };
168
+ const useDialog = () => {
169
+ const holderRef = import_react.default.useRef(null);
170
+ const wrapAPI = (props) => {
171
+ const options = __spreadValues({ theme: holderRef.current.theme }, formatProps(props));
172
+ const _a = options, { onConfirm, onCancel } = _a, rest = __objRest(_a, ["onConfirm", "onCancel"]);
173
+ return new Promise((resolve) => {
174
+ DialogGenerator(__spreadProps(__spreadValues({}, rest), {
175
+ onConfirm: (val) => __async(void 0, null, function* () {
176
+ yield onConfirm == null ? void 0 : onConfirm(val);
177
+ if (rest.type === "prompt")
178
+ resolve(val);
179
+ else
180
+ resolve(true);
181
+ }),
182
+ onCancel: () => __async(void 0, null, function* () {
183
+ yield onCancel == null ? void 0 : onCancel();
184
+ resolve(false);
185
+ })
186
+ }));
187
+ });
188
+ };
189
+ wrapAPI.confirm = (options) => Dialog(__spreadProps(__spreadValues({
190
+ type: "confirm"
191
+ }, formatProps(options)), {
192
+ theme: holderRef.current.theme
193
+ }));
194
+ wrapAPI.prompt = (options) => Dialog(__spreadProps(__spreadValues({
195
+ type: "prompt"
196
+ }, formatProps(options)), {
197
+ theme: holderRef.current.theme
198
+ }));
199
+ return [wrapAPI, /* @__PURE__ */ import_react.default.createElement(import_Dialog.default, { key: "dialog-holder", ref: holderRef })];
200
+ };
166
201
  Dialog.confirm = confirm;
167
202
  Dialog.prompt = prompt;
203
+ Dialog.useDialog = useDialog;
168
204
  var FunctionalDialog_default = Dialog;
@@ -1,8 +1,15 @@
1
1
  .bui-dialog {
2
- --max-width: 300px;
3
- --border-radius: var(--bui-shape-radius-drawer);
4
- --header-font-size: var(--bui-title-size-2);
5
- --message-font-size: var(--bui-title-size-4);
2
+ --max-width: var(--bui-dialog-max-width, 300px);
3
+ --border-radius: var(--bui-dialog-border-radius, var(--bui-shape-radius-drawer));
4
+ --title-padding: var(--bui-dialog-title-padding, 0 40px 9px);
5
+ --desc-padding: var(--bui-dialog-desc-padding, 0 24px);
6
+ --footer-margin-top: var(--bui-dialog-footer-margin-top, 15px);
7
+ --button-height: var(--bui-dialog-button-height, 53px);
8
+ --button-line-height: var(--bui-dialog-button-line-height, 25px);
9
+ --button-padding: var(--bui-dialog-button-padding, 12px 0 13px);
10
+ --button-font-size: var(--bui-dialog-button-font-size, 17px);
11
+ --button-border-left: var(--bui-dialog-button-border-left, 1px solid rgba(0, 0, 0, 0.05));
12
+ --button-active-background-color: var(--bui-dialog-button-active-background-color, rgba(54, 57, 64, 0.05));
6
13
  display: flex;
7
14
  align-items: center;
8
15
  justify-content: center;
@@ -17,26 +24,26 @@
17
24
  line-height: 21px;
18
25
  }
19
26
  .bui-dialog-body-title {
20
- padding: 0 40px 9px;
21
- font-size: var(--header-font-size);
27
+ padding: var(--title-padding);
28
+ font-size: var(--bui-title-size-2);
22
29
  text-align: center;
23
30
  color: var(--bui-color-fg-default);
24
- font-weight: 500;
31
+ font-weight: var(--bui-font-weight-medium);
25
32
  }
26
33
  .bui-dialog-body-title + .bui-dialog-body-footer {
27
- margin-top: 6px;
34
+ margin-top: var(--bui-spacing-sm);
28
35
  }
29
36
  .bui-dialog-body-desc {
30
- padding: 0 24px;
37
+ padding: var(--desc-padding);
31
38
  color: var(--bui-color-fg-muted);
32
- font-size: var(--message-font-size);
39
+ font-size: var(--bui-title-size-4);
33
40
  text-align: center;
34
41
  }
35
42
  .bui-dialog-body-desc:first-child {
36
43
  padding-top: 0;
37
44
  }
38
45
  .bui-dialog-body-footer {
39
- margin-top: 15px;
46
+ margin-top: var(--footer-margin-top);
40
47
  border-top: 1px solid rgba(0, 0, 0, 0.05);
41
48
  display: -webkit-box;
42
49
  display: flex;
@@ -49,18 +56,20 @@
49
56
  flex: 1;
50
57
  display: block;
51
58
  width: 100%;
52
- height: 53px;
53
- line-height: 25px;
54
- padding: 12px 0 13px;
55
- font-size: 17px;
56
- background: 0 0;
59
+ height: var(--button-height);
60
+ line-height: var(--button-line-height);
61
+ padding: var(--button-padding);
62
+ font-size: var(--button-font-size);
57
63
  border: 0;
58
64
  outline: 0;
59
- border-left: 1px solid rgba(0, 0, 0, 0.05);
65
+ border-left: var(--button-border-left);
60
66
  border-radius: 0;
61
67
  text-align: center;
62
68
  box-sizing: border-box;
63
69
  }
70
+ .bui-dialog-body-button:first-child {
71
+ border: none;
72
+ }
64
73
  .bui-dialog-body-button:active {
65
- background-color: rgba(54, 57, 64, 0.05);
74
+ background-color: var(--button-active-background-color);
66
75
  }
@@ -1,18 +1,20 @@
1
1
  .bui-divider {
2
2
  --height: var(--bui-divider-height, 100%);
3
3
  --width: var(--bui-divider-width, 100%);
4
+ --border-width: var(--bui-divider-border-width, 1px);
5
+ --line-width: var(--bui-divider-line-width, 40px);
4
6
  border-color: var(--bui-color-border-default);
5
7
  font-family: var(--bui-font-family);
6
8
  }
7
9
  .bui-divider-vertical {
8
10
  height: var(--height);
9
11
  display: inline-block;
10
- border-right-width: 1px;
12
+ border-right-width: var(--border-width);
11
13
  border-right-style: solid;
12
14
  }
13
15
  .bui-divider-horizontal {
14
16
  width: var(--width);
15
- border-bottom-width: 1px;
17
+ border-bottom-width: var(--border-width);
16
18
  border-bottom-style: solid;
17
19
  }
18
20
  .bui-divider-vertical-dashed {
@@ -29,8 +31,8 @@
29
31
  justify-content: center;
30
32
  }
31
33
  .bui-divider-line {
32
- width: 40px;
33
- border-bottom-width: 1px;
34
+ width: var(--line-width);
35
+ border-bottom-width: var(--border-width);
34
36
  border-bottom-style: solid;
35
37
  border-color: var(--bui-color-border-default);
36
38
  }
@@ -1,8 +1,10 @@
1
1
  .bui-icon-btn {
2
- --bg-color: var(--bui-color-neutral-5);
3
- --color: var(--bui-color-fg-muted);
4
- --icon-size: 17px;
5
- --user-area: 5px;
2
+ --bg-color: var(--bui-icon-btn-bg-color, var(--bui-color-neutral-5));
3
+ --color: var(--bui-icon-btn-color, var(--bui-color-fg-muted));
4
+ --icon-size: var(--bui-icon-btn-font-size, 17px);
5
+ --user-area: var(--bui-icon-btn-padding, 5px);
6
+ --large-font-size: var(--bui-icon-btn-large-font-size, 23px);
7
+ --disabled-opacity: var(--bui-icon-btn-disabled-opacity, 0.5);
6
8
  position: relative;
7
9
  display: inline-flex;
8
10
  height: auto;
@@ -47,10 +49,10 @@
47
49
  }
48
50
  .bui-icon-btn-medium.bui-icon-btn-outlined,
49
51
  .bui-icon-btn-medium.bui-icon-btn-contained {
50
- padding: 5px;
52
+ padding: var(--user-area);
51
53
  }
52
54
  .bui-icon-btn-large {
53
- font-size: 23px;
55
+ font-size: var(--large-font-size);
54
56
  padding: var(--bui-spacing-sm);
55
57
  }
56
58
  .bui-icon-btn-large.bui-icon-btn-outlined,
@@ -59,7 +61,7 @@
59
61
  }
60
62
  .bui-icon-btn-disabled {
61
63
  pointer-events: none;
62
- opacity: 0.5;
64
+ opacity: var(--disabled-opacity);
63
65
  }
64
66
  .bui-icon-btn-circular {
65
67
  border-radius: 100%;
@@ -1,4 +1,5 @@
1
1
  .bui-image {
2
+ --default-background-color: var(--bui-image-default-background-color, rgba(127, 127, 127, 0.2));
2
3
  width: auto;
3
4
  height: auto;
4
5
  display: inline-block;
@@ -31,5 +32,5 @@
31
32
  .bui-image-default-icon-item {
32
33
  width: 100%;
33
34
  height: 100%;
34
- background-color: rgba(127, 127, 127, 0.2);
35
+ background-color: var(--default-background-color);
35
36
  }
@@ -1,11 +1,18 @@
1
1
  .bui-input {
2
+ --height: var(--bui-input-height, 32px);
3
+ --padding: var(--bui-input-padding, 4px 10px);
4
+ --border-radius: var(--bui-input-border-radius, var(--bui-shape-radius-default));
5
+ --icon-start-margin-right: var(--bui-input-icon-start-margin-right, 3px);
6
+ --icon-end-margin-left: var(--bui-input-icon-end-margin-left, 3px);
7
+ --background-color: var(--bui-input-background-color, transparent);
8
+ --disabled-background-color: var(--bui-input-disabled-background-color, rgba(0, 0, 0, 0.04));
2
9
  position: relative;
3
10
  display: flex;
4
11
  align-items: center;
5
- height: 32px;
6
- padding: 4px 10px;
12
+ height: var(--height);
13
+ padding: var(--padding);
7
14
  box-sizing: border-box;
8
- border-radius: var(--bui-shape-radius-default);
15
+ border-radius: var(--border-radius);
9
16
  border: 1px solid var(--bui-color-border-default);
10
17
  font-family: var(--bui-font-family);
11
18
  }
@@ -16,10 +23,10 @@
16
23
  font-size: var(--bui-title-size-3);
17
24
  }
18
25
  .bui-input-icon-start {
19
- margin-right: 3px;
26
+ margin-right: var(--icon-start-margin-right);
20
27
  }
21
28
  .bui-input-icon-end {
22
- margin-left: 3px;
29
+ margin-left: var(--icon-end-margin-left);
23
30
  }
24
31
  .bui-input-input {
25
32
  flex: 1;
@@ -30,7 +37,7 @@
30
37
  color: var(--bui-color-fg-default);
31
38
  border: none;
32
39
  outline: none;
33
- background-color: transparent;
40
+ background-color: var(--background-color);
34
41
  font-size: var(--bui-text-size-2);
35
42
  }
36
43
  .bui-input-input::placeholder {
@@ -38,7 +45,7 @@
38
45
  }
39
46
  .bui-input-disabled {
40
47
  pointer-events: none;
41
- background-color: rgba(0, 0, 0, 0.04);
48
+ background-color: var(--disabled-background-color);
42
49
  }
43
50
  .bui-input-disabled .bui-input-input {
44
51
  color: var(--bui-color-fg-disabled);
@@ -1,4 +1,7 @@
1
1
  .bui-list {
2
+ --small-item-padding: var(--bui-list-small-item-padding, 5px 12px);
3
+ --medium-item-padding: var(--bui-list-medium-item-padding, 18px 12px);
4
+ --large-item-padding: var(--bui-list-large-item-padding, 20px 12px);
2
5
  background: var(--bui-color-bg-view);
3
6
  font-size: var(--bui-title-size-3);
4
7
  font-family: var(--bui-font-family);
@@ -10,13 +10,13 @@
10
10
  color: var(--bui-color-fg-subtle);
11
11
  }
12
12
  .bui-list-small .bui-list-item {
13
- padding: 5px 12px;
13
+ padding: var(--small-item-padding);
14
14
  }
15
15
  .bui-list-medium .bui-list-item {
16
- padding: 18px 12px;
16
+ padding: var(--medium-item-padding);
17
17
  }
18
18
  .bui-list-large .bui-list-item {
19
- padding: 20px 12px;
19
+ padding: var(--large-item-padding);
20
20
  }
21
21
  .bui-list-item-divider:not(:last-child) {
22
22
  border-bottom: 1px solid var(--bui-color-border-default);
@@ -13,6 +13,6 @@
13
13
  flex: 1 1 auto;
14
14
  }
15
15
  .bui-list-item-content-secondary {
16
- font-size: 13px;
16
+ font-size: var(--bui-text-size-2);
17
17
  color: var(--bui-color-fg-muted);
18
18
  }
@@ -1,4 +1,6 @@
1
1
  .bui-loading {
2
+ --icon-font-size: var(--bui-loading-icon-font-size, 30px);
3
+ --text-padding: var(--bui-loading-text-padding, 10px);
2
4
  --animation-duration: var(--bui-loading-animation-duration, 1.6s);
3
5
  width: fit-content;
4
6
  display: flex;
@@ -8,11 +10,11 @@
8
10
  font-family: var(--bui-font-family);
9
11
  }
10
12
  .bui-loading-icon {
11
- font-size: 30px;
13
+ font-size: var(--icon-font-size);
12
14
  animation: loading var(--animation-duration) linear infinite;
13
15
  }
14
16
  .bui-loading-text {
15
- padding: 10px;
17
+ padding: var(--text-padding);
16
18
  font-size: var(--bui-title-size-3);
17
19
  }
18
20
  .bui-loading-vertical {