@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.
Files changed (96) hide show
  1. package/dist/adaptiveContainer.d.ts.map +1 -1
  2. package/dist/adaptiveContainer.js +14 -9
  3. package/dist/adaptiveContainer.js.map +1 -1
  4. package/dist/adaptiveContainer.stories.d.ts +2 -2
  5. package/dist/adaptiveContainer.stories.d.ts.map +1 -1
  6. package/dist/controls.d.ts +4 -4
  7. package/dist/controls.d.ts.map +1 -1
  8. package/dist/controls.js +79 -72
  9. package/dist/controls.js.map +1 -1
  10. package/dist/controls.stories.d.ts +2 -2
  11. package/dist/controls.stories.d.ts.map +1 -1
  12. package/dist/error.d.ts.map +1 -1
  13. package/dist/error.js +23 -24
  14. package/dist/error.js.map +1 -1
  15. package/dist/error.stories.d.ts +2 -2
  16. package/dist/error.stories.d.ts.map +1 -1
  17. package/dist/field.d.ts.map +1 -1
  18. package/dist/field.js +27 -27
  19. package/dist/field.js.map +1 -1
  20. package/dist/field.stories.d.ts +2 -2
  21. package/dist/field.stories.d.ts.map +1 -1
  22. package/dist/footer.d.ts.map +1 -1
  23. package/dist/footer.js +41 -42
  24. package/dist/footer.js.map +1 -1
  25. package/dist/footer.stories.d.ts +2 -2
  26. package/dist/footer.stories.d.ts.map +1 -1
  27. package/dist/globalLoading.d.ts.map +1 -1
  28. package/dist/globalLoading.js +13 -9
  29. package/dist/globalLoading.js.map +1 -1
  30. package/dist/globalLoading.stories.d.ts +2 -2
  31. package/dist/globalLoading.stories.d.ts.map +1 -1
  32. package/dist/index.d.ts +12 -12
  33. package/dist/index.js +3 -25
  34. package/dist/loading.d.ts.map +1 -1
  35. package/dist/loading.js +19 -17
  36. package/dist/loading.js.map +1 -1
  37. package/dist/loading.stories.d.ts +2 -2
  38. package/dist/loading.stories.d.ts.map +1 -1
  39. package/dist/responsiveHelper.d.ts.map +1 -1
  40. package/dist/responsiveHelper.js +69 -42
  41. package/dist/responsiveHelper.js.map +1 -1
  42. package/dist/responsiveHelper.stories.d.ts +2 -2
  43. package/dist/responsiveHelper.stories.d.ts.map +1 -1
  44. package/dist/screen.d.ts.map +1 -1
  45. package/dist/screen.js +84 -77
  46. package/dist/screen.js.map +1 -1
  47. package/dist/screen.stories.d.ts +2 -2
  48. package/dist/screen.stories.d.ts.map +1 -1
  49. package/dist/toaster.d.ts.map +1 -1
  50. package/dist/toaster.js +29 -30
  51. package/dist/toaster.js.map +1 -1
  52. package/dist/toaster.stories.d.ts +2 -2
  53. package/dist/toaster.stories.d.ts.map +1 -1
  54. package/dist/useModal.d.ts.map +1 -1
  55. package/dist/useModal.js +58 -47
  56. package/dist/useModal.js.map +1 -1
  57. package/dist/useModal.stories.d.ts +2 -2
  58. package/dist/useModal.stories.d.ts.map +1 -1
  59. package/dist/useWrappedForm.d.ts.map +1 -1
  60. package/dist/useWrappedForm.js +40 -29
  61. package/dist/useWrappedForm.js.map +1 -1
  62. package/package.json +17 -5
  63. package/.ctirc +0 -20
  64. package/.storybook/main.ts +0 -2
  65. package/.storybook/preview.ts +0 -2
  66. package/.turbo/turbo-build.log +0 -31
  67. package/CHANGELOG.md +0 -8
  68. package/dist/index.js.map +0 -1
  69. package/src/adaptiveContainer.stories.tsx +0 -59
  70. package/src/adaptiveContainer.tsx +0 -14
  71. package/src/controls.stories.tsx +0 -62
  72. package/src/controls.tsx +0 -119
  73. package/src/error.stories.tsx +0 -34
  74. package/src/error.tsx +0 -37
  75. package/src/field.stories.tsx +0 -42
  76. package/src/field.tsx +0 -37
  77. package/src/footer.stories.tsx +0 -121
  78. package/src/footer.tsx +0 -65
  79. package/src/globalLoading.stories.tsx +0 -25
  80. package/src/globalLoading.tsx +0 -19
  81. package/src/index.ts +0 -12
  82. package/src/loading.stories.tsx +0 -35
  83. package/src/loading.tsx +0 -24
  84. package/src/main.scss +0 -86
  85. package/src/responsiveHelper.stories.tsx +0 -109
  86. package/src/responsiveHelper.tsx +0 -55
  87. package/src/screen.stories.tsx +0 -160
  88. package/src/screen.tsx +0 -146
  89. package/src/toaster.stories.tsx +0 -32
  90. package/src/toaster.tsx +0 -40
  91. package/src/useModal.stories.tsx +0 -51
  92. package/src/useModal.tsx +0 -93
  93. package/src/useWrappedForm.ts +0 -42
  94. package/tsconfig.json +0 -10
  95. package/turbo.json +0 -10
  96. 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;AACxC,OAAO,EAAa,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG5D,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAEpD,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAOvD,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 { jsx } from "react/jsx-runtime";
1
+ import { useBreakpoint } from "./responsiveHelper.js";
2
2
  import { memo } from "react";
3
3
  import { Container } from "react-bootstrap";
