@wordpress/components 32.3.1-next.v.202602271551.0 → 32.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -1
- package/build/alignment-matrix-control/cell.cjs +2 -2
- package/build/alignment-matrix-control/cell.cjs.map +1 -1
- package/build/alignment-matrix-control/index.cjs +2 -2
- package/build/alignment-matrix-control/index.cjs.map +1 -1
- package/build/angle-picker-control/angle-circle.cjs +2 -2
- package/build/angle-picker-control/angle-circle.cjs.map +1 -1
- package/build/calendar/utils/constants.cjs +1 -0
- package/build/calendar/utils/constants.cjs.map +2 -2
- package/build/date-time/date/styles.cjs +9 -9
- package/build/date-time/date/styles.cjs.map +2 -2
- package/build/date-time/time/index.cjs +1 -1
- package/build/date-time/time/index.cjs.map +2 -2
- package/build/date-time/utils.cjs +9 -0
- package/build/date-time/utils.cjs.map +2 -2
- package/build/menu/radio-item.cjs +1 -1
- package/build/menu/radio-item.cjs.map +2 -2
- package/build/private-apis.cjs +0 -4
- package/build/private-apis.cjs.map +3 -3
- package/build/tooltip/index.cjs +1 -1
- package/build/tooltip/index.cjs.map +1 -1
- package/build/visually-hidden/styles.cjs +2 -1
- package/build/visually-hidden/styles.cjs.map +2 -2
- package/build-module/alignment-matrix-control/cell.mjs +2 -2
- package/build-module/alignment-matrix-control/cell.mjs.map +1 -1
- package/build-module/alignment-matrix-control/index.mjs +2 -2
- package/build-module/alignment-matrix-control/index.mjs.map +1 -1
- package/build-module/angle-picker-control/angle-circle.mjs +2 -2
- package/build-module/angle-picker-control/angle-circle.mjs.map +1 -1
- package/build-module/calendar/utils/constants.mjs +1 -0
- package/build-module/calendar/utils/constants.mjs.map +2 -2
- package/build-module/date-time/date/styles.mjs +9 -9
- package/build-module/date-time/date/styles.mjs.map +2 -2
- package/build-module/date-time/time/index.mjs +2 -2
- package/build-module/date-time/time/index.mjs.map +2 -2
- package/build-module/date-time/utils.mjs +8 -0
- package/build-module/date-time/utils.mjs.map +2 -2
- package/build-module/menu/radio-item.mjs +1 -1
- package/build-module/menu/radio-item.mjs.map +2 -2
- package/build-module/private-apis.mjs +0 -4
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/tooltip/index.mjs +1 -1
- package/build-module/tooltip/index.mjs.map +1 -1
- package/build-module/visually-hidden/styles.mjs +2 -1
- package/build-module/visually-hidden/styles.mjs.map +2 -2
- package/build-style/style-rtl.css +11 -184
- package/build-style/style.css +11 -184
- package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
- package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
- package/build-types/animate/stories/index.story.d.ts +7 -7
- package/build-types/animate/stories/index.story.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts +1 -1
- package/build-types/border-box-control/stories/index.story.d.ts +1 -1
- package/build-types/border-control/stories/index.story.d.ts +5 -5
- package/build-types/box-control/stories/index.story.d.ts +7 -7
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts +7 -7
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/calendar/stories/date-calendar.story.d.ts +5 -0
- package/build-types/calendar/stories/date-calendar.story.d.ts.map +1 -1
- package/build-types/calendar/stories/date-range-calendar.story.d.ts +5 -0
- package/build-types/calendar/stories/date-range-calendar.story.d.ts.map +1 -1
- package/build-types/calendar/types.d.ts +12 -0
- package/build-types/calendar/types.d.ts.map +1 -1
- package/build-types/calendar/utils/constants.d.ts +1 -0
- package/build-types/calendar/utils/constants.d.ts.map +1 -1
- package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
- package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts +4 -4
- package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
- package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
- package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control/stories/index.story.d.ts +3 -3
- package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/index.story.d.ts +3 -3
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/date-time/stories/time.story.d.ts +1 -1
- package/build-types/date-time/stories/time.story.d.ts.map +1 -1
- package/build-types/date-time/time/index.d.ts.map +1 -1
- package/build-types/date-time/utils.d.ts +9 -0
- package/build-types/date-time/utils.d.ts.map +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +1 -1
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
- package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
- package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
- package/build-types/guide/stories/index.story.d.ts +1 -1
- package/build-types/guide/stories/index.story.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts +4 -4
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts +7 -7
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/radio-item.d.ts.map +1 -1
- package/build-types/menu-group/stories/index.story.d.ts +1 -1
- package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-item/stories/index.story.d.ts +4 -4
- package/build-types/navigation/stories/index.story.d.ts +6 -6
- package/build-types/navigation/stories/index.story.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts +5 -5
- package/build-types/notice/stories/index.story.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +1 -1
- package/build-types/palette-edit/stories/index.story.d.ts +2 -2
- package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
- package/build-types/query-controls/stories/index.story.d.ts +1 -1
- package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts +2 -2
- package/build-types/responsive-wrapper/stories/index.story.d.ts +1 -1
- package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
- package/build-types/sandbox/stories/index.story.d.ts +1 -1
- package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts +1 -1
- package/build-types/select-control/stories/index.story.d.ts +5 -5
- package/build-types/shortcut/stories/index.story.d.ts +1 -1
- package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.story.d.ts +4 -4
- package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts +7 -7
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/text/stories/index.story.d.ts +3 -3
- package/build-types/theme/stories/index.story.d.ts +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts +2 -2
- package/build-types/toolbar/stories/index.story.d.ts +3 -3
- package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +1 -1
- package/build-types/tools-panel/types.d.ts +1 -1
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/tooltip/stories/index.story.d.ts +1 -1
- package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/types.d.ts +2 -2
- package/build-types/tree-grid/stories/index.story.d.ts +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/stories/index.story.d.ts +1 -1
- package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.story.d.ts +1 -1
- package/build-types/visually-hidden/styles.d.ts.map +1 -1
- package/package.json +25 -25
- package/src/button-group/stories/index.story.tsx +1 -1
- package/src/calendar/stories/date-calendar.story.tsx +11 -0
- package/src/calendar/stories/date-range-calendar.story.tsx +11 -0
- package/src/calendar/style.scss +5 -0
- package/src/calendar/types.ts +12 -0
- package/src/calendar/utils/constants.ts +1 -0
- package/src/composite/legacy/stories/index.story.tsx +1 -1
- package/src/date-time/date/styles.ts +1 -0
- package/src/date-time/test/utils.test.ts +8 -11
- package/src/date-time/time/index.tsx +2 -12
- package/src/date-time/time/test/index.tsx +69 -0
- package/src/date-time/utils.ts +18 -0
- package/src/guide/style.scss +3 -0
- package/src/menu/radio-item.tsx +1 -1
- package/src/modal/style.scss +4 -7
- package/src/navigation/stories/index.story.tsx +1 -1
- package/src/notice/test/__snapshots__/index.tsx.snap +1 -1
- package/src/private-apis.ts +0 -4
- package/src/radio-group/stories/index.story.tsx +1 -1
- package/src/snackbar/style.scss +1 -0
- package/src/style.scss +0 -2
- package/src/tools-panel/types.ts +4 -1
- package/src/tooltip/README.md +2 -2
- package/src/tooltip/index.tsx +2 -2
- package/src/tooltip/types.ts +2 -2
- package/src/visually-hidden/styles.ts +1 -0
- package/src/visually-hidden/test/__snapshots__/index.tsx.snap +1 -1
- package/build/avatar/component.cjs +0 -99
- package/build/avatar/component.cjs.map +0 -7
- package/build/avatar/index.cjs +0 -37
- package/build/avatar/index.cjs.map +0 -7
- package/build/avatar/types.cjs +0 -19
- package/build/avatar/types.cjs.map +0 -7
- package/build/avatar-group/component.cjs +0 -60
- package/build/avatar-group/component.cjs.map +0 -7
- package/build/avatar-group/index.cjs +0 -37
- package/build/avatar-group/index.cjs.map +0 -7
- package/build/avatar-group/types.cjs +0 -19
- package/build/avatar-group/types.cjs.map +0 -7
- package/build-module/avatar/component.mjs +0 -68
- package/build-module/avatar/component.mjs.map +0 -7
- package/build-module/avatar/index.mjs +0 -6
- package/build-module/avatar/index.mjs.map +0 -7
- package/build-module/avatar/types.mjs +0 -1
- package/build-module/avatar/types.mjs.map +0 -7
- package/build-module/avatar-group/component.mjs +0 -29
- package/build-module/avatar-group/component.mjs.map +0 -7
- package/build-module/avatar-group/index.mjs +0 -6
- package/build-module/avatar-group/index.mjs.map +0 -7
- package/build-module/avatar-group/types.mjs +0 -1
- package/build-module/avatar-group/types.mjs.map +0 -7
- package/build-types/avatar/component.d.ts +0 -5
- package/build-types/avatar/component.d.ts.map +0 -1
- package/build-types/avatar/index.d.ts +0 -3
- package/build-types/avatar/index.d.ts.map +0 -1
- package/build-types/avatar/types.d.ts +0 -59
- package/build-types/avatar/types.d.ts.map +0 -1
- package/build-types/avatar-group/component.d.ts +0 -8
- package/build-types/avatar-group/component.d.ts.map +0 -1
- package/build-types/avatar-group/index.d.ts +0 -3
- package/build-types/avatar-group/index.d.ts.map +0 -1
- package/build-types/avatar-group/types.d.ts +0 -14
- package/build-types/avatar-group/types.d.ts.map +0 -1
- package/src/avatar/component.tsx +0 -82
- package/src/avatar/index.ts +0 -2
- package/src/avatar/styles.scss +0 -152
- package/src/avatar/types.ts +0 -59
- package/src/avatar-group/component.tsx +0 -46
- package/src/avatar-group/index.ts +0 -2
- package/src/avatar-group/styles.scss +0 -32
- package/src/avatar-group/types.ts +0 -13
package/src/avatar/types.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { IconType } from '../icon';
|
|
2
|
-
|
|
3
|
-
export type AvatarProps = {
|
|
4
|
-
/**
|
|
5
|
-
* URL of the avatar image.
|
|
6
|
-
*
|
|
7
|
-
* When not provided, initials derived from `name` are shown.
|
|
8
|
-
*/
|
|
9
|
-
src?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Name of the user. Used as an accessible label and to generate
|
|
12
|
-
* initials when no image is provided.
|
|
13
|
-
*/
|
|
14
|
-
name?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Visible text shown in the hover badge. When not provided, `name`
|
|
17
|
-
* is used instead. Use this to provide contextual labels like "You"
|
|
18
|
-
* without affecting the accessible name or initials.
|
|
19
|
-
*/
|
|
20
|
-
label?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Whether to show the hover-expand badge that reveals the user's
|
|
23
|
-
* name (or `label`) on hover. Requires `name` to be set.
|
|
24
|
-
*
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
27
|
-
badge?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Size of the avatar.
|
|
30
|
-
*
|
|
31
|
-
* - `'default'`: 32px
|
|
32
|
-
* - `'small'`: 24px
|
|
33
|
-
*
|
|
34
|
-
* @default 'default'
|
|
35
|
-
*/
|
|
36
|
-
size?: 'default' | 'small';
|
|
37
|
-
/**
|
|
38
|
-
* CSS color value for an accent border ring around the avatar.
|
|
39
|
-
*
|
|
40
|
-
* When not provided, no border is rendered and the hover badge
|
|
41
|
-
* and avatar status uses the admin theme color as its background.
|
|
42
|
-
*/
|
|
43
|
-
borderColor?: string;
|
|
44
|
-
/**
|
|
45
|
-
* A status string applied to the avatar. When set, the image is
|
|
46
|
-
* dimmed to indicate a non-default state. A corresponding
|
|
47
|
-
* `is-{status}` class is added for custom styling.
|
|
48
|
-
*/
|
|
49
|
-
status?: string;
|
|
50
|
-
/**
|
|
51
|
-
* An icon or custom component rendered as a centered overlay on the
|
|
52
|
-
* avatar image. Only visible when `status` is set.
|
|
53
|
-
*
|
|
54
|
-
* Accepts any value supported by the `Icon` component: an icon from
|
|
55
|
-
* `@wordpress/icons`, a Dashicon name string, a component, or a
|
|
56
|
-
* JSX element.
|
|
57
|
-
*/
|
|
58
|
-
statusIndicator?: IconType | null;
|
|
59
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { Children } from '@wordpress/element';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import type { AvatarGroupProps } from './types';
|
|
15
|
-
import type { WordPressComponentProps } from '../context';
|
|
16
|
-
|
|
17
|
-
function AvatarGroup( {
|
|
18
|
-
className,
|
|
19
|
-
max = 3,
|
|
20
|
-
children,
|
|
21
|
-
...props
|
|
22
|
-
}: WordPressComponentProps< AvatarGroupProps, 'div', false > ) {
|
|
23
|
-
const childArray = Children.toArray( children );
|
|
24
|
-
const visible = childArray.slice( 0, max );
|
|
25
|
-
const overflowCount = childArray.length - max;
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<div
|
|
29
|
-
role="group"
|
|
30
|
-
className={ clsx( 'components-avatar-group', className ) }
|
|
31
|
-
{ ...props }
|
|
32
|
-
>
|
|
33
|
-
{ visible }
|
|
34
|
-
{ overflowCount > 0 && (
|
|
35
|
-
<span
|
|
36
|
-
className="components-avatar-group__overflow"
|
|
37
|
-
aria-label={ `${ overflowCount } more` }
|
|
38
|
-
>
|
|
39
|
-
{ `+${ overflowCount }` }
|
|
40
|
-
</span>
|
|
41
|
-
) }
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default AvatarGroup;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
@use "@wordpress/base-styles/colors" as *;
|
|
2
|
-
@use "@wordpress/base-styles/variables" as *;
|
|
3
|
-
|
|
4
|
-
.components-avatar-group {
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
|
|
8
|
-
// Overlap subsequent avatars.
|
|
9
|
-
> .components-avatar + .components-avatar {
|
|
10
|
-
margin-inline-start: -$grid-unit-10;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Stack earlier avatars on top of later ones so the overlap
|
|
14
|
-
// is visually correct, and elevate on hover for badge expansion.
|
|
15
|
-
> .components-avatar {
|
|
16
|
-
position: relative;
|
|
17
|
-
|
|
18
|
-
@for $i from 1 through 10 {
|
|
19
|
-
&:nth-child(#{$i}) {
|
|
20
|
-
z-index: #{11 - $i};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.components-avatar-group__overflow {
|
|
27
|
-
margin-inline-start: $grid-unit-05;
|
|
28
|
-
font-size: $font-size-small;
|
|
29
|
-
line-height: $font-line-height-small;
|
|
30
|
-
color: $gray-900;
|
|
31
|
-
white-space: nowrap;
|
|
32
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type AvatarGroupProps = {
|
|
2
|
-
/**
|
|
3
|
-
* Maximum number of avatars to display before showing an
|
|
4
|
-
* overflow indicator.
|
|
5
|
-
*
|
|
6
|
-
* @default 3
|
|
7
|
-
*/
|
|
8
|
-
max?: number;
|
|
9
|
-
/**
|
|
10
|
-
* Avatar elements to display in the group.
|
|
11
|
-
*/
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
};
|