Skip to content

Commit b171411

Browse files
docs(mosaic): document the profile page, select group and organization panel exports
1 parent 851638f commit b171411

4 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎packages/mosaic/src/features/organization-profile/organization-profile.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ export function OrganizationProfile({
112112
);
113113
}
114114

115+
/**
116+
* The organization's built-in panels, for the pages the instance has turned on. `apiKeysProps.hide`
117+
* leaves the API keys panel out; the rest of `apiKeysProps` goes to it.
118+
*/
115119
export function organizationProfilePanels(
116120
available: readonly OrganizationProfilePageId[],
117121
{ hide: hideAPIKeys = false, ...apiKeysProps }: APIKeysPageProps = {},

‎packages/mosaic/src/features/organization-profile/organization-profile.view.tsx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@ import type {
1616
OrganizationProfilePages,
1717
} from './organization-profile.types';
1818

19+
/** What the organization's navigation is built from. */
1920
export interface OrganizationProfilePageListOptions {
21+
/** The built-in pages. One left undefined is left out of the navigation. */
2022
pages: OrganizationProfilePages;
23+
/** Pages of the consumer's own, added to the navigation after the built-ins. */
2124
customPages?: readonly CustomOrganizationProfilePage[];
25+
/**
26+
* The order the navigation runs in, by id: a built-in page's id, or a custom page's `path`. Ids
27+
* left out keep their default place behind the ones named.
28+
*/
2229
pageOrder?: readonly (OrganizationProfilePageId | (string & {}))[];
2330
}
2431

‎packages/mosaic/src/features/profile-pages/profile-pages.view.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ export interface ProfilePageGroup {
2121
export interface ProfilePagesViewProps extends Omit<ProfileRootProps, 'children' | 'value' | 'onValueChange'> {
2222
/** Names the surface, and the dialog it opens in. */
2323
label: string;
24+
/** The navigation, in order. A group without a label lists its pages without a heading. */
2425
groups: readonly ProfilePageGroup[];
2526
/** The open page's id. One the navigation does not list opens the first page instead. */
2627
activePage: string;
28+
/** Called with a page's id when the user picks it from the navigation. */
2729
onPageChange: (page: string) => void;
2830
}
2931

‎packages/mosaic/src/primitives/select/select-group.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const SelectGroupContext = createContext<string | undefined>(undefined);
88

99
export type SelectGroupProps = ComponentProps<'div'>;
1010

11+
/** A labelled set of options in the listbox, named by the `Select.GroupLabel` inside it. */
1112
export function SelectGroup(props: SelectGroupProps) {
1213
const { render, ...otherProps } = props;
1314
const labelId = useId();
@@ -30,6 +31,7 @@ export function SelectGroup(props: SelectGroupProps) {
3031

3132
export type SelectGroupLabelProps = ComponentProps<'div'>;
3233

34+
/** Names the `Select.Group` it sits in. Throws outside one. */
3335
export function SelectGroupLabel(props: SelectGroupLabelProps) {
3436
const { render, ...otherProps } = props;
3537
const labelId = useContext(SelectGroupContext);

0 commit comments

Comments
 (0)