@pathscale/ui 0.0.1 → 0.0.2

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.
Files changed (69) hide show
  1. package/dist/Accordion-nwuRbRRw.d.ts +27 -0
  2. package/dist/Checkbox-BjaweaOH.d.ts +40 -0
  3. package/dist/Pagination-BlrjElGg.d.ts +43 -0
  4. package/dist/Progress-a616LgE0.d.ts +5 -0
  5. package/dist/Select-CP-TUHJv.d.ts +44 -0
  6. package/dist/Switch-3IXS_68H.d.ts +72 -0
  7. package/dist/Tabs-BNR3p92D.d.ts +42 -0
  8. package/dist/Tag-BPrhn-Ne.d.ts +42 -0
  9. package/dist/Tooltip-BfPongoz.d.ts +53 -0
  10. package/dist/Upload-BrFuZ4JA.d.ts +39 -0
  11. package/dist/chunk/3IHANYRN.js +98 -0
  12. package/dist/chunk/4TWLQ3IA.js +103 -0
  13. package/dist/chunk/6SBH3KSM.jsx +96 -0
  14. package/dist/chunk/CJZGTNJZ.js +115 -0
  15. package/dist/chunk/DBQ7IOPU.js +189 -0
  16. package/dist/chunk/DNTGSCVF.jsx +100 -0
  17. package/dist/chunk/ELRAUORW.jsx +179 -0
  18. package/dist/chunk/FPUQ25SO.js +137 -0
  19. package/dist/chunk/GLEAR2TS.jsx +160 -0
  20. package/dist/chunk/KV6LTJHI.jsx +175 -0
  21. package/dist/chunk/LI3HCFL7.jsx +132 -0
  22. package/dist/chunk/MMTAND25.jsx +126 -0
  23. package/dist/chunk/MXG3MBEN.jsx +148 -0
  24. package/dist/chunk/NZKPDBTE.js +118 -0
  25. package/dist/chunk/P2L6LFLS.js +144 -0
  26. package/dist/chunk/QLESLIWS.jsx +110 -0
  27. package/dist/chunk/QNOJ6PCD.js +278 -0
  28. package/dist/chunk/QONDPQ2I.jsx +105 -0
  29. package/dist/chunk/S3ZDSQSV.js +98 -0
  30. package/dist/chunk/V6Y5E7BL.js +133 -0
  31. package/dist/chunk/WCBMW2TP.jsx +203 -0
  32. package/dist/chunk/WOT36Q7O.js +166 -0
  33. package/dist/components/Progress/index.d.ts +2 -3
  34. package/dist/components/Progress/index.js +1 -278
  35. package/dist/components/Progress/index.jsx +7 -194
  36. package/dist/components/accordion/index.d.ts +5 -24
  37. package/dist/components/accordion/index.js +1 -118
  38. package/dist/components/accordion/index.jsx +3 -100
  39. package/dist/components/breadcrumb/index.d.ts +2 -2
  40. package/dist/components/breadcrumb/index.js +1 -133
  41. package/dist/components/breadcrumb/index.jsx +4 -120
  42. package/dist/components/checkbox/index.d.ts +5 -37
  43. package/dist/components/checkbox/index.js +1 -137
  44. package/dist/components/checkbox/index.jsx +3 -143
  45. package/dist/components/pagination/index.d.ts +5 -40
  46. package/dist/components/pagination/index.js +1 -189
  47. package/dist/components/pagination/index.jsx +3 -174
  48. package/dist/components/select/index.d.ts +5 -41
  49. package/dist/components/select/index.js +1 -98
  50. package/dist/components/select/index.jsx +3 -91
  51. package/dist/components/switch/index.d.ts +5 -69
  52. package/dist/components/switch/index.js +1 -144
  53. package/dist/components/switch/index.jsx +3 -155
  54. package/dist/components/tabs/index.d.ts +5 -39
  55. package/dist/components/tabs/index.js +1 -166
  56. package/dist/components/tabs/index.jsx +3 -170
  57. package/dist/components/tag/index.d.ts +5 -39
  58. package/dist/components/tag/index.js +1 -115
  59. package/dist/components/tag/index.jsx +3 -127
  60. package/dist/components/tooltip/index.d.ts +5 -50
  61. package/dist/components/tooltip/index.js +1 -103
  62. package/dist/components/tooltip/index.jsx +3 -95
  63. package/dist/components/upload/index.d.ts +5 -36
  64. package/dist/components/upload/index.js +1 -98
  65. package/dist/components/upload/index.jsx +3 -105
  66. package/dist/index.d.ts +11 -0
  67. package/dist/index.js +12 -1
  68. package/dist/index.jsx +47 -1
  69. package/package.json +1 -1
