commit b40650c35917a241bad42e89971cffbad17ccd1c
parent 00e8dd2e20a5a71689140e482b38153925854d94
Author: triesap <137732411+triesap@users.noreply.github.com>
Date: Fri, 6 Dec 2024 05:42:36 +0000
apps-lib: edit component styles, add/edit locales, types, utils
Diffstat:
9 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/apps-lib/src/lib/components/button_layout.svelte b/apps-lib/src/lib/components/button_layout.svelte
@@ -19,10 +19,14 @@
};
$: layer = parse_layer(basis.layer, 1);
+
+ $: classes_active = !basis.hide_active
+ ? `layer-1-active-surface layer-1-active-raise-less layer-1-active-ring-less`
+ : ``;
</script>
<button
- class={`${fmt_cl(basis.classes)} group flex flex-row h-touch_guide w-${$app_layout} justify-center items-center bg-layer-${layer}-surface round-44 ${!basis.hide_active ? `active:bg-layer-${layer}-surface_a` : ``} ${basis.disabled ? `opacity-60` : ``} el-re`}
+ class={`${fmt_cl(basis.classes)} group flex flex-row h-touch_guide w-${$app_layout} justify-center items-center bg-layer-${layer}-surface rounded-touch ${basis.disabled ? `opacity-60` : classes_active} el-re`}
on:click|stopPropagation={async () => {
if (!basis.disabled) await basis.callback();
}}
diff --git a/apps-lib/src/lib/components/nav.svelte b/apps-lib/src/lib/components/nav.svelte
@@ -23,7 +23,7 @@
let nav_prev_label = ``;
- $: classes_nav_blur = $nav_blur ? `bg-white/40 backdrop-blur-lg` : ``;
+ $: classes_nav_blur = $nav_blur ? `bg-white/40 backdrop-blur-sm` : ``;
onMount(async () => {
try {
@@ -74,10 +74,10 @@
>
<div
bind:this={el_inner}
- class={`relative flex flex-col h-full w-full justify-end items-center bg-transparent`}
+ class={`relative flex flex-col h-full w-full justify-end items-center`}
>
<div
- class={`absolute bottom-[5px] left-0 grid grid-cols-12 flex flex-row h-8 w-full justify-start items-center`}
+ class={`absolute bottom-[6px] left-0 grid grid-cols-12 flex flex-row h-8 w-full justify-start items-center`}
>
<div
class={`col-span-4 flex flex-row w-full justify-start items-center`}
diff --git a/apps-lib/src/lib/components/nav_option.svelte b/apps-lib/src/lib/components/nav_option.svelte
@@ -13,7 +13,7 @@
export let basis: INavBasisOption;
$: basis = basis;
$: layer = parse_layer(1);
- $: classes_disabled = basis.disabled ? `opacity-60` : ``;
+ $: classes_disabled = basis.disabled ? `opacity-40` : ``;
</script>
{#if basis?.loading}
diff --git a/apps-lib/src/lib/locales/en/common.json b/apps-lib/src/lib/locales/en/common.json
@@ -16,6 +16,8 @@
"bag": "Bag",
"bags": "Bags",
"bank_account": "Bank account",
+ "banner_photo": "Banner photo",
+ "bio": "Bio",
"business_name": "Business name",
"cancel": "Cancel",
"close": "Close",
@@ -46,6 +48,7 @@
"file_size": "File size",
"filters": "Filters",
"from": "From",
+ "general": "General",
"hex": "Hex",
"highest_price": "Highest price",
"home": "Home",
@@ -72,6 +75,7 @@
"messages": "Messages",
"month": "Month",
"month_to_date": "Month to date",
+ "name": "Name",
"new": "New",
"no": "No",
"no_items_to_display": "No items to display",
@@ -104,6 +108,7 @@
"products": "Products",
"profile": "Profile",
"profile_name": "Profile name",
+ "profile_photo": "Profile photo",
"profiles": "Profiles",
"public_key": "Public key",
"publish": "Publish",
@@ -131,7 +136,8 @@
"unlock": "Unlock",
"update": "Update",
"upload_url": "Upload url",
- "url": "URL",
+ "url": "url",
+ "username": "Username",
"value": "Value",
"view": "View",
"wallet": "Wallet",
diff --git a/apps-lib/src/lib/locales/en/models.json b/apps-lib/src/lib/locales/en/models.json
@@ -191,6 +191,9 @@
},
"trade_product": {
"fields": {
+ "category": {
+ "label": "Product Category"
+ },
"key": {
"label": "Product Kind"
},
@@ -241,6 +244,7 @@
}
},
"schema": {
+ "category.required": "The product category is required",
"key.required": "The product kind is required",
"lot.max": "The product lot must be less than 120 characters",
"lot.min": "The product lot must be more than 1 character",
diff --git a/apps-lib/src/lib/types/el.ts b/apps-lib/src/lib/types/el.ts
@@ -56,6 +56,7 @@ export type GlyphKey = |
`handbag-simple` |
`devices` |
`lock-key` |
+ `gear` |
`gear-fine` |
`bell-simple` |
`envelope` |
diff --git a/apps-lib/src/lib/utils/client.ts b/apps-lib/src/lib/utils/client.ts
@@ -1,8 +1,9 @@
import { goto } from "$app/navigation";
import { app_toast, locale, nav_prev, t, TOAST_MS, type AnchorRoute, type AppConfigType, type AppLayoutKey, type CallbackPromise, type CallbackPromiseGeneric, type GeolocationLatitudeFmtOption, type GlyphKey, type IToast, type LabelFieldKind, type LayerGlyphBasisKind, type NavigationParamTuple, type NavigationRoute, type NavigationRouteParamKey } from "$lib";
import type { ColorMode, ThemeKey, ThemeLayer } from "@radroots/theme";
-import { get as get_store } from "svelte/store";
+import { get } from "svelte/store";
+export const get_store = get;
export const sleep = async (ms: number): Promise<void> => {
await new Promise((resolve) => setTimeout(resolve, ms));
@@ -78,7 +79,7 @@ export function time_now_ms(): number {
export const fmt_id = (id?: string): string => {
const pref = location.pathname.slice(1, -1).replaceAll(`-`, `_`).replaceAll(`/`, `-`).replaceAll(`--`, `-`);
- return `${pref}${id ? `-${id}` : ``}`
+ return `*${pref}${id ? `-${id}` : ``}`
};
export const fmt_capitalize = (val: string): string => {
diff --git a/apps-lib/src/lib/utils/routes.ts b/apps-lib/src/lib/utils/routes.ts
@@ -10,8 +10,8 @@ export type NavigationRoute =
| "/models/trade-product/add"
| "/models/trade-product/view"
| "/settings"
- | "/settings/account"
| "/settings/nostr"
+ | "/settings/profile"
| "/test"
| "/cfg/error"
| "/cfg/init";
@@ -29,8 +29,8 @@ export function parse_route(route: string): NavigationRoute {
case "/models/trade-product/add":
case "/models/trade-product/view":
case "/settings":
- case "/settings/account":
case "/settings/nostr":
+ case "/settings/profile":
case "/test":
case "/cfg/error":
case "/cfg/init":
diff --git a/apps-lib/src/lib/utils/styles.ts b/apps-lib/src/lib/utils/styles.ts
@@ -11,7 +11,7 @@ export const glyph_style_map: Map<GeometryGlyphDimension, { gl_1: number; dim_1?
["md-", { gl_1: 23 }],
["md", { gl_1: 24 }],
["md+", { gl_1: 26 }],
- ["lg-", { gl_1: 28 }],
+ ["lg-", { gl_1: 27 }],
["lg", { gl_1: 28 }],
["xl", { gl_1: 30 }],
["xl+", { gl_1: 40 }],