@domicile-desktop/manganese-bar-module-notifications 1.1.1 → 2.0.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/package.json +5 -6
- package/src/NotificationBell.tsx +5 -10
- package/src/bar-item.tsx +2 -2
- package/styled-system/patterns/aspect-ratio.mjs +2 -2
- package/styled-system/patterns/bleed.mjs +1 -2
- package/styled-system/patterns/float.mjs +5 -11
- package/styled-system/patterns/grid-item.mjs +1 -2
- package/styled-system/patterns/grid.mjs +1 -2
- package/styled-system/patterns/link-overlay.mjs +1 -1
- package/styled-system/patterns/spacer.mjs +3 -3
- package/styled-system/patterns/visually-hidden.mjs +1 -1
- package/styled-system/types/prop-type.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@domicile-desktop/component-library": "2.0
|
|
4
|
-
"@domicile-desktop/manganese-bar": "1.1.
|
|
5
|
-
"@domicile-desktop/manganese-notifications": "
|
|
3
|
+
"@domicile-desktop/component-library": "2.1.0",
|
|
4
|
+
"@domicile-desktop/manganese-bar": "1.1.2",
|
|
5
|
+
"@domicile-desktop/manganese-notifications": "2.0.0",
|
|
6
6
|
"@pandacss/dev": "^1.12.1",
|
|
7
7
|
"react": "^19.2.8"
|
|
8
8
|
},
|
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
"typescript": "^7.0.2"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
|
-
"bun": ">=1.4.2"
|
|
24
|
-
"node": ">=24"
|
|
23
|
+
"bun": ">=1.4.2"
|
|
25
24
|
},
|
|
26
25
|
"exports": {
|
|
27
26
|
".": "./src/bar-item.tsx"
|
|
@@ -49,5 +48,5 @@
|
|
|
49
48
|
"test:unit": "bun test"
|
|
50
49
|
},
|
|
51
50
|
"type": "module",
|
|
52
|
-
"version": "
|
|
51
|
+
"version": "2.0.0"
|
|
53
52
|
}
|
package/src/NotificationBell.tsx
CHANGED
|
@@ -8,10 +8,10 @@ import { bellId } from "@domicile-desktop/manganese-notifications/notifications-
|
|
|
8
8
|
import { css } from "../styled-system/css";
|
|
9
9
|
|
|
10
10
|
type Props = {
|
|
11
|
-
/** Toasts are held back; the bell is struck through. */
|
|
12
|
-
doNotDisturb: boolean;
|
|
13
11
|
/** Opens the drawer under this bell. */
|
|
14
12
|
handle: NotificationsHandle;
|
|
13
|
+
/** Toasts are held back; the bell is struck through. */
|
|
14
|
+
paused: boolean;
|
|
15
15
|
/** The bar's monitor. */
|
|
16
16
|
screen: string;
|
|
17
17
|
/** How many arrived since the drawer was last opened. */
|
|
@@ -25,16 +25,11 @@ type Props = {
|
|
|
25
25
|
* It swings when the count goes up, to point back to notifications whose
|
|
26
26
|
* toasts have gone, and not when they are read.
|
|
27
27
|
*/
|
|
28
|
-
export const NotificationBell = ({
|
|
29
|
-
doNotDisturb,
|
|
30
|
-
handle,
|
|
31
|
-
screen,
|
|
32
|
-
unread,
|
|
33
|
-
}: Props) => {
|
|
28
|
+
export const NotificationBell = ({ handle, paused, screen, unread }: Props) => {
|
|
34
29
|
const label = [
|
|
35
30
|
"Notifications",
|
|
36
31
|
...(unread === 0 ? [] : [`${unread} unread`]),
|
|
37
|
-
...(
|
|
32
|
+
...(paused ? ["paused"] : []),
|
|
38
33
|
].join(", ");
|
|
39
34
|
return (
|
|
40
35
|
<Tooltip
|
|
@@ -52,7 +47,7 @@ export const NotificationBell = ({
|
|
|
52
47
|
>
|
|
53
48
|
<AnimatedBellIcon
|
|
54
49
|
cue={unread === 0 ? undefined : unread}
|
|
55
|
-
off={
|
|
50
|
+
off={paused}
|
|
56
51
|
size={15}
|
|
57
52
|
/>
|
|
58
53
|
<CountBadge count={unread} />
|
package/src/bar-item.tsx
CHANGED
|
@@ -5,11 +5,11 @@ import { NotificationBell } from "./NotificationBell";
|
|
|
5
5
|
/** The bell, which opens the notification drawer under itself. */
|
|
6
6
|
export const Notifications = () => {
|
|
7
7
|
const { screen } = useBar();
|
|
8
|
-
const {
|
|
8
|
+
const { handle, paused, unread } = useNotificationsDrawer();
|
|
9
9
|
return (
|
|
10
10
|
<NotificationBell
|
|
11
|
-
doNotDisturb={doNotDisturb}
|
|
12
11
|
handle={handle}
|
|
12
|
+
paused={paused}
|
|
13
13
|
screen={screen}
|
|
14
14
|
unread={unread}
|
|
15
15
|
/>
|
|
@@ -3,11 +3,11 @@ import { css } from '../css/index.mjs';
|
|
|
3
3
|
|
|
4
4
|
const aspectRatioConfig = {
|
|
5
5
|
transform(props, { map }) {
|
|
6
|
-
const { ratio =
|
|
6
|
+
const { ratio = 1.3333333333333333, ...rest } = props;
|
|
7
7
|
return {
|
|
8
8
|
position: "relative",
|
|
9
9
|
_before: {
|
|
10
|
-
content:
|
|
10
|
+
content: '""',
|
|
11
11
|
display: "block",
|
|
12
12
|
height: "0",
|
|
13
13
|
paddingBottom: map(ratio, (r) => `${1 / r * 100}%`)
|
|
@@ -3,8 +3,7 @@ import { css } from '../css/index.mjs';
|
|
|
3
3
|
|
|
4
4
|
const bleedConfig = {
|
|
5
5
|
transform(props, { map, isCssUnit, isCssVar }) {
|
|
6
|
-
const { inline, block, ...rest } = props
|
|
7
|
-
const valueFn = (v) => isCssUnit(v) || isCssVar(v) ? v : `token(spacing.${v}, ${v})`;
|
|
6
|
+
const { inline, block, ...rest } = props, valueFn = (v) => isCssUnit(v) || isCssVar(v) ? v : `token(spacing.${v}, ${v})`;
|
|
8
7
|
return {
|
|
9
8
|
"--bleed-x": map(inline, valueFn),
|
|
10
9
|
"--bleed-y": map(block, valueFn),
|
|
@@ -11,28 +11,22 @@ transform(props, { map }) {
|
|
|
11
11
|
position: "absolute",
|
|
12
12
|
insetBlockStart: map(placement, (v) => {
|
|
13
13
|
const [side] = v.split("-");
|
|
14
|
-
|
|
15
|
-
return map2[side];
|
|
14
|
+
return { top: offsetY, middle: "50%", bottom: "auto" }[side];
|
|
16
15
|
}),
|
|
17
16
|
insetBlockEnd: map(placement, (v) => {
|
|
18
17
|
const [side] = v.split("-");
|
|
19
|
-
|
|
20
|
-
return map2[side];
|
|
18
|
+
return { top: "auto", middle: "50%", bottom: offsetY }[side];
|
|
21
19
|
}),
|
|
22
20
|
insetInlineStart: map(placement, (v) => {
|
|
23
21
|
const [, align] = v.split("-");
|
|
24
|
-
|
|
25
|
-
return map2[align];
|
|
22
|
+
return { start: offsetX, center: "50%", end: "auto" }[align];
|
|
26
23
|
}),
|
|
27
24
|
insetInlineEnd: map(placement, (v) => {
|
|
28
25
|
const [, align] = v.split("-");
|
|
29
|
-
|
|
30
|
-
return map2[align];
|
|
26
|
+
return { start: "auto", center: "50%", end: offsetX }[align];
|
|
31
27
|
}),
|
|
32
28
|
translate: map(placement, (v) => {
|
|
33
|
-
const [side, align] = v.split("-");
|
|
34
|
-
const mapX = { start: "-50%", center: "-50%", end: "50%" };
|
|
35
|
-
const mapY = { top: "-50%", middle: "-50%", bottom: "50%" };
|
|
29
|
+
const [side, align] = v.split("-"), mapX = { start: "-50%", center: "-50%", end: "50%" }, mapY = { top: "-50%", middle: "-50%", bottom: "50%" };
|
|
36
30
|
return `${mapX[align]} ${mapY[side]}`;
|
|
37
31
|
}),
|
|
38
32
|
...rest
|
|
@@ -3,8 +3,7 @@ import { css } from '../css/index.mjs';
|
|
|
3
3
|
|
|
4
4
|
const gridItemConfig = {
|
|
5
5
|
transform(props, { map }) {
|
|
6
|
-
const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props
|
|
7
|
-
const spanFn = (v) => v === "auto" ? v : `span ${v}`;
|
|
6
|
+
const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props, spanFn = (v) => v === "auto" ? v : `span ${v}`;
|
|
8
7
|
return {
|
|
9
8
|
gridColumn: colSpan != null ? map(colSpan, spanFn) : void 0,
|
|
10
9
|
gridRow: rowSpan != null ? map(rowSpan, spanFn) : void 0,
|
|
@@ -3,8 +3,7 @@ import { css } from '../css/index.mjs';
|
|
|
3
3
|
|
|
4
4
|
const gridConfig = {
|
|
5
5
|
transform(props, { map, isCssUnit }) {
|
|
6
|
-
const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props
|
|
7
|
-
const getValue = (v) => isCssUnit(v) ? v : `token(sizes.${v}, ${v})`;
|
|
6
|
+
const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props, getValue = (v) => isCssUnit(v) ? v : `token(sizes.${v}, ${v})`;
|
|
8
7
|
return {
|
|
9
8
|
display: "grid",
|
|
10
9
|
gridTemplateColumns: columns != null ? map(columns, (v) => `repeat(${v}, minmax(0, 1fr))`) : minChildWidth != null ? map(minChildWidth, (v) => `repeat(auto-fit, minmax(${getValue(v)}, 1fr))`) : void 0,
|
|
@@ -8,9 +8,9 @@ transform(props, { map, isCssUnit, isCssVar }) {
|
|
|
8
8
|
alignSelf: "stretch",
|
|
9
9
|
justifySelf: "stretch",
|
|
10
10
|
flex: map(size, (v) => {
|
|
11
|
-
if (v == null)
|
|
12
|
-
|
|
13
|
-
return `0 0 ${
|
|
11
|
+
if (v == null)
|
|
12
|
+
return "1";
|
|
13
|
+
return `0 0 ${isCssUnit(v) || isCssVar(v) ? v : `token(spacing.${v}, ${v})`}`;
|
|
14
14
|
}),
|
|
15
15
|
...rest
|
|
16
16
|
};
|
|
@@ -169,7 +169,7 @@ export interface UtilityValues {
|
|
|
169
169
|
transitionProperty: "common" | "colors" | "size" | "position" | "background";
|
|
170
170
|
transition: "all" | "common" | "size" | "position" | "background" | "colors" | "opacity" | "shadow" | "transform";
|
|
171
171
|
animation: Tokens["animations"];
|
|
172
|
-
animationName: "bounce" | "iconArcRipple" | "iconArcSearch" | "iconArmReach" | "iconArmSwing" | "iconArrowWind" | "iconBellClapper" | "iconBellNudge" | "iconBellSwing" | "iconBoltStrike" | "iconBubbleTip" | "iconCapsuleBob" | "iconCheckDraw" | "iconCoreIn" | "iconCoreOut" | "iconDotBlink" | "iconDownloadDrop" | "iconGearTurn" | "iconKeyholePulse" | "iconKeyPress" | "iconLineWrite" | "iconMoonIn" | "iconMoonOut" | "iconMoonRock" | "iconPartSpread" | "iconPupilGlance" | "iconRayIn" | "iconRayOut" | "iconRayPulse" | "iconShackleLift" | "iconShackleShut" | "iconTrayGive" | "iconWavePull" | "iconWavePush" | "levelToastEnter" | "levelToastHold" | "levelToastHoldAgain" | "noticeShown" | "ping" | "pulse" | "spin" | "themeSwipeFromBottom" | "themeSwipeFromTop" | "toastCountdown";
|
|
172
|
+
animationName: "bounce" | "iconArcRipple" | "iconArcSearch" | "iconArmReach" | "iconArmSwing" | "iconArrowWind" | "iconBellClapper" | "iconBellNudge" | "iconBellSwing" | "iconBoltStrike" | "iconBubbleTip" | "iconCapsuleBob" | "iconCheckDraw" | "iconCoreIn" | "iconCoreOut" | "iconDotBlink" | "iconDownloadDrop" | "iconGearTurn" | "iconKeyholePulse" | "iconKeyPress" | "iconLineWrite" | "iconMoonIn" | "iconMoonOut" | "iconMoonRock" | "iconPartSpread" | "iconPupilGlance" | "iconRayIn" | "iconRayOut" | "iconRayPulse" | "iconShackleLift" | "iconShackleShut" | "iconSparkleTwinkle" | "iconSparkleWink" | "iconTrayGive" | "iconWavePull" | "iconWavePush" | "levelToastEnter" | "levelToastHold" | "levelToastHoldAgain" | "noticeShown" | "ping" | "pulse" | "spin" | "themeSwipeFromBottom" | "themeSwipeFromTop" | "toastCountdown";
|
|
173
173
|
animationTimingFunction: Tokens["easings"];
|
|
174
174
|
animationDuration: Tokens["durations"];
|
|
175
175
|
animationDelay: Tokens["durations"];
|