@@ -1,115 +1 @@
1
- import { cva, classes } from '../../chunk/HKS7ET6T.js';
2
- import { delegateEvents, template, spread, mergeProps, insert, createComponent, effect, setAttribute, className } from 'solid-js/web';
3
- import { splitProps, createMemo, untrack, Show } from 'solid-js';
4
-
5
- // src/components/tag/Tag.styles.ts
6
- var tagVariants = cva(
7
- [
8
- "inline-flex items-center gap-2 px-3 py-1 text-sm rounded",
9
- "transition select-none"
10
- ],
11
- {
12
- variants: {
13
- size: {
14
- normal: "text-xs px-2 py-0.5",
15
- medium: "text-sm px-3 py-1",
16
- large: "text-base px-4 py-2"
17
- },
18
- type: {
19
- primary: "bg-blue-500 text-white",
20
- info: "bg-sky-500 text-white",
21
- success: "bg-green-500 text-white",
22
- warning: "bg-yellow-500 text-black",
23
- danger: "bg-red-500 text-white",
24
- dark: "bg-zinc-800 text-white",
25
- light: "bg-gray-100 text-black"
26
- },
27
- rounded: {
28
- true: "rounded-full",
29
- false: ""
30
- },
31
- closable: {
32
- true: "pr-1",
33
- false: ""
34
- }
35
- },
36
- defaultVariants: {
37
- size: "normal"
38
- }
39
- }
40
- );
41
-
42
- // src/components/tag/Tag.tsx
43
- var _tmpl$ = /* @__PURE__ */ template(`<button type=button class="ml-2 text-xs text-white hover:opacity-80">`);
44
- var _tmpl$2 = /* @__PURE__ */ template(`<button type=button>`);
45
- var _tmpl$3 = /* @__PURE__ */ template(`<div role=group><span role=status><span class=truncate>`);
46
- var Tag = (props) => {
47
- const [localProps, variantProps, otherProps] = splitProps(props, ["closable", "attached", "onClose", "ariaCloseLabel", "closeIcon", "children", "type"], ["class", ...tagVariants.variantKeys]);
48
- const isAttachedClosable = createMemo(() => untrack(() => localProps.attached && localProps.closable));
49
- const isClosable = createMemo(() => untrack(() => localProps.closable && !localProps.attached));
50
- const tagClasses = createMemo(() => classes(tagVariants({
51
- ...variantProps,
52
- closable: localProps.closable
53
- }), variantProps.class));
54
- const attachedButtonClasses = createMemo(() => tagVariants({
55
- ...variantProps,
56
- class: "ml-1 text-xs hover:opacity-80"
57
- }));
58
- const handleClose = (e) => {
59
- untrack(() => {
60
- if (typeof localProps.onClose === "function") {
61
- localProps.onClose(e);
62
- }
63
- });
64
- };
65
- return (() => {
66
- var _el$ = _tmpl$3(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
67
- spread(_el$2, mergeProps({
68
- get ["class"]() {
69
- return tagClasses();
70
- }
71
- }, otherProps), false, true);
72
- insert(_el$3, () => localProps.children);
73
- insert(_el$2, createComponent(Show, {
74
- get when() {
75
- return isClosable();
76
- },
77
- get children() {
78
- var _el$4 = _tmpl$();
79
- _el$4.$$click = handleClose;
80
- insert(_el$4, () => localProps.closeIcon ?? "\xD7");
81
- effect(() => setAttribute(_el$4, "aria-label", localProps.ariaCloseLabel ?? "Remove tag"));
82
- return _el$4;
83
- }
84
- }), null);
85
- insert(_el$, createComponent(Show, {
86
- get when() {
87
- return isAttachedClosable();
88
- },
89
- get children() {
90
- var _el$5 = _tmpl$2();
91
- _el$5.$$click = handleClose;
92
- insert(_el$5, () => localProps.closeIcon ?? "\xD7");
93
- effect((_p$) => {
94
- var _v$ = localProps.ariaCloseLabel ?? "Remove tag", _v$2 = attachedButtonClasses();
95
- _v$ !== _p$.e && setAttribute(_el$5, "aria-label", _p$.e = _v$);
96
- _v$2 !== _p$.t && className(_el$5, _p$.t = _v$2);
97
- return _p$;
98
- }, {
99
- e: void 0,
100
- t: void 0
101
- });
102
- return _el$5;
103
- }
104
- }), null);
105
- effect(() => className(_el$, isAttachedClosable() ? "tags has-addons" : void 0));
106
- return _el$;
107
- })();
108
- };
109
- var Tag_default = Tag;
110
- delegateEvents(["click"]);
111
-
112
- // src/components/tag/index.ts
113
- var tag_default = Tag_default;
114
-
115
- export { tag_default as default };
1
+ export { tag_default as default } from '../../chunk/CJZGTNJZ.js';
@@ -1,131 +1,7 @@
1
1
  import {
2
- classes,
3
- cva
4
- } from "../../chunk/P7WPLZNA.jsx";
5
-
6
- // src/components/tag/Tag.tsx
7
- import {
8
- splitProps,
9
- createMemo,
10
- Show,
11
- untrack
12
- } from "solid-js";
13
-
14
- // src/components/tag/Tag.styles.ts
15
- var tagVariants = cva(
16
- [
17
- "inline-flex items-center gap-2 px-3 py-1 text-sm rounded",
18
- "transition select-none"
19
- ],
20
- {
21
- variants: {
22
- size: {
23
- normal: "text-xs px-2 py-0.5",
24
- medium: "text-sm px-3 py-1",
25
- large: "text-base px-4 py-2"
26
- },
27
- type: {
28
- primary: "bg-blue-500 text-white",
29
- info: "bg-sky-500 text-white",
30
- success: "bg-green-500 text-white",
31
- warning: "bg-yellow-500 text-black",
32
- danger: "bg-red-500 text-white",
33
- dark: "bg-zinc-800 text-white",
34
- light: "bg-gray-100 text-black"
35
- },
36
- rounded: {
37
- true: "rounded-full",
38
- false: ""
39
- },
40
- closable: {
41
- true: "pr-1",
42
- false: ""
43
- }
44
- },
45
- defaultVariants: {
46
- size: "normal"
47
- }
48
- }
49
- );
50
-
51
- // src/components/tag/Tag.tsx
52
- var Tag = (props) => {
53
- const [localProps, variantProps, otherProps] = splitProps(
54
- props,
55
- [
56
- "closable",
57
- "attached",
58
- "onClose",
59
- "ariaCloseLabel",
60
- "closeIcon",
61
- "children",
62
- "type"
63
- ],
64
- ["class", ...tagVariants.variantKeys]
65
- );
66
- const isAttachedClosable = createMemo(
67
- () => untrack(() => localProps.attached && localProps.closable)
68
- );
69
- const isClosable = createMemo(
70
- () => untrack(() => localProps.closable && !localProps.attached)
71
- );
72
- const tagClasses = createMemo(
73
- () => classes(
74
- tagVariants({
75
- ...variantProps,
76
- closable: localProps.closable
77
- }),
78
- variantProps.class
79
- )
80
- );
81
- const attachedButtonClasses = createMemo(
82
- () => tagVariants({
83
- ...variantProps,
84
- class: "ml-1 text-xs hover:opacity-80"
85
- })
86
- );
87
- const handleClose = (e) => {
88
- untrack(() => {
89
- if (typeof localProps.onClose === "function") {
90
- localProps.onClose(e);
91
- }
92
- });
93
- };
94
- return <div
95
- class={isAttachedClosable() ? "tags has-addons" : void 0}
96
- role="group"
97
- >
98
- <span class={tagClasses()} role="status" {...otherProps}>
99
- <span class="truncate">{localProps.children}</span>
100
-
101
- <Show when={isClosable()}>
102
- <button
103
- type="button"
104
- aria-label={localProps.ariaCloseLabel ?? "Remove tag"}
105
- onClick={handleClose}
106
- class="ml-2 text-xs text-white hover:opacity-80"
107
- >
108
- {localProps.closeIcon ?? "\xD7"}
109
- </button>
110
- </Show>
111
- </span>
112
-
113
- <Show when={isAttachedClosable()}>
114
- <button
115
- type="button"
116
- aria-label={localProps.ariaCloseLabel ?? "Remove tag"}
117
- onClick={handleClose}
118
- class={attachedButtonClasses()}
119
- >
120
- {localProps.closeIcon ?? "\xD7"}
121
- </button>
122
- </Show>
123
- </div>;
124
- };
125
- var Tag_default = Tag;
126
-
127
- // src/components/tag/index.ts
128
- var tag_default = Tag_default;
2
+ tag_default
3
+ } from "../../chunk/LI3HCFL7.jsx";
4
+ import "../../chunk/P7WPLZNA.jsx";
129
5
  export {
130
6
  tag_default as default
131
7
  };
