@pathscale/ui 2.9.1 → 2.9.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Component as __LayoutComponent } from "solid-js";
|
|
2
2
|
import "./Button.css";
|
|
3
|
-
import {
|
|
3
|
+
import type { JSX } from "@solidjs/web";
|
|
4
4
|
import type { Flavor, IconSlotProps, Radius, Size, State, UIBaseProps, Variant, Width } from "../vocabulary";
|
|
5
5
|
export type ButtonProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "type"> & UIBaseProps & IconSlotProps & {
|
|
6
6
|
variant?: Variant;
|
|
@@ -1,86 +1,110 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { claimElement, createComponent, insert, memo, mergeProps, spread, template } from "@solidjs/web";
|
|
2
2
|
import { defineComponent } from "solid-layouts/solid-2/application-boundary";
|
|
3
3
|
import "./Button.css";
|
|
4
4
|
import { Show } from "solid-js";
|
|
5
5
|
import { button as external_Button_recipe_js_button } from "./Button.recipe.js";
|
|
6
6
|
import { buttonElement, buttonHref, buttonRel } from "./Button.interactions.js";
|
|
7
|
-
var _tmpl$ = /*#__PURE__*/ template("<span>");
|
|
7
|
+
var _tmpl$ = /*#__PURE__*/ template("<span>"), _tmpl$2 = /*#__PURE__*/ template("<a>"), _tmpl$3 = /*#__PURE__*/ template("<button>");
|
|
8
8
|
const __solidLayoutButtonLayout = (_stable, p)=>{
|
|
9
9
|
const loading = ()=>"loading" === p.state;
|
|
10
10
|
const inert = ()=>loading() || "disabled" === p.state || Boolean(p.disabled);
|
|
11
11
|
const element = ()=>buttonElement(p.href);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
12
|
+
const content = ()=>[
|
|
13
|
+
createComponent(Show, {
|
|
14
|
+
get when () {
|
|
15
|
+
return loading();
|
|
16
|
+
},
|
|
17
|
+
get children () {
|
|
18
|
+
var _el$ = _tmpl$();
|
|
19
|
+
spread(_el$, mergeProps(()=>_stable.slot.spinner, {
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
}), false);
|
|
22
|
+
return _el$;
|
|
23
|
+
}
|
|
24
|
+
}),
|
|
25
|
+
createComponent(Show, {
|
|
26
|
+
get when () {
|
|
27
|
+
return p.startIcon;
|
|
28
|
+
},
|
|
29
|
+
get children () {
|
|
30
|
+
var _el$2 = _tmpl$();
|
|
31
|
+
spread(_el$2, mergeProps(()=>_stable.slot.startIcon), true);
|
|
32
|
+
insert(_el$2, ()=>p.startIcon);
|
|
33
|
+
return _el$2;
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
36
|
+
memo(()=>_stable.children),
|
|
37
|
+
createComponent(Show, {
|
|
38
|
+
get when () {
|
|
39
|
+
return p.endIcon;
|
|
40
|
+
},
|
|
41
|
+
get children () {
|
|
42
|
+
var _el$3 = _tmpl$();
|
|
43
|
+
spread(_el$3, mergeProps(()=>_stable.slot.endIcon), true);
|
|
44
|
+
insert(_el$3, ()=>p.endIcon);
|
|
45
|
+
return _el$3;
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
];
|
|
49
|
+
return createComponent(Show, {
|
|
50
|
+
get when () {
|
|
51
|
+
return "a" === element();
|
|
40
52
|
},
|
|
41
|
-
get
|
|
42
|
-
|
|
53
|
+
get fallback () {
|
|
54
|
+
var _el$5 = _tmpl$3();
|
|
55
|
+
spread(_el$5, mergeProps(()=>_stable.slot.root, {
|
|
56
|
+
get type () {
|
|
57
|
+
return p.type ?? "button";
|
|
58
|
+
},
|
|
59
|
+
get disabled () {
|
|
60
|
+
return inert();
|
|
61
|
+
},
|
|
62
|
+
get ["aria-disabled"] () {
|
|
63
|
+
return inert() ? "true" : "false";
|
|
64
|
+
},
|
|
65
|
+
get ["aria-busy"] () {
|
|
66
|
+
return loading() ? "true" : void 0;
|
|
67
|
+
},
|
|
68
|
+
get ["data-state"] () {
|
|
69
|
+
return p.state ?? "default";
|
|
70
|
+
},
|
|
71
|
+
get ["data-flavor"] () {
|
|
72
|
+
return p.flavor ?? "primary";
|
|
73
|
+
}
|
|
74
|
+
}), true);
|
|
75
|
+
insert(_el$5, content);
|
|
76
|
+
return _el$5;
|
|
43
77
|
},
|
|
44
78
|
get children () {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return p.endIcon;
|
|
73
|
-
},
|
|
74
|
-
get children () {
|
|
75
|
-
var _el$3 = _tmpl$();
|
|
76
|
-
spread(_el$3, mergeProps(()=>_stable.slot.endIcon), true);
|
|
77
|
-
insert(_el$3, ()=>p.endIcon);
|
|
78
|
-
return _el$3;
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
];
|
|
79
|
+
var _el$4 = _tmpl$2();
|
|
80
|
+
claimElement(_el$4);
|
|
81
|
+
spread(_el$4, mergeProps(()=>_stable.slot.root, {
|
|
82
|
+
get href () {
|
|
83
|
+
return buttonHref(p.href, inert());
|
|
84
|
+
},
|
|
85
|
+
get target () {
|
|
86
|
+
return p.target;
|
|
87
|
+
},
|
|
88
|
+
get rel () {
|
|
89
|
+
return buttonRel(p.rel, p.target);
|
|
90
|
+
},
|
|
91
|
+
get ["aria-disabled"] () {
|
|
92
|
+
return inert() ? "true" : "false";
|
|
93
|
+
},
|
|
94
|
+
get ["aria-busy"] () {
|
|
95
|
+
return loading() ? "true" : void 0;
|
|
96
|
+
},
|
|
97
|
+
get ["data-state"] () {
|
|
98
|
+
return p.state ?? "default";
|
|
99
|
+
},
|
|
100
|
+
get ["data-flavor"] () {
|
|
101
|
+
return p.flavor ?? "primary";
|
|
102
|
+
}
|
|
103
|
+
}), true);
|
|
104
|
+
insert(_el$4, content);
|
|
105
|
+
return _el$4;
|
|
82
106
|
}
|
|
83
|
-
})
|
|
107
|
+
});
|
|
84
108
|
};
|
|
85
109
|
const ButtonLayout = defineComponent({
|
|
86
110
|
recipe: external_Button_recipe_js_button,
|