Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,12 @@
"markdown_source": "../packages/components/src/guide/README.md",
"parent": "components"
},
{
"title": "HStack",
"slug": "h-stack",
"markdown_source": "../packages/components/src/h-stack/README.md",
"parent": "components"
},
{
"title": "Heading",
"slug": "heading",
Expand Down Expand Up @@ -1157,6 +1163,12 @@
"markdown_source": "../packages/components/src/unit-control/README.md",
"parent": "components"
},
{
"title": "VStack",
"slug": "v-stack",
"markdown_source": "../packages/components/src/v-stack/README.md",
"parent": "components"
},
{
"title": "VisuallyHidden",
"slug": "visually-hidden",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/alignment-matrix-control/cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { CompositeItem } from '../composite';
import Tooltip from '../tooltip';
import VisuallyHidden from '../visually-hidden';
import { VisuallyHidden } from '../visually-hidden';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/base-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import classnames from 'classnames';
/**
* Internal dependencies
*/
import VisuallyHidden from '../visually-hidden';
import { VisuallyHidden } from '../visually-hidden';
import {
Wrapper,
StyledField,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { forwardRef } from '@wordpress/element';
*/
import Tooltip from '../tooltip';
import Icon from '../icon';
import VisuallyHidden from '../visually-hidden';
import { VisuallyHidden } from '../visually-hidden';

const disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ];

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/button/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { plusCircle } from '@wordpress/icons';
* Internal dependencies
*/
import ButtonWithForwardedRef, { Button } from '../';
import VisuallyHidden from '../../visually-hidden';
import { VisuallyHidden } from '../../visually-hidden';

describe( 'Button', () => {
describe( 'basic rendering', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/color-picker/hue.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { TAB } from '@wordpress/keycodes';
*/
import { calculateHueChange } from './utils';
import KeyboardShortcuts from '../keyboard-shortcuts';
import VisuallyHidden from '../visually-hidden';
import { VisuallyHidden } from '../visually-hidden';

export class Hue extends Component {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/color-picker/inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { chevronDown } from '@wordpress/icons';
*/
import Button from '../button';
import TextControl from '../text-control';
import VisuallyHidden from '../visually-hidden';
import { VisuallyHidden } from '../visually-hidden';
import { isValidHex } from './utils';

/* Wrapper for TextControl, only used to handle intermediate state while typing. */
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/color-picker/saturation.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { compose, pure, withInstanceId } from '@wordpress/compose';
import { calculateSaturationChange } from './utils';
import Button from '../button';
import KeyboardShortcuts from '../keyboard-shortcuts';
import VisuallyHidden from '../visually-hidden';
import { VisuallyHidden } from '../visually-hidden';

export class Saturation extends Component {
constructor( props ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Button from '../button';
import ColorPicker from '../color-picker';
import Dropdown from '../dropdown';
import KeyboardShortcuts from '../keyboard-shortcuts';
import VisuallyHidden from '../visually-hidden';
import { VisuallyHidden } from '../visually-hidden';

import {
addControlPoint,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/external-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { external } from '@wordpress/icons';
/**
* Internal dependencies
*/
import VisuallyHidden from '../visually-hidden';
import { VisuallyHidden } from '../visually-hidden';
import { StyledIcon } from './styles/external-link-styles';

export function ExternalLink(
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/font-size-picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Button from '../button';
import RangeControl from '../range-control';
import UnitControl from '../unit-control';
import CustomSelectControl from '../custom-select-control';
import VisuallyHidden from '../visually-hidden';
import { VisuallyHidden } from '../visually-hidden';

const DEFAULT_FONT_SIZE = 'default';
const CUSTOM_FONT_SIZE = 'custom';
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/form-token-field/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { closeSmall } from '@wordpress/icons';
* Internal dependencies
*/
import Button from '../button';
import VisuallyHidden from '../visually-hidden';
import { VisuallyHidden } from '../visually-hidden';

export default function Token( {
value,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# HStack

> **Experimental!**

`HStack` (Horizontal Stack) arranges child elements in a horizontal line.

## Usage

`HStack` can render anything inside.

```jsx
import { HStack, Text, View } from '@wordpress/components/ui';
import {
__experimentalHStack as HStack,
__experimentalText as Text,
__experimentalView as View,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that View is going to be moved quite soon.

} from '@wordpress/components';

function Example() {
return (
Expand Down Expand Up @@ -83,7 +89,12 @@ Determines if children should wrap.
When a `Spacer` is used within an `HStack`, the `Spacer` adaptively expands to take up the remaining space.

```jsx
import { HStack, Spacer, Text, View } from '@wordpress/components/ui';
import {
__experimentalHStack as HStack,
__experimentalSpacer as Spacer,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no Spacer in @wordpress/components yet. Should we replace it with something else in this README file?

__experimentalText as Text,
__experimentalView as View,
} from '@wordpress/components';

function Example() {
return (
Expand All @@ -105,7 +116,12 @@ function Example() {
`Spacer` also be used in-between items to push them apart.

```jsx
import { HStack, Spacer, Text, View } from '@wordpress/components/ui';
import {
__experimentalHStack as HStack,
__experimentalSpacer as Spacer,
__experimentalText as Text,
__experimentalView as View,
} from '@wordpress/components';

function Example() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Internal dependencies
*/
import { createComponent } from '../utils';
import { createComponent } from '../ui/utils';
import { useHStack } from './hook';

/**
Expand All @@ -11,7 +11,11 @@ import { useHStack } from './hook';
*
* @example
* ```jsx
* import { HStack, Text, View } from `@wordpress/components/ui`;
* import {
* __experimentalHStack as HStack,
* __experimentalText as Text,
* __experimentalView as View,
* } from `@wordpress/components`;
*
* function Example() {
* return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/**
* Internal dependencies
*/
import { hasConnectNamespace, useContextSystem } from '../context';
import { FlexItem, useFlex } from '../../flex';
import { hasConnectNamespace, useContextSystem } from '../ui/context';
import { FlexItem, useFlex } from '../flex';
import { getAlignmentProps } from './utils';
import { getValidChildren } from '../utils/get-valid-children';
import { getValidChildren } from '../ui/utils/get-valid-children';

/**
*
* @param {import('../context').ViewOwnProps<import('./types').Props, 'div'>} props
* @param {import('../ui/context').ViewOwnProps<import('./types').Props, 'div'>} props
*/
export function useHStack( props ) {
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as HStack } from './component';
export * from './hook';
export { useHStack } from './hook';
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Internal dependencies
*/
import { View } from '../../view';
import { HStack } from '../index';
import { View } from '../../ui/view';
import { HStack } from '..';

export default {
component: HStack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { render } from '@testing-library/react';
/**
* Internal dependencies
*/
import { View } from '../../view';
import { View } from '../../ui/view';
import { HStack } from '..';

describe( 'props', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { CSSProperties } from 'react';
/**
* Internal dependencies
*/
import type { FlexProps } from '../../flex/types';
import type { FlexProps } from '../flex/types';

export type HStackAlignment =
| 'bottom'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const V_ALIGNMENTS = {
/* eslint-disable jsdoc/valid-types */
/**
* @param {import('./types').HStackAlignment | import('react').CSSProperties[ 'alignItems' ]} alignment Where to align.
* @param {import('../../flex/types').FlexDirection} [direction='row'] Direction to align.
* @param {import('../flex/types').FlexDirection} [direction='row'] Direction to align.
* @return {import('./types').AlignmentProps} Alignment props.
*/
/* eslint-enable jsdoc/valid-types */
Expand Down
4 changes: 3 additions & 1 deletion packages/components/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export { default as __experimentalCustomGradientPicker } from './custom-gradient
export { default as Guide } from './guide';
export { default as GuidePage } from './guide/page';
export { Heading as __experimentalHeading } from './heading';
export { HStack as __experimentalHStack } from './h-stack';
export { default as Icon } from './icon';
export { default as IconButton } from './button/deprecated';
export { default as __experimentalInputControl } from './input-control';
Expand Down Expand Up @@ -124,7 +125,8 @@ export {
export { default as TreeSelect } from './tree-select';
export { Truncate as __experimentalTruncate } from './truncate';
export { default as __experimentalUnitControl } from './unit-control';
export { default as VisuallyHidden } from './visually-hidden';
export { VisuallyHidden } from './visually-hidden';
export { VStack as __experimentalVStack } from './v-stack';
export { default as IsolatedEventContainer } from './isolated-event-container';
export {
createSlotFill,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/input-control/label.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Internal dependencies
*/
import VisuallyHidden from '../visually-hidden';
import { VisuallyHidden } from '../visually-hidden';
import { Label as BaseLabel } from './styles/input-control-styles';

export default function Label( {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ESCAPE } from '@wordpress/keycodes';
* Internal dependencies
*/
import Button from '../../button';
import VisuallyHidden from '../../visually-hidden';
import { VisuallyHidden } from '../../visually-hidden';
import withSpokenMessages from '../../higher-order/with-spoken-messages';
import { useNavigationMenuContext } from './context';
import { useNavigationContext } from '../context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Grid } from '../grid';
import { Surface } from '../surface';
import { Text } from '../../text';
import { View } from '../view';
import { VStack } from '../v-stack';
import { VStack } from '../../v-stack';

const Container = ( { children } ) => (
<div
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/__storybook-utils/page.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Internal dependencies
*/
import { VStack } from '../v-stack';
import { VStack } from '../../v-stack';
import { View } from '../view';
import { Heading } from '../../heading';
import { Divider } from '../divider';
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/card/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { Grid } from '../../grid';
import { Text } from '../../../text';
import { VStack } from '../../v-stack';
import { VStack } from '../../../v-stack';
import { Card, CardBody, CardFooter } from '../index';
import { Divider } from '../../divider';
import { Heading } from '../../../heading';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { createContext, useContext, memo, useState } from '@wordpress/element';
/**
* Internal dependencies
*/
import { Card, CardBody, Text, View } from '../../';
import { Card, CardBody, View } from '../../';
import { Text } from '../../../text';
import { ContextSystemProvider } from '../index';

const SomeContext = createContext();
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/elevation/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { number } from '@storybook/addon-knobs';
import { Elevation } from '../index';
import { Grid } from '../../grid';
import { View } from '../../view';
import { HStack } from '../../h-stack';
import { HStack } from '../../../h-stack';
import { Divider } from '../../divider';
import {
ExampleGrid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useMemo, memo } from '@wordpress/element';
/**
* Internal dependencies
*/
import { VStack } from '../v-stack';
import { VStack } from '../../v-stack';
import { FormGroupContext } from './form-group-context';
import FormGroupHelp from './form-group-help';
import FormGroupLabel from './form-group-label';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { memo } from '@wordpress/element';
* Internal dependencies
*/
import { ControlLabel } from '../control-label';
import VisuallyHidden from '../../visually-hidden';
import { VisuallyHidden } from '../../visually-hidden';

/**
* @param {import('../context').ViewOwnProps<import('./types').FormGroupLabelProps, 'label'>} props
Expand Down
2 changes: 0 additions & 2 deletions packages/components/src/ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ export * from './divider';
export * from './elevation';
export * from './form-group';
export * from './grid';
export * from './h-stack';
export * from './shortcut';
export * from './spinner';
export * from './v-stack';
export * from './view';
Loading