@@ -1,53 +1,8 @@
1
- import { JSX, Component } from 'solid-js';
2
- import { C as ConfigVariants, a as ClassProps, V as VariantProps } from '../../classes-B_S9K-9I.js';
1
+ import { T as Tooltip } from '../../Tooltip-BfPongoz.js';
2
+ export { a as TooltipProps } from '../../Tooltip-BfPongoz.js';
3
+ import 'solid-js';
4
+ import '../../classes-B_S9K-9I.js';
3
5
 
4
- declare const tooltipVariants: {
5
- (props?: (ConfigVariants<{
6
- type: {
7
- info: string;
8
- success: string;
9
- warning: string;
10
- danger: string;
11
- primary: string;
12
- gray: string;
13
- };
14
- size: {
15
- sm: string;
16
- md: string;
17
- lg: string;
18
- };
19
- rounded: {
20
- true: string;
21
- false: string;
22
- };
23
- dashed: {
24
- true: string;
25
- false: string;
26
- };
27
- multilined: {
28
- true: string;
29
- false: string;
30
- };
31
- animated: {
32
- true: string;
33
- false: string;
34
- };
35
- position: {
36
- top: string;
37
- bottom: string;
38
- left: string;
39
- right: string;
40
- };
41
- }> & ClassProps) | undefined): string;
42
- variantKeys: ("type" | "size" | "rounded" | "dashed" | "multilined" | "animated" | "position")[];
43
- };
44
6
 
