@oneplatformdev/ui 0.1.10-119 → 0.1.10-120
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/Button/Button.d.ts.map +1 -1
- package/Button/Button.js +33 -33
- package/Button/Button.js.map +1 -1
- package/CHANGELOG.md +31 -0
- package/package.json +4 -4
package/Button/Button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAmDlD,eAAO,MAAM,MAAM,uFA+DlB,CAAA;AAGD,eAAe,MAAM,CAAC"}
|
package/Button/Button.js
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as b, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import * as x from "react";
|
|
3
3
|
import { Slot as z } from "@radix-ui/react-slot";
|
|
4
4
|
import { cn as k } from "@oneplatformdev/utils";
|
|
5
|
-
import { buttonVariants as
|
|
5
|
+
import { buttonVariants as N } from "./buttonVariants.js";
|
|
6
6
|
import "@radix-ui/react-tooltip";
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
import { LoadedIcon as
|
|
9
|
-
const
|
|
10
|
-
const { variant:
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
if (
|
|
7
|
+
import { Tooltip as j } from "../Tooltip/Tooltip.js";
|
|
8
|
+
import { LoadedIcon as p } from "../LoadedIcon/LoadedIcon.js";
|
|
9
|
+
const A = (n) => {
|
|
10
|
+
const { variant: e, size: o, color: r } = n, t = { color: r, variant: e, size: o };
|
|
11
|
+
if (o === "icon")
|
|
12
|
+
return console.warn('Button size "icon" is not supported. Please use ButtonIcon component for icon-only buttons.'), t;
|
|
13
|
+
if (e === "default")
|
|
14
14
|
return console.warn('Button variant "default" is deprecated. Please use "variant=contained color=primary" instead.'), t.variant = "contained", t.color = "primary", t;
|
|
15
|
-
if (
|
|
15
|
+
if (e === "outline")
|
|
16
16
|
return console.warn('Button variant "outline" is deprecated. Please use "variant=outlined color=primary" instead.'), t.variant = "outlined", t.color = "primary", t;
|
|
17
|
-
if (
|
|
17
|
+
if (e === "secondary")
|
|
18
18
|
return console.warn('Button variant "secondary" is deprecated. Please use "variant=contained color=secondary" instead.'), t.variant = "contained", t.color = "secondary", t;
|
|
19
|
-
if (
|
|
19
|
+
if (e === "ghost")
|
|
20
20
|
return console.warn('Button variant "ghost" is deprecated. Please use "variant=text color=primary" instead.'), t.variant = "text", t.color = "primary", t;
|
|
21
|
-
if (
|
|
21
|
+
if (e === "destructive")
|
|
22
22
|
return console.warn('Button variant "destructive" is deprecated. Please use "variant=contained color=error" instead.'), t.variant = "contained", t.color = "error", t;
|
|
23
|
-
if (
|
|
23
|
+
if (e === "link")
|
|
24
24
|
throw console.warn('Button variant "link" is not implemented yet. Please contact the development team for more information.'), new Error('Button variant "link" is not implemented yet. Please contact the development team for more information.');
|
|
25
25
|
return t;
|
|
26
|
-
},
|
|
27
|
-
(n,
|
|
26
|
+
}, C = x.forwardRef(
|
|
27
|
+
(n, e) => {
|
|
28
28
|
const {
|
|
29
|
-
disabled:
|
|
29
|
+
disabled: o,
|
|
30
30
|
className: r,
|
|
31
31
|
variant: t,
|
|
32
|
-
color:
|
|
32
|
+
color: u,
|
|
33
33
|
size: f,
|
|
34
34
|
asChild: v = !1,
|
|
35
35
|
title: y = "",
|
|
36
|
-
tooltip:
|
|
36
|
+
tooltip: h,
|
|
37
37
|
tooltipProps: c = {},
|
|
38
|
-
message:
|
|
38
|
+
message: B,
|
|
39
39
|
loading: a = !1,
|
|
40
40
|
children: w,
|
|
41
41
|
startAdornment: l,
|
|
42
42
|
endAdornment: d,
|
|
43
43
|
...P
|
|
44
|
-
} = n,
|
|
45
|
-
|
|
44
|
+
} = n, g = v ? z : "button", i = B || h || y, m = /* @__PURE__ */ b(
|
|
45
|
+
g,
|
|
46
46
|
{
|
|
47
47
|
type: "button",
|
|
48
|
-
ref:
|
|
49
|
-
disabled:
|
|
48
|
+
ref: e,
|
|
49
|
+
disabled: o,
|
|
50
50
|
className: k(
|
|
51
|
-
|
|
52
|
-
...
|
|
51
|
+
N({
|
|
52
|
+
...A({ variant: t, size: f, color: u }),
|
|
53
53
|
className: r
|
|
54
54
|
}),
|
|
55
55
|
a && "pointer-events-none opacity-80"
|
|
56
56
|
),
|
|
57
57
|
...P,
|
|
58
58
|
children: [
|
|
59
|
-
!!l && /* @__PURE__ */ s(
|
|
59
|
+
!!l && /* @__PURE__ */ s(p, { loading: a, children: l }),
|
|
60
60
|
w,
|
|
61
|
-
!!d && /* @__PURE__ */ s(
|
|
61
|
+
!!d && /* @__PURE__ */ s(p, { loading: a, children: d })
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
65
|
return i ? /* @__PURE__ */ s(
|
|
66
|
-
|
|
66
|
+
j,
|
|
67
67
|
{
|
|
68
68
|
...c || {},
|
|
69
|
-
open: c.open ?? (
|
|
69
|
+
open: c.open ?? (o || !i) ? !1 : void 0,
|
|
70
70
|
message: i,
|
|
71
71
|
children: m
|
|
72
72
|
}
|
|
73
73
|
) : m;
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
|
-
|
|
76
|
+
C.displayName = "Button";
|
|
77
77
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
C as Button,
|
|
79
|
+
C as default
|
|
80
80
|
};
|
|
81
81
|
//# sourceMappingURL=Button.js.map
|
package/Button/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../src/Button/Button.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\n\nimport { cn } from \"@oneplatformdev/utils\"\nimport { ButtonCVAProps, buttonVariants } from './buttonVariants';\nimport { type ButtonProps } from './Button.types';\n\nimport { Tooltip } from '../Tooltip';\nimport { LoadedIcon } from \"../LoadedIcon\";\n\nconst normalizedVariantProperties = (props: ButtonCVAProps): ButtonCVAProps => {\n const { variant, size, color } = props;\n const vls = { color, variant, size }\n if(size === 'icon') {\n console.warn('Button size \"icon\" is not supported. Please use ButtonIcon component for icon-only buttons.')\n throw new Error('Button size \"icon\" is not supported. Please use ButtonIcon component for icon-only buttons.')\n }\n if(variant === 'default') {\n console.warn('Button variant \"default\" is deprecated. Please use \"variant=contained color=primary\" instead.')\n vls.variant = 'contained'\n vls.color = 'primary'\n return vls\n }\n if(variant === 'outline') {\n console.warn('Button variant \"outline\" is deprecated. Please use \"variant=outlined color=primary\" instead.')\n vls.variant = 'outlined'\n vls.color = 'primary'\n return vls\n }\n if(variant === 'secondary') {\n console.warn('Button variant \"secondary\" is deprecated. Please use \"variant=contained color=secondary\" instead.')\n vls.variant = 'contained'\n vls.color = 'secondary'\n return vls\n }\n if(variant === 'ghost') {\n console.warn('Button variant \"ghost\" is deprecated. Please use \"variant=text color=primary\" instead.')\n vls.variant = 'text'\n vls.color = 'primary'\n return vls\n }\n if(variant === 'destructive') {\n console.warn('Button variant \"destructive\" is deprecated. Please use \"variant=contained color=error\" instead.')\n vls.variant = 'contained'\n vls.color = 'error'\n return vls\n }\n if(variant === 'link') {\n console.warn('Button variant \"link\" is not implemented yet. Please contact the development team for more information.')\n throw new Error('Button variant \"link\" is not implemented yet. Please contact the development team for more information.')\n }\n return vls;\n}\n\n// TODO: create ButtonIcon component | update button | add start/end icon\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (props, ref) => {\n const {\n disabled,\n className,\n variant,\n color,\n size,\n asChild = false,\n title = '',\n tooltip,\n tooltipProps = {},\n message,\n loading = false,\n children,\n startAdornment,\n endAdornment,\n ...rest\n } = props;\n const Comp = asChild ? Slot : \"button\"\n const msg = message || tooltip || title;\n\n const cmp = (\n <Comp\n type='button'\n ref={ref}\n disabled={disabled}\n className={cn(\n buttonVariants({\n ...normalizedVariantProperties({ variant, size, color }),\n className\n }),\n loading && 'pointer-events-none opacity-80',\n )}\n {...rest}\n >\n {!!startAdornment && (\n <LoadedIcon loading={loading}>\n {startAdornment}\n </LoadedIcon>\n )}\n\n {children}\n\n {!!endAdornment && (\n <LoadedIcon loading={loading}>\n {endAdornment}\n </LoadedIcon>\n )}\n </Comp>\n )\n\n if (!msg) return cmp\n return (\n <Tooltip\n {...(tooltipProps || {})}\n open={tooltipProps.open ?? (disabled || !msg) ? false : undefined}\n message={msg}\n >\n {cmp}\n </Tooltip>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport default Button;\n"],"names":["normalizedVariantProperties","props","variant","size","color","vls","Button","React","ref","disabled","className","asChild","title","tooltip","tooltipProps","message","loading","children","startAdornment","endAdornment","rest","Comp","Slot","msg","cmp","jsxs","cn","buttonVariants","jsx","LoadedIcon","Tooltip"],"mappings":";;;;;;;;AAUA,MAAMA,IAA8B,CAACC,MAA0C;AAC7E,QAAM,EAAE,SAAAC,GAAS,MAAAC,GAAM,OAAAC,EAAA,IAAUH,GAC3BI,IAAM,EAAE,OAAAD,GAAO,SAAAF,GAAS,MAAAC,EAAA;AAC9B,MAAGA,MAAS;AACV,
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../src/Button/Button.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\n\nimport { cn } from \"@oneplatformdev/utils\"\nimport { ButtonCVAProps, buttonVariants } from './buttonVariants';\nimport { type ButtonProps } from './Button.types';\n\nimport { Tooltip } from '../Tooltip';\nimport { LoadedIcon } from \"../LoadedIcon\";\n\nconst normalizedVariantProperties = (props: ButtonCVAProps): ButtonCVAProps => {\n const { variant, size, color } = props;\n const vls = { color, variant, size }\n if(size === 'icon') {\n console.warn('Button size \"icon\" is not supported. Please use ButtonIcon component for icon-only buttons.')\n return vls;\n throw new Error('Button size \"icon\" is not supported. Please use ButtonIcon component for icon-only buttons.')\n }\n if(variant === 'default') {\n console.warn('Button variant \"default\" is deprecated. Please use \"variant=contained color=primary\" instead.')\n vls.variant = 'contained'\n vls.color = 'primary'\n return vls\n }\n if(variant === 'outline') {\n console.warn('Button variant \"outline\" is deprecated. Please use \"variant=outlined color=primary\" instead.')\n vls.variant = 'outlined'\n vls.color = 'primary'\n return vls\n }\n if(variant === 'secondary') {\n console.warn('Button variant \"secondary\" is deprecated. Please use \"variant=contained color=secondary\" instead.')\n vls.variant = 'contained'\n vls.color = 'secondary'\n return vls\n }\n if(variant === 'ghost') {\n console.warn('Button variant \"ghost\" is deprecated. Please use \"variant=text color=primary\" instead.')\n vls.variant = 'text'\n vls.color = 'primary'\n return vls\n }\n if(variant === 'destructive') {\n console.warn('Button variant \"destructive\" is deprecated. Please use \"variant=contained color=error\" instead.')\n vls.variant = 'contained'\n vls.color = 'error'\n return vls\n }\n if(variant === 'link') {\n console.warn('Button variant \"link\" is not implemented yet. Please contact the development team for more information.')\n throw new Error('Button variant \"link\" is not implemented yet. Please contact the development team for more information.')\n }\n return vls;\n}\n\n// TODO: create ButtonIcon component | update button | add start/end icon\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (props, ref) => {\n const {\n disabled,\n className,\n variant,\n color,\n size,\n asChild = false,\n title = '',\n tooltip,\n tooltipProps = {},\n message,\n loading = false,\n children,\n startAdornment,\n endAdornment,\n ...rest\n } = props;\n const Comp = asChild ? Slot : \"button\"\n const msg = message || tooltip || title;\n\n const cmp = (\n <Comp\n type='button'\n ref={ref}\n disabled={disabled}\n className={cn(\n buttonVariants({\n ...normalizedVariantProperties({ variant, size, color }),\n className\n }),\n loading && 'pointer-events-none opacity-80',\n )}\n {...rest}\n >\n {!!startAdornment && (\n <LoadedIcon loading={loading}>\n {startAdornment}\n </LoadedIcon>\n )}\n\n {children}\n\n {!!endAdornment && (\n <LoadedIcon loading={loading}>\n {endAdornment}\n </LoadedIcon>\n )}\n </Comp>\n )\n\n if (!msg) return cmp\n return (\n <Tooltip\n {...(tooltipProps || {})}\n open={tooltipProps.open ?? (disabled || !msg) ? false : undefined}\n message={msg}\n >\n {cmp}\n </Tooltip>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport default Button;\n"],"names":["normalizedVariantProperties","props","variant","size","color","vls","Button","React","ref","disabled","className","asChild","title","tooltip","tooltipProps","message","loading","children","startAdornment","endAdornment","rest","Comp","Slot","msg","cmp","jsxs","cn","buttonVariants","jsx","LoadedIcon","Tooltip"],"mappings":";;;;;;;;AAUA,MAAMA,IAA8B,CAACC,MAA0C;AAC7E,QAAM,EAAE,SAAAC,GAAS,MAAAC,GAAM,OAAAC,EAAA,IAAUH,GAC3BI,IAAM,EAAE,OAAAD,GAAO,SAAAF,GAAS,MAAAC,EAAA;AAC9B,MAAGA,MAAS;AACV,mBAAQ,KAAK,6FAA6F,GACnGE;AAGT,MAAGH,MAAY;AACb,mBAAQ,KAAK,+FAA+F,GAC5GG,EAAI,UAAU,aACdA,EAAI,QAAQ,WACLA;AAET,MAAGH,MAAY;AACb,mBAAQ,KAAK,8FAA8F,GAC3GG,EAAI,UAAU,YACdA,EAAI,QAAQ,WACLA;AAET,MAAGH,MAAY;AACb,mBAAQ,KAAK,mGAAmG,GAChHG,EAAI,UAAU,aACdA,EAAI,QAAQ,aACLA;AAET,MAAGH,MAAY;AACb,mBAAQ,KAAK,wFAAwF,GACrGG,EAAI,UAAU,QACdA,EAAI,QAAQ,WACLA;AAET,MAAGH,MAAY;AACb,mBAAQ,KAAK,iGAAiG,GAC9GG,EAAI,UAAU,aACdA,EAAI,QAAQ,SACLA;AAET,MAAGH,MAAY;AACb,kBAAQ,KAAK,y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YA;AAAA,EAUnB;AACF;AACAlB,EAAO,cAAc;"}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
## 0.1.10-120 (2025-12-26)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- enhance FormSelect with onChangePrepare and updated onChange signature ([3b4402b](https://github.com/oneplatformdev/core-web/commit/3b4402b))
|
|
6
|
+
|
|
7
|
+
### 🩹 Fixes
|
|
8
|
+
|
|
9
|
+
- **FormSelect:** ensure default value is an empty string when undefined ([056631f](https://github.com/oneplatformdev/core-web/commit/056631f))
|
|
10
|
+
- update icon size for large button variant ([1e7c0a7](https://github.com/oneplatformdev/core-web/commit/1e7c0a7))
|
|
11
|
+
- add min-width to large button variant ([e34bc71](https://github.com/oneplatformdev/core-web/commit/e34bc71))
|
|
12
|
+
- handle undefined value in FormSelect component ([9c7ae4a](https://github.com/oneplatformdev/core-web/commit/9c7ae4a))
|
|
13
|
+
- minor alert dialog content ([#41](https://github.com/oneplatformdev/core-web/pull/41))
|
|
14
|
+
- update Dialog component title font size for better readability and add .env to .gitignore ([9646134](https://github.com/oneplatformdev/core-web/commit/9646134))
|
|
15
|
+
- adjust Dialog component styling for better alignment and update container size in CSS ([afaa5af](https://github.com/oneplatformdev/core-web/commit/afaa5af))
|
|
16
|
+
- update XIcon styling in Dialog component for improved visibility ([164338b](https://github.com/oneplatformdev/core-web/commit/164338b))
|
|
17
|
+
- update dialog primitive close ([5e7c577](https://github.com/oneplatformdev/core-web/commit/5e7c577))
|
|
18
|
+
- update dialog primitive close ([560b5ba](https://github.com/oneplatformdev/core-web/commit/560b5ba))
|
|
19
|
+
- update dialog primitive close ([f63b143](https://github.com/oneplatformdev/core-web/commit/f63b143))
|
|
20
|
+
|
|
21
|
+
### 🧱 Updated Dependencies
|
|
22
|
+
|
|
23
|
+
- Updated @oneplatformdev/utils to 0.1.1-169
|
|
24
|
+
- Updated @oneplatformdev/hooks to 0.1.0-155
|
|
25
|
+
- Updated @oneplatformdev/tokens to 0.0.1-142
|
|
26
|
+
|
|
27
|
+
### ❤️ Thank You
|
|
28
|
+
|
|
29
|
+
- Bohdan Radchenko @BohdanRadchenko
|
|
30
|
+
- BohdanRadchenko
|
|
31
|
+
|
|
1
32
|
## 0.1.10-118 (2025-12-23)
|
|
2
33
|
|
|
3
34
|
### 🧱 Updated Dependencies
|
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-120",
|
|
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/tokens": "^0.0.1-
|
|
109
|
-
"@oneplatformdev/
|
|
110
|
-
"@oneplatformdev/
|
|
108
|
+
"@oneplatformdev/tokens": "^0.0.1-142",
|
|
109
|
+
"@oneplatformdev/utils": "^0.1.1-169",
|
|
110
|
+
"@oneplatformdev/hooks": "^0.1.0-155"
|
|
111
111
|
}
|
|
112
112
|
}
|