Skip to content

Commit 64c18df

Browse files
committed
feat: inject useTimeAgo & useFormInput composables
1 parent 18d3b3f commit 64c18df

File tree

5 files changed

+32
-12
lines changed

5 files changed

+32
-12
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { useForm } from "@open-xamu-co/ui-common-helpers";
2+
3+
/**
4+
* xamu form composable
5+
*/
6+
export function useFormInput() {
7+
const { xamu } = useAppConfig();
8+
9+
return useForm(xamu);
10+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { timeAgo } from "@open-xamu-co/ui-common-helpers";
2+
3+
/**
4+
* Time ago composable
5+
*/
6+
export function useTimeAgo(date: Date) {
7+
const { xamu } = useAppConfig();
8+
9+
const lang = xamu?.lang || "en";
10+
const country = xamu?.country || "US";
11+
12+
return timeAgo(date, `${lang}-${country}`);
13+
}

packages/styles/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"postcss-precision": "vis97c/postcss-precision",
8686
"postcss-preset-env": "^8.4.1",
8787
"postcss-sort-media-queries": "^5.2.0",
88-
"sass": "^1.60.0"
88+
"sass": "^1.70.0"
8989
},
9090
"engines": {
9191
"node": ">=18",
@@ -103,4 +103,4 @@
103103
"copyFilesSettings": {
104104
"whenFileExists": "overwrite"
105105
}
106-
}
106+
}

packages/styles/src/layouts/_scroll.scss

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030

3131
&.#{utils.$prefix-default}--vertical {
3232
max-height: 100%;
33-
overflow-x: hidden;
34-
overflow-y: auto;
33+
overflow: hidden auto;
3534

3635
@layer defaults {
3736
& {
@@ -45,8 +44,7 @@
4544
// @modifier
4645
&.#{utils.$prefix-default}--always {
4746
max-width: 100%;
48-
overflow-x: auto;
49-
overflow-y: hidden;
47+
overflow: auto hidden;
5048

5149
> * {
5250
min-width: 100%;
@@ -88,8 +86,7 @@
8886
max-width: 100vw;
8987
height: auto;
9088
box-sizing: border-box;
91-
overflow-x: auto;
92-
overflow-y: hidden;
89+
overflow: hidden auto;
9390
padding-right: 0;
9491

9592
> * {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11959,10 +11959,10 @@ sass-convert@^0.5.0:
1195911959
through2 "^2.0.0"
1196011960
which "^1.0.5"
1196111961

11962-
sass@^1.60.0:
11963-
version "1.69.5"
11964-
resolved "https://registry.yarnpkg.com/sass/-/sass-1.69.5.tgz#23e18d1c757a35f2e52cc81871060b9ad653dfde"
11965-
integrity sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==
11962+
sass@^1.70.0:
11963+
version "1.70.0"
11964+
resolved "https://registry.yarnpkg.com/sass/-/sass-1.70.0.tgz#761197419d97b5358cb25f9dd38c176a8a270a75"
11965+
integrity sha512-uUxNQ3zAHeAx5nRFskBnrWzDUJrrvpCPD5FNAoRvTi0WwremlheES3tg+56PaVtCs5QDRX5CBLxxKMDJMEa1WQ==
1196611966
dependencies:
1196711967
chokidar ">=3.0.0 <4.0.0"
1196811968
immutable "^4.0.0"

0 commit comments

Comments
 (0)