@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.mjs
CHANGED
|
@@ -1287,7 +1287,7 @@ function concat(a, b) {
|
|
|
1287
1287
|
return a + b;
|
|
1288
1288
|
}
|
|
1289
1289
|
|
|
1290
|
-
// src/components/buttons/WavelengthButton/
|
|
1290
|
+
// src/components/buttons/WavelengthButton/WavelengthButton.tsx
|
|
1291
1291
|
import { Button } from "@mui/material";
|
|
1292
1292
|
|
|
1293
1293
|
// node_modules/@mui/utils/esm/formatMuiErrorMessage/formatMuiErrorMessage.js
|
|
@@ -1344,13 +1344,12 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
1344
1344
|
if (source == null)
|
|
1345
1345
|
return {};
|
|
1346
1346
|
var target = {};
|
|
1347
|
-
var
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
target[key] = source[key];
|
|
1347
|
+
for (var key in source) {
|
|
1348
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1349
|
+
if (excluded.indexOf(key) >= 0)
|
|
1350
|
+
continue;
|
|
1351
|
+
target[key] = source[key];
|
|
1352
|
+
}
|
|
1354
1353
|
}
|
|
1355
1354
|
return target;
|
|
1356
1355
|
}
|
|
@@ -2829,7 +2828,7 @@ function createStyled(input = {}) {
|
|
|
2829
2828
|
var styled2 = createStyled();
|
|
2830
2829
|
var styled_default = styled2;
|
|
2831
2830
|
|
|
2832
|
-
// src/components/buttons/WavelengthButton/
|
|
2831
|
+
// src/components/buttons/WavelengthButton/WavelengthButton.tsx
|
|
2833
2832
|
import React from "react";
|
|
2834
2833
|
|
|
2835
2834
|
// src/themes/WavelengthAppTheme.ts
|
|
@@ -2838,26 +2837,27 @@ var WavelengthAppTheme = createContext({});
|
|
|
2838
2837
|
var useThemeContext = () => useContext(WavelengthAppTheme);
|
|
2839
2838
|
|
|
2840
2839
|
// src/themes/Palette.ts
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2840
|
+
var defaultPalette = {
|
|
2841
|
+
primary: `#336699`,
|
|
2842
|
+
secondary: `#66FFCC`
|
|
2843
|
+
};
|
|
2844
|
+
var arrowPalette = {
|
|
2845
|
+
primary: "#46D8ECFF",
|
|
2846
|
+
secondary: "#46D8EC99"
|
|
2847
|
+
};
|
|
2848
|
+
function getPalette() {
|
|
2849
|
+
const { name } = useThemeContext();
|
|
2850
|
+
if (name != void 0) {
|
|
2851
|
+
if (name.toLowerCase() === "arrow") {
|
|
2852
|
+
return arrowPalette;
|
|
2850
2853
|
}
|
|
2851
|
-
} else {
|
|
2852
|
-
console.log("Using Default Theme");
|
|
2853
2854
|
}
|
|
2854
|
-
return
|
|
2855
|
+
return defaultPalette;
|
|
2855
2856
|
}
|
|
2856
2857
|
|
|
2857
|
-
// src/components/buttons/WavelengthButton/
|
|
2858
|
-
function
|
|
2859
|
-
const
|
|
2860
|
-
const palette2 = getPalette(name);
|
|
2858
|
+
// src/components/buttons/WavelengthButton/WavelengthButton.tsx
|
|
2859
|
+
function WavelengthButton({ id, variant, margin: margin2, padding: padding2, autoFocus, disabled, onClick, children }) {
|
|
2860
|
+
const palette2 = getPalette();
|
|
2861
2861
|
const WLContainedButton = styled_default(Button)(({}) => ({
|
|
2862
2862
|
height: "45px",
|
|
2863
2863
|
color: "#FFFFFF",
|
|
@@ -2890,9 +2890,26 @@ function WLButton({ id, variant, margin: margin2, padding: padding2, autoFocus,
|
|
|
2890
2890
|
}
|
|
2891
2891
|
return /* @__PURE__ */ React.createElement(WLTextButton, { variant: "outlined", id, autoFocus, disabled, onClick, sx: { margin: { margin: margin2 }, padding: { padding: padding2 } } }, children);
|
|
2892
2892
|
}
|
|
2893
|
+
|
|
2894
|
+
// src/components/sample/MyComponent.tsx
|
|
2895
|
+
import React2 from "react";
|
|
2896
|
+
function MyComponent({ width: width2 = 100, height: height2 = 100 }) {
|
|
2897
|
+
const palette2 = getPalette();
|
|
2898
|
+
const divStyle = {
|
|
2899
|
+
display: "inline-block",
|
|
2900
|
+
border: "1px solid black",
|
|
2901
|
+
padding: "5px",
|
|
2902
|
+
borderRadius: "5px"
|
|
2903
|
+
};
|
|
2904
|
+
const titleStyle = {
|
|
2905
|
+
color: palette2.primary
|
|
2906
|
+
};
|
|
2907
|
+
return /* @__PURE__ */ React2.createElement("div", { style: divStyle }, /* @__PURE__ */ React2.createElement("center", null, /* @__PURE__ */ React2.createElement("p", { style: titleStyle }, "My Component")), /* @__PURE__ */ React2.createElement("br", null), /* @__PURE__ */ React2.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width2, height: height2, viewBox: "0 0 96 105" }, /* @__PURE__ */ React2.createElement("g", { fill: palette2.secondary, stroke: palette2.secondary, strokeLinejoin: "round", strokeLinecap: "round" }, /* @__PURE__ */ React2.createElement("path", { d: "M14,40v24M81,40v24M38,68v24M57,68v24M28,42v31h39v-31z", strokeWidth: "12" }), /* @__PURE__ */ React2.createElement("path", { d: "M32,5l5,10M64,5l-6,10 ", strokeWidth: "2" })), /* @__PURE__ */ React2.createElement("path", { d: "M22,35h51v10h-51zM22,33c0-31,51-31,51,0", fill: palette2.secondary }), /* @__PURE__ */ React2.createElement("g", { fill: "#FFF" }, /* @__PURE__ */ React2.createElement("circle", { cx: "36", cy: "22", r: "2" }), /* @__PURE__ */ React2.createElement("circle", { cx: "59", cy: "22", r: "2" }))));
|
|
2908
|
+
}
|
|
2893
2909
|
export {
|
|
2894
|
-
|
|
2910
|
+
MyComponent,
|
|
2895
2911
|
WavelengthAppTheme,
|
|
2912
|
+
WavelengthButton,
|
|
2896
2913
|
add,
|
|
2897
2914
|
concat,
|
|
2898
2915
|
useThemeContext
|