fullstacked 0.12.0-1200 → 0.12.0-1203
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/fullstacked_modules/@fullstacked/ui/README.md +3 -0
- package/fullstacked_modules/@fullstacked/ui/components/button-group/button-group.scss +28 -0
- package/fullstacked_modules/@fullstacked/ui/components/button-group/index.ts +8 -0
- package/fullstacked_modules/@fullstacked/ui/components/dialog/dialog.scss +39 -0
- package/fullstacked_modules/@fullstacked/ui/components/dialog/index.ts +17 -0
- package/fullstacked_modules/@fullstacked/ui/components/list-item/index.ts +37 -0
- package/fullstacked_modules/@fullstacked/ui/components/list-item/list-item.scss +19 -0
- package/fullstacked_modules/@fullstacked/ui/components/loader/index.ts +14 -0
- package/fullstacked_modules/@fullstacked/ui/components/loader/loader.scss +25 -0
- package/fullstacked_modules/@fullstacked/ui/components/message/index.ts +26 -0
- package/fullstacked_modules/@fullstacked/ui/components/message/message.scss +20 -0
- package/fullstacked_modules/@fullstacked/ui/components/popover/index.ts +110 -0
- package/fullstacked_modules/@fullstacked/ui/components/popover/popover.scss +44 -0
- package/fullstacked_modules/@fullstacked/ui/globals.scss +66 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Archive.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Arrow 2.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Arrow Corner.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Arrow.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Caret.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Check.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Clipboard.svg +12 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Clock.svg +12 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Close.svg +10 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Copy.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Directory Add.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Edit.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Export.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/External Link.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/File Add.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/File.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Git Branch.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Git.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Glitter.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Info.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Link.svg +10 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Loader.svg +4 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Lock.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Options.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Package.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Peers.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Play.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Plus.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Revert.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Settings.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Side Panel.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Terminal.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Trash.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/TypeScript.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Upload.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/User.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/icons/Warning.svg +3 -0
- package/fullstacked_modules/@fullstacked/ui/inputs/checkbox/index.ts +28 -0
- package/fullstacked_modules/@fullstacked/ui/inputs/file/index.ts +48 -0
- package/fullstacked_modules/@fullstacked/ui/inputs/inputs.scss +204 -0
- package/fullstacked_modules/@fullstacked/ui/inputs/observer.ts +36 -0
- package/fullstacked_modules/@fullstacked/ui/inputs/predictive/index.ts +195 -0
- package/fullstacked_modules/@fullstacked/ui/inputs/radio/index.ts +28 -0
- package/fullstacked_modules/@fullstacked/ui/inputs/select/index.ts +125 -0
- package/fullstacked_modules/@fullstacked/ui/inputs/switch/index.ts +37 -0
- package/fullstacked_modules/@fullstacked/ui/inputs/text/index.ts +23 -0
- package/fullstacked_modules/@fullstacked/ui/package.json +8 -0
- package/fullstacked_modules/@fullstacked/ui/primitives/badge/badge.scss +35 -0
- package/fullstacked_modules/@fullstacked/ui/primitives/badge/index.ts +23 -0
- package/fullstacked_modules/@fullstacked/ui/primitives/button/button.scss +97 -0
- package/fullstacked_modules/@fullstacked/ui/primitives/button/index.ts +41 -0
- package/fullstacked_modules/@fullstacked/ui/primitives/icon/icon.scss +13 -0
- package/fullstacked_modules/@fullstacked/ui/primitives/icon/index.ts +30 -0
- package/fullstacked_modules/@fullstacked/ui/ui.scss +15 -0
- package/fullstacked_modules/@fullstacked/ui/ui.ts +18 -0
- package/fullstacked_modules/@fullstacked/ui/values/breakpoints.scss +7 -0
- package/fullstacked_modules/@fullstacked/ui/values/colors.scss +26 -0
- package/fullstacked_modules/@fullstacked/ui/values/spacing.scss +10 -0
- package/fullstacked_modules/@fullstacked/ui/values/typography.scss +23 -0
- package/fullstacked_modules/esbuild/sass.ts +0 -3
- package/fullstacked_modules/fs/fs.ts +17 -4
- package/fullstacked_modules/sass/index.js +125921 -0
- package/index.js +0 -2
- package/package.json +1 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { startObserverInterval } from "../observer";
|
|
2
|
+
import { Icon } from "../../ui";
|
|
3
|
+
|
|
4
|
+
export type InputSelectOpts = {
|
|
5
|
+
label: string;
|
|
6
|
+
placeholder: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type InputSelectOption = {
|
|
10
|
+
name: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function InputSelect(opts: Partial<InputSelectOpts>) {
|
|
17
|
+
startObserverInterval();
|
|
18
|
+
|
|
19
|
+
const container = document.createElement("div");
|
|
20
|
+
container.classList.add("input-select");
|
|
21
|
+
|
|
22
|
+
if (opts.label) {
|
|
23
|
+
container.innerHTML = `<label>${opts.label}</label>`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const selectAndIconContainer = document.createElement("div");
|
|
27
|
+
selectAndIconContainer.classList.add("select-container");
|
|
28
|
+
const select = document.createElement("select");
|
|
29
|
+
const icon = document.createElement("div");
|
|
30
|
+
icon.append(Icon("Arrow"));
|
|
31
|
+
selectAndIconContainer.append(select, icon);
|
|
32
|
+
container.append(selectAndIconContainer);
|
|
33
|
+
|
|
34
|
+
const placeholderOption = document.createElement("option");
|
|
35
|
+
placeholderOption.selected = true;
|
|
36
|
+
placeholderOption.innerText = opts.placeholder || "Choose an option";
|
|
37
|
+
select.append(placeholderOption);
|
|
38
|
+
|
|
39
|
+
select.classList.add("invalid");
|
|
40
|
+
|
|
41
|
+
const selectOptions: InputSelectOption[] = [];
|
|
42
|
+
|
|
43
|
+
const addOptions = (option: InputSelectOption) => {
|
|
44
|
+
selectOptions.push(option);
|
|
45
|
+
const el = document.createElement("option");
|
|
46
|
+
el.innerText = option.name;
|
|
47
|
+
el.disabled = option.disabled;
|
|
48
|
+
if (!el.disabled) {
|
|
49
|
+
el.value = selectOptions.length.toString();
|
|
50
|
+
}
|
|
51
|
+
el.selected = option.selected;
|
|
52
|
+
select.append(el);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const disablePlaceholder = () => {
|
|
56
|
+
placeholderOption.disabled = true;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
select.onfocus = disablePlaceholder;
|
|
60
|
+
select.ontouchstart = disablePlaceholder;
|
|
61
|
+
select.onclick = disablePlaceholder;
|
|
62
|
+
select.onblur = () => {
|
|
63
|
+
placeholderOption.disabled = false;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const indexOfIdOrName = (idOrName: string) => {
|
|
67
|
+
return selectOptions.findIndex((item) => {
|
|
68
|
+
if (item.id) {
|
|
69
|
+
return item.id === idOrName;
|
|
70
|
+
}
|
|
71
|
+
return item.name === idOrName;
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
let selectAPI = {
|
|
76
|
+
get value() {
|
|
77
|
+
const index = select.selectedIndex - 1;
|
|
78
|
+
if (index === -1) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
const item = selectOptions.at(index);
|
|
82
|
+
return item.id || item.name;
|
|
83
|
+
},
|
|
84
|
+
set value(v: string) {
|
|
85
|
+
const indexOf = indexOfIdOrName(v);
|
|
86
|
+
if (indexOf === -1) return;
|
|
87
|
+
select.selectedIndex = indexOf + 1;
|
|
88
|
+
},
|
|
89
|
+
onchange: (item?: string, index?: number): any => {
|
|
90
|
+
return { item, index };
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
select.onchange = () => {
|
|
95
|
+
const index = select.selectedIndex - 1;
|
|
96
|
+
const item = selectOptions.at(index);
|
|
97
|
+
const value = item.id || item.name;
|
|
98
|
+
selectAPI.value = value;
|
|
99
|
+
selectAPI.onchange(value, index);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
container,
|
|
104
|
+
select: selectAPI,
|
|
105
|
+
options: {
|
|
106
|
+
get() {
|
|
107
|
+
return selectOptions;
|
|
108
|
+
},
|
|
109
|
+
add(...options: InputSelectOption[]) {
|
|
110
|
+
options.forEach(addOptions);
|
|
111
|
+
},
|
|
112
|
+
remove(nameOrId: string) {
|
|
113
|
+
const indexOf = indexOfIdOrName(nameOrId);
|
|
114
|
+
if (indexOf === -1) return;
|
|
115
|
+
|
|
116
|
+
const selectedIndex = select.selectedIndex - 1;
|
|
117
|
+
if (indexOf === selectedIndex) {
|
|
118
|
+
select.selectedIndex = 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
selectOptions.splice(indexOf, 1);
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { startObserverInterval } from "../observer";
|
|
2
|
+
import { InputOpts } from "../text";
|
|
3
|
+
|
|
4
|
+
export function InputSwitch(opts?: Partial<InputOpts>) {
|
|
5
|
+
startObserverInterval();
|
|
6
|
+
|
|
7
|
+
const container = document.createElement("div");
|
|
8
|
+
container.classList.add("input-switch");
|
|
9
|
+
|
|
10
|
+
if (opts?.label) {
|
|
11
|
+
container.innerHTML = `<label>${opts.label}</label>`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const input = document.createElement("input");
|
|
15
|
+
input.type = "checkbox";
|
|
16
|
+
|
|
17
|
+
input.addEventListener("change", () => {
|
|
18
|
+
if (input.checked) container.classList.add("checked");
|
|
19
|
+
else container.classList.remove("checked");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
container.append(input);
|
|
23
|
+
|
|
24
|
+
const overrideUI = document.createElement("div");
|
|
25
|
+
|
|
26
|
+
const switchEl = document.createElement("div");
|
|
27
|
+
switchEl.onclick = () => input.click();
|
|
28
|
+
|
|
29
|
+
switchEl.innerHTML = `<div></div>`;
|
|
30
|
+
overrideUI.append(switchEl);
|
|
31
|
+
container.append(overrideUI);
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
input,
|
|
35
|
+
container
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type InputOpts = {
|
|
2
|
+
label: string;
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
export function InputText(opts?: Partial<InputOpts>) {
|
|
6
|
+
const container = document.createElement("div");
|
|
7
|
+
container.classList.add("input-text");
|
|
8
|
+
|
|
9
|
+
if (opts?.label) {
|
|
10
|
+
container.innerHTML = `<label>${opts.label}</label>`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const input = document.createElement("input");
|
|
14
|
+
input.autocapitalize = "off";
|
|
15
|
+
|
|
16
|
+
container.append(input);
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
container,
|
|
20
|
+
input
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This file must follow the figma design
|
|
3
|
+
https://www.figma.com/design/xb3JBRCvEWpbwGda03T5QQ/Mockups?node-id=101-1212
|
|
4
|
+
*/
|
|
5
|
+
@use "../../values/colors.scss";
|
|
6
|
+
@use "../../values/spacing.scss";
|
|
7
|
+
@use "../../values/typography.scss";
|
|
8
|
+
|
|
9
|
+
.badge {
|
|
10
|
+
color: colors.$light;
|
|
11
|
+
background-color: colors.opacity(colors.$gray, 50);
|
|
12
|
+
border-radius: spacing.$x-small;
|
|
13
|
+
padding: spacing.$x-small spacing.$small;
|
|
14
|
+
font-family: typography.$fonts;
|
|
15
|
+
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
|
|
20
|
+
&.success {
|
|
21
|
+
background-color: colors.opacity(colors.$green, 50);
|
|
22
|
+
}
|
|
23
|
+
&.warning {
|
|
24
|
+
background-color: colors.opacity(colors.$yellow, 50);
|
|
25
|
+
}
|
|
26
|
+
&.error {
|
|
27
|
+
background-color: colors.opacity(colors.$red, 50);
|
|
28
|
+
}
|
|
29
|
+
&.info {
|
|
30
|
+
background-color: colors.opacity(colors.$blue-accent, 50);
|
|
31
|
+
}
|
|
32
|
+
&.info-2 {
|
|
33
|
+
background-color: colors.opacity(colors.$blue, 50);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This file must follow the figma design
|
|
3
|
+
https://www.figma.com/design/xb3JBRCvEWpbwGda03T5QQ/Mockups?node-id=101-1212
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
type BadgeOpts = {
|
|
7
|
+
text: string;
|
|
8
|
+
type: "success" | "warning" | "error" | "info" | "info-2";
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function Badge(opts?: Partial<BadgeOpts>) {
|
|
12
|
+
const container = document.createElement("label");
|
|
13
|
+
container.classList.add("badge");
|
|
14
|
+
|
|
15
|
+
if (opts?.type) {
|
|
16
|
+
container.classList.add(opts.type);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
container.innerText = opts?.text || "";
|
|
20
|
+
|
|
21
|
+
return container;
|
|
22
|
+
}
|
|
23
|
+
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This file must follow the figma design
|
|
3
|
+
https://www.figma.com/design/xb3JBRCvEWpbwGda03T5QQ/Mockups?node-id=6-67
|
|
4
|
+
*/
|
|
5
|
+
@use "sass:color";
|
|
6
|
+
@use "../../values/typography.scss";
|
|
7
|
+
@use "../../values/colors.scss";
|
|
8
|
+
@use "../../values/spacing.scss";
|
|
9
|
+
|
|
10
|
+
button {
|
|
11
|
+
font-weight: bold;
|
|
12
|
+
font-size: typography.$medium;
|
|
13
|
+
font-family: typography.$fonts;
|
|
14
|
+
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
gap: spacing.$x-small;
|
|
19
|
+
|
|
20
|
+
padding: 7px spacing.$small;
|
|
21
|
+
border-radius: spacing.$x-small;
|
|
22
|
+
background-color: colors.$blue;
|
|
23
|
+
color: colors.$light;
|
|
24
|
+
border: 0;
|
|
25
|
+
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
|
|
28
|
+
.icon {
|
|
29
|
+
height: 20px;
|
|
30
|
+
width: 20px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:active {
|
|
34
|
+
background-color: color.scale(colors.$blue, $lightness: -30%);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.red {
|
|
38
|
+
background-color: colors.$red;
|
|
39
|
+
|
|
40
|
+
&:active {
|
|
41
|
+
background-color: color.scale(colors.$red, $lightness: -30%);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:disabled {
|
|
46
|
+
background-color: colors.$gray;
|
|
47
|
+
color: colors.opacity(colors.$light, 70);
|
|
48
|
+
cursor: default;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&.text,
|
|
52
|
+
&.icon-small,
|
|
53
|
+
&.icon-large {
|
|
54
|
+
background-color: transparent;
|
|
55
|
+
color: colors.$blue;
|
|
56
|
+
|
|
57
|
+
&:active {
|
|
58
|
+
background-color: colors.$gray-dark;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:disabled {
|
|
62
|
+
color: colors.$gray;
|
|
63
|
+
background-color: transparent;
|
|
64
|
+
}
|
|
65
|
+
&.red {
|
|
66
|
+
color: colors.$red;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&.icon-small,
|
|
71
|
+
&.icon-large {
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
padding: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.icon-small {
|
|
79
|
+
height: 24px;
|
|
80
|
+
width: 24px;
|
|
81
|
+
|
|
82
|
+
.icon {
|
|
83
|
+
height: 20px;
|
|
84
|
+
width: 20px;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&.icon-large {
|
|
89
|
+
height: 38px;
|
|
90
|
+
width: 38px;
|
|
91
|
+
|
|
92
|
+
.icon {
|
|
93
|
+
height: 30px;
|
|
94
|
+
width: 30px;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This file must follow the figma design
|
|
3
|
+
https://www.figma.com/design/xb3JBRCvEWpbwGda03T5QQ/Mockups?node-id=6-67
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { Icon } from "../icon";
|
|
7
|
+
|
|
8
|
+
type ButtonOpts = {
|
|
9
|
+
iconLeft: string;
|
|
10
|
+
iconRight: string;
|
|
11
|
+
text: string;
|
|
12
|
+
style: "default" | "text" | "icon-small" | "icon-large";
|
|
13
|
+
color: "red";
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function Button(opts?: Partial<ButtonOpts>) {
|
|
17
|
+
const button = document.createElement("button");
|
|
18
|
+
|
|
19
|
+
if (!opts?.style?.startsWith("icon")) {
|
|
20
|
+
button.innerText = opts?.text || "";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (opts?.style && opts?.style !== "default") {
|
|
24
|
+
button.classList.add(opts.style);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (opts?.color) {
|
|
28
|
+
button.classList.add(opts.color);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (opts?.iconLeft) {
|
|
32
|
+
button.prepend(Icon(opts.iconLeft));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (opts?.iconRight) {
|
|
36
|
+
button.append(Icon(opts.iconRight));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return button;
|
|
40
|
+
}
|
|
41
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
let iconsDirectory: string = "/node_modules/@fullstacked/ui/icons";
|
|
2
|
+
|
|
3
|
+
export function setIconsDirectory(directory: string) {
|
|
4
|
+
iconsDirectory = directory;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function Icon(name: string) {
|
|
8
|
+
const container = document.createElement("div");
|
|
9
|
+
container.classList.add("icon");
|
|
10
|
+
loadIcon(name).then((svgData) => (container.innerHTML = svgData));
|
|
11
|
+
return container;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const iconCache = new Map<string, Promise<string>>();
|
|
15
|
+
function loadIcon(name: string) {
|
|
16
|
+
let icon = iconCache.get(name);
|
|
17
|
+
|
|
18
|
+
if (!icon) {
|
|
19
|
+
icon = fetchIcon(name);
|
|
20
|
+
iconCache.set(name, icon);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return icon;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function fetchIcon(name: string) {
|
|
27
|
+
const response = await fetch(`${iconsDirectory}/${name}.svg`);
|
|
28
|
+
return response.text();
|
|
29
|
+
}
|
|
30
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@use "./globals.scss";
|
|
2
|
+
|
|
3
|
+
@use "./primitives/icon/icon.scss";
|
|
4
|
+
@use "./primitives/button/button.scss";
|
|
5
|
+
@use "./primitives/badge/badge.scss";
|
|
6
|
+
|
|
7
|
+
@use "./inputs/inputs.scss";
|
|
8
|
+
|
|
9
|
+
@use "./components/button-group/button-group.scss";
|
|
10
|
+
@use "./components/dialog/dialog.scss";
|
|
11
|
+
@use "./components/loader/loader.scss";
|
|
12
|
+
@use "./components/message/message.scss";
|
|
13
|
+
@use "./components/popover/popover.scss";
|
|
14
|
+
@use "./components/list-item/list-item.scss";
|
|
15
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { Icon, setIconsDirectory } from "./primitives/icon";
|
|
2
|
+
export { Button } from "./primitives/button";
|
|
3
|
+
export { Badge } from "./primitives/badge";
|
|
4
|
+
|
|
5
|
+
export { InputText } from "./inputs/text";
|
|
6
|
+
export { InputFile } from "./inputs/file";
|
|
7
|
+
export { InputSwitch } from "./inputs/switch";
|
|
8
|
+
export { InputCheckbox } from "./inputs/checkbox";
|
|
9
|
+
export { InputRadio } from "./inputs/radio";
|
|
10
|
+
export { InputPredictive } from "./inputs/predictive";
|
|
11
|
+
export { InputSelect } from "./inputs/select";
|
|
12
|
+
|
|
13
|
+
export { ButtonGroup } from "./components/button-group";
|
|
14
|
+
export { Dialog } from "./components/dialog";
|
|
15
|
+
export { Loader } from "./components/loader";
|
|
16
|
+
export { Message } from "./components/message";
|
|
17
|
+
export { Popover } from "./components/popover";
|
|
18
|
+
export { ListItem } from "./components/list-item";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This file must follow the figma local color styles
|
|
3
|
+
https://www.figma.com/design/xb3JBRCvEWpbwGda03T5QQ/Mockups
|
|
4
|
+
*/
|
|
5
|
+
@use "sass:color";
|
|
6
|
+
|
|
7
|
+
$blue-accent: #04b8ec;
|
|
8
|
+
$blue: #007aff;
|
|
9
|
+
$blue-dark: #1e293b;
|
|
10
|
+
$dark: #15171b;
|
|
11
|
+
$red: #ff453a;
|
|
12
|
+
$green: #30d158;
|
|
13
|
+
$yellow: #ffcc00;
|
|
14
|
+
$light: #ffffff;
|
|
15
|
+
$gray: #8c929b;
|
|
16
|
+
$gray-dark: #404958;
|
|
17
|
+
$overlay: #15171b99;
|
|
18
|
+
|
|
19
|
+
@function opacity($color, $opacity) {
|
|
20
|
+
@return rgba(
|
|
21
|
+
color.channel($color, "red", $space: rgb),
|
|
22
|
+
color.channel($color, "green", $space: rgb),
|
|
23
|
+
color.channel($color, "blue", $space: rgb),
|
|
24
|
+
calc($opacity / 100)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This file must follow the figma local text styles
|
|
3
|
+
https://www.figma.com/design/xb3JBRCvEWpbwGda03T5QQ/Mockups
|
|
4
|
+
*/
|
|
5
|
+
$heading-1: 36px;
|
|
6
|
+
$heading-2: 30px;
|
|
7
|
+
$heading-3: 24px;
|
|
8
|
+
$medium: 16px;
|
|
9
|
+
$small: 12px;
|
|
10
|
+
$x-small: 9px;
|
|
11
|
+
|
|
12
|
+
$fonts:
|
|
13
|
+
system-ui,
|
|
14
|
+
-apple-system,
|
|
15
|
+
BlinkMacSystemFont,
|
|
16
|
+
"Segoe UI",
|
|
17
|
+
Roboto,
|
|
18
|
+
Oxygen,
|
|
19
|
+
Ubuntu,
|
|
20
|
+
Cantarell,
|
|
21
|
+
"Open Sans",
|
|
22
|
+
"Helvetica Neue",
|
|
23
|
+
sans-serif;
|
|
@@ -18,7 +18,6 @@ export async function buildSASS(
|
|
|
18
18
|
? `${baseDirectory}/.build`
|
|
19
19
|
: ".build";
|
|
20
20
|
await fs.mkdir(buildDirectory);
|
|
21
|
-
console.log(buildDirectory + "/index.css", css);
|
|
22
21
|
await fs.writeFile(buildDirectory + "/index.css", css);
|
|
23
22
|
};
|
|
24
23
|
|
|
@@ -27,8 +26,6 @@ export async function buildSASS(
|
|
|
27
26
|
(item) => item === "index.sass" || item === "index.scss"
|
|
28
27
|
);
|
|
29
28
|
|
|
30
|
-
console.log(entryPointSASS);
|
|
31
|
-
|
|
32
29
|
// check for css file and write to output
|
|
33
30
|
// esbuild will pick it up and merge with css in js
|
|
34
31
|
if (!entryPointSASS) {
|
|
@@ -50,19 +50,32 @@ export type FileInfo = {
|
|
|
50
50
|
// 5
|
|
51
51
|
export function readdir(
|
|
52
52
|
path: string,
|
|
53
|
-
options?: {
|
|
53
|
+
options?: {
|
|
54
|
+
recursive?: boolean;
|
|
55
|
+
withFileTypes?: false;
|
|
56
|
+
filesOnly?: boolean;
|
|
57
|
+
}
|
|
54
58
|
): Promise<string[]>;
|
|
55
59
|
export function readdir(
|
|
56
60
|
path: string,
|
|
57
|
-
options?: { recursive?: boolean; withFileTypes: true
|
|
61
|
+
options?: { recursive?: boolean; withFileTypes: true; filesOnly?: boolean }
|
|
58
62
|
): Promise<FileInfo[]>;
|
|
59
63
|
export function readdir(
|
|
60
64
|
path: string,
|
|
61
|
-
options?: {
|
|
65
|
+
options?: {
|
|
66
|
+
recursive?: boolean;
|
|
67
|
+
withFileTypes?: boolean;
|
|
68
|
+
filesOnly?: boolean;
|
|
69
|
+
}
|
|
62
70
|
) {
|
|
63
71
|
const payload = new Uint8Array([
|
|
64
72
|
5,
|
|
65
|
-
...serializeArgs([
|
|
73
|
+
...serializeArgs([
|
|
74
|
+
path,
|
|
75
|
+
!!options?.recursive,
|
|
76
|
+
!!options?.withFileTypes,
|
|
77
|
+
!!options?.filesOnly
|
|
78
|
+
])
|
|
66
79
|
]);
|
|
67
80
|
|
|
68
81
|
const transformer = (items: string[] | (string | boolean)[]) => {
|