@wavelengthusaf/components 1.0.4 → 1.0.5
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/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +45 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -27,7 +27,13 @@ interface OutlinedButtonProps {
|
|
|
27
27
|
disabled?: boolean;
|
|
28
28
|
children?: ReactNode;
|
|
29
29
|
}
|
|
30
|
-
declare function
|
|
30
|
+
declare function WavelengthButton({ id, variant, margin, padding, autoFocus, disabled, onClick, children }: OutlinedButtonProps): React__default.JSX.Element;
|
|
31
|
+
|
|
32
|
+
interface MyComponentProps {
|
|
33
|
+
width?: number;
|
|
34
|
+
height?: number;
|
|
35
|
+
}
|
|
36
|
+
declare function MyComponent({ width, height }: MyComponentProps): React__default.JSX.Element;
|
|
31
37
|
|
|
32
38
|
type ThemeProperties = {
|
|
33
39
|
name?: string;
|
|
@@ -35,4 +41,4 @@ type ThemeProperties = {
|
|
|
35
41
|
declare const WavelengthAppTheme: React.Context<ThemeProperties>;
|
|
36
42
|
declare const useThemeContext: () => ThemeProperties;
|
|
37
43
|
|
|
38
|
-
export { type ThemeProperties,
|
|
44
|
+
export { MyComponent, type ThemeProperties, WavelengthAppTheme, WavelengthButton, add, concat, useThemeContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -27,7 +27,13 @@ interface OutlinedButtonProps {
|
|
|
27
27
|
disabled?: boolean;
|
|
28
28
|
children?: ReactNode;
|
|
29
29
|
}
|
|
30
|
-
declare function
|
|
30
|
+
declare function WavelengthButton({ id, variant, margin, padding, autoFocus, disabled, onClick, children }: OutlinedButtonProps): React__default.JSX.Element;
|
|
31
|
+
|
|
32
|
+
interface MyComponentProps {
|
|
33
|
+
width?: number;
|
|
34
|
+
height?: number;
|
|
35
|
+
}
|
|
36
|
+
declare function MyComponent({ width, height }: MyComponentProps): React__default.JSX.Element;
|
|
31
37
|
|
|
32
38
|
type ThemeProperties = {
|
|
33
39
|
name?: string;
|
|
@@ -35,4 +41,4 @@ type ThemeProperties = {
|
|
|
35
41
|
declare const WavelengthAppTheme: React.Context<ThemeProperties>;
|
|
36
42
|
declare const useThemeContext: () => ThemeProperties;
|
|
37
43
|
|
|
38
|
-
export { type ThemeProperties,
|
|
44
|
+
export { MyComponent, type ThemeProperties, WavelengthAppTheme, WavelengthButton, add, concat, useThemeContext };
|
package/dist/index.js
CHANGED
|
@@ -1286,8 +1286,9 @@ var require_react_is2 = __commonJS({
|
|
|
1286
1286
|
// src/index.ts
|
|
1287
1287
|
var src_exports = {};
|
|
1288
1288
|
__export(src_exports, {
|
|
1289
|
-
|
|
1289
|
+
MyComponent: () => MyComponent,
|
|
1290
1290
|
WavelengthAppTheme: () => WavelengthAppTheme,
|
|
1291
|
+
WavelengthButton: () => WavelengthButton,
|
|
1291
1292
|
add: () => add,
|
|
1292
1293
|
concat: () => concat,
|
|
1293
1294
|
useThemeContext: () => useThemeContext
|
|
@@ -1304,7 +1305,7 @@ function concat(a, b) {
|
|
|
1304
1305
|
return a + b;
|
|
1305
1306
|
}
|
|
1306
1307
|
|
|
1307
|
-
// src/components/buttons/WavelengthButton/
|
|
1308
|
+
// src/components/buttons/WavelengthButton/WavelengthButton.tsx
|
|
1308
1309
|
var import_material = require("@mui/material");
|
|
1309
1310
|
|
|
1310
1311
|
// node_modules/@mui/utils/esm/formatMuiErrorMessage/formatMuiErrorMessage.js
|
|
@@ -1361,13 +1362,12 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
1361
1362
|
if (source == null)
|
|
1362
1363
|
return {};
|
|
1363
1364
|
var target = {};
|
|
1364
|
-
var
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
target[key] = source[key];
|
|
1365
|
+
for (var key in source) {
|
|
1366
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1367
|
+
if (excluded.indexOf(key) >= 0)
|
|
1368
|
+
continue;
|
|
1369
|
+
target[key] = source[key];
|
|
1370
|
+
}
|
|
1371
1371
|
}
|
|
1372
1372
|
return target;
|
|
1373
1373
|
}
|
|
@@ -2846,7 +2846,7 @@ function createStyled(input = {}) {
|
|
|
2846
2846
|
var styled2 = createStyled();
|
|
2847
2847
|
var styled_default = styled2;
|
|
2848
2848
|
|
|
2849
|
-
// src/components/buttons/WavelengthButton/
|
|
2849
|
+
// src/components/buttons/WavelengthButton/WavelengthButton.tsx
|
|
2850
2850
|
var import_react3 = __toESM(require("react"));
|
|
2851
2851
|
|
|
2852
2852
|
// src/themes/WavelengthAppTheme.ts
|
|
@@ -2855,26 +2855,27 @@ var WavelengthAppTheme = (0, import_react2.createContext)({});
|
|
|
2855
2855
|
var useThemeContext = () => (0, import_react2.useContext)(WavelengthAppTheme);
|
|
2856
2856
|
|
|
2857
2857
|
// src/themes/Palette.ts
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2858
|
+
var defaultPalette = {
|
|
2859
|
+
primary: `#336699`,
|
|
2860
|
+
secondary: `#66FFCC`
|
|
2861
|
+
};
|
|
2862
|
+
var arrowPalette = {
|
|
2863
|
+
primary: "#46D8ECFF",
|
|
2864
|
+
secondary: "#46D8EC99"
|
|
2865
|
+
};
|
|
2866
|
+
function getPalette() {
|
|
2867
|
+
const { name } = useThemeContext();
|
|
2868
|
+
if (name != void 0) {
|
|
2869
|
+
if (name.toLowerCase() === "arrow") {
|
|
2870
|
+
return arrowPalette;
|
|
2867
2871
|
}
|
|
2868
|
-
} else {
|
|
2869
|
-
console.log("Using Default Theme");
|
|
2870
2872
|
}
|
|
2871
|
-
return
|
|
2873
|
+
return defaultPalette;
|
|
2872
2874
|
}
|
|
2873
2875
|
|
|
2874
|
-
// src/components/buttons/WavelengthButton/
|
|
2875
|
-
function
|
|
2876
|
-
const
|
|
2877
|
-
const palette2 = getPalette(name);
|
|
2876
|
+
// src/components/buttons/WavelengthButton/WavelengthButton.tsx
|
|
2877
|
+
function WavelengthButton({ id, variant, margin: margin2, padding: padding2, autoFocus, disabled, onClick, children }) {
|
|
2878
|
+
const palette2 = getPalette();
|
|
2878
2879
|
const WLContainedButton = styled_default(import_material.Button)(({}) => ({
|
|
2879
2880
|
height: "45px",
|
|
2880
2881
|
color: "#FFFFFF",
|
|
@@ -2907,10 +2908,27 @@ function WLButton({ id, variant, margin: margin2, padding: padding2, autoFocus,
|
|
|
2907
2908
|
}
|
|
2908
2909
|
return /* @__PURE__ */ import_react3.default.createElement(WLTextButton, { variant: "outlined", id, autoFocus, disabled, onClick, sx: { margin: { margin: margin2 }, padding: { padding: padding2 } } }, children);
|
|
2909
2910
|
}
|
|
2911
|
+
|
|
2912
|
+
// src/components/sample/MyComponent.tsx
|
|
2913
|
+
var import_react4 = __toESM(require("react"));
|
|
2914
|
+
function MyComponent({ width: width2 = 100, height: height2 = 100 }) {
|
|
2915
|
+
const palette2 = getPalette();
|
|
2916
|
+
const divStyle = {
|
|
2917
|
+
display: "inline-block",
|
|
2918
|
+
border: "1px solid black",
|
|
2919
|
+
padding: "5px",
|
|
2920
|
+
borderRadius: "5px"
|
|
2921
|
+
};
|
|
2922
|
+
const titleStyle = {
|
|
2923
|
+
color: palette2.primary
|
|
2924
|
+
};
|
|
2925
|
+
return /* @__PURE__ */ import_react4.default.createElement("div", { style: divStyle }, /* @__PURE__ */ import_react4.default.createElement("center", null, /* @__PURE__ */ import_react4.default.createElement("p", { style: titleStyle }, "My Component")), /* @__PURE__ */ import_react4.default.createElement("br", null), /* @__PURE__ */ import_react4.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width2, height: height2, viewBox: "0 0 96 105" }, /* @__PURE__ */ import_react4.default.createElement("g", { fill: palette2.secondary, stroke: palette2.secondary, strokeLinejoin: "round", strokeLinecap: "round" }, /* @__PURE__ */ import_react4.default.createElement("path", { d: "M14,40v24M81,40v24M38,68v24M57,68v24M28,42v31h39v-31z", strokeWidth: "12" }), /* @__PURE__ */ import_react4.default.createElement("path", { d: "M32,5l5,10M64,5l-6,10 ", strokeWidth: "2" })), /* @__PURE__ */ import_react4.default.createElement("path", { d: "M22,35h51v10h-51zM22,33c0-31,51-31,51,0", fill: palette2.secondary }), /* @__PURE__ */ import_react4.default.createElement("g", { fill: "#FFF" }, /* @__PURE__ */ import_react4.default.createElement("circle", { cx: "36", cy: "22", r: "2" }), /* @__PURE__ */ import_react4.default.createElement("circle", { cx: "59", cy: "22", r: "2" }))));
|
|
2926
|
+
}
|
|
2910
2927
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2911
2928
|
0 && (module.exports = {
|
|
2912
|
-
|
|
2929
|
+
MyComponent,
|
|
2913
2930
|
WavelengthAppTheme,
|
|
2931
|
+
WavelengthButton,
|
|
2914
2932
|
add,
|
|
2915
2933
|
concat,
|
|
2916
2934
|
useThemeContext
|