@configura/web-ui 1.4.0 → 1.5.0-alpha.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.
Files changed (96) hide show
  1. package/.postcssrc.json +8 -8
  2. package/LICENSE +201 -201
  3. package/README.md +1 -1
  4. package/dist/components/CanvasWrapper.d.ts +9 -9
  5. package/dist/components/CanvasWrapper.js +8 -8
  6. package/dist/components/CfgPriceView.d.ts +7 -0
  7. package/dist/components/CfgPriceView.js +13 -0
  8. package/dist/components/ConfigurationActionsButtonRow.d.ts +11 -11
  9. package/dist/components/ConfigurationActionsButtonRow.js +13 -13
  10. package/dist/components/Configurator.d.ts +12 -12
  11. package/dist/components/Configurator.js +15 -15
  12. package/dist/components/ConfiguratorWrapper.d.ts +8 -8
  13. package/dist/components/ConfiguratorWrapper.js +5 -5
  14. package/dist/components/CurrencyPrice.d.ts +9 -9
  15. package/dist/components/CurrencyPrice.js +7 -7
  16. package/dist/components/ExpandableHeadingRow.d.ts +15 -15
  17. package/dist/components/ExpandableHeadingRow.js +21 -21
  18. package/dist/components/Loading.d.ts +13 -13
  19. package/dist/components/Loading.js +20 -20
  20. package/dist/components/ProductInformation.d.ts +13 -10
  21. package/dist/components/ProductInformation.js +14 -23
  22. package/dist/components/TaskListView.d.ts +9 -0
  23. package/dist/components/TaskListView.js +50 -0
  24. package/dist/components/TaskStartView.d.ts +13 -0
  25. package/dist/components/TaskStartView.js +22 -0
  26. package/dist/components/icons/Checkmark.d.ts +6 -5
  27. package/dist/components/icons/Checkmark.js +12 -12
  28. package/dist/components/icons/Chevron.d.ts +7 -6
  29. package/dist/components/icons/Chevron.js +18 -18
  30. package/dist/components/icons/CircleXmarkIcon.d.ts +4 -0
  31. package/dist/components/icons/CircleXmarkIcon.js +8 -0
  32. package/dist/components/icons/DownloadIcon.d.ts +4 -0
  33. package/dist/components/icons/DownloadIcon.js +8 -0
  34. package/dist/components/icons/ErrorIcon.d.ts +4 -0
  35. package/dist/components/icons/ErrorIcon.js +8 -0
  36. package/dist/components/productConfiguration/CfgAdditionalProductView.d.ts +3 -3
  37. package/dist/components/productConfiguration/CfgAdditionalProductView.js +28 -28
  38. package/dist/components/productConfiguration/CfgCheckboxView.d.ts +19 -18
  39. package/dist/components/productConfiguration/CfgCheckboxView.js +22 -22
  40. package/dist/components/productConfiguration/CfgCheckboxesView.d.ts +13 -12
  41. package/dist/components/productConfiguration/CfgCheckboxesView.js +19 -18
  42. package/dist/components/productConfiguration/CfgDropdownOptionView.d.ts +19 -18
  43. package/dist/components/productConfiguration/CfgDropdownOptionView.js +36 -35
  44. package/dist/components/productConfiguration/CfgDropdownView.d.ts +13 -12
  45. package/dist/components/productConfiguration/CfgDropdownView.js +21 -20
  46. package/dist/components/productConfiguration/CfgFeatureView.d.ts +29 -27
  47. package/dist/components/productConfiguration/CfgFeatureView.js +36 -34
  48. package/dist/components/productConfiguration/CfgGroupView.d.ts +4 -4
  49. package/dist/components/productConfiguration/CfgGroupView.js +7 -13
  50. package/dist/components/productConfiguration/CfgOptionFeaturesView.d.ts +6 -6
  51. package/dist/components/productConfiguration/CfgOptionFeaturesView.js +13 -13
  52. package/dist/components/productConfiguration/CfgOptionNumericView.d.ts +27 -27
  53. package/dist/components/productConfiguration/CfgOptionNumericView.js +119 -117
  54. package/dist/components/productConfiguration/CfgOptionPriceView.d.ts +9 -9
  55. package/dist/components/productConfiguration/CfgOptionPriceView.js +29 -29
  56. package/dist/components/productConfiguration/CfgProductConfigurationView.d.ts +18 -18
  57. package/dist/components/productConfiguration/CfgProductConfigurationView.js +45 -45
  58. package/dist/css/web-ui.css +1 -1
  59. package/dist/css/web-ui.css.map +1 -1
  60. package/dist/index.d.ts +22 -20
  61. package/dist/index.js +22 -20
  62. package/dist/scss/_button.scss +36 -36
  63. package/dist/scss/_configurator.scss +87 -67
  64. package/dist/scss/_expandable.scss +37 -37
  65. package/dist/scss/_feature-item.scss +137 -124
  66. package/dist/scss/_forms.scss +42 -0
  67. package/dist/scss/_hr.scss +16 -16
  68. package/dist/scss/_loading.scss +98 -98
  69. package/dist/scss/_mixins.scss +56 -56
  70. package/dist/scss/_option-tree.scss +29 -29
  71. package/dist/scss/_product-information.scss +49 -49
  72. package/dist/scss/_range-view.scss +39 -28
  73. package/dist/scss/_slider.scss +70 -70
  74. package/dist/scss/_tasks.scss +71 -0
  75. package/dist/scss/_themed.scss +147 -124
  76. package/dist/scss/_utilities.scss +21 -21
  77. package/dist/scss/_variables.scss +6 -6
  78. package/dist/scss/icons/_checkmark.scss +46 -46
  79. package/dist/scss/icons/_chevron.scss +62 -62
  80. package/dist/scss/icons/_circle-xmark-icon.scss +24 -0
  81. package/dist/scss/icons/_download-icon.scss +24 -0
  82. package/dist/scss/icons/_error-icon.scss +24 -0
  83. package/dist/scss/web-ui.scss +11 -11
  84. package/dist/useObservable.d.ts +4 -4
  85. package/dist/useObservable.js +18 -18
  86. package/dist/useRerender.d.ts +1 -1
  87. package/dist/useRerender.js +5 -5
  88. package/dist/useResize.d.ts +6 -6
  89. package/dist/useResize.js +47 -47
  90. package/dist/useSelected.d.ts +2 -2
  91. package/dist/useSelected.js +13 -13
  92. package/dist/useUniqueId.d.ts +1 -1
  93. package/dist/useUniqueId.js +7 -7
  94. package/dist/utilities.d.ts +5 -5
  95. package/dist/utilities.js +1 -1
  96. package/package.json +3 -3