4
- import { useBreakpoint } from "./responsiveHelper.js";
5
- const AdaptiveContainer = memo(function AdaptiveContainer2({ children, ...props }) {
6
- const { isMobile } = useBreakpoint();
7
- return /* @__PURE__ */ jsx(Container, { fluid: isMobile, ...props, children });
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
- export {
10
- AdaptiveContainer
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"],"names":["AdaptiveContainer"],"mappings":";;;;AAMO,MAAM,oBAAgD,KAAK,SAASA,mBAAkB,EAAE,UAAU,GAAG,SAAS;AACjH,QAAM,EAAE,SAAA,IAAa,cAAA;AACrB,6BACK,WAAA,EAAU,OAAO,UAAW,GAAG,OAC3B,UACL;AAER,CAAC;"}
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,kBAAkB,CAAC;AAEvD,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"}
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"}
@@ -1,5 +1,5 @@
1
1
  import { default as React, HTMLInputTypeAttribute, FC } from 'react';
2
- export interface ControlProps {
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 interface RangeProps extends ControlProps {
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>;
@@ -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;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;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AAM,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
- 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
- ] });
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
- 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
- ] });
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
- 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
- );
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
- 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
- );
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
- const Select = memo(function Select2({ children, ...props }) {
69
- return /* @__PURE__ */ jsx(Control, { inputProps: { Tag: "select", className: "form-select" }, ...props, hideValue: true, children });
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
- export {
72
- Checkbox,
73
- Control,
74
- Label,
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
@@ -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 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,IAA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AAW,cAAA,GAAkB,GAAG,OAAO,WAAW,MACnF,SAAA,CACL;AAER,CAAC;"}
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,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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,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"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;AACxC,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,CAwBzC,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
- const ErrorAlert = memo(function ErrorAlert2({ onRetry, children, buttonProps, ...props }) {
6
- if (!children) return null;
7
- return /* @__PURE__ */ jsxs(Alert, { variant: "danger", ...props, children: [
8
- /* @__PURE__ */ jsx("div", { children: children.message || children.toString() }),
9
- onRetry && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
10
- Button,
11
- {
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
- ) })
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
- export {
26
- ErrorAlert
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, 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> = 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"],"names":["ErrorAlert"],"mappings":";;;;AAYO,MAAM,aAAkC,KAAK,SAASA,YAAW,EAAE,SAAS,UAAU,aAAa,GAAG,SAAS;AAClH,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,CAAC;"}
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"}
@@ -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,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"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../src/field.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;AACxC,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,CAyBzC,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
- const FieldGroup = memo(function FieldGroup2({
5
- label,
6
- labelProps = {},
7
- text,
8
- textProps = {},
9
- horizontal,
10
- children,
11
- ...props
12
- }) {
13
- if (horizontal) {
14
- props.className = "hstack gap-3 " + (props.className || "");
15
- labelProps.className = "m-0 " + (labelProps.className || "");
16
- }
17
- if (text && horizontal) {
18
- throw new Error("Cannot use text and horizontal together");
19
- }
20
- return /* @__PURE__ */ jsxs(Form.Group, { ...props, children: [
21
- label && /* @__PURE__ */ jsx(Form.Label, { ...labelProps, children: label }),
22
- children,
23
- text && !horizontal && /* @__PURE__ */ jsx(Form.Text, { ...textProps, children: text }),
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
- export {
28
- FieldGroup
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"],"names":["FieldGroup"],"mappings":";;;AAWO,MAAM,aAAkC,KAAK,SAASA,YAAW;AAAA,EACpE;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,CAAC;"}
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"}
@@ -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,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"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../src/footer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;AAKxC,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"}
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
- const FooterNavItem = memo(function FooterNavItem2({
7
- href,
8
- icon,
9
- active = false,
10
- children = ""
11
- }) {
12
- const isFilepath = icon.includes(".");
13
- let iconElement;
14
- if (isFilepath) {
15
- iconElement = /* @__PURE__ */ jsx("img", { src: icon, alt: "icon", className: "me-lg-2" });
16
- } else {
17
- iconElement = /* @__PURE__ */ jsx("span", { className: `lead me-lg-2 ${icon}` });
18
- }
19
- const link = /* @__PURE__ */ jsxs(
20
- Nav.Link,
21
- {
22
- href,
23
- className: `px-0 px-lg-3 d-flex align-items-center flex-column flex-lg-row ${active ? "text-primary" : ""}`,
24
- children: [
25
- iconElement,
26
- children
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
- const Footer = memo(function Footer2({ children }) {
33
- const { isDesktop } = useBreakpoint();
34
- return (
35
- // border-bottom
36
- /* @__PURE__ */ jsx("div", { className: isDesktop ? "" : "border-top", children: /* @__PURE__ */ jsx(Navbar, { className: isDesktop ? "" : "py-0", children: /* @__PURE__ */ jsxs(AdaptiveContainer, { children: [
37
- isDesktop && /* @__PURE__ */ jsx(Navbar.Brand, { href: "/", children: "Le Brand" }),
38
- /* @__PURE__ */ jsx(Nav, { className: isDesktop ? "me-auto" : "justify-content-center flex-nowrap w-100", children })
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
- export {
43
- Footer,
44
- FooterNavItem
45
- };
46
- //# sourceMappingURL=footer.js.map
42
+ //#endregion
43
+ export { Footer, FooterNavItem };
44
+
45
+ //# sourceMappingURL=footer.js.map
@@ -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"],"names":["FooterNavItem","Footer"],"mappings":";;;;;AAYO,MAAM,gBAAwC,KAAK,SAASA,eAAc;AAAA,EAC7E;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,CAAC;AAMM,MAAM,SAA0B,KAAK,SAASC,QAAO,EAAE,YAAY;AACtE,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,CAAC;"}
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"}