@oneplatformdev/ui 0.1.99-beta.52 → 0.1.99-beta.55
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/CHANGELOG.md +8 -0
- package/Form/FormRenderControl.d.ts +1 -1
- package/Form/FormRenderControl.d.ts.map +1 -1
- package/Form/FormRenderControl.js +46 -24
- package/Form/FormRenderControl.js.map +1 -1
- package/Form/FormRenderControl.types.d.ts +2 -0
- package/Form/FormRenderControl.types.d.ts.map +1 -1
- package/FormCombobox/FormCombobox.d.ts.map +1 -1
- package/FormCombobox/FormCombobox.js +15 -13
- package/FormCombobox/FormCombobox.js.map +1 -1
- package/FormDatePicker/FormDatePicker.d.ts.map +1 -1
- package/FormDatePicker/FormDatePicker.js +18 -16
- package/FormDatePicker/FormDatePicker.js.map +1 -1
- package/FormDropzone/FormDropzone.d.ts.map +1 -1
- package/FormDropzone/FormDropzone.js +11 -9
- package/FormDropzone/FormDropzone.js.map +1 -1
- package/FormInput/FormInput.d.ts.map +1 -1
- package/FormInput/FormInput.js +23 -22
- package/FormInput/FormInput.js.map +1 -1
- package/FormSelect/FormSelect.d.ts.map +1 -1
- package/FormSelect/FormSelect.js +21 -17
- package/FormSelect/FormSelect.js.map +1 -1
- package/FormTextarea/FormTextarea.d.ts.map +1 -1
- package/FormTextarea/FormTextarea.js +15 -13
- package/FormTextarea/FormTextarea.js.map +1 -1
- package/Tooltip/Tooltip.d.ts.map +1 -1
- package/Tooltip/Tooltip.js +41 -29
- package/Tooltip/Tooltip.js.map +1 -1
- package/Tooltip/Tooltip.types.d.ts +1 -0
- package/Tooltip/Tooltip.types.d.ts.map +1 -1
- package/Tooltip/tooltipVariants.d.ts +4 -0
- package/Tooltip/tooltipVariants.d.ts.map +1 -0
- package/Tooltip/tooltipVariants.js +23 -0
- package/Tooltip/tooltipVariants.js.map +1 -0
- package/package.json +4 -4
- package/Form/FormTooltipButton.d.ts +0 -6
- package/Form/FormTooltipButton.d.ts.map +0 -1
- package/Form/FormTooltipButton.js +0 -34
- package/Form/FormTooltipButton.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.1.99-beta.53 (2026-01-15)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated @oneplatformdev/utils to 0.1.99-beta.53
|
|
6
|
+
- Updated @oneplatformdev/hooks to 0.1.99-beta.53
|
|
7
|
+
- Updated @oneplatformdev/tokens to 0.1.99-beta.53
|
|
8
|
+
|
|
1
9
|
## 0.1.99-beta.52 (2026-01-14)
|
|
2
10
|
|
|
3
11
|
### 🧱 Updated Dependencies
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormRenderControlProps } from './FormRenderControl.types';
|
|
2
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { FormRenderControlProps } from './FormRenderControl.types';
|
|
3
3
|
export declare const FormRenderControl: <Data extends FieldValues = FieldValues>(props: FormRenderControlProps<Data>) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=FormRenderControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormRenderControl.d.ts","sourceRoot":"","sources":["../../src/Form/FormRenderControl.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormRenderControl.d.ts","sourceRoot":"","sources":["../../src/Form/FormRenderControl.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AA+BnE,eAAO,MAAM,iBAAiB,GAC5B,IAAI,SAAS,WAAW,GAAG,WAAW,EAEtC,OAAO,sBAAsB,CAAC,IAAI,CAAC,4CA+CpC,CAAC"}
|
|
@@ -1,35 +1,57 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { FormField as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { FormField as d, FormItem as u, FormMessage as F, FormLabel as f } from "./Form.js";
|
|
3
|
+
import "@radix-ui/react-tooltip";
|
|
4
|
+
import "@oneplatformdev/utils";
|
|
5
|
+
import { Tooltip as h } from "../Tooltip/Tooltip.js";
|
|
6
|
+
const b = (n) => {
|
|
7
|
+
const { label: r, tooltip: t, tooltipProps: i } = n, e = /* @__PURE__ */ o(f, { children: r });
|
|
8
|
+
return r ? t ? /* @__PURE__ */ o(
|
|
9
|
+
h,
|
|
9
10
|
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
message: t,
|
|
12
|
+
showQuestionMark: !0,
|
|
13
|
+
questionIconSize: "xs",
|
|
14
|
+
contentProps: {
|
|
15
|
+
side: "right",
|
|
16
|
+
align: "center"
|
|
17
|
+
},
|
|
18
|
+
...i,
|
|
19
|
+
children: e
|
|
20
|
+
}
|
|
21
|
+
) : e : null;
|
|
22
|
+
}, L = (n) => {
|
|
23
|
+
const {
|
|
24
|
+
form: r,
|
|
25
|
+
name: t,
|
|
26
|
+
label: i,
|
|
27
|
+
tooltip: e,
|
|
28
|
+
tooltipProps: l,
|
|
29
|
+
render: s,
|
|
30
|
+
containerProps: m = {},
|
|
31
|
+
...p
|
|
32
|
+
} = n;
|
|
33
|
+
return /* @__PURE__ */ o(
|
|
34
|
+
d,
|
|
35
|
+
{
|
|
36
|
+
control: r.control,
|
|
37
|
+
name: t,
|
|
38
|
+
render: (c) => /* @__PURE__ */ a(u, { ...m, children: [
|
|
39
|
+
/* @__PURE__ */ o(
|
|
40
|
+
b,
|
|
15
41
|
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
children: [
|
|
20
|
-
o && /* @__PURE__ */ r("span", { children: o }),
|
|
21
|
-
e && /* @__PURE__ */ r(h, { content: e })
|
|
22
|
-
]
|
|
42
|
+
label: i,
|
|
43
|
+
tooltip: e,
|
|
44
|
+
tooltipProps: l
|
|
23
45
|
}
|
|
24
46
|
),
|
|
25
|
-
s(
|
|
26
|
-
/* @__PURE__ */
|
|
47
|
+
s(c),
|
|
48
|
+
/* @__PURE__ */ o(F, {})
|
|
27
49
|
] }),
|
|
28
|
-
...
|
|
50
|
+
...p
|
|
29
51
|
}
|
|
30
52
|
);
|
|
31
53
|
};
|
|
32
54
|
export {
|
|
33
|
-
|
|
55
|
+
L as FormRenderControl
|
|
34
56
|
};
|
|
35
57
|
//# sourceMappingURL=FormRenderControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormRenderControl.js","sources":["../../src/Form/FormRenderControl.tsx"],"sourcesContent":["import { FormField, FormItem, FormLabel, FormMessage } from \"./Form\";\nimport { FormRenderControlProps } from \"./FormRenderControl.types\";\nimport {
|
|
1
|
+
{"version":3,"file":"FormRenderControl.js","sources":["../../src/Form/FormRenderControl.tsx"],"sourcesContent":["import { FieldValues } from \"react-hook-form\";\n\nimport { cn } from \"@oneplatformdev/utils\";\n\nimport { FormField, FormItem, FormLabel, FormMessage } from \"./Form\";\nimport { FormRenderControlProps } from \"./FormRenderControl.types\";\nimport { Tooltip } from \"../Tooltip\";\n\ninterface IFormLabelWithTooltipProps<\n Data extends FieldValues = FieldValues,\n> extends Pick<FormRenderControlProps<Data>, 'label' | 'tooltip' | 'tooltipProps'> {\n}\n\nconst FormLabelWithTooltip = <\n Data extends FieldValues = FieldValues,\n>(props: IFormLabelWithTooltipProps<Data>) => {\n const { label, tooltip, tooltipProps } = props;\n const cmp = <FormLabel>{label}</FormLabel>;\n if(!label) return null;\n if(!tooltip) return cmp;\n return (\n <Tooltip\n message={tooltip}\n showQuestionMark\n questionIconSize=\"xs\"\n contentProps={{\n side: \"right\",\n align: \"center\"\n }}\n {...tooltipProps}\n >\n {cmp}\n </Tooltip>\n )\n}\n\nexport const FormRenderControl = <\n Data extends FieldValues = FieldValues,\n>(\n props: FormRenderControlProps<Data>\n) => {\n const {\n form,\n name,\n label,\n tooltip,\n tooltipProps,\n render,\n containerProps = {},\n ...rest\n } = props;\n return (\n <FormField\n control={form.control}\n name={name}\n render={(params) => (\n <FormItem {...containerProps}>\n <FormLabelWithTooltip\n label={label}\n tooltip={tooltip}\n tooltipProps={tooltipProps}\n />\n {/*{(label || tooltip) && (*/}\n {/* <FormLabel className={cn(\"flex items-center gap-1\")}>*/}\n {/* {label && <span>{label}</span>}*/}\n {/* {tooltip && (*/}\n {/* <Tooltip*/}\n {/* message={tooltip}*/}\n {/* showQuestionMark*/}\n {/* questionIconSize=\"xs\"*/}\n {/* contentProps={{*/}\n {/* side: \"right\",*/}\n {/* align: \"center\"*/}\n {/* }}*/}\n {/* {...props.tooltipProps}*/}\n {/* />*/}\n {/* )}*/}\n {/* </FormLabel>*/}\n {/*)}*/}\n {render(params)}\n <FormMessage/>\n </FormItem>\n )}\n {...rest}\n />\n );\n};\n"],"names":["FormLabelWithTooltip","props","label","tooltip","tooltipProps","cmp","jsx","FormLabel","Tooltip","FormRenderControl","form","name","render","containerProps","rest","FormField","params","jsxs","FormItem","FormMessage"],"mappings":";;;;;AAaA,MAAMA,IAAuB,CAE3BC,MAA4C;AAC5C,QAAM,EAAE,OAAAC,GAAO,SAAAC,GAAS,cAAAC,EAAA,IAAiBH,GACnCI,IAAM,gBAAAC,EAACC,GAAA,EAAW,UAAAL,EAAA,CAAM;AAC9B,SAAIA,IACAC,IAEF,gBAAAG;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,SAASL;AAAA,MACT,kBAAgB;AAAA,MAChB,kBAAiB;AAAA,MACjB,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,MAER,GAAGC;AAAA,MAEH,UAAAC;AAAA,IAAA;AAAA,EAAA,IAZeA,IADF;AAgBpB,GAEaI,IAAoB,CAG/BR,MACG;AACH,QAAM;AAAA,IACJ,MAAAS;AAAA,IACA,MAAAC;AAAA,IACA,OAAAT;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,QAAAQ;AAAA,IACA,gBAAAC,IAAiB,CAAA;AAAA,IACjB,GAAGC;AAAA,EAAA,IACDb;AACJ,SACE,gBAAAK;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,SAASL,EAAK;AAAA,MACd,MAAAC;AAAA,MACA,QAAQ,CAACK,MACP,gBAAAC,EAACC,GAAA,EAAU,GAAGL,GACZ,UAAA;AAAA,QAAA,gBAAAP;AAAA,UAACN;AAAA,UAAA;AAAA,YACC,OAAAE;AAAA,YACA,SAAAC;AAAA,YACA,cAAAC;AAAA,UAAA;AAAA,QAAA;AAAA,QAmBDQ,EAAOI,CAAM;AAAA,0BACbG,GAAA,CAAA,CAAW;AAAA,MAAA,GACd;AAAA,MAED,GAAGL;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { ControllerFieldState, ControllerRenderProps, FieldPath, FieldValues, UseFormReturn, UseFormStateReturn } from 'react-hook-form';
|
|
3
|
+
import { TooltipProps } from '../Tooltip';
|
|
3
4
|
export type FormRenderProps<Data extends FieldValues> = ({ field, fieldState, formState, }: {
|
|
4
5
|
field: ControllerRenderProps<Data, FieldPath<Data>>;
|
|
5
6
|
fieldState: ControllerFieldState;
|
|
@@ -10,6 +11,7 @@ export interface FormRenderControlProps<Data extends FieldValues = FieldValues>
|
|
|
10
11
|
name: FieldPath<Data>;
|
|
11
12
|
label?: string;
|
|
12
13
|
tooltip?: ReactNode;
|
|
14
|
+
tooltipProps?: Omit<TooltipProps, "message">;
|
|
13
15
|
render: FormRenderProps<Data>;
|
|
14
16
|
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
15
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormRenderControl.types.d.ts","sourceRoot":"","sources":["../../src/Form/FormRenderControl.types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,SAAS,EACT,WAAW,EACX,aAAa,EACb,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"FormRenderControl.types.d.ts","sourceRoot":"","sources":["../../src/Form/FormRenderControl.types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,SAAS,EACT,WAAW,EACX,aAAa,EACb,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,MAAM,eAAe,CAAC,IAAI,SAAS,WAAW,IAAI,CAAC,EACvD,KAAK,EACL,UAAU,EACV,SAAS,GACV,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACpD,UAAU,EAAE,oBAAoB,CAAC;IACjC,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;CACrC,KAAK,YAAY,CAAC;AAEnB,MAAM,WAAW,sBAAsB,CACrC,IAAI,SAAS,WAAW,GAAG,WAAW;IAEtC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1B,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,YAAY,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAC7C,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAC9B,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,MAAM,MAAM,4BAA4B,CACtC,IAAI,SAAS,WAAW,GAAG,WAAW,IACpC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormCombobox.d.ts","sourceRoot":"","sources":["../../src/FormCombobox/FormCombobox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,eAAO,MAAM,YAAY,GAAI,IAAI,SAAS,WAAW,EACnD,OAAO,iBAAiB,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"FormCombobox.d.ts","sourceRoot":"","sources":["../../src/FormCombobox/FormCombobox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,eAAO,MAAM,YAAY,GAAI,IAAI,SAAS,WAAW,EACnD,OAAO,iBAAiB,CAAC,IAAI,CAAC,4CAqB/B,CAAC"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { FormControl as
|
|
3
|
-
import { FormRenderControl as
|
|
4
|
-
import { Combobox as
|
|
5
|
-
const
|
|
6
|
-
const { form:
|
|
2
|
+
import { FormControl as C } from "../Form/Form.js";
|
|
3
|
+
import { FormRenderControl as b } from "../Form/FormRenderControl.js";
|
|
4
|
+
import { Combobox as s } from "../Combobox/Combobox.js";
|
|
5
|
+
const h = (m) => {
|
|
6
|
+
const { form: t, label: n, tooltip: e, tooltipProps: p, name: i, ...l } = m;
|
|
7
7
|
return /* @__PURE__ */ o(
|
|
8
|
-
|
|
8
|
+
b,
|
|
9
9
|
{
|
|
10
|
-
form:
|
|
11
|
-
label:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
form: t,
|
|
11
|
+
label: n,
|
|
12
|
+
tooltip: e,
|
|
13
|
+
tooltipProps: p,
|
|
14
|
+
name: i,
|
|
15
|
+
render: ({ field: r }) => /* @__PURE__ */ o(C, { children: /* @__PURE__ */ o(
|
|
16
|
+
s,
|
|
15
17
|
{
|
|
16
|
-
...
|
|
18
|
+
...l,
|
|
17
19
|
...r,
|
|
18
20
|
onChange: r.onChange
|
|
19
21
|
}
|
|
@@ -22,6 +24,6 @@ const x = (m) => {
|
|
|
22
24
|
);
|
|
23
25
|
};
|
|
24
26
|
export {
|
|
25
|
-
|
|
27
|
+
h as FormCombobox
|
|
26
28
|
};
|
|
27
29
|
//# sourceMappingURL=FormCombobox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormCombobox.js","sources":["../../src/FormCombobox/FormCombobox.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Combobox } from '../Combobox';\nimport { FormComboboxProps } from './FormCombobox.types';\nimport { FieldValues } from 'react-hook-form';\n\n// TODO: add description\nexport const FormCombobox = <Data extends FieldValues>(\n props: FormComboboxProps<Data>\n) => {\n const { form, label, name, ...rest } = props;\n return (\n <FormRenderControl\n form={form}\n label={label}\n name={name}\n render={({ field }) => (\n <FormControl>\n <Combobox\n {...rest}\n {...field}\n onChange={field.onChange}\n />\n </FormControl>\n )}\n />\n );\n};\n"],"names":["FormCombobox","props","form","label","name","rest","jsx","FormRenderControl","field","FormControl","Combobox"],"mappings":";;;;AAMO,MAAMA,IAAe,CAC1BC,MACG;AACH,QAAM,EAAE,MAAAC,GAAM,OAAAC,GAAO,MAAAC,GAAM,GAAGC,
|
|
1
|
+
{"version":3,"file":"FormCombobox.js","sources":["../../src/FormCombobox/FormCombobox.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Combobox } from '../Combobox';\nimport { FormComboboxProps } from './FormCombobox.types';\nimport { FieldValues } from 'react-hook-form';\n\n// TODO: add description\nexport const FormCombobox = <Data extends FieldValues>(\n props: FormComboboxProps<Data>\n) => {\n const { form, label, tooltip, tooltipProps, name, ...rest } = props;\n return (\n <FormRenderControl\n form={form}\n label={label}\n tooltip={tooltip}\n tooltipProps={tooltipProps} \n name={name}\n render={({ field }) => (\n <FormControl>\n <Combobox\n {...rest}\n {...field}\n onChange={field.onChange}\n />\n </FormControl>\n )}\n />\n );\n};\n"],"names":["FormCombobox","props","form","label","tooltip","tooltipProps","name","rest","jsx","FormRenderControl","field","FormControl","Combobox"],"mappings":";;;;AAMO,MAAMA,IAAe,CAC1BC,MACG;AACH,QAAM,EAAE,MAAAC,GAAM,OAAAC,GAAO,SAAAC,GAAS,cAAAC,GAAc,MAAAC,GAAM,GAAGC,MAASN;AAC9D,SACE,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAP;AAAA,MACA,OAAAC;AAAA,MACA,SAAAC;AAAA,MACA,cAAAC;AAAA,MACA,MAAAC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAI,EAAA,wBACRC,GAAA,EACC,UAAA,gBAAAH;AAAA,QAACI;AAAA,QAAA;AAAA,UACE,GAAGL;AAAA,UACH,GAAGG;AAAA,UACJ,UAAUA,EAAM;AAAA,QAAA;AAAA,MAAA,EAClB,CACF;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormDatePicker.d.ts","sourceRoot":"","sources":["../../src/FormDatePicker/FormDatePicker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D,eAAO,MAAM,cAAc,GAAI,IAAI,SAAS,WAAW,EACrD,OAAO,mBAAmB,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"FormDatePicker.d.ts","sourceRoot":"","sources":["../../src/FormDatePicker/FormDatePicker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D,eAAO,MAAM,cAAc,GAAI,IAAI,SAAS,WAAW,EACrD,OAAO,mBAAmB,CAAC,IAAI,CAAC,4CAyBjC,CAAC"}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { DatePicker as
|
|
3
|
-
import { FormControl as
|
|
4
|
-
import { FormRenderControl as
|
|
5
|
-
const
|
|
6
|
-
const { form: n, name: m,
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { DatePicker as s } from "../DatePicker/DatePicker.js";
|
|
3
|
+
import { FormControl as C } from "../Form/Form.js";
|
|
4
|
+
import { FormRenderControl as D } from "../Form/FormRenderControl.js";
|
|
5
|
+
const P = (t) => {
|
|
6
|
+
const { form: n, name: m, tooltip: a, tooltipProps: p, label: i, onDateChange: l, ...c } = t;
|
|
7
|
+
return /* @__PURE__ */ r(
|
|
8
|
+
D,
|
|
9
9
|
{
|
|
10
10
|
form: n,
|
|
11
11
|
name: m,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
tooltip: a,
|
|
13
|
+
tooltipProps: p,
|
|
14
|
+
label: i,
|
|
15
|
+
render: ({ field: o }) => /* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(
|
|
16
|
+
s,
|
|
15
17
|
{
|
|
16
|
-
...
|
|
17
|
-
...
|
|
18
|
-
selectedDate:
|
|
18
|
+
...o,
|
|
19
|
+
...c,
|
|
20
|
+
selectedDate: o.value,
|
|
19
21
|
onDateChange: (e) => {
|
|
20
|
-
|
|
22
|
+
o.onChange(e), l?.(e);
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
) })
|
|
@@ -25,6 +27,6 @@ const g = (t) => {
|
|
|
25
27
|
);
|
|
26
28
|
};
|
|
27
29
|
export {
|
|
28
|
-
|
|
30
|
+
P as FormDatePicker
|
|
29
31
|
};
|
|
30
32
|
//# sourceMappingURL=FormDatePicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormDatePicker.js","sources":["../../src/FormDatePicker/FormDatePicker.tsx"],"sourcesContent":["'use client';\n\nimport { DatePicker } from '../DatePicker';\nimport { FormControl, FormRenderControl } from '../Form';\nimport { FieldValues } from 'react-hook-form';\nimport { FormDatePickerProps } from './FormDatePicker.types';\n\n// TODO: add description\nexport const FormDatePicker = <Data extends FieldValues>(\n props: FormDatePickerProps<Data>\n) => {\n const { form, name, label, onDateChange, ...rest } = props;\n return (\n <FormRenderControl\n form={form}\n name={name}\n label={label}\n render={({ field }) => (\n <FormControl>\n <DatePicker\n { ...field }\n { ...rest }\n selectedDate={field.value}\n onDateChange={(date: Date | undefined) => {\n field.onChange(date);\n onDateChange?.(date);\n }}\n />\n </FormControl>\n )}\n />\n );\n};\n"],"names":["FormDatePicker","props","form","name","label","onDateChange","rest","jsx","FormRenderControl","field","FormControl","DatePicker","date"],"mappings":";;;;AAQO,MAAMA,IAAiB,CAC5BC,MACG;AACH,QAAM,EAAE,MAAAC,GAAM,MAAAC,GAAM,OAAAC,GAAO,cAAAC,GAAc,GAAGC,
|
|
1
|
+
{"version":3,"file":"FormDatePicker.js","sources":["../../src/FormDatePicker/FormDatePicker.tsx"],"sourcesContent":["'use client';\n\nimport { DatePicker } from '../DatePicker';\nimport { FormControl, FormRenderControl } from '../Form';\nimport { FieldValues } from 'react-hook-form';\nimport { FormDatePickerProps } from './FormDatePicker.types';\n\n// TODO: add description\nexport const FormDatePicker = <Data extends FieldValues>(\n props: FormDatePickerProps<Data>\n) => {\n const { form, name, tooltip, tooltipProps, label, onDateChange, ...rest } = props;\n return (\n <FormRenderControl\n form={form}\n name={name}\n tooltip={tooltip}\n tooltipProps={tooltipProps}\n label={label}\n render={({ field }) => (\n <FormControl>\n <DatePicker\n { ...field }\n { ...rest }\n selectedDate={field.value}\n onDateChange={(date: Date | undefined) => {\n field.onChange(date);\n onDateChange?.(date);\n }}\n />\n </FormControl>\n )}\n />\n );\n};\n"],"names":["FormDatePicker","props","form","name","tooltip","tooltipProps","label","onDateChange","rest","jsx","FormRenderControl","field","FormControl","DatePicker","date"],"mappings":";;;;AAQO,MAAMA,IAAiB,CAC5BC,MACG;AACH,QAAM,EAAE,MAAAC,GAAM,MAAAC,GAAM,SAAAC,GAAS,cAAAC,GAAc,OAAAC,GAAO,cAAAC,GAAc,GAAGC,EAAA,IAASP;AAC5E,SACE,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAR;AAAA,MACA,MAAAC;AAAA,MACA,SAAAC;AAAA,MACA,cAAAC;AAAA,MACA,OAAAC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAK,EAAA,wBACRC,GAAA,EACC,UAAA,gBAAAH;AAAA,QAACI;AAAA,QAAA;AAAA,UACG,GAAGF;AAAA,UACH,GAAGH;AAAA,UACL,cAAcG,EAAM;AAAA,UACpB,cAAc,CAACG,MAA2B;AACxC,YAAAH,EAAM,SAASG,CAAI,GACnBP,IAAeO,CAAI;AAAA,UACrB;AAAA,QAAA;AAAA,MAAA,EACF,CACF;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormDropzone.d.ts","sourceRoot":"","sources":["../../src/FormDropzone/FormDropzone.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,eAAO,MAAM,YAAY,GAAI,IAAI,SAAS,WAAW,EACnD,OAAO,iBAAiB,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"FormDropzone.d.ts","sourceRoot":"","sources":["../../src/FormDropzone/FormDropzone.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,eAAO,MAAM,YAAY,GAAI,IAAI,SAAS,WAAW,EACnD,OAAO,iBAAiB,CAAC,IAAI,CAAC,4CAkB/B,CAAC"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { FormControl as a } from "../Form/Form.js";
|
|
3
|
-
import { FormRenderControl as
|
|
3
|
+
import { FormRenderControl as s } from "../Form/FormRenderControl.js";
|
|
4
4
|
import { Dropzone as f } from "../Dropzone/Dropzone.js";
|
|
5
|
-
const
|
|
6
|
-
const { form:
|
|
5
|
+
const d = (n) => {
|
|
6
|
+
const { form: t, label: e, tooltip: m, tooltipProps: p, name: l, ...i } = n;
|
|
7
7
|
return /* @__PURE__ */ o(
|
|
8
|
-
|
|
8
|
+
s,
|
|
9
9
|
{
|
|
10
|
-
form:
|
|
11
|
-
label:
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
form: t,
|
|
11
|
+
label: e,
|
|
12
|
+
tooltip: m,
|
|
13
|
+
tooltipProps: p,
|
|
14
|
+
name: l,
|
|
15
|
+
render: ({ field: r }) => /* @__PURE__ */ o(a, { children: /* @__PURE__ */ o(f, { ...i, ...r, onChangeValue: r.onChange }) })
|
|
14
16
|
}
|
|
15
17
|
);
|
|
16
18
|
};
|
|
17
19
|
export {
|
|
18
|
-
|
|
20
|
+
d as FormDropzone
|
|
19
21
|
};
|
|
20
22
|
//# sourceMappingURL=FormDropzone.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormDropzone.js","sources":["../../src/FormDropzone/FormDropzone.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Dropzone } from '../Dropzone';\nimport { FieldValues } from 'react-hook-form';\nimport { FormDropzoneProps } from './FormDropzone.types';\n\nexport const FormDropzone = <Data extends FieldValues>(\n props: FormDropzoneProps<Data>\n) => {\n const { form, label, name, ...rest } = props;\n\n return (\n <FormRenderControl\n form={form}\n label={label}\n name={name}\n render={({ field }) => (\n <FormControl>\n <Dropzone {...rest} {...field} onChangeValue={field.onChange} />\n </FormControl>\n )}\n />\n );\n};\n"],"names":["FormDropzone","props","form","label","name","rest","jsx","FormRenderControl","field","FormControl","Dropzone"],"mappings":";;;;AAKO,MAAMA,IAAe,CAC1BC,MACG;AACH,QAAM,EAAE,MAAAC,GAAM,OAAAC,GAAO,MAAAC,GAAM,GAAGC,
|
|
1
|
+
{"version":3,"file":"FormDropzone.js","sources":["../../src/FormDropzone/FormDropzone.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Dropzone } from '../Dropzone';\nimport { FieldValues } from 'react-hook-form';\nimport { FormDropzoneProps } from './FormDropzone.types';\n\nexport const FormDropzone = <Data extends FieldValues>(\n props: FormDropzoneProps<Data>\n) => {\n const { form, label, tooltip, tooltipProps, name, ...rest } = props;\n\n return (\n <FormRenderControl\n form={form}\n label={label}\n tooltip={tooltip}\n tooltipProps={tooltipProps}\n name={name}\n render={({ field }) => (\n <FormControl>\n <Dropzone {...rest} {...field} onChangeValue={field.onChange} />\n </FormControl>\n )}\n />\n );\n};\n"],"names":["FormDropzone","props","form","label","tooltip","tooltipProps","name","rest","jsx","FormRenderControl","field","FormControl","Dropzone"],"mappings":";;;;AAKO,MAAMA,IAAe,CAC1BC,MACG;AACH,QAAM,EAAE,MAAAC,GAAM,OAAAC,GAAO,SAAAC,GAAS,cAAAC,GAAc,MAAAC,GAAM,GAAGC,MAASN;AAE9D,SACE,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAP;AAAA,MACA,OAAAC;AAAA,MACA,SAAAC;AAAA,MACA,cAAAC;AAAA,MACA,MAAAC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAI,EAAA,wBACRC,GAAA,EACC,UAAA,gBAAAH,EAACI,GAAA,EAAU,GAAGL,GAAO,GAAGG,GAAO,eAAeA,EAAM,UAAU,EAAA,CAChE;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormInput.d.ts","sourceRoot":"","sources":["../../src/FormInput/FormInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAc,YAAY,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormInput.d.ts","sourceRoot":"","sources":["../../src/FormInput/FormInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAc,YAAY,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;AAyGjE,eAAO,MAAM,SAAS,EAAiC,CAAC,IAAI,SAAS,WAAW,EAC9E,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;CAAE,KAC1D,YAAY,CAAC"}
|
package/FormInput/FormInput.js
CHANGED
|
@@ -1,50 +1,51 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { FormControl as F } from "../Form/Form.js";
|
|
3
3
|
import { FormRenderControl as I } from "../Form/FormRenderControl.js";
|
|
4
|
-
import { Input as
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
function
|
|
7
|
-
const { form:
|
|
4
|
+
import { Input as y } from "../Input/Input.js";
|
|
5
|
+
import { forwardRef as B } from "react";
|
|
6
|
+
function b(c, r) {
|
|
7
|
+
const { form: l, tooltip: p, tooltipProps: m, label: i, name: u, onChange: f, onBlur: h, onPaste: v, style: g, onPastePrepare: s, ...d } = c;
|
|
8
8
|
return /* @__PURE__ */ a(
|
|
9
9
|
I,
|
|
10
10
|
{
|
|
11
|
-
form:
|
|
12
|
-
name:
|
|
13
|
-
tooltip:
|
|
14
|
-
|
|
11
|
+
form: l,
|
|
12
|
+
name: u,
|
|
13
|
+
tooltip: p,
|
|
14
|
+
tooltipProps: m,
|
|
15
|
+
label: i,
|
|
15
16
|
render: ({ field: n }) => /* @__PURE__ */ a(F, { children: /* @__PURE__ */ a(
|
|
16
|
-
|
|
17
|
+
y,
|
|
17
18
|
{
|
|
18
19
|
...n,
|
|
19
|
-
...
|
|
20
|
+
...d,
|
|
20
21
|
ref: (t) => {
|
|
21
|
-
n.ref(t), typeof
|
|
22
|
+
n.ref(t), typeof r == "function" ? r(t) : r && (r.current = t);
|
|
22
23
|
},
|
|
23
|
-
style:
|
|
24
|
+
style: g,
|
|
24
25
|
value: n.value || "",
|
|
25
26
|
onChange: (...t) => {
|
|
26
|
-
n.onChange?.(...t),
|
|
27
|
+
n.onChange?.(...t), f?.(...t);
|
|
27
28
|
},
|
|
28
29
|
onPaste: (t) => {
|
|
29
|
-
const
|
|
30
|
-
let
|
|
31
|
-
s && (
|
|
32
|
-
const D =
|
|
33
|
-
t.preventDefault(),
|
|
30
|
+
const C = t.clipboardData.getData("text"), o = t.currentTarget, P = o.selectionStart ?? o.value.length, x = o.selectionEnd ?? o.value.length;
|
|
31
|
+
let e = o.value.slice(0, P) + C + o.value.slice(x);
|
|
32
|
+
s && (e = s(e, t));
|
|
33
|
+
const D = e;
|
|
34
|
+
t.preventDefault(), l.setValue(u, D, {
|
|
34
35
|
shouldDirty: !0,
|
|
35
36
|
shouldTouch: !0
|
|
36
|
-
}),
|
|
37
|
+
}), v?.(t);
|
|
37
38
|
},
|
|
38
39
|
onBlur: (...t) => {
|
|
39
|
-
n.onBlur?.(),
|
|
40
|
+
n.onBlur?.(), h?.(...t);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
) })
|
|
43
44
|
}
|
|
44
45
|
);
|
|
45
46
|
}
|
|
46
|
-
const
|
|
47
|
+
const S = B(b);
|
|
47
48
|
export {
|
|
48
|
-
|
|
49
|
+
S as FormInput
|
|
49
50
|
};
|
|
50
51
|
//# sourceMappingURL=FormInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormInput.js","sources":["../../src/FormInput/FormInput.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Input } from '../Input';\nimport { FormInputProps } from './FormInput.types';\nimport { FieldValues, Path, PathValue } from 'react-hook-form';\nimport { forwardRef, ReactElement, Ref, RefObject } from 'react';\n\n// TODO: add description\n// export const FormInput = <Data extends FieldValues>(\n// props: FormInputProps<Data> & { inputRef?: Ref<HTMLInputElement> }\n// ) => {\n// const { inputRef, form, label, name, onChange, onBlur, style, ...rest } =\n// props;\n// return (\n// <FormRenderControl\n// form={form}\n// name={name}\n// label={label}\n// render={({ field }) => (\n// <FormControl>\n// <Input\n// {...field}\n// {...rest}\n// ref={(el) => {\n// field.ref(el);\n// if (typeof inputRef === 'function') {\n// inputRef(el);\n// } else if (inputRef) {\n// (inputRef as RefObject<HTMLInputElement | null>).current = el;\n// }\n// }}\n// style={style}\n// value={field.value || ''}\n// onChange={(...rest) => {\n// field.onChange?.(...rest);\n// onChange?.(...rest);\n// }}\n// onBlur={(...rest) => {\n// field.onBlur?.();\n// onBlur?.(...rest);\n// }}\n// />\n// </FormControl>\n// )}\n// />\n// );\n// };\n\nfunction FormInputInner<Data extends FieldValues>(\n props: FormInputProps<Data>,\n ref: Ref<HTMLInputElement>\n) {\n const { form, tooltip, label, name, onChange, onBlur, onPaste, style, onPastePrepare, ...rest } = props;\n return (\n <FormRenderControl\n form={form}\n name={name}\n tooltip={tooltip}\n label={label}\n render={({ field }) => (\n <FormControl>\n <Input\n {...field}\n {...rest}\n ref={(el) => {\n field.ref(el);\n if (typeof ref === 'function') {\n ref(el);\n } else if (ref) {\n (ref as RefObject<HTMLInputElement | null>).current = el;\n }\n }}\n style={style}\n value={field.value || ''}\n onChange={(...rest) => {\n field.onChange?.(...rest);\n onChange?.(...rest);\n }}\n onPaste={(e) => {\n const pasted = e.clipboardData.getData('text');\n const t = e.currentTarget;\n\n const start = t.selectionStart ?? t.value.length;\n const end = t.selectionEnd ?? t.value.length;\n\n let next = t.value.slice(0, start) + pasted + t.value.slice(end);\n if(onPastePrepare) next = onPastePrepare(next, e);\n const value = next as unknown as PathValue<Data, Path<Data>>;\n\n e.preventDefault();\n\n form.setValue(name, value, {\n shouldDirty: true,\n shouldTouch: true,\n });\n\n onPaste?.(e);\n }}\n onBlur={(...rest) => {\n field.onBlur?.();\n onBlur?.(...rest);\n }}\n />\n </FormControl>\n )}\n />\n );\n}\n\nexport const FormInput = forwardRef(FormInputInner) as <Data extends FieldValues>(\n props: FormInputProps<Data> & { ref?: Ref<HTMLInputElement> }\n) => ReactElement;\n"],"names":["FormInputInner","props","ref","form","tooltip","label","name","onChange","onBlur","onPaste","style","onPastePrepare","rest","jsx","FormRenderControl","field","FormControl","Input","el","e","pasted","t","start","end","next","value","FormInput","forwardRef"],"mappings":";;;;;AA+CA,SAASA,EACPC,GACAC,GACA;AACA,QAAM,EAAE,MAAAC,GAAM,SAAAC,GAAS,OAAAC,GAAO,MAAAC,GAAM,UAAAC,GAAU,QAAAC,GAAQ,SAAAC,GAAS,OAAAC,GAAO,gBAAAC,GAAgB,GAAGC,
|
|
1
|
+
{"version":3,"file":"FormInput.js","sources":["../../src/FormInput/FormInput.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Input } from '../Input';\nimport { FormInputProps } from './FormInput.types';\nimport { FieldValues, Path, PathValue } from 'react-hook-form';\nimport { forwardRef, ReactElement, Ref, RefObject } from 'react';\n\n// TODO: add description\n// export const FormInput = <Data extends FieldValues>(\n// props: FormInputProps<Data> & { inputRef?: Ref<HTMLInputElement> }\n// ) => {\n// const { inputRef, form, label, name, onChange, onBlur, style, ...rest } =\n// props;\n// return (\n// <FormRenderControl\n// form={form}\n// name={name}\n// label={label}\n// render={({ field }) => (\n// <FormControl>\n// <Input\n// {...field}\n// {...rest}\n// ref={(el) => {\n// field.ref(el);\n// if (typeof inputRef === 'function') {\n// inputRef(el);\n// } else if (inputRef) {\n// (inputRef as RefObject<HTMLInputElement | null>).current = el;\n// }\n// }}\n// style={style}\n// value={field.value || ''}\n// onChange={(...rest) => {\n// field.onChange?.(...rest);\n// onChange?.(...rest);\n// }}\n// onBlur={(...rest) => {\n// field.onBlur?.();\n// onBlur?.(...rest);\n// }}\n// />\n// </FormControl>\n// )}\n// />\n// );\n// };\n\nfunction FormInputInner<Data extends FieldValues>(\n props: FormInputProps<Data>,\n ref: Ref<HTMLInputElement>\n) {\n const { form, tooltip, tooltipProps, label, name, onChange, onBlur, onPaste, style, onPastePrepare, ...rest } = props;\n return (\n <FormRenderControl\n form={form}\n name={name}\n tooltip={tooltip}\n tooltipProps={tooltipProps}\n label={label}\n render={({ field }) => (\n <FormControl>\n <Input\n {...field}\n {...rest}\n ref={(el) => {\n field.ref(el);\n if (typeof ref === 'function') {\n ref(el);\n } else if (ref) {\n (ref as RefObject<HTMLInputElement | null>).current = el;\n }\n }}\n style={style}\n value={field.value || ''}\n onChange={(...rest) => {\n field.onChange?.(...rest);\n onChange?.(...rest);\n }}\n onPaste={(e) => {\n const pasted = e.clipboardData.getData('text');\n const t = e.currentTarget;\n\n const start = t.selectionStart ?? t.value.length;\n const end = t.selectionEnd ?? t.value.length;\n\n let next = t.value.slice(0, start) + pasted + t.value.slice(end);\n if(onPastePrepare) next = onPastePrepare(next, e);\n const value = next as unknown as PathValue<Data, Path<Data>>;\n\n e.preventDefault();\n\n form.setValue(name, value, {\n shouldDirty: true,\n shouldTouch: true,\n });\n\n onPaste?.(e);\n }}\n onBlur={(...rest) => {\n field.onBlur?.();\n onBlur?.(...rest);\n }}\n />\n </FormControl>\n )}\n />\n );\n}\n\nexport const FormInput = forwardRef(FormInputInner) as <Data extends FieldValues>(\n props: FormInputProps<Data> & { ref?: Ref<HTMLInputElement> }\n) => ReactElement;\n"],"names":["FormInputInner","props","ref","form","tooltip","tooltipProps","label","name","onChange","onBlur","onPaste","style","onPastePrepare","rest","jsx","FormRenderControl","field","FormControl","Input","el","e","pasted","t","start","end","next","value","FormInput","forwardRef"],"mappings":";;;;;AA+CA,SAASA,EACPC,GACAC,GACA;AACA,QAAM,EAAE,MAAAC,GAAM,SAAAC,GAAS,cAAAC,GAAc,OAAAC,GAAO,MAAAC,GAAM,UAAAC,GAAU,QAAAC,GAAQ,SAAAC,GAAS,OAAAC,GAAO,gBAAAC,GAAgB,GAAGC,MAASZ;AAChH,SACE,gBAAAa;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAZ;AAAA,MACA,MAAAI;AAAA,MACA,SAAAH;AAAA,MACA,cAAAC;AAAA,MACA,OAAAC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAU,EAAA,wBACRC,GAAA,EACC,UAAA,gBAAAH;AAAA,QAACI;AAAA,QAAA;AAAA,UACE,GAAGF;AAAA,UACH,GAAGH;AAAA,UACJ,KAAK,CAACM,MAAO;AACX,YAAAH,EAAM,IAAIG,CAAE,GACR,OAAOjB,KAAQ,aACjBA,EAAIiB,CAAE,IACGjB,MACRA,EAA2C,UAAUiB;AAAA,UAE1D;AAAA,UACA,OAAAR;AAAA,UACA,OAAOK,EAAM,SAAS;AAAA,UACtB,UAAU,IAAIH,MAAS;AACrB,YAAAG,EAAM,WAAW,GAAGH,CAAI,GACxBL,IAAW,GAAGK,CAAI;AAAA,UACpB;AAAA,UACA,SAAS,CAACO,MAAM;AACd,kBAAMC,IAASD,EAAE,cAAc,QAAQ,MAAM,GACvCE,IAAIF,EAAE,eAENG,IAAQD,EAAE,kBAAkBA,EAAE,MAAM,QACpCE,IAAMF,EAAE,gBAAgBA,EAAE,MAAM;AAEtC,gBAAIG,IAAOH,EAAE,MAAM,MAAM,GAAGC,CAAK,IAAIF,IAASC,EAAE,MAAM,MAAME,CAAG;AAC/D,YAAGZ,MAAgBa,IAAOb,EAAea,GAAML,CAAC;AAChD,kBAAMM,IAAQD;AAEd,YAAAL,EAAE,eAAA,GAEFjB,EAAK,SAASI,GAAMmB,GAAO;AAAA,cACzB,aAAa;AAAA,cACb,aAAa;AAAA,YAAA,CACd,GAEDhB,IAAUU,CAAC;AAAA,UACb;AAAA,UACA,QAAQ,IAAIP,MAAS;AACnB,YAAAG,EAAM,SAAA,GACNP,IAAS,GAAGI,CAAI;AAAA,UAClB;AAAA,QAAA;AAAA,MAAA,EACF,CACF;AAAA,IAAA;AAAA,EAAA;AAIR;AAEO,MAAMc,IAAYC,EAAW5B,CAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSelect.d.ts","sourceRoot":"","sources":["../../src/FormSelect/FormSelect.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,eAAO,MAAM,UAAU,GAAI,IAAI,SAAS,WAAW,EAAE,gBAAgB,EACnE,OAAO,eAAe,CAAC,IAAI,EAAE,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"FormSelect.d.ts","sourceRoot":"","sources":["../../src/FormSelect/FormSelect.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,eAAO,MAAM,UAAU,GAAI,IAAI,SAAS,WAAW,EAAE,gBAAgB,EACnE,OAAO,eAAe,CAAC,IAAI,EAAE,gBAAgB,CAAC,4CA8C/C,CAAC"}
|
package/FormSelect/FormSelect.js
CHANGED
|
@@ -1,47 +1,51 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { FormControl as
|
|
3
|
-
import { FormRenderControl as
|
|
2
|
+
import { FormControl as u } from "../Form/Form.js";
|
|
3
|
+
import { FormRenderControl as x } from "../Form/FormRenderControl.js";
|
|
4
4
|
import "@radix-ui/react-select";
|
|
5
5
|
import "lucide-react";
|
|
6
6
|
import "@oneplatformdev/utils";
|
|
7
|
-
import { Select as
|
|
8
|
-
const
|
|
7
|
+
import { Select as F } from "../Select/Select.js";
|
|
8
|
+
const V = (m) => {
|
|
9
9
|
const {
|
|
10
10
|
value: i = void 0,
|
|
11
11
|
form: p,
|
|
12
12
|
label: a,
|
|
13
|
-
|
|
13
|
+
tooltip: l,
|
|
14
|
+
tooltipProps: g,
|
|
15
|
+
name: s,
|
|
14
16
|
options: c = [],
|
|
15
|
-
onChange:
|
|
16
|
-
containerProps:
|
|
17
|
-
renderTrigger:
|
|
17
|
+
onChange: h,
|
|
18
|
+
containerProps: C,
|
|
19
|
+
renderTrigger: d,
|
|
18
20
|
onChangePrepare: n,
|
|
19
|
-
...
|
|
21
|
+
...f
|
|
20
22
|
} = m;
|
|
21
23
|
return /* @__PURE__ */ e(
|
|
22
|
-
|
|
24
|
+
x,
|
|
23
25
|
{
|
|
24
26
|
form: p,
|
|
25
|
-
name:
|
|
27
|
+
name: s,
|
|
28
|
+
tooltip: l,
|
|
29
|
+
tooltipProps: g,
|
|
26
30
|
label: a,
|
|
27
|
-
containerProps:
|
|
31
|
+
containerProps: C,
|
|
28
32
|
render: ({ field: t }) => /* @__PURE__ */ e(
|
|
29
|
-
|
|
33
|
+
F,
|
|
30
34
|
{
|
|
31
35
|
value: t.value ?? (i || ""),
|
|
32
36
|
options: c,
|
|
33
37
|
onChange: (r) => {
|
|
34
38
|
const o = n ? n(r) : r;
|
|
35
|
-
t.onChange(o),
|
|
39
|
+
t.onChange(o), h?.(r, o);
|
|
36
40
|
},
|
|
37
|
-
renderTrigger: (r, o) => /* @__PURE__ */ e(
|
|
38
|
-
...
|
|
41
|
+
renderTrigger: (r, o) => /* @__PURE__ */ e(u, { children: d?.(r, o) || o }),
|
|
42
|
+
...f
|
|
39
43
|
}
|
|
40
44
|
)
|
|
41
45
|
}
|
|
42
46
|
);
|
|
43
47
|
};
|
|
44
48
|
export {
|
|
45
|
-
|
|
49
|
+
V as FormSelect
|
|
46
50
|
};
|
|
47
51
|
//# sourceMappingURL=FormSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSelect.js","sources":["../../src/FormSelect/FormSelect.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Select } from '../Select';\nimport { FormSelectProps } from './FormSelect.types';\nimport { FieldValues } from 'react-hook-form';\n\n// TODO: add description\nexport const FormSelect = <Data extends FieldValues, ExtendOptionData>(\n props: FormSelectProps<Data, ExtendOptionData>\n) => {\n const {\n value = undefined,\n form,\n label,\n name,\n options = [],\n onChange,\n containerProps,\n renderTrigger,\n onChangePrepare,\n ...rest\n } = props;\n\n return (\n <FormRenderControl\n form={form}\n name={name}\n label={label}\n containerProps={containerProps}\n render={({ field }) => (\n <Select<ExtendOptionData>\n value={field.value ?? (value || '')}\n options={options}\n onChange={(value) => {\n const nextValue = onChangePrepare ? onChangePrepare(value) : value;\n field.onChange(nextValue);\n onChange?.(value, nextValue);\n }}\n renderTrigger={(p, defaultComponent) => {\n return (\n <FormControl>\n {renderTrigger?.(p, defaultComponent) || defaultComponent}\n </FormControl>\n )\n }}\n {...rest}\n />\n )}\n />\n );\n};\n"],"names":["FormSelect","props","value","form","label","name","options","onChange","containerProps","renderTrigger","onChangePrepare","rest","jsx","FormRenderControl","field","Select","nextValue","p","defaultComponent","FormControl"],"mappings":";;;;;;;AAMO,MAAMA,IAAa,CACxBC,MACG;AACH,QAAM;AAAA,IACJ,OAAAC,IAAQ;AAAA,IACR,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC,IAAU,CAAA;AAAA,IACV,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"FormSelect.js","sources":["../../src/FormSelect/FormSelect.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Select } from '../Select';\nimport { FormSelectProps } from './FormSelect.types';\nimport { FieldValues } from 'react-hook-form';\n\n// TODO: add description\nexport const FormSelect = <Data extends FieldValues, ExtendOptionData>(\n props: FormSelectProps<Data, ExtendOptionData>\n) => {\n const {\n value = undefined,\n form,\n label,\n tooltip,\n tooltipProps,\n name,\n options = [],\n onChange,\n containerProps,\n renderTrigger,\n onChangePrepare,\n ...rest\n } = props;\n\n return (\n <FormRenderControl\n form={form}\n name={name}\n tooltip={tooltip}\n tooltipProps={tooltipProps}\n label={label}\n containerProps={containerProps}\n render={({ field }) => (\n <Select<ExtendOptionData>\n value={field.value ?? (value || '')}\n options={options}\n onChange={(value) => {\n const nextValue = onChangePrepare ? onChangePrepare(value) : value;\n field.onChange(nextValue);\n onChange?.(value, nextValue);\n }}\n renderTrigger={(p, defaultComponent) => {\n return (\n <FormControl>\n {renderTrigger?.(p, defaultComponent) || defaultComponent}\n </FormControl>\n )\n }}\n {...rest}\n />\n )}\n />\n );\n};\n"],"names":["FormSelect","props","value","form","label","tooltip","tooltipProps","name","options","onChange","containerProps","renderTrigger","onChangePrepare","rest","jsx","FormRenderControl","field","Select","nextValue","p","defaultComponent","FormControl"],"mappings":";;;;;;;AAMO,MAAMA,IAAa,CACxBC,MACG;AACH,QAAM;AAAA,IACJ,OAAAC,IAAQ;AAAA,IACR,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC,IAAU,CAAA;AAAA,IACV,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDZ;AAEJ,SACE,gBAAAa;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAZ;AAAA,MACA,MAAAI;AAAA,MACA,SAAAF;AAAA,MACA,cAAAC;AAAA,MACA,OAAAF;AAAA,MACA,gBAAAM;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAM,EAAA,MACT,gBAAAF;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,OAAOD,EAAM,UAAUd,KAAS;AAAA,UAChC,SAAAM;AAAA,UACA,UAAU,CAACN,MAAU;AACnB,kBAAMgB,IAAYN,IAAkBA,EAAgBV,CAAK,IAAIA;AAC7D,YAAAc,EAAM,SAASE,CAAS,GACxBT,IAAWP,GAAOgB,CAAS;AAAA,UAC7B;AAAA,UACA,eAAe,CAACC,GAAGC,wBAEdC,GAAA,EACE,UAAAV,IAAgBQ,GAAGC,CAAgB,KAAKA,GAC3C;AAAA,UAGH,GAAGP;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAIR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormTextarea.d.ts","sourceRoot":"","sources":["../../src/FormTextarea/FormTextarea.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,eAAO,MAAM,YAAY,GAAI,IAAI,SAAS,WAAW,EACnD,OAAO,iBAAiB,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"FormTextarea.d.ts","sourceRoot":"","sources":["../../src/FormTextarea/FormTextarea.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,eAAO,MAAM,YAAY,GAAI,IAAI,SAAS,WAAW,EACnD,OAAO,iBAAiB,CAAC,IAAI,CAAC,4CAsB/B,CAAC"}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { FormControl as
|
|
3
|
-
import { FormRenderControl as
|
|
4
|
-
import { Textarea as
|
|
5
|
-
const
|
|
6
|
-
const { form:
|
|
2
|
+
import { FormControl as s } from "../Form/Form.js";
|
|
3
|
+
import { FormRenderControl as c } from "../Form/FormRenderControl.js";
|
|
4
|
+
import { Textarea as f } from "../Textarea/Textarea.js";
|
|
5
|
+
const v = (t) => {
|
|
6
|
+
const { form: e, label: m, tooltip: n, tooltipProps: a, name: p, containerProps: l, ...i } = t;
|
|
7
7
|
return /* @__PURE__ */ r(
|
|
8
|
-
|
|
8
|
+
c,
|
|
9
9
|
{
|
|
10
|
-
form:
|
|
11
|
-
|
|
10
|
+
form: e,
|
|
11
|
+
tooltip: n,
|
|
12
|
+
tooltipProps: a,
|
|
13
|
+
name: p,
|
|
12
14
|
label: m,
|
|
13
|
-
containerProps:
|
|
14
|
-
render: ({ field: o }) => /* @__PURE__ */ r(
|
|
15
|
-
|
|
15
|
+
containerProps: l,
|
|
16
|
+
render: ({ field: o }) => /* @__PURE__ */ r(s, { children: /* @__PURE__ */ r(
|
|
17
|
+
f,
|
|
16
18
|
{
|
|
17
19
|
...o,
|
|
18
20
|
value: o.value || "",
|
|
19
|
-
...
|
|
21
|
+
...i
|
|
20
22
|
}
|
|
21
23
|
) })
|
|
22
24
|
}
|
|
23
25
|
);
|
|
24
26
|
};
|
|
25
27
|
export {
|
|
26
|
-
|
|
28
|
+
v as FormTextarea
|
|
27
29
|
};
|
|
28
30
|
//# sourceMappingURL=FormTextarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormTextarea.js","sources":["../../src/FormTextarea/FormTextarea.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { FormTextareaProps } from './FormTextarea.types';\nimport { FieldValues } from 'react-hook-form';\nimport { Textarea } from '../Textarea';\n\n// TODO: add description\nexport const FormTextarea = <Data extends FieldValues>(\n props: FormTextareaProps<Data>\n) => {\nconst { form, label, name, containerProps, ...rest } = props;\n return (\n <FormRenderControl\n form={form}\n name={name}\n label={label}\n containerProps={containerProps}\n render={({ field }) => (\n <FormControl>\n <Textarea\n {...field}\n value={field.value || ''}\n {...rest}\n />\n </FormControl>\n )}\n />\n )\n};\n"],"names":["FormTextarea","props","form","label","name","containerProps","rest","jsx","FormRenderControl","field","FormControl","Textarea"],"mappings":";;;;AAMO,MAAMA,IAAe,CAC1BC,MACG;AACL,QAAM,EAAE,MAAAC,GAAM,OAAAC,GAAO,MAAAC,GAAM,gBAAAC,GAAgB,GAAGC,
|
|
1
|
+
{"version":3,"file":"FormTextarea.js","sources":["../../src/FormTextarea/FormTextarea.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { FormTextareaProps } from './FormTextarea.types';\nimport { FieldValues } from 'react-hook-form';\nimport { Textarea } from '../Textarea';\n\n// TODO: add description\nexport const FormTextarea = <Data extends FieldValues>(\n props: FormTextareaProps<Data>\n) => {\nconst { form, label, tooltip, tooltipProps, name, containerProps, ...rest } = props;\n return (\n <FormRenderControl\n form={form}\n tooltip={tooltip}\n tooltipProps={tooltipProps}\n name={name}\n label={label}\n containerProps={containerProps}\n render={({ field }) => (\n <FormControl>\n <Textarea\n {...field}\n value={field.value || ''}\n {...rest}\n />\n </FormControl>\n )}\n />\n )\n};\n"],"names":["FormTextarea","props","form","label","tooltip","tooltipProps","name","containerProps","rest","jsx","FormRenderControl","field","FormControl","Textarea"],"mappings":";;;;AAMO,MAAMA,IAAe,CAC1BC,MACG;AACL,QAAM,EAAE,MAAAC,GAAM,OAAAC,GAAO,SAAAC,GAAS,cAAAC,GAAc,MAAAC,GAAM,gBAAAC,GAAgB,GAAGC,EAAA,IAASP;AAC1E,SACI,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,MAAAR;AAAA,MACA,SAAAE;AAAA,MACA,cAAAC;AAAA,MACA,MAAAC;AAAA,MACA,OAAAH;AAAA,MACA,gBAAAI;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAI,EAAA,wBACRC,GAAA,EACC,UAAA,gBAAAH;AAAA,QAACI;AAAA,QAAA;AAAA,UACE,GAAGF;AAAA,UACJ,OAAOA,EAAM,SAAS;AAAA,UACrB,GAAGH;AAAA,QAAA;AAAA,MAAA,EACN,CACF;AAAA,IAAA;AAAA,EAAA;AAId;"}
|
package/Tooltip/Tooltip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,CAAC,YAAY,CAAC,4CAkDlE,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,iBAAiB,CAAC,YAAY,CAAC,4CAQ7D,CAAC"}
|
package/Tooltip/Tooltip.js
CHANGED
|
@@ -1,60 +1,72 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { CircleQuestionMarkIcon as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { TooltipProvider as
|
|
1
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { CircleQuestionMarkIcon as f } from "lucide-react";
|
|
3
|
+
import { cn as n } from "@oneplatformdev/utils";
|
|
4
|
+
import { TooltipProvider as u, TooltipRoot as d, TooltipTrigger as x, TooltipContent as g } from "./TooltipRoot.js";
|
|
5
|
+
import { tooltipQuestionIconVariants as h } from "./tooltipVariants.js";
|
|
5
6
|
const s = (e) => {
|
|
6
|
-
const { triggerProps:
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
|
|
7
|
+
const { triggerProps: o, contentProps: r, message: a, children: l, showQuestionMark: c = !1, questionIconSize: p, ...m } = e;
|
|
8
|
+
return /* @__PURE__ */ i(
|
|
9
|
+
d,
|
|
9
10
|
{
|
|
10
11
|
defaultOpen: !1,
|
|
11
12
|
delayDuration: 300,
|
|
12
|
-
...
|
|
13
|
+
...m,
|
|
13
14
|
children: [
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
|
|
15
|
+
/* @__PURE__ */ i(
|
|
16
|
+
x,
|
|
16
17
|
{
|
|
17
|
-
...
|
|
18
|
-
className:
|
|
18
|
+
...o || {},
|
|
19
|
+
className: n(
|
|
19
20
|
"flex flex-row gap-1 w-fit",
|
|
20
21
|
"items-center",
|
|
21
22
|
"cursor-pointer",
|
|
22
23
|
"outline-none",
|
|
23
|
-
|
|
24
|
+
o?.className
|
|
24
25
|
),
|
|
25
26
|
type: "button",
|
|
26
27
|
children: [
|
|
27
|
-
|
|
28
|
-
c && /* @__PURE__ */
|
|
28
|
+
l,
|
|
29
|
+
c && /* @__PURE__ */ t(
|
|
30
|
+
f,
|
|
31
|
+
{
|
|
32
|
+
className: h({
|
|
33
|
+
size: p
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
)
|
|
29
37
|
]
|
|
30
38
|
}
|
|
31
39
|
),
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
40
|
+
/* @__PURE__ */ t(
|
|
41
|
+
g,
|
|
34
42
|
{
|
|
35
43
|
align: "center",
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
sideOffset: 8,
|
|
45
|
+
...r || {},
|
|
46
|
+
className: n(
|
|
38
47
|
"flex items-center justify-center",
|
|
39
|
-
"max-w-
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
48
|
+
"w-auto max-w-80",
|
|
49
|
+
"rounded-xl",
|
|
50
|
+
"px-4 py-3",
|
|
51
|
+
"bg-white",
|
|
52
|
+
"text-primary",
|
|
53
|
+
"text-md font-normal leading-normal",
|
|
54
|
+
"shadow-[1px_1px_10px_0px_rgba(6,8,13,0.1)]",
|
|
43
55
|
"whitespace-pre-wrap",
|
|
44
|
-
|
|
56
|
+
r?.className
|
|
45
57
|
),
|
|
46
|
-
children:
|
|
58
|
+
children: a || ""
|
|
47
59
|
}
|
|
48
60
|
)
|
|
49
61
|
]
|
|
50
62
|
}
|
|
51
63
|
);
|
|
52
|
-
},
|
|
53
|
-
const { skipProvider:
|
|
54
|
-
return
|
|
64
|
+
}, P = (e) => {
|
|
65
|
+
const { skipProvider: o = !0 } = e;
|
|
66
|
+
return o ? /* @__PURE__ */ t(s, { ...e }) : /* @__PURE__ */ t(u, { children: /* @__PURE__ */ t(s, { ...e }) });
|
|
55
67
|
};
|
|
56
68
|
export {
|
|
57
|
-
|
|
69
|
+
P as Tooltip,
|
|
58
70
|
s as TooltipInner
|
|
59
71
|
};
|
|
60
72
|
//# sourceMappingURL=Tooltip.js.map
|
package/Tooltip/Tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["import { CircleQuestionMarkIcon } from 'lucide-react';\nimport { PropsWithChildren } from \"react\";\n\nimport { cn } from \"@oneplatformdev/utils\";\nimport type { TooltipProps } from \"./Tooltip.types\";\nimport { TooltipRoot, TooltipTrigger, TooltipContent, TooltipProvider } from \"./TooltipRoot\";\n\nexport const TooltipInner = (props: PropsWithChildren<TooltipProps>) => {\n const { triggerProps, contentProps, message, children, showQuestionMark = false, ...rest } = props;\n return (\n <TooltipRoot\n defaultOpen={false}\n delayDuration={300}\n {...rest}\n >\n <TooltipTrigger\n {...(triggerProps || {})}\n className={cn(\n 'flex flex-row gap-1 w-fit',\n 'items-center',\n 'cursor-pointer',\n 'outline-none',\n triggerProps?.className\n )}\n type='button'\n >\n {children}\n {showQuestionMark && <CircleQuestionMarkIcon
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["import { CircleQuestionMarkIcon } from 'lucide-react';\nimport { PropsWithChildren } from \"react\";\n\nimport { cn } from \"@oneplatformdev/utils\";\nimport type { TooltipProps } from \"./Tooltip.types\";\nimport { TooltipRoot, TooltipTrigger, TooltipContent, TooltipProvider } from \"./TooltipRoot\";\nimport { tooltipQuestionIconVariants } from './tooltipVariants';\n\nexport const TooltipInner = (props: PropsWithChildren<TooltipProps>) => {\n const { triggerProps, contentProps, message, children, showQuestionMark = false, questionIconSize, ...rest } = props;\n return (\n <TooltipRoot\n defaultOpen={false}\n delayDuration={300}\n {...rest}\n >\n <TooltipTrigger\n {...(triggerProps || {})}\n className={cn(\n 'flex flex-row gap-1 w-fit',\n 'items-center',\n 'cursor-pointer',\n 'outline-none',\n triggerProps?.className\n )}\n type='button'\n >\n {children}\n {showQuestionMark && (\n <CircleQuestionMarkIcon\n className={tooltipQuestionIconVariants({\n size: questionIconSize,\n })}\n />\n )}\n </TooltipTrigger>\n\n <TooltipContent\n align=\"center\"\n sideOffset={8}\n {...(contentProps || {})}\n className={cn(\n 'flex items-center justify-center',\n 'w-auto max-w-80',\n 'rounded-xl',\n 'px-4 py-3',\n 'bg-white',\n 'text-primary',\n 'text-md font-normal leading-normal',\n 'shadow-[1px_1px_10px_0px_rgba(6,8,13,0.1)]',\n 'whitespace-pre-wrap',\n contentProps?.className\n )}\n >\n {message || ''}\n </TooltipContent>\n </TooltipRoot>\n );\n};\n\nexport const Tooltip = (props: PropsWithChildren<TooltipProps>) => {\n const { skipProvider = true } = props;\n if (skipProvider) return <TooltipInner {...props}/>;\n return (\n <TooltipProvider>\n <TooltipInner {...props}/>\n </TooltipProvider>\n );\n};\n"],"names":["TooltipInner","props","triggerProps","contentProps","message","children","showQuestionMark","questionIconSize","rest","jsxs","TooltipRoot","TooltipTrigger","cn","jsx","CircleQuestionMarkIcon","tooltipQuestionIconVariants","TooltipContent","Tooltip","skipProvider","TooltipProvider"],"mappings":";;;;;AAQO,MAAMA,IAAe,CAACC,MAA2C;AACtE,QAAM,EAAE,cAAAC,GAAc,cAAAC,GAAc,SAAAC,GAAS,UAAAC,GAAU,kBAAAC,IAAmB,IAAO,kBAAAC,GAAkB,GAAGC,EAAA,IAASP;AAC/G,SACE,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,aAAa;AAAA,MACb,eAAe;AAAA,MACd,GAAGF;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAC;AAAA,UAACE;AAAA,UAAA;AAAA,YACE,GAAIT,KAAgB,CAAA;AAAA,YACrB,WAAWU;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACAV,GAAc;AAAA,YAAA;AAAA,YAEhB,MAAK;AAAA,YAEJ,UAAA;AAAA,cAAAG;AAAA,cACAC,KACC,gBAAAO;AAAA,gBAACC;AAAA,gBAAA;AAAA,kBACC,WAAWC,EAA4B;AAAA,oBACrC,MAAMR;AAAA,kBAAA,CACP;AAAA,gBAAA;AAAA,cAAA;AAAA,YACH;AAAA,UAAA;AAAA,QAAA;AAAA,QAIJ,gBAAAM;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,OAAM;AAAA,YACN,YAAY;AAAA,YACX,GAAIb,KAAgB,CAAA;AAAA,YACrB,WAAWS;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACAT,GAAc;AAAA,YAAA;AAAA,YAGf,UAAAC,KAAW;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAAA;AAGN,GAEaa,IAAU,CAAChB,MAA2C;AACjE,QAAM,EAAE,cAAAiB,IAAe,GAAA,IAASjB;AAChC,SAAIiB,IAAqB,gBAAAL,EAACb,GAAA,EAAc,GAAGC,EAAA,CAAM,sBAE9CkB,GAAA,EACC,UAAA,gBAAAN,EAACb,GAAA,EAAc,GAAGC,GAAM,GAC1B;AAEJ;"}
|
|
@@ -6,5 +6,6 @@ export interface TooltipProps extends ComponentPropsWithoutRef<typeof TooltipRoo
|
|
|
6
6
|
showQuestionMark?: boolean;
|
|
7
7
|
contentProps?: ComponentPropsWithoutRef<typeof TooltipContent>;
|
|
8
8
|
triggerProps?: ComponentPropsWithoutRef<typeof TooltipTrigger>;
|
|
9
|
+
questionIconSize?: "xs" | "sm" | "md";
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=Tooltip.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.types.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE5E,MAAM,WAAW,YAAa,SAAQ,wBAAwB,CAAC,OAAO,WAAW,CAAC;IAChF,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,wBAAwB,CAAC,OAAO,cAAc,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,wBAAwB,CAAC,OAAO,cAAc,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.types.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE5E,MAAM,WAAW,YAAa,SAAQ,wBAAwB,CAAC,OAAO,WAAW,CAAC;IAChF,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,wBAAwB,CAAC,OAAO,cAAc,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,wBAAwB,CAAC,OAAO,cAAc,CAAC,CAAC;IAC/D,gBAAgB,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltipVariants.d.ts","sourceRoot":"","sources":["../../src/Tooltip/tooltipVariants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B;;8EAiBvC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cva as s } from "class-variance-authority";
|
|
2
|
+
const t = s(
|
|
3
|
+
[
|
|
4
|
+
"shrink-0",
|
|
5
|
+
"text-[#666A78]"
|
|
6
|
+
],
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
xs: "size-2",
|
|
11
|
+
sm: "size-3",
|
|
12
|
+
md: "size-4"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
size: "sm"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
export {
|
|
21
|
+
t as tooltipQuestionIconVariants
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=tooltipVariants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltipVariants.js","sources":["../../src/Tooltip/tooltipVariants.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\";\n\nexport const tooltipQuestionIconVariants = cva(\n [\n \"shrink-0\",\n \"text-[#666A78]\",\n ],\n {\n variants: {\n size: {\n xs: \"size-2\",\n sm: \"size-3\",\n md: \"size-4\",\n },\n },\n defaultVariants: {\n size: \"sm\",\n },\n }\n);\n"],"names":["tooltipQuestionIconVariants","cva"],"mappings":";AAEO,MAAMA,IAA8BC;AAAA,EACzC;AAAA,IACE;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneplatformdev/ui",
|
|
3
|
-
"version": "0.1.99-beta.
|
|
3
|
+
"version": "0.1.99-beta.55",
|
|
4
4
|
"description": "UI component library for OnePlatform",
|
|
5
5
|
"author": "One Platform Development Team",
|
|
6
6
|
"keywords": [
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
"recharts": "^3.2.0",
|
|
106
106
|
"sonner": "^2.0.7",
|
|
107
107
|
"vaul": "^1.1.2",
|
|
108
|
-
"@oneplatformdev/tokens": "^0.1.99-beta.
|
|
109
|
-
"@oneplatformdev/
|
|
110
|
-
"@oneplatformdev/
|
|
108
|
+
"@oneplatformdev/tokens": "^0.1.99-beta.55",
|
|
109
|
+
"@oneplatformdev/utils": "^0.1.99-beta.55",
|
|
110
|
+
"@oneplatformdev/hooks": "^0.1.99-beta.55"
|
|
111
111
|
},
|
|
112
112
|
"scripts": {
|
|
113
113
|
"chromatic": "chromatic"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormTooltipButton.d.ts","sourceRoot":"","sources":["../../src/Form/FormTooltipButton.tsx"],"names":[],"mappings":"AAKA,UAAU,sBAAsB;IAC9B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,eAAO,MAAM,iBAAiB,GAAI,aAAa,sBAAsB,4CA0BpE,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { cn as t } from "@oneplatformdev/utils";
|
|
3
|
-
import { CircleQuestionMarkIcon as n } from "lucide-react";
|
|
4
|
-
import { Popover as i, PopoverTrigger as m, PopoverContent as l } from "../Popover/Popover.js";
|
|
5
|
-
import { ButtonIcon as a } from "../ButtonIcon/ButtonIcon.js";
|
|
6
|
-
import "../ButtonIcon/buttonIconVariants.js";
|
|
7
|
-
const h = ({ content: o }) => /* @__PURE__ */ e(i, { children: [
|
|
8
|
-
/* @__PURE__ */ r(m, { asChild: !0, children: /* @__PURE__ */ r(
|
|
9
|
-
a,
|
|
10
|
-
{
|
|
11
|
-
color: "primary",
|
|
12
|
-
className: "w-2 h-2 rounded-full border-none",
|
|
13
|
-
size: "xs",
|
|
14
|
-
children: /* @__PURE__ */ r(n, { size: 4 })
|
|
15
|
-
}
|
|
16
|
-
) }),
|
|
17
|
-
/* @__PURE__ */ r(
|
|
18
|
-
l,
|
|
19
|
-
{
|
|
20
|
-
side: "right",
|
|
21
|
-
align: "center",
|
|
22
|
-
className: t(
|
|
23
|
-
"w-auto max-w-80 rounded-xl bg-white px-4 py-3 shadow-lg",
|
|
24
|
-
"text-sm text-primary font-manrope font-normal",
|
|
25
|
-
"text-md leading-normal tracking-normal align-middle"
|
|
26
|
-
),
|
|
27
|
-
children: o
|
|
28
|
-
}
|
|
29
|
-
)
|
|
30
|
-
] });
|
|
31
|
-
export {
|
|
32
|
-
h as FormTooltipButton
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=FormTooltipButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormTooltipButton.js","sources":["../../src/Form/FormTooltipButton.tsx"],"sourcesContent":["import { cn } from \"@oneplatformdev/utils\";\nimport { CircleQuestionMarkIcon } from \"lucide-react\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../Popover\";\nimport ButtonIcon from \"../ButtonIcon\";\n\ninterface FormTooltipButtonProps {\n content: React.ReactNode;\n}\n\nexport const FormTooltipButton = ({ content }: FormTooltipButtonProps) => {\n return (\n <Popover>\n <PopoverTrigger asChild>\n <ButtonIcon\n color=\"primary\"\n className=\"w-2 h-2 rounded-full border-none\"\n size=\"xs\"\n >\n <CircleQuestionMarkIcon size={4} />\n </ButtonIcon>\n </PopoverTrigger>\n\n <PopoverContent\n side=\"right\"\n align=\"center\"\n className={cn(\n \"w-auto max-w-80 rounded-xl bg-white px-4 py-3 shadow-lg\",\n \"text-sm text-primary font-manrope font-normal\",\n \"text-md leading-normal tracking-normal align-middle\"\n )}\n >\n {content}\n </PopoverContent>\n </Popover>\n );\n};\n"],"names":["FormTooltipButton","content","Popover","jsx","PopoverTrigger","ButtonIcon","CircleQuestionMarkIcon","PopoverContent","cn"],"mappings":";;;;;;AASO,MAAMA,IAAoB,CAAC,EAAE,SAAAC,0BAE/BC,GAAA,EACC,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAA,EAAe,SAAO,IACrB,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,WAAU;AAAA,MACV,MAAK;AAAA,MAEL,UAAA,gBAAAF,EAACG,GAAA,EAAuB,MAAM,EAAA,CAAG;AAAA,IAAA;AAAA,EAAA,GAErC;AAAA,EAEA,gBAAAH;AAAA,IAACI;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAM;AAAA,MACN,WAAWC;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAGD,UAAAP;AAAA,IAAA;AAAA,EAAA;AACH,GACF;"}
|