45
- type TooltipProps = {
46
- label: string;
47
- delay?: number;
48
- always?: boolean;
49
- children?: JSX.Element;
50
- } & VariantProps<typeof tooltipVariants> & JSX.HTMLAttributes<HTMLSpanElement>;
51
- declare const Tooltip: Component<TooltipProps>;
52
7
 
53
- export { type TooltipProps, Tooltip as default };
8
+ export { Tooltip as default };
@@ -1,103 +1 @@
1
- import { cva } from '../../chunk/HKS7ET6T.js';
2
- import { template, spread, insert, createComponent, effect, className } from 'solid-js/web';
3
- import { splitProps, Show } from 'solid-js';
4
-
5
- // src/components/tooltip/Tooltip.styles.ts
6
- var tooltipVariants = cva(
7
- [
8
- "absolute z-10 px-3 py-1 text-white text-sm",
9
- "opacity-0 group-hover:opacity-100",
10
- "pointer-events-none transition-opacity duration-200",
11
- "max-w-xs break-words",
12
- "after:content-[''] after:absolute after:w-2 after:h-2 after:rotate-45 after:bg-inherit"
13
- ].join(" "),
14
- {
15
- variants: {
16
- type: {
17
- info: "bg-blue-500",
18
- success: "bg-green-500",
19
- warning: "bg-yellow-500",
20
- danger: "bg-red-500",
21
- primary: "bg-indigo-500",
22
- gray: "bg-gray-700"
23
- },
24
- size: {
25
- sm: "text-xs",
26
- md: "text-sm",
27
- lg: "text-base"
28
- },
29
- rounded: {
30
- true: "rounded",
31
- false: "rounded-none"
32
- },
33
- dashed: {
34
- true: "border border-white border-dashed",
35
- false: ""
36
- },
37
- multilined: {
38
- true: "whitespace-pre-wrap",
39
- false: "whitespace-nowrap"
40
- },
41
- animated: {
42
- true: "transition-opacity duration-300 ease-in-out",
43
- false: ""
44
- },
45
- position: {
46
- top: "bottom-full left-1/2 -translate-x-1/2 mb-1 after:top-full after:left-1/2 after:-translate-x-1/2 after:-mt-1",
47
- bottom: "top-full left-1/2 -translate-x-1/2 mt-1 after:bottom-full after:left-1/2 after:-translate-x-1/2 after:-mb-1",
48
- left: "right-full top-1/2 -translate-y-1/2 mr-1 after:left-full after:top-1/2 after:-translate-y-1/2 after:-ml-1",
49
- right: "left-full top-1/2 -translate-y-1/2 ml-1 after:right-full after:top-1/2 after:-translate-y-1/2 after:-mr-1"
50
- }
51
- },
52
- defaultVariants: {
53
- type: "primary",
54
- size: "md",
55
- rounded: true,
56
- dashed: false,
57
- multilined: false,
58
- animated: true,
59
- position: "top"
60
- }
61
- }
62
- );
63
-
64
- // src/components/tooltip/Tooltip.tsx
65
- var _tmpl$ = /* @__PURE__ */ template(`<span>`);
66
- var _tmpl$2 = /* @__PURE__ */ template(`<span class="relative inline-block group">`);
67
- var Tooltip = (props) => {
68
- const [local, variantProps, otherProps] = splitProps(props, ["label", "delay", "always", "children"], ["type", "size", "position", "rounded", "dashed", "multilined", "animated"]);
69
- return (() => {
70
- var _el$ = _tmpl$2();
71
- spread(_el$, otherProps, false, true);
72
- insert(_el$, () => local.children, null);
73
- insert(_el$, createComponent(Show, {
74
- get when() {
75
- return local.label;
76
- },
77
- get children() {
78
- var _el$2 = _tmpl$();
79
- _el$2.style.setProperty("pointer-events", "none");
80
- insert(_el$2, () => local.label);
81
- effect((_p$) => {
82
- var _v$ = tooltipVariants(variantProps), _v$2 = `${local.delay ?? 0}ms`, _v$3 = local.always ? 1 : void 0;
83
- _v$ !== _p$.e && className(_el$2, _p$.e = _v$);
84
- _v$2 !== _p$.t && ((_p$.t = _v$2) != null ? _el$2.style.setProperty("transition-delay", _v$2) : _el$2.style.removeProperty("transition-delay"));
85
- _v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$2.style.setProperty("opacity", _v$3) : _el$2.style.removeProperty("opacity"));
86
- return _p$;
87
- }, {
88
- e: void 0,
89
- t: void 0,
90
- a: void 0
91
- });
92
- return _el$2;
93
- }
94
- }), null);
95
- return _el$;
96
- })();
97
- };
98
- var Tooltip_default = Tooltip;
99
-
100
- // src/components/tooltip/index.ts
101
- var tooltip_default = Tooltip_default;
102
-
103
- export { tooltip_default as default };
1
+ export { tooltip_default as default } from '../../chunk/4TWLQ3IA.js';
@@ -1,99 +1,7 @@
1
1
  import {
2
- cva
3
- } from "../../chunk/P7WPLZNA.jsx";
4
-
5
- // src/components/tooltip/Tooltip.tsx
6
- import {
7
- splitProps,
8
- Show
9
- } from "solid-js";
10
-
11
- // src/components/tooltip/Tooltip.styles.ts
12
- var tooltipVariants = cva(
13
- [
14
- "absolute z-10 px-3 py-1 text-white text-sm",
15
- "opacity-0 group-hover:opacity-100",
16
- "pointer-events-none transition-opacity duration-200",
17
- "max-w-xs break-words",
18
- "after:content-[''] after:absolute after:w-2 after:h-2 after:rotate-45 after:bg-inherit"
19
- ].join(" "),
20
- {
21
- variants: {
22
- type: {
23
- info: "bg-blue-500",
24
- success: "bg-green-500",
25
- warning: "bg-yellow-500",
26
- danger: "bg-red-500",
27
- primary: "bg-indigo-500",
28
- gray: "bg-gray-700"
29
- },
30
- size: {
31
- sm: "text-xs",
32
- md: "text-sm",
33
- lg: "text-base"
34
- },
35
- rounded: {
36
- true: "rounded",
37
- false: "rounded-none"
38
- },
39
- dashed: {
40
- true: "border border-white border-dashed",
41
- false: ""
42
- },
43
- multilined: {
44
- true: "whitespace-pre-wrap",
45
- false: "whitespace-nowrap"
46
- },
47
- animated: {
48
- true: "transition-opacity duration-300 ease-in-out",
49
- false: ""
50
- },
51
- position: {
52
- top: "bottom-full left-1/2 -translate-x-1/2 mb-1 after:top-full after:left-1/2 after:-translate-x-1/2 after:-mt-1",
53
- bottom: "top-full left-1/2 -translate-x-1/2 mt-1 after:bottom-full after:left-1/2 after:-translate-x-1/2 after:-mb-1",
54
- left: "right-full top-1/2 -translate-y-1/2 mr-1 after:left-full after:top-1/2 after:-translate-y-1/2 after:-ml-1",
55
- right: "left-full top-1/2 -translate-y-1/2 ml-1 after:right-full after:top-1/2 after:-translate-y-1/2 after:-mr-1"
56
- }
57
- },
58
- defaultVariants: {
59
- type: "primary",
60
- size: "md",
61
- rounded: true,
62
- dashed: false,
63
- multilined: false,
64
- animated: true,
65
- position: "top"
66
- }
67
- }
68
- );
69
-
70
- // src/components/tooltip/Tooltip.tsx
71
- var Tooltip = (props) => {
72
- const [local, variantProps, otherProps] = splitProps(
73
- props,
74
- ["label", "delay", "always", "children"],
75
- ["type", "size", "position", "rounded", "dashed", "multilined", "animated"]
76
- );
77
- return <span class="relative inline-block group" {...otherProps}>
78
- {local.children}
79
- <Show when={local.label}>
80
- <span
81
- class={tooltipVariants(variantProps)}
82
- style={{
83
- "transition-delay": `${local.delay ?? 0}ms`,
84
- opacity: local.always ? 1 : void 0,
85
- "pointer-events": "none"
86
- }}
87
- >
88
- {local.label}
89
- </span>
90
- </Show>
91
- </span>;
92
- };
93
- var Tooltip_default = Tooltip;
94
-
95
- // src/components/tooltip/index.ts
96
- var tooltip_default = Tooltip_default;
2
+ tooltip_default
3
+ } from "../../chunk/DNTGSCVF.jsx";
4
+ import "../../chunk/P7WPLZNA.jsx";
97
5
  export {
98
6
  tooltip_default as default
99
7
  };