@@ -1,10 +1,10 @@
1
- import React from "react";
2
- interface Props {
3
- currency: string;
4
- language?: string;
5
- price: number;
6
- fractionDigits: number;
7
- }
8
- export declare const CurrencyPrice: React.FC<Props>;
9
- export {};
1
+ import React from "react";
2
+ interface Props {
3
+ currency: string;
4
+ language?: string;
5
+ price: number;
6
+ fractionDigits: number;
7
+ }
8
+ export declare const CurrencyPrice: React.FC<Props>;
9
+ export {};
10
10
  //# sourceMappingURL=CurrencyPrice.d.ts.map
@@ -1,7 +1,7 @@
1
- import { formatPrice } from "@configura/web-utilities";
2
- import React from "react";
3
- export const CurrencyPrice = (props) => {
4
- const { price, fractionDigits, currency, language } = props;
5
- const lang = language || navigator.language;
6
- return React.createElement(React.Fragment, null, formatPrice(price, fractionDigits, lang, currency));
7
- };
1
+ import { formatPrice } from "@configura/web-utilities";
2
+ import React from "react";
3
+ export const CurrencyPrice = (props) => {
4
+ const { price, fractionDigits, currency, language } = props;
5
+ const lang = language || navigator.language;
6
+ return React.createElement(React.Fragment, null, formatPrice(price, fractionDigits, lang, currency));
7
+ };
@@ -1,16 +1,16 @@
1
- import React from "react";
2
- import { CssProps } from "../utilities.js";
3
- export declare enum ExpandableHeadingRowSymbol {
4
- Chevron = 0,
5
- Checkbox = 1
6
- }
7
- declare type Props = {
8
- heading: string;
9
- open: boolean;
10
- onClick: () => void;
11
- expandable?: boolean;
12
- symbol?: ExpandableHeadingRowSymbol;
13
- };
14
- export declare const ExpandableHeadingRow: React.FC<Props & CssProps>;
15
- export {};
1
+ import React from "react";
2
+ import { CssProps } from "../utilities.js";
3
+ export declare enum ExpandableHeadingRowSymbol {
4
+ Chevron = 0,
5
+ Checkbox = 1
6
+ }
7
+ declare type Props = {
8
+ heading: string;
9
+ open: boolean;
10
+ onClick: () => void;
11
+ expandable?: boolean;
12
+ symbol?: ExpandableHeadingRowSymbol;
13
+ };
14
+ export declare const ExpandableHeadingRow: React.FC<Props & CssProps>;
15
+ export {};
16
16
  //# sourceMappingURL=ExpandableHeadingRow.d.ts.map
