@domicile-desktop/manganese-bar-module-network 0.0.0-alpha-72d3e73d548e → 0.0.0-alpha-e33f6286fa2a
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 +7 -7
- package/src/Network.tsx +2 -16
- package/styled-system/jsx/bar-button.d.ts +7 -0
- package/styled-system/jsx/bar-button.js +11 -0
- package/styled-system/jsx/index.d.ts +1 -0
- package/styled-system/jsx/index.js +1 -0
- package/styled-system/patterns/bar-button.d.ts +17 -0
- package/styled-system/patterns/bar-button.js +30 -0
- package/styled-system/patterns/index.d.ts +1 -0
- package/styled-system/patterns/index.js +1 -0
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": "0.0.0-alpha-
|
|
5
|
-
"@domicile-desktop/manganese-bar": "0.0.0-alpha-
|
|
6
|
-
"@domicile-desktop/manganese-host": "0.0.0-alpha-
|
|
7
|
-
"@domicile-desktop/react": "0.0.0-alpha-
|
|
8
|
-
"@domicile-desktop/sdk": "0.0.0-alpha-
|
|
9
|
-
"@domicile-desktop/system-network": "0.0.0-alpha-
|
|
4
|
+
"@domicile-desktop/component-library": "0.0.0-alpha-e33f6286fa2a",
|
|
5
|
+
"@domicile-desktop/manganese-bar": "0.0.0-alpha-e33f6286fa2a",
|
|
6
|
+
"@domicile-desktop/manganese-host": "0.0.0-alpha-e33f6286fa2a",
|
|
7
|
+
"@domicile-desktop/react": "0.0.0-alpha-e33f6286fa2a",
|
|
8
|
+
"@domicile-desktop/sdk": "0.0.0-alpha-e33f6286fa2a",
|
|
9
|
+
"@domicile-desktop/system-network": "0.0.0-alpha-e33f6286fa2a",
|
|
10
10
|
"@pandacss/dev": "^2.6.0",
|
|
11
11
|
"@phosphor-icons/react": "^2.1.10",
|
|
12
12
|
"react": "^19.3.1"
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"test:unit": "bun test"
|
|
57
57
|
},
|
|
58
58
|
"type": "module",
|
|
59
|
-
"version": "0.0.0-alpha-
|
|
59
|
+
"version": "0.0.0-alpha-e33f6286fa2a"
|
|
60
60
|
}
|
package/src/Network.tsx
CHANGED
|
@@ -17,6 +17,7 @@ import { LinkKind } from "@domicile-desktop/system-network/network";
|
|
|
17
17
|
import type { Wifi } from "@domicile-desktop/system-network/wifi";
|
|
18
18
|
import { useState } from "react";
|
|
19
19
|
import { cva } from "../styled-system/css";
|
|
20
|
+
import { barButton } from "../styled-system/patterns";
|
|
20
21
|
import { LinkIcon, shownOf } from "./link-shown";
|
|
21
22
|
import { NetworkPanel } from "./NetworkPanel";
|
|
22
23
|
import type { WifiActions } from "./wifi-actions";
|
|
@@ -138,23 +139,8 @@ const Item = ({
|
|
|
138
139
|
);
|
|
139
140
|
};
|
|
140
141
|
|
|
141
|
-
// Matches the volume item's button.
|
|
142
142
|
const triggerStyles = cva({
|
|
143
|
-
base:
|
|
144
|
-
_hoverOrOpen: { backgroundColor: "fillOverPhoto" },
|
|
145
|
-
alignItems: "center",
|
|
146
|
-
backgroundColor: "transparent",
|
|
147
|
-
blockSize: 7,
|
|
148
|
-
borderRadius: "lg",
|
|
149
|
-
borderStyle: "none",
|
|
150
|
-
cursor: "pointer",
|
|
151
|
-
display: "inline-flex",
|
|
152
|
-
flexShrink: 0,
|
|
153
|
-
inlineSize: 7,
|
|
154
|
-
justifyContent: "center",
|
|
155
|
-
padding: 0,
|
|
156
|
-
transition: "background-color {durations.fast} {easings.default}",
|
|
157
|
-
},
|
|
143
|
+
base: barButton.raw(),
|
|
158
144
|
variants: {
|
|
159
145
|
linked: {
|
|
160
146
|
// Dims the icon alone, so the hover background stays as strong.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import type { BarButtonProperties } from '../patterns/bar-button';
|
|
3
|
+
import type { HTMLStyledProps } from '../types/jsx';
|
|
4
|
+
import type { DistributiveOmit } from '../types/system';
|
|
5
|
+
|
|
6
|
+
export interface BarButtonProps extends BarButtonProperties, DistributiveOmit<HTMLStyledProps<'div'>, keyof BarButtonProperties> {}
|
|
7
|
+
export declare const BarButton: FunctionComponent<BarButtonProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createElement, forwardRef } from 'react';
|
|
2
|
+
import { barButton } from '../patterns/bar-button';
|
|
3
|
+
import { splitProps } from '../helpers';
|
|
4
|
+
import { styled } from './factory';
|
|
5
|
+
|
|
6
|
+
export const BarButton = /* @__PURE__ */ forwardRef(function BarButton(props, ref) {
|
|
7
|
+
const [patternProps, restProps] = splitProps(props, barButton.propKeys)
|
|
8
|
+
const styleProps = barButton.raw(patternProps)
|
|
9
|
+
const mergedProps = { ref, ...restProps, css: styleProps }
|
|
10
|
+
return createElement(styled["div"], mergedProps)
|
|
11
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SystemStyleObject } from '../types/system';
|
|
2
|
+
|
|
3
|
+
export interface BarButtonProperties {}
|
|
4
|
+
|
|
5
|
+
type BarButtonRestStyles = Omit<SystemStyleObject, keyof BarButtonProperties>
|
|
6
|
+
|
|
7
|
+
interface BarButtonStyles extends BarButtonProperties, BarButtonRestStyles {}
|
|
8
|
+
|
|
9
|
+
interface BarButtonPatternFn {
|
|
10
|
+
(styles?: BarButtonStyles): string
|
|
11
|
+
raw: (styles?: BarButtonStyles) => SystemStyleObject
|
|
12
|
+
propKeys: Array<keyof BarButtonProperties>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export declare function barButtonRaw(styles?: BarButtonStyles): SystemStyleObject;
|
|
16
|
+
|
|
17
|
+
export declare const barButton: BarButtonPatternFn;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getPatternStyles, patternFns } from './runtime';
|
|
2
|
+
import { memo } from '../helpers';
|
|
3
|
+
import { css } from '../css/index';
|
|
4
|
+
|
|
5
|
+
const barButtonConfig = { transform: (props) => ({
|
|
6
|
+
_hoverOrOpen: { backgroundColor: "fillOverPhoto" },
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
backgroundColor: "transparent",
|
|
9
|
+
blockSize: 7,
|
|
10
|
+
borderRadius: "lg",
|
|
11
|
+
borderStyle: "none",
|
|
12
|
+
color: "inherit",
|
|
13
|
+
cursor: "pointer",
|
|
14
|
+
display: "inline-flex",
|
|
15
|
+
flexShrink: 0,
|
|
16
|
+
inlineSize: 7,
|
|
17
|
+
justifyContent: "center",
|
|
18
|
+
padding: 0,
|
|
19
|
+
transition: "background-color {durations.fast} {easings.default}",
|
|
20
|
+
...props
|
|
21
|
+
}) }
|
|
22
|
+
|
|
23
|
+
export function barButtonRaw(styles) {
|
|
24
|
+
const s = getPatternStyles(barButtonConfig, styles || {})
|
|
25
|
+
return barButtonConfig.transform(s, patternFns)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const barButton = /* @__PURE__ */ Object.assign(/* @__PURE__ */ memo(function barButton(styles = {}) {
|
|
29
|
+
return css(barButtonRaw(styles))
|
|
30
|
+
}), { raw: barButtonRaw, propKeys: [] })
|