@edu-tosel/design 1.0.45 → 1.0.46

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.
Files changed (153) hide show
  1. package/README.md +42 -42
  2. package/asset/SVG.d.ts +5 -0
  3. package/asset/SVG.js +2 -0
  4. package/asset/SVG.tsx +23 -21
  5. package/asset/svg/Close.tsx +32 -32
  6. package/asset/svg/Direction.tsx +36 -36
  7. package/asset/svg/Email.tsx +20 -20
  8. package/asset/svg/Image.tsx +24 -24
  9. package/asset/svg/Notification.tsx +34 -34
  10. package/asset/svg/Operation.d.ts +11 -0
  11. package/asset/svg/Operation.js +16 -0
  12. package/asset/svg/Operation.tsx +66 -0
  13. package/asset/svg/Phone.tsx +20 -20
  14. package/asset/svg/Profile.tsx +27 -27
  15. package/asset/svg/TOSEL.tsx +63 -63
  16. package/board/design/Board.design.d.ts +1 -1
  17. package/board/design/Board.design.js +4 -4
  18. package/board/template/CanvasBoard.d.ts +1 -1
  19. package/board/template/CanvasBoard.js +3 -3
  20. package/board/template/ManageBoard.d.ts +1 -1
  21. package/board/template/ManageBoard.js +6 -6
  22. package/board/widget/Header.js +1 -1
  23. package/card/design/Card.design.js +4 -3
  24. package/card/design/NavCard.design.js +1 -1
  25. package/card/design/RollCard.design.d.ts +2 -0
  26. package/card/design/RollCard.design.js +13 -0
  27. package/card/design/TableCard.design.js +9 -8
  28. package/card/index.d.ts +1 -0
  29. package/card/index.js +1 -0
  30. package/card/template/InfoCard/Academy.js +1 -1
  31. package/card/template/InfoCard/Exam.js +1 -1
  32. package/card/template/InfoCard/ExamData.js +3 -3
  33. package/card/template/InfoCard/Finance.js +1 -1
  34. package/card/template/InfoCard/Grade.js +1 -1
  35. package/card/template/InfoCard/Student.js +1 -1
  36. package/card/template/RollCard.d.ts +2 -0
  37. package/card/template/RollCard.js +5 -0
  38. package/globals.css +226 -226
  39. package/hook/useFlag.js +2 -2
  40. package/index.d.ts +1 -1
  41. package/index.js +1 -1
  42. package/interaction/template/Loading.d.ts +3 -3
  43. package/interaction/template/Loading.js +3 -3
  44. package/interaction/template/NoData.js +2 -2
  45. package/interface/{Widget.d.ts → Action.d.ts} +3 -3
  46. package/interface/Board.d.ts +2 -2
  47. package/interface/Card.d.ts +9 -2
  48. package/interface/HTMLElement.d.ts +0 -4
  49. package/interface/Layout.d.ts +3 -3
  50. package/interface/Modal.d.ts +5 -2
  51. package/interface/Overlay.d.ts +2 -2
  52. package/interface/Property.d.ts +4 -4
  53. package/interface/Shelf.d.ts +2 -2
  54. package/interface/UtilityType.d.ts +2 -0
  55. package/interface/UtilityType.js +1 -0
  56. package/interface/index.d.ts +2 -1
  57. package/interface/index.js +2 -1
  58. package/interface/widget/Switch.d.ts +19 -0
  59. package/interface/widget/Switch.js +1 -0
  60. package/interface/widget/index.d.ts +1 -0
  61. package/interface/widget/index.js +1 -0
  62. package/layout/design/DataField.design.js +2 -2
  63. package/layout/design/Row.design.js +1 -1
  64. package/layout/design/Tab.design.d.ts +15 -4
  65. package/layout/design/Tab.design.js +26 -11
  66. package/layout/index.d.ts +1 -1
  67. package/layout/index.js +1 -1
  68. package/layout/template/Action.d.ts +8 -0
  69. package/layout/template/{Events.js → Action.js} +12 -12
  70. package/layout/template/Gallery.d.ts +2 -2
  71. package/layout/template/Gallery.js +10 -3
  72. package/layout/template/Shelf.js +3 -1
  73. package/layout/widget/dashboard/Header.js +5 -5
  74. package/layout/widget/dashboard/Layout.js +2 -2
  75. package/layout/widget/dashboard/Menu.d.ts +1 -1
  76. package/layout/widget/dashboard/Menu.js +5 -5
  77. package/layout/widget/dashboard/Notification.d.ts +1 -1
  78. package/layout/widget/dashboard/Notification.js +4 -4
  79. package/layout/widget/dashboard/buttonClassNames.js +2 -2
  80. package/layout/widget/dashboard/mypage/Layout.js +2 -2
  81. package/layout/widget/dashboard/mypage/Profile.js +1 -1
  82. package/layout/widget/sign/WithTitle.js +1 -1
  83. package/modal/design/ConfirmModal.design.d.ts +1 -1
  84. package/modal/design/ConfirmModal.design.js +3 -3
  85. package/modal/design/Modal.design.d.ts +1 -1
  86. package/modal/design/Modal.design.js +8 -7
  87. package/modal/template/Alert.d.ts +1 -1
  88. package/modal/template/Alert.js +2 -2
  89. package/modal/template/ConfirmModal/Input.js +1 -1
  90. package/modal/template/ConfirmModal/Switch.d.ts +11 -0
  91. package/modal/template/ConfirmModal/Switch.js +19 -0
  92. package/modal/template/ConfirmModal/Tag.d.ts +13 -0
  93. package/modal/template/ConfirmModal/Tag.js +19 -0
  94. package/modal/template/ConfirmModal/index.d.ts +2 -0
  95. package/modal/template/ConfirmModal/index.js +4 -0
  96. package/modal/template/Input.d.ts +1 -1
  97. package/modal/template/Input.js +2 -2
  98. package/overlay/design/Overlay.design.d.ts +1 -1
  99. package/overlay/design/Overlay.design.js +4 -4
  100. package/overlay/template/Info.d.ts +1 -1
  101. package/overlay/template/Info.js +2 -2
  102. package/overlay/template/Manage.d.ts +1 -1
  103. package/overlay/template/Manage.js +2 -2
  104. package/package.json +1 -1
  105. package/store/index.d.ts +4 -4
  106. package/store/index.js +1 -1
  107. package/tailwind.config.ts +605 -602
  108. package/util/select.d.ts +10 -0
  109. package/util/select.js +10 -0
  110. package/version.txt +1 -1
  111. package/{html/widget → widget}/CheckBox.d.ts +1 -1
  112. package/{html/widget → widget}/DatePicker.d.ts +1 -1
  113. package/{html/widget → widget}/EmailInput.d.ts +1 -1
  114. package/{html/widget → widget}/EmailInput.js +1 -1
  115. package/{html/widget → widget}/Obstacle.d.ts +1 -1
  116. package/{html/widget → widget}/Obstacle.js +1 -1
  117. package/widget/Toggle.d.ts +6 -0
  118. package/{html/widget → widget}/Toggle.js +1 -10
  119. package/{html → widget}/design/Label.design.js +1 -1
  120. package/{html → widget}/design/Select.design.js +2 -2
  121. package/widget/design/Tag.design.d.ts +0 -0
  122. package/widget/design/Tag.design.js +1 -0
  123. package/{html → widget}/index.d.ts +3 -2
  124. package/{html → widget}/index.js +3 -2
  125. package/{html → widget}/template/Input.js +1 -1
  126. package/widget/template/Switch/Handle.d.ts +2 -0
  127. package/widget/template/Switch/Handle.js +26 -0
  128. package/widget/template/Switch/Switch.d.ts +3 -0
  129. package/widget/template/Switch/Switch.js +44 -0
  130. package/widget/template/Switch/index.d.ts +6 -0
  131. package/widget/template/Switch/index.js +4 -0
  132. package/html/widget/Toggle.d.ts +0 -2
  133. package/layout/template/Events.d.ts +0 -8
  134. /package/interaction/{widget → design}/Jumper.design.d.ts +0 -0
  135. /package/interaction/{widget → design}/Jumper.design.js +0 -0
  136. /package/interaction/{widget → design}/Script.design.d.ts +0 -0
  137. /package/interaction/{widget → design}/Script.design.js +0 -0
  138. /package/interaction/{widget → design}/Sign.design.d.ts +0 -0
  139. /package/interaction/{widget → design}/Sign.design.js +0 -0
  140. /package/interaction/{widget → design}/Spinner.design.d.ts +0 -0
  141. /package/interaction/{widget → design}/Spinner.design.js +0 -0
  142. /package/interaction/{widget → design}/Worm.design.d.ts +0 -0
  143. /package/interaction/{widget → design}/Worm.design.js +0 -0
  144. /package/interface/{Widget.js → Action.js} +0 -0
  145. /package/{html/widget → widget}/CheckBox.js +0 -0
  146. /package/{html/widget → widget}/DatePicker.js +0 -0
  147. /package/{html → widget}/design/Label.design.d.ts +0 -0
  148. /package/{html → widget}/design/Select.design.d.ts +0 -0
  149. /package/{html → widget}/template/Input.d.ts +0 -0
  150. /package/{html → widget}/template/Label.d.ts +0 -0
  151. /package/{html → widget}/template/Label.js +0 -0
  152. /package/{html → widget}/template/Select.d.ts +0 -0
  153. /package/{html → widget}/template/Select.js +0 -0
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import ConfirmModal from "../../design/ConfirmModal.design";
3
+ import { cn } from "../../../util";
4
+ import { selectOne, selectPlural } from "../../../util/select";
5
+ export default function Tag(props) {
6
+ const { state, tags, options } = props.tag;
7
+ const { selectHow } = options || { selectHow: "plural" };
8
+ const button = (key) => ({
9
+ sizes: "h-10",
10
+ styles: "rounded-full",
11
+ animations: "duration-300",
12
+ boundaries: state[0].includes(key)
13
+ ? "bg-green-dark text-white"
14
+ : "border border-gray-medium",
15
+ });
16
+ return (_jsx(ConfirmModal, { ...props, children: _jsx("div", { className: "grid grid-cols-4 gap-2.5 mt-4.75", children: tags.map(([key, value]) => (_jsx("button", { onClick: () => selectHow === "one"
17
+ ? selectOne({ state, key })
18
+ : selectPlural({ state, key }), className: cn(button(key)), children: value }, key))) }) }));
19
+ }
@@ -3,5 +3,7 @@ declare function ConfirmModal(props: ConfirmProps): import("react/jsx-runtime").
3
3
  declare namespace ConfirmModal {
4
4
  var Input: typeof import("./Input").default;
5
5
  var Reimage: typeof import("./Reimage").default;
6
+ var Switch: typeof import("./Switch").default;
7
+ var Tag: typeof import("./Tag").default;
6
8
  }
