@stoker-platform/web-app 0.5.57 → 0.5.58

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @stoker-platform/web-app
2
2
 
3
+ ## 0.5.58
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: improve list metrics layout
8
+
3
9
  ## 0.5.57
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-app",
3
- "version": "0.5.57",
3
+ "version": "0.5.58",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {
@@ -1895,7 +1895,7 @@ function Collection({
1895
1895
  (action) => !action.condition || action.condition(),
1896
1896
  ) ? (
1897
1897
  <DropdownMenu>
1898
- <DropdownMenuTrigger>
1898
+ <DropdownMenuTrigger asChild>
1899
1899
  <Button
1900
1900
  type="button"
1901
1901
  size="sm"
package/src/List.tsx CHANGED
@@ -1320,8 +1320,9 @@ export function List({
1320
1320
  >
1321
1321
  <CardContent>
1322
1322
  {metrics && hasMetrics && !relationList && (
1323
- <div className="hidden lg:flex flex-row gap-4 mb-4 mt-4">
1323
+ <div className="hidden lg:flex flex-row gap-4 mb-4 mt-4 max-w-[calc(100vw-96px)]">
1324
1324
  {metrics.map((metric: Metric | Chart, index: number) => {
1325
+ const hideThirdMetric = index >= 2 ? "hidden xl:grid" : undefined
1325
1326
  if (
1326
1327
  permissions?.Role &&
1327
1328
  (!metric.roles || metric.roles.includes(permissions?.Role))
@@ -1337,7 +1338,7 @@ export function List({
1337
1338
  return (
1338
1339
  <div
1339
1340
  key={`metric-${index}`}
1340
- className="grid gap-3 place-content-center"
1341
+ className={cn("grid gap-3 place-content-center", hideThirdMetric)}
1341
1342
  >
1342
1343
  <Card className="p-4 pt-6 pb-6 h-[175px] min-w-[175px] flex flex-col place-content-center items-center bg-blue-500 dark:bg-blue-500/50 text-primary-foreground dark:text-primary">
1343
1344
  <div className="relative bottom-2">
@@ -2,12 +2,17 @@ import { flushSync } from "react-dom"
2
2
 
3
3
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
4
  export const runViewTransition = (callback: () => any) => {
5
- if (document.startViewTransition) {
6
- document.startViewTransition(() => {
7
- flushSync(() => {
8
- callback()
5
+ if (document.startViewTransition && document.visibilityState === "visible") {
6
+ try {
7
+ const transition = document.startViewTransition(() => {
8
+ flushSync(() => {
9
+ callback()
10
+ })
9
11
  })
10
- })
12
+ transition.finished.catch(() => {})
13
+ } catch {
14
+ callback()
15
+ }
11
16
  } else {
12
17
  callback()
13
18
  }