@@ -1,39 +1,8 @@
1
- import { JSX, Component } from 'solid-js';
2
- import { C as ConfigVariants, a as ClassProps, V as VariantProps } from '../../classes-B_S9K-9I.js';
1
+ import { U as Upload } from '../../Upload-BrFuZ4JA.js';
2
+ export { a as UploadProps } from '../../Upload-BrFuZ4JA.js';
3
+ import 'solid-js';
4
+ import '../../classes-B_S9K-9I.js';
3
5
 
4
- declare const uploadWrapperVariants: {
5
- (props?: (ConfigVariants<{
6
- style: {
7
- boxed: string;
8
- button: string;
9
- };
10
- color: {
11
- primary: string;
12
- success: string;
13
- info: string;
14
- warning: string;
15
- danger: string;
16
- gray: string;
17
- };
18
- size: {
19
- sm: string;
20
- md: string;
21
- lg: string;
22
- };
23
- }> & ClassProps) | undefined): string;
24
- variantKeys: ("style" | "color" | "size")[];
25
- };
26
6
 
27
- type UploadProps = {
28
- icon?: JSX.Element;
29
- label?: string;
30
- multiple?: boolean;
31
- disabled?: boolean;
32
- accept?: string;
33
- dragDrop?: boolean;
34
- name?: string;
35
- onChange?: (files: File | File[]) => void;
36
- } & VariantProps<typeof uploadWrapperVariants> & JSX.InputHTMLAttributes<HTMLInputElement>;
37
- declare const Upload: Component<UploadProps>;
38
7
 