7
9
  export default ConfirmModal;
@@ -2,9 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Confirm from "./Confirm";
3
3
  import Input from "./Input";
4
4
  import Reimage from "./Reimage";
5
+ import Tag from "./Tag";
6
+ import Switch from "./Switch";
5
7
  function ConfirmModal(props) {
6
8
  return _jsx(Confirm, { ...props });
7
9
  }
8
10
  ConfirmModal.Input = Input;
9
11
  ConfirmModal.Reimage = Reimage;
12
+ ConfirmModal.Switch = Switch;
13
+ ConfirmModal.Tag = Tag;
10
14
  export default ConfirmModal;
@@ -1,6 +1,6 @@
1
1
  import { State } from "../../interface";
2
2
  import { ModalProps } from "../../interface/Modal";
3
- export default function Input<T>({ titles, action, options, state, }: Omit<ModalProps, "children"> & {
3
+ export default function Input<T>({ titles, showAction, options, state, }: Omit<ModalProps, "children"> & {
4
4
  title?: string;
5
5
  state: State<T>;
6
6
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import ModalDesign from "../design/Modal.design";
3
- export default function Input({ titles, action, options, state, }) {
3
+ export default function Input({ titles, showAction, options, state, }) {
4
4
  const { buttons } = options ?? {};
5
- return (_jsx(ModalDesign, { titles: titles, action: action, className: "pt-18 px-25", options: { buttons }, children: _jsx("input", { className: "border-2 border-black w-80 h-8", value: state[0], onChange: (e) => state[1](e.target.value) }) }));
5
+ return (_jsx(ModalDesign, { titles: titles, showAction: showAction, className: "pt-18 px-25", options: { buttons }, children: _jsx("input", { className: "border-2 border-black w-80 h-8", value: state[0], onChange: (e) => state[1](e.target.value) }) }));
6
6
  }
@@ -1,2 +1,2 @@
1
1
  import { OverlayProps } from "../../interface";
2
- export default function OverlayDesign({ titles, children, action, }: OverlayProps): JSX.Element;
2
+ export default function OverlayDesign({ titles, children, showAction, }: OverlayProps): JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useTransition, animated } from "react-spring";
3
3
  import { cn } from "../../util";
4
- import { useWidgetStore } from "../../store";
5
- export default function OverlayDesign({ titles, children, action, }) {
6
- const { removeView, setIsOwn } = useWidgetStore();
4
+ import { useActionStore } from "../../store";
5
+ export default function OverlayDesign({ titles, children, showAction, }) {
6
+ const { removeView, setIsOwn } = useActionStore();
7
7
  const { title } = titles;
8
- const { isVisible, event } = action ?? {};
8
+ const { isVisible, event } = showAction ?? {};
9
9
  const container = {
10
10
  positions: "absolute top-0 right-0 z-30",
11
11
  sizes: "h-full",
@@ -1,2 +1,2 @@
1
1
  import { InfoOverlayProps } from "../../interface/Overlay";
2
- export default function Info({ action }: Omit<InfoOverlayProps, "titles">): import("react/jsx-runtime").JSX.Element;
2
+ export default function Info({ showAction }: Omit<InfoOverlayProps, "titles">): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import OverlayDesign from "../design/Overlay.design";
3
- export default function Info({ action }) {
4
- return (_jsx(OverlayDesign, { titles: { title: "유저 관리" }, action: action, children: _jsx("div", { children: "TEST" }) }));
3
+ export default function Info({ showAction }) {
4
+ return (_jsx(OverlayDesign, { titles: { title: "유저 관리" }, showAction: showAction, children: _jsx("div", { children: "TEST" }) }));
5
5
  }
@@ -1,2 +1,2 @@
1
1
  import { ManageOverlayProps } from "../../interface";
2
- export default function Manage({ titles, action, elements, buttons, }: ManageOverlayProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function Manage({ titles, showAction, elements, buttons, }: ManageOverlayProps): import("react/jsx-runtime").JSX.Element;
@@ -4,13 +4,13 @@ import OverlayDesign from "../design/Overlay.design";
4
4
  import Frame from "../design/Frame.design";
5
5
  import { useId } from "react";
6
6
  import { cn } from "../../util";
7
- export default function Manage({ titles, action, elements, buttons, }) {
7
+ export default function Manage({ titles, showAction, elements, buttons, }) {
8
8
  const id = useId();
9
9
  const body = {
10
10
  sizes: "w-full min-h-160 xl:h-120 ",
11
11
  styles: "overflow-y-scroll",
12
12
  };
13
- return (_jsxs(OverlayDesign, { titles: titles, action: action, children: [_jsx("div", { className: cn(body), children: elements?.map(({ title, type, labels, state, selectOptions, disabled }) => {
13
+ return (_jsxs(OverlayDesign, { titles: titles, showAction: showAction, children: [_jsx("div", { className: cn(body), children: elements?.map(({ title, type, labels, state, selectOptions, disabled }) => {
14
14
  if (type === "text")
15
15
  return (_jsx(Frame, { title: title, children: _jsx("div", { className: "text-base pl-4", children: state[0] }) }, id + title));
16
16
  if (type === "select")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.45",
3
+ "version": "1.0.46",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/store/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Order, WidgetEvent } from "../interface";
2
- interface WidgetProps {
3
- events: WidgetEvent[];
1
+ import { Order, ActionEvent } from "../interface";
2
+ interface ActionProps {
3
+ events: ActionEvent[];
4
4
  setView: (prop: string) => void;
5
5
  removeView: (prop: string) => void;
6
6
  clearView: () => void;
@@ -21,5 +21,5 @@ interface WidgetProps {
21
21
  isDark: boolean;
22
22
  setDark: () => void;
23
23
  }
24
- export declare const useWidgetStore: import("zustand").UseBoundStore<import("zustand").StoreApi<WidgetProps>>;
24
+ export declare const useActionStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ActionProps>>;
25
25
  export {};
package/store/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { create } from "zustand";
2
- export const useWidgetStore = create((set) => ({
2
+ export const useActionStore = create((set) => ({
3
3
  events: [],
4
4
  setView: (prop) => set((state) => {
5
5
  state.setIsOwn(true);