@oneplatformdev/ui 0.1.10-100 → 0.1.10-102
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 +24 -0
- package/Dialog/Dialog.js +12 -12
- package/Dialog/Dialog.js.map +1 -1
- package/FormSelect/FormSelect.d.ts.map +1 -1
- package/FormSelect/FormSelect.js +26 -24
- package/FormSelect/FormSelect.js.map +1 -1
- package/FormSelect/FormSelect.types.d.ts +4 -2
- package/FormSelect/FormSelect.types.d.ts.map +1 -1
- package/Select/Select.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## 0.1.10-102 (2025-12-03)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- enhance FormSelect with onChangePrepare and updated onChange signature ([3b4402b](https://github.com/oneplatformdev/core-web/commit/3b4402b))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated @oneplatformdev/utils to 0.1.1-151
|
|
10
|
+
- Updated @oneplatformdev/hooks to 0.1.0-137
|
|
11
|
+
- Updated @oneplatformdev/tokens to 0.0.1-124
|
|
12
|
+
|
|
13
|
+
### ❤️ Thank You
|
|
14
|
+
|
|
15
|
+
- Bohdan Radchenko
|
|
16
|
+
|
|
17
|
+
## 0.1.10-101 (2025-12-03)
|
|
18
|
+
|
|
19
|
+
### 🧱 Updated Dependencies
|
|
20
|
+
|
|
21
|
+
- Updated @oneplatformdev/utils to 0.1.1-150
|
|
22
|
+
- Updated @oneplatformdev/hooks to 0.1.0-136
|
|
23
|
+
- Updated @oneplatformdev/tokens to 0.0.1-123
|
|
24
|
+
|
|
1
25
|
## 0.1.10-100 (2025-12-03)
|
|
2
26
|
|
|
3
27
|
### 🧱 Updated Dependencies
|
package/Dialog/Dialog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "@radix-ui/react-dialog";
|
|
3
3
|
import { XIcon as c } from "lucide-react";
|
|
4
4
|
import { cn as n } from "@oneplatformdev/utils";
|
|
@@ -17,7 +17,7 @@ function u({
|
|
|
17
17
|
}) {
|
|
18
18
|
return /* @__PURE__ */ e(a.Portal, { "data-slot": "dialog-portal", ...t });
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function D({
|
|
21
21
|
...t
|
|
22
22
|
}) {
|
|
23
23
|
return /* @__PURE__ */ e(a.Close, { "data-slot": "dialog-close", ...t });
|
|
@@ -38,15 +38,15 @@ function g({
|
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function b(t) {
|
|
42
42
|
const {
|
|
43
43
|
className: o,
|
|
44
|
-
children:
|
|
44
|
+
children: i,
|
|
45
45
|
showCloseButton: l = !0,
|
|
46
46
|
style: r,
|
|
47
47
|
...d
|
|
48
48
|
} = t;
|
|
49
|
-
return /* @__PURE__ */ e(u, { "data-slot": "dialog-portal", children: /* @__PURE__ */ e(g, { children: /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ e(u, { "data-slot": "dialog-portal", children: /* @__PURE__ */ e(g, { children: /* @__PURE__ */ s(
|
|
50
50
|
a.Content,
|
|
51
51
|
{
|
|
52
52
|
"data-slot": "dialog-content",
|
|
@@ -65,8 +65,8 @@ function h(t) {
|
|
|
65
65
|
...r || {}
|
|
66
66
|
},
|
|
67
67
|
children: [
|
|
68
|
-
|
|
69
|
-
l && /* @__PURE__ */
|
|
68
|
+
i,
|
|
69
|
+
l && /* @__PURE__ */ s(
|
|
70
70
|
a.Close,
|
|
71
71
|
{
|
|
72
72
|
"data-slot": "dialog-close",
|
|
@@ -80,7 +80,7 @@ function h(t) {
|
|
|
80
80
|
"cursor-pointer size-10 flex items-center justify-center"
|
|
81
81
|
),
|
|
82
82
|
children: [
|
|
83
|
-
/* @__PURE__ */ e(c, {}),
|
|
83
|
+
/* @__PURE__ */ e(c, { className: "size-6 text-[#06080D]" }),
|
|
84
84
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Close" })
|
|
85
85
|
]
|
|
86
86
|
}
|
|
@@ -89,7 +89,7 @@ function h(t) {
|
|
|
89
89
|
}
|
|
90
90
|
) }) });
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function h({ className: t, ...o }) {
|
|
93
93
|
return /* @__PURE__ */ e(
|
|
94
94
|
"div",
|
|
95
95
|
{
|
|
@@ -140,11 +140,11 @@ function z({
|
|
|
140
140
|
}
|
|
141
141
|
export {
|
|
142
142
|
x as Dialog,
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
D as DialogClose,
|
|
144
|
+
b as DialogContent,
|
|
145
145
|
z as DialogDescription,
|
|
146
146
|
y as DialogFooter,
|
|
147
|
-
|
|
147
|
+
h as DialogHeader,
|
|
148
148
|
g as DialogOverlay,
|
|
149
149
|
u as DialogPortal,
|
|
150
150
|
a as DialogPrimitive,
|
package/Dialog/Dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../../src/Dialog/Dialog.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"@oneplatformdev/utils\"\n\nfunction Dialog({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent(props: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}) {\n const {\n className,\n children,\n showCloseButton = true,\n style,\n ...rest\n } = props;\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay>\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-[50%] left-[50%] z-50 translate-x-[-50%] translate-y-[-50%]',\n 'grid w-full max-w-[calc(100%-2rem)] gap-4 sm:max-w-2xl',\n 'bg-background rounded-lg border p-6 shadow-lg duration-200',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n \"focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0 focus:ring-transparent\",\n 'outline-none focus:outline-none focus-visible:outline-none',\n className\n )}\n {...rest}\n style={{\n pointerEvents: 'auto',\n ...(style || {}),\n }}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className={cn(\n 'absolute top-4 right-4 rounded-2xl opacity-70 transition-opacity hover:opacity-100',\n 'data-[state=open]:bg-accent data-[state=open]:text-muted-foreground',\n 'ring-offset-background focus:ring-transparent focus:ring-0 focus:ring-offset-0 focus:outline-hidden',\n 'focus:outline-none focus:ring-0',\n 'disabled:pointer-events-none [&_svg]:pointer-events-none',\n '[&_svg]:shrink-0 [&_svg:not([class*=\"size-\"])]:size-5',\n 'cursor-pointer size-10 flex items-center justify-center',\n )}\n >\n <XIcon/>\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogOverlay>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-4 text-center sm:text-left\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-xl leading-none font-bold text-[#06080D]\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-[#363B4E] font-medium text-base\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogPrimitive\n}\n"],"names":["Dialog","props","DialogPrimitive","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","className","jsx","cn","DialogContent","children","showCloseButton","style","rest","jsxs","XIcon","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":";;;;AAQA,SAASA,EAAO;AAAA,EACE,GAAGC;AACL,GAAsD;AACpE,2BAAQC,EAAgB,MAAhB,EAAqB,aAAU,UAAU,GAAGD,GAAO;AAC7D;AAEA,SAASE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AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,YAGF,UAAA;AAAA,cAAA,gBAAAD,EAACQ,GAAA,
|
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../../src/Dialog/Dialog.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"@oneplatformdev/utils\"\n\nfunction Dialog({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent(props: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}) {\n const {\n className,\n children,\n showCloseButton = true,\n style,\n ...rest\n } = props;\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay>\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-[50%] left-[50%] z-50 translate-x-[-50%] translate-y-[-50%]',\n 'grid w-full max-w-[calc(100%-2rem)] gap-4 sm:max-w-2xl',\n 'bg-background rounded-lg border p-6 shadow-lg duration-200',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n \"focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0 focus:ring-transparent\",\n 'outline-none focus:outline-none focus-visible:outline-none',\n className\n )}\n {...rest}\n style={{\n pointerEvents: 'auto',\n ...(style || {}),\n }}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className={cn(\n 'absolute top-4 right-4 rounded-2xl opacity-70 transition-opacity hover:opacity-100',\n 'data-[state=open]:bg-accent data-[state=open]:text-muted-foreground',\n 'ring-offset-background focus:ring-transparent focus:ring-0 focus:ring-offset-0 focus:outline-hidden',\n 'focus:outline-none focus:ring-0',\n 'disabled:pointer-events-none [&_svg]:pointer-events-none',\n '[&_svg]:shrink-0 [&_svg:not([class*=\"size-\"])]:size-5',\n 'cursor-pointer size-10 flex items-center justify-center',\n )}\n >\n <XIcon className='size-6 text-[#06080D]'/>\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogOverlay>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-4 text-center sm:text-left\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-xl leading-none font-bold text-[#06080D]\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n }: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-[#363B4E] font-medium text-base\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogPrimitive\n}\n"],"names":["Dialog","props","DialogPrimitive","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","className","jsx","cn","DialogContent","children","showCloseButton","style","rest","jsxs","XIcon","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":";;;;AAQA,SAASA,EAAO;AAAA,EACE,GAAGC;AACL,GAAsD;AACpE,2BAAQC,EAAgB,MAAhB,EAAqB,aAAU,UAAU,GAAGD,GAAO;AAC7D;AAEA,SAASE,EAAc;AAAA,EACE,GAAGF;AACL,GAAyD;AAC9E,2BAAQC,EAAgB,SAAhB,EAAwB,aAAU,kBAAkB,GAAGD,GAAO;AACxE;AAEA,SAASG,EAAa;AAAA,EACE,GAAGH;AACL,GAAwD;AAC5E,2BAAQC,EAAgB,QAAhB,EAAuB,aAAU,iBAAiB,GAAGD,GAAO;AACtE;AAEA,SAASI,EAAY;AAAA,EACE,GAAGJ;AACL,GAAuD;AAC1E,2BAAQC,EAAgB,OAAhB,EAAsB,aAAU,gBAAgB,GAAGD,GAAO;AACpE;AAEA,SAASK,EAAc;AAAA,EACE,WAAAC;AAAA,EACA,GAAGN;AACL,GAAyD;AAC9E,SACE,gBAAAO;AAAA,IAACN,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAWO;AAAA,QACT;AAAA,QACAF;AAAA,MAAA;AAAA,MAED,GAAGN;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASS,EAAcT,GAEpB;AAC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;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAF;AAAA,MAAA;AAAA,MAED,GAAGN;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASkB,EAAY;AAAA,EACE,WAAAZ;AAAA,EACA,GAAGN;AACL,GAAuD;AAC1E,SACE,gBAAAO;AAAA,IAACN,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAWO,EAAG,iDAAiDF,CAAS;AAAA,MACvE,GAAGN;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASmB,EAAkB;AAAA,EACE,WAAAb;AAAA,EACA,GAAGN;AACL,GAA6D;AACtF,SACE,gBAAAO;AAAA,IAACN,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAWO,EAAG,wCAAwCF,CAAS;AAAA,MAC9D,GAAGN;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -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,4CAyC/C,CAAC"}
|
package/FormSelect/FormSelect.js
CHANGED
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { FormControl as
|
|
3
|
-
import { FormRenderControl as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl as C } from "../Form/Form.js";
|
|
3
|
+
import { FormRenderControl as d } 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 j = (
|
|
7
|
+
import { Select as f } from "../Select/Select.js";
|
|
8
|
+
const j = (m) => {
|
|
9
9
|
const {
|
|
10
|
-
form:
|
|
11
|
-
label:
|
|
12
|
-
name:
|
|
10
|
+
form: i,
|
|
11
|
+
label: p,
|
|
12
|
+
name: a,
|
|
13
13
|
options: g = [],
|
|
14
|
-
onChange:
|
|
15
|
-
containerProps:
|
|
14
|
+
onChange: c,
|
|
15
|
+
containerProps: s,
|
|
16
16
|
renderTrigger: l,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
onChangePrepare: n,
|
|
18
|
+
...h
|
|
19
|
+
} = m;
|
|
20
|
+
return /* @__PURE__ */ e(
|
|
21
|
+
d,
|
|
21
22
|
{
|
|
22
|
-
form:
|
|
23
|
-
name:
|
|
24
|
-
label:
|
|
25
|
-
containerProps:
|
|
26
|
-
render: ({ field:
|
|
27
|
-
|
|
23
|
+
form: i,
|
|
24
|
+
name: a,
|
|
25
|
+
label: p,
|
|
26
|
+
containerProps: s,
|
|
27
|
+
render: ({ field: t }) => /* @__PURE__ */ e(
|
|
28
|
+
f,
|
|
28
29
|
{
|
|
29
|
-
value:
|
|
30
|
+
value: t.value,
|
|
30
31
|
options: g,
|
|
31
32
|
onChange: (r) => {
|
|
32
|
-
|
|
33
|
+
const o = n ? n(r) : r;
|
|
34
|
+
t.onChange(o), c?.(r, o);
|
|
33
35
|
},
|
|
34
|
-
renderTrigger: (r,
|
|
35
|
-
...
|
|
36
|
+
renderTrigger: (r, o) => /* @__PURE__ */ e(C, { children: l?.(r, o) || o }),
|
|
37
|
+
...h
|
|
36
38
|
}
|
|
37
39
|
)
|
|
38
40
|
}
|
|
@@ -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 form,\n label,\n name,\n options = [],\n onChange,\n containerProps,\n renderTrigger,\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}\n options={options}\n onChange={(value) => {\n field.onChange(
|
|
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 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}\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","form","label","name","options","onChange","containerProps","renderTrigger","onChangePrepare","rest","jsx","FormRenderControl","field","Select","value","nextValue","p","defaultComponent","FormControl"],"mappings":";;;;;;;AAMO,MAAMA,IAAa,CACxBC,MACG;AACH,QAAM;AAAA,IACJ,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,IACDT;AAEJ,SACE,gBAAAU;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAV;AAAA,MACA,MAAAE;AAAA,MACA,OAAAD;AAAA,MACA,gBAAAI;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAM,EAAA,MACT,gBAAAF;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,OAAOD,EAAM;AAAA,UACb,SAAAR;AAAA,UACA,UAAU,CAACU,MAAU;AACnB,kBAAMC,IAAYP,IAAkBA,EAAgBM,CAAK,IAAIA;AAC7D,YAAAF,EAAM,SAASG,CAAS,GACxBV,IAAWS,GAAOC,CAAS;AAAA,UAC7B;AAAA,UACA,eAAe,CAACC,GAAGC,wBAEdC,GAAA,EACE,UAAAX,IAAgBS,GAAGC,CAAgB,KAAKA,GAC3C;AAAA,UAGH,GAAGR;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAIR;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
2
|
import { FormRenderControlExtendProps } from '../Form';
|
|
3
|
-
import { SelectProps } from '../Select';
|
|
4
|
-
export interface FormSelectProps<Data extends FieldValues, ExtendOptionData> extends FormRenderControlExtendProps<Data>, Omit<SelectProps<ExtendOptionData>, 'onChange'
|
|
3
|
+
import { SelectOption, SelectProps } from '../Select';
|
|
4
|
+
export interface FormSelectProps<Data extends FieldValues, ExtendOptionData> extends FormRenderControlExtendProps<Data>, Omit<SelectProps<ExtendOptionData>, 'onChange'> {
|
|
5
|
+
onChangePrepare?: <R>(value: SelectOption<ExtendOptionData>['value']) => R;
|
|
6
|
+
onChange?: <R>(value: SelectOption<ExtendOptionData>['value'], preparedValue: R) => void;
|
|
5
7
|
}
|
|
6
8
|
//# sourceMappingURL=FormSelect.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSelect.types.d.ts","sourceRoot":"","sources":["../../src/FormSelect/FormSelect.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"FormSelect.types.d.ts","sourceRoot":"","sources":["../../src/FormSelect/FormSelect.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,WAAW,eAAe,CAAC,IAAI,SAAS,WAAW,EAAE,gBAAgB,CACzE,SAAQ,4BAA4B,CAAC,IAAI,CAAC,EACxC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC;IACjD,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC3E,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC,KAAK,IAAI,CAAC;CAC1F"}
|
package/Select/Select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../src/Select/Select.tsx"],"sourcesContent":["import { HTMLAttributes, ReactNode
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../src/Select/Select.tsx"],"sourcesContent":["import { HTMLAttributes, ReactNode } from 'react';\n\nimport { Button } from '../Button';\nimport {\n SelectContent,\n SelectItem,\n SelectOption,\n SelectProps,\n SelectRoot,\n SelectTrigger,\n SelectValue,\n} from '../Select';\nimport { cn } from '@oneplatformdev/utils';\n\nconst RenderSelectTrigger = <ExtendOptionData,>(\n props: SelectProps<ExtendOptionData>\n) => {\n const { placeholder, renderTrigger, slotProps } = props;\n const defaultComponent = (\n <SelectTrigger {...(slotProps?.triggerProps || {})}>\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n );\n\n if (Boolean(renderTrigger) && typeof renderTrigger === 'function') {\n return renderTrigger(props, defaultComponent);\n }\n\n return defaultComponent;\n};\n\nconst DefaultRenderSelectOption = <ExtendOptionData,>(\n props: SelectProps<ExtendOptionData> & {\n option: SelectOption<ExtendOptionData>;\n index: number;\n deep?: number;\n child?: ((params: SelectProps<ExtendOptionData> & {\n option: SelectOption<ExtendOptionData>;\n index: number;\n }) => ReactNode) | ReactNode;\n } & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>\n) => {\n const { children, child, option, deep = 0, className, style = {} } = props;\n\n return (\n <SelectItem\n key={option.value}\n value={option.value ?? ''}\n disabled={option.disabled}\n className={cn('cursor-pointer', className)}\n style={{ paddingLeft: `calc(8px + ${(deep || 0) * 8}px)`, ...(style || {}) }}\n >\n {children}\n {!child && option.label}\n {child && (\n <>\n {typeof child === 'function'\n ? child({ ...props })\n : child\n }\n </>\n )}\n </SelectItem>\n )\n};\n\nconst RenderSelectOption = <ExtendOptionData,>(\n props: SelectProps<ExtendOptionData> & {\n option: SelectOption<ExtendOptionData>;\n index: number;\n deep?: number;\n }\n) => {\n const { renderOption, option, index, options, deep = 0, ...rest } = props;\n if(!renderOption) return <DefaultRenderSelectOption {...props} />;\n if(renderOption && typeof renderOption !== 'function') return <DefaultRenderSelectOption {...props} />;\n if(renderOption && typeof renderOption === 'function') return renderOption(\n option,\n index,\n options,\n { ...rest, options },\n <DefaultRenderSelectOption {...props} />\n )\n\n if(!option.children?.length) {\n return <DefaultRenderSelectOption {...props} />;\n }\n\n return (\n <div\n key={option.value}\n className=\"flex flex-col gap-1 truncate line-clamp-2\"\n >\n <DefaultRenderSelectOption {...props} />\n {option.children?.map((child, idx, arr) => (\n <RenderSelectOption\n {...props}\n key={child.value}\n option={child}\n options={arr}\n index={idx}\n deep={(deep || 0) + 1}\n />\n ))}\n </div>\n )\n};\n\n// TODO: add description\nexport const Select = <ExtendOptionData,>(\n props: SelectProps<ExtendOptionData>\n) => {\n const {\n value,\n options,\n onChange,\n nullable = false,\n clearLabel = 'Clear',\n disabled,\n slotProps,\n } = props;\n\n return (\n <SelectRoot value={value} onValueChange={onChange} disabled={disabled}>\n <RenderSelectTrigger {...props} />\n <SelectContent {...(slotProps?.selectProps || {})}>\n {nullable && (\n <Button\n className=\"w-full px-2\"\n variant=\"secondary\"\n size=\"sm\"\n onClick={() => {\n onChange?.('');\n }}\n >\n {clearLabel}\n </Button>\n )}\n {options.map((option, index) => (\n <RenderSelectOption\n {...props}\n key={option.value}\n option={option}\n index={index}\n deep={0}\n />\n ))}\n </SelectContent>\n </SelectRoot>\n );\n};\n"],"names":["RenderSelectTrigger","props","placeholder","renderTrigger","slotProps","defaultComponent","jsx","SelectTrigger","SelectValue","DefaultRenderSelectOption","children","child","option","deep","className","style","jsxs","SelectItem","cn","Fragment","RenderSelectOption","renderOption","index","options","rest","idx","arr","createElement","Select","value","onChange","nullable","clearLabel","disabled","SelectRoot","SelectContent","Button"],"mappings":";;;;;;AAcA,MAAMA,IAAsB,CAC1BC,MACG;AACH,QAAM,EAAE,aAAAC,GAAa,eAAAC,GAA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AAA,MAGJT,EAAQ,IAAI,CAACX,GAAQU,MACpB,gBAAAK;AAAA,QAACP;AAAA,QAAA;AAAA,UACE,GAAGnB;AAAA,UACJ,KAAKW,EAAO;AAAA,UACZ,QAAAA;AAAA,UACA,OAAAU;AAAA,UACA,MAAM;AAAA,QAAA;AAAA,MAAA,CAET;AAAA,IAAA,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneplatformdev/ui",
|
|
3
|
-
"version": "0.1.10-
|
|
3
|
+
"version": "0.1.10-102",
|
|
4
4
|
"description": "UI component library for OnePlatform",
|
|
5
5
|
"author": "One Platform Development Team",
|
|
6
6
|
"keywords": [
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"recharts": "^3.2.0",
|
|
106
106
|
"sonner": "^2.0.7",
|
|
107
107
|
"vaul": "^1.1.2",
|
|
108
|
-
"@oneplatformdev/hooks": "^0.1.0-
|
|
109
|
-
"@oneplatformdev/
|
|
110
|
-
"@oneplatformdev/
|
|
108
|
+
"@oneplatformdev/hooks": "^0.1.0-137",
|
|
109
|
+
"@oneplatformdev/tokens": "^0.0.1-124",
|
|
110
|
+
"@oneplatformdev/utils": "^0.1.1-151"
|
|
111
111
|
}
|
|
112
112
|
}
|