@domicile-desktop/manganese-bar-module-network 1.1.1 → 1.1.2

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 CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "@cprussin/option-result": "^2.0.1",
4
- "@domicile-desktop/component-library": "2.0.1",
5
- "@domicile-desktop/manganese-bar": "1.1.1",
6
- "@domicile-desktop/manganese-host": "2.0.1",
7
- "@domicile-desktop/react": "0.1.1",
8
- "@domicile-desktop/sdk": "2.1.0",
9
- "@domicile-desktop/system-network": "1.1.1",
4
+ "@domicile-desktop/component-library": "2.1.0",
5
+ "@domicile-desktop/manganese-bar": "1.1.2",
6
+ "@domicile-desktop/manganese-host": "2.0.2",
7
+ "@domicile-desktop/react": "0.1.2",
8
+ "@domicile-desktop/sdk": "2.2.0",
9
+ "@domicile-desktop/system-network": "1.1.2",
10
10
  "@pandacss/dev": "^1.12.1",
11
11
  "@phosphor-icons/react": "^2.1.10",
12
12
  "react": "^19.2.8"
@@ -25,8 +25,7 @@
25
25
  "typescript": "^7.0.2"
26
26
  },
27
27
  "engines": {
28
- "bun": ">=1.4.2",
29
- "node": ">=24"
28
+ "bun": ">=1.4.2"
30
29
  },
31
30
  "exports": {
32
31
  ".": "./src/bar-item.tsx",
@@ -57,5 +56,5 @@
57
56
  "test:unit": "bun test"
58
57
  },
59
58
  "type": "module",
60
- "version": "1.1.1"
59
+ "version": "1.1.2"
61
60
  }
package/src/WifiPanel.tsx CHANGED
@@ -7,6 +7,7 @@ import { IconButton } from "@domicile-desktop/component-library/IconButton";
7
7
  import { Input } from "@domicile-desktop/component-library/Input";
8
8
  import { List, ListRow } from "@domicile-desktop/component-library/ListRow";
9
9
  import { Loading } from "@domicile-desktop/component-library/Loading";
10
+ import { PanelFooter } from "@domicile-desktop/component-library/PanelFooter";
10
11
  import { PanelNote } from "@domicile-desktop/component-library/PanelNote";
11
12
  import { PanelSection } from "@domicile-desktop/component-library/PanelSection";
12
13
  import { Switch } from "@domicile-desktop/component-library/Switch";
@@ -175,7 +176,6 @@ const Controls = ({ actions, addresses, host, wifi }: ControlsProps) => {
175
176
  <Connection
176
177
  addresses={addresses}
177
178
  connection={wifi.connection}
178
- failed={requests.failed("disconnect")}
179
179
  onDisconnect={() => {
180
180
  requests.run("disconnect", () =>
181
181
  actions.disconnectWifi(host, wifi),
@@ -211,6 +211,9 @@ const Controls = ({ actions, addresses, host, wifi }: ControlsProps) => {
211
211
  wifi.connection !== undefined && (
212
212
  <PanelNote>No other networks nearby</PanelNote>
213
213
  )}
214
+ <Failure error={requests.failed("disconnect")}>
215
+ Couldn't disconnect
216
+ </Failure>
214
217
  <Failure error={requests.failed("scan")}>
215
218
  Couldn't look for networks
216
219
  </Failure>
@@ -264,14 +267,13 @@ type ConnectionProps = {
264
267
  addresses: Addresses;
265
268
  connection: WifiConnection;
266
269
  pending: boolean;
267
- failed: SystemError | undefined;
268
270
  onDisconnect: () => void;
269
271
  };
270
272
 
273
+ /** The connection, with Disconnect at the foot of its details. */
271
274
  const Connection = ({
272
275
  addresses,
273
276
  connection,
274
- failed,
275
277
  onDisconnect,
276
278
  pending,
277
279
  wifi,
@@ -284,12 +286,20 @@ const Connection = ({
284
286
  surface="filled"
285
287
  >
286
288
  <DetailList rows={detailsOf(wifi, connection, addresses)} />
287
- <span>
288
- <Button loading={pending} onClick={onDisconnect} rounded size="xs">
289
- Disconnect
290
- </Button>
291
- </span>
292
- <Failure error={failed}>Couldn't disconnect</Failure>
289
+ <PanelFooter
290
+ action={
291
+ <Button
292
+ beforeIcon={<WifiSlashIcon aria-hidden size={14} />}
293
+ loading={pending}
294
+ onClick={onDisconnect}
295
+ rounded
296
+ size="xs"
297
+ variant="ghost"
298
+ >
299
+ Disconnect
300
+ </Button>
301
+ }
302
+ />
293
303
  </ListRow>
294
304
  );
295
305
 
@@ -3,11 +3,11 @@ import { css } from '../css/index.mjs';
3
3
 
4
4
  const aspectRatioConfig = {
5
5
  transform(props, { map }) {
6
- const { ratio = 4 / 3, ...rest } = props;
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
- const map2 = { top: offsetY, middle: "50%", bottom: "auto" };
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
- const map2 = { top: "auto", middle: "50%", bottom: offsetY };
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
- const map2 = { start: offsetX, center: "50%", end: "auto" };
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
- const map2 = { start: "auto", center: "50%", end: offsetX };
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,
@@ -9,7 +9,7 @@ transform(props) {
9
9
  position: "absolute",
10
10
  inset: "0",
11
11
  zIndex: "0",
12
- ...props["_before"]
12
+ ...props._before
13
13
  },
14
14
  ...props
15
15
  };
@@ -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) return "1";
12
- const val = isCssUnit(v) || isCssVar(v) ? v : `token(spacing.${v}, ${v})`;
13
- return `0 0 ${val}`;
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
  };
@@ -4,7 +4,7 @@ import { css } from '../css/index.mjs';
4
4
  const visuallyHiddenConfig = {
5
5
  transform(props) {
6
6
  return {
7
- srOnly: true,
7
+ srOnly: !0,
8
8
  ...props
9
9
  };
10
10
  }}
@@ -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"];