Skip to content

Commit

Permalink
Merge pull request #1136 from nsbno/update-docs-cards
Browse files Browse the repository at this point in the history
Update property docs for cards and bump version
  • Loading branch information
alicemacl authored May 13, 2024
2 parents 45c1842 + 6852a42 commit 5fb52b6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/hip-walls-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vygruppen/spor-react": patch
---

Update docs for PressableCard and RadioCard
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "0.0.25",
"version": "0.0.26",
"name": "@vygruppen/docs",
"description": "The Spor documentation",
"license": "MIT",
Expand Down
9 changes: 3 additions & 6 deletions packages/spor-react/src/layout/PressableCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import React from "react";
import { Box, BoxProps, useStyleConfig } from "@chakra-ui/react";

type PressableCardProps = Omit<BoxProps, "as"> & {
/** Use "floating" | "accent" | "base". Defaults to base */
/** Defaults to "base" */
variant: "floating" | "accent" | "base";
/** Use "sm" | "lg". Defaults to sm */
size?: "sm" | "lg";
/** Use "button" | "a" | "label". Defaults to button */
/** Defaults to "button" */
as: "button" | "a" | "label";
};

Expand Down Expand Up @@ -44,11 +42,10 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
export const PressableCard = ({
children,
as = "button",
size = "sm",
variant = "base",
...props
}: PressableCardProps) => {
const styles = useStyleConfig("PressableCard", { variant, size });
const styles = useStyleConfig("PressableCard", { variant });
return (
<Box as={as} __css={styles} {...props}>
{children}
Expand Down
1 change: 1 addition & 0 deletions packages/spor-react/src/layout/RadioCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import React, { useId } from "react";
type RadioCardProps = UseRadioProps &
BoxProps & {
children: React.ReactNode;
/** Defaults to "base" */
variant: "floating" | "base";
};

Expand Down
9 changes: 9 additions & 0 deletions packages/spor-react/src/layout/RadioCardGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ import React, { Children } from "react";
type RadioCardGroupProps = RadioGroupProps & {
children: React.ReactNode;
props?: RadioGroupProps;
/** Defaults to "row" */
direction?: StackDirection;
/** Defaults to "base" */
variant?: string;
/** The name of the radio group */
name?: string;
/** The default value of the radio group */
defaultValue?: string;
/** The callback function to be called when the radio group value changes */
onChange?: (value: string) => void;
};

/**
Expand Down

0 comments on commit 5fb52b6

Please sign in to comment.