@@ -1,21 +1,21 @@
1
- import React from "react";
2
- import { CheckmarkWithBorder } from "./icons/Checkmark.js";
3
- import { Chevron } from "./icons/Chevron.js";
4
- export var ExpandableHeadingRowSymbol;
5
- (function (ExpandableHeadingRowSymbol) {
6
- ExpandableHeadingRowSymbol[ExpandableHeadingRowSymbol["Chevron"] = 0] = "Chevron";
7
- ExpandableHeadingRowSymbol[ExpandableHeadingRowSymbol["Checkbox"] = 1] = "Checkbox";
8
- })(ExpandableHeadingRowSymbol || (ExpandableHeadingRowSymbol = {}));
9
- export const ExpandableHeadingRow = (props) => {
10
- const { heading, open: active, onClick, children } = props;
11
- const symbol = props.symbol === undefined ? ExpandableHeadingRowSymbol.Chevron : props.symbol;
12
- if (props.expandable === false) {
13
- return (React.createElement("div", { className: "cfgExpandableHeadingRow" },
14
- children,
15
- React.createElement("div", { className: "cfgExpandableHeadingRow__title cfgTextOverflow" }, heading)));
16
- }
17
- return (React.createElement("button", { className: `cfgExpandableHeadingRow cfgExpandableHeadingRow--expandable ${props.className || ""}`, style: props.style, onClick: onClick },
18
- children,
19
- React.createElement("div", { className: "cfgExpandableHeadingRow__title cfgTextOverflow" }, heading),
20
- React.createElement("div", { className: "cfgExpandableHeadingRow__icon" }, symbol === ExpandableHeadingRowSymbol.Chevron ? (React.createElement(Chevron, { active: active })) : (React.createElement(CheckmarkWithBorder, { active: active })))));
21
- };
1
+ import React from "react";
2
+ import { CheckmarkWithBorder } from "./icons/Checkmark.js";
3
+ import { Chevron } from "./icons/Chevron.js";
4
+ export var ExpandableHeadingRowSymbol;
5
+ (function (ExpandableHeadingRowSymbol) {
6
+ ExpandableHeadingRowSymbol[ExpandableHeadingRowSymbol["Chevron"] = 0] = "Chevron";
7
+ ExpandableHeadingRowSymbol[ExpandableHeadingRowSymbol["Checkbox"] = 1] = "Checkbox";
8
+ })(ExpandableHeadingRowSymbol || (ExpandableHeadingRowSymbol = {}));
9
+ export const ExpandableHeadingRow = (props) => {
10
+ const { heading, open: active, onClick, children } = props;
11
+ const symbol = props.symbol === undefined ? ExpandableHeadingRowSymbol.Chevron : props.symbol;
12
+ if (props.expandable === false) {
13
+ return (React.createElement("div", { className: "cfgExpandableHeadingRow" },
14
+ children,
15
+ React.createElement("div", { className: "cfgExpandableHeadingRow__title cfgTextOverflow" }, heading)));
16
+ }
17
+ return (React.createElement("button", { className: `cfgExpandableHeadingRow cfgExpandableHeadingRow--expandable ${props.className || ""}`, style: props.style, onClick: onClick },
18
+ children,
19
+ React.createElement("div", { className: "cfgExpandableHeadingRow__title cfgTextOverflow" }, heading),
20
+ React.createElement("div", { className: "cfgExpandableHeadingRow__icon" }, symbol === ExpandableHeadingRowSymbol.Chevron ? (React.createElement(Chevron, { active: active })) : (React.createElement(CheckmarkWithBorder, { active: active })))));
21
+ };
@@ -1,14 +1,14 @@
1
- import React from "react";
2
- import { CssProps } from "../utilities";
3
- interface SpinnerProps {
4
- small?: boolean;
5
- }
6
- interface OverlayProps {
7
- clickThrough?: boolean;
8
- fullWindow?: boolean;
9
- }
10
- export declare const Loading: React.FC<SpinnerProps & CssProps>;
11
- export declare const CenteredLoading: React.FC<CssProps>;
12
- export declare const OverlayLoading: React.FC<OverlayProps & CssProps>;
13
- export {};
1
+ import React from "react";
2
+ import { CssProps } from "../utilities";
3
+ interface SpinnerProps {
4
+ small?: boolean;
5
+ }
6
+ interface OverlayProps {
7
+ clickThrough?: boolean;
8
+ fullWindow?: boolean;
9
+ }
10
+ export declare const Loading: React.FC<SpinnerProps & CssProps>;
11
+ export declare const CenteredLoading: React.FC<CssProps>;
12
+ export declare const OverlayLoading: React.FC<OverlayProps & CssProps>;
13
+ export {};
14
14
  //# sourceMappingURL=Loading.d.ts.map
