@majapisoftwares/ui 4.1.15 → 4.1.17

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/base.css CHANGED
@@ -152,7 +152,7 @@ input[type="checkbox"]:indeterminate {
152
152
  --animate-elastic-slide-right-and-fade: elasticSlideRightAndFade 350ms cubic-bezier(0.16, 1, 0.3, 1);
153
153
  --animate-fade-out: fadeOut 150ms ease-in;
154
154
  --animate-fade-in: fadeIn 150ms ease-in;
155
- --animate-shiny: shiny 2s infinite linear;
155
+ --animate-skeleton-shiny: skeletonShiny 4s infinite linear;
156
156
  --animate-slide-down: slideDown 300ms cubic-bezier(0.87, 0, 0.13, 1);
157
157
  --animate-slide-up: slideUp 300ms cubic-bezier(0.87, 0, 0.13, 1);
158
158
 
@@ -277,12 +277,12 @@ input[type="checkbox"]:indeterminate {
277
277
  opacity: 1;
278
278
  }
279
279
  }
280
- @keyframes shiny {
280
+ @keyframes skeletonShiny {
281
281
  0% {
282
- background-position: 100%;
282
+ background-position: 200%;
283
283
  }
284
284
  100% {
285
- background-position: -100%;
285
+ background-position: -200%;
286
286
  }
287
287
  }
288
288
  @keyframes slideDown {
@@ -0,0 +1 @@
1
+ export default function AntiClickjacking(): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ export default function AntiClickjacking() {
2
+ return (<>
3
+ <style id="antiClickjack">{`
4
+ body { display: none !important; }
5
+ `}</style>
6
+ <script dangerouslySetInnerHTML={{
7
+ __html: `
8
+ if (self === top) {
9
+ var antiClickjack = document.getElementById("antiClickjack");
10
+ antiClickjack.parentNode.removeChild(antiClickjack);
11
+ } else {
12
+ top.location = self.location;
13
+ }
14
+ `,
15
+ }}/>
16
+ </>);
17
+ }
@@ -0,0 +1,2 @@
1
+ import AntiClickjacking from "./AntiClickjacking";
2
+ export default AntiClickjacking;
@@ -0,0 +1,2 @@
1
+ import AntiClickjacking from "./AntiClickjacking";
2
+ export default AntiClickjacking;
@@ -6,6 +6,7 @@ import numeral from "numeral";
6
6
  import { ArrowUpTrayIcon } from "@heroicons/react/24/solid";
7
7
  import { DocumentIcon } from "@heroicons/react/24/outline";
8
8
  import Loading from "../Loading";
9
+ import { uniq } from "lodash-es";
9
10
  const translateAllowedType = (type) => ({
10
11
  "image/png": "PNG",
11
12
  ".png": "PNG",
@@ -85,25 +86,27 @@ function FileSelect({ maxFileSize, allowedFileTypes, id, limit, onAcceptFiles, c
85
86
  })}/>
86
87
  <div>{uploadingText}</div>
87
88
  </div>) : !canDrop || disabled ? (<div className={clsx("relative flex flex-col items-center justify-center gap-2 text-center", innerClassName)}>
88
- {cloneElement(icon, {
89
+ <div className="relative flex flex-col items-center justify-center gap-2 text-center">
90
+ {cloneElement(icon, {
89
91
  className: clsx("mx-auto h-12 w-12 text-zinc-400", icon.props.className),
90
92
  })}
91
- <div className="text-sm">
92
- <label htmlFor={id} className={clsx("text-primary-600 focus-within:ring-primary-500 hover:text-primary-500 relative rounded-md font-medium focus-within:ring-2 focus-within:ring-offset-2 focus-within:outline-hidden dark:ring-offset-slate-900", {
93
+ <div className="text-sm">
94
+ <label htmlFor={id} className={clsx("text-primary-600 focus-within:ring-primary-500 hover:text-primary-500 relative rounded-md font-medium focus-within:ring-2 focus-within:ring-offset-2 focus-within:outline-hidden dark:ring-offset-slate-900", {
93
95
  "cursor-pointer": !disabled,
94
96
  "cursor-not-allowed": disabled,
95
97
  })}>
96
- <span>{uploadAFileText}</span>
97
- {!disabled && (<input id={id} name={id} type="file" className="sr-only" accept={allowedFileTypes?.join(",")} onChange={handleFileBrowse} multiple={limit !== 1} ref={ref}/>)}
98
- </label>
99
- <span className="pl-1">{orDragAndDropText}</span>
100
- </div>
101
- <p className="text-xs text-zinc-500">
102
- {allowedFileTypes
103
- ? allowedFileTypes.map(translateAllowedType).join(", ")
98
+ <span>{uploadAFileText}</span>
99
+ {!disabled && (<input id={id} name={id} type="file" className="sr-only" accept={allowedFileTypes?.join(",")} onChange={handleFileBrowse} multiple={limit !== 1} ref={ref}/>)}
100
+ </label>
101
+ <span className="pl-1">{orDragAndDropText}</span>
102
+ </div>
103
+ <p className="text-xs text-zinc-500">
104
+ {allowedFileTypes
105
+ ? uniq(allowedFileTypes.map(translateAllowedType)).join(", ")
104
106
  : anyFileText}{" "}
105
- {upToText} {numeral(maxFileSize).format("0b")}
106
- </p>
107
+ {upToText} {numeral(maxFileSize).format("0b")}
108
+ </p>
109
+ </div>
107
110
  {additionalBottomInfo}
108
111
  </div>) : (<div className={clsx("flex flex-col items-center justify-center gap-2 text-center", innerClassName)}>
109
112
  <ArrowUpTrayIcon className={clsx("w-10 text-7xl", {
@@ -3,7 +3,7 @@ import ReactMarkdown from "react-markdown";
3
3
  import clsx from "../../utils/clsx";
4
4
  import remarkGfm from "remark-gfm";
5
5
  export default function Markdown({ children, className, options, }) {
6
- return (<div className={clsx("prose prose-zinc dark:prose-invert max-w-full", "[&_.contains-task-list]:list-none [&_.contains-task-list]:pl-0", "[&_.task-list-item_input[type='checkbox']]:-mt-1", className)}>
6
+ return (<div className={clsx("prose prose-zinc dark:prose-invert max-w-full leading-normal", "[&_.contains-task-list]:list-none [&_.contains-task-list]:pl-0", "[&_.task-list-item_input[type='checkbox']]:-mt-1", "prose-a:break-all", className)}>
7
7
  <ReactMarkdown remarkPlugins={[remarkGfm, ...(options?.remarkPlugins || [])]} {...options}>
8
8
  {children}
9
9
  </ReactMarkdown>
@@ -6,7 +6,7 @@ export interface MultiSelectProps<T extends object | string> extends Omit<Unstyl
6
6
  items?: T[];
7
7
  filterProperty?: keyof T;
8
8
  filterFunction?: (item: T) => boolean;
9
- onChange?: (items: T[]) => void;
9
+ onChange?: (items: string[]) => void;
10
10
  renderProperty?: keyof T;
11
11
  renderFunction?: (item: T) => ReactNode;
12
12
  query?: string;
@@ -19,10 +19,10 @@ export interface MultiSelectProps<T extends object | string> extends Omit<Unstyl
19
19
  as?: typeof Input;
20
20
  static?: boolean;
21
21
  displayValue?: (item: T | null) => string;
22
- value?: T[];
22
+ value?: string[];
23
23
  creatable?: boolean;
24
24
  getCreateLabel?: (query: string) => string;
25
25
  itemsRenderLimit?: number;
26
- valueProperty?: string | number;
26
+ valueProperty?: string;
27
27
  }
28
28
  export default function MultiSelect<T extends object | string>({ placeholder, emptyText, items, renderProperty, renderFunction, filterProperty, filterFunction, onChange, query: defaultQuery, onChangeQuery, loading, inputInnerClassName, inputElementClassName, as, trailing, trailingClassName, trailingInputClassName, leadingInputClassName, static: isStatic, displayValue, value, labelClassName, creatable, getCreateLabel, itemsRenderLimit, className, valueProperty, label, required, readOnly, error, ...props }: MultiSelectProps<T>): import("react").JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import clsx from "../../utils/clsx";
2
2
  export default function Skeleton({ className, ...props }) {
3
- return (<div className={clsx("animate-pulse overflow-hidden rounded-sm text-transparent", "bg-zinc-300 text-zinc-300 dark:bg-zinc-700 dark:text-zinc-700", className)} {...props}>
4
- <div className={clsx("animate-shiny w-dull h-full", "bg-[linear-gradient(120deg,rgba(255,255,255,0)_0%,#e4e4e7,rgba(255,255,255,0)_100%)]", "dark:bg-[linear-gradient(120deg,rgba(255,255,255,0)_20%,#52525b,rgba(255,255,255,0)_80%)]")} style={{
5
- backgroundSize: "200% 100%",
6
- }}/>
3
+ return (<div className={clsx("animate-pulse overflow-hidden rounded-sm text-transparent", "bg-zinc-300 text-zinc-300 dark:bg-zinc-700 dark:text-zinc-700", className)} {...props}>
4
+ <div className={clsx("animate-skeleton-shiny h-full w-full", "bg-[linear-gradient(120deg,rgba(255,255,255,0)_0%,#e4e4e7,rgba(255,255,255,0)_100%)]", "dark:bg-[linear-gradient(120deg,rgba(255,255,255,0)_20%,#52525b,rgba(255,255,255,0)_80%)]")} style={{
5
+ backgroundSize: "400% 100%",
6
+ }}/>
7
7
  </div>);
8
8
  }
package/package.json CHANGED
@@ -4,6 +4,6 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/majapisoftwares/ui.git"
6
6
  },
7
- "version": "4.1.15",
7
+ "version": "4.1.17",
8
8
  "type": "module"
9
9
  }