39
- export { type UploadProps, Upload as default };
8
+ export { Upload as default };
@@ -1,98 +1 @@
1
- import { cva, classes } from '../../chunk/HKS7ET6T.js';
2
- import { template, className, spread, mergeProps, insert, createComponent, effect } from 'solid-js/web';
3
- import { splitProps, Show } from 'solid-js';
4
-
5
- // src/components/upload/Upload.styles.ts
6
- var uploadWrapperVariants = cva("", {
7
- variants: {
8
- style: {
9
- boxed: "flex flex-col items-center justify-center border border-gray-300 rounded-md p-4 bg-white dark:bg-gray-800 text-gray-700 hover:text-gray-900 text-center",
10
- button: "px-4 py-2 rounded inline-flex items-center gap-2 text-white transition-colors"
11
- },
12
- color: {
13
- primary: "bg-blue-500 hover:bg-blue-600",
14
- success: "bg-green-500 hover:bg-green-600",
15
- info: "bg-sky-500 hover:bg-sky-600",
16
- warning: "bg-yellow-500 hover:bg-yellow-600",
17
- danger: "bg-red-500 hover:bg-red-600",
18
- gray: ""
19
- // usado solo en style="boxed"
20
- },
21
- size: {
22
- sm: "text-sm",
23
- md: "text-base",
24
- lg: "text-lg"
25
- }
26
- },
27
- defaultVariants: {
28
- style: "boxed",
29
- color: "gray",
30
- size: "md"
31
- }
32
- });
33
- var fileInputClass = "absolute inset-0 w-full h-full opacity-0 cursor-pointer";
34
- var fileIconClass = "w-6 h-6";
35
- var fileLabelClass = "font-medium";
36
-
37
- // src/components/upload/Upload.tsx
38
- var _tmpl$ = /* @__PURE__ */ template(`<span>`);
39
- var _tmpl$2 = /* @__PURE__ */ template(`<div><label class="cursor-pointer relative w-full h-full"><input type=file><div><span>`);
40
- var Upload = (props) => {
41
- const [local, variantProps, otherProps] = splitProps(props, ["icon", "label", "multiple", "disabled", "accept", "dragDrop", "name", "onChange"], ["style", "color", "size"]);
42
- const handleChange = (e) => {
43
- const files = e.target.files;
44
- if (!files || files.length === 0) return;
45
- const result = local.multiple ? Array.from(files) : files[0];
46
- if (result) {
47
- local.onChange?.(result);
48
- }
49
- };
50
- return (() => {
51
- var _el$ = _tmpl$2(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$6 = _el$4.firstChild;
52
- _el$3.addEventListener("change", handleChange);
53
- className(_el$3, fileInputClass);
54
- spread(_el$3, mergeProps({
55
- get name() {
56
- return local.name;
57
- },
58
- get multiple() {
59
- return local.multiple;
60
- },
61
- get accept() {
62
- return local.accept;
63
- },
64
- get disabled() {
65
- return local.disabled;
66
- }
67
- }, otherProps), false, false);
68
- insert(_el$4, createComponent(Show, {
69
- get when() {
70
- return local.icon;
71
- },
72
- get children() {
73
- var _el$5 = _tmpl$();
74
- className(_el$5, fileIconClass);
75
- insert(_el$5, () => local.icon);
76
- return _el$5;
77
- }
78
- }), _el$6);
79
- className(_el$6, fileLabelClass);
80
- insert(_el$6, () => local.label);
81
- effect((_p$) => {
82
- var _v$ = uploadWrapperVariants(variantProps), _v$2 = classes(variantProps.style === "boxed" ? "flex flex-col items-center justify-center gap-2" : "flex flex-row items-center justify-center gap-2");
83
- _v$ !== _p$.e && className(_el$, _p$.e = _v$);
84
- _v$2 !== _p$.t && className(_el$4, _p$.t = _v$2);
85
- return _p$;
86
- }, {
87
- e: void 0,
88
- t: void 0
89
- });
90
- return _el$;
91
- })();
92
- };
93
- var Upload_default = Upload;
94
-
95
- // src/components/upload/index.ts
96
- var upload_default = Upload_default;
97
-
98
- export { upload_default as default };
1
+ export { upload_default as default } from '../../chunk/S3ZDSQSV.js';