@studious-creative/yumekit 0.1.8 → 0.1.10
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/components/y-appbar.js +19 -4
- package/dist/components/y-avatar.js +31 -3
- package/dist/components/y-card.js +9 -0
- package/dist/components/y-dialog.js +16 -0
- package/dist/components/y-progress.d.ts +0 -1
- package/dist/components/y-progress.js +28 -15
- package/dist/components/y-tag.d.ts +1 -1
- package/dist/components/y-tag.js +30 -5
- package/dist/components/y-theme.js +7 -2
- package/dist/components/y-toast.d.ts +0 -1
- package/dist/components/y-toast.js +25 -93
- package/dist/components/y-tooltip.d.ts +0 -1
- package/dist/components/y-tooltip.js +25 -93
- package/dist/icons/all.js +69 -0
- package/dist/index.js +203 -166
- package/dist/modules/helpers.d.ts +9 -0
- package/dist/modules/helpers.js +26 -0
- package/dist/react.d.ts +211 -130
- package/dist/styles/variables.css +3 -0
- package/dist/yumekit.min.js +1 -1
- package/package.json +1 -1
- package/dist/modules/load-defaults.d.ts +0 -1
- package/dist/modules/load-defaults.js +0 -45
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return a [background, foreground] CSS variable pair for a color scheme.
|
|
3
|
+
* Background is `--{color}-content--`, foreground is `--{color}-content-inverse`.
|
|
4
|
+
* @param {string} color — one of base, primary, secondary, success, warning, error, help
|
|
5
|
+
* @param {string} [fallbackColor="base"] — color to fall back to when `color` is unrecognised.
|
|
6
|
+
* Use `null` to pass the raw `color` string through as the background instead.
|
|
7
|
+
* @returns {[string, string]} — [bg var, fg var]
|
|
8
|
+
*/
|
|
9
|
+
export function getColorVarPair(color: string, fallbackColor?: string): [string, string];
|
|
1
10
|
export function hideEmptySlotContainers(shadowRoot: any, slotsConfig?: {}): void;
|
|
2
11
|
/**
|
|
3
12
|
* Resolve a CSS custom-property value to a concrete color string.
|
package/dist/modules/helpers.js
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return a [background, foreground] CSS variable pair for a color scheme.
|
|
3
|
+
* Background is `--{color}-content--`, foreground is `--{color}-content-inverse`.
|
|
4
|
+
* @param {string} color — one of base, primary, secondary, success, warning, error, help
|
|
5
|
+
* @param {string} [fallbackColor="base"] — color to fall back to when `color` is unrecognised.
|
|
6
|
+
* Use `null` to pass the raw `color` string through as the background instead.
|
|
7
|
+
* @returns {[string, string]} — [bg var, fg var]
|
|
8
|
+
*/
|
|
9
|
+
export function getColorVarPair(color, fallbackColor = "base") {
|
|
10
|
+
const map = {
|
|
11
|
+
base: ["var(--base-content--)", "var(--base-content-inverse)"],
|
|
12
|
+
primary: ["var(--primary-content--)", "var(--primary-content-inverse)"],
|
|
13
|
+
secondary: [
|
|
14
|
+
"var(--secondary-content--)",
|
|
15
|
+
"var(--secondary-content-inverse)",
|
|
16
|
+
],
|
|
17
|
+
success: ["var(--success-content--)", "var(--success-content-inverse)"],
|
|
18
|
+
warning: ["var(--warning-content--)", "var(--warning-content-inverse)"],
|
|
19
|
+
error: ["var(--error-content--)", "var(--error-content-inverse)"],
|
|
20
|
+
help: ["var(--help-content--)", "var(--help-content-inverse)"],
|
|
21
|
+
};
|
|
22
|
+
if (map[color]) return map[color];
|
|
23
|
+
if (fallbackColor === null) return [color, "var(--base-content-inverse)"];
|
|
24
|
+
return map[fallbackColor] || map.base;
|
|
25
|
+
}
|
|
26
|
+
|
|
1
27
|
// helpers/slot-utils.js
|
|
2
28
|
export function hideEmptySlotContainers(shadowRoot, slotsConfig = {}) {
|
|
3
29
|
Object.entries(slotsConfig).forEach(([slotName, containerSelector]) => {
|
package/dist/react.d.ts
CHANGED
|
@@ -1,134 +1,215 @@
|
|
|
1
|
-
import type { DetailedHTMLProps, HTMLAttributes } from
|
|
1
|
+
import type { DetailedHTMLProps, HTMLAttributes } from "react";
|
|
2
2
|
|
|
3
|
-
type El<T = object> = DetailedHTMLProps<
|
|
3
|
+
type El<T = object> = DetailedHTMLProps<
|
|
4
|
+
HTMLAttributes<HTMLElement>,
|
|
5
|
+
HTMLElement
|
|
6
|
+
> &
|
|
7
|
+
T;
|
|
4
8
|
|
|
5
|
-
declare module
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
9
|
+
declare module "react" {
|
|
10
|
+
namespace JSX {
|
|
11
|
+
interface IntrinsicElements {
|
|
12
|
+
"y-appbar": El<{
|
|
13
|
+
orientation?: "vertical" | "horizontal";
|
|
14
|
+
collapsed?: boolean | string;
|
|
15
|
+
items?: string;
|
|
16
|
+
size?: "small" | "medium" | "large";
|
|
17
|
+
"menu-direction"?: "right" | "down" | "";
|
|
18
|
+
sticky?: "start" | "end";
|
|
19
|
+
}>;
|
|
20
|
+
"y-avatar": El<{
|
|
21
|
+
src?: string;
|
|
22
|
+
alt?: string;
|
|
23
|
+
size?: "small" | "medium" | "large";
|
|
24
|
+
shape?: string;
|
|
25
|
+
}>;
|
|
26
|
+
"y-badge": El<{
|
|
27
|
+
value?: string;
|
|
28
|
+
position?: "top" | "bottom";
|
|
29
|
+
alignment?: "right" | "left";
|
|
30
|
+
color?: string;
|
|
31
|
+
size?: "small" | "medium" | "large";
|
|
32
|
+
}>;
|
|
33
|
+
"y-button": El<{
|
|
34
|
+
"left-icon"?: string;
|
|
35
|
+
"right-icon"?: string;
|
|
36
|
+
color?: string;
|
|
37
|
+
size?: "small" | "medium" | "large";
|
|
38
|
+
"style-type"?: "outlined" | "filled" | "flat";
|
|
39
|
+
type?: string;
|
|
40
|
+
disabled?: boolean | string;
|
|
41
|
+
name?: string;
|
|
42
|
+
value?: string;
|
|
43
|
+
autofocus?: boolean | string;
|
|
44
|
+
form?: string;
|
|
45
|
+
formaction?: string;
|
|
46
|
+
formenctype?: string;
|
|
47
|
+
formmethod?: string;
|
|
48
|
+
formnovalidate?: boolean | string;
|
|
49
|
+
formtarget?: string;
|
|
50
|
+
"aria-label"?: string;
|
|
51
|
+
"aria-pressed"?: string;
|
|
52
|
+
"aria-hidden"?: string;
|
|
53
|
+
}>;
|
|
54
|
+
"y-card": El<{
|
|
55
|
+
color?: string;
|
|
56
|
+
raised?: boolean | string;
|
|
57
|
+
}>;
|
|
58
|
+
"y-checkbox": El<{
|
|
59
|
+
name?: string;
|
|
60
|
+
value?: string;
|
|
61
|
+
checked?: boolean | string;
|
|
62
|
+
disabled?: boolean | string;
|
|
63
|
+
indeterminate?: boolean | string;
|
|
64
|
+
"label-position"?: "top" | "bottom" | "left" | "right";
|
|
65
|
+
color?: string;
|
|
66
|
+
size?: string;
|
|
67
|
+
}>;
|
|
68
|
+
"y-dialog": El<{
|
|
69
|
+
visible?: boolean | string;
|
|
70
|
+
anchor?: string;
|
|
71
|
+
closable?: boolean | string;
|
|
72
|
+
}>;
|
|
73
|
+
"y-drawer": El<{
|
|
74
|
+
visible?: boolean | string;
|
|
75
|
+
anchor?: string;
|
|
76
|
+
position?: "left" | "right" | "top" | "bottom";
|
|
77
|
+
resizable?: boolean | string;
|
|
78
|
+
}>;
|
|
79
|
+
"y-icon": El<{
|
|
80
|
+
name?: string;
|
|
81
|
+
size?: "small" | "medium" | "large";
|
|
82
|
+
color?: string;
|
|
83
|
+
label?: string;
|
|
84
|
+
weight?: "thin" | "regular" | "thick";
|
|
85
|
+
}>;
|
|
86
|
+
"y-input": El<{
|
|
87
|
+
type?: string;
|
|
88
|
+
name?: string;
|
|
89
|
+
value?: string;
|
|
90
|
+
placeholder?: string;
|
|
91
|
+
disabled?: boolean | string;
|
|
92
|
+
invalid?: boolean | string;
|
|
93
|
+
required?: boolean | string;
|
|
94
|
+
color?: string;
|
|
95
|
+
size?: "small" | "medium" | "large";
|
|
96
|
+
label?: string;
|
|
97
|
+
"label-position"?: string;
|
|
98
|
+
}>;
|
|
99
|
+
"y-menu": El<{
|
|
100
|
+
items?: string;
|
|
101
|
+
anchor?: string;
|
|
102
|
+
visible?: boolean | string;
|
|
103
|
+
direction?: "down" | "up" | "left" | "right";
|
|
104
|
+
size?: "small" | "medium" | "large";
|
|
105
|
+
}>;
|
|
106
|
+
"y-panel": El<{
|
|
107
|
+
selected?: boolean | string;
|
|
108
|
+
expanded?: boolean | string;
|
|
109
|
+
href?: string;
|
|
110
|
+
history?: string;
|
|
111
|
+
}>;
|
|
112
|
+
"y-panelbar": El<{
|
|
113
|
+
exclusive?: boolean | string;
|
|
114
|
+
}>;
|
|
115
|
+
"y-progress": El<{
|
|
116
|
+
value?: string | number;
|
|
117
|
+
min?: string | number;
|
|
118
|
+
max?: string | number;
|
|
119
|
+
step?: string | number;
|
|
120
|
+
color?: string;
|
|
121
|
+
size?: "small" | "medium" | "large";
|
|
122
|
+
"label-display"?: boolean | string;
|
|
123
|
+
"label-format"?: "percent" | "value" | "fraction";
|
|
124
|
+
indeterminate?: boolean | string;
|
|
125
|
+
disabled?: boolean | string;
|
|
126
|
+
}>;
|
|
127
|
+
"y-radio": El<{
|
|
128
|
+
name?: string;
|
|
129
|
+
value?: string;
|
|
130
|
+
options?: string;
|
|
131
|
+
disabled?: boolean | string;
|
|
132
|
+
color?: string;
|
|
133
|
+
size?: string;
|
|
134
|
+
}>;
|
|
135
|
+
"y-select": El<{
|
|
136
|
+
name?: string;
|
|
137
|
+
value?: string;
|
|
138
|
+
disabled?: boolean | string;
|
|
139
|
+
multiple?: boolean | string;
|
|
140
|
+
color?: string;
|
|
141
|
+
size?: string;
|
|
142
|
+
placeholder?: string;
|
|
143
|
+
options?: string;
|
|
144
|
+
invalid?: boolean | string;
|
|
145
|
+
required?: boolean | string;
|
|
146
|
+
"label-position"?: string;
|
|
147
|
+
"display-mode"?: string;
|
|
148
|
+
"close-on-click-outside"?: string;
|
|
149
|
+
}>;
|
|
150
|
+
"y-slider": El<{
|
|
151
|
+
name?: string;
|
|
152
|
+
value?: string | number;
|
|
153
|
+
min?: string | number;
|
|
154
|
+
max?: string | number;
|
|
155
|
+
step?: string | number;
|
|
156
|
+
disabled?: boolean | string;
|
|
157
|
+
color?: string;
|
|
158
|
+
size?: "small" | "medium" | "large";
|
|
159
|
+
orientation?: "horizontal" | "vertical";
|
|
160
|
+
}>;
|
|
161
|
+
"y-switch": El<{
|
|
162
|
+
name?: string;
|
|
163
|
+
value?: string;
|
|
164
|
+
checked?: boolean | string;
|
|
165
|
+
disabled?: boolean | string;
|
|
166
|
+
animate?: string;
|
|
167
|
+
"toggle-label"?: boolean | string;
|
|
168
|
+
"label-display"?: string;
|
|
169
|
+
"label-position"?: "top" | "bottom" | "left" | "right";
|
|
170
|
+
color?: string;
|
|
171
|
+
size?: "small" | "medium" | "large";
|
|
172
|
+
}>;
|
|
173
|
+
"y-table": El<{
|
|
174
|
+
columns?: string;
|
|
175
|
+
data?: string;
|
|
176
|
+
striped?: boolean | string;
|
|
177
|
+
size?: "small" | "medium" | "large";
|
|
178
|
+
}>;
|
|
179
|
+
"y-tabs": El<{
|
|
180
|
+
options?: string;
|
|
181
|
+
size?: "small" | "medium" | "large";
|
|
182
|
+
position?: "top" | "bottom" | "left" | "right";
|
|
183
|
+
}>;
|
|
184
|
+
"y-tag": El<{
|
|
185
|
+
color?: string;
|
|
186
|
+
size?: "small" | "medium" | "large";
|
|
187
|
+
removable?: boolean | string;
|
|
188
|
+
"style-type"?: "filled" | "outlined" | "flat";
|
|
189
|
+
shape?: "square" | "round";
|
|
190
|
+
}>;
|
|
191
|
+
"y-theme": El<{
|
|
192
|
+
theme?: string;
|
|
193
|
+
mode?: "light" | "dark";
|
|
194
|
+
"theme-path"?: string;
|
|
195
|
+
}>;
|
|
196
|
+
"y-toast": El<{
|
|
197
|
+
position?:
|
|
198
|
+
| "top-right"
|
|
199
|
+
| "top-left"
|
|
200
|
+
| "top-center"
|
|
201
|
+
| "bottom-right"
|
|
202
|
+
| "bottom-left"
|
|
203
|
+
| "bottom-center";
|
|
204
|
+
duration?: string | number;
|
|
205
|
+
max?: string | number;
|
|
206
|
+
}>;
|
|
207
|
+
"y-tooltip": El<{
|
|
208
|
+
text?: string;
|
|
209
|
+
position?: "top" | "bottom" | "left" | "right";
|
|
210
|
+
color?: string;
|
|
211
|
+
delay?: string | number;
|
|
212
|
+
}>;
|
|
213
|
+
}
|
|
132
214
|
}
|
|
133
|
-
}
|
|
134
215
|
}
|
|
@@ -433,6 +433,9 @@
|
|
|
433
433
|
--component-tag-padding-large: var(--spacing-small);
|
|
434
434
|
--component-tag-padding-medium: var(--spacing-x-small);
|
|
435
435
|
--component-tag-padding-small: var(--spacing-2x-small);
|
|
436
|
+
--component-tag-height-large: 38px;
|
|
437
|
+
--component-tag-height-medium: 28px;
|
|
438
|
+
--component-tag-height-small: 22px;
|
|
436
439
|
--component-tag-size-large: var(--sizing-large);
|
|
437
440
|
--component-tag-size-medium: var(--sizing-medium);
|
|
438
441
|
--component-tag-size-small: var(--sizing-small);
|