@oneplatformdev/ui 0.1.99-beta.4 → 0.1.99-beta.6
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 +1 -7
- package/Button/Button.d.ts.map +1 -1
- package/Button/Button.js +47 -43
- package/Button/Button.js.map +1 -1
- package/Button/Button.stories.js +45 -53
- package/Button/Button.stories.js.map +1 -1
- package/Button/Button.types.d.ts +8 -1
- package/Button/Button.types.d.ts.map +1 -1
- package/ButtonIcon/ButtonIcon.d.ts +26 -20
- package/ButtonIcon/ButtonIcon.d.ts.map +1 -1
- package/ButtonIcon/ButtonIcon.js +51 -43
- package/ButtonIcon/ButtonIcon.js.map +1 -1
- package/ButtonIcon/ButtonIcon.stories.js +89 -73
- package/ButtonIcon/ButtonIcon.stories.js.map +1 -1
- package/ButtonIcon/ButtonIcon.types.d.ts +2 -1
- package/ButtonIcon/ButtonIcon.types.d.ts.map +1 -1
- package/CHANGELOG.md +25 -0
- package/package.json +7 -4
- package/Button/Button.s.d.ts +0 -83
- package/Button/Button.s.d.ts.map +0 -1
- package/Button/Button.s.js +0 -163
- package/Button/Button.s.js.map +0 -1
package/ButtonIcon/ButtonIcon.js
CHANGED
|
@@ -1,61 +1,69 @@
|
|
|
1
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { jsx as n, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import * as j from "react";
|
|
3
|
+
import { isValidElement as B, createElement as C } from "react";
|
|
4
|
+
import { cn as E } from "@oneplatformdev/utils";
|
|
5
|
+
import { buttonIconVariants as I } from "./buttonIconVariants.js";
|
|
6
|
+
import { Slot as V } from "@radix-ui/react-slot";
|
|
6
7
|
import "@radix-ui/react-tooltip";
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
import { LoadedIcon as
|
|
9
|
-
const
|
|
10
|
-
(
|
|
8
|
+
import { Tooltip as w } from "../Tooltip/Tooltip.js";
|
|
9
|
+
import { LoadedIcon as z } from "../LoadedIcon/LoadedIcon.js";
|
|
10
|
+
const L = (t) => t ? B(t) ? t : C(t) : null, P = j.forwardRef(
|
|
11
|
+
(t, d) => {
|
|
11
12
|
const {
|
|
12
|
-
asChild:
|
|
13
|
-
children:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
asChild: s,
|
|
14
|
+
children: i,
|
|
15
|
+
icon: f,
|
|
16
|
+
disabled: a = !1,
|
|
17
|
+
loading: o = !1,
|
|
18
|
+
message: u,
|
|
19
|
+
title: h = "",
|
|
20
|
+
tooltipProps: l = {},
|
|
21
|
+
className: g,
|
|
22
|
+
variant: y,
|
|
21
23
|
color: b,
|
|
22
|
-
size:
|
|
23
|
-
rounded:
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
size: m,
|
|
25
|
+
rounded: x,
|
|
26
|
+
screenReader: e,
|
|
27
|
+
...N
|
|
28
|
+
} = t, v = s ? V : "button", r = u || h, c = s ? i : /* @__PURE__ */ n(z, { loading: o, size: m, children: L(f) ?? i });
|
|
29
|
+
if (!c) return null;
|
|
30
|
+
const p = /* @__PURE__ */ R(
|
|
26
31
|
v,
|
|
27
32
|
{
|
|
28
33
|
type: "button",
|
|
29
|
-
ref:
|
|
30
|
-
disabled:
|
|
31
|
-
className:
|
|
32
|
-
|
|
33
|
-
variant:
|
|
34
|
-
size:
|
|
34
|
+
ref: d,
|
|
35
|
+
disabled: a,
|
|
36
|
+
className: E(
|
|
37
|
+
I({
|
|
38
|
+
variant: y,
|
|
39
|
+
size: m,
|
|
35
40
|
color: b,
|
|
36
|
-
rounded:
|
|
37
|
-
className:
|
|
41
|
+
rounded: x,
|
|
42
|
+
className: g
|
|
38
43
|
}),
|
|
39
|
-
|
|
44
|
+
o && "pointer-events-none opacity-80"
|
|
40
45
|
),
|
|
41
|
-
...
|
|
42
|
-
children:
|
|
46
|
+
...N,
|
|
47
|
+
children: [
|
|
48
|
+
c,
|
|
49
|
+
!!e && /* @__PURE__ */ n("span", { className: "sr-only", children: typeof e == "string" ? e : e.text })
|
|
50
|
+
]
|
|
43
51
|
}
|
|
44
52
|
);
|
|
45
|
-
return
|
|
46
|
-
|
|
53
|
+
return r ? /* @__PURE__ */ n(
|
|
54
|
+
w,
|
|
47
55
|
{
|
|
48
|
-
...
|
|
49
|
-
open:
|
|
50
|
-
message:
|
|
51
|
-
children:
|
|
56
|
+
...l || {},
|
|
57
|
+
open: l.open ?? (a || o || !r) ? !1 : void 0,
|
|
58
|
+
message: r,
|
|
59
|
+
children: p
|
|
52
60
|
}
|
|
53
|
-
) :
|
|
61
|
+
) : p;
|
|
54
62
|
}
|
|
55
63
|
);
|
|
56
|
-
|
|
64
|
+
P.displayName = "Button";
|
|
57
65
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
P as ButtonIcon,
|
|
67
|
+
P as default
|
|
60
68
|
};
|
|
61
69
|
//# sourceMappingURL=ButtonIcon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.js","sources":["../../src/ButtonIcon/ButtonIcon.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@oneplatformdev/utils\"\nimport { buttonIconVariants } from './buttonIconVariants';\nimport { ButtonIconProps } from './ButtonIcon.types';\nimport { Slot } from \"@radix-ui/react-slot\"\n\nimport { Tooltip } from '../Tooltip';\nimport { LoadedIcon } from \"../LoadedIcon\";\n\n/**\n * Icon-only version of the Button component.\n *\n * `ButtonIcon` is used for compact actions represented by an icon instead of text.\n * Supports all core features of Button: variants, sizes, tooltips, disabled and loading state.\n *\n * @example\n * > Basic usage:\n * ```tsx\n
|
|
1
|
+
{"version":3,"file":"ButtonIcon.js","sources":["../../src/ButtonIcon/ButtonIcon.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@oneplatformdev/utils\"\nimport { buttonIconVariants } from './buttonIconVariants';\nimport { ButtonIconProps } from './ButtonIcon.types';\nimport { Slot } from \"@radix-ui/react-slot\"\n\nimport { Tooltip } from '../Tooltip';\nimport { LoadedIcon } from \"../LoadedIcon\";\nimport { ButtonIconType } from \"../Button\";\nimport { createElement, isValidElement } from \"react\";\n\nconst renderInnerIcon = (Icon?: ButtonIconType) => {\n if (!Icon) return null;\n if (isValidElement(Icon)) return Icon;\n return createElement(Icon);\n};\n\n/**\n * Icon-only version of the Button component.\n *\n * `ButtonIcon` is used for compact actions represented by an icon instead of text.\n * Supports all core features of Button: variants, sizes, tooltips, disabled and loading state.\n *\n * @public\n * @see [Documentation](#) // TODO: add link to docs\n *\n * @example\n * > Import:\n * ```tsx\n * import { ButtonIcon } from '@oneplatformdev/ui/ButtonIcon';\n * ```\n * > Basic usage by icon:\n * ```tsx\n *<ButtonIcon icon={<PlusIcon />}/>\n *<ButtonIcon icon={PlusIcon}/>\n * ```\n * > Basic usage by children:\n * ```tsx\n *<ButtonIcon>\n * <PlusIcon />\n *</ButtonIcon>\n * ```\n * > With variant & color:\n * ```tsx\n *<ButtonIcon variant=\"outline\" color=\"primary\">\n * <Search />\n *</ButtonIcon>\n * ```\n * > With tooltip message:\n * ```tsx\n *<ButtonIcon message=\"Edit item\">\n * <PencilLine />\n *</ButtonIcon>\n * ```\n * > Loading state:\n * ```tsx\n *<ButtonIcon loading>\n * <Trash2 />\n *</ButtonIcon>\n * ```\n *\n * @remarks\n * - Designed for icon-only usage. If you need text, use `Button`.\n * - Works with any SVG React component or element, e.g. lucide-react, heroicons, custom icons.\n *\n * @see {@link ButtonIcon} for icon-only buttons\n */\nexport const ButtonIcon = React.forwardRef<HTMLButtonElement, ButtonIconProps>(\n (props, ref) => {\n const {\n asChild,\n children,\n icon,\n disabled = false,\n loading = false,\n message,\n title = '',\n tooltipProps = {},\n className,\n variant,\n color,\n size,\n rounded,\n screenReader,\n ...rest\n } = props;\n\n const Comp = asChild ? Slot : \"button\"\n const msg = message || title;\n\n const content = asChild\n ? children\n : (\n <LoadedIcon loading={loading} size={size}>\n {renderInnerIcon(icon) ?? children}\n </LoadedIcon>\n )\n\n if (!content) return null;\n\n const cmp = (\n <Comp\n type='button'\n ref={ref}\n disabled={disabled}\n className={cn(\n buttonIconVariants({\n variant, size, color, rounded,\n className\n }),\n loading && 'pointer-events-none opacity-80',\n )}\n {...rest}\n >\n {content}\n {!!screenReader && <span className=\"sr-only\">\n {typeof screenReader === 'string' ? screenReader : screenReader.text}\n </span>}\n </Comp>\n )\n\n if (!msg) return cmp\n return (\n <Tooltip\n {...(tooltipProps || {})}\n open={tooltipProps.open ?? (disabled || loading || !msg) ? false : undefined}\n message={msg}\n >\n {cmp}\n </Tooltip>\n )\n }\n)\nButtonIcon.displayName = \"Button\"\nexport default ButtonIcon;\n"],"names":["renderInnerIcon","Icon","isValidElement","createElement","ButtonIcon","React","props","ref","asChild","children","icon","disabled","loading","message","title","tooltipProps","className","variant","color","size","rounded","screenReader","rest","Comp","Slot","msg","content","jsx","LoadedIcon","cmp","jsxs","cn","buttonIconVariants","Tooltip"],"mappings":";;;;;;;;;AAYA,MAAMA,IAAkB,CAACC,MAClBA,IACDC,EAAeD,CAAI,IAAUA,IAC1BE,EAAcF,CAAI,IAFP,MAuDPG,IAAaC,EAAM;AAAA,EAC9B,CAACC,GAAOC,MAAQ;AACd,UAAM;AAAA,MACJ,SAAAC;AAAA,MACA,UAAAC;AAAA,MACA,MAAAC;AAAA,MACA,UAAAC,IAAW;AAAA,MACX,SAAAC,IAAU;AAAA,MACV,SAAAC;AAAA,MACA,OAAAC,IAAQ;AAAA,MACR,cAAAC,IAAe,CAAA;AAAA,MACf,WAAAC;AAAA,MACA,SAAAC;AAAA,MACA,OAAAC;AAAA,MACA,MAAAC;AAAA,MACA,SAAAC;AAAA,MACA,cAAAC;AAAA,MACA,GAAGC;AAAA,IAAA,IACDhB,GAEEiB,IAAOf,IAAUgB,IAAO,UACxBC,IAAMZ,KAAWC,GAEjBY,IAAUlB,IACZC,IAEA,gBAAAkB,EAACC,GAAA,EAAW,SAAAhB,GAAkB,MAAAO,GAC3B,UAAAnB,EAAgBU,CAAI,KAAKD,EAAA,CAC5B;AAGJ,QAAI,CAACiB,EAAS,QAAO;AAErB,UAAMG,IACJ,gBAAAC;AAAA,MAACP;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,KAAAhB;AAAA,QACA,UAAAI;AAAA,QACA,WAAWoB;AAAA,UACTC,EAAmB;AAAA,YACjB,SAAAf;AAAA,YAAS,MAAAE;AAAA,YAAM,OAAAD;AAAA,YAAO,SAAAE;AAAA,YACtB,WAAAJ;AAAA,UAAA,CACD;AAAA,UACDJ,KAAW;AAAA,QAAA;AAAA,QAEZ,GAAGU;AAAA,QAEH,UAAA;AAAA,UAAAI;AAAA,UACA,CAAC,CAACL,KAAgB,gBAAAM,EAAC,QAAA,EAAK,WAAU,WAChC,UAAA,OAAON,KAAiB,WAAWA,IAAeA,EAAa,KAAA,CAClE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAIJ,WAAKI,IAEH,gBAAAE;AAAA,MAACM;AAAA,MAAA;AAAA,QACE,GAAIlB,KAAgB,CAAA;AAAA,QACrB,MAAMA,EAAa,SAASJ,KAAYC,KAAW,CAACa,KAAO,KAAQ;AAAA,QACnE,SAASA;AAAA,QAER,UAAAI;AAAA,MAAA;AAAA,IAAA,IAPYA;AAAA,EAUnB;AACF;AACAzB,EAAW,cAAc;"}
|
|
@@ -1,35 +1,12 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { ButtonIcon as
|
|
3
|
-
import { PlusIcon as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { ButtonIcon as c } from "./ButtonIcon.js";
|
|
3
|
+
import { FileDownIcon as r, Trash2Icon as l, PlusIcon as t } from "lucide-react";
|
|
4
|
+
import { DashedWrapper as u } from "../.storybook/Wrappers.js";
|
|
5
|
+
const h = (e) => /* @__PURE__ */ o(c, { ...e });
|
|
6
|
+
h.args = {
|
|
6
7
|
onClick: { action: (e) => e }
|
|
7
8
|
};
|
|
8
|
-
const
|
|
9
|
-
"div",
|
|
10
|
-
{
|
|
11
|
-
style: {
|
|
12
|
-
padding: "0px 20px",
|
|
13
|
-
display: "flex",
|
|
14
|
-
gap: "32px",
|
|
15
|
-
alignItems: "flex-start"
|
|
16
|
-
},
|
|
17
|
-
children: /* @__PURE__ */ o(
|
|
18
|
-
"div",
|
|
19
|
-
{
|
|
20
|
-
style: {
|
|
21
|
-
position: "relative",
|
|
22
|
-
border: "2px dashed rgba(139, 92, 246, 0.7)",
|
|
23
|
-
borderRadius: "24px",
|
|
24
|
-
padding: "24px 32px",
|
|
25
|
-
display: "flex",
|
|
26
|
-
gap: "32px"
|
|
27
|
-
},
|
|
28
|
-
children: e.children
|
|
29
|
-
}
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
), t = (e) => /* @__PURE__ */ o(
|
|
9
|
+
const n = (e) => /* @__PURE__ */ o(
|
|
33
10
|
"div",
|
|
34
11
|
{
|
|
35
12
|
style: {
|
|
@@ -39,7 +16,7 @@ const p = (e) => /* @__PURE__ */ o(
|
|
|
39
16
|
gap: "16px"
|
|
40
17
|
},
|
|
41
18
|
children: ["default", "hover", "focus", "active", "disabled"].map((a) => /* @__PURE__ */ o(
|
|
42
|
-
|
|
19
|
+
c,
|
|
43
20
|
{
|
|
44
21
|
id: a,
|
|
45
22
|
...e,
|
|
@@ -49,57 +26,76 @@ const p = (e) => /* @__PURE__ */ o(
|
|
|
49
26
|
a
|
|
50
27
|
))
|
|
51
28
|
}
|
|
52
|
-
),
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */ o(
|
|
55
|
-
/* @__PURE__ */ o(
|
|
56
|
-
/* @__PURE__ */ o(
|
|
29
|
+
), s = (e) => /* @__PURE__ */ i("div", { className: "flex", children: [
|
|
30
|
+
/* @__PURE__ */ i(u, { children: [
|
|
31
|
+
/* @__PURE__ */ o(n, { ...e, variant: "contained" }),
|
|
32
|
+
/* @__PURE__ */ o(n, { ...e, variant: "outlined" }),
|
|
33
|
+
/* @__PURE__ */ o(n, { ...e, variant: "ghost" })
|
|
57
34
|
] }),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */ o(
|
|
60
|
-
/* @__PURE__ */ o(
|
|
61
|
-
/* @__PURE__ */ o(
|
|
35
|
+
/* @__PURE__ */ i(u, { children: [
|
|
36
|
+
/* @__PURE__ */ o(n, { ...e, variant: "contained", rounded: !0 }),
|
|
37
|
+
/* @__PURE__ */ o(n, { ...e, variant: "outlined", rounded: !0 }),
|
|
38
|
+
/* @__PURE__ */ o(n, { ...e, variant: "ghost", rounded: !0 })
|
|
62
39
|
] })
|
|
63
|
-
] }),
|
|
40
|
+
] }), p = ["contained", "outlined", "ghost"], m = ["primary", "secondary", "error"], f = ["xs", "sm", "md", "lg"], y = "contained", I = "primary", B = "lg", g = {
|
|
41
|
+
undefined: void 0,
|
|
42
|
+
"<PlusIcon />": /* @__PURE__ */ o(t, {}),
|
|
43
|
+
"<Trash2Icon />": /* @__PURE__ */ o(l, {}),
|
|
44
|
+
"<FileDownIcon />": /* @__PURE__ */ o(r, {}),
|
|
45
|
+
PlusIcon: t,
|
|
46
|
+
Trash2Icon: l,
|
|
47
|
+
FileDownIcon: r
|
|
48
|
+
}, v = {
|
|
49
|
+
"<PlusIcon />": /* @__PURE__ */ o(t, {}),
|
|
50
|
+
"<Trash2Icon />": /* @__PURE__ */ o(l, {}),
|
|
51
|
+
"<FileDownIcon />": /* @__PURE__ */ o(r, {})
|
|
52
|
+
}, b = {
|
|
64
53
|
title: "ButtonIcon",
|
|
65
|
-
component:
|
|
66
|
-
render:
|
|
54
|
+
component: c,
|
|
55
|
+
render: h,
|
|
67
56
|
args: {
|
|
68
57
|
asChild: !1,
|
|
69
58
|
disabled: !1,
|
|
70
59
|
loading: !1,
|
|
71
60
|
rounded: !1,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
61
|
+
variant: y,
|
|
62
|
+
color: I,
|
|
63
|
+
size: B,
|
|
64
|
+
children: /* @__PURE__ */ o(t, {}),
|
|
65
|
+
icon: void 0,
|
|
66
|
+
message: void 0,
|
|
67
|
+
title: void 0
|
|
77
68
|
},
|
|
78
69
|
argTypes: {
|
|
70
|
+
tooltip: {
|
|
71
|
+
name: "tooltip",
|
|
72
|
+
description: "ButtonIcon tooltip from ButtonIconProps [deprecated, use title and message instead]",
|
|
73
|
+
control: !1
|
|
74
|
+
},
|
|
79
75
|
asChild: {
|
|
80
76
|
name: "asChild",
|
|
81
|
-
description: "ButtonIcon asChild",
|
|
77
|
+
description: "ButtonIcon asChild from ButtonIconProps [boolean]",
|
|
82
78
|
control: !1
|
|
83
79
|
},
|
|
84
80
|
variant: {
|
|
85
81
|
name: "variant",
|
|
86
82
|
description: "ButtonIcon variant",
|
|
87
|
-
defaultValue:
|
|
88
|
-
options:
|
|
83
|
+
defaultValue: p[0],
|
|
84
|
+
options: p,
|
|
89
85
|
control: { type: "inline-radio" }
|
|
90
86
|
},
|
|
91
87
|
color: {
|
|
92
88
|
name: "color",
|
|
93
89
|
description: "ButtonIcon color",
|
|
94
|
-
defaultValue:
|
|
95
|
-
options:
|
|
90
|
+
defaultValue: m[0],
|
|
91
|
+
options: m,
|
|
96
92
|
control: { type: "inline-radio" }
|
|
97
93
|
},
|
|
98
94
|
size: {
|
|
99
95
|
name: "size",
|
|
100
96
|
description: "ButtonIcon size",
|
|
101
|
-
defaultValue:
|
|
102
|
-
options:
|
|
97
|
+
defaultValue: f[0],
|
|
98
|
+
options: f,
|
|
103
99
|
control: { type: "inline-radio" }
|
|
104
100
|
},
|
|
105
101
|
title: {
|
|
@@ -126,6 +122,20 @@ const p = (e) => /* @__PURE__ */ o(
|
|
|
126
122
|
name: "loading",
|
|
127
123
|
description: "ButtonIcon loading",
|
|
128
124
|
control: { type: "boolean" }
|
|
125
|
+
},
|
|
126
|
+
icon: {
|
|
127
|
+
name: "icon",
|
|
128
|
+
description: "ButtonIcon icon from ButtonIconProps [`undefined` | `ComponentType<SVGProps<SVGSVGElement>>` | `ReactElement<SVGProps<SVGSVGElement>>`]",
|
|
129
|
+
options: Object.keys(g),
|
|
130
|
+
mapping: g,
|
|
131
|
+
control: { type: "inline-radio" }
|
|
132
|
+
},
|
|
133
|
+
children: {
|
|
134
|
+
name: "children",
|
|
135
|
+
description: "ButtonIcon children from ButtonIconProps [`ReactNode`]",
|
|
136
|
+
options: Object.keys(v),
|
|
137
|
+
mapping: v,
|
|
138
|
+
control: { type: "inline-radio" }
|
|
129
139
|
}
|
|
130
140
|
},
|
|
131
141
|
parameters: {
|
|
@@ -136,15 +146,21 @@ const p = (e) => /* @__PURE__ */ o(
|
|
|
136
146
|
disabled: "#disabled"
|
|
137
147
|
}
|
|
138
148
|
}
|
|
139
|
-
},
|
|
149
|
+
}, d = {
|
|
140
150
|
asChild: !1,
|
|
141
151
|
disabled: !1,
|
|
142
152
|
loading: !1,
|
|
143
153
|
rounded: !1,
|
|
144
|
-
children: /* @__PURE__ */ o(
|
|
145
|
-
},
|
|
154
|
+
children: /* @__PURE__ */ o(t, {})
|
|
155
|
+
}, D = {
|
|
156
|
+
args: {
|
|
157
|
+
...b.args,
|
|
158
|
+
icon: r,
|
|
159
|
+
children: void 0
|
|
160
|
+
}
|
|
161
|
+
}, x = {
|
|
146
162
|
args: {
|
|
147
|
-
...
|
|
163
|
+
...d,
|
|
148
164
|
color: "primary",
|
|
149
165
|
size: "lg"
|
|
150
166
|
},
|
|
@@ -152,14 +168,14 @@ const p = (e) => /* @__PURE__ */ o(
|
|
|
152
168
|
variant: { control: !1 },
|
|
153
169
|
color: { control: !1 }
|
|
154
170
|
},
|
|
155
|
-
render:
|
|
171
|
+
render: s
|
|
156
172
|
};
|
|
157
|
-
|
|
173
|
+
x.parameters = {
|
|
158
174
|
controls: { exclude: ["variant", "color"] }
|
|
159
175
|
};
|
|
160
|
-
const
|
|
176
|
+
const P = {
|
|
161
177
|
args: {
|
|
162
|
-
...
|
|
178
|
+
...d,
|
|
163
179
|
color: "secondary",
|
|
164
180
|
size: "lg"
|
|
165
181
|
},
|
|
@@ -167,14 +183,14 @@ const g = {
|
|
|
167
183
|
variant: { control: !1 },
|
|
168
184
|
color: { control: !1 }
|
|
169
185
|
},
|
|
170
|
-
render:
|
|
186
|
+
render: s
|
|
171
187
|
};
|
|
172
|
-
|
|
188
|
+
P.parameters = {
|
|
173
189
|
controls: { exclude: ["variant", "color"] }
|
|
174
190
|
};
|
|
175
|
-
const
|
|
191
|
+
const T = {
|
|
176
192
|
args: {
|
|
177
|
-
...
|
|
193
|
+
...d,
|
|
178
194
|
color: "error",
|
|
179
195
|
size: "lg"
|
|
180
196
|
},
|
|
@@ -182,16 +198,16 @@ const v = {
|
|
|
182
198
|
variant: { control: !1 },
|
|
183
199
|
color: { control: !1 }
|
|
184
200
|
},
|
|
185
|
-
render:
|
|
201
|
+
render: s
|
|
186
202
|
};
|
|
187
|
-
|
|
203
|
+
T.parameters = {
|
|
188
204
|
controls: { exclude: ["variant", "color"] }
|
|
189
205
|
};
|
|
190
206
|
export {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
207
|
+
D as Default,
|
|
208
|
+
T as Error,
|
|
209
|
+
x as Primary,
|
|
210
|
+
P as Secondary,
|
|
195
211
|
b as default
|
|
196
212
|
};
|
|
197
213
|
//# sourceMappingURL=ButtonIcon.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.stories.js","sources":["../../src/ButtonIcon/ButtonIcon.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react';\n\nimport { ButtonIcon } from './ButtonIcon';\nimport type { ButtonIconProps } from './ButtonIcon.types';\nimport React, { PropsWithChildren } from 'react';\nimport { PlusIcon } from 'lucide-react'\n\nconst Template = (props: ButtonIconProps) => <ButtonIcon {...props}/>\nTemplate.args = {\n onClick: { action: (e: React.MouseEvent<HTMLButtonElement>) => e },\n};\n\nconst DashedWrapper = (props: PropsWithChildren) => {\n return (\n <div\n style={{\n padding: '0px 20px',\n display: 'flex',\n gap: '32px',\n alignItems: 'flex-start',\n }}\n >\n <div\n style={{\n position: 'relative',\n border: '2px dashed rgba(139, 92, 246, 0.7)',\n borderRadius: '24px',\n padding: '24px 32px',\n display: 'flex',\n gap: '32px',\n }}\n >\n {props.children}\n </div>\n </div>\n )\n}\n\nconst States = (props: ButtonIconProps) => (\n <div\n style={{\n position: 'relative',\n display: 'flex',\n flexDirection: 'column',\n gap: '16px',\n }}\n >\n {[ 'default', 'hover', 'focus', 'active', 'disabled' ]\n .map((state) => (\n <ButtonIcon\n key={state}\n id={state}\n {...props}\n disabled={state === 'disabled' || props.disabled}\n >\n {props.children}\n </ButtonIcon>\n ))}\n </div>\n);\n\nconst StateRender = (props: ButtonIconProps) => (\n <div className='flex'>\n <DashedWrapper>\n <States {...props} variant='contained'/>\n <States {...props} variant='outlined'/>\n <States {...props} variant='ghost'/>\n </DashedWrapper>\n <DashedWrapper>\n <States {...props} variant='contained' rounded/>\n <States {...props} variant='outlined' rounded/>\n <States {...props} variant='ghost' rounded/>\n </DashedWrapper>\n </div>\n);\n\nconst variants: ButtonIconProps['variant'][] = [ 'contained', 'outlined', 'ghost' ]\nconst colors: ButtonIconProps['color'][] = [ 'primary', 'secondary', 'error' ]\nconst sizes: ButtonIconProps['size'][] = [ 'xs', 'sm', 'md', 'lg' ]\n\nconst meta = {\n title: 'ButtonIcon',\n component: ButtonIcon,\n render: Template,\n args: {\n asChild: false,\n disabled: false,\n loading: false,\n rounded: false,\n children: <PlusIcon/>,\n variant: variants[0],\n color: colors[0],\n size: sizes[0],\n message: '',\n },\n argTypes: {\n asChild: {\n name: 'asChild',\n description: 'ButtonIcon asChild',\n control: false\n },\n variant: {\n name: 'variant',\n description: 'ButtonIcon variant',\n defaultValue: variants[0],\n options: variants,\n control: { type: 'inline-radio', },\n },\n color: {\n name: 'color',\n description: 'ButtonIcon color',\n defaultValue: colors[0],\n options: colors,\n control: { type: 'inline-radio' },\n },\n size: {\n name: 'size',\n description: 'ButtonIcon size',\n defaultValue: sizes[0],\n options: sizes,\n control: { type: 'inline-radio' },\n },\n title: {\n name: 'title',\n description: \"ButtonIcon tooltip title from HTMLAttributes<HTMLButtonElement> [string only]\",\n control: { type: 'text' },\n },\n message: {\n name: 'message',\n description: 'ButtonIcon tooltip message from ButtonProps [ReactNode]',\n control: { type: \"object\" },\n },\n disabled: {\n name: 'disabled',\n description: 'ButtonIcon disabled',\n control: { type: 'boolean' }\n },\n rounded: {\n name: 'rounded',\n description: 'ButtonIcon rounded',\n control: { type: 'boolean' }\n },\n loading: {\n name: 'loading',\n description: 'ButtonIcon loading',\n control: { type: 'boolean' }\n },\n },\n parameters: {\n pseudo: {\n hover: '#hover',\n focus: '#focus',\n active: '#active',\n disabled: '#disabled',\n },\n }\n} satisfies Meta<typeof ButtonIcon>;\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\nconst args: Story['args'] = {\n asChild: false,\n disabled: false,\n loading: false,\n rounded: false,\n children: <PlusIcon/>,\n}\n\nexport const Default: Story = { args };\n\nexport const Primary: Story = {\n args: {\n ...args,\n color: 'primary',\n size: 'lg',\n },\n argTypes: {\n variant: { control: false },\n color: { control: false },\n },\n render: StateRender,\n};\nPrimary.parameters = {\n controls: { exclude: [ 'variant', 'color' ] },\n}\n\nexport const Secondary: Story = {\n args: {\n ...args,\n color: 'secondary',\n size: 'lg',\n },\n argTypes: {\n variant: { control: false },\n color: { control: false },\n },\n render: StateRender,\n};\nSecondary.parameters = {\n controls: { exclude: [ 'variant', 'color' ] },\n}\n\nexport const Error: Story = {\n args: {\n ...args,\n color: 'error',\n size: 'lg',\n },\n argTypes: {\n variant: { control: false },\n color: { control: false },\n },\n render: StateRender,\n};\nError.parameters = {\n controls: { exclude: [ 'variant', 'color' ] },\n}\n"],"names":["Template","props","jsx","ButtonIcon","DashedWrapper","States","state","StateRender","jsxs","variants","colors","sizes","meta","PlusIcon","args","Default","Primary","Secondary","Error"],"mappings":";;;AAOA,MAAMA,IAAW,CAACC,MAA2B,gBAAAC,EAACC,GAAA,EAAY,GAAGF,GAAM;AACnED,EAAS,OAAO;AAAA,EACd,SAAS,EAAE,QAAQ,CAAC,MAA2C,EAAA;AACjE;AAEA,MAAMI,IAAgB,CAACH,MAEnB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAO;AAAA,MACL,SAAS;AAAA,MACT,SAAS;AAAA,MACT,KAAK;AAAA,MACL,YAAY;AAAA,IAAA;AAAA,IAGd,UAAA,gBAAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,cAAc;AAAA,UACd,SAAS;AAAA,UACT,SAAS;AAAA,UACT,KAAK;AAAA,QAAA;AAAA,QAGN,UAAAD,EAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EACT;AAAA,GAKAI,IAAS,CAACJ,MACd,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAO;AAAA,MACL,UAAU;AAAA,MACV,SAAS;AAAA,MACT,eAAe;AAAA,MACf,KAAK;AAAA,IAAA;AAAA,IAGN,UAAA,CAAE,WAAW,SAAS,SAAS,UAAU,UAAW,EAClD,IAAI,CAACI,MACJ,gBAAAJ;AAAA,MAACC;AAAA,MAAA;AAAA,QAEC,IAAIG;AAAA,QACH,GAAGL;AAAA,QACJ,UAAUK,MAAU,cAAcL,EAAM;AAAA,QAEvC,UAAAA,EAAM;AAAA,MAAA;AAAA,MALFK;AAAA,IAAA,CAOR;AAAA,EAAA;AACL,GAGIC,IAAc,CAACN,MACnB,gBAAAO,EAAC,OAAA,EAAI,WAAU,QACb,UAAA;AAAA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AAU;AAAA,IACR,SAAS,EAAE,SAAS,GAAA;AAAA,IACpB,OAAO,EAAE,SAAS,GAAA;AAAA,EAAM;AAAA,EAE1B,QAAQP;AACV;AACAS,EAAQ,aAAa;AAAA,EACnB,UAAU,EAAE,SAAS,CAAE,WAAW,OAAQ,EAAA;AAC5C;AAEO,MAAMC,IAAmB;AAAA,EAC9B,MAAM;AAAA,IACJ,GAAGH;AAAA,IACH,OAAO;AAAA,IACP,MAAM;AAAA,EAAA;AAAA,EAER,UAAU;AAAA,IACR,SAAS,EAAE,SAAS,GAAA;AAAA,IACpB,OAAO,EAAE,SAAS,GAAA;AAAA,EAAM;AAAA,EAE1B,QAAQP;AACV;AACAU,EAAU,aAAa;AAAA,EACrB,UAAU,EAAE,SAAS,CAAE,WAAW,OAAQ,EAAA;AAC5C;AAEO,MAAMC,IAAe;AAAA,EAC1B,MAAM;AAAA,IACJ,GAAGJ;AAAA,IACH,OAAO;AAAA,IACP,MAAM;AAAA,EAAA;AAAA,EAER,UAAU;AAAA,IACR,SAAS,EAAE,SAAS,GAAA;AAAA,IACpB,OAAO,EAAE,SAAS,GAAA;AAAA,EAAM;AAAA,EAE1B,QAAQP;AACV;AACAW,EAAM,aAAa;AAAA,EACjB,UAAU,EAAE,SAAS,CAAE,WAAW,OAAQ,EAAA;AAC5C;"}
|
|
1
|
+
{"version":3,"file":"ButtonIcon.stories.js","sources":["../../src/ButtonIcon/ButtonIcon.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react';\n\nimport { ButtonIcon } from './ButtonIcon';\nimport type { ButtonIconProps } from './ButtonIcon.types';\nimport React from 'react';\nimport { FileDownIcon, PlusIcon, Trash2Icon } from 'lucide-react'\nimport { DashedWrapper } from \"../../.storybook/Wrappers\";\nimport { ButtonProps } from \"../Button\";\n\nconst Template = (props: ButtonIconProps) => <ButtonIcon {...props}/>\nTemplate.args = {\n onClick: { action: (e: React.MouseEvent<HTMLButtonElement>) => e },\n};\n\nconst States = (props: ButtonIconProps) => (\n <div\n style={{\n position: 'relative',\n display: 'flex',\n flexDirection: 'column',\n gap: '16px',\n }}\n >\n {[ 'default', 'hover', 'focus', 'active', 'disabled' ]\n .map((state) => (\n <ButtonIcon\n key={state}\n id={state}\n {...props}\n disabled={state === 'disabled' || props.disabled}\n >\n {props.children}\n </ButtonIcon>\n ))}\n </div>\n);\n\nconst StateRender = (props: ButtonIconProps) => (\n <div className='flex'>\n <DashedWrapper>\n <States {...props} variant='contained'/>\n <States {...props} variant='outlined'/>\n <States {...props} variant='ghost'/>\n </DashedWrapper>\n <DashedWrapper>\n <States {...props} variant='contained' rounded/>\n <States {...props} variant='outlined' rounded/>\n <States {...props} variant='ghost' rounded/>\n </DashedWrapper>\n </div>\n);\n\nconst variants: ButtonIconProps['variant'][] = [ 'contained', 'outlined', 'ghost' ]\nconst colors: ButtonIconProps['color'][] = [ 'primary', 'secondary', 'error' ]\nconst sizes: ButtonIconProps['size'][] = [ 'xs', 'sm', 'md', 'lg' ]\n\nconst variant_default: ButtonProps['variant'] = 'contained';\nconst color_default: ButtonProps['color'] = 'primary';\nconst size_default: ButtonProps['size'] = 'lg';\n\nconst iconMap = {\n 'undefined': undefined,\n \"<PlusIcon />\": <PlusIcon/>,\n \"<Trash2Icon />\": <Trash2Icon/>,\n \"<FileDownIcon />\": <FileDownIcon/>,\n PlusIcon: PlusIcon,\n Trash2Icon: Trash2Icon,\n FileDownIcon: FileDownIcon,\n};\n\nconst iconChildrenMap = {\n \"<PlusIcon />\": <PlusIcon/>,\n \"<Trash2Icon />\": <Trash2Icon/>,\n \"<FileDownIcon />\": <FileDownIcon/>,\n};\n\nconst meta = {\n title: 'ButtonIcon',\n component: ButtonIcon,\n render: Template,\n args: {\n asChild: false,\n disabled: false,\n loading: false,\n rounded: false,\n variant: variant_default,\n color: color_default,\n size: size_default,\n children: <PlusIcon/>,\n icon: undefined,\n message: undefined,\n title: undefined,\n },\n argTypes: {\n tooltip: {\n name: 'tooltip',\n description: 'ButtonIcon tooltip from ButtonIconProps [deprecated, use title and message instead]',\n control: false,\n },\n asChild: {\n name: 'asChild',\n description: 'ButtonIcon asChild from ButtonIconProps [boolean]',\n control: false\n },\n variant: {\n name: 'variant',\n description: 'ButtonIcon variant',\n defaultValue: variants[0],\n options: variants,\n control: { type: 'inline-radio', },\n },\n color: {\n name: 'color',\n description: 'ButtonIcon color',\n defaultValue: colors[0],\n options: colors,\n control: { type: 'inline-radio' },\n },\n size: {\n name: 'size',\n description: 'ButtonIcon size',\n defaultValue: sizes[0],\n options: sizes,\n control: { type: 'inline-radio' },\n },\n title: {\n name: 'title',\n description: \"ButtonIcon tooltip title from HTMLAttributes<HTMLButtonElement> [string only]\",\n control: { type: 'text' },\n },\n message: {\n name: 'message',\n description: 'ButtonIcon tooltip message from ButtonProps [ReactNode]',\n control: { type: \"object\" },\n },\n disabled: {\n name: 'disabled',\n description: 'ButtonIcon disabled',\n control: { type: 'boolean' }\n },\n rounded: {\n name: 'rounded',\n description: 'ButtonIcon rounded',\n control: { type: 'boolean' }\n },\n loading: {\n name: 'loading',\n description: 'ButtonIcon loading',\n control: { type: 'boolean' }\n },\n icon: {\n name: 'icon',\n description: 'ButtonIcon icon from ButtonIconProps [`undefined` | `ComponentType<SVGProps<SVGSVGElement>>` | `ReactElement<SVGProps<SVGSVGElement>>`]',\n options: Object.keys(iconMap),\n mapping: iconMap,\n control: { type: 'inline-radio' },\n },\n children: {\n name: 'children',\n description: 'ButtonIcon children from ButtonIconProps [`ReactNode`]',\n options: Object.keys(iconChildrenMap),\n mapping: iconChildrenMap,\n control: { type: 'inline-radio' },\n },\n },\n parameters: {\n pseudo: {\n hover: '#hover',\n focus: '#focus',\n active: '#active',\n disabled: '#disabled',\n },\n }\n} satisfies Meta<typeof ButtonIcon>;\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\nconst args: Story['args'] = {\n asChild: false,\n disabled: false,\n loading: false,\n rounded: false,\n children: <PlusIcon/>,\n}\n\nexport const Default: Story = {\n args: {\n ...meta.args,\n icon: FileDownIcon,\n children: undefined,\n }\n};\n\nexport const Primary: Story = {\n args: {\n ...args,\n color: 'primary',\n size: 'lg',\n },\n argTypes: {\n variant: { control: false },\n color: { control: false },\n },\n render: StateRender,\n};\nPrimary.parameters = {\n controls: { exclude: [ 'variant', 'color' ] },\n}\n\nexport const Secondary: Story = {\n args: {\n ...args,\n color: 'secondary',\n size: 'lg',\n },\n argTypes: {\n variant: { control: false },\n color: { control: false },\n },\n render: StateRender,\n};\nSecondary.parameters = {\n controls: { exclude: [ 'variant', 'color' ] },\n}\n\nexport const Error: Story = {\n args: {\n ...args,\n color: 'error',\n size: 'lg',\n },\n argTypes: {\n variant: { control: false },\n color: { control: false },\n },\n render: StateRender,\n};\nError.parameters = {\n controls: { exclude: [ 'variant', 'color' ] },\n}\n"],"names":["Template","props","jsx","ButtonIcon","States","state","StateRender","jsxs","DashedWrapper","variants","colors","sizes","variant_default","color_default","size_default","iconMap","PlusIcon","Trash2Icon","FileDownIcon","iconChildrenMap","meta","args","Default","Primary","Secondary","Error"],"mappings":";;;;AASA,MAAMA,IAAW,CAACC,MAA2B,gBAAAC,EAACC,GAAA,EAAY,GAAGF,GAAM;AACnED,EAAS,OAAO;AAAA,EACd,SAAS,EAAE,QAAQ,CAAC,MAA2C,EAAA;AACjE;AAEA,MAAMI,IAAS,CAACH,MACd,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAO;AAAA,MACL,UAAU;AAAA,MACV,SAAS;AAAA,MACT,eAAe;AAAA,MACf,KAAK;AAAA,IAAA;AAAA,IAGN,UAAA,CAAE,WAAW,SAAS,SAAS,UAAU,UAAW,EAClD,IAAI,CAACG,MACJ,gBAAAH;AAAA,MAACC;AAAA,MAAA;AAAA,QAEC,IAAIE;AAAA,QACH,GAAGJ;AAAA,QACJ,UAAUI,MAAU,cAAcJ,EAAM;AAAA,QAEvC,UAAAA,EAAM;AAAA,MAAA;AAAA,MALFI;AAAA,IAAA,CAOR;AAAA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SAAS,EAAE,SAAS,GAAA;AAAA,IACpB,OAAO,EAAE,SAAS,GAAA;AAAA,EAAM;AAAA,EAE1B,QAAQf;AACV;AACAkB,EAAU,aAAa;AAAA,EACrB,UAAU,EAAE,SAAS,CAAE,WAAW,OAAQ,EAAA;AAC5C;AAEO,MAAMC,IAAe;AAAA,EAC1B,MAAM;AAAA,IACJ,GAAGJ;AAAA,IACH,OAAO;AAAA,IACP,MAAM;AAAA,EAAA;AAAA,EAER,UAAU;AAAA,IACR,SAAS,EAAE,SAAS,GAAA;AAAA,IACpB,OAAO,EAAE,SAAS,GAAA;AAAA,EAAM;AAAA,EAE1B,QAAQf;AACV;AACAmB,EAAM,aAAa;AAAA,EACjB,UAAU,EAAE,SAAS,CAAE,WAAW,OAAQ,EAAA;AAC5C;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ButtonIconVarianceProps } from './buttonIconVariants';
|
|
2
|
-
import { ButtonBaseProps } from '../Button';
|
|
2
|
+
import { ButtonBaseProps, ButtonIconType } from '../Button';
|
|
3
3
|
export interface ButtonIconSlotProps {
|
|
4
4
|
}
|
|
5
5
|
export interface ButtonIconProps extends ButtonBaseProps<ButtonIconVarianceProps, ButtonIconSlotProps> {
|
|
6
|
+
icon?: ButtonIconType;
|
|
6
7
|
}
|
|
7
8
|
//# sourceMappingURL=ButtonIcon.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonIcon.types.d.ts","sourceRoot":"","sources":["../../src/ButtonIcon/ButtonIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EACL,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"ButtonIcon.types.d.ts","sourceRoot":"","sources":["../../src/ButtonIcon/ButtonIcon.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,mBAAmB;CAAG;AAEvC,MAAM,WAAW,eACf,SAAQ,eAAe,CAAC,uBAAuB,EAAE,mBAAmB,CAAC;IACrE,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB"}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
## 0.1.99-beta.6 (2025-12-29)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **ButtonIcon:** introduce icon-only variant with enhanced props and storybook support ([d643217](https://github.com/oneplatformdev/core-web/commit/d643217))
|
|
6
|
+
- **Button:** add storybook integration with loading and tooltip support ([72ae45e](https://github.com/oneplatformdev/core-web/commit/72ae45e))
|
|
7
|
+
|
|
8
|
+
### 🧱 Updated Dependencies
|
|
9
|
+
|
|
10
|
+
- Updated @oneplatformdev/utils to 0.1.99-beta.6
|
|
11
|
+
- Updated @oneplatformdev/hooks to 0.1.99-beta.6
|
|
12
|
+
- Updated @oneplatformdev/tokens to 0.1.99-beta.6
|
|
13
|
+
|
|
14
|
+
### ❤️ Thank You
|
|
15
|
+
|
|
16
|
+
- Bohdan Radchenko
|
|
17
|
+
|
|
18
|
+
## 0.1.99-beta.5 (2025-12-29)
|
|
19
|
+
|
|
20
|
+
### 🧱 Updated Dependencies
|
|
21
|
+
|
|
22
|
+
- Updated @oneplatformdev/utils to 0.1.99-beta.5
|
|
23
|
+
- Updated @oneplatformdev/hooks to 0.1.99-beta.5
|
|
24
|
+
- Updated @oneplatformdev/tokens to 0.1.99-beta.5
|
|
25
|
+
|
|
1
26
|
## 0.1.99-beta.4 (2025-12-29)
|
|
2
27
|
|
|
3
28
|
### 🧱 Updated Dependencies
|
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.6",
|
|
4
4
|
"description": "UI component library for OnePlatform",
|
|
5
5
|
"author": "One Platform Development Team",
|
|
6
6
|
"keywords": [
|
|
@@ -105,8 +105,11 @@
|
|
|
105
105
|
"recharts": "^3.2.0",
|
|
106
106
|
"sonner": "^2.0.7",
|
|
107
107
|
"vaul": "^1.1.2",
|
|
108
|
-
"@oneplatformdev/
|
|
109
|
-
"@oneplatformdev/
|
|
110
|
-
"@oneplatformdev/utils": "^0.1.99-beta.
|
|
108
|
+
"@oneplatformdev/hooks": "^0.1.99-beta.6",
|
|
109
|
+
"@oneplatformdev/tokens": "^0.1.99-beta.6",
|
|
110
|
+
"@oneplatformdev/utils": "^0.1.99-beta.6"
|
|
111
|
+
},
|
|
112
|
+
"scripts": {
|
|
113
|
+
"chromatic": "chromatic"
|
|
111
114
|
}
|
|
112
115
|
}
|
package/Button/Button.s.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
2
|
-
import { ButtonProps } from './Button.types';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
render: (props: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
args: {
|
|
8
|
-
tooltip: undefined;
|
|
9
|
-
asChild: false;
|
|
10
|
-
variant: "none" | "default" | "destructive" | "outline" | "secondary" | "contained" | "outlined" | "ghost" | null | undefined;
|
|
11
|
-
color: "secondary" | "primary" | "error" | null | undefined;
|
|
12
|
-
size: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
13
|
-
disabled: false;
|
|
14
|
-
};
|
|
15
|
-
argTypes: {
|
|
16
|
-
tooltip: {
|
|
17
|
-
control: false;
|
|
18
|
-
};
|
|
19
|
-
asChild: {
|
|
20
|
-
control: false;
|
|
21
|
-
};
|
|
22
|
-
variant: {
|
|
23
|
-
options: ("none" | "default" | "destructive" | "outline" | "secondary" | "contained" | "outlined" | "ghost" | null | undefined)[];
|
|
24
|
-
control: {
|
|
25
|
-
type: "inline-radio";
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
color: {
|
|
29
|
-
options: ("secondary" | "primary" | "error" | null | undefined)[];
|
|
30
|
-
control: {
|
|
31
|
-
type: "inline-radio";
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
size: {
|
|
35
|
-
options: ("xs" | "sm" | "md" | "lg" | null | undefined)[];
|
|
36
|
-
control: {
|
|
37
|
-
type: "inline-radio";
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
title: {
|
|
41
|
-
name: string;
|
|
42
|
-
description: string;
|
|
43
|
-
control: {
|
|
44
|
-
type: "text";
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
message: {
|
|
48
|
-
name: string;
|
|
49
|
-
description: string;
|
|
50
|
-
control: {
|
|
51
|
-
type: "object";
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
slotProps: {
|
|
55
|
-
name: string;
|
|
56
|
-
description: string;
|
|
57
|
-
control: {
|
|
58
|
-
type: "object";
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
tags: string[];
|
|
63
|
-
parameters: {
|
|
64
|
-
docs: {
|
|
65
|
-
description: {
|
|
66
|
-
component: string;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
pseudo: {
|
|
70
|
-
hover: string;
|
|
71
|
-
focus: string;
|
|
72
|
-
active: string;
|
|
73
|
-
disabled: string;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
export default meta;
|
|
78
|
-
type Story = StoryObj<typeof meta>;
|
|
79
|
-
export declare const Default: Story;
|
|
80
|
-
export declare const Primary: Story;
|
|
81
|
-
export declare const Secondary: Story;
|
|
82
|
-
export declare const Error: Story;
|
|
83
|
-
//# sourceMappingURL=Button.s.d.ts.map
|
package/Button/Button.s.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.s.d.ts","sourceRoot":"","sources":["../../src/Button/Button.s.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA2DlD,QAAA,MAAM,IAAI;;;oBAvDe,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwGL,CAAC;AAChC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAQnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAoBrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAoBvB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAoBnB,CAAC"}
|