@pathscale/ui 0.0.3 → 0.0.4

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.
@@ -12,7 +12,7 @@ declare const accordionContainerVariants: {
12
12
  false: string;
13
13
  };
14
14
  }> & ClassProps) | undefined): string;
15
- variantKeys: ("expanded" | "disabled")[];
15
+ variantKeys: ("disabled" | "expanded")[];
16
16
  };
17
17
 
18
18
  type AccordionProps = {
@@ -21,7 +21,7 @@ declare const inputVariants: {
21
21
  false: string;
22
22
  };
23
23
  }> & ClassProps) | undefined): string;
24
- variantKeys: ("expanded" | "rounded" | "loading" | "color")[];
24
+ variantKeys: ("rounded" | "loading" | "color" | "expanded")[];
25
25
  };
26
26
 
27
27
  type InputProps = Partial<VariantProps<typeof inputVariants> & ClassProps & ComponentProps<"input">> & {
@@ -25,7 +25,7 @@ declare const paginationItemVariants: {
25
25
  false: string;
26
26
  };
27
27
  }> & ClassProps) | undefined): string;
28
- variantKeys: ("disabled" | "size" | "rounded" | "active" | "simple")[];
28
+ variantKeys: ("size" | "rounded" | "disabled" | "active" | "simple")[];
29
29
  };
30
30
 
31
31
  type PaginationProps = {
@@ -28,7 +28,7 @@ declare const selectVariants: {
28
28
  false: string;
29
29
  };
30
30
  }> & ClassProps) | undefined): string;
31
- variantKeys: ("expanded" | "size" | "rounded" | "loading" | "color")[];
31
+ variantKeys: ("size" | "rounded" | "loading" | "color" | "expanded")[];
32
32
  };
33
33
 
34
34
  type SelectProps = VariantProps<typeof selectVariants> & ClassProps & ComponentProps<"select"> & {
@@ -21,7 +21,7 @@ declare const switchVariants: {
21
21
  false: string;
22
22
  };
23
23
  }> & ClassProps) | undefined): string;
24
- variantKeys: ("disabled" | "size" | "rounded" | "outlined")[];
24
+ variantKeys: ("size" | "rounded" | "outlined" | "disabled")[];
25
25
  };
26
26
  declare const checkVariants: {
27
27
  (props?: (ConfigVariants<{
@@ -24,7 +24,7 @@ declare const tabsNavVariants: {
24
24
  false: string;
25
25
  };
26
26
  }> & ClassProps) | undefined): string;
27
- variantKeys: ("expanded" | "size" | "type" | "alignment")[];
27
+ variantKeys: ("size" | "type" | "expanded" | "alignment")[];
28
28
  };
29
29
 
30
30
  type TabItem = {
@@ -33,7 +33,7 @@ type UploadProps = {
33
33
  dragDrop?: boolean;
34
34
  name?: string;
35
35
  onChange?: (files: File | File[]) => void;
36
- } & VariantProps<typeof uploadWrapperVariants> & JSX.InputHTMLAttributes<HTMLInputElement>;
36
+ } & VariantProps<typeof uploadWrapperVariants> & Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "onChange" | "multiple" | "accept" | "disabled">;
37
37
  declare const Upload: Component<UploadProps>;
38
38
 
39
39
  export { Upload as U, type UploadProps as a };
@@ -55,11 +55,15 @@ var Upload = (props) => {
55
55
  ["style", "color", "size"]
56
56
  );