@@ -1,20 +1,20 @@
1
- import React from "react";
2
- export const Loading = (props) => {
3
- const { small } = props;
4
- const smallClass = small ? "cfgLoading--small" : "";
5
- return (React.createElement("div", { className: `cfgLoading ${smallClass} ${props.className || ""}`, style: props.style }));
6
- };
7
- const LoadingWithText = (props) => {
8
- return (React.createElement("div", { className: `cfgLoadingWithText ${props.className || ""}`, style: props.style },
9
- React.createElement(Loading, Object.assign({}, props)),
10
- React.createElement("div", { className: "cfgLoadingWithText__text" }, "Loading")));
11
- };
12
- export const CenteredLoading = (props) => {
13
- return (React.createElement("div", { className: `cfgCenteredLoading ${props.className || ""}`, style: props.style },
14
- React.createElement(LoadingWithText, null)));
15
- };
16
- export const OverlayLoading = (props) => {
17
- const { clickThrough, fullWindow } = props;
18
- return (React.createElement("div", { className: `cfgOverlayLoading ${clickThrough ? "cfgOverlayLoading--clickThrough" : ""} ${fullWindow ? "cfgOverlayLoading--fullWindow" : ""} ${props.className || ""}`, style: props.style },
19
- React.createElement(LoadingWithText, null)));
20
- };
1
+ import React from "react";
2
+ export const Loading = (props) => {
3
+ const { small } = props;
4
+ const smallClass = small ? "cfgLoading--small" : "";
5
+ return (React.createElement("div", { className: `cfgLoading ${smallClass} ${props.className || ""}`, style: props.style }));
6
+ };
7
+ const LoadingWithText = (props) => {
8
+ return (React.createElement("div", { className: `cfgLoadingWithText ${props.className || ""}`, style: props.style },
9
+ React.createElement(Loading, Object.assign({}, props)),
10
+ React.createElement("div", { className: "cfgLoadingWithText__text" }, "Loading")));
11
+ };
12
+ export const CenteredLoading = (props) => {
13
+ return (React.createElement("div", { className: `cfgCenteredLoading ${props.className || ""}`, style: props.style },
14
+ React.createElement(LoadingWithText, null)));
15
+ };
16
+ export const OverlayLoading = (props) => {
17
+ const { clickThrough, fullWindow } = props;
18
+ return (React.createElement("div", { className: `cfgOverlayLoading ${clickThrough ? "cfgOverlayLoading--clickThrough" : ""} ${fullWindow ? "cfgOverlayLoading--fullWindow" : ""} ${props.className || ""}`, style: props.style },
19
+ React.createElement(LoadingWithText, null)));
20
+ };
@@ -1,11 +1,14 @@
1
- import { CfgPrice } from "@configura/web-api";
2
- import { CssProps } from "../utilities.js";
3
- interface Props {
4
- description: string | undefined;
5
- lang: string | undefined;
6
- styleNr: string | undefined;
7
- price: CfgPrice | undefined;
8
- }
9
- export declare function ProductInformation(props: Props & CssProps): JSX.Element;
10
- export {};
1
+ import { CfgPrice } from "@configura/web-api";
2
+ import React, { ReactElement } from "react";
3
+ import { CssProps } from "../utilities.js";
4
+ interface Props {
5
+ description: string | undefined;
6
+ lang: string | undefined;
7
+ styleNr: string | undefined;
8
+ price: CfgPrice | undefined;
9
+ leftContent?: ReactElement;
10
+ rightContent?: ReactElement;
11
+ }
12
+ export declare const ProductInformation: React.FC<Props & CssProps>;
13
+ export {};
11
14
  //# sourceMappingURL=ProductInformation.d.ts.map
