@uxf/ui 11.21.3 → 11.21.5

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,4 +1,5 @@
1
- import { FileResponse, FormControlProps } from "@uxf/ui/types";
1
+ import { FileResponse } from "@uxf/core/types";
2
+ import { FormControlProps } from "@uxf/ui/types";
2
3
  import React from "react";
3
4
  export interface FileInputBaseProps extends FormControlProps<FileResponse | null> {
4
5
  "aria-describedby"?: string;
@@ -9,7 +9,8 @@
9
9
  }
10
10
 
11
11
  &__option-wrapper {
12
- @apply flex justify-between;
12
+ display: flex;
13
+ justify-content: space-between;
13
14
 
14
15
  &.is-selected {
15
16
  .uxf-radio-group__option-label {
@@ -31,7 +32,7 @@
31
32
  }
32
33
 
33
34
  &__label {
34
- @apply mb-2;
35
+ margin-bottom: theme("spacing.2");
35
36
  }
36
37
  }
37
38
 
@@ -57,7 +58,7 @@
57
58
  }
58
59
 
59
60
  .uxf-radio-group__option-label {
60
- @apply pr-4;
61
+ padding-right: theme("spacing.4");
61
62
  }
62
63
  }
63
64
 
@@ -71,7 +72,9 @@
71
72
  }
72
73
 
73
74
  .uxf-radio-group__options-wrapper {
74
- @apply flex flex-wrap gap-2;
75
+ display: flex;
76
+ flex-wrap: wrap;
77
+ gap: theme("spacing.2");
75
78
  }
76
79
 
77
80
  .uxf-radio-group__option-wrapper {
@@ -92,7 +95,9 @@
92
95
  }
93
96
 
94
97
  .uxf-radio-group__option-label {
95
- @apply pt-4 text-sm;
98
+ @apply text-sm;
99
+
100
+ padding-top: theme("spacing.4");
96
101
  }
97
102
  }
98
103
 
@@ -107,22 +112,29 @@
107
112
  }
108
113
 
109
114
  .uxf-radio-group__option-wrapper {
110
- @apply flex-row-reverse items-center;
115
+ @apply flex-row-reverse;
116
+
117
+ align-items: center;
111
118
  }
112
119
 
113
120
  .uxf-radio-group__option-label {
114
- @apply pl-2;
121
+ padding-left: theme("spacing.2");
115
122
  }
116
123
  }
117
124
 
118
125
  .uxf-radio-group--column {
119
126
  .uxf-radio-group__options-wrapper {
120
- @apply flex flex-col items-start space-y-2;
127
+ align-items: start;
128
+ display: flex;
129
+ flex-direction: column;
130
+ gap: theme("spacing.2");
121
131
  }
122
132
  }
123
133
 
124
134
  .uxf-radio-group--row {
125
135
  .uxf-radio-group__options-wrapper {
126
- @apply flex items-center space-x-10;
136
+ align-items: center;
137
+ display: flex;
138
+ gap: theme("spacing.10");
127
139
  }
128
140
  }
@@ -1,4 +1,5 @@
1
- import { FileResponse, FormControlProps, UploadOptions } from "@uxf/ui/types";
1
+ import { FileResponse } from "@uxf/core/types";
2
+ import { FormControlProps, UploadOptions } from "@uxf/ui/types";
2
3
  import React, { CSSProperties, ReactNode } from "react";
3
4
  import { IconName } from "../icon/types";
4
5
  import { Accept, DropzoneFile } from "./types";
@@ -36,6 +36,7 @@ function fileToFileResponse(file) {
36
36
  id: -Math.round(Math.random() * 100000000),
37
37
  uuid: "00000000-0000-0000-0000-000000000000",
38
38
  name: file.name,
39
+ namespace: null,
39
40
  extension: file.name.split(".").slice(-1).join(""),
40
41
  };
41
42
  }