57
57
  const handleChange = (e) => {
58
- const files = e.target.files;
58
+ const input = e.target;
59
+ const files = input.files;
59
60
  if (!files || files.length === 0) return;
60
- const result = local.multiple ? Array.from(files) : files[0];
61
- if (result) {
62
- local.onChange?.(result);
61
+ if (local.onChange) {
62
+ if (local.multiple) {
63
+ local.onChange(Array.from(files));
64
+ } else if (files[0]) {
65
+ local.onChange(files[0]);
66
+ }
63
67
  }
64
68
  };
65
69
  const handleDrop = (e) => {
@@ -67,9 +71,12 @@ var Upload = (props) => {
67
71
  e.preventDefault();
68
72
  const files = e.dataTransfer?.files;
69
73
  if (!files || files.length === 0) return;
70
- const result = local.multiple ? Array.from(files) : files[0];
71
- if (result) {
72
- local.onChange?.(result);
74
+ if (local.onChange) {
75
+ if (local.multiple) {
76
+ local.onChange(Array.from(files));
77
+ } else if (files[0]) {
78
+ local.onChange(files[0]);
79
+ }
73
80
  }
74
81
  };
75
82
  const handleDragOver = (e) => {
@@ -40,11 +40,15 @@ var _tmpl$2 = /* @__PURE__ */ template(`<div><label class="cursor-pointer relati
40
40
  var Upload = (props) => {
41
41
  const [local, variantProps, otherProps] = splitProps(props, ["icon", "label", "multiple", "disabled", "accept", "dragDrop", "name", "onChange"], ["style", "color", "size"]);
42
42
  const handleChange = (e) => {
43
- const files = e.target.files;
43
+ const input = e.target;
44
+ const files = input.files;
44
45
  if (!files || files.length === 0) return;
45
- const result = local.multiple ? Array.from(files) : files[0];
46
- if (result) {
47
- local.onChange?.(result);
46
+ if (local.onChange) {
47
+ if (local.multiple) {
48
+ local.onChange(Array.from(files));
49
+ } else if (files[0]) {
50
+ local.onChange(files[0]);
51
+ }
48
52
  }
49
53
  };
50
54
  return (() => {
@@ -1,5 +1,5 @@
1
- import { A as Accordion } from '../../Accordion-JZGWxBMK.js';
2
- export { a as AccordionProps } from '../../Accordion-JZGWxBMK.js';
1
+ import { A as Accordion } from '../../Accordion-nwuRbRRw.js';
2
+ export { a as AccordionProps } from '../../Accordion-nwuRbRRw.js';
3
3
  import 'solid-js';
4
4
  import '../../classes-B_S9K-9I.js';
5
5
 
@@ -1,5 +1,5 @@
1
- import { I as Input } from '../../Input-C1bm4HGf.js';
2
- export { a as InputProps } from '../../Input-C1bm4HGf.js';
1
+ import { I as Input } from '../../Input-BQbTzjIO.js';
2
+ export { a as InputProps } from '../../Input-BQbTzjIO.js';
3
3
  import 'solid-js';
4
4
  import '../../classes-B_S9K-9I.js';
5
5
 
@@ -34,7 +34,7 @@ declare const itemVariants: {
34
34
  false: string;
35
35
  };
36
36
  }> & ClassProps) | undefined): string;
37
- variantKeys: ("expanded" | "disabled" | "active")[];
37
+ variantKeys: ("disabled" | "expanded" | "active")[];
38
38
  };
39
39
 
40
40
  type MenuProps = {
@@ -1,5 +1,5 @@
1
- import { P as Pagination } from '../../Pagination-CJtlFMHy.js';
2
- export { a as PaginationProps } from '../../Pagination-CJtlFMHy.js';
1
+ import { P as Pagination } from '../../Pagination-BlrjElGg.js';
2
+ export { a as PaginationProps } from '../../Pagination-BlrjElGg.js';
3
3
  import 'solid-js';
4
4
  import '../../classes-B_S9K-9I.js';
5
5
 
@@ -1,5 +1,5 @@
1
- import { S as Select } from '../../Select-CWCDBvec.js';
2
- export { a as SelectProps } from '../../Select-CWCDBvec.js';
1
+ import { S as Select } from '../../Select-CP-TUHJv.js';
2
+ export { a as SelectProps } from '../../Select-CP-TUHJv.js';
3
3
  import 'solid-js';
4
4
  import '../../classes-B_S9K-9I.js';
5
5
 
@@ -1,5 +1,5 @@
1
- import { S as Switch } from '../../Switch-BiKX7HZ2.js';
2
- export { a as SwitchProps } from '../../Switch-BiKX7HZ2.js';
1
+ import { S as Switch } from '../../Switch-3IXS_68H.js';
2
+ export { a as SwitchProps } from '../../Switch-3IXS_68H.js';
3
3
  import 'solid-js';
4
4
  import '../../classes-B_S9K-9I.js';
5
5
 
@@ -1,5 +1,5 @@
1
- import { T as Tabs } from '../../Tabs-BEnRV6GG.js';
2
- export { a as TabsProps } from '../../Tabs-BEnRV6GG.js';
1
+ import { T as Tabs } from '../../Tabs-BNR3p92D.js';
2
+ export { a as TabsProps } from '../../Tabs-BNR3p92D.js';
3
3
  import 'solid-js';
4
4
  import '../../classes-B_S9K-9I.js';
5
5
 
@@ -1,5 +1,5 @@
1
- import { U as Upload } from '../../Upload-BrFuZ4JA.js';
2
- export { a as UploadProps } from '../../Upload-BrFuZ4JA.js';
1
+ import { U as Upload } from '../../Upload-CRljD5jf.js';
2
+ export { a as UploadProps } from '../../Upload-CRljD5jf.js';
3
3
  import 'solid-js';
4
4
  import '../../classes-B_S9K-9I.js';
5
5
 
@@ -1 +1 @@
1
- export { upload_default as default } from '../../chunk/S3ZDSQSV.js';
1
+ export { upload_default as default } from '../../chunk/YDEDUOFM.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  upload_default
3
- } from "../../chunk/QLESLIWS.jsx";
3
+ } from "../../chunk/QHJOIUYT.jsx";
4
4
  import "../../chunk/P7WPLZNA.jsx";
5
5
  export {
6
6
  upload_default as default
package/dist/index.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  export { A as Avatar } from './Avatar-CzIirpVq.js';
2
2
  export { B as Button } from './Button-B50OLXuV.js';
3
- export { I as Input } from './Input-C1bm4HGf.js';
3
+ export { I as Input } from './Input-BQbTzjIO.js';
4
4
  export { T as Textarea } from './Textarea-Cpdk7m6S.js';
5
5
  export { P as Progress } from './Progress-gN0xqhAF.js';
6
- export { U as Upload } from './Upload-BrFuZ4JA.js';
7
- export { A as Accordion } from './Accordion-JZGWxBMK.js';
8
- export { P as Pagination } from './Pagination-CJtlFMHy.js';
9
- export { T as Tabs } from './Tabs-BEnRV6GG.js';
6
+ export { U as Upload } from './Upload-CRljD5jf.js';
7
+ export { A as Accordion } from './Accordion-nwuRbRRw.js';
8
+ export { P as Pagination } from './Pagination-BlrjElGg.js';
9
+ export { T as Tabs } from './Tabs-BNR3p92D.js';
10
10
  export { T as Tooltip } from './Tooltip-BfPongoz.js';
11
11
  export { T as Tag } from './Tag-BPrhn-Ne.js';
12
- export { S as Select } from './Select-CWCDBvec.js';
13
- export { S as Switch } from './Switch-BiKX7HZ2.js';
12
+ export { S as Select } from './Select-CP-TUHJv.js';
13
+ export { S as Switch } from './Switch-3IXS_68H.js';
14
14
  export { C as Checkbox } from './Checkbox-BjaweaOH.js';
15
15
  export { Breadcrumb, BreadcrumbItem } from './components/breadcrumb/index.js';
16
16
  export { A as Autocomplete } from './Autocomplete-gLkjMHrc.js';
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
1
  export { toast_default as Toast } from './chunk/JWRGKHDO.js';
2
+ export { upload_default as Upload } from './chunk/YDEDUOFM.js';
2
3
  export { tooltip_default as Tooltip } from './chunk/4TWLQ3IA.js';
3
- export { upload_default as Upload } from './chunk/S3ZDSQSV.js';
4
4
  export { select_default as Select } from './chunk/3IHANYRN.js';
5
- export { steps_default as Steps } from './chunk/TT2JYGLU.js';
6
5
  export { switch_default as Switch } from './chunk/P2L6LFLS.js';
6
+ export { steps_default as Steps } from './chunk/TT2JYGLU.js';
7
7
  export { table_default as Table } from './chunk/QYEMOKUG.js';
8
8
  export { tabs_default as Tabs } from './chunk/WOT36Q7O.js';
9
9
  export { tag_default as Tag } from './chunk/CJZGTNJZ.js';
10
10
  export { textarea_default as Textarea } from './chunk/EB7KXR65.js';
11
11
  export { timeline_default as Timeline } from './chunk/WUZETUQR.js';
12
- export { Dropdown_default as Dropdown, DropdownItem_default as DropdownItem, DropdownMenu_default as DropdownMenu } from './chunk/7ROVLN3J.js';
13
12
  export { field_default as Field } from './chunk/MAX47D6F.js';
14
13
  export { input_default as Input } from './chunk/T2DPPLBQ.js';
14
+ export { Menu_default as Menu, MenuItem_default as MenuItem, MenuList_default as MenuList } from './chunk/3VOILEMN.js';
15
15
  export { Navbar_default as Navbar, NavbarDropdown_default as NavbarDropdown, NavbarItem_default as NavbarItem } from './chunk/OSJ3P7PI.js';
16
16
  export { pagination_default as Pagination } from './chunk/DBQ7IOPU.js';
17
- export { Menu_default as Menu, MenuItem_default as MenuItem, MenuList_default as MenuList } from './chunk/3VOILEMN.js';
17
+ export { Dropdown_default as Dropdown, DropdownItem_default as DropdownItem, DropdownMenu_default as DropdownMenu } from './chunk/7ROVLN3J.js';
18
18
  export { progress_default as Progress } from './chunk/GMIXRYN3.js';
19
19
  export { accordion_default as Accordion } from './chunk/NZKPDBTE.js';
20
20
  export { autocomplete_default as Autocomplete } from './chunk/MYERRMTM.js';
package/dist/index.jsx CHANGED
@@ -6,39 +6,39 @@ import {
6
6
  } from "./chunk/DNTGSCVF.jsx";
7
7
  import {
8
8
  upload_default
9
- } from "./chunk/QLESLIWS.jsx";
10
- import {
11
- select_default
12
- } from "./chunk/6SBH3KSM.jsx";
9
+ } from "./chunk/QHJOIUYT.jsx";
13
10
  import {
14
11
  steps_default
15
12
  } from "./chunk/LAQPAV5I.jsx";
16
13
  import {
17
14
  switch_default
18
15
  } from "./chunk/GLEAR2TS.jsx";
16
+ import {
17
+ select_default
18
+ } from "./chunk/6SBH3KSM.jsx";
19
19
  import {
20
20
  table_default
21
21
  } from "./chunk/HWAGW5N4.jsx";
22
22
  import {
23
23
  tabs_default
24
24
  } from "./chunk/KV6LTJHI.jsx";
25
- import {
26
- tag_default
27
- } from "./chunk/LI3HCFL7.jsx";
28
25
  import {
29
26
  textarea_default
30
27
  } from "./chunk/WB6NEEQV.jsx";
28
+ import {
29
+ tag_default
30
+ } from "./chunk/LI3HCFL7.jsx";
31
31
  import {
32
32
  timeline_default
33
33
  } from "./chunk/DSTUGZW6.jsx";
34
+ import {
35
+ field_default
36
+ } from "./chunk/VN5BKHA2.jsx";
34
37
  import {
35
38
  DropdownItem_default,
36
39
  DropdownMenu_default,
37
40
  Dropdown_default
38
41
  } from "./chunk/D2BEL4SM.jsx";
39
- import {
40
- field_default
41
- } from "./chunk/VN5BKHA2.jsx";
42
42
  import {
43
43
  input_default
44
44
  } from "./chunk/N7BXP7EI.jsx";
@@ -61,12 +61,12 @@ import {
61
61
  import {
62
62
  accordion_default
63
63
  } from "./chunk/QONDPQ2I.jsx";
64
- import {
65
- autocomplete_default
66
- } from "./chunk/C4YO33NN.jsx";
67
64
  import {
68
65
  avatar_default
69
66
  } from "./chunk/C4745OZS.jsx";
67
+ import {
68
+ autocomplete_default
69
+ } from "./chunk/C4YO33NN.jsx";
70
70
  import {
71
71
  BreadcrumbItem_default,
72
72
  Breadcrumb_default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathscale/ui",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "author": "pathscale",
5
5
  "repository": {
6
6
  "type": "git",