@liner-fe/design-library 1.2.5 → 1.2.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/lib/index.d.ts +26 -1
- package/lib/index.js +87 -3
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ButtonProps, TextButtonProps } from '@liner-fe/prism';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
|
+
import { Popover } from 'radix-ui';
|
|
5
6
|
|
|
6
7
|
declare const TemplateDialog: {
|
|
7
8
|
({ open, preventEscape, onOpenChange, children, }: {
|
|
@@ -58,4 +59,28 @@ declare const TemplateIllustDialog: {
|
|
|
58
59
|
TextButton({ children, className, ...props }: TextButtonProps): react_jsx_runtime.JSX.Element;
|
|
59
60
|
};
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
interface ContentProps extends Omit<Popover.PopoverContentProps, 'side' | 'className'> {
|
|
63
|
+
position: 'top' | 'right' | 'bottom' | 'left';
|
|
64
|
+
title: string;
|
|
65
|
+
description: string;
|
|
66
|
+
leftSlot?: ReactNode;
|
|
67
|
+
footer?: {
|
|
68
|
+
currentStep: number;
|
|
69
|
+
totalStep: number;
|
|
70
|
+
buttonText: string;
|
|
71
|
+
onButtonClick: () => void;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
declare const TemplateTutorialGuide: ({ isOpen, children, onClose, className, content, }: {
|
|
75
|
+
position: "top" | "right" | "bottom" | "left";
|
|
76
|
+
isOpen: boolean;
|
|
77
|
+
children: ReactNode;
|
|
78
|
+
onClose: () => void;
|
|
79
|
+
className?: {
|
|
80
|
+
trigger?: ClassValue;
|
|
81
|
+
content?: ClassValue;
|
|
82
|
+
};
|
|
83
|
+
content: ContentProps;
|
|
84
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
85
|
+
|
|
86
|
+
export { TemplateDialog, TemplateIllustDialog, TemplateTutorialGuide };
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IconClose } from '@liner-fe/icon';
|
|
2
|
-
import { IconButton, Title, Paragraph, Button, TextButton } from '@liner-fe/prism';
|
|
3
|
-
import { Dialog } from 'radix-ui';
|
|
2
|
+
import { IconButton, Title, Paragraph, Button, TextButton, Caption } from '@liner-fe/prism';
|
|
3
|
+
import { Dialog, Popover } from 'radix-ui';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
@@ -181,5 +181,89 @@ TemplateIllustDialog.Buttons = ({
|
|
|
181
181
|
);
|
|
182
182
|
TemplateIllustDialog.Button = ({ children, className, ...props }) => /* @__PURE__ */ jsx(Button, { ...props, className: tw("w-full!", className), children });
|
|
183
183
|
TemplateIllustDialog.TextButton = ({ children, className, ...props }) => /* @__PURE__ */ jsx(TextButton, { ...props, className: tw(className), children });
|
|
184
|
+
var TemplateTutorialGuide = ({
|
|
185
|
+
isOpen,
|
|
186
|
+
children,
|
|
187
|
+
onClose,
|
|
188
|
+
className,
|
|
189
|
+
content
|
|
190
|
+
}) => {
|
|
191
|
+
const { position, title, description, leftSlot, sideOffset = -5, footer, ...rest } = content;
|
|
192
|
+
return /* @__PURE__ */ jsxs(Popover.Root, { open: isOpen, children: [
|
|
193
|
+
/* @__PURE__ */ jsx(Popover.Trigger, { className: tw(className?.trigger), children }),
|
|
194
|
+
/* @__PURE__ */ jsx(
|
|
195
|
+
Popover.Content,
|
|
196
|
+
{
|
|
197
|
+
side: position,
|
|
198
|
+
className: tw(className?.content),
|
|
199
|
+
sideOffset,
|
|
200
|
+
asChild: true,
|
|
201
|
+
...rest,
|
|
202
|
+
children: /* @__PURE__ */ jsxs("div", { children: [
|
|
203
|
+
/* @__PURE__ */ jsxs(
|
|
204
|
+
"div",
|
|
205
|
+
{
|
|
206
|
+
className: tw(
|
|
207
|
+
"bg-neutral-container-lowest gap-positive-150 border-brand-border-opaque-strong py-component-300 px-component-400 relative flex flex-col rounded-xl border shadow-[0_0_4px_0_rgba(12,137,59,0.08),0_0_12px_0_rgba(12,137,59,0.12),0_0_12px_0_rgba(255,255,255,0.50)]",
|
|
208
|
+
leftSlot && "pl-component-300"
|
|
209
|
+
),
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ jsx("button", { className: "absolute top-[8px] right-[8px]", onClick: onClose, children: /* @__PURE__ */ jsx(IconClose, { type: "neutral-label-secondary", size: "xs" }) }),
|
|
212
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-[12px]", children: [
|
|
213
|
+
leftSlot,
|
|
214
|
+
/* @__PURE__ */ jsxs("div", { className: "gap-positive-200 flex flex-col", children: [
|
|
215
|
+
/* @__PURE__ */ jsx(Caption, { type: "normal", weight: "medium", size: 1, children: title }),
|
|
216
|
+
/* @__PURE__ */ jsx(
|
|
217
|
+
Caption,
|
|
218
|
+
{
|
|
219
|
+
type: "normal",
|
|
220
|
+
weight: "regular",
|
|
221
|
+
size: 2,
|
|
222
|
+
className: "whitespace-pre-wrap opacity-70",
|
|
223
|
+
children: description
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
] })
|
|
227
|
+
] }),
|
|
228
|
+
footer && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
229
|
+
/* @__PURE__ */ jsxs(
|
|
230
|
+
Caption,
|
|
231
|
+
{
|
|
232
|
+
type: "normal",
|
|
233
|
+
weight: "medium",
|
|
234
|
+
size: 2,
|
|
235
|
+
className: "pl-component-100",
|
|
236
|
+
color: "neutral-label-secondary",
|
|
237
|
+
children: [
|
|
238
|
+
footer.currentStep,
|
|
239
|
+
" / ",
|
|
240
|
+
footer.totalStep
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
/* @__PURE__ */ jsx(Button, { size: "s", level: "quaternary", onClick: footer.onButtonClick, children: footer.buttonText })
|
|
245
|
+
] })
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
),
|
|
249
|
+
/* @__PURE__ */ jsx(Popover.Arrow, { asChild: true, width: 8, height: 35, children: /* @__PURE__ */ jsxs(
|
|
250
|
+
"svg",
|
|
251
|
+
{
|
|
252
|
+
width: "8",
|
|
253
|
+
height: "35",
|
|
254
|
+
viewBox: "0 0 8 35",
|
|
255
|
+
fill: "none",
|
|
256
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ jsx("rect", { width: "1", height: "28", transform: "translate(3.5)", fill: "#0C893B" }),
|
|
259
|
+
/* @__PURE__ */ jsx("circle", { cx: "4", cy: "31", r: "4", fill: "#0C893B" })
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
) })
|
|
263
|
+
] })
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
] });
|
|
267
|
+
};
|
|
184
268
|
|
|
185
|
-
export { TemplateDialog, TemplateIllustDialog };
|
|
269
|
+
export { TemplateDialog, TemplateIllustDialog, TemplateTutorialGuide };
|