@@ -1,4 +1,4 @@
1
- import { FileResponse } from "@uxf/ui/types";
1
+ import { FileResponse } from "@uxf/core/types";
2
2
  export interface DropzoneFile extends FileResponse {
3
3
  abortController?: AbortController;
4
4
  error?: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/ui",
3
- "version": "11.21.3",
3
+ "version": "11.21.5",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -17,10 +17,10 @@
17
17
  "dependencies": {
18
18
  "@floating-ui/react": "0.26.9",
19
19
  "@headlessui/react": "1.7.14",
20
- "@uxf/core": "11.21.0",
21
- "@uxf/core-react": "11.21.0",
20
+ "@uxf/core": "11.21.5",
21
+ "@uxf/core-react": "11.21.5",
22
22
  "@uxf/datepicker": "11.11.3",
23
- "@uxf/styles": "11.21.0",
23
+ "@uxf/styles": "11.21.5",
24
24
  "color2k": "2.0.3",
25
25
  "dayjs": "1.11.10",
26
26
  "jump.js": "1.0.2",
@@ -1,10 +1,12 @@
1
1
  import { PaginationSizes } from "@uxf/ui/pagination/theme";
2
2
  import { FC } from "react";
3
3
  export interface PaginationProps {
4
+ className?: string;
4
5
  count: number;
5
- page: number;
6
6
  onPageChange: (index: number) => void;
7
+ page: number;
8
+ showFirstButton?: boolean;
9
+ showLastButton?: boolean;
7
10
  size?: keyof PaginationSizes;
8
- className?: string;
9
11
  }
10
12
  export declare const Pagination: FC<PaginationProps>;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Pagination = void 0;
7
+ const show_1 = require("@uxf/core-react/components/show");
7
8
  const use_pagination_1 = require("@uxf/core-react/hooks/use-pagination");
8
9
  const cx_1 = require("@uxf/core/utils/cx");
9
10
  const react_1 = __importDefault(require("react"));
@@ -16,8 +17,8 @@ const Pagination = (props) => {
16
17
  const pagination = (0, use_pagination_1.usePagination)({
17
18
  count: props.count,
18
19
  page: props.page,
19
- showFirstButton: true,
20
- showLastButton: true,
20
+ showFirstButton: props.showFirstButton,
21
+ showLastButton: props.showFirstButton,
21
22
  });
22
23
  const onClick = (item) => {
23
24
  if (typeof item === "number") {
@@ -39,15 +40,21 @@ const Pagination = (props) => {
39
40
  ((item === "last" || item === "next") && isCurrentPageLast);
40
41
  return (
41
42
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events
42
- react_1.default.createElement("a", { className: (0, cx_1.cx)("uxf-pagination__button", isDisabled && "is-disabled", (item === "start-ellipsis" || item === "end-ellipsis") && "is-ellipsis", item === props.page && "is-selected", index === 0 && "is-first", index === pagination.length - 1 && "is-last"), key: item, onClick: isDisabled ? undefined : () => onClick(item) }, item === "first" ? (react_1.default.createElement(react_1.default.Fragment, null,
43
- react_1.default.createElement("span", { className: "uxf-pagination__label" }, "First"),
44
- react_1.default.createElement(icon_1.Icon, { name: "chevronsLeft", size: 12 }))) : item === "previous" ? (react_1.default.createElement(react_1.default.Fragment, null,
45
- react_1.default.createElement("span", { className: "uxf-pagination__label" }, "Previous"),
46
- react_1.default.createElement(icon_1.Icon, { name: "chevronLeft", size: 12 }))) : item === "start-ellipsis" || item === "end-ellipsis" ? (react_1.default.createElement(react_1.default.Fragment, null, "...")) : typeof item === "number" ? (react_1.default.createElement(react_1.default.Fragment, null, item)) : item === "next" ? (react_1.default.createElement(react_1.default.Fragment, null,
47
- react_1.default.createElement("span", { className: "uxf-pagination__label" }, "Next"),
48
- react_1.default.createElement(icon_1.Icon, { name: "chevronRight", size: 12 }))) : (react_1.default.createElement(react_1.default.Fragment, null,
49
- react_1.default.createElement("span", { className: "uxf-pagination__label" }, "Last"),
50
- react_1.default.createElement(icon_1.Icon, { name: "chevronsRight", size: 12 })))));
43
+ react_1.default.createElement("a", { className: (0, cx_1.cx)("uxf-pagination__button", isDisabled && "is-disabled", (item === "start-ellipsis" || item === "end-ellipsis") && "is-ellipsis", item === props.page && "is-selected", index === 0 && "is-go-to-first", index === pagination.length - 1 && "is-go-to-last", item === "next" && "is-next", item === "previous" && "is-previous", typeof item === "number" && "is-number"), key: item, onClick: isDisabled ? undefined : () => onClick(item) },
44
+ react_1.default.createElement(show_1.Show, { when: item === "first" },
45
+ react_1.default.createElement("span", { className: "uxf-pagination__label" }, "First"),
46
+ react_1.default.createElement(icon_1.Icon, { name: "chevronsLeft", size: 12 })),
47
+ react_1.default.createElement(show_1.Show, { when: item === "previous" },
48
+ react_1.default.createElement("span", { className: "uxf-pagination__label" }, "Previous"),
49
+ react_1.default.createElement(icon_1.Icon, { name: "chevronLeft", size: 12 })),
50
+ react_1.default.createElement(show_1.Show, { when: item === "start-ellipsis" || item === "end-ellipsis" }, "\u2026"),
51
+ react_1.default.createElement(show_1.Show, { when: typeof item === "number" }, item),
52
+ react_1.default.createElement(show_1.Show, { when: item === "next" },
53
+ react_1.default.createElement("span", { className: "uxf-pagination__label" }, "Next"),
54
+ react_1.default.createElement(icon_1.Icon, { name: "chevronRight", size: 12 })),
55
+ react_1.default.createElement(show_1.Show, { when: item === "last" },
56
+ react_1.default.createElement("span", { className: "uxf-pagination__label" }, "Last"),
57
+ react_1.default.createElement(icon_1.Icon, { name: "chevronsRight", size: 12 }))));
51
58
  })));
52
59
  };
53
60
  exports.Pagination = Pagination;
@@ -1,10 +1,3 @@
1
- export interface FileResponse {
2
- extension: string;
3
- id: number;
4
- name: string;
5
- namespace?: string | null;
6
- uuid: string;
7
- }
8
1
  export interface UploadOptions {
9
2
  abortController?: AbortController;
10
3
  onUploadProgress?: (progressEvent: UploadProgressEvent) => void;
@@ -1,2 +1,2 @@
1
- import { FileResponse } from "@uxf/ui/types";
1
+ import { FileResponse } from "@uxf/core/types";
2
2
  export declare function getFileUrl(domain: string, file: FileResponse): string;
@@ -1,2 +1,3 @@
1
- import { FileResponse, UploadOptions } from "@uxf/ui/types";
1
+ import { FileResponse } from "@uxf/core/types";
2
+ import { UploadOptions } from "@uxf/ui/types";
2
3
  export declare function uploadFile(file: File, uploadOptions?: UploadOptions): Promise<FileResponse>;
@@ -38,6 +38,7 @@ function uploadFile(file, uploadOptions) {
38
38
  id: Math.round(Math.random() * 100000000),
39
39
  uuid: getRandomUuid(),
40
40
  name: file.name,
41
+ namespace: null,
41
42
  extension: file.name.split(".").slice(-1).join(""),
42
43
  });
43
44
  }, time);