@kirill.konshin/bootstrap 0.0.2 → 0.0.3
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/adaptiveContainer.d.ts.map +1 -1
- package/dist/adaptiveContainer.js +14 -9
- package/dist/adaptiveContainer.js.map +1 -1
- package/dist/adaptiveContainer.stories.d.ts +2 -2
- package/dist/adaptiveContainer.stories.d.ts.map +1 -1
- package/dist/controls.d.ts +4 -4
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +79 -72
- package/dist/controls.js.map +1 -1
- package/dist/controls.stories.d.ts +2 -2
- package/dist/controls.stories.d.ts.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +23 -24
- package/dist/error.js.map +1 -1
- package/dist/error.stories.d.ts +2 -2
- package/dist/error.stories.d.ts.map +1 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +27 -27
- package/dist/field.js.map +1 -1
- package/dist/field.stories.d.ts +2 -2
- package/dist/field.stories.d.ts.map +1 -1
- package/dist/footer.d.ts.map +1 -1
- package/dist/footer.js +41 -42
- package/dist/footer.js.map +1 -1
- package/dist/footer.stories.d.ts +2 -2
- package/dist/footer.stories.d.ts.map +1 -1
- package/dist/globalLoading.d.ts.map +1 -1
- package/dist/globalLoading.js +13 -9
- package/dist/globalLoading.js.map +1 -1
- package/dist/globalLoading.stories.d.ts +2 -2
- package/dist/globalLoading.stories.d.ts.map +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.js +3 -25
- package/dist/loading.d.ts.map +1 -1
- package/dist/loading.js +19 -17
- package/dist/loading.js.map +1 -1
- package/dist/loading.stories.d.ts +2 -2
- package/dist/loading.stories.d.ts.map +1 -1
- package/dist/responsiveHelper.d.ts.map +1 -1
- package/dist/responsiveHelper.js +69 -42
- package/dist/responsiveHelper.js.map +1 -1
- package/dist/responsiveHelper.stories.d.ts +2 -2
- package/dist/responsiveHelper.stories.d.ts.map +1 -1
- package/dist/screen.d.ts.map +1 -1
- package/dist/screen.js +84 -77
- package/dist/screen.js.map +1 -1
- package/dist/screen.stories.d.ts +2 -2
- package/dist/screen.stories.d.ts.map +1 -1
- package/dist/toaster.d.ts.map +1 -1
- package/dist/toaster.js +29 -30
- package/dist/toaster.js.map +1 -1
- package/dist/toaster.stories.d.ts +2 -2
- package/dist/toaster.stories.d.ts.map +1 -1
- package/dist/useModal.d.ts.map +1 -1
- package/dist/useModal.js +58 -47
- package/dist/useModal.js.map +1 -1
- package/dist/useModal.stories.d.ts +2 -2
- package/dist/useModal.stories.d.ts.map +1 -1
- package/dist/useWrappedForm.d.ts.map +1 -1
- package/dist/useWrappedForm.js +40 -29
- package/dist/useWrappedForm.js.map +1 -1
- package/package.json +17 -5
- package/.ctirc +0 -20
- package/.storybook/main.ts +0 -2
- package/.storybook/preview.ts +0 -2
- package/.turbo/turbo-build.log +0 -31
- package/CHANGELOG.md +0 -8
- package/dist/index.js.map +0 -1
- package/src/adaptiveContainer.stories.tsx +0 -59
- package/src/adaptiveContainer.tsx +0 -14
- package/src/controls.stories.tsx +0 -62
- package/src/controls.tsx +0 -119
- package/src/error.stories.tsx +0 -34
- package/src/error.tsx +0 -37
- package/src/field.stories.tsx +0 -42
- package/src/field.tsx +0 -37
- package/src/footer.stories.tsx +0 -121
- package/src/footer.tsx +0 -65
- package/src/globalLoading.stories.tsx +0 -25
- package/src/globalLoading.tsx +0 -19
- package/src/index.ts +0 -12
- package/src/loading.stories.tsx +0 -35
- package/src/loading.tsx +0 -24
- package/src/main.scss +0 -86
- package/src/responsiveHelper.stories.tsx +0 -109
- package/src/responsiveHelper.tsx +0 -55
- package/src/screen.stories.tsx +0 -160
- package/src/screen.tsx +0 -146
- package/src/toaster.stories.tsx +0 -32
- package/src/toaster.tsx +0 -40
- package/src/useModal.stories.tsx +0 -51
- package/src/useModal.tsx +0 -93
- package/src/useWrappedForm.ts +0 -42
- package/tsconfig.json +0 -10
- package/turbo.json +0 -10
- package/vite.config.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptiveContainer.d.ts","sourceRoot":"","sources":["../src/adaptiveContainer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"adaptiveContainer.d.ts","sourceRoot":"","sources":["../src/adaptiveContainer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjE,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAEpD,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAOvD,CAAC"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useBreakpoint } from "./responsiveHelper.js";
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
import { Container } from "react-bootstrap";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/adaptiveContainer.tsx
|
|
6
|
+
var AdaptiveContainer = memo(function AdaptiveContainer({ children, ...props }) {
|
|
7
|
+
const { isMobile } = useBreakpoint();
|
|
8
|
+
return /* @__PURE__ */ jsx(Container, {
|
|
9
|
+
fluid: isMobile,
|
|
10
|
+
...props,
|
|
11
|
+
children
|
|
12
|
+
});
|
|
8
13
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=adaptiveContainer.js.map
|
|
14
|
+
//#endregion
|
|
15
|
+
export { AdaptiveContainer };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=adaptiveContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptiveContainer.js","sources":["../src/adaptiveContainer.tsx"],"sourcesContent":["import React, { FC, memo } from 'react';\nimport { Container, ContainerProps } from 'react-bootstrap';\nimport { useBreakpoint } from './responsiveHelper';\n\nexport type AdaptiveContainerProps = ContainerProps;\n\nexport const AdaptiveContainer: FC<AdaptiveContainerProps> = memo(function AdaptiveContainer({ children, ...props }) {\n const { isMobile } = useBreakpoint();\n return (\n <Container fluid={isMobile} {...props}>\n {children}\n </Container>\n );\n});\n"],"
|
|
1
|
+
{"version":3,"file":"adaptiveContainer.js","names":[],"sources":["../src/adaptiveContainer.tsx"],"sourcesContent":["import React, { type FC, memo } from 'react';\nimport { Container, type ContainerProps } from 'react-bootstrap';\nimport { useBreakpoint } from './responsiveHelper';\n\nexport type AdaptiveContainerProps = ContainerProps;\n\nexport const AdaptiveContainer: FC<AdaptiveContainerProps> = memo(function AdaptiveContainer({ children, ...props }) {\n const { isMobile } = useBreakpoint();\n return (\n <Container fluid={isMobile} {...props}>\n {children}\n </Container>\n );\n});\n"],"mappings":";;;;;AAMA,IAAa,oBAAgD,KAAK,SAAS,kBAAkB,EAAE,UAAU,GAAG,SAAS;CACjH,MAAM,EAAE,aAAa,cAAc;CACnC,OACI,oBAAC,WAAD;EAAW,OAAO;EAAU,GAAI;EAC3B;CACM,CAAA;AAEnB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { AdaptiveContainer } from './adaptiveContainer';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { AdaptiveContainer } from './adaptiveContainer.js';
|
|
3
3
|
declare const meta: Meta<typeof AdaptiveContainer>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptiveContainer.stories.d.ts","sourceRoot":"","sources":["../src/adaptiveContainer.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"adaptiveContainer.stories.d.ts","sourceRoot":"","sources":["../src/adaptiveContainer.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,iBAAiB,CAWxC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAK3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAsBzB,CAAC"}
|
package/dist/controls.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, HTMLInputTypeAttribute, FC } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type ControlProps = {
|
|
3
3
|
value?: any;
|
|
4
4
|
setValue?: (v: any) => void;
|
|
5
5
|
defaultValue?: any;
|
|
@@ -21,17 +21,17 @@ export interface ControlProps {
|
|
|
21
21
|
className?: string;
|
|
22
22
|
} & any;
|
|
23
23
|
hideValue?: boolean;
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
25
|
export type LabelProps = Pick<ControlProps, 'name' | 'value' | 'defaultValue'> & {
|
|
26
26
|
reset: () => void;
|
|
27
27
|
};
|
|
28
28
|
export declare const Label: FC<LabelProps>;
|
|
29
29
|
export declare const Control: FC<ControlProps>;
|
|
30
|
-
export
|
|
30
|
+
export type RangeProps = {
|
|
31
31
|
min: number;
|
|
32
32
|
max: number;
|
|
33
33
|
step?: number;
|
|
34
|
-
}
|
|
34
|
+
} & ControlProps;
|
|
35
35
|
export declare const Range: FC<RangeProps>;
|
|
36
36
|
export declare const Checkbox: FC<ControlProps>;
|
|
37
37
|
export declare const Select: FC<ControlProps>;
|
package/dist/controls.d.ts.map
CHANGED
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,sBAAsB,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAO1E,MAAM,MAAM,YAAY,GAAG;IACvB,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,CAAC;AAEF,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,MAAM,UAAU,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,YAAY,CAAC;AAEjB,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
CHANGED
|
@@ -1,78 +1,85 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
1
|
import { memo } from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
//#region src/controls.tsx
|
|
5
|
+
var lcFirst = (str) => str[0].toLowerCase() + str.substring(1, str.length);
|
|
6
|
+
var toProperty = (str) => lcFirst(str).split(" ").join("");
|
|
7
|
+
var Label = memo(function Label({ name, reset, value, defaultValue }) {
|
|
8
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
9
|
+
className: "flex-grow-1 mb-0 d-flex align-items-center justify-content-start gap-2",
|
|
10
|
+
children: [name, value !== defaultValue && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("a", {
|
|
11
|
+
href: "javascript: void(0)",
|
|
12
|
+
onClick: reset,
|
|
13
|
+
children: /* @__PURE__ */ jsx("small", { children: "reset" })
|
|
14
|
+
}) })]
|
|
15
|
+
});
|
|
10
16
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
] });
|
|
17
|
+
var Control = memo(function Control({ value = null, setValue, defaultValue = null, options = {}, setOptions, defaultOptions = {}, name, inputProps: { Tag = "input", property = "value", valueExtractor = (e) => e.target.value, ...inputProps } = {}, hideValue = false, children }) {
|
|
18
|
+
const prop = toProperty(name);
|
|
19
|
+
defaultValue = defaultValue || defaultOptions[prop];
|
|
20
|
+
value = value || options?.[prop];
|
|
21
|
+
setValue = setValue || ((v) => setOptions?.({ [prop]: v }));
|
|
22
|
+
const reset = () => setValue(defaultValue);
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
+
className: "d-flex align-items-center gap-2",
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Label, {
|
|
27
|
+
name,
|
|
28
|
+
reset,
|
|
29
|
+
value,
|
|
30
|
+
defaultValue
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ jsx(Tag, {
|
|
33
|
+
...inputProps,
|
|
34
|
+
[property]: value || "",
|
|
35
|
+
className: clsx(value === defaultValue && "opacity-75", inputProps.className) || void 0,
|
|
36
|
+
onChange: (e) => setValue(valueExtractor(e)),
|
|
37
|
+
children
|
|
38
|
+
}),
|
|
39
|
+
!hideValue && /* @__PURE__ */ jsx("span", {
|
|
40
|
+
onDoubleClick: reset,
|
|
41
|
+
className: "text-start",
|
|
42
|
+
style: { width: "20px" },
|
|
43
|
+
children: value
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
});
|
|
42
47
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
...props
|
|
56
|
-
}
|
|
57
|
-
);
|
|
48
|
+
var Range = memo(function Range({ min, max, step = .1, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx(Control, {
|
|
50
|
+
inputProps: {
|
|
51
|
+
type: "range",
|
|
52
|
+
min,
|
|
53
|
+
max,
|
|
54
|
+
step,
|
|
55
|
+
className: "form-control-range",
|
|
56
|
+
valueExtractor: (e) => parseFloat(e.target.value)
|
|
57
|
+
},
|
|
58
|
+
...props
|
|
59
|
+
});
|
|
58
60
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
var Checkbox = memo(function Checkbox(props) {
|
|
62
|
+
return /* @__PURE__ */ jsx(Control, {
|
|
63
|
+
inputProps: {
|
|
64
|
+
type: "checkbox",
|
|
65
|
+
property: "checked",
|
|
66
|
+
valueExtractor: (e) => e.target.checked
|
|
67
|
+
},
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
67
70
|
});
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
var Select = memo(function Select({ children, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx(Control, {
|
|
73
|
+
inputProps: {
|
|
74
|
+
Tag: "select",
|
|
75
|
+
className: "form-select"
|
|
76
|
+
},
|
|
77
|
+
...props,
|
|
78
|
+
hideValue: true,
|
|
79
|
+
children
|
|
80
|
+
});
|
|
70
81
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Range,
|
|
76
|
-
Select
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=controls.js.map
|
|
82
|
+
//#endregion
|
|
83
|
+
export { Checkbox, Control, Label, Range, Select };
|
|
84
|
+
|
|
85
|
+
//# sourceMappingURL=controls.js.map
|
package/dist/controls.js.map
CHANGED
|
@@ -1 +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
|
|
1
|
+
{"version":3,"file":"controls.js","names":[],"sources":["../src/controls.tsx"],"sourcesContent":["import React, { type HTMLInputTypeAttribute, memo, type FC } from 'react';\nimport clsx from 'clsx';\n\nconst lcFirst = (str: string) => str[0].toLowerCase() + str.substring(1, str.length);\n\nconst toProperty = (str: string) => lcFirst(str).split(' ').join('');\n\nexport type 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={clsx(value === defaultValue && 'opacity-75', inputProps.className) || undefined}\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 type RangeProps = {\n min: number;\n max: number;\n step?: number;\n} & ControlProps;\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"],"mappings":";;;;AAGA,IAAM,WAAW,QAAgB,IAAI,EAAE,CAAC,YAAY,IAAI,IAAI,UAAU,GAAG,IAAI,MAAM;AAEnF,IAAM,cAAc,QAAgB,QAAQ,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE;AAsBnE,IAAa,QAAwB,KAAK,SAAS,MAAM,EAAE,MAAM,OAAO,OAAO,gBAAgB;CAC3F,OACI,qBAAC,SAAD;EAAO,WAAU;YAAjB,CACK,MACA,UAAU,gBACP,oBAAA,UAAA,EAAA,UACI,oBAAC,KAAD;GAAG,MAAK;GAAsB,SAAS;aACnC,oBAAC,SAAD,EAAA,UAAO,QAAY,CAAA;EACpB,CAAA,EACL,CAAA,CAEH;;AAEf,CAAC;AAED,IAAa,UAA4B,KAAK,SAAS,QAAQ,EAC3D,QAAQ,MACR,UACA,eAAe,MACf,UAAU,CAAC,GACX,YACA,iBAAiB,CAAC,GAClB,MACA,YAAY,EAAE,MAAM,SAAS,WAAW,SAAS,kBAAkB,MAAW,EAAE,OAAO,OAAO,GAAG,eAAe,CAAC,GACjH,YAAY,OACZ,YACD;CACC,MAAM,OAAO,WAAW,IAAI;CAE5B,eAAe,gBAAgB,eAAe;CAC9C,QAAQ,SAAS,UAAU;CAC3B,WAAW,cAAc,MAAM,aAAa,GAAG,OAAO,EAAE,CAAC;CAEzD,MAAM,cAAc,SAAS,YAAY;CAEzC,OACI,qBAAC,OAAD;EAAK,WAAU;YAAf;GACI,oBAAC,OAAD;IAAa;IAAa;IAAc;IAAqB;GAAe,CAAA;GAC5E,oBAAC,KAAD;IACI,GAAI;KACG,WAAW,SAAS;IAC3B,WAAW,KAAK,UAAU,gBAAgB,cAAc,WAAW,SAAS,KAAK,KAAA;IACjF,WAAW,MAAa,SAAS,eAAe,CAAC,CAAC;IAEjD;GACA,CAAA;GACJ,CAAC,aACE,oBAAC,QAAD;IAAM,eAAe;IAAO,WAAU;IAAa,OAAO,EAAE,OAAO,OAAO;cACrE;GACC,CAAA;EAET;;AAEb,CAAC;AAQD,IAAa,QAAwB,KAAK,SAAS,MAAM,EAAE,KAAK,KAAK,OAAO,IAAK,GAAG,SAAS;CACzF,OACI,oBAAC,SAAD;EACI,YAAY;GACR,MAAM;GACN;GACA;GACA;GACA,WAAW;GACX,iBAAiB,MAAW,WAAW,EAAE,OAAO,KAAK;EACzD;EACA,GAAI;CACP,CAAA;AAET,CAAC;AAED,IAAa,WAA6B,KAAK,SAAS,SAAS,OAAO;CACpE,OACI,oBAAC,SAAD;EACI,YAAY;GAAE,MAAM;GAAY,UAAU;GAAW,iBAAiB,MAAW,EAAE,OAAO;EAAQ;EAClG,GAAI;CACP,CAAA;AAET,CAAC;AAED,IAAa,SAA2B,KAAK,SAAS,OAAO,EAAE,UAAU,GAAG,SAAS;CACjF,OACI,oBAAC,SAAD;EAAS,YAAY;GAAE,KAAK;GAAU,WAAW;EAAc;EAAG,GAAI;EAAO,WAAW;EACnF;CACI,CAAA;AAEjB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Control } from './controls';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Control } from './controls.js';
|
|
3
3
|
declare const meta: Meta<typeof Control>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
@@ -1 +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,
|
|
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,uBAAuB,CAAC;AAG5D,OAAO,EAAU,KAAK,OAAO,EAAmB,MAAM,YAAY,CAAC;AAKnE,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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAElE,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,CAwBzC,CAAC"}
|
package/dist/error.js
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
2
|
import { memo } from "react";
|
|
4
3
|
import { Alert, Button } from "react-bootstrap";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/error.tsx
|
|
6
|
+
var ErrorAlert = memo(function ErrorAlert({ onRetry, children, buttonProps, ...props }) {
|
|
7
|
+
if (!children) return null;
|
|
8
|
+
return /* @__PURE__ */ jsxs(Alert, {
|
|
9
|
+
variant: "danger",
|
|
10
|
+
...props,
|
|
11
|
+
children: [/* @__PURE__ */ jsx("div", { children: children.message || children.toString() }), onRetry && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
|
|
12
|
+
variant: "link",
|
|
13
|
+
className: "alert-link",
|
|
14
|
+
...buttonProps,
|
|
15
|
+
onClick: (e) => {
|
|
16
|
+
e.preventDefault();
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
onRetry();
|
|
19
|
+
},
|
|
20
|
+
children: "Retry"
|
|
21
|
+
}) })]
|
|
22
|
+
});
|
|
24
23
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=error.js.map
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ErrorAlert };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=error.js.map
|
package/dist/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sources":["../src/error.tsx"],"sourcesContent":["'use client';\n\nimport React, { FC, memo } from 'react';\nimport { Alert,
|
|
1
|
+
{"version":3,"file":"error.js","names":[],"sources":["../src/error.tsx"],"sourcesContent":["'use client';\n\nimport React, { type FC, memo } from 'react';\nimport { Alert, Button, type 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> = memo(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"],"mappings":";;;;;AAYA,IAAa,aAAkC,KAAK,SAAS,WAAW,EAAE,SAAS,UAAU,aAAa,GAAG,SAAS;CAClH,IAAI,CAAC,UAAU,OAAO;CAEtB,OACI,qBAAC,OAAD;EAAO,SAAQ;EAAS,GAAI;YAA5B,CACI,oBAAC,OAAD,EAAA,UAAM,SAAS,WAAW,SAAS,SAAS,EAAO,CAAA,GAClD,WACG,oBAAC,OAAD,EAAA,UACI,oBAAC,QAAD;GACI,SAAQ;GACR,WAAU;GACV,GAAI;GACJ,UAAU,MAAM;IACZ,EAAE,eAAe;IACjB,EAAE,gBAAgB;IAClB,QAAQ;GACZ;aACH;EAEO,CAAA,EACP,CAAA,CAEN;;AAEf,CAAC"}
|
package/dist/error.stories.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { ErrorAlert } from './error';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ErrorAlert } from './error.js';
|
|
3
3
|
declare const meta: Meta<typeof ErrorAlert>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
@@ -1 +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,
|
|
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,uBAAuB,CAAC;AAG5D,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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../src/field.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../src/field.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAQ,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErG,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,CA0BzC,CAAC"}
|
package/dist/field.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
1
|
import { memo } from "react";
|
|
3
2
|
import { Form } from "react-bootstrap";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/field.tsx
|
|
5
|
+
var FieldGroup = memo(function FieldGroup({ label, labelProps = {}, text, textProps = {}, horizontal, children, ...props }) {
|
|
6
|
+
if (horizontal) {
|
|
7
|
+
props.className = "hstack gap-3 " + (props.className || "");
|
|
8
|
+
labelProps.className = "m-0 " + (labelProps.className || "");
|
|
9
|
+
}
|
|
10
|
+
if (text && horizontal) throw new Error("Cannot use text and horizontal together");
|
|
11
|
+
return /* @__PURE__ */ jsxs(Form.Group, {
|
|
12
|
+
...props,
|
|
13
|
+
children: [
|
|
14
|
+
label && /* @__PURE__ */ jsx(Form.Label, {
|
|
15
|
+
...labelProps,
|
|
16
|
+
children: label
|
|
17
|
+
}),
|
|
18
|
+
children,
|
|
19
|
+
text && !horizontal && /* @__PURE__ */ jsx(Form.Text, {
|
|
20
|
+
...textProps,
|
|
21
|
+
children: text
|
|
22
|
+
}),
|
|
23
|
+
" "
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
26
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=field.js.map
|
|
27
|
+
//#endregion
|
|
28
|
+
export { FieldGroup };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=field.js.map
|
package/dist/field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sources":["../src/field.tsx"],"sourcesContent":["import React, { FC, memo } 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> = memo(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"],"
|
|
1
|
+
{"version":3,"file":"field.js","names":[],"sources":["../src/field.tsx"],"sourcesContent":["import React, { type FC, memo } from 'react';\nimport { Form, type FormGroupProps, type FormLabelProps, type 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> = memo(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 // eslint-disable-next-line react-hooks/immutability\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"],"mappings":";;;;AAWA,IAAa,aAAkC,KAAK,SAAS,WAAW,EACpE,OACA,aAAa,CAAC,GACd,MACA,YAAY,CAAC,GACb,YACA,UACA,GAAG,SACJ;CACC,IAAI,YAAY;EACZ,MAAM,YAAY,mBAAmB,MAAM,aAAa;EAExD,WAAW,YAAY,UAAU,WAAW,aAAa;CAC7D;CAEA,IAAI,QAAQ,YACR,MAAM,IAAI,MAAM,yCAAyC;CAG7D,OACI,qBAAC,KAAK,OAAN;EAAY,GAAI;YAAhB;GACK,SAAS,oBAAC,KAAK,OAAN;IAAY,GAAI;cAAa;GAAkB,CAAA;GACxD;GACA,QAAQ,CAAC,cAAc,oBAAC,KAAK,MAAN;IAAW,GAAI;cAAY;GAAgB,CAAA;GAAG;EAC9D;;AAEpB,CAAC"}
|
package/dist/field.stories.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { FieldGroup } from './field';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { FieldGroup } from './field.js';
|
|
3
3
|
declare const meta: Meta<typeof FieldGroup>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
@@ -1 +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,
|
|
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,uBAAuB,CAAC;AAG5D,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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../src/footer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../src/footer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAK7C,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,CAgC/C,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG;IACtB,QAAQ,EAAE,GAAG,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CAcjC,CAAC"}
|
package/dist/footer.js
CHANGED
|
@@ -1,46 +1,45 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from "react";
|
|
3
|
-
import { Nav, Navbar } from "react-bootstrap";
|
|
4
1
|
import { useBreakpoint } from "./responsiveHelper.js";
|
|
5
2
|
import { AdaptiveContainer } from "./adaptiveContainer.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
return /* @__PURE__ */ jsx(Nav.Item, { style: { flex: 1 }, children: link });
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { Nav, Navbar } from "react-bootstrap";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/footer.tsx
|
|
7
|
+
var FooterNavItem = memo(function FooterNavItem({ href, icon, active = false, children = "" }) {
|
|
8
|
+
const isFilepath = icon.includes(".");
|
|
9
|
+
let iconElement;
|
|
10
|
+
if (isFilepath) iconElement = /* @__PURE__ */ jsx("img", {
|
|
11
|
+
src: icon,
|
|
12
|
+
alt: "icon",
|
|
13
|
+
className: "me-lg-2"
|
|
14
|
+
});
|
|
15
|
+
else iconElement = /* @__PURE__ */ jsx("span", { className: `lead me-lg-2 ${icon}` });
|
|
16
|
+
const link = /* @__PURE__ */ jsxs(Nav.Link, {
|
|
17
|
+
href,
|
|
18
|
+
className: `px-0 px-lg-3 d-flex align-items-center flex-column flex-lg-row ${active ? "text-primary" : ""}`,
|
|
19
|
+
children: [iconElement, children]
|
|
20
|
+
});
|
|
21
|
+
return /* @__PURE__ */ jsx(Nav.Item, {
|
|
22
|
+
style: { flex: 1 },
|
|
23
|
+
children: link
|
|
24
|
+
});
|
|
31
25
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
var Footer = memo(function Footer({ children }) {
|
|
27
|
+
const { isDesktop } = useBreakpoint();
|
|
28
|
+
return /* @__PURE__ */ jsx("div", {
|
|
29
|
+
className: isDesktop ? "" : "border-top",
|
|
30
|
+
children: /* @__PURE__ */ jsx(Navbar, {
|
|
31
|
+
className: isDesktop ? "" : "py-0",
|
|
32
|
+
children: /* @__PURE__ */ jsxs(AdaptiveContainer, { children: [isDesktop && /* @__PURE__ */ jsx(Navbar.Brand, {
|
|
33
|
+
href: "/",
|
|
34
|
+
children: "Le Brand"
|
|
35
|
+
}), /* @__PURE__ */ jsx(Nav, {
|
|
36
|
+
className: isDesktop ? "me-auto" : "justify-content-center flex-nowrap w-100",
|
|
37
|
+
children
|
|
38
|
+
})] })
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
41
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=footer.js.map
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Footer, FooterNavItem };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=footer.js.map
|
package/dist/footer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.js","sources":["../src/footer.tsx"],"sourcesContent":["import React, { FC, memo } 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> = memo(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 type FooterProps = {\n children: any;\n};\n\nexport const Footer: FC<FooterProps> = memo(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"],"
|
|
1
|
+
{"version":3,"file":"footer.js","names":[],"sources":["../src/footer.tsx"],"sourcesContent":["import React, { type FC, memo } 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> = memo(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 type FooterProps = {\n children: any;\n};\n\nexport const Footer: FC<FooterProps> = memo(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"],"mappings":";;;;;;AAYA,IAAa,gBAAwC,KAAK,SAAS,cAAc,EAC7E,MACA,MACA,SAAS,OACT,WAAW,MACZ;CAGC,MAAM,aAAa,KAAK,SAAS,GAAG;CACpC,IAAI;CAEJ,IAAI,YACA,cAAc,oBAAC,OAAD;EAAK,KAAK;EAAM,KAAI;EAAO,WAAU;CAAW,CAAA;MAE9D,cAAc,oBAAC,QAAD,EAAM,WAAW,gBAAgB,OAAS,CAAA;CAK5D,MAAM,OACF,qBAAC,IAAI,MAAL;EAEU;EAEN,WAAW,kEAAkE,SAAS,iBAAiB;YAJ3G,CAMK,aACA,QACK;;CAGd,OAAO,oBAAC,IAAI,MAAL;EAAU,OAAO,EAAE,MAAM,EAAE;YAAI;CAAe,CAAA;AACzD,CAAC;AAMD,IAAa,SAA0B,KAAK,SAAS,OAAO,EAAE,YAAY;CACtE,MAAM,EAAE,cAAc,cAAc;CAEpC,OAEI,oBAAC,OAAD;EAAK,WAAW,YAAY,KAAK;YAC7B,oBAAC,QAAD;GAAQ,WAAW,YAAY,KAAK;aAChC,qBAAC,mBAAD,EAAA,UAAA,CACK,aAAa,oBAAC,OAAO,OAAR;IAAc,MAAK;cAAI;GAAsB,CAAA,GAC3D,oBAAC,KAAD;IAAK,WAAW,YAAY,YAAY;IAA6C;GAAc,CAAA,CACpF,EAAA,CAAA;EACf,CAAA;CACP,CAAA;AAEb,CAAC"}
|