commit eabc24120a77ac5de37b49c0b9f98bae899c6f41
parent 04e54a1408ddd41ec5c678af335ee3d333166c2b
Author: triesap <137732411+triesap@users.noreply.github.com>
Date: Wed, 18 Sep 2024 16:28:46 +0000
apps-lib: edit components, locales, types, utils
Diffstat:
8 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/apps-lib/src/lib/components/layout_window.svelte b/apps-lib/src/lib/components/layout_window.svelte
@@ -4,4 +4,5 @@
<div class={`flex flex-col h-full w-full`}>
<slot />
</div>
+ <slot name="overlay" />
</div>
diff --git a/apps-lib/src/lib/components/nav.svelte b/apps-lib/src/lib/components/nav.svelte
@@ -47,7 +47,7 @@
class={`absolute bottom-[5px] left-0 grid grid-cols-12 flex flex-row h-8 w-full justify-start items-center`}
>
<button
- class={`col-span-4 flex flex-row h-full pl-2 justify-start items-center`}
+ class={`group col-span-4 flex flex-row h-full pl-2 justify-start items-center`}
on:click={async () => {
if (basis.prev.callback) await basis.prev.callback();
await goto(basis.prev.route);
@@ -104,7 +104,7 @@
</div>
{:else}
<button
- class={`col-span-4 flex flex-row h-full pr-6 gap-2 justify-end items-center`}
+ class={`group col-span-4 flex flex-row h-full pr-6 gap-2 justify-end items-center`}
on:click={async () => {
await basis.option?.callback();
}}
@@ -112,6 +112,7 @@
{#if `glyph` in basis.option && basis.option.glyph}
<Glyph
basis={{
+ classes: `group-active:opacity-70 ${basis.option.glyph.classes}`,
...basis.option.glyph,
}}
/>
diff --git a/apps-lib/src/lib/components/tabs.svelte b/apps-lib/src/lib/components/tabs.svelte
@@ -54,14 +54,15 @@
: `text-layer-2-glyph text-lineMd`,
key: tab.icon,
dim: `md`,
- weight:
- typeof tab_focus === `number` &&
- tab_focus === tab_i
- ? `fill`
- : !basis.hide_active &&
- $app_tab_active === tab_i
- ? tab.active_weight || `fill`
- : `bold`,
+ weight: tab.force_weight
+ ? tab.force_weight
+ : typeof tab_focus === `number` &&
+ tab_focus === tab_i
+ ? `fill`
+ : !basis.hide_active &&
+ $app_tab_active === tab_i
+ ? tab.active_weight || `fill`
+ : `bold`,
}}
/>
</button>
diff --git a/apps-lib/src/lib/index.ts b/apps-lib/src/lib/index.ts
@@ -32,7 +32,6 @@ export { default as Divider } from "./ui/divider.svelte"
export { default as Fill } from "./ui/fill.svelte"
export { default as Glyph } from "./ui/glyph.svelte"
export { default as Loading } from "./ui/loading.svelte"
-export { default as Loading2 } from "./ui/loading2.svelte"
export * from "./utils/client"
export * from "./utils/dom"
export * from "./utils/geo"
diff --git a/apps-lib/src/lib/locales/en/common.json b/apps-lib/src/lib/locales/en/common.json
@@ -1,4 +1,9 @@
{
+ "delete": "Delete",
+ "messages": "Messages",
+ "message": "Message",
+ "back": "Back",
+ "subject": "Subject",
"from": "From",
"to": "To",
"inbox": "Inbox",
diff --git a/apps-lib/src/lib/types/components.ts b/apps-lib/src/lib/types/components.ts
@@ -5,6 +5,7 @@ export type ITabsBasisList = {
icon: GlyphKey;
classes?: string;
active_weight?: GlyphWeight;
+ force_weight?: GlyphWeight
indicator?: string;
hide_active?: boolean;
callback: CallbackPromiseGeneric<number>;
diff --git a/apps-lib/src/lib/types/ui.ts b/apps-lib/src/lib/types/ui.ts
@@ -4,6 +4,7 @@ import type { GeometryCardinalDirection, GeometryGlyphDimension, ICbOpt } from "
export type GlyphKeyCurrency = `dollar` | `eur`;
export type GlyphKey = |
+ `paper-plane-tilt` |
`note-pencil` |
`share-fat` |
`folder` |
diff --git a/apps-lib/src/lib/utils/time.ts b/apps-lib/src/lib/utils/time.ts
@@ -2,7 +2,8 @@ import { DateTime, type DateTimeFormatOptions } from "luxon";
const time_fmt: Record<string, DateTimeFormatOptions> = {
default: DateTime.DATE_SHORT,
- abbrev: DateTime.DATE_MED
+ abbrev: DateTime.DATE_MED,
+ time_24: DateTime.TIME_24_SIMPLE
};
export function time_fmt_epoch_s(locale: string, epoch_s: number | undefined, fmt_key: keyof typeof time_fmt = `default`): string {