@pathscale/ui 0.0.3 → 0.0.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.
@@ -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';
@@ -22,6 +22,6 @@ export { Polymorphic, PolymorphicButton } from './components/polymorphic/index.j
22
22
  export { S as Steps } from './Steps-1miUeyCD.js';
23
23
  export { T as Table } from './Table-CGa6Nop3.js';
24
24
  export { T as Timeline } from './Timeline-Bd4SxHMT.js';
25
- export { default as Toast } from './components/toast/index.js';
25
+ export { Toaster, default as toast } from './components/toast/index.js';
26
26
  import 'solid-js';
27
27
  import './classes-B_S9K-9I.js';
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
- export { toast_default as Toast } from './chunk/JWRGKHDO.js';
1
+ export { Toaster_default as Toaster, 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
- export { select_default as Select } from './chunk/3IHANYRN.js';
5
4
  export { steps_default as Steps } from './chunk/TT2JYGLU.js';
5
+ export { select_default as Select } from './chunk/3IHANYRN.js';
6
6
  export { switch_default as Switch } from './chunk/P2L6LFLS.js';
7
- export { table_default as Table } from './chunk/QYEMOKUG.js';
8
7
  export { tabs_default as Tabs } from './chunk/WOT36Q7O.js';
9
- export { tag_default as Tag } from './chunk/CJZGTNJZ.js';
10
8
  export { textarea_default as Textarea } from './chunk/EB7KXR65.js';
9
+ export { table_default as Table } from './chunk/QYEMOKUG.js';
10
+ export { tag_default as Tag } from './chunk/CJZGTNJZ.js';
11
11
  export { timeline_default as Timeline } from './chunk/WUZETUQR.js';
12
+ export { checkbox_default as Checkbox } from './chunk/FPUQ25SO.js';
12
13
  export { Dropdown_default as Dropdown, DropdownItem_default as DropdownItem, DropdownMenu_default as DropdownMenu } from './chunk/7ROVLN3J.js';
13
- export { field_default as Field } from './chunk/MAX47D6F.js';
14
+ export { Menu_default as Menu, MenuItem_default as MenuItem, MenuList_default as MenuList } from './chunk/3VOILEMN.js';
15
+ export { pagination_default as Pagination } from './chunk/DBQ7IOPU.js';
14
16
  export { input_default as Input } from './chunk/T2DPPLBQ.js';
15
17
  export { Navbar_default as Navbar, NavbarDropdown_default as NavbarDropdown, NavbarItem_default as NavbarItem } from './chunk/OSJ3P7PI.js';
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';
18
18
  export { progress_default as Progress } from './chunk/GMIXRYN3.js';
19
19
  export { accordion_default as Accordion } from './chunk/NZKPDBTE.js';
20
- export { autocomplete_default as Autocomplete } from './chunk/MYERRMTM.js';
21
20
  export { avatar_default as Avatar } from './chunk/MI773TMC.js';
22
- export { Breadcrumb_default as Breadcrumb, BreadcrumbItem_default as BreadcrumbItem } from './chunk/V6Y5E7BL.js';
21
+ export { autocomplete_default as Autocomplete } from './chunk/MYERRMTM.js';
23
22
  export { button_default as Button } from './chunk/YMO6RPS6.js';
24
23
  export { Polymorphic_default as Polymorphic, PolymorphicButton_default as PolymorphicButton } from './chunk/G6RG4LR7.js';
25
- export { checkbox_default as Checkbox } from './chunk/FPUQ25SO.js';
24
+ export { field_default as Field } from './chunk/MAX47D6F.js';
25
+ export { Breadcrumb_default as Breadcrumb, BreadcrumbItem_default as BreadcrumbItem } from './chunk/V6Y5E7BL.js';
package/dist/index.jsx CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ Toaster_default,
2
3
  toast_default
3
4
  } from "./chunk/FKSQPGOD.jsx";
4
5
  import {
@@ -6,28 +7,28 @@ import {
6
7
  } from "./chunk/DNTGSCVF.jsx";
7
8
  import {
8
9
  upload_default
9
- } from "./chunk/QLESLIWS.jsx";
10
- import {
11
- select_default
12
- } from "./chunk/6SBH3KSM.jsx";
10
+ } from "./chunk/QHJOIUYT.jsx";
13
11
  import {
14
12
  steps_default
15
13
  } from "./chunk/LAQPAV5I.jsx";
14
+ import {
15
+ select_default
16
+ } from "./chunk/6SBH3KSM.jsx";
16
17
  import {
17
18
  switch_default
18
19
  } from "./chunk/GLEAR2TS.jsx";
19
20
  import {
20
21
  table_default
21
22
  } from "./chunk/HWAGW5N4.jsx";
22
- import {
23
- tabs_default
24
- } from "./chunk/KV6LTJHI.jsx";
25
23
  import {
26
24
  tag_default
27
25
  } from "./chunk/LI3HCFL7.jsx";
28
26
  import {
29
27
  textarea_default
30
28
  } from "./chunk/WB6NEEQV.jsx";
29
+ import {
30
+ tabs_default
31
+ } from "./chunk/KV6LTJHI.jsx";
31
32
  import {
32
33
  timeline_default
33
34
  } from "./chunk/DSTUGZW6.jsx";
@@ -114,7 +115,8 @@ export {
114
115
  tag_default as Tag,
115
116
  textarea_default as Textarea,
116
117
  timeline_default as Timeline,
117
- toast_default as Toast,
118
+ Toaster_default as Toaster,
118
119
  tooltip_default as Tooltip,
119
- upload_default as Upload
120
+ upload_default as Upload,
121
+ toast_default as toast
120
122
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathscale/ui",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "author": "pathscale",
5
5
  "repository": {
6
6
  "type": "git",