@kirill.konshin/bootstrap 0.0.1
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/.ctirc +11 -0
- package/.storybook/main.ts +2 -0
- package/.storybook/preview.ts +2 -0
- package/.turbo/turbo-build.log +24 -0
- package/dist/adaptiveContainer.d.ts +4 -0
- package/dist/adaptiveContainer.d.ts.map +1 -0
- package/dist/adaptiveContainer.js +11 -0
- package/dist/adaptiveContainer.js.map +1 -0
- package/dist/controls.d.ts +38 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/controls.js +78 -0
- package/dist/controls.js.map +1 -0
- package/dist/controls.stories.d.ts +9 -0
- package/dist/controls.stories.d.ts.map +1 -0
- package/dist/error.d.ts +9 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +27 -0
- package/dist/error.js.map +1 -0
- package/dist/error.stories.d.ts +8 -0
- package/dist/error.stories.d.ts.map +1 -0
- package/dist/field.d.ts +11 -0
- package/dist/field.d.ts.map +1 -0
- package/dist/field.js +29 -0
- package/dist/field.js.map +1 -0
- package/dist/field.stories.d.ts +8 -0
- package/dist/field.stories.d.ts.map +1 -0
- package/dist/footer.d.ts +10 -0
- package/dist/footer.d.ts.map +1 -0
- package/dist/footer.js +45 -0
- package/dist/footer.js.map +1 -0
- package/dist/globalLoading.d.ts +6 -0
- package/dist/globalLoading.d.ts.map +1 -0
- package/dist/globalLoading.js +10 -0
- package/dist/globalLoading.js.map +1 -0
- package/dist/globalLoading.stories.d.ts +7 -0
- package/dist/globalLoading.stories.d.ts.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/loading.d.ts +10 -0
- package/dist/loading.d.ts.map +1 -0
- package/dist/loading.js +19 -0
- package/dist/loading.js.map +1 -0
- package/dist/loading.stories.d.ts +9 -0
- package/dist/loading.stories.d.ts.map +1 -0
- package/dist/responsiveHelper.d.ts +8 -0
- package/dist/responsiveHelper.d.ts.map +1 -0
- package/dist/responsiveHelper.js +46 -0
- package/dist/responsiveHelper.js.map +1 -0
- package/dist/screen.d.ts +22 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +80 -0
- package/dist/screen.js.map +1 -0
- package/dist/screen.stories.d.ts +14 -0
- package/dist/screen.stories.d.ts.map +1 -0
- package/dist/toaster.d.ts +11 -0
- package/dist/toaster.d.ts.map +1 -0
- package/dist/toaster.js +34 -0
- package/dist/toaster.js.map +1 -0
- package/dist/toaster.stories.d.ts +8 -0
- package/dist/toaster.stories.d.ts.map +1 -0
- package/dist/useModal.d.ts +23 -0
- package/dist/useModal.d.ts.map +1 -0
- package/dist/useModal.js +50 -0
- package/dist/useModal.js.map +1 -0
- package/dist/useModal.stories.d.ts +9 -0
- package/dist/useModal.stories.d.ts.map +1 -0
- package/dist/useWrappedForm.d.ts +14 -0
- package/dist/useWrappedForm.d.ts.map +1 -0
- package/dist/useWrappedForm.js +32 -0
- package/dist/useWrappedForm.js.map +1 -0
- package/package.json +68 -0
- package/src/adaptiveContainer.tsx +12 -0
- package/src/controls.stories.tsx +62 -0
- package/src/controls.tsx +119 -0
- package/src/error.stories.tsx +34 -0
- package/src/error.tsx +37 -0
- package/src/field.stories.tsx +42 -0
- package/src/field.tsx +37 -0
- package/src/footer.tsx +61 -0
- package/src/globalLoading.stories.tsx +25 -0
- package/src/globalLoading.tsx +19 -0
- package/src/index.ts +12 -0
- package/src/loading.stories.tsx +35 -0
- package/src/loading.tsx +24 -0
- package/src/main.scss +86 -0
- package/src/responsiveHelper.tsx +55 -0
- package/src/screen.stories.tsx +160 -0
- package/src/screen.tsx +146 -0
- package/src/toaster.stories.tsx +32 -0
- package/src/toaster.tsx +40 -0
- package/src/useModal.stories.tsx +51 -0
- package/src/useModal.tsx +93 -0
- package/src/useWrappedForm.ts +42 -0
- package/tsconfig.json +10 -0
- package/turbo.json +10 -0
- package/vite.config.ts +2 -0
package/.ctirc
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[36mvite v7.0.6 [32mbuilding SSR bundle for production...[36m[39m
|
|
2
|
+
create succeeded: /home/runner/work/utils/utils/packages/bootstrap/src
|
|
3
|
+
transforming...
|
|
4
|
+
[32m✓[39m 13 modules transformed.
|
|
5
|
+
rendering chunks...
|
|
6
|
+
|
|
7
|
+
[vite:dts] Start generate declaration files...
|
|
8
|
+
[2mdist/[22m[36madaptiveContainer.js [39m[1m[2m0.42 kB[22m[1m[22m[2m │ map: 0.71 kB[22m
|
|
9
|
+
[2mdist/[22m[36mglobalLoading.js [39m[1m[2m0.45 kB[22m[1m[22m[2m │ map: 0.92 kB[22m
|
|
10
|
+
[2mdist/[22m[36mloading.js [39m[1m[2m0.59 kB[22m[1m[22m[2m │ map: 1.12 kB[22m
|
|
11
|
+
[2mdist/[22m[36merror.js [39m[1m[2m0.81 kB[22m[1m[22m[2m │ map: 1.70 kB[22m
|
|
12
|
+
[2mdist/[22m[36mfield.js [39m[1m[2m0.81 kB[22m[1m[22m[2m │ map: 1.66 kB[22m
|
|
13
|
+
[2mdist/[22m[36museWrappedForm.js [39m[1m[2m0.90 kB[22m[1m[22m[2m │ map: 2.27 kB[22m
|
|
14
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m0.97 kB[22m[1m[22m[2m │ map: 0.10 kB[22m
|
|
15
|
+
[2mdist/[22m[36mtoaster.js [39m[1m[2m1.08 kB[22m[1m[22m[2m │ map: 2.12 kB[22m
|
|
16
|
+
[2mdist/[22m[36mfooter.js [39m[1m[2m1.58 kB[22m[1m[22m[2m │ map: 2.87 kB[22m
|
|
17
|
+
[2mdist/[22m[36mresponsiveHelper.js [39m[1m[2m1.82 kB[22m[1m[22m[2m │ map: 3.02 kB[22m
|
|
18
|
+
[2mdist/[22m[36museModal.js [39m[1m[2m2.08 kB[22m[1m[22m[2m │ map: 4.90 kB[22m
|
|
19
|
+
[2mdist/[22m[36mcontrols.js [39m[1m[2m2.69 kB[22m[1m[22m[2m │ map: 5.90 kB[22m
|
|
20
|
+
[2mdist/[22m[36mscreen.js [39m[1m[2m3.42 kB[22m[1m[22m[2m │ map: 7.17 kB[22m
|
|
21
|
+
[vite:dts] Declaration files built in 3375ms.
|
|
22
|
+
|
|
23
|
+
[32m✓ built in 4.10s[39m
|
|
24
|
+
Updated package.json with exports
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adaptiveContainer.d.ts","sourceRoot":"","sources":["../src/adaptiveContainer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAa,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG5D,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,cAAc,CAOhD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Container } from "react-bootstrap";
|
|
3
|
+
import { useBreakpoint } from "./responsiveHelper.js";
|
|
4
|
+
const AdaptiveContainer = function AdaptiveContainer2({ children, ...props }) {
|
|
5
|
+
const { isMobile } = useBreakpoint();
|
|
6
|
+
return /* @__PURE__ */ jsx(Container, { fluid: isMobile, ...props, children });
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
AdaptiveContainer
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=adaptiveContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adaptiveContainer.js","sources":["../src/adaptiveContainer.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { Container, ContainerProps } from 'react-bootstrap';\nimport { useBreakpoint } from './responsiveHelper';\n\nexport const AdaptiveContainer: FC<ContainerProps> = function AdaptiveContainer({ children, ...props }) {\n const { isMobile } = useBreakpoint();\n return (\n <Container fluid={isMobile} {...props}>\n {children}\n </Container>\n );\n};\n"],"names":["AdaptiveContainer"],"mappings":";;;AAIO,MAAM,oBAAwC,SAASA,mBAAkB,EAAE,UAAU,GAAG,SAAS;AACpG,QAAM,EAAE,SAAA,IAAa,cAAA;AACrB,6BACK,WAAA,EAAU,OAAO,UAAW,GAAG,OAC3B,UACL;AAER;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React, HTMLInputTypeAttribute, FC } from 'react';
|
|
2
|
+
export interface ControlProps {
|
|
3
|
+
value?: any;
|
|
4
|
+
setValue?: (v: any) => void;
|
|
5
|
+
defaultValue?: any;
|
|
6
|
+
options?: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
setOptions?: (v: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}) => void;
|
|
12
|
+
defaultOptions?: {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
name: string;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
inputProps?: {
|
|
18
|
+
type: HTMLInputTypeAttribute;
|
|
19
|
+
property?: string;
|
|
20
|
+
valueExtractor?: (e: any) => any;
|
|
21
|
+
className?: string;
|
|
22
|
+
} & any;
|
|
23
|
+
hideValue?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export type LabelProps = Pick<ControlProps, 'name' | 'value' | 'defaultValue'> & {
|
|
26
|
+
reset: () => void;
|
|
27
|
+
};
|
|
28
|
+
export declare const Label: FC<LabelProps>;
|
|
29
|
+
export declare const Control: FC<ControlProps>;
|
|
30
|
+
export interface RangeProps extends ControlProps {
|
|
31
|
+
min: number;
|
|
32
|
+
max: number;
|
|
33
|
+
step?: number;
|
|
34
|
+
}
|
|
35
|
+
export declare const Range: FC<RangeProps>;
|
|
36
|
+
export declare const Checkbox: FC<ControlProps>;
|
|
37
|
+
export declare const Select: FC<ControlProps>;
|
|
38
|
+
//# sourceMappingURL=controls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,sBAAsB,EAAQ,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhE,MAAM,WAAW,YAAY;IACzB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACjC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,KAAK,IAAI,CAAC;IACjD,cAAc,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE;QACT,IAAI,EAAE,sBAAsB,CAAC;QAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC;QACjC,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,GAAG,CAAC;IACR,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAEvG,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAa/B,CAAC;AAEH,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAsCnC,CAAC;AAEH,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAc/B,CAAC;AAEH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,YAAY,CAOpC,CAAC;AAEH,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,YAAY,CAMlC,CAAC"}
|
package/dist/controls.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
const lcFirst = (str) => str[0].toLowerCase() + str.substring(1, str.length);
|
|
4
|
+
const toProperty = (str) => lcFirst(str).split(" ").join("");
|
|
5
|
+
const Label = memo(function Label2({ name, reset, value, defaultValue }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs("label", { className: "flex-grow-1 mb-0 d-flex align-items-center justify-content-start gap-2", children: [
|
|
7
|
+
name,
|
|
8
|
+
value !== defaultValue && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("a", { href: "javascript: void(0)", onClick: reset, children: /* @__PURE__ */ jsx("small", { children: "reset" }) }) })
|
|
9
|
+
] });
|
|
10
|
+
});
|
|
11
|
+
const Control = memo(function Control2({
|
|
12
|
+
value = null,
|
|
13
|
+
setValue,
|
|
14
|
+
defaultValue = null,
|
|
15
|
+
options = {},
|
|
16
|
+
setOptions,
|
|
17
|
+
defaultOptions = {},
|
|
18
|
+
name,
|
|
19
|
+
inputProps: { Tag = "input", property = "value", valueExtractor = (e) => e.target.value, ...inputProps } = {},
|
|
20
|
+
hideValue = false,
|
|
21
|
+
children
|
|
22
|
+
}) {
|
|
23
|
+
const prop = toProperty(name);
|
|
24
|
+
defaultValue = defaultValue || defaultOptions[prop];
|
|
25
|
+
value = value || options?.[prop];
|
|
26
|
+
setValue = setValue || ((v) => setOptions?.({ [prop]: v }));
|
|
27
|
+
const reset = () => setValue(defaultValue);
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center gap-2", children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Label, { name, reset, value, defaultValue }),
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
Tag,
|
|
32
|
+
{
|
|
33
|
+
...inputProps,
|
|
34
|
+
...{ [property]: value || "" },
|
|
35
|
+
className: `${value === defaultValue ? "opacity-75" : ""} ${inputProps.className}`,
|
|
36
|
+
onChange: (e) => setValue(valueExtractor(e)),
|
|
37
|
+
children
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
!hideValue && /* @__PURE__ */ jsx("span", { onDoubleClick: reset, className: "text-start", style: { width: "20px" }, children: value })
|
|
41
|
+
] });
|
|
42
|
+
});
|
|
43
|
+
const Range = memo(function Range2({ min, max, step = 0.1, ...props }) {
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
Control,
|
|
46
|
+
{
|
|
47
|
+
inputProps: {
|
|
48
|
+
type: "range",
|
|
49
|
+
min,
|
|
50
|
+
max,
|
|
51
|
+
step,
|
|
52
|
+
className: "form-control-range",
|
|
53
|
+
valueExtractor: (e) => parseFloat(e.target.value)
|
|
54
|
+
},
|
|
55
|
+
...props
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
});
|
|
59
|
+
const Checkbox = memo(function Checkbox2(props) {
|
|
60
|
+
return /* @__PURE__ */ jsx(
|
|
61
|
+
Control,
|
|
62
|
+
{
|
|
63
|
+
inputProps: { type: "checkbox", property: "checked", valueExtractor: (e) => e.target.checked },
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
const Select = memo(function Select2({ children, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(Control, { inputProps: { Tag: "select", className: "form-select" }, ...props, hideValue: true, children });
|
|
70
|
+
});
|
|
71
|
+
export {
|
|
72
|
+
Checkbox,
|
|
73
|
+
Control,
|
|
74
|
+
Label,
|
|
75
|
+
Range,
|
|
76
|
+
Select
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=controls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controls.js","sources":["../src/controls.tsx"],"sourcesContent":["import React, { HTMLInputTypeAttribute, memo, FC } from 'react';\n\nconst lcFirst = (str: string) => str[0].toLowerCase() + str.substring(1, str.length);\n\nconst toProperty = (str: string) => lcFirst(str).split(' ').join('');\n\nexport interface ControlProps {\n value?: any;\n setValue?: (v: any) => void;\n defaultValue?: any;\n options?: { [key: string]: any };\n setOptions?: (v: { [key: string]: any }) => void;\n defaultOptions?: { [key: string]: any };\n name: string;\n children?: React.ReactNode;\n inputProps?: {\n type: HTMLInputTypeAttribute;\n property?: string;\n valueExtractor?: (e: any) => any;\n className?: string;\n } & any;\n hideValue?: boolean;\n}\n\nexport type LabelProps = Pick<ControlProps, 'name' | 'value' | 'defaultValue'> & { reset: () => void };\n\nexport const Label: FC<LabelProps> = memo(function Label({ name, reset, value, defaultValue }) {\n return (\n <label className=\"flex-grow-1 mb-0 d-flex align-items-center justify-content-start gap-2\">\n {name}\n {value !== defaultValue && (\n <>\n <a href=\"javascript: void(0)\" onClick={reset}>\n <small>reset</small>\n </a>\n </>\n )}\n </label>\n );\n});\n\nexport const Control: FC<ControlProps> = memo(function Control({\n value = null,\n setValue,\n defaultValue = null,\n options = {},\n setOptions,\n defaultOptions = {},\n name,\n inputProps: { Tag = 'input', property = 'value', valueExtractor = (e: any) => e.target.value, ...inputProps } = {},\n hideValue = false,\n children,\n}) {\n const prop = toProperty(name);\n\n defaultValue = defaultValue || defaultOptions[prop];\n value = value || options?.[prop];\n setValue = setValue || ((v) => setOptions?.({ [prop]: v }));\n\n const reset = () => setValue(defaultValue);\n\n return (\n <div className=\"d-flex align-items-center gap-2\">\n <Label name={name} reset={reset} value={value} defaultValue={defaultValue} />\n <Tag\n {...inputProps}\n {...{ [property]: value || '' }} // null is needed to make it always controlled\n className={`${value === defaultValue ? 'opacity-75' : ''} ${inputProps.className}`}\n onChange={(e: Event) => setValue(valueExtractor(e))}\n >\n {children}\n </Tag>\n {!hideValue && (\n <span onDoubleClick={reset} className=\"text-start\" style={{ width: '20px' }}>\n {value}\n </span>\n )}\n </div>\n );\n});\n\nexport interface RangeProps extends ControlProps {\n min: number;\n max: number;\n step?: number;\n}\n\nexport const Range: FC<RangeProps> = memo(function Range({ min, max, step = 0.1, ...props }) {\n return (\n <Control\n inputProps={{\n type: 'range',\n min,\n max,\n step,\n className: 'form-control-range',\n valueExtractor: (e: any) => parseFloat(e.target.value),\n }}\n {...props}\n />\n );\n});\n\nexport const Checkbox: FC<ControlProps> = memo(function Checkbox(props) {\n return (\n <Control\n inputProps={{ type: 'checkbox', property: 'checked', valueExtractor: (e: any) => e.target.checked }}\n {...props}\n />\n );\n});\n\nexport const Select: FC<ControlProps> = memo(function Select({ children, ...props }) {\n return (\n <Control inputProps={{ Tag: 'select', className: 'form-select' }} {...props} hideValue={true}>\n {children}\n </Control>\n );\n});\n"],"names":["Label","Control","Range","Checkbox","Select"],"mappings":";;AAEA,MAAM,UAAU,CAAC,QAAgB,IAAI,CAAC,EAAE,gBAAgB,IAAI,UAAU,GAAG,IAAI,MAAM;AAEnF,MAAM,aAAa,CAAC,QAAgB,QAAQ,GAAG,EAAE,MAAM,GAAG,EAAE,KAAK,EAAE;AAsB5D,MAAM,QAAwB,KAAK,SAASA,OAAM,EAAE,MAAM,OAAO,OAAO,gBAAgB;AAC3F,SACI,qBAAC,SAAA,EAAM,WAAU,0EACZ,UAAA;AAAA,IAAA;AAAA,IACA,UAAU,gBACP,oBAAA,UAAA,EACI,UAAA,oBAAC,KAAA,EAAE,MAAK,uBAAsB,SAAS,OACnC,UAAA,oBAAC,SAAA,EAAM,UAAA,SAAK,GAChB,EAAA,CACJ;AAAA,EAAA,GAER;AAER,CAAC;AAEM,MAAM,UAA4B,KAAK,SAASC,SAAQ;AAAA,EAC3D,QAAQ;AAAA,EACR;AAAA,EACA,eAAe;AAAA,EACf,UAAU,CAAA;AAAA,EACV;AAAA,EACA,iBAAiB,CAAA;AAAA,EACjB;AAAA,EACA,YAAY,EAAE,MAAM,SAAS,WAAW,SAAS,iBAAiB,CAAC,MAAW,EAAE,OAAO,OAAO,GAAG,WAAA,IAAe,CAAA;AAAA,EAChH,YAAY;AAAA,EACZ;AACJ,GAAG;AACC,QAAM,OAAO,WAAW,IAAI;AAE5B,iBAAe,gBAAgB,eAAe,IAAI;AAClD,UAAQ,SAAS,UAAU,IAAI;AAC/B,aAAW,aAAa,CAAC,MAAM,aAAa,EAAE,CAAC,IAAI,GAAG,EAAA,CAAG;AAEzD,QAAM,QAAQ,MAAM,SAAS,YAAY;AAEzC,SACI,qBAAC,OAAA,EAAI,WAAU,mCACX,UAAA;AAAA,IAAA,oBAAC,OAAA,EAAM,MAAY,OAAc,OAAc,cAA4B;AAAA,IAC3E;AAAA,MAAC;AAAA,MAAA;AAAA,QACI,GAAG;AAAA,QACH,GAAG,EAAE,CAAC,QAAQ,GAAG,SAAS,GAAA;AAAA,QAC3B,WAAW,GAAG,UAAU,eAAe,eAAe,EAAE,IAAI,WAAW,SAAS;AAAA,QAChF,UAAU,CAAC,MAAa,SAAS,eAAe,CAAC,CAAC;AAAA,QAEjD;AAAA,MAAA;AAAA,IAAA;AAAA,IAEJ,CAAC,aACE,oBAAC,QAAA,EAAK,eAAe,OAAO,WAAU,cAAa,OAAO,EAAE,OAAO,OAAA,GAC9D,UAAA,MAAA,CACL;AAAA,EAAA,GAER;AAER,CAAC;AAQM,MAAM,QAAwB,KAAK,SAASC,OAAM,EAAE,KAAK,KAAK,OAAO,KAAK,GAAG,SAAS;AACzF,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,YAAY;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,QACX,gBAAgB,CAAC,MAAW,WAAW,EAAE,OAAO,KAAK;AAAA,MAAA;AAAA,MAExD,GAAG;AAAA,IAAA;AAAA,EAAA;AAGhB,CAAC;AAEM,MAAM,WAA6B,KAAK,SAASC,UAAS,OAAO;AACpE,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,YAAY,EAAE,MAAM,YAAY,UAAU,WAAW,gBAAgB,CAAC,MAAW,EAAE,OAAO,QAAA;AAAA,MACzF,GAAG;AAAA,IAAA;AAAA,EAAA;AAGhB,CAAC;AAEM,MAAM,SAA2B,KAAK,SAASC,QAAO,EAAE,UAAU,GAAG,SAAS;AACjF,SACI,oBAAC,SAAA,EAAQ,YAAY,EAAE,KAAK,UAAU,WAAW,cAAA,GAAkB,GAAG,OAAO,WAAW,MACnF,SAAA,CACL;AAER,CAAC;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Control } from './controls';
|
|
3
|
+
declare const meta: Meta<typeof Control>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const RangeControl: Story;
|
|
7
|
+
export declare const CheckboxControl: Story;
|
|
8
|
+
export declare const SelectControl: Story;
|
|
9
|
+
//# sourceMappingURL=controls.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controls.stories.d.ts","sourceRoot":"","sources":["../src/controls.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAU,OAAO,EAAmB,MAAM,YAAY,CAAC;AAK9D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAyB9B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,YAAY,EAAE,KAI1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAI7B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAS3B,CAAC"}
|
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ButtonProps } from 'react-bootstrap';
|
|
3
|
+
export type ErrorAlertProps = {
|
|
4
|
+
children?: Error | string | any;
|
|
5
|
+
onRetry?: () => any;
|
|
6
|
+
buttonProps?: ButtonProps;
|
|
7
|
+
};
|
|
8
|
+
export declare const ErrorAlert: FC<ErrorAlertProps>;
|
|
9
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAA6B,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEzE,MAAM,MAAM,eAAe,GAAG;IAC1B,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,GAAG,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAwB1C,CAAC"}
|
package/dist/error.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Alert, Button } from "react-bootstrap";
|
|
4
|
+
const ErrorAlert = function ErrorAlert2({ onRetry, children, buttonProps, ...props }) {
|
|
5
|
+
if (!children) return null;
|
|
6
|
+
return /* @__PURE__ */ jsxs(Alert, { variant: "danger", ...props, children: [
|
|
7
|
+
/* @__PURE__ */ jsx("div", { children: children.message || children.toString() }),
|
|
8
|
+
onRetry && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
9
|
+
Button,
|
|
10
|
+
{
|
|
11
|
+
variant: "link",
|
|
12
|
+
className: "alert-link",
|
|
13
|
+
...buttonProps,
|
|
14
|
+
onClick: (e) => {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
e.stopPropagation();
|
|
17
|
+
onRetry();
|
|
18
|
+
},
|
|
19
|
+
children: "Retry"
|
|
20
|
+
}
|
|
21
|
+
) })
|
|
22
|
+
] });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
ErrorAlert
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sources":["../src/error.tsx"],"sourcesContent":["'use client';\n\nimport React, { FC } from 'react';\nimport { Alert, AlertProps, Button, ButtonProps } from 'react-bootstrap';\n\nexport type ErrorAlertProps = {\n children?: Error | string | any;\n onRetry?: () => any;\n buttonProps?: ButtonProps;\n};\n\n//TODO Create MUI-specific?\nexport const ErrorAlert: FC<ErrorAlertProps> = function ErrorAlert({ onRetry, children, buttonProps, ...props }) {\n if (!children) return null;\n\n return (\n <Alert variant=\"danger\" {...props}>\n <div>{children.message || children.toString()}</div>\n {onRetry && (\n <div>\n <Button\n variant=\"link\"\n className=\"alert-link\"\n {...buttonProps}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n onRetry();\n }}\n >\n Retry\n </Button>\n </div>\n )}\n </Alert>\n );\n};\n"],"names":["ErrorAlert"],"mappings":";;;AAYO,MAAM,aAAkC,SAASA,YAAW,EAAE,SAAS,UAAU,aAAa,GAAG,SAAS;AAC7G,MAAI,CAAC,SAAU,QAAO;AAEtB,SACI,qBAAC,OAAA,EAAM,SAAQ,UAAU,GAAG,OACxB,UAAA;AAAA,IAAA,oBAAC,OAAA,EAAK,UAAA,SAAS,WAAW,SAAS,YAAW;AAAA,IAC7C,+BACI,OAAA,EACG,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,SAAQ;AAAA,QACR,WAAU;AAAA,QACT,GAAG;AAAA,QACJ,SAAS,CAAC,MAAM;AACZ,YAAE,eAAA;AACF,YAAE,gBAAA;AACF,kBAAA;AAAA,QACJ;AAAA,QACH,UAAA;AAAA,MAAA;AAAA,IAAA,EAED,CACJ;AAAA,EAAA,GAER;AAER;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ErrorAlert } from './error';
|
|
3
|
+
declare const meta: Meta<typeof ErrorAlert>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const String: Story;
|
|
7
|
+
export declare const ErrorObject: Story;
|
|
8
|
+
//# sourceMappingURL=error.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.stories.d.ts","sourceRoot":"","sources":["../src/error.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAYjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,MAAM,EAAE,KAIpB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC"}
|
package/dist/field.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FormGroupProps, FormLabelProps, FormTextProps } from 'react-bootstrap';
|
|
3
|
+
export type FieldGroupProps = FormGroupProps & {
|
|
4
|
+
label?: any;
|
|
5
|
+
labelProps?: FormLabelProps;
|
|
6
|
+
text?: any;
|
|
7
|
+
textProps?: FormTextProps;
|
|
8
|
+
horizontal?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const FieldGroup: FC<FieldGroupProps>;
|
|
11
|
+
//# sourceMappingURL=field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../src/field.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAQ,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEtF,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG;IAC3C,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAyB1C,CAAC"}
|
package/dist/field.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Form } from "react-bootstrap";
|
|
3
|
+
const FieldGroup = function FieldGroup2({
|
|
4
|
+
label,
|
|
5
|
+
labelProps = {},
|
|
6
|
+
text,
|
|
7
|
+
textProps = {},
|
|
8
|
+
horizontal,
|
|
9
|
+
children,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
if (horizontal) {
|
|
13
|
+
props.className = "hstack gap-3 " + (props.className || "");
|
|
14
|
+
labelProps.className = "m-0 " + (labelProps.className || "");
|
|
15
|
+
}
|
|
16
|
+
if (text && horizontal) {
|
|
17
|
+
throw new Error("Cannot use text and horizontal together");
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */ jsxs(Form.Group, { ...props, children: [
|
|
20
|
+
label && /* @__PURE__ */ jsx(Form.Label, { ...labelProps, children: label }),
|
|
21
|
+
children,
|
|
22
|
+
text && !horizontal && /* @__PURE__ */ jsx(Form.Text, { ...textProps, children: text }),
|
|
23
|
+
" "
|
|
24
|
+
] });
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
FieldGroup
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../src/field.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { Form, FormGroupProps, FormLabelProps, FormTextProps } from 'react-bootstrap';\n\nexport type FieldGroupProps = FormGroupProps & {\n label?: any;\n labelProps?: FormLabelProps;\n text?: any;\n textProps?: FormTextProps;\n horizontal?: boolean;\n};\n\nexport const FieldGroup: FC<FieldGroupProps> = function FieldGroup({\n label,\n labelProps = {},\n text,\n textProps = {},\n horizontal,\n children,\n ...props\n}) {\n if (horizontal) {\n props.className = 'hstack gap-3 ' + (props.className || '');\n labelProps.className = 'm-0 ' + (labelProps.className || '');\n }\n\n if (text && horizontal) {\n throw new Error('Cannot use text and horizontal together');\n }\n\n return (\n <Form.Group {...props}>\n {label && <Form.Label {...labelProps}>{label}</Form.Label>}\n {children}\n {text && !horizontal && <Form.Text {...textProps}>{text}</Form.Text>}{' '}\n </Form.Group>\n );\n};\n"],"names":["FieldGroup"],"mappings":";;AAWO,MAAM,aAAkC,SAASA,YAAW;AAAA,EAC/D;AAAA,EACA,aAAa,CAAA;AAAA,EACb;AAAA,EACA,YAAY,CAAA;AAAA,EACZ;AAAA,EACA;AAAA,EACA,GAAG;AACP,GAAG;AACC,MAAI,YAAY;AACZ,UAAM,YAAY,mBAAmB,MAAM,aAAa;AACxD,eAAW,YAAY,UAAU,WAAW,aAAa;AAAA,EAC7D;AAEA,MAAI,QAAQ,YAAY;AACpB,UAAM,IAAI,MAAM,yCAAyC;AAAA,EAC7D;AAEA,SACI,qBAAC,KAAK,OAAL,EAAY,GAAG,OACX,UAAA;AAAA,IAAA,6BAAU,KAAK,OAAL,EAAY,GAAG,YAAa,UAAA,OAAM;AAAA,IAC5C;AAAA,IACA,QAAQ,CAAC,cAAc,oBAAC,KAAK,MAAL,EAAW,GAAG,WAAY,UAAA,MAAK;AAAA,IAAc;AAAA,EAAA,GAC1E;AAER;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { FieldGroup } from './field';
|
|
3
|
+
declare const meta: Meta<typeof FieldGroup>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Vertical: Story;
|
|
7
|
+
export declare const Horizontal: Story;
|
|
8
|
+
//# sourceMappingURL=field.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.stories.d.ts","sourceRoot":"","sources":["../src/field.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAajC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC"}
|
package/dist/footer.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export type FooterNavItemProps = {
|
|
3
|
+
href: any;
|
|
4
|
+
icon: any;
|
|
5
|
+
active?: boolean | undefined;
|
|
6
|
+
children?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare const FooterNavItem: FC<FooterNavItemProps>;
|
|
9
|
+
export declare const Footer: FC<any>;
|
|
10
|
+
//# sourceMappingURL=footer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../src/footer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKlC,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAgChD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,GAAG,CAc1B,CAAC"}
|
package/dist/footer.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Nav, Navbar } from "react-bootstrap";
|
|
3
|
+
import { useBreakpoint } from "./responsiveHelper.js";
|
|
4
|
+
import { AdaptiveContainer } from "./adaptiveContainer.js";
|
|
5
|
+
const FooterNavItem = function FooterNavItem2({
|
|
6
|
+
href,
|
|
7
|
+
icon,
|
|
8
|
+
active = false,
|
|
9
|
+
children = ""
|
|
10
|
+
}) {
|
|
11
|
+
const isFilepath = icon.includes(".");
|
|
12
|
+
let iconElement;
|
|
13
|
+
if (isFilepath) {
|
|
14
|
+
iconElement = /* @__PURE__ */ jsx("img", { src: icon, alt: "icon", className: "me-lg-2" });
|
|
15
|
+
} else {
|
|
16
|
+
iconElement = /* @__PURE__ */ jsx("span", { className: `lead me-lg-2 ${icon}` });
|
|
17
|
+
}
|
|
18
|
+
const link = /* @__PURE__ */ jsxs(
|
|
19
|
+
Nav.Link,
|
|
20
|
+
{
|
|
21
|
+
href,
|
|
22
|
+
className: `px-0 px-lg-3 d-flex align-items-center flex-column flex-lg-row ${active ? "text-primary" : ""}`,
|
|
23
|
+
children: [
|
|
24
|
+
iconElement,
|
|
25
|
+
children
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
return /* @__PURE__ */ jsx(Nav.Item, { style: { flex: 1 }, children: link });
|
|
30
|
+
};
|
|
31
|
+
const Footer = function Footer2({ children }) {
|
|
32
|
+
const { isDesktop } = useBreakpoint();
|
|
33
|
+
return (
|
|
34
|
+
// border-bottom
|
|
35
|
+
/* @__PURE__ */ jsx("div", { className: isDesktop ? "" : "border-top", children: /* @__PURE__ */ jsx(Navbar, { className: isDesktop ? "" : "py-0", children: /* @__PURE__ */ jsxs(AdaptiveContainer, { children: [
|
|
36
|
+
isDesktop && /* @__PURE__ */ jsx(Navbar.Brand, { href: "/", children: "Le Brand" }),
|
|
37
|
+
/* @__PURE__ */ jsx(Nav, { className: isDesktop ? "me-auto" : "justify-content-center flex-nowrap w-100", children })
|
|
38
|
+
] }) }) })
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
Footer,
|
|
43
|
+
FooterNavItem
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","sources":["../src/footer.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { Nav, Navbar } from 'react-bootstrap';\nimport { useBreakpoint } from './responsiveHelper';\nimport { AdaptiveContainer } from './adaptiveContainer';\n\nexport type FooterNavItemProps = {\n href: any;\n icon: any;\n active?: boolean | undefined;\n children?: string | undefined;\n};\n\nexport const FooterNavItem: FC<FooterNavItemProps> = function FooterNavItem({\n href,\n icon,\n active = false,\n children = '',\n}) {\n // const pathname = usePathname();\n\n const isFilepath = icon.includes('.');\n let iconElement;\n\n if (isFilepath) {\n iconElement = <img src={icon} alt=\"icon\" className=\"me-lg-2\" />;\n } else {\n iconElement = <span className={`lead me-lg-2 ${icon}`} />;\n }\n\n // const active = isActivePath(href, pathname);\n\n const link = (\n <Nav.Link\n // as={Link}\n href={href}\n // active={active} // has no effect when not pills or tabs\n className={`px-0 px-lg-3 d-flex align-items-center flex-column flex-lg-row ${active ? 'text-primary' : ''}`}\n >\n {iconElement}\n {children}\n </Nav.Link>\n );\n\n return <Nav.Item style={{ flex: 1 }}>{link}</Nav.Item>;\n};\n\nexport const Footer: FC<any> = function Footer({ children }) {\n const { isDesktop } = useBreakpoint();\n\n return (\n // border-bottom\n <div className={isDesktop ? '' : 'border-top'}>\n <Navbar className={isDesktop ? '' : 'py-0'}>\n <AdaptiveContainer>\n {isDesktop && <Navbar.Brand href=\"/\">Le Brand</Navbar.Brand>}\n <Nav className={isDesktop ? 'me-auto' : 'justify-content-center flex-nowrap w-100'}>{children}</Nav>\n </AdaptiveContainer>\n </Navbar>\n </div>\n );\n};\n"],"names":["FooterNavItem","Footer"],"mappings":";;;;AAYO,MAAM,gBAAwC,SAASA,eAAc;AAAA,EACxE;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,WAAW;AACf,GAAG;AAGC,QAAM,aAAa,KAAK,SAAS,GAAG;AACpC,MAAI;AAEJ,MAAI,YAAY;AACZ,sCAAe,OAAA,EAAI,KAAK,MAAM,KAAI,QAAO,WAAU,WAAU;AAAA,EACjE,OAAO;AACH,kBAAc,oBAAC,QAAA,EAAK,WAAW,gBAAgB,IAAI,IAAI;AAAA,EAC3D;AAIA,QAAM,OACF;AAAA,IAAC,IAAI;AAAA,IAAJ;AAAA,MAEG;AAAA,MAEA,WAAW,kEAAkE,SAAS,iBAAiB,EAAE;AAAA,MAExG,UAAA;AAAA,QAAA;AAAA,QACA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIT,SAAO,oBAAC,IAAI,MAAJ,EAAS,OAAO,EAAE,MAAM,EAAA,GAAM,UAAA,MAAK;AAC/C;AAEO,MAAM,SAAkB,SAASC,QAAO,EAAE,YAAY;AACzD,QAAM,EAAE,UAAA,IAAc,cAAA;AAEtB;AAAA;AAAA,IAEI,oBAAC,OAAA,EAAI,WAAW,YAAY,KAAK,cAC7B,UAAA,oBAAC,QAAA,EAAO,WAAW,YAAY,KAAK,QAChC,+BAAC,mBAAA,EACI,UAAA;AAAA,MAAA,iCAAc,OAAO,OAAP,EAAa,MAAK,KAAI,UAAA,YAAQ;AAAA,0BAC5C,KAAA,EAAI,WAAW,YAAY,YAAY,4CAA6C,SAAA,CAAS;AAAA,IAAA,EAAA,CAClG,GACJ,EAAA,CACJ;AAAA;AAER;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalLoading.d.ts","sourceRoot":"","sources":["../src/globalLoading.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIlC,MAAM,MAAM,kBAAkB,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtD,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAYhD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Loading } from "./loading.js";
|
|
3
|
+
const GlobalLoading = function GlobalLoading2({ loading }) {
|
|
4
|
+
if (!loading) return null;
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { className: "bg-white position-absolute top-0 start-0 w-100 h-100 z-3 d-flex align-items-center justify-content-center", children: /* @__PURE__ */ jsx(Loading, {}) });
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
GlobalLoading
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=globalLoading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalLoading.js","sources":["../src/globalLoading.tsx"],"sourcesContent":["import React, { FC } from 'react';\n// import { useLoading, useLoadingTimeout } from '../redux/loadingSlice';\nimport { Loading } from './loading';\n\nexport type GlobalLoadingProps = { loading: boolean };\n\nexport const GlobalLoading: FC<GlobalLoadingProps> = function GlobalLoading({ loading }) {\n // const { loading } = useLoading();\n\n // useLoadingTimeout(15000); // escape latch if something is stuck\n\n if (!loading) return null;\n\n return (\n <div className=\"bg-white position-absolute top-0 start-0 w-100 h-100 z-3 d-flex align-items-center justify-content-center\">\n <Loading />\n </div>\n );\n};\n"],"names":["GlobalLoading"],"mappings":";;AAMO,MAAM,gBAAwC,SAASA,eAAc,EAAE,WAAW;AAKrF,MAAI,CAAC,QAAS,QAAO;AAErB,6BACK,OAAA,EAAI,WAAU,6GACX,UAAA,oBAAC,WAAQ,GACb;AAER;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { GlobalLoading } from './globalLoading';
|
|
3
|
+
declare const meta: Meta<typeof GlobalLoading>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
//# sourceMappingURL=globalLoading.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalLoading.stories.d.ts","sourceRoot":"","sources":["../src/globalLoading.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CAUpC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './adaptiveContainer';
|
|
2
|
+
export * from './controls';
|
|
3
|
+
export * from './error';
|
|
4
|
+
export * from './field';
|
|
5
|
+
export * from './footer';
|
|
6
|
+
export * from './globalLoading';
|
|
7
|
+
export * from './loading';
|
|
8
|
+
export * from './responsiveHelper';
|
|
9
|
+
export * from './screen';
|
|
10
|
+
export * from './toaster';
|
|
11
|
+
export * from './useModal';
|
|
12
|
+
export * from './useWrappedForm';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AdaptiveContainer } from "./adaptiveContainer.js";
|
|
2
|
+
import { Checkbox, Control, Label, Range, Select } from "./controls.js";
|
|
3
|
+
import { ErrorAlert } from "./error.js";
|
|
4
|
+
import { FieldGroup } from "./field.js";
|
|
5
|
+
import { Footer, FooterNavItem } from "./footer.js";
|
|
6
|
+
import { GlobalLoading } from "./globalLoading.js";
|
|
7
|
+
import { Loading } from "./loading.js";
|
|
8
|
+
import { ResponsiveHelperBS, useBreakpoint } from "./responsiveHelper.js";
|
|
9
|
+
import { Screen } from "./screen.js";
|
|
10
|
+
import { Toaster } from "./toaster.js";
|
|
11
|
+
import { useModal } from "./useModal.js";
|
|
12
|
+
import { isFormLoading, stopPropagation, useWrappedForm } from "./useWrappedForm.js";
|
|
13
|
+
export {
|
|
14
|
+
AdaptiveContainer,
|
|
15
|
+
Checkbox,
|
|
16
|
+
Control,
|
|
17
|
+
ErrorAlert,
|
|
18
|
+
FieldGroup,
|
|
19
|
+
Footer,
|
|
20
|
+
FooterNavItem,
|
|
21
|
+
GlobalLoading,
|
|
22
|
+
Label,
|
|
23
|
+
Loading,
|
|
24
|
+
Range,
|
|
25
|
+
ResponsiveHelperBS,
|
|
26
|
+
Screen,
|
|
27
|
+
Select,
|
|
28
|
+
Toaster,
|
|
29
|
+
isFormLoading,
|
|
30
|
+
stopPropagation,
|
|
31
|
+
useBreakpoint,
|
|
32
|
+
useModal,
|
|
33
|
+
useWrappedForm
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SpinnerProps } from 'react-bootstrap';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export type LoadingProps = {
|
|
4
|
+
children?: any;
|
|
5
|
+
show?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
size?: SpinnerProps['size'];
|
|
8
|
+
};
|
|
9
|
+
export declare const Loading: FC<LoadingProps>;
|
|
10
|
+
//# sourceMappingURL=loading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../src/loading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAS,MAAM,iBAAiB,CAAC;AAC/D,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;AAExC,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAanC,CAAC"}
|
package/dist/loading.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, Spinner } from "react-bootstrap";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
const Loading = memo(function Loading2({
|
|
5
|
+
children = "Loading...",
|
|
6
|
+
show = true,
|
|
7
|
+
className = "",
|
|
8
|
+
size
|
|
9
|
+
}) {
|
|
10
|
+
if (!show) return null;
|
|
11
|
+
return /* @__PURE__ */ jsxs(Stack, { direction: "horizontal", gap: 3, className: `align-self-auto ${className}`, children: [
|
|
12
|
+
/* @__PURE__ */ jsx(Spinner, { animation: "border", role: "status", size }),
|
|
13
|
+
/* @__PURE__ */ jsx("span", { children })
|
|
14
|
+
] });
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
Loading
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=loading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading.js","sources":["../src/loading.tsx"],"sourcesContent":["import { Spinner, SpinnerProps, Stack } from 'react-bootstrap';\nimport React, { FC, memo } from 'react';\n\nexport type LoadingProps = {\n children?: any;\n show?: boolean;\n className?: string;\n size?: SpinnerProps['size'];\n};\n\nexport const Loading: FC<LoadingProps> = memo(function Loading({\n children = 'Loading...' as any,\n show = true,\n className = '',\n size,\n}) {\n if (!show) return null;\n return (\n <Stack direction=\"horizontal\" gap={3} className={`align-self-auto ${className}`}>\n <Spinner animation=\"border\" role=\"status\" size={size as any} />\n <span>{children}</span>\n </Stack>\n );\n});\n"],"names":["Loading"],"mappings":";;;AAUO,MAAM,UAA4B,KAAK,SAASA,SAAQ;AAAA,EAC3D,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AACJ,GAAG;AACC,MAAI,CAAC,KAAM,QAAO;AAClB,SACI,qBAAC,SAAM,WAAU,cAAa,KAAK,GAAG,WAAW,mBAAmB,SAAS,IACzE,UAAA;AAAA,IAAA,oBAAC,SAAA,EAAQ,WAAU,UAAS,MAAK,UAAS,MAAmB;AAAA,IAC7D,oBAAC,UAAM,SAAA,CAAS;AAAA,EAAA,GACpB;AAER,CAAC;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Loading } from './loading';
|
|
3
|
+
declare const meta: Meta<typeof Loading>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Children: Story;
|
|
8
|
+
export declare const Size: Story;
|
|
9
|
+
//# sourceMappingURL=loading.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading.stories.d.ts","sourceRoot":"","sources":["../src/loading.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAY9B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAIlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsiveHelper.d.ts","sourceRoot":"","sources":["../src/responsiveHelper.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAEvD,wBAAgB,aAAa,IAAI;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACtB,CAiCA;AAED,eAAO,MAAM,kBAAkB,EAAE,EAWhC,CAAC"}
|