Skip to content

Commit 1b661ee

Browse files
committed
Add docs
1 parent 54b6e7a commit 1b661ee

File tree

5 files changed

+80
-26
lines changed

5 files changed

+80
-26
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"id": "actionbar",
3+
"name": "ActionBar",
4+
"status": "draft",
5+
"a11yReviewed": false,
6+
"stories": [
7+
{"id": "components-actionbar--default"},
8+
{"id": "components-actionbar--small-action-bar"},
9+
{"id": "components-actionbar--comment-box"}
10+
],
11+
"props": [
12+
{
13+
"name": "size",
14+
"type": "'small' | 'medium' | 'large'",
15+
"required": false,
16+
"description": "Size of the action bar"
17+
},
18+
{
19+
"name": "aria-label",
20+
"type": "string",
21+
"description": "When provided, a label is added to the action bar"
22+
},
23+
{
24+
"name": "children",
25+
"type": "React.ReactElement",
26+
"required": true
27+
}
28+
],
29+
"subcomponents": [
30+
{
31+
"name": "ActionBar.Icon",
32+
"props": [
33+
{
34+
"name": "children",
35+
"type": "React.ReactNode",
36+
"defaultValue": "",
37+
"required": true,
38+
"description": "This will be the Button description."
39+
},
40+
{
41+
"name": "icon",
42+
"type": "Component",
43+
"defaultValue": "",
44+
"description": "provide an octicon. It will be placed in the center of the button"
45+
},
46+
{
47+
"name": "aria-label",
48+
"type": "string",
49+
"defaultValue": "",
50+
"description": "Use an aria label to describe the functionality of the button. Please refer to [our guidance on alt text](https://primer.style/guides/accessibility/alternative-text-for-images) for tips on writing good alternative text."
51+
},
52+
{
53+
"name": "sx",
54+
"type": "SystemStyleObject"
55+
}
56+
]
57+
},
58+
{
59+
"name": "ActionBar.Divider"
60+
}
61+
]
62+
}

packages/react/src/ActionBar/ActionBar.stories.tsx renamed to packages/react/src/drafts/ActionBar/ActionBar.stories.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import {Meta} from '@storybook/react'
2+
import type {Meta} from '@storybook/react'
33
import ActionBar from '.'
44
import {
55
BoldIcon,
@@ -14,9 +14,10 @@ import {
1414
ListOrderedIcon,
1515
TasklistIcon,
1616
} from '@primer/octicons-react'
17-
import {MarkdownInput} from '../drafts/MarkdownEditor/_MarkdownInput'
18-
import {ViewSwitch, type MarkdownViewMode} from '../drafts/MarkdownEditor/_ViewSwitch'
19-
import {Box} from '..'
17+
import {MarkdownInput} from '../MarkdownEditor/_MarkdownInput'
18+
import {ViewSwitch} from '../MarkdownEditor/_ViewSwitch'
19+
import type {MarkdownViewMode} from '../MarkdownEditor/_ViewSwitch'
20+
import {Box} from '../..'
2021

2122
export default {
2223
title: 'Components/ActionBar',

packages/react/src/ActionBar/ActionBar.tsx renamed to packages/react/src/drafts/ActionBar/ActionBar.tsx

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
1-
/*
2-
TODO
3-
- Decide props for ActionBar
4-
- Add api docs
5-
- Add proper types\
6-
Bugs
7-
- Nothing in More items
8-
- Divider is loopy
9-
*/
10-
111
import type {RefObject, MutableRefObject} from 'react'
122
import React, {useState, useCallback, useRef, forwardRef} from 'react'
133
import {KebabHorizontalIcon} from '@primer/octicons-react'
14-
import {ActionList} from '../ActionList'
15-
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect'
4+
import {ActionList} from '../../ActionList'
5+
import useIsomorphicLayoutEffect from '../../utils/useIsomorphicLayoutEffect'
166
import styled from 'styled-components'
17-
import sx from '../sx'
18-
import {useOnEscapePress} from '../hooks/useOnEscapePress'
19-
import type {ResizeObserverEntry} from '../hooks/useResizeObserver'
20-
import {useResizeObserver} from '../hooks/useResizeObserver'
21-
22-
import {useOnOutsideClick} from '../hooks/useOnOutsideClick'
23-
import type {IconButtonProps} from '../Button'
24-
import {IconButton} from '../Button'
25-
import Box from '../Box'
7+
import sx from '../../sx'
8+
import {useOnEscapePress} from '../../hooks/useOnEscapePress'
9+
import type {ResizeObserverEntry} from '../../hooks/useResizeObserver'
10+
import {useResizeObserver} from '../../hooks/useResizeObserver'
11+
12+
import {useOnOutsideClick} from '../../hooks/useOnOutsideClick'
13+
import type {IconButtonProps} from '../../Button'
14+
import {IconButton} from '../../Button'
15+
import Box from '../../Box'
2616

2717
type ChildSize = {
2818
text: string

packages/react/src/ActionBar/index.ts renamed to packages/react/src/drafts/ActionBar/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {ActionBar as Bar, ActionBarIconButton, VerticalDivider} from './ActionBar'
2-
//export type {ActionBarProps} from './ActionBar'
2+
export type {ActionBarProps} from './ActionBar'
33

44
const ActionBar = Object.assign(Bar, {
55
IconButton: ActionBarIconButton,

packages/react/src/drafts/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,4 @@ export type {
6262
} from '../NavList'
6363
export * from './SelectPanel2'
6464
export * from './Tooltip'
65+
export * from './ActionBar'

0 commit comments

Comments
 (0)