@edu-tosel/design 1.0.57 → 1.0.59

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.
@@ -0,0 +1,9 @@
1
+ import { Scripts } from "../../../interface";
2
+ import { ConfirmModalProps } from "../../../interface/Modal";
3
+ interface AlertProps extends Omit<ConfirmModalProps, "children"> {
4
+ scripts: Scripts & {
5
+ alert?: string;
6
+ };
7
+ }
8
+ export type { AlertProps };
9
+ export default function Alert(props: AlertProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { LineBreaks } from "../../../text";
3
+ import { cn } from "../../../util";
4
+ import ConfirmModalDesign from "../../design/ConfirmModal.design";
5
+ export default function Alert(props) {
6
+ const container = {
7
+ displays: "flex flex-col gap-3 justify-center items-center",
8
+ margins: "mt-2.5",
9
+ sizes: "w-full h-60",
10
+ };
11
+ return (_jsx(ConfirmModalDesign, { ...props, children: _jsxs("div", { className: cn(container), children: [_jsx("div", { className: "leading-none text-xl font-pretendard-bold", children: props.scripts.script }), _jsx(LineBreaks, { className: "text-center", texts: props.scripts.subscript }), _jsx("div", { className: "leading-none font-pretendard-bold text-crimson-burgundy", children: props.scripts.alert })] }), options: {
12
+ width: "md",
13
+ height: "lg",
14
+ } }));
15
+ }
@@ -1,9 +1,2 @@
1
- import { Scripts } from "../../../interface";
2
1
  import { ConfirmModalProps } from "../../../interface/Modal";
3
- interface ConfirmProps extends Omit<ConfirmModalProps, "children"> {
4
- scripts: Scripts & {
5
- alert?: string;
6
- };
7
- }
8
- export type { ConfirmProps };
9
- export default function Confirm(props: ConfirmProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function Confirm(props: ConfirmModalProps): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,13 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { LineBreaks } from "../../../text";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
3
2
  import { cn } from "../../../util";
4
3
  import ConfirmModalDesign from "../../design/ConfirmModal.design";
5
4
  export default function Confirm(props) {
6
5
  const container = {
7
- displays: "flex flex-col gap-3 justify-center items-center",
6
+ displays: "flex flex-col",
8
7
  margins: "mt-2.5",
9
8
  sizes: "w-full h-60",
10
9
  };
11
- return (_jsx(ConfirmModalDesign, { ...props, children: _jsxs("div", { className: cn(container), children: [_jsx("div", { className: "leading-none text-xl font-pretendard-bold", children: props.scripts.script }), _jsx(LineBreaks, { className: "text-center", texts: props.scripts.subscript }), _jsx("div", { className: "leading-none font-pretendard-bold text-crimson-burgundy", children: props.scripts.alert })] }), options: {
10
+ return (_jsx(ConfirmModalDesign, { ...props, children: _jsx("div", { className: cn(container), children: props.children }), options: {
12
11
  width: "md",
13
12
  height: "lg",
14
13
  } }));
@@ -1,6 +1,7 @@
1
- import { ConfirmProps } from "./Confirm";
2
- declare function ConfirmModal(props: ConfirmProps): import("react/jsx-runtime").JSX.Element;
1
+ import { ConfirmModalProps } from "../../../interface/Modal";
2
+ declare function ConfirmModal(props: ConfirmModalProps): import("react/jsx-runtime").JSX.Element;
3
3
  declare namespace ConfirmModal {
4
+ var Alert: typeof import("./Alert").default;
4
5
  var Input: typeof import("./Input").default;
5
6
  var Reimage: typeof import("./Reimage").default;
6
7
  var Switch: typeof import("./Switch").default;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Confirm from "./Confirm";
3
+ import Alert from "./Alert";
3
4
  import Input from "./Input";
4
5
  import Reimage from "./Reimage";
5
6
  import Tag from "./Tag";
@@ -7,6 +8,7 @@ import Switch from "./Switch";
7
8
  function ConfirmModal(props) {
8
9
  return _jsx(Confirm, { ...props });
9
10
  }
11
+ ConfirmModal.Alert = Alert;
10
12
  ConfirmModal.Input = Input;
11
13
  ConfirmModal.Reimage = Reimage;
12
14
  ConfirmModal.Switch = Switch;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  export function LineBreaks({ texts, className, }) {
3
- return (_jsx("div", { className: className, children: typeof texts === "string"
4
- ? texts
5
- : texts?.map((text, index) => (_jsx("div", { className: "leading-tight", children: text }, index))) }));
3
+ const strings = typeof texts === "string"
4
+ ? texts.split("\n")
5
+ : texts?.map((text) => text.split("\n")).flat();
6
+ return (_jsx("div", { className: className, children: strings?.map((text, index) => (_jsx("div", { className: "leading-tight", children: text.length > 0 ? text : "\u00a0" }, index))) }));
6
7
  }
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.57
1
+ 1.0.59