@blocklet/ui-react 2.13.12 → 2.13.13

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 (70) hide show
  1. package/lib/ComponentInstaller/index.js +6 -7
  2. package/lib/ComponentInstaller/installer-item.js +6 -6
  3. package/lib/Dashboard/index.js +6 -4
  4. package/lib/Footer/index.js +9 -5
  5. package/lib/Footer/links.js +1 -1
  6. package/lib/Footer/social-media.js +3 -12
  7. package/lib/Header/index.js +7 -6
  8. package/lib/Notifications/hooks/use-title.js +7 -5
  9. package/lib/UserCenter/components/config-profile.js +2 -3
  10. package/lib/UserCenter/components/editable-field.d.ts +2 -0
  11. package/lib/UserCenter/components/editable-field.js +4 -5
  12. package/lib/UserCenter/components/nft.js +3 -4
  13. package/lib/UserCenter/components/notification.js +4 -7
  14. package/lib/UserCenter/components/passport.js +3 -6
  15. package/lib/UserCenter/components/settings.js +4 -4
  16. package/lib/UserCenter/components/status-dialog/index.js +4 -5
  17. package/lib/UserCenter/components/status-selector/duration-menu.d.ts +1 -3
  18. package/lib/UserCenter/components/status-selector/duration-menu.js +2 -4
  19. package/lib/UserCenter/components/status-selector/menu-item.d.ts +1 -3
  20. package/lib/UserCenter/components/status-selector/menu-item.js +2 -4
  21. package/lib/UserCenter/components/third-party-login/third-party-item.js +21 -17
  22. package/lib/UserCenter/components/user-center.js +6 -7
  23. package/lib/UserCenter/components/user-info/address.js +2 -3
  24. package/lib/UserCenter/components/user-info/link-preview-input.js +8 -8
  25. package/lib/UserCenter/components/user-info/metadata.js +1 -1
  26. package/lib/UserCenter/components/user-info/switch-role.js +5 -8
  27. package/lib/UserCenter/components/user-info/timezone-select.js +13 -8
  28. package/lib/UserCenter/components/user-info/user-basic-info.js +3 -4
  29. package/lib/UserCenter/components/user-info/user-info-item.js +2 -3
  30. package/lib/UserCenter/components/user-info/utils.d.ts +2 -2
  31. package/lib/UserCenter/components/user-info/utils.js +12 -13
  32. package/lib/UserCenter/components/webhook-item.js +16 -13
  33. package/lib/UserSessions/components/user-session-info.js +2 -3
  34. package/lib/UserSessions/components/user-sessions.js +9 -6
  35. package/lib/common/header-addons.js +1 -1
  36. package/lib/hooks/use-blocklet-logo.d.ts +8 -0
  37. package/lib/hooks/use-blocklet-logo.js +23 -0
  38. package/package.json +4 -4
  39. package/src/ComponentInstaller/index.jsx +7 -7
  40. package/src/ComponentInstaller/installer-item.jsx +6 -6
  41. package/src/Dashboard/index.jsx +6 -4
  42. package/src/Footer/index.jsx +9 -5
  43. package/src/Footer/links.jsx +1 -1
  44. package/src/Footer/social-media.jsx +3 -9
  45. package/src/Header/index.tsx +7 -6
  46. package/src/Notifications/hooks/use-title.tsx +8 -5
  47. package/src/UserCenter/components/config-profile.tsx +2 -3
  48. package/src/UserCenter/components/editable-field.tsx +6 -5
  49. package/src/UserCenter/components/nft.tsx +3 -4
  50. package/src/UserCenter/components/notification.tsx +4 -7
  51. package/src/UserCenter/components/passport.tsx +3 -7
  52. package/src/UserCenter/components/settings.tsx +4 -4
  53. package/src/UserCenter/components/status-dialog/index.tsx +4 -5
  54. package/src/UserCenter/components/status-selector/duration-menu.tsx +2 -4
  55. package/src/UserCenter/components/status-selector/menu-item.tsx +2 -4
  56. package/src/UserCenter/components/third-party-login/third-party-item.tsx +22 -17
  57. package/src/UserCenter/components/user-center.tsx +6 -7
  58. package/src/UserCenter/components/user-info/address.tsx +3 -3
  59. package/src/UserCenter/components/user-info/link-preview-input.tsx +9 -10
  60. package/src/UserCenter/components/user-info/metadata.tsx +1 -1
  61. package/src/UserCenter/components/user-info/switch-role.tsx +6 -9
  62. package/src/UserCenter/components/user-info/timezone-select.tsx +12 -9
  63. package/src/UserCenter/components/user-info/user-basic-info.tsx +3 -4
  64. package/src/UserCenter/components/user-info/user-info-item.tsx +2 -3
  65. package/src/UserCenter/components/user-info/utils.ts +13 -13
  66. package/src/UserCenter/components/webhook-item.tsx +16 -13
  67. package/src/UserSessions/components/user-session-info.tsx +2 -3
  68. package/src/UserSessions/components/user-sessions.tsx +9 -5
  69. package/src/common/header-addons.jsx +2 -2
  70. package/src/hooks/use-blocklet-logo.tsx +32 -0