@@ -1,23 +1,14 @@
1
- import React from "react";
2
- import { CurrencyPrice } from "./CurrencyPrice.js";
3
- export function ProductInformation(props) {
4
- const { styleNr, price, description, lang } = props;
5
- return (React.createElement("div", { className: `cfgProductInfo ${props.className || ""}`, style: props.style },
6
- React.createElement("div", { className: "cfgProductInfo__left" },
7
- React.createElement("h2", { className: "cfgProductInfo__name cfgTextOverflow" }, description),
8
- React.createElement("div", { className: "cfgProductInfo__number cfgTextOverflow" }, styleNr)),
9
- React.createElement(ProductInformationPrice, { price: price, lang: lang })));
10
- }
11
- function ProductInformationPrice(props) {
12
- const { price, lang } = props;
13
- if (price === undefined) {
14
- return null;
15
- }
16
- const { listPrice, currency, fractionDigits } = price;
17
- if (listPrice === 0 || currency === "") {
18
- return null;
19
- }
20
- return (React.createElement("div", { className: "cfgProductInfo__right" },
21
- React.createElement("div", { className: "cfgProductInfo__name cfgProductInfo__name--right" },
22
- React.createElement(CurrencyPrice, { currency: currency, language: lang, price: listPrice, fractionDigits: fractionDigits }))));
23
- }
1
+ import React from "react";
2
+ import { CfgPriceView } from "./CfgPriceView.js";
3
+ export const ProductInformation = (props) => {
4
+ const { styleNr, price, description, lang, leftContent, rightContent } = props;
5
+ return (React.createElement("div", { className: `cfgProductInfo ${props.className || ""}`, style: props.style },
6
+ React.createElement("div", { className: "cfgProductInfo__left" },
7
+ React.createElement("h2", { className: "cfgProductInfo__name cfgTextOverflow" }, description),
8
+ React.createElement("div", { className: "cfgProductInfo__number cfgTextOverflow" }, styleNr),
9
+ leftContent),
10
+ React.createElement("div", { className: "cfgProductInfo__right" },
11
+ React.createElement("div", { className: "cfgProductInfo__name cfgProductInfo__name--right" },
12
+ React.createElement(CfgPriceView, { price: price, lang: lang })),
13
+ rightContent)));
14
+ };
@@ -0,0 +1,9 @@
1
+ import { TaskHandler } from "@configura/web-api";
2
+ import React from "react";
3
+ import { CssProps } from "../utilities.js";
4
+ declare type Props = {
5
+ taskHandler: TaskHandler;
6
+ };
7
+ export declare const TaskListView: React.FC<Props & CssProps>;
8
+ export {};
9
+ //# sourceMappingURL=TaskListView.d.ts.map
@@ -0,0 +1,50 @@
1
+ import { isRenderFormat } from "@configura/web-api";
2
+ import React from "react";
3
+ import { CircleXmarkIcon } from "./icons/CircleXmarkIcon.js";
4
+ import { DownloadIcon } from "./icons/DownloadIcon.js";
5
+ import { ErrorIcon } from "./icons/ErrorIcon.js";
6
+ import { Loading } from "./Loading.js";
7
+ export const TaskListView = (props) => {
8
+ var _a;
9
+ const tasks = props.taskHandler.tasks;
10
+ return (React.createElement("div", { className: `cfgTaskList ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style }, 0 < tasks.length && (React.createElement("ul", null, tasks.map((task) => (React.createElement(TaskView, { task: task, key: task.uuid })))))));
11
+ };
12
+ const spinner = (React.createElement("span", { className: "cfgLoadingSizer" },
13
+ React.createElement(Loading, null)));
14
+ const TaskView = (props) => {
15
+ const { task } = props;
16
+ const { status, format, url, previewUrl } = task;
17
+ let icon;
18
+ let statusMessage;
19
+ switch (status) {
20
+ case "pending":
21
+ icon = spinner;
22
+ statusMessage = `Pending ${format.toUpperCase()} ${isRenderFormat(format) ? "render" : "export"}...`;
23
+ break;
24
+ case "running":
25
+ icon = spinner;
26
+ statusMessage = `${isRenderFormat(format) ? "Rendering" : "Exporting"} ${format.toUpperCase()}...`;
27
+ break;
28
+ case "finished":
29
+ icon = React.createElement(DownloadIcon, null);
30
+ statusMessage = `Download ${format.toUpperCase()}`;
31
+ break;
32
+ case "failed":
33
+ icon = React.createElement(ErrorIcon, null);
34
+ statusMessage = `Failed ${isRenderFormat(format) ? "rendering" : "export"} ${format.toUpperCase()}`;
35
+ break;
36
+ default:
37
+ icon = undefined;
38
+ statusMessage = "";
39
+ }
40
+ return (React.createElement("li", { className: "cfgTaskList__item" },
41
+ React.createElement("div", { className: "cfgTaskList__preview" }, previewUrl && React.createElement("img", { src: previewUrl, alt: `Preview of ${statusMessage}` })),
42
+ React.createElement("div", { className: "cfgTaskList__icon" }, url === undefined ? (icon) : (React.createElement("a", { href: url, title: statusMessage }, icon))),
43
+ React.createElement("div", { className: "cfgTaskList__status" },
44
+ url === undefined ? (statusMessage) : (React.createElement("a", { href: url, title: statusMessage }, statusMessage)),
45
+ status === "failed" && (React.createElement(React.Fragment, null,
46
+ " ",
47
+ React.createElement("button", { className: "cfgTaskList__restart", onClick: () => task.restart() }, "Restart")))),
48
+ React.createElement("button", { className: "cfgTaskList__abort", onClick: () => task.abort() },
49
+ React.createElement(CircleXmarkIcon, null))));
50
+ };
@@ -0,0 +1,13 @@
1
+ import { CfgProduct, RenderOrExportFormat, RenderTaskParams, TaskHandler } from "@configura/web-api";
2
+ import React from "react";
3
+ import { CssProps } from "../utilities.js";
4
+ declare type Props = {
5
+ taskHandler: TaskHandler;
6
+ product: CfgProduct;
7
+ renderTaskParams: (() => RenderTaskParams) | RenderTaskParams | undefined;
8
+ getPreviewUrl: (() => Promise<string>) | undefined;
9
+ formats?: RenderOrExportFormat[];
10
+ };
11
+ export declare const TaskStartView: React.FC<Props & CssProps>;
12
+ export {};
13
+ //# sourceMappingURL=TaskStartView.d.ts.map
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ export const TaskStartView = (props) => {
3
+ var _a, _b;
4
+ const { taskHandler, product, renderTaskParams, getPreviewUrl } = props;
5
+ const formats = (_a = props.formats) !== null && _a !== void 0 ? _a : taskHandler.availableFormats;
6
+ if (formats.length === 0) {
7
+ return null;
8
+ }
9
+ return (React.createElement("div", { className: `cfgTaskStart ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`, style: props.style },
10
+ React.createElement("div", { className: "cfgFormSelect" },
11
+ React.createElement("select", { value: "", onChange: (event) => {
12
+ const index = event.target.selectedIndex;
13
+ if (index === 0) {
14
+ return;
15
+ }
16
+ taskHandler.start(formats[index - 1], product, typeof renderTaskParams === "function"
17
+ ? renderTaskParams()
18
+ : renderTaskParams, getPreviewUrl);
19
+ } },
20
+ React.createElement("option", { value: "" }, "Export"),
21
+ formats.map((format) => (React.createElement("option", { value: format, key: format }, format)))))));
22
+ };
@@ -1,6 +1,7 @@
1
- import { CssProps } from "../../utilities";
2
- export declare function CheckmarkWithBorder(props: {
3
- active: boolean;
4
- } & CssProps): JSX.Element;
5
- export declare function Checkmark(props: CssProps): JSX.Element;
1
+ import React from "react";
2
+ import { CssProps } from "../../utilities";
3
+ export declare const CheckmarkWithBorder: React.FC<{
4
+ active: boolean;
5
+ } & CssProps>;
6
+ export declare const Checkmark: React.FC<CssProps>;
6
7
  //# sourceMappingURL=Checkmark.d.ts.map
@@ -1,12 +1,12 @@
1
- import React from "react";
2
- export function CheckmarkWithBorder(props) {
3
- const { active } = props;
4
- return (React.createElement("div", { className: `cfgCheckmark__border ${props.className || ""} ${active ? "cfgCheckmark__border--active" : ""}`, style: props.style }, active && React.createElement(Checkmark, null)));
5
- }
6
- export function Checkmark(props) {
7
- return (React.createElement("span", { className: `cfgCheckmark ${props.className || ""}`, style: props.style },
8
- React.createElement("svg", { height: "100%", preserveAspectRatio: "xMidYMid", version: "1.1", viewBox: "0 0 100 100", width: "100%", xmlns: "http://www.w3.org/2000/svg" },
9
- React.createElement("g", { className: "cfgCheckmark__container" },
10
- React.createElement("line", { className: "cfgCheckmark__line cfgCheckmark__lineLeft", x1: "10", y1: "30", x2: "30", y2: "30" }),
11
- React.createElement("line", { className: "cfgCheckmark__line cfgCheckmark__lineRight", x1: "90", y1: "50", x2: "50", y2: "50" })))));
12
- }
1
+ import React from "react";
2
+ export const CheckmarkWithBorder = (props) => {
3
+ const { active } = props;
4
+ return (React.createElement("div", { className: `cfgCheckmark__border ${props.className || ""} ${active ? "cfgCheckmark__border--active" : ""}`, style: props.style }, active && React.createElement(Checkmark, null)));
5
+ };
6
+ export const Checkmark = (props) => {
7
+ return (React.createElement("span", { className: `cfgCheckmark ${props.className || ""}`, style: props.style },
8
+ React.createElement("svg", { height: "100%", preserveAspectRatio: "xMidYMid", version: "1.1", viewBox: "0 0 100 100", width: "100%", xmlns: "http://www.w3.org/2000/svg" },
9
+ React.createElement("g", { className: "cfgCheckmark__container" },
10
+ React.createElement("line", { className: "cfgCheckmark__line cfgCheckmark__lineLeft", x1: "10", y1: "30", x2: "30", y2: "30" }),
11
+ React.createElement("line", { className: "cfgCheckmark__line cfgCheckmark__lineRight", x1: "90", y1: "50", x2: "50", y2: "50" })))));
12
+ };
@@ -1,7 +1,8 @@
1
- import { CssProps } from "../../utilities";
2
- export interface Props {
3
- active: boolean;
4
- up?: boolean;
5
- }
6
- export declare function Chevron(props: Props & CssProps): JSX.Element;
1
+ import React from "react";
2
+ import { CssProps } from "../../utilities";
3
+ export interface Props {
4
+ active: boolean;
5
+ up?: boolean;
6
+ }
7
+ export declare const Chevron: React.FC<Props & CssProps>;
7
8
  //# sourceMappingURL=Chevron.d.ts.map
@@ -1,18 +1,18 @@
1
- import React from "react";
2
- export function Chevron(props) {
3
- const { active } = props;
4
- let { up } = props;
5
- if (up === undefined) {
6
- up = active;
7
- }
8
- const upFragment = up ? "up" : "down";
9
- const activeFragment = active ? "active" : "passive";
10
- const containerClass = "cfgChevron__container--" + upFragment + " cfgChevron__container--" + activeFragment;
11
- const leftLineClass = "cfgChevron__lineLeft--" + upFragment + " cfgChevron__lineLeft--" + activeFragment;
12
- const rightLineClass = "cfgChevron__lineRight--" + upFragment + " cfgChevron__lineRight--" + activeFragment;
13
- return (React.createElement("span", { className: `cfgChevron ${props.className || ""}`, style: props.style },
14
- React.createElement("svg", { height: "100%", preserveAspectRatio: "xMidYMid", version: "1.1", viewBox: "0 0 100 100", width: "100%", xmlns: "http://www.w3.org/2000/svg" },
15
- React.createElement("g", { className: `cfgChevron__container ${containerClass}` },
16
- React.createElement("line", { className: `cfgChevron__line ${leftLineClass}`, x1: "10", y1: "50", x2: "50", y2: "50" }),
17
- React.createElement("line", { className: `cfgChevron__line ${rightLineClass}`, x1: "90", y1: "50", x2: "50", y2: "50" })))));
18
- }
1
+ import React from "react";
2
+ export const Chevron = (props) => {
3
+ const { active } = props;
4
+ let { up } = props;
5
+ if (up === undefined) {
6
+ up = active;
7
+ }
8
+ const upFragment = up ? "up" : "down";
9
+ const activeFragment = active ? "active" : "passive";
10
+ const containerClass = "cfgChevron__container--" + upFragment + " cfgChevron__container--" + activeFragment;
11
+ const leftLineClass = "cfgChevron__lineLeft--" + upFragment + " cfgChevron__lineLeft--" + activeFragment;
12
+ const rightLineClass = "cfgChevron__lineRight--" + upFragment + " cfgChevron__lineRight--" + activeFragment;
13
+ return (React.createElement("span", { className: `cfgChevron ${props.className || ""}`, style: props.style },
14
+ React.createElement("svg", { height: "100%", preserveAspectRatio: "xMidYMid", version: "1.1", viewBox: "0 0 100 100", width: "100%", xmlns: "http://www.w3.org/2000/svg" },
15
+ React.createElement("g", { className: `cfgChevron__container ${containerClass}` },
16
+ React.createElement("line", { className: `cfgChevron__line ${leftLineClass}`, x1: "10", y1: "50", x2: "50", y2: "50" }),
17
+ React.createElement("line", { className: `cfgChevron__line ${rightLineClass}`, x1: "90", y1: "50", x2: "50", y2: "50" })))));
18
+ };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { CssProps } from "../../utilities";
3
+ export declare const CircleXmarkIcon: React.FC<CssProps>;
4
+ //# sourceMappingURL=CircleXmarkIcon.d.ts.map
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ export const CircleXmarkIcon = (props) => {
3
+ return (React.createElement("span", { className: `cfgCircleXmarkIcon ${props.className || ""}`, style: props.style },
4
+ React.createElement("svg", { preserveAspectRatio: "xMidYMid", width: "100%", height: "100%", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
5
+ React.createElement("path", { d: "M6 6L10 10" }),
6
+ React.createElement("path", { d: "M6 10L10 6" }),
7
+ React.createElement("circle", { cx: "8", cy: "8", r: "7.25" }))));
8
+ };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { CssProps } from "../../utilities";
3
+ export declare const DownloadIcon: React.FC<CssProps>;
4
+ //# sourceMappingURL=DownloadIcon.d.ts.map
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ export const DownloadIcon = (props) => {
3
+ return (React.createElement("span", { className: `cfgDownloadIcon ${props.className || ""}`, style: props.style },
4
+ React.createElement("svg", { preserveAspectRatio: "xMidYMid", width: "100%", height: "100%", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
5
+ React.createElement("path", { d: "M1.5 11.5V14.5H14.5V11.5" }),
6
+ React.createElement("path", { d: "M8 1V11" }),
7
+ React.createElement("path", { d: "M5 9L8 12L11 9" }))));
8
+ };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { CssProps } from "../../utilities";
3
+ export declare const ErrorIcon: React.FC<CssProps>;
4
+ //# sourceMappingURL=ErrorIcon.d.ts.map
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ export const ErrorIcon = (props) => {
3
+ return (React.createElement("span", { className: `cfgErrorIcon ${props.className || ""}`, style: props.style },
4
+ React.createElement("svg", { preserveAspectRatio: "xMidYMid", width: "100%", height: "100%", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
5
+ React.createElement("path", { d: "M8 11L8 11.5" }),
6
+ React.createElement("path", { d: "M8 8.5L8 4.5" }),
7
+ React.createElement("circle", { cx: "8", cy: "8", r: "7.25" }))));
8
+ };
@@ -1,4 +1,4 @@
1
- import React from "react";
2
- import { CfgAdditionalProductViewProps } from "./CfgFeatureView.js";
3
- export declare const CfgAdditionalProductView: React.FC<CfgAdditionalProductViewProps>;
1
+ import React from "react";
2
+ import { CfgAdditionalProductViewProps } from "./CfgFeatureView.js";
3
+ export declare const CfgAdditionalProductView: React.FC<CfgAdditionalProductViewProps>;
4
4
  //# sourceMappingURL=CfgAdditionalProductView.d.ts.map
@@ -1,28 +1,28 @@
1
- import React, { useState } from "react";
2
- import { ExpandableHeadingRow, ExpandableHeadingRowSymbol } from "../ExpandableHeadingRow.js";
3
- import { forwardProps } from "./CfgFeatureView.js";
4
- import { CfgProductConfigurationView } from "./CfgProductConfigurationView.js";
5
- export const CfgAdditionalProductView = React.memo((props) => {
6
- const { product, permanentlyExpandedLevels, additionalProductComponent } = props;
7
- const { partNumber, optional, selected, configuration, additionalProducts, preview, description, } = product;
8
- const [open, setOpen] = useState(false);
9
- const openOrSelected = optional ? selected : open;
10
- const noChildren = configuration.features.length === 0 && additionalProducts.length === 0;
11
- const AdditionalProductComponent = additionalProductComponent || CfgAdditionalProductView;
12
- return (React.createElement("li", { className: "cfgFeatureItem" },
13
- React.createElement(ExpandableHeadingRow, { heading: description || partNumber, expandable: optional || (!noChildren && permanentlyExpandedLevels <= 0), open: openOrSelected, onClick: () => {
14
- if (optional) {
15
- product.setSelected(!selected);
16
- }
17
- else {
18
- setOpen((prev) => !prev);
19
- }
20
- }, symbol: optional ? ExpandableHeadingRowSymbol.Checkbox : undefined }, preview && (React.createElement("div", { className: "cfgThumbnailPlaceholder" },
21
- React.createElement("img", { alt: `Preview for ${description}`, className: "cfgThumbnailImage", src: preview })))),
22
- !noChildren &&
23
- (!optional || selected) &&
24
- (openOrSelected || 0 < permanentlyExpandedLevels) && (React.createElement("div", { className: "cfgFeatureItem__subTree" },
25
- React.createElement(CfgProductConfigurationView, Object.assign({}, forwardProps(props), { productOrConfiguration: configuration })),
26
- additionalProducts.length !== 0 && (React.createElement("ul", { className: `cfgOptionTree cfgOptionTree--topLevel` }, additionalProducts.map((additionalProduct) => (React.createElement(AdditionalProductComponent, Object.assign({ key: additionalProduct.key }, forwardProps(props), { product: additionalProduct, permanentlyExpandedLevels: permanentlyExpandedLevels - 1 })))))))),
27
- React.createElement("hr", { className: "cfgFeatureItem__hr cfgHr" })));
28
- });
1
+ import React, { useState } from "react";
2
+ import { ExpandableHeadingRow, ExpandableHeadingRowSymbol } from "../ExpandableHeadingRow.js";
3
+ import { forwardProps } from "./CfgFeatureView.js";
4
+ import { CfgProductConfigurationView } from "./CfgProductConfigurationView.js";
5
+ export const CfgAdditionalProductView = React.memo((props) => {
6
+ const { product, permanentlyExpandedLevels, additionalProductComponent } = props;
7
+ const { partNumber, optional, selected, configuration, additionalProducts, preview, description, } = product;
8
+ const [open, setOpen] = useState(false);
9
+ const openOrSelected = optional ? selected : open;
10
+ const noChildren = configuration.features.length === 0 && additionalProducts.length === 0;
11
+ const AdditionalProductComponent = additionalProductComponent !== null && additionalProductComponent !== void 0 ? additionalProductComponent : CfgAdditionalProductView;
12
+ return (React.createElement("li", { className: "cfgFeatureItem cfgAdditionalProduct" },
13
+ React.createElement(ExpandableHeadingRow, { heading: description || partNumber, expandable: optional || (!noChildren && permanentlyExpandedLevels <= 0), open: openOrSelected, onClick: () => {
14
+ if (optional) {
15
+ product.setSelected(!selected);
16
+ }
17
+ else {
18
+ setOpen((prev) => !prev);
19
+ }
20
+ }, symbol: optional ? ExpandableHeadingRowSymbol.Checkbox : undefined }, preview && (React.createElement("div", { className: "cfgThumbnailPlaceholder" },
21
+ React.createElement("img", { alt: `Preview for ${description}`, className: "cfgThumbnailImage", src: preview })))),
22
+ !noChildren &&
23
+ (!optional || selected) &&
24
+ (openOrSelected || 0 < permanentlyExpandedLevels) && (React.createElement("div", { className: "cfgFeatureItem__subTree" },
25
+ React.createElement(CfgProductConfigurationView, Object.assign({}, forwardProps(props), { productOrConfiguration: configuration })),
26
+ additionalProducts.length !== 0 && (React.createElement("ul", { className: `cfgOptionTree cfgOptionTree--topLevel` }, additionalProducts.map((additionalProduct) => (React.createElement(AdditionalProductComponent, Object.assign({ key: additionalProduct.key }, forwardProps(props), { product: additionalProduct, permanentlyExpandedLevels: permanentlyExpandedLevels - 1 })))))))),
27
+ React.createElement("hr", { className: "cfgFeatureItem__hr cfgHr" })));
28
+ });
@@ -1,19 +1,20 @@
1
- import { CfgOption } from "@configura/web-api";
2
- import React from "react";
3
- import { CssProps } from "../../utilities.js";
4
- import { CfgProductConfigurationComponentAndPassthroughProps } from "./CfgFeatureView.js";
5
- import { PassthroughProps } from "./CfgProductConfigurationView.js";
6
- declare type Props = PassthroughProps & {
7
- option: CfgOption;
8
- };
9
- export declare const CfgCheckboxView: React.FC<Props & CfgProductConfigurationComponentAndPassthroughProps & CssProps>;
10
- export declare const CfgCheckboxViewMemo: React.NamedExoticComponent<PassthroughProps & {
11
- option: CfgOption;
12
- } & {
13
- additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
14
- featureGroupComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
15
- featureSelectManyComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
16
- featureSelectOneComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
17
- } & CssProps>;
18
- export {};
1
+ import { CfgOption } from "@configura/web-api";
2
+ import React from "react";
3
+ import { CssProps } from "../../utilities.js";
4
+ import { CfgProductConfigurationComponentAndPassthroughProps } from "./CfgFeatureView.js";
5
+ import { PassthroughProps } from "./CfgProductConfigurationView.js";
6
+ declare type Props = PassthroughProps & {
7
+ option: CfgOption;
8
+ };
9
+ export declare const CfgCheckboxView: React.FC<Props & CfgProductConfigurationComponentAndPassthroughProps & CssProps>;
10
+ export declare const CfgCheckboxViewMemo: React.NamedExoticComponent<PassthroughProps & {
11
+ option: CfgOption;
12
+ } & {
13
+ additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
14
+ featureFlattenComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
15
+ featureGroupComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
16
+ featureSelectManyComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
17
+ featureSelectOneComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
18
+ } & CssProps>;
19
+ export {};
19
20
  //# sourceMappingURL=CfgCheckboxView.d.ts.map