Skip to content

Commit 16484c8

Browse files
more docs updates
1 parent 62a0daf commit 16484c8

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

src/components/Button/ActionButton.stories.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ const EDGES = enumValues<NonNullable<ActionButtonProps["edge"]>>({
4141
none: true,
4242
})
4343

44+
/**
45+
* A button that should contain a remixicon icon and nothing else.
46+
*/
4447
const meta: Meta<typeof ActionButton> = {
4548
title: "smoot-design/ActionButton",
4649
component: ActionButton,
@@ -166,6 +169,13 @@ export const Showcase: Story = {
166169
),
167170
}
168171

172+
/**
173+
* `ActionButtonLink` is styled as a `ActionButton` that renders an anchor tag.
174+
*
175+
* To use a custom link component (E.g. `Link` from `react-router` or `next/link`),
176+
* pass it as the `Component` prop. Alternatively, customize the project-wide
177+
* default link adapter via [Theme's LinkAdapter](../?path=/docs/smoot-design-themeprovider--docs)
178+
*/
169179
export const Links: Story = {
170180
render: () => (
171181
<Stack direction="row" gap={2} sx={{ my: 2 }}>

src/components/Button/Button.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,11 @@ const ButtonInner: React.FC<
315315
type ButtonProps = ButtonStyleProps & React.ComponentProps<"button">
316316

317317
/**
318-
* Our standard button component.
318+
* Our standard button component. See [Button Docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-button--docs).
319319
*
320320
* See also:
321-
* - ButtonLink
322-
* - ActionButton
321+
* - [ButtonLink](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-button--docs#links)
322+
* - [ActionButton](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-actionbutton--docs) for icon-only uses
323323
*/
324324
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
325325
({ children, ...props }, ref) => {
@@ -336,6 +336,9 @@ type ButtonLinkProps = ButtonStyleProps &
336336
Component?: React.ElementType
337337
} & LinkAdapterPropsOverrides
338338

339+
/**
340+
* See [ButtonLink docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-button--docs#links)
341+
*/
339342
const ButtonLink = React.forwardRef<HTMLAnchorElement, ButtonLinkProps>(
340343
({ children, Component, ...props }: ButtonLinkProps, ref) => {
341344
return (
@@ -381,7 +384,11 @@ const actionStyles = (size: ButtonSize) => {
381384

382385
/**
383386
* A button that should contain a remixicon icon and nothing else.
384-
* For a variant that functions as a link, see ActionButtonLink.
387+
* See [ActionButton docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-actionbutton--docs).
388+
*
389+
* See also:
390+
* - [ActionButtonLink](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-button--docs#links)
391+
* - [Button](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-button--docs) for text buttons
385392
*/
386393
const ActionButton = styled(
387394
React.forwardRef<HTMLButtonElement, ActionButtonProps>((props, ref) => (
@@ -401,6 +408,9 @@ type ActionButtonLinkProps = ActionButtonStyleProps &
401408
Component?: React.ElementType
402409
} & LinkAdapterPropsOverrides
403410

411+
/**
412+
* See [ActionButtonLink docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-actionbutton--docs#links)
413+
*/
404414
const ActionButtonLink = ActionButton.withComponent(
405415
({ Component, ...props }: ButtonLinkProps) => {
406416
return <LinkStyled Component={Component} {...props} />

src/components/ThemeProvider/ThemeProvider.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ type ExtendedTheme = Theme & {
9898
custom: CustomTheme
9999
}
100100

101+
/**
102+
* Create a customized Smoot Design theme for use with `ThemeProvider`.
103+
*
104+
* See [ThemeProvider Docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-themeprovider--docs#further-customized-theme-with-createtheme)
105+
* for more.
106+
*/
101107
const createTheme = (options?: {
102108
custom: Partial<ThemeOptions["custom"]>
103109
}): ExtendedTheme =>
@@ -116,6 +122,11 @@ type ThemeProviderProps = {
116122
theme?: Theme
117123
}
118124

125+
/**
126+
*
127+
* @param param0
128+
* @returns
129+
*/
119130
const ThemeProvider: React.FC<ThemeProviderProps> = ({
120131
children,
121132
theme = defaultTheme,

0 commit comments

Comments
 (0)