@edu-tosel/design 1.0.55 → 1.0.57

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.
@@ -1,2 +1,2 @@
1
- import { BoardHeaderProps } from "./../../interface/Board";
1
+ import { BoardHeaderProps } from "../../interface/Board";
2
2
  export default function BoardHeader<B>({ titles, tag, options, }: BoardHeaderProps<B>): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Action } from "../..";
3
3
  import { cn } from "../../util";
4
4
  import { Board } from "../design/Board.design";
5
- import BoardHeader from "../widget/Header";
5
+ import BoardHeader from "../design/Header.design";
6
6
  export default function CanvasBoard({ header, children, action, buttons, options, }) {
7
7
  const body = {
8
8
  displays: "flex flex-col lg:flex-row lg:flex-wrap gap-7.5",
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { DataField, Action, Shelf } from "../..";
3
3
  import { Board } from "../design/Board.design";
4
- import BoardHeader from "../widget/Header";
4
+ import BoardHeader from "../design/Header.design";
5
5
  import { cn, sortByOrder } from "../../util";
6
6
  import { useActionStore } from "../../store";
7
7
  import { useId } from "react";
@@ -39,6 +39,7 @@ export interface RowProps<T> {
39
39
  dataField?: DataField<T>;
40
40
  onClick?: OnClick<T>;
41
41
  buttons?: HTMLLabelElement[];
42
+ flag?: boolean;
42
43
  options?: {
43
44
  height?: string;
44
45
  size?: string;
@@ -43,7 +43,7 @@ export interface ChartCardProps extends Omit<CardProps, "children"> {
43
43
  score: number;
44
44
  };
45
45
  }
46
- interface ButtonInLay {
46
+ export interface ButtonInLay {
47
47
  title: string;
48
48
  onClick: OnClick;
49
49
  disabled?: Disabled;
@@ -1,2 +1,2 @@
1
1
  import { RowProps } from "../../interface";
2
- export default function RowDesign<T>({ item, dataField, options, onClick, buttons, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
2
+ export default function RowDesign<T>({ item, dataField, options, onClick, buttons, flag, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
3
  import { cn } from "../../util";
4
4
  import { Label } from "../../widget";
5
- export default function RowDesign({ item, dataField, options, onClick, buttons, }) {
5
+ export default function RowDesign({ item, dataField, options, onClick, buttons, flag, }) {
6
6
  const { size, padding, text, noHover, className, isPointer } = options ?? {};
7
7
  const id = useId();
8
8
  const container = {
@@ -18,7 +18,13 @@ export default function RowDesign({ item, dataField, options, onClick, buttons,
18
18
  styles: "truncate",
19
19
  className,
20
20
  };
21
- return (_jsxs("div", { className: cn(container), onClick: () => onClick?.(), children: [dataField &&
21
+ const flagBox = (flag) => ({
22
+ positions: "absolute left-3.5",
23
+ backgrounds: flag ? "bg-green-500" : "bg-red-500",
24
+ sizes: "w-2 h-2",
25
+ styles: "rounded-full",
26
+ });
27
+ return (_jsxs("div", { className: cn(container), onClick: () => onClick?.(), children: [typeof flag !== "undefined" && _jsx("div", { className: cn(flagBox(flag)) }), dataField &&
22
28
  Object.keys(dataField).map((key) => (_jsx("div", { className: cn(`w-${dataField[key]?.size}/100`, itemBox), children: String(item[key]) }, id + key))), _jsx("div", { className: "absolute right-4 xl:right-8 flex gap-4", children: buttons?.map(({ title, onClick, options }) => (_jsx(Label.Button, { title: title, onClick: onClick, options: {
23
29
  background: options?.background ?? "bg-crimson-dark",
24
30
  text: options?.text ?? "text-white",
@@ -1,11 +1,11 @@
1
1
  import { RowProps } from "../../interface";
2
- declare function Row<T>({ item, dataField, onClick, buttons }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
2
+ declare function Row<T>({ item, dataField, onClick, buttons, flag }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
3
3
  declare namespace Row {
4
- var Card: <T>({ item, dataField, onClick, buttons, height, noPadding, noHover, }: Omit<RowProps<T>, "options"> & {
4
+ var Card: <T>({ item, dataField, onClick, buttons, height, noPadding, noHover, flag, }: Omit<RowProps<T>, "options"> & {
5
5
  height?: string | undefined;
6
6
  noPadding?: boolean | undefined;
7
7
  noHover?: boolean | undefined;
8
8
  }) => import("react/jsx-runtime").JSX.Element;
9
- var Board: <T>({ item, dataField, onClick, buttons, options }: RowProps<T>) => import("react/jsx-runtime").JSX.Element;
9
+ var Board: <T>({ item, dataField, onClick, buttons, flag, options, }: RowProps<T>) => import("react/jsx-runtime").JSX.Element;
10
10
  }
11
11
  export default Row;
@@ -1,26 +1,26 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
3
  import RowDesign from "../design/Row.design";
4
- function Row({ item, dataField, onClick, buttons }) {
5
- return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, options: {
4
+ function Row({ item, dataField, onClick, buttons, flag }) {
5
+ return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, flag: flag, options: {
6
6
  size: "w-full h-12",
7
7
  noHover: true,
8
8
  text: "text-xs",
9
9
  className: "text-center",
10
10
  } }));
11
11
  }
12
- function Board({ item, dataField, onClick, buttons, options }) {
12
+ function Board({ item, dataField, onClick, buttons, flag, options, }) {
13
13
  const id = useId();
14
- return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, options: {
14
+ return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, flag: flag, options: {
15
15
  ...options,
16
16
  size: "w-full h-12",
17
17
  padding: "px-2 xs:px-4 xl:px-7.5",
18
18
  text: "text-xl",
19
19
  } }, id));
20
20
  }
21
- function Card({ item, dataField, onClick, buttons, height, noPadding, noHover, }) {
21
+ function Card({ item, dataField, onClick, buttons, height, noPadding, noHover, flag, }) {
22
22
  const id = useId();
23
- return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, options: {
23
+ return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, flag: flag, options: {
24
24
  size: `w-full ${height ?? "h-12"}`,
25
25
  padding: !noPadding ? "px-2 xs:px-4 xl:px-7.5" : "",
26
26
  text: "text-base",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.55",
3
+ "version": "1.0.57",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.55
1
+ 1.0.57