@meddleware/token-deployer-ui 0.0.1 → 0.0.3
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/.github/workflows/publish.yml +367 -0
- package/Dockerfile +96 -0
- package/package.json +5 -3
- package/scripts/sync-template-src.sh +1 -1
- package/src/App.vue +1 -2
- package/src/component-styles.css +257 -0
- package/src/components/ConfigForm.vue +42 -41
- package/src/components/GithubPush.vue +4 -4
- package/src/components/IconPicker.vue +8 -9
- package/src/components/LicensePicker.vue +7 -9
- package/src/components/ResultPanel.vue +2 -2
- package/src/components/ReviewPanel.vue +3 -3
- package/src/components/TokenDeployerView.vue +2 -2
- package/src/components/WalletBar.vue +6 -7
- package/src/components/WalrusBlobBrowser.vue +2 -2
- package/src/components/WalrusIconUpload.vue +4 -4
- package/src/index.ts +1 -0
- package/src/main.ts +5 -1
- package/src/styles.css +3 -335
- package/tests/templateParity.test.ts +1 -1
- package/.env.production +0 -7
- package/src/components/AppNotice.vue +0 -15
- package/src/components/ColorModeControl.vue +0 -81
- package/src/components/FieldHint.vue +0 -79
- package/src/components/FormField.vue +0 -28
- package/src/components/FormSelect.vue +0 -43
- package/src/composables/useColorMode.ts +0 -76
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineOptions({ inheritAttrs: false })
|
|
3
|
-
const model = defineModel<string>()
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<template>
|
|
7
|
-
<div class="select-wrapper">
|
|
8
|
-
<select v-bind="$attrs" v-model="model"><slot /></select>
|
|
9
|
-
<svg
|
|
10
|
-
class="select-chevron"
|
|
11
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
-
width="12"
|
|
13
|
-
height="8"
|
|
14
|
-
viewBox="0 0 12 8"
|
|
15
|
-
aria-hidden="true"
|
|
16
|
-
>
|
|
17
|
-
<path d="M1 1l5 5 5-5" />
|
|
18
|
-
</svg>
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<style scoped>
|
|
23
|
-
.select-wrapper {
|
|
24
|
-
position: relative;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.select-wrapper select {
|
|
28
|
-
appearance: none;
|
|
29
|
-
padding-right: 2.5rem;
|
|
30
|
-
width: 100%;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.select-chevron {
|
|
34
|
-
position: absolute;
|
|
35
|
-
right: 0.75rem;
|
|
36
|
-
top: 50%;
|
|
37
|
-
transform: translateY(-50%);
|
|
38
|
-
pointer-events: none;
|
|
39
|
-
stroke: var(--muted);
|
|
40
|
-
stroke-width: 1.5;
|
|
41
|
-
fill: none;
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { ref, watch, type Ref } from 'vue'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Colour-mode state manager (light | dark | system). Sets `data-theme` on
|
|
5
|
-
* <html>, persists the choice, and follows the OS in `system` mode.
|
|
6
|
-
*
|
|
7
|
-
* Vendored mirror of `@meddleware/ui`'s `useColorMode` for visual/UX parity with
|
|
8
|
-
* the dashboard — this repo is self-contained (no cross-repo links).
|
|
9
|
-
* TODO(unify): consume `@meddleware/ui` once it is published.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
export type ColorMode = 'light' | 'dark' | 'system'
|
|
13
|
-
|
|
14
|
-
const STORAGE_KEY = 'sui-deployer:color-mode'
|
|
15
|
-
|
|
16
|
-
const mode: Ref<ColorMode> = ref<ColorMode>('system')
|
|
17
|
-
let initialized = false
|
|
18
|
-
|
|
19
|
-
function systemPrefersDark(): boolean {
|
|
20
|
-
return (
|
|
21
|
-
typeof window !== 'undefined' &&
|
|
22
|
-
typeof window.matchMedia === 'function' &&
|
|
23
|
-
window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function resolveDark(m: ColorMode): boolean {
|
|
28
|
-
return m === 'dark' || (m === 'system' && systemPrefersDark())
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function apply(m: ColorMode): void {
|
|
32
|
-
if (typeof document === 'undefined') return
|
|
33
|
-
document.documentElement.setAttribute('data-theme', resolveDark(m) ? 'dark' : 'light')
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function useColorMode(defaultMode: ColorMode = 'system') {
|
|
37
|
-
if (!initialized) {
|
|
38
|
-
initialized = true
|
|
39
|
-
let stored: ColorMode | null = null
|
|
40
|
-
try {
|
|
41
|
-
stored =
|
|
42
|
-
typeof localStorage !== 'undefined'
|
|
43
|
-
? (localStorage.getItem(STORAGE_KEY) as ColorMode | null)
|
|
44
|
-
: null
|
|
45
|
-
} catch {
|
|
46
|
-
/* no storage — ignore */
|
|
47
|
-
}
|
|
48
|
-
mode.value = stored ?? defaultMode
|
|
49
|
-
apply(mode.value)
|
|
50
|
-
|
|
51
|
-
if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
|
|
52
|
-
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
|
53
|
-
if (mode.value === 'system') apply('system')
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
watch(mode, (m) => {
|
|
58
|
-
apply(m)
|
|
59
|
-
try {
|
|
60
|
-
if (typeof localStorage !== 'undefined') localStorage.setItem(STORAGE_KEY, m)
|
|
61
|
-
} catch {
|
|
62
|
-
/* ignore */
|
|
63
|
-
}
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function set(m: ColorMode): void {
|
|
68
|
-
mode.value = m
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function cycle(): void {
|
|
72
|
-
set(mode.value === 'light' ? 'dark' : mode.value === 'dark' ? 'system' : 'light')
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return { mode, set, cycle, isDark: () => resolveDark(mode.value) }
|
|
76
|
-
}
|