@@ -2,7 +2,6 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Icon } from "@iconify/react";
3
3
  import { Box, Tooltip, Typography } from "@mui/material";
4
4
  import LinkRoundedIcon from "@iconify-icons/material-symbols/link-rounded";
5
- import { temp as colors } from "@arcblock/ux/lib/Colors";
6
5
  import Button from "@arcblock/ux/lib/Button";
7
6
  import Avatar from "@arcblock/ux/lib/Avatar";
8
7
  import { useCreation, useMemoizedFn, useReactive } from "ahooks";
@@ -134,9 +133,10 @@ export default function ThirdPartyItem({
134
133
  Box,
135
134
  {
136
135
  sx: {
137
- borderRadius: 2,
138
- border: `1px solid ${colors.strokeBorderBase}`,
139
- background: colors.backgroundsBgField,
136
+ borderRadius: 1,
137
+ border: "1px solid",
138
+ borderColor: "divider",
139
+ backgroundColor: "grey.50",
140
140
  display: "flex",
141
141
  alignItems: "center",
142
142
  py: 1,
@@ -213,7 +213,7 @@ export default function ThirdPartyItem({
213
213
  {
214
214
  component: Icon,
215
215
  icon: InfoOutlineRoundedIcon,
216
- color: colors.textSubtitle,
216
+ color: "text.secondary",
217
217
  fontSize: 16,
218
218
  sx: { cursor: "pointer", flexShrink: 0 }
219
219
  }
@@ -231,18 +231,22 @@ export default function ThirdPartyItem({
231
231
  {
232
232
  variant: "outlined",
233
233
  size: "small",
234
- sx: {
235
- color: item?._bind ? colors.red : colors.foregroundsFgBase,
236
- borderColor: item?._bind ? colors.red : colors.strokeBorderBase,
237
- backgroundColor: colors.buttonsButtonNeutral,
238
- "&:hover": {
239
- borderColor: item?._bind ? colors.red : colors.strokeBorderBase,
240
- backgroundColor: colors.buttonsButtonNeutralHover
241
- },
242
- py: 0.5,
243
- borderRadius: 2,
244
- fontWeight: 500,
245
- whiteSpace: "nowrap"
234
+ sx: (theme) => {
235
+ const textRed = theme.palette.error.main;
236
+ const textPrimary = theme.palette.primary.main;
237
+ return {
238
+ color: item?._bind ? textRed : textPrimary,
239
+ borderColor: item?._bind ? textRed : textPrimary,
240
+ backgroundColor: "background.default",
241
+ "&:hover": {
242
+ borderColor: item?._bind ? textRed : textPrimary,
243
+ backgroundColor: "action.hover"
244
+ },
245
+ py: 0.5,
246
+ borderRadius: 1,
247
+ fontWeight: 500,
248
+ whiteSpace: "nowrap"
249
+ };
246
250
  },
247
251
  fullWidth: true,
248
252
  startIcon: currentState.loading ? null : /* @__PURE__ */ jsx(Icon, { icon: LinkRoundedIcon }),
@@ -8,7 +8,6 @@ import Tabs from "@arcblock/ux/lib/Tabs";
8
8
  import Empty from "@arcblock/ux/lib/Empty";
9
9
  import Button from "@arcblock/ux/lib/Button";
10
10
  import Result from "@arcblock/ux/lib/Result";
11
- import { temp as colors } from "@arcblock/ux/lib/Colors";
12
11
  import { useConfirm } from "@arcblock/ux/lib/Dialog";
13
12
  import { translate } from "@arcblock/ux/lib/Locale/util";
14
13
  import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
@@ -139,7 +138,7 @@ export default function UserCenter({
139
138
  fullScreen: isMobile,
140
139
  sx: {
141
140
  ".MuiDialog-paper": {
142
- borderRadius: 2,
141
+ borderRadius: 1,
143
142
  maxWidth: 1200
144
143
  },
145
144
  ".ux-dialog_title": {
@@ -274,12 +273,12 @@ export default function UserCenter({
274
273
  gap: 2.5
275
274
  },
276
275
  children: [
277
- isMyself ? /* @__PURE__ */ jsxs(Box, { sx: { border: `1px solid ${colors.dividerColor}`, borderRadius: 2, p: 2 }, children: [
276
+ isMyself ? /* @__PURE__ */ jsxs(Box, { sx: { border: "1px solid", borderColor: "divider", borderRadius: 1.5, p: 2 }, children: [
278
277
  /* @__PURE__ */ jsx(
279
278
  Typography,
280
279
  {
281
280
  sx: {
282
- color: colors.foregroundsFgBase,
281
+ color: "text.primary",
283
282
  fontWeight: 600,
284
283
  mb: 2.5
285
284
  },
@@ -330,7 +329,7 @@ export default function UserCenter({
330
329
  alignItems: "center",
331
330
  flex: 1
332
331
  },
333
- children: /* @__PURE__ */ jsx(CircularProgress, { sx: { color: colors.primary100 } })
332
+ children: /* @__PURE__ */ jsx(CircularProgress, {})
334
333
  }
335
334
  );
336
335
  }
@@ -459,7 +458,7 @@ export default function UserCenter({
459
458
  display: "block",
460
459
  width: "100%",
461
460
  height: "1px",
462
- backgroundColor: `${colors.dividerColor} !important`
461
+ backgroundColor: "divider"
463
462
  }
464
463
  }
465
464
  }
@@ -471,7 +470,7 @@ export default function UserCenter({
471
470
  ) : null,
472
471
  userCenterTabs.length === 0 && emptyContent
473
472
  ] }),
474
- !isMobile && /* @__PURE__ */ jsx(Divider, { orientation: "vertical", sx: { borderColor: colors.dividerColor, ml: 5 } }),
473
+ !isMobile && /* @__PURE__ */ jsx(Divider, { orientation: "vertical", sx: { ml: 5 } }),
475
474
  /* @__PURE__ */ jsx(
476
475
  UserBasicInfo,
477
476
  {
@@ -3,7 +3,6 @@ import { Box } from "@mui/material";
3
3
  import { useMemoizedFn } from "ahooks";
4
4
  import { translate } from "@arcblock/ux/lib/Locale/util";
5
5
  import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
6
- import { temp as colors } from "@arcblock/ux/lib/Colors";
7
6
  import CountrySelect from "@arcblock/ux/lib/PhoneInput/country-select";
8
7
  import { translations } from "../../libs/locales.js";
9
8
  import EditableField from "../editable-field.js";
@@ -14,11 +13,11 @@ const selectStyle = {
14
13
  borderRadius: 1,
15
14
  "&:hover": {
16
15
  "fieldset.MuiOutlinedInput-notchedOutline": {
17
- borderColor: colors.dividerColor
16
+ borderColor: "divider"
18
17
  }
19
18
  },
20
19
  "fieldset.MuiOutlinedInput-notchedOutline": {
21
- borderColor: colors.dividerColor,
20
+ borderColor: "divider",
22
21
  borderRadius: 1
23
22
  },
24
23
  ".MuiSelect-select": {
@@ -1,9 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Box, Button, FormControl, IconButton, TextField, Typography } from "@mui/material";
3
3
  import styled from "@emotion/styled";
4
- import RemoveIcon from "@arcblock/icons/lib/Subtract";
4
+ import RemoveIcon from "@mui/icons-material/Remove";
5
5
  import AddIcon from "@mui/icons-material/Add";
6
- import { temp as colors } from "@arcblock/ux/lib/Colors";
7
6
  import { useEffect, useMemo, useState } from "react";
8
7
  import { translate } from "@arcblock/ux/lib/Locale/util";
9
8
  import { useMemoizedFn } from "ahooks";
@@ -69,7 +68,7 @@ function DynamicLinkForm({ links = [], onChange }) {
69
68
  onChange(updatedLinks);
70
69
  };
71
70
  return /* @__PURE__ */ jsxs(Box, { width: "100%", children: [
72
- /* @__PURE__ */ jsx(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", gap: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, sx: { mb: 0, fontSize: "12px", color: "#4B5563" }, children: "Social Media" }) }),
71
+ /* @__PURE__ */ jsx(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", gap: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, sx: { mb: 0, fontSize: "12px", color: "text.primary" }, children: "Social Media" }) }),
73
72
  links.map((link, index) => (
74
73
  // eslint-disable-next-line react/no-array-index-key
75
74
  /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "flex-start", mb: 1, children: [
@@ -81,7 +80,7 @@ function DynamicLinkForm({ links = [], onChange }) {
81
80
  errorMsg: errors[index] ? t("profile.invalidURL") : ""
82
81
  }
83
82
  ),
84
- /* @__PURE__ */ jsx(IconButton, { sx: { color: colors.foregroundsFgMuted }, onClick: () => handleRemoveLink(index), children: /* @__PURE__ */ jsx(RemoveIcon, {}) })
83
+ /* @__PURE__ */ jsx(IconButton, { onClick: () => handleRemoveLink(index), children: /* @__PURE__ */ jsx(RemoveIcon, { sx: { color: "text.secondary" } }) })
85
84
  ] }, index)
86
85
  )),
87
86
  links.length < 5 && /* @__PURE__ */ jsxs(
@@ -94,11 +93,12 @@ function DynamicLinkForm({ links = [], onChange }) {
94
93
  size: "small",
95
94
  sx: {
96
95
  height: "40px",
97
- border: `1px dashed ${colors.dividerColor}`,
98
- color: colors.textBase,
96
+ border: "1px dashed",
97
+ borderColor: "grey.100",
98
+ color: "text.primary",
99
99
  "&:hover": {
100
- border: `1px dashed ${colors.backgroundsBgSubtileHover}`,
101
- backgroundColor: colors.backgroundsBgSubtileHover
100
+ borderColor: "grey.100",
101
+ backgroundColor: "action.hover"
102
102
  },
103
103
  "&.Mui-disabled": {
104
104
  borderStyle: "dashed"
@@ -519,7 +519,7 @@ export default function UserMetadataComponent({
519
519
  PaperProps: {
520
520
  sx: {
521
521
  boxShadow: "0px -2px 16px 0px rgba(0, 0, 0, 0.08)",
522
- borderRadius: 3,
522
+ borderRadius: 1.5,
523
523
  // 保持跟 DID Wallet 一致
524
524
  borderBottomLeftRadius: 0,
525
525
  borderBottomRightRadius: 0
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { memo } from "react";
3
3
  import { Chip } from "@mui/material";
4
+ import { Icon } from "@iconify/react";
5
+ import SwapHorizRoundedIcon from "@iconify-icons/material-symbols/swap-horiz-rounded";
4
6
  import { useCreation } from "ahooks";
5
- import SwitchIcon from "@arcblock/icons/lib/Switch";
6
- import { temp as colors } from "@arcblock/ux/lib/Colors";
7
7
  function SwitchRole({ user, switchPassport }) {
8
8
  const currentRole = useCreation(
9
9
  () => (user?.passports || [])?.find((item) => item.name === user.role),
@@ -19,21 +19,18 @@ function SwitchRole({ user, switchPassport }) {
19
19
  flexShrink: 0,
20
20
  fontWeight: "bold",
21
21
  fontSize: "12px",
22
- color: colors.textBase,
23
- borderColor: colors.strokeBorderStrong,
22
+ color: "text.primary",
23
+ borderColor: "grey.100",
24
24
  backgroundColor: "transparent",
25
25
  textTransform: "capitalize",
26
26
  pr: 1,
27
27
  pl: 0.5,
28
- "&:hover": {
29
- backgroundColor: "rgba(0, 0, 0, 0.04)"
30
- },
31
28
  "&:active": {
32
29
  boxShadow: "none"
33
30
  }
34
31
  },
35
32
  clickable: true,
36
- deleteIcon: /* @__PURE__ */ jsx(SwitchIcon, { color: colors.textBase, width: 20, height: 20 }),
33
+ deleteIcon: /* @__PURE__ */ jsx(Icon, { icon: SwapHorizRoundedIcon, color: "inherit" }),
37
34
  onDelete: switchPassport,
38
35
  onClick: switchPassport
39
36
  }
@@ -5,8 +5,7 @@ import Select from "@mui/material/Select";
5
5
  import ListSubheader from "@mui/material/ListSubheader";
6
6
  import TextField from "@mui/material/TextField";
7
7
  import debounce from "lodash/debounce";
8
- import { temp as colors } from "@arcblock/ux/lib/Colors";
9
- import ArrowDownwardIcon from "@arcblock/icons/lib/ArrowDown";
8
+ import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
10
9
  import { getTimezones } from "./utils.js";
11
10
  const timezones = getTimezones();
12
11
  export function TimezoneSelect({ value, onChange, disabled = false, mode = "self" }) {
@@ -37,7 +36,13 @@ export function TimezoneSelect({ value, onChange, disabled = false, mode = "self
37
36
  displayEmpty: true,
38
37
  variant: "outlined",
39
38
  placeholder: "Timezone",
40
- IconComponent: (props) => /* @__PURE__ */ jsx(ArrowDownwardIcon, { ...props, width: 20, height: 20 }),
39
+ IconComponent: (props) => /* @__PURE__ */ jsx(
40
+ KeyboardArrowDownIcon,
41
+ {
42
+ ...props,
43
+ sx: { fontSize: 18, color: (theme) => `${theme.palette.text.secondary} !important` }
44
+ }
45
+ ),
41
46
  MenuProps: {
42
47
  PaperProps: {
43
48
  style: {
@@ -52,11 +57,11 @@ export function TimezoneSelect({ value, onChange, disabled = false, mode = "self
52
57
  width: "100%",
53
58
  "&:hover": {
54
59
  "fieldset.MuiOutlinedInput-notchedOutline": {
55
- borderColor: colors.dividerColor
60
+ borderColor: "divider"
56
61
  }
57
62
  },
58
63
  "fieldset.MuiOutlinedInput-notchedOutline": {
59
- borderColor: colors.dividerColor
64
+ borderColor: "divider"
60
65
  }
61
66
  },
62
67
  children: [
@@ -76,14 +81,14 @@ export function TimezoneSelect({ value, onChange, disabled = false, mode = "self
76
81
  marginTop: "8px",
77
82
  "& .MuiOutlinedInput-root": {
78
83
  "& fieldset": {
79
- borderColor: colors.dividerColor,
84
+ borderColor: "divider",
80
85
  borderWidth: "1px"
81
86
  },
82
87
  "&:hover fieldset": {
83
- borderColor: colors.dividerColor
88
+ borderColor: "divider"
84
89
  },
85
90
  "&.Mui-focused fieldset": {
86
- borderColor: colors.dividerColor
91
+ borderColor: "divider"
87
92
  }
88
93
  }
89
94
  }
@@ -8,7 +8,6 @@ import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
8
8
  import noop from "lodash/noop";
9
9
  import { useEffect, useState } from "react";
10
10
  import Toast from "@arcblock/ux/lib/Toast";
11
- import { temp as colors } from "@arcblock/ux/lib/Colors";
12
11
  import { parseURL, joinURL } from "ufo";
13
12
  import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
14
13
  import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
@@ -213,7 +212,7 @@ export default function UserBasicInfo({
213
212
  ] }),
214
213
  /* @__PURE__ */ jsx(UserMetadataComponent, { isMobile, isMyself, user, onSave }),
215
214
  isMyself ? /* @__PURE__ */ jsxs(Fragment, { children: [
216
- /* @__PURE__ */ jsx(Divider, { sx: { my: isMobile ? 1 : 3, borderColor: colors.dividerColor } }),
215
+ /* @__PURE__ */ jsx(Divider, { sx: { my: isMobile ? 1 : 3 } }),
217
216
  isMobile && !onlyProfile ? /* @__PURE__ */ jsx(
218
217
  Box,
219
218
  {
@@ -228,9 +227,9 @@ export default function UserBasicInfo({
228
227
  size: "small",
229
228
  onClick: toggleExpand,
230
229
  sx: {
231
- backgroundColor: colors.backgroundsBgField,
230
+ backgroundColor: "grey.50",
232
231
  "&:hover": {
233
- backgroundColor: colors.backgroundsBgField,
232
+ backgroundColor: "grey.50",
234
233
  opacity: 0.8
235
234
  }
236
235
  },
@@ -1,7 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Box, Typography } from "@mui/material";
3
3
  import VerifiedIcon from "@mui/icons-material/Verified";
4
- import { temp as colors } from "@arcblock/ux/lib/Colors";
5
4
  export default function UserInfoItem({ data, verified, ...rest }) {
6
5
  return /* @__PURE__ */ jsxs(
7
6
  Box,
@@ -20,7 +19,7 @@ export default function UserInfoItem({ data, verified, ...rest }) {
20
19
  sx: {
21
20
  display: "flex",
22
21
  alignItems: "center",
23
- color: colors.textBase,
22
+ color: "text.primary",
24
23
  fontSize: "14px",
25
24
  gap: 1,
26
25
  fontWeight: 500
@@ -36,7 +35,7 @@ export default function UserInfoItem({ data, verified, ...rest }) {
36
35
  Typography,
37
36
  {
38
37
  sx: {
39
- color: colors.textSubtitle,
38
+ color: "text.secondary",
40
39
  whiteSpace: "pre-wrap",
41
40
  fontSize: "14px"
42
41
  },
@@ -33,7 +33,7 @@ export declare const defaultButtonStyle: {
33
33
  backgroundColor: string;
34
34
  };
35
35
  py: number;
36
- borderRadius: string;
36
+ borderRadius: number;
37
37
  };
38
38
  export declare const primaryButtonStyle: {
39
39
  color: string;
@@ -44,5 +44,5 @@ export declare const primaryButtonStyle: {
44
44
  backgroundColor: string;
45
45
  };
46
46
  py: number;
47
- borderRadius: string;
47
+ borderRadius: number;
48
48
  };
@@ -1,6 +1,5 @@
1
1
  import moment from "moment-timezone";
2
2
  import dayjs from "dayjs";
3
- import { temp as colors } from "@arcblock/ux/lib/Colors";
4
3
  import { DurationEnum } from "../../../@types/index.js";
5
4
  const HOUR = 3600;
6
5
  const MINUTES_30 = 1800;
@@ -97,24 +96,24 @@ export const getTimeRemaining = (date) => {
97
96
  return 0;
98
97
  };
99
98
  export const defaultButtonStyle = {
100
- color: colors.foregroundsFgBase,
101
- borderColor: colors.strokeBorderBase,
102
- backgroundColor: colors.buttonsButtonNeutral,
99
+ color: "text.primary",
100
+ borderColor: "grey.100",
101
+ backgroundColor: "background.default",
103
102
  "&:hover": {
104
- borderColor: colors.strokeBorderBase,
105
- backgroundColor: colors.buttonsButtonNeutralHover
103
+ borderColor: "grey.100",
104
+ backgroundColor: "action.hover"
106
105
  },
107
106
  py: 0.5,
108
- borderRadius: "8px"
107
+ borderRadius: 1
109
108
  };
110
109
  export const primaryButtonStyle = {
111
- color: colors.buttonsButtonNeutral,
112
- borderColor: colors.foregroundsFgInteractive,
113
- backgroundColor: colors.foregroundsFgInteractive,
110
+ color: "primary.contrastText",
111
+ borderColor: "primary.main",
112
+ backgroundColor: "primary.main",
114
113
  "&:hover": {
115
- borderColor: colors.foregroundsFgInteractive,
116
- backgroundColor: colors.foregroundsFgInteractive
114
+ borderColor: "primary.main",
115
+ backgroundColor: "primary.main"
117
116
  },
118
117
  py: 0.5,
119
- borderRadius: "8px"
118
+ borderRadius: 1
120
119
  };
@@ -12,7 +12,6 @@ import {
12
12
  import { useCreation, useMemoizedFn, useReactive } from "ahooks";
13
13
  import noop from "lodash/noop";
14
14
  import isUrl from "is-url";
15
- import { temp as colors } from "@arcblock/ux/lib/Colors";
16
15
  import { Icon } from "@iconify/react";
17
16
  import CloseRoundedIcon from "@iconify-icons/material-symbols/close-rounded";
18
17
  import CheckIcon from "@iconify-icons/material-symbols/check";
@@ -120,9 +119,9 @@ export default function WebhookItem({
120
119
  Select,
121
120
  {
122
121
  sx: {
123
- borderRadius: 2,
122
+ borderRadius: 1,
124
123
  "&.Mui-disabled": {
125
- backgroundColor: colors.backgroundsBgField
124
+ backgroundColor: "grey.50"
126
125
  }
127
126
  },
128
127
  disabled: !currentState.edit || currentState.loading,
@@ -153,9 +152,9 @@ export default function WebhookItem({
153
152
  sx: {
154
153
  flex: 1,
155
154
  ".MuiInputBase-root": {
156
- borderRadius: 2,
155
+ borderRadius: 1,
157
156
  "&.Mui-disabled": {
158
- backgroundColor: colors.backgroundsBgField
157
+ backgroundColor: "grey.50"
159
158
  }
160
159
  }
161
160
  },
@@ -184,8 +183,9 @@ export default function WebhookItem({
184
183
  currentState.edit = false;
185
184
  }),
186
185
  sx: {
187
- borderRadius: 2,
188
- border: `1px solid ${colors.strokeBorderBase}`
186
+ borderRadius: 1,
187
+ border: "1px solid",
188
+ borderColor: "grey.200"
189
189
  },
190
190
  children: /* @__PURE__ */ jsx(Icon, { icon: CheckIcon })
191
191
  }
@@ -196,8 +196,9 @@ export default function WebhookItem({
196
196
  color: "error",
197
197
  onClick: handleClose,
198
198
  sx: {
199
- borderRadius: 2,
200
- border: `1px solid ${colors.strokeBorderBase}`
199
+ borderRadius: 1,
200
+ border: "1px solid",
201
+ borderColor: "grey.200"
201
202
  },
202
203
  children: /* @__PURE__ */ jsx(Icon, { icon: CloseRoundedIcon })
203
204
  }
@@ -210,8 +211,9 @@ export default function WebhookItem({
210
211
  currentState.edit = true;
211
212
  },
212
213
  sx: {
213
- borderRadius: 2,
214
- border: `1px solid ${colors.strokeBorderBase}`
214
+ borderRadius: 1,
215
+ border: "1px solid",
216
+ borderColor: "grey.200"
215
217
  },
216
218
  children: /* @__PURE__ */ jsx(Icon, { icon: EditSquareOutlineRoundedIcon })
217
219
  }
@@ -227,8 +229,9 @@ export default function WebhookItem({
227
229
  });
228
230
  },
229
231
  sx: {
230
- borderRadius: 2,
231
- border: `1px solid ${colors.strokeBorderBase}`
232
+ borderRadius: 1,
233
+ border: "1px solid",
234
+ borderColor: "grey.200"
232
235
  },
233
236
  children: /* @__PURE__ */ jsx(Icon, { icon: DeleteOutlineRoundedIcon })
234
237
  }
@@ -2,7 +2,6 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Box, Chip, Tooltip, Typography } from "@mui/material";
3
3
  import Avatar from "@arcblock/ux/lib/Avatar";
4
4
  import { useCreation } from "ahooks";
5
- import { temp as colors } from "@arcblock/ux/lib/Colors";
6
5
  export default function UserSessionInfo({ user, sessionUser }) {
7
6
  const currentRole = useCreation(() => {
8
7
  return (user?.passports || [])?.find((item) => item.name === sessionUser.role);
@@ -59,8 +58,8 @@ export default function UserSessionInfo({ user, sessionUser }) {
59
58
  flexShrink: 0,
60
59
  fontWeight: "bold",
61
60
  fontSize: "12px",
62
- color: colors.textBase,
63
- borderColor: colors.strokeBorderStrong,
61
+ color: "text.primary",
62
+ borderColor: "grey.300",
64
63
  backgroundColor: "transparent",
65
64
  textTransform: "capitalize",
66
65
  pr: 0.5,
@@ -7,7 +7,6 @@ import RelativeTime from "@arcblock/ux/lib/RelativeTime";
7
7
  import UAParser from "ua-parser-js";
8
8
  import { getVisitorId } from "@arcblock/ux/lib/Util";
9
9
  import { useConfirm } from "@arcblock/ux/lib/Dialog";
10
- import { temp as colors } from "@arcblock/ux/lib/Colors";
11
10
  import PQueue from "p-queue";
12
11
  import {
13
12
  Box,
@@ -312,20 +311,23 @@ export default function UserSessions({
312
311
  maxWidth: isMobile ? "unset" : isLg ? "calc(100vw - 300px)" : "100%",
313
312
  ...isMobile && {
314
313
  ".pc-user-sessions-table > div:nth-child(2)": {
315
- border: `1px solid ${colors.dividerColor}`,
316
- borderRadius: "8px"
314
+ border: "1px solid",
315
+ borderColor: "divider",
316
+ borderRadius: 1
317
317
  }
318
318
  },
319
319
  ".MuiTableCell-head": {
320
320
  whiteSpace: "nowrap",
321
- fontWeight: "bold"
321
+ fontWeight: "bold",
322
+ backgroundColor: "background.default"
322
323
  },
323
324
  ".MuiTableRow-root": {
324
325
  border: "unset",
326
+ backgroundColor: "background.default",
325
327
  "&:nth-child(even)": {
326
- backgroundColor: "#F9FAFB",
328
+ backgroundColor: "grey.50",
327
329
  "&:hover": {
328
- backgroundColor: "#F9FAFB !important"
330
+ backgroundColor: (theme) => `${theme.palette.grey[50]} !important`
329
331
  }
330
332
  }
331
333
  },
@@ -337,6 +339,7 @@ export default function UserSessions({
337
339
  ".MuiTableCell-root": {
338
340
  paddingRight: "8px",
339
341
  paddingLeft: "8px",
342
+ color: "text.secondary",
340
343
  ...isMobile && {
341
344
  padding: "8px !important",
342
345
  "&:first-child": {
@@ -35,7 +35,7 @@ export default function HeaderAddons({ formattedBlocklet, addons, showDomainWarn
35
35
  if (enableLocale && locale && languages.length > 1) {
36
36
  addonsArray.push(/* @__PURE__ */ jsx(LocaleSelector, { showText: false }, "locale-selector"));
37
37
  }
38
- if (["1", "true"].includes(window.blocklet?.USE_DARK_THEME)) {
38
+ if (window.blocklet?.theme?.prefer === "system") {
39
39
  addonsArray.push(/* @__PURE__ */ jsx(ThemeModeToggle, {}, "theme-mode-toggle"));
40
40
  }
41
41
  if (enableConnect && sessionCtx) {
@@ -0,0 +1,8 @@
1
+ import { type Breakpoint } from '@mui/material';
2
+ import { type ThemeOptions } from '@blocklet/theme';
3
+ export default function useBlockletLogo({ key, meta, theme: themeOverrides, square, }?: {
4
+ key?: number | Breakpoint;
5
+ meta?: any;
6
+ theme?: ThemeOptions;
7
+ square?: boolean;
8
+ }): any;
@@ -0,0 +1,23 @@
1
+ import { useTheme } from "@arcblock/ux/lib/Theme";
2
+ import { useCreation } from "ahooks";
3
+ import useMobile from "./use-mobile.js";
4
+ export default function useBlockletLogo({
5
+ key = "sm",
6
+ meta = {},
7
+ theme: themeOverrides = {},
8
+ square
9
+ } = {}) {
10
+ const isMobileDevice = useMobile({ key });
11
+ const theme = useTheme();
12
+ const mode = useCreation(() => {
13
+ return themeOverrides?.palette?.mode || theme.palette.mode;
14
+ }, [theme, themeOverrides]);
15
+ const finalAppLogo = useCreation(() => {
16
+ const { appLogo, appLogoDark, appLogoRect, appLogoRectDark } = Object.assign(window.blocklet ?? {}, meta);
17
+ const isDark = mode === "dark";
18
+ const squareLogo = (isDark ? appLogoDark : appLogo) || appLogo;
19
+ const rectLogo = (isDark ? appLogoRectDark || appLogoDark : appLogoRect) || appLogoRect;
20
+ return isMobileDevice || square ? squareLogo : rectLogo || squareLogo || "";
21
+ }, [mode, meta, isMobileDevice, square]);
22
+ return finalAppLogo;
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.13.12",
3
+ "version": "2.13.13",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -34,8 +34,8 @@
34
34
  "dependencies": {
35
35
  "@abtnode/constant": "^1.16.42",
36
36
  "@abtnode/util": "^1.16.42",
37
- "@arcblock/bridge": "^2.13.12",
38
- "@arcblock/react-hooks": "^2.13.12",
37
+ "@arcblock/bridge": "^2.13.13",
38
+ "@arcblock/react-hooks": "^2.13.13",
39
39
  "@arcblock/ws": "^1.20.1",
40
40
  "@blocklet/constant": "^1.16.42",
41
41
  "@blocklet/did-space-react": "^1.0.48",
@@ -94,5 +94,5 @@
94
94
  "jest": "^29.7.0",
95
95
  "unbuild": "^2.0.0"
96
96
  },
97
- "gitHead": "898e576675cefb8c4738d87f4198271943efec76"
97
+ "gitHead": "b098f3a884e8b34a1926479507b674d40ea58298"
98
98
  }