Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
### Documentation

- `Menu`: Fix `overriden` typo to `overridden` in `CheckboxItemProps` and `RadioItemProps`. ([#79331](https://github.com/WordPress/gutenberg/pull/79331))
- Add component documentation for `ColorPicker`, `CustomSelectControl`, `Navigator`, `NumberControl`, `ResizableBox`, and `Slot` components ([#79460](https://github.com/WordPress/gutenberg/pull/79460)).

### Code Quality

Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/color-picker/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ const UnconnectedColorPicker = (
);
};

/**
* ColorPicker lets users select a color from a visual color surface, or by
Comment thread
aduth marked this conversation as resolved.
Outdated
* by editing its hex, RGB, or HSL values.
*/
export const ColorPicker = contextConnect(
UnconnectedColorPicker,
'ColorPicker'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import { ColorPicker } from '../component';
const meta: Meta< typeof ColorPicker > = {
tags: [ 'manifest' ],
component: ColorPicker,
// Temporary: Due to an upstream bug, render the root explicitly so the
// components manifest extractor can resolve props from the JSX.
//
// See: https://github.com/storybookjs/storybook/issues/34877
render: ( args ) => <ColorPicker { ...args } />,
title: 'Components/Selection & Input/Color/ColorPicker',
id: 'components-colorpicker',
argTypes: {
Expand Down
5 changes: 5 additions & 0 deletions packages/components/src/custom-select-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ function getDescribedBy( currentName: string, describedBy?: string ) {
return sprintf( __( 'Currently selected: %s' ), currentName );
}

/**
* CustomSelectControl is a dropdown for selecting a single option from a list,
Comment thread
aduth marked this conversation as resolved.
Outdated
* with support for custom styling. Use it instead of the `SelectControl` when
* options need richer markup (e.g. per-option styles or hints).
*/
function CustomSelectControl< T extends CustomSelectOption >(
props: CustomSelectProps< T >
) {
Expand Down
5 changes: 5 additions & 0 deletions packages/components/src/navigator/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const meta: Meta< typeof Navigator > = {
Button: Navigator.Button,
BackButton: Navigator.BackButton,
},
// Temporary: Due to an upstream bug, render the root explicitly so the
// components manifest extractor can resolve props from the JSX.
//
// See: https://github.com/storybookjs/storybook/issues/34877
render: ( args ) => <Navigator { ...args } />,
title: 'Components/Navigation/Navigator',
id: 'components-navigator',
argTypes: {
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/number-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ function UnforwardedNumberControl(
);
}

/**
* NumberControl lets users enter and adjust a numeric value.
Comment thread
aduth marked this conversation as resolved.
Outdated
*/
export const NumberControl = forwardRef( UnforwardedNumberControl );
NumberControl.displayName = 'NumberControl';

Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/resizable-box/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ function UnforwardedResizableBox(
);
}

/**
* ResizableBox wraps content in a container with draggable handles, letting
* users interactively resize it along one or more edges or corners.
*/
export const ResizableBox = forwardRef( UnforwardedResizableBox );
ResizableBox.displayName = 'ResizableBox';

Expand Down
5 changes: 5 additions & 0 deletions packages/components/src/slot-fill/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ import type {

export { Fill };

/**
* Slot marks a location where content rendered by matching `Fill` components
* elsewhere will appear. Use it to allow a component to define UI areas that
* can be extended from other parts of the application.
*/
export const Slot = forwardRef(
(
props: SlotComponentProps &
Expand Down
3 changes: 2 additions & 1 deletion packages/dataviews/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

### Documentation

- Fix `overriden` typo to `overridden` in README. ([#79331](https://github.com/WordPress/gutenberg/pull/79331))
- Fix `overriden` typo to `overridden` in README. ([#79331](https://github.com/WordPress/gutenberg/pull/79331))
- Add component documentation for `DataViews`, `DataViewsPicker`, and `DataForm` components ([#79460](https://github.com/WordPress/gutenberg/pull/79460)).

### Internal

Expand Down
5 changes: 5 additions & 0 deletions packages/dataviews/src/dataform/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import { DataFormProvider } from '../components/dataform-context';
import { DataFormLayout } from '../components/dataform-layouts/data-form-layout';
import normalizeForm from '../components/dataform-layouts/normalize-form';

/**
* DataForm renders an auto-generated form for viewing and editing the fields of
* a data item, driven by a fields and form layout configuration. Use it to edit
* items of a dataset, often alongside `DataViews`.
*/
export default function DataForm< Item >( {
data,
form,
Expand Down
5 changes: 5 additions & 0 deletions packages/dataviews/src/dataviews-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ function DataViewsPicker< Item >( {
);
}

/**
* DataViewsPicker renders a dataset allowing users to select one or multiple
* items. It shares the layouts, search, and filtering of `DataViews` but is
* geared toward choosing items rather than managing them.
*/
// Populate the DataViews sub components
const DataViewsPickerSubComponents =
DataViewsPicker as typeof DataViewsPicker & {
Expand Down
5 changes: 5 additions & 0 deletions packages/dataviews/src/dataviews/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ function DataViews< Item >( {
);
}

/**
* DataViews renders a dataset using configurable layouts (table, grid, list)
* with built-in search, filtering, sorting, pagination, and actions. Use it to
* display and manage a collection of records.
*/
// Populate the DataViews sub components
const DataViewsSubComponents = DataViews as typeof DataViews & {
BulkActionToolbar: typeof BulkActionsFooter;
Expand Down
5 changes: 5 additions & 0 deletions packages/dataviews/src/dataviews/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ const meta = {
tags: [ 'manifest' ],
title: 'DataViews/DataViews',
component: DataViews,
// Temporary: Due to an upstream bug, render the root explicitly so the
// components manifest extractor can resolve props from the JSX.
//
// See: https://github.com/storybookjs/storybook/issues/34877
render: ( args ) => <DataViews { ...args } />,
args: {
containerHeight: 'auto',
},
Expand Down
7 changes: 1 addition & 6 deletions tools/eslint/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,7 @@ export default dedupePlugins( [
// component always receives props and returns a React element, and its
// props should be documented through its TypeScript props types.
{
files: [
'**/@(storybook|stories)/**',
'packages/components/src/**/*.tsx',
'packages/theme/src/**/*.tsx',
'packages/ui/src/**/*.tsx',
],
files: [ '**/@(storybook|stories)/**', '**/*.tsx' ],
Comment thread
ntsekouras marked this conversation as resolved.
rules: {
'jsdoc/require-param': 'off',
},
Expand Down
Loading