From e1bd30eb9d72b68c8464fb516e99e74d9dfa15c6 Mon Sep 17 00:00:00 2001 From: upsiflu Date: Thu, 19 Dec 2024 14:57:04 +0100 Subject: [PATCH] feat(ui-docs): minor improvements and corrections --- front/src/components/ui/Card.vue | 128 ++++++++++++---------- front/src/components/ui/Layout.vue | 9 +- front/src/components/ui/layout/Spacer.vue | 6 +- front/ui-docs/.vitepress/theme/Theme.vue | 9 +- front/ui-docs/components/ui/button.md | 13 +-- front/ui-docs/components/ui/card.md | 49 ++++++--- front/ui-docs/components/ui/layout.md | 105 +++++++++++------- 7 files changed, 196 insertions(+), 123 deletions(-) diff --git a/front/src/components/ui/Card.vue b/front/src/components/ui/Card.vue index 2c9c81c43..b093ae89f 100644 --- a/front/src/components/ui/Card.vue +++ b/front/src/components/ui/Card.vue @@ -9,15 +9,15 @@ import Alert from './Alert.vue' import Layout from './Layout.vue'; import Spacer from './layout/Spacer.vue'; -interface Props extends Partial { +const props = defineProps<{ title: string category?: true | "h1" | "h2" | "h3" | "h4" | "h5" - image?: string | { src: string, style?: "withPadding" } - tags?: string[] small?: true -} -const props = defineProps() + tags?: string[] + image?: string | { src: string, style?: "withPadding" } + icon?: string +} & Partial & (PastelProps | ColorProps | DefaultProps) & RaisedProps & VariantProps>() const image = typeof props.image === 'string' ? { src: props.image } : props.image @@ -28,6 +28,65 @@ const isExternalLink = computed(() => { // const fallbackWidth = + + - - diff --git a/front/src/components/ui/Layout.vue b/front/src/components/ui/Layout.vue index 4f5768c83..08b9052a0 100644 --- a/front/src/components/ui/Layout.vue +++ b/front/src/components/ui/Layout.vue @@ -1,6 +1,9 @@ ``` -
+
{{ noGap ? 'no-gap' : '-' }} --- - - - - + + + +
@@ -242,6 +266,13 @@ const noGap = ref(true); ### Add fixed or flexible Spacers +::: info Only available on: + +- **stack** +- **flex** + +::: + If you add a spacer with attribute `grow`, it will push the other item until the Layout fills the available space. This only works if the parent element itself grows beyond its minimal contents. @@ -254,11 +285,11 @@ const isGrowing = ref(true); ``` @@ -268,11 +299,11 @@ const isGrowing = ref(true); --- - - A - B - - C (footer) + + + + +
@@ -280,7 +311,7 @@ const isGrowing = ref(true); Multiple spacers will distribute their growth evenly. -Note that you can set the minimum space occupied by the `Spacer` with its `size` prop [(docs)](layout/spacer). Negative values can offset the gap of the `Layout`: +Note that you can set the minimum space occupied by the `Spacer` with its `size` prop [(docs)](layout/spacer). Negative values can offset the gap of the `Layout` (but, due to a limitation of flexbox, not eat into the space occupied by adjacent items): @@ -289,12 +320,12 @@ Note that you can set the minimum space occupied by the `Spacer` with its `size` - A + - B1 - B2 + + - C (footer) + ``` @@ -304,13 +335,13 @@ Note that you can set the minimum space occupied by the `Spacer` with its `size` --- - - A + + - B1 - B2 + + - C (footer) +