Skip to content

Commit

Permalink
restrict select options
Browse files Browse the repository at this point in the history
  • Loading branch information
larsrickert committed Jan 23, 2025
1 parent bf97b81 commit b2caf92
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions apps/docs/src/.vitepress/components/OnyxTypography.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<script lang="ts" setup>
import { OnyxHeadline, OnyxLink, type HeadlineType, type TextSize } from "sit-onyx";
import {
OnyxHeadline,
OnyxLink,
type HeadlineType,
type OnyxHeadlineProps,
type TextSize,
} from "sit-onyx";
import { computed, ref } from "vue";
import DesignVariable from "./DesignVariable.vue";
import DesignVariableCard from "./DesignVariableCard.vue";
Expand Down Expand Up @@ -67,7 +73,12 @@ const getTextSizeClass = (fontSize?: TextSize) => {
{{ previewText }}
</OnyxLink>

<OnyxHeadline is="h3" v-else :visual-size="variable.htmlTag" :monospace="isMonospace">
<OnyxHeadline
is="h3"
v-else
:visual-size="variable.htmlTag as OnyxHeadlineProps['visualSize']"
:monospace="isMonospace"
>
{{ previewText }}
</OnyxHeadline>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test.describe("Screenshot tests", () => {
test.describe("Screenshot tests (visual size)", () => {
executeMatrixScreenshotTest({
name: "Headline (visual sizes)",
columns: HEADLINE_TYPES,
columns: ["h1", "h2", "h3", "h4"],
rows: HEADLINE_TYPES,
component: (column, row) => (
<OnyxHeadline is={row} visualSize={column}>
Expand Down
2 changes: 1 addition & 1 deletion packages/sit-onyx/src/components/OnyxHeadline/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type OnyxHeadlineProps = {
* Visual size of the headline (h1-h6). Will default to but can be different from the semantical `is` property.
* Please note that only h1-h4 are intended to be used from UX perspective, h5 and h6 will have the same styles as h4.
*/
visualSize?: HeadlineType;
visualSize?: Exclude<HeadlineType, "h5" | "h6">;
/**
* Unique headline hash/ID (without "#") that is used to show a "#" icon on hover. Makes the headline clickable and a URL that points to this headline
* is copied to the users clipboard. Will be automatically normalized when containing non URL-safe characters.
Expand Down

0 comments on commit b2caf92

Please sign in to comment.