@pathscale/ui 0.0.5 → 0.0.7
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/dist/{Checkbox-BjaweaOH.d.ts → Checkbox-CzeDsQLA.d.ts} +3 -11
- package/dist/{Input-BQbTzjIO.d.ts → Input-X4gwIB-F.d.ts} +9 -1
- package/dist/{Switch-3IXS_68H.d.ts → Switch-B6dN2G97.d.ts} +13 -9
- package/dist/chunk/{4TWLQ3IA.js → 5KABSQPM.js} +10 -2
- package/dist/chunk/{GLEAR2TS.jsx → 5R7S7TXL.jsx} +36 -17
- package/dist/chunk/{P2L6LFLS.js → 6B7HOWQD.js} +40 -19
- package/dist/chunk/DGI3XY32.jsx +157 -0
- package/dist/chunk/F33TSIEQ.jsx +181 -0
- package/dist/chunk/FNXIOJJY.js +156 -0
- package/dist/chunk/OMRJVDZV.js +173 -0
- package/dist/chunk/VLJEQN2A.js +130 -0
- package/dist/chunk/{DNTGSCVF.jsx → YM2NLFQE.jsx} +1 -1
- package/dist/chunk/Z5DP7GYE.jsx +155 -0
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.jsx +1 -1
- package/dist/components/input/index.d.ts +7 -5
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/index.jsx +3 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/index.jsx +1 -1
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.jsx +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.jsx +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -12
- package/dist/index.jsx +15 -15
- package/package.json +1 -1
- package/dist/chunk/3IHANYRN.js +0 -98
- package/dist/chunk/6SBH3KSM.jsx +0 -96
- package/dist/chunk/FPUQ25SO.js +0 -137
- package/dist/chunk/MXG3MBEN.jsx +0 -148
- package/dist/chunk/N7BXP7EI.jsx +0 -102
- package/dist/chunk/T2DPPLBQ.js +0 -100
- /package/dist/components/{Progress → progress}/index.d.ts +0 -0
- /package/dist/components/{Progress → progress}/index.js +0 -0
- /package/dist/components/{Progress → progress}/index.jsx +0 -0
package/dist/chunk/FPUQ25SO.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { cva, classes } from './HKS7ET6T.js';
|
|
2
|
-
import { template, spread, mergeProps, insert, createComponent, effect, className, setAttribute, use } from 'solid-js/web';
|
|
3
|
-
import { splitProps, createMemo, createEffect, Show, untrack } from 'solid-js';
|
|
4
|
-
|
|
5
|
-
// src/components/checkbox/Checkbox.styles.ts
|
|
6
|
-
var checkboxVariants = cva(
|
|
7
|
-
[
|
|
8
|
-
"relative inline-flex items-center gap-2 cursor-pointer",
|
|
9
|
-
"select-none",
|
|
10
|
-
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
11
|
-
],
|
|
12
|
-
{
|
|
13
|
-
variants: {
|
|
14
|
-
size: {
|
|
15
|
-
sm: "text-sm",
|
|
16
|
-
md: "text-base",
|
|
17
|
-
lg: "text-lg"
|
|
18
|
-
},
|
|
19
|
-
color: {
|
|
20
|
-
primary: "text-primary",
|
|
21
|
-
success: "text-green-600",
|
|
22
|
-
warning: "text-yellow-600",
|
|
23
|
-
danger: "text-red-600"
|
|
24
|
-
},
|
|
25
|
-
checked: {
|
|
26
|
-
true: "",
|
|
27
|
-
false: ""
|
|
28
|
-
},
|
|
29
|
-
indeterminate: {
|
|
30
|
-
true: "",
|
|
31
|
-
false: ""
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
defaultVariants: {
|
|
35
|
-
size: "md",
|
|
36
|
-
color: "primary",
|
|
37
|
-
checked: false,
|
|
38
|
-
indeterminate: false
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
// src/components/checkbox/Checkbox.tsx
|
|
44
|
-
var _tmpl$ = /* @__PURE__ */ template(`<span class="absolute top-1/2 left-1/2 w-2 h-0.5 bg-white -translate-x-1/2 -translate-y-1/2"aria-hidden=true>`);
|
|
45
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<span class=ml-2>`);
|
|
46
|
-
var _tmpl$3 = /* @__PURE__ */ template(`<label role=checkbox><input type=checkbox class="peer absolute opacity-0 w-4 h-4"aria-hidden=true><span>`);
|
|
47
|
-
var Checkbox = (props) => {
|
|
48
|
-
const [localProps, variantProps, otherProps] = splitProps(props, ["label", "indeterminate", "type", "onChange", "onFocus", "onBlur", "checked", "disabled", "aria-label", "aria-describedby"], ["class", ...checkboxVariants.variantKeys]);
|
|
49
|
-
let inputRef;
|
|
50
|
-
const checkboxClasses = createMemo(() => checkboxVariants(variantProps));
|
|
51
|
-
const markerClasses = createMemo(() => classes("inline-block w-4 h-4 border border-gray-400 rounded-sm peer-checked:bg-current", localProps.indeterminate ? "bg-gray-400 relative" : ""));
|
|
52
|
-
const handleChange = (e) => {
|
|
53
|
-
untrack(() => {
|
|
54
|
-
if (typeof localProps.onChange === "function") {
|
|
55
|
-
localProps.onChange(e);
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
const handleFocus = (e) => {
|
|
60
|
-
untrack(() => {
|
|
61
|
-
if (typeof localProps.onFocus === "function") {
|
|
62
|
-
localProps.onFocus(e);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
const handleBlur = (e) => {
|
|
67
|
-
untrack(() => {
|
|
68
|
-
if (typeof localProps.onBlur === "function") {
|
|
69
|
-
localProps.onBlur(e);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
createEffect(() => {
|
|
74
|
-
if (inputRef) {
|
|
75
|
-
untrack(() => {
|
|
76
|
-
inputRef.indeterminate = !!localProps.indeterminate;
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
return (() => {
|
|
81
|
-
var _el$ = _tmpl$3(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
82
|
-
var _ref$ = inputRef;
|
|
83
|
-
typeof _ref$ === "function" ? use(_ref$, _el$2) : inputRef = _el$2;
|
|
84
|
-
spread(_el$2, mergeProps({
|
|
85
|
-
get checked() {
|
|
86
|
-
return localProps.checked;
|
|
87
|
-
},
|
|
88
|
-
get disabled() {
|
|
89
|
-
return localProps.disabled;
|
|
90
|
-
}
|
|
91
|
-
}, otherProps, {
|
|
92
|
-
"onChange": handleChange,
|
|
93
|
-
"onFocus": handleFocus,
|
|
94
|
-
"onBlur": handleBlur
|
|
95
|
-
}), false, false);
|
|
96
|
-
insert(_el$3, createComponent(Show, {
|
|
97
|
-
get when() {
|
|
98
|
-
return localProps.indeterminate;
|
|
99
|
-
},
|
|
100
|
-
get children() {
|
|
101
|
-
return _tmpl$();
|
|
102
|
-
}
|
|
103
|
-
}));
|
|
104
|
-
insert(_el$, createComponent(Show, {
|
|
105
|
-
get when() {
|
|
106
|
-
return localProps.label;
|
|
107
|
-
},
|
|
108
|
-
get children() {
|
|
109
|
-
var _el$5 = _tmpl$2();
|
|
110
|
-
insert(_el$5, () => localProps.label);
|
|
111
|
-
return _el$5;
|
|
112
|
-
}
|
|
113
|
-
}), null);
|
|
114
|
-
effect((_p$) => {
|
|
115
|
-
var _v$ = checkboxClasses(), _v$2 = localProps.indeterminate ? "mixed" : localProps.checked, _v$3 = localProps["aria-label"], _v$4 = localProps["aria-describedby"], _v$5 = markerClasses();
|
|
116
|
-
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
117
|
-
_v$2 !== _p$.t && setAttribute(_el$, "aria-checked", _p$.t = _v$2);
|
|
118
|
-
_v$3 !== _p$.a && setAttribute(_el$, "aria-label", _p$.a = _v$3);
|
|
119
|
-
_v$4 !== _p$.o && setAttribute(_el$, "aria-describedby", _p$.o = _v$4);
|
|
120
|
-
_v$5 !== _p$.i && className(_el$3, _p$.i = _v$5);
|
|
121
|
-
return _p$;
|
|
122
|
-
}, {
|
|
123
|
-
e: void 0,
|
|
124
|
-
t: void 0,
|
|
125
|
-
a: void 0,
|
|
126
|
-
o: void 0,
|
|
127
|
-
i: void 0
|
|
128
|
-
});
|
|
129
|
-
return _el$;
|
|
130
|
-
})();
|
|
131
|
-
};
|
|
132
|
-
var Checkbox_default = Checkbox;
|
|
133
|
-
|
|
134
|
-
// src/components/checkbox/index.ts
|
|
135
|
-
var checkbox_default = Checkbox_default;
|
|
136
|
-
|
|
137
|
-
export { checkbox_default };
|
package/dist/chunk/MXG3MBEN.jsx
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
classes,
|
|
3
|
-
cva
|
|
4
|
-
} from "./P7WPLZNA.jsx";
|
|
5
|
-
|
|
6
|
-
// src/components/checkbox/Checkbox.tsx
|
|
7
|
-
import {
|
|
8
|
-
splitProps,
|
|
9
|
-
Show,
|
|
10
|
-
createEffect,
|
|
11
|
-
createMemo,
|
|
12
|
-
untrack
|
|
13
|
-
} from "solid-js";
|
|
14
|
-
|
|
15
|
-
// src/components/checkbox/Checkbox.styles.ts
|
|
16
|
-
var checkboxVariants = cva(
|
|
17
|
-
[
|
|
18
|
-
"relative inline-flex items-center gap-2 cursor-pointer",
|
|
19
|
-
"select-none",
|
|
20
|
-
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
21
|
-
],
|
|
22
|
-
{
|
|
23
|
-
variants: {
|
|
24
|
-
size: {
|
|
25
|
-
sm: "text-sm",
|
|
26
|
-
md: "text-base",
|
|
27
|
-
lg: "text-lg"
|
|
28
|
-
},
|
|
29
|
-
color: {
|
|
30
|
-
primary: "text-primary",
|
|
31
|
-
success: "text-green-600",
|
|
32
|
-
warning: "text-yellow-600",
|
|
33
|
-
danger: "text-red-600"
|
|
34
|
-
},
|
|
35
|
-
checked: {
|
|
36
|
-
true: "",
|
|
37
|
-
false: ""
|
|
38
|
-
},
|
|
39
|
-
indeterminate: {
|
|
40
|
-
true: "",
|
|
41
|
-
false: ""
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
defaultVariants: {
|
|
45
|
-
size: "md",
|
|
46
|
-
color: "primary",
|
|
47
|
-
checked: false,
|
|
48
|
-
indeterminate: false
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
// src/components/checkbox/Checkbox.tsx
|
|
54
|
-
var Checkbox = (props) => {
|
|
55
|
-
const [localProps, variantProps, otherProps] = splitProps(
|
|
56
|
-
props,
|
|
57
|
-
[
|
|
58
|
-
"label",
|
|
59
|
-
"indeterminate",
|
|
60
|
-
"type",
|
|
61
|
-
"onChange",
|
|
62
|
-
"onFocus",
|
|
63
|
-
"onBlur",
|
|
64
|
-
"checked",
|
|
65
|
-
"disabled",
|
|
66
|
-
"aria-label",
|
|
67
|
-
"aria-describedby"
|
|
68
|
-
],
|
|
69
|
-
["class", ...checkboxVariants.variantKeys]
|
|
70
|
-
);
|
|
71
|
-
let inputRef;
|
|
72
|
-
const checkboxClasses = createMemo(() => checkboxVariants(variantProps));
|
|
73
|
-
const markerClasses = createMemo(
|
|
74
|
-
() => classes(
|
|
75
|
-
"inline-block w-4 h-4 border border-gray-400 rounded-sm peer-checked:bg-current",
|
|
76
|
-
localProps.indeterminate ? "bg-gray-400 relative" : ""
|
|
77
|
-
)
|
|
78
|
-
);
|
|
79
|
-
const handleChange = (e) => {
|
|
80
|
-
untrack(() => {
|
|
81
|
-
if (typeof localProps.onChange === "function") {
|
|
82
|
-
localProps.onChange(e);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
const handleFocus = (e) => {
|
|
87
|
-
untrack(() => {
|
|
88
|
-
if (typeof localProps.onFocus === "function") {
|
|
89
|
-
localProps.onFocus(e);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
const handleBlur = (e) => {
|
|
94
|
-
untrack(() => {
|
|
95
|
-
if (typeof localProps.onBlur === "function") {
|
|
96
|
-
localProps.onBlur(e);
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
createEffect(() => {
|
|
101
|
-
if (inputRef) {
|
|
102
|
-
untrack(() => {
|
|
103
|
-
inputRef.indeterminate = !!localProps.indeterminate;
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
return <label
|
|
108
|
-
class={checkboxClasses()}
|
|
109
|
-
role="checkbox"
|
|
110
|
-
aria-checked={localProps.indeterminate ? "mixed" : localProps.checked}
|
|
111
|
-
aria-label={localProps["aria-label"]}
|
|
112
|
-
aria-describedby={localProps["aria-describedby"]}
|
|
113
|
-
>
|
|
114
|
-
<input
|
|
115
|
-
ref={inputRef}
|
|
116
|
-
type="checkbox"
|
|
117
|
-
class="peer absolute opacity-0 w-4 h-4"
|
|
118
|
-
checked={localProps.checked}
|
|
119
|
-
disabled={localProps.disabled}
|
|
120
|
-
aria-hidden="true"
|
|
121
|
-
{...otherProps}
|
|
122
|
-
onChange={handleChange}
|
|
123
|
-
onFocus={handleFocus}
|
|
124
|
-
onBlur={handleBlur}
|
|
125
|
-
/>
|
|
126
|
-
|
|
127
|
-
<span class={markerClasses()}>
|
|
128
|
-
<Show when={localProps.indeterminate}>
|
|
129
|
-
<span
|
|
130
|
-
class="absolute top-1/2 left-1/2 w-2 h-0.5 bg-white -translate-x-1/2 -translate-y-1/2"
|
|
131
|
-
aria-hidden="true"
|
|
132
|
-
/>
|
|
133
|
-
</Show>
|
|
134
|
-
</span>
|
|
135
|
-
|
|
136
|
-
<Show when={localProps.label}>
|
|
137
|
-
<span class="ml-2">{localProps.label}</span>
|
|
138
|
-
</Show>
|
|
139
|
-
</label>;
|
|
140
|
-
};
|
|
141
|
-
var Checkbox_default = Checkbox;
|
|
142
|
-
|
|
143
|
-
// src/components/checkbox/index.ts
|
|
144
|
-
var checkbox_default = Checkbox_default;
|
|
145
|
-
|
|
146
|
-
export {
|
|
147
|
-
checkbox_default
|
|
148
|
-
};
|
package/dist/chunk/N7BXP7EI.jsx
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cva
|
|
3
|
-
} from "./P7WPLZNA.jsx";
|
|
4
|
-
|
|
5
|
-
// src/components/input/Input.tsx
|
|
6
|
-
import {
|
|
7
|
-
createMemo,
|
|
8
|
-
createSignal,
|
|
9
|
-
mergeProps,
|
|
10
|
-
Show,
|
|
11
|
-
splitProps,
|
|
12
|
-
untrack
|
|
13
|
-
} from "solid-js";
|
|
14
|
-
|
|
15
|
-
// src/components/input/Input.styles.ts
|
|
16
|
-
var inputVariants = cva(
|
|
17
|
-
[
|
|
18
|
-
"block w-full appearance-none outline-none bg-transparent",
|
|
19
|
-
"border transition-colors duration-200",
|
|
20
|
-
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
21
|
-
],
|
|
22
|
-
{
|
|
23
|
-
variants: {
|
|
24
|
-
color: {
|
|
25
|
-
danger: "border-red-500 text-red-600",
|
|
26
|
-
success: "border-green-500 text-green-600",
|
|
27
|
-
warning: "border-orange-500 text-orange-600"
|
|
28
|
-
},
|
|
29
|
-
rounded: {
|
|
30
|
-
true: "rounded-full",
|
|
31
|
-
false: "rounded-md"
|
|
32
|
-
},
|
|
33
|
-
expanded: {
|
|
34
|
-
true: "w-full",
|
|
35
|
-
false: "w-fit"
|
|
36
|
-
},
|
|
37
|
-
loading: {
|
|
38
|
-
true: "opacity-50",
|
|
39
|
-
false: ""
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
defaultVariants: {
|
|
43
|
-
color: void 0,
|
|
44
|
-
rounded: false,
|
|
45
|
-
expanded: true,
|
|
46
|
-
loading: false
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
// src/components/input/Input.tsx
|
|
52
|
-
var Input = (props) => {
|
|
53
|
-
const defaultedProps = mergeProps({ type: "text" }, props);
|
|
54
|
-
const [localProps, variantProps, otherProps] = splitProps(
|
|
55
|
-
defaultedProps,
|
|
56
|
-
["type", "passwordReveal", "leftIcon", "rightIcon"],
|
|
57
|
-
["class", ...inputVariants.variantKeys]
|
|
58
|
-
);
|
|
59
|
-
const [showPassword, setShowPassword] = createSignal(false);
|
|
60
|
-
const computedType = createMemo(
|
|
61
|
-
() => untrack(
|
|
62
|
-
() => localProps.passwordReveal && showPassword() ? "text" : defaultedProps.type
|
|
63
|
-
)
|
|
64
|
-
);
|
|
65
|
-
const classes = createMemo(() => inputVariants(variantProps));
|
|
66
|
-
const handlePasswordToggle = () => {
|
|
67
|
-
untrack(() => setShowPassword((prev) => !prev));
|
|
68
|
-
};
|
|
69
|
-
return <div class="relative flex items-center">
|
|
70
|
-
<Show when={localProps.leftIcon}>
|
|
71
|
-
<span class="absolute left-3 top-1/2 -translate-y-1/2">
|
|
72
|
-
{localProps.leftIcon}
|
|
73
|
-
</span>
|
|
74
|
-
</Show>
|
|
75
|
-
|
|
76
|
-
<input
|
|
77
|
-
class={classes()}
|
|
78
|
-
type={computedType()}
|
|
79
|
-
aria-invalid={variantProps.color === "danger" ? "true" : void 0}
|
|
80
|
-
{...otherProps}
|
|
81
|
-
/>
|
|
82
|
-
|
|
83
|
-
<Show when={localProps.passwordReveal && localProps.rightIcon}>
|
|
84
|
-
<button
|
|
85
|
-
type="button"
|
|
86
|
-
onClick={handlePasswordToggle}
|
|
87
|
-
class="absolute right-3 top-1/2 -translate-y-1/2 outline-none"
|
|
88
|
-
aria-label={showPassword() ? "Hide password" : "Show password"}
|
|
89
|
-
>
|
|
90
|
-
{localProps.rightIcon}
|
|
91
|
-
</button>
|
|
92
|
-
</Show>
|
|
93
|
-
</div>;
|
|
94
|
-
};
|
|
95
|
-
var Input_default = Input;
|
|
96
|
-
|
|
97
|
-
// src/components/input/index.ts
|
|
98
|
-
var input_default = Input_default;
|
|
99
|
-
|
|
100
|
-
export {
|
|
101
|
-
input_default
|
|
102
|
-
};
|
package/dist/chunk/T2DPPLBQ.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { cva } from './HKS7ET6T.js';
|
|
2
|
-
import { delegateEvents, template, insert, createComponent, spread, mergeProps as mergeProps$1, effect, setAttribute } from 'solid-js/web';
|
|
3
|
-
import { mergeProps, splitProps, createSignal, createMemo, untrack, Show } from 'solid-js';
|
|
4
|
-
|
|
5
|
-
// src/components/input/Input.styles.ts
|
|
6
|
-
var inputVariants = cva(
|
|
7
|
-
[
|
|
8
|
-
"block w-full appearance-none outline-none bg-transparent",
|
|
9
|
-
"border transition-colors duration-200",
|
|
10
|
-
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
11
|
-
],
|
|
12
|
-
{
|
|
13
|
-
variants: {
|
|
14
|
-
color: {
|
|
15
|
-
danger: "border-red-500 text-red-600",
|
|
16
|
-
success: "border-green-500 text-green-600",
|
|
17
|
-
warning: "border-orange-500 text-orange-600"
|
|
18
|
-
},
|
|
19
|
-
rounded: {
|
|
20
|
-
true: "rounded-full",
|
|
21
|
-
false: "rounded-md"
|
|
22
|
-
},
|
|
23
|
-
expanded: {
|
|
24
|
-
true: "w-full",
|
|
25
|
-
false: "w-fit"
|
|
26
|
-
},
|
|
27
|
-
loading: {
|
|
28
|
-
true: "opacity-50",
|
|
29
|
-
false: ""
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
defaultVariants: {
|
|
33
|
-
color: void 0,
|
|
34
|
-
rounded: false,
|
|
35
|
-
expanded: true,
|
|
36
|
-
loading: false
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
// src/components/input/Input.tsx
|
|
42
|
-
var _tmpl$ = /* @__PURE__ */ template(`<span class="absolute left-3 top-1/2 -translate-y-1/2">`);
|
|
43
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<button type=button class="absolute right-3 top-1/2 -translate-y-1/2 outline-none">`);
|
|
44
|
-
var _tmpl$3 = /* @__PURE__ */ template(`<div class="relative flex items-center"><input>`);
|
|
45
|
-
var Input = (props) => {
|
|
46
|
-
const defaultedProps = mergeProps({
|
|
47
|
-
type: "text"
|
|
48
|
-
}, props);
|
|
49
|
-
const [localProps, variantProps, otherProps] = splitProps(defaultedProps, ["type", "passwordReveal", "leftIcon", "rightIcon"], ["class", ...inputVariants.variantKeys]);
|
|
50
|
-
const [showPassword, setShowPassword] = createSignal(false);
|
|
51
|
-
const computedType = createMemo(() => untrack(() => localProps.passwordReveal && showPassword() ? "text" : defaultedProps.type));
|
|
52
|
-
const classes = createMemo(() => inputVariants(variantProps));
|
|
53
|
-
const handlePasswordToggle = () => {
|
|
54
|
-
untrack(() => setShowPassword((prev) => !prev));
|
|
55
|
-
};
|
|
56
|
-
return (() => {
|
|
57
|
-
var _el$ = _tmpl$3(), _el$3 = _el$.firstChild;
|
|
58
|
-
insert(_el$, createComponent(Show, {
|
|
59
|
-
get when() {
|
|
60
|
-
return localProps.leftIcon;
|
|
61
|
-
},
|
|
62
|
-
get children() {
|
|
63
|
-
var _el$2 = _tmpl$();
|
|
64
|
-
insert(_el$2, () => localProps.leftIcon);
|
|
65
|
-
return _el$2;
|
|
66
|
-
}
|
|
67
|
-
}), _el$3);
|
|
68
|
-
spread(_el$3, mergeProps$1({
|
|
69
|
-
get ["class"]() {
|
|
70
|
-
return classes();
|
|
71
|
-
},
|
|
72
|
-
get type() {
|
|
73
|
-
return computedType();
|
|
74
|
-
},
|
|
75
|
-
get ["aria-invalid"]() {
|
|
76
|
-
return variantProps.color === "danger" ? "true" : void 0;
|
|
77
|
-
}
|
|
78
|
-
}, otherProps), false, false);
|
|
79
|
-
insert(_el$, createComponent(Show, {
|
|
80
|
-
get when() {
|
|
81
|
-
return localProps.passwordReveal && localProps.rightIcon;
|
|
82
|
-
},
|
|
83
|
-
get children() {
|
|
84
|
-
var _el$4 = _tmpl$2();
|
|
85
|
-
_el$4.$$click = handlePasswordToggle;
|
|
86
|
-
insert(_el$4, () => localProps.rightIcon);
|
|
87
|
-
effect(() => setAttribute(_el$4, "aria-label", showPassword() ? "Hide password" : "Show password"));
|
|
88
|
-
return _el$4;
|
|
89
|
-
}
|
|
90
|
-
}), null);
|
|
91
|
-
return _el$;
|
|
92
|
-
})();
|
|
93
|
-
};
|
|
94
|
-
var Input_default = Input;
|
|
95
|
-
delegateEvents(["click"]);
|
|
96
|
-
|
|
97
|
-
// src/components/input/index.ts
|
|
98
|
-
var input_default = Input_default;
|
|
99
|
-
|
|
100
|
-
export { input_default };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|