@quaffui/quaff 1.0.0-alpha1 → 1.0.0-beta1

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.
@@ -1,6 +1,5 @@
1
1
  <script lang="ts">
2
2
  import { setContext, type Snippet } from "svelte";
3
- import { assets } from "$app/paths";
4
3
  import { QCard, QCardSection, QTheme, Quaff } from "../..";
5
4
  import { QColors, QDocsCtxName, type QComponentDocs } from "../../utils";
6
5
  import QApi from "./QApi.svelte";
@@ -38,44 +37,54 @@
38
37
  setContext(QDocsCtxName.snippets, () => snippets);
39
38
  }
40
39
 
41
- const image = $derived(`${assets}/cocktail-close-up.jpg`);
42
-
43
40
  let principalDocument = Array.isArray(componentDocs)
44
41
  ? componentDocs[0]
45
42
  : componentDocs;
43
+
44
+ const brightness = $derived(Quaff.darkMode.isActive ? 0.7 : 1.2);
46
45
  </script>
47
46
 
48
- <div class="q-docs" style="padding: 1rem">
47
+ <div
48
+ class="q-docs"
49
+ style="padding: 1rem; --q-hue-rotate: {hueRotate}deg; --q-brightness: {brightness}; max-width: {Quaff
50
+ .breakpoints.lg}px; margin: auto;"
51
+ >
49
52
  <div class="row q-gutter-lg" style="min-height: 400px">
50
53
  <QCard
51
- class="col-sm-12 col-lg-6 flex flex-center"
54
+ class="col-sm-12 col-xs-12 col-lg-6"
52
55
  fill="primary"
53
56
  style="min-height: 400px; align-content: center;"
54
57
  >
55
- <h1 class="large no-margin">{principalDocument?.name || docName}</h1>
58
+ <h1
59
+ class={[
60
+ "no-margin justify-center",
61
+ Quaff.breakpoints.isMoreThan("sm", true) ? "large" : "small",
62
+ ]}
63
+ >
64
+ {docName || principalDocument?.name}
65
+ </h1>
56
66
  <QCardSection class="q-docs__description flex flex-center">
57
67
  <h3 class="q-docs__description-text">
58
- {principalDocument?.description || docDescription}
68
+ {docDescription || principalDocument?.description}
59
69
  </h3>
60
70
  </QCardSection>
61
71
  </QCard>
62
72
  <QCard
63
- class="q-docs__preview col-sm-12 col-lg-6 q-mt-none q-pa-none"
73
+ class="q-docs__preview col-sm-12 col-xs-12 col-lg-6 q-mt-none q-pa-none"
64
74
  fill="secondary"
65
75
  style="min-height: 400px"
66
76
  >
67
77
  <QCardSection class="q-pa-none">
68
78
  <div
69
- class="flex flex-center"
79
+ class="flex flex-center column"
70
80
  style="position: absolute; height: 100%; width: 100%; z-index: 1; overflow: hidden;"
71
81
  >
72
82
  {@render display?.()}
73
83
  </div>
74
84
  <img
75
85
  class="q-docs__image"
76
- src={image}
86
+ src="/cocktail-close-up.jpg"
77
87
  alt="Close-up of the content of a cocktail"
78
- style={`filter: hue-rotate(${hueRotate}deg) ${isDark ? "brightness(0.7)" : "brightness(1.2)"}`}
79
88
  />
80
89
  </QCardSection>
81
90
  </QCard>
@@ -119,6 +128,7 @@
119
128
  width: 100%;
120
129
  height: 25rem;
121
130
  object-fit: cover;
131
+ filter: hue-rotate(var(--q-hue-rotate)) brightness(var(--q-brightness));
122
132
  }
123
133
  .q-docs :global(.q-docs__preview) {
124
134
  display: flex !important;