@automattic/vip-design-system 2.12.0 → 2.12.2

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.
@@ -2,6 +2,7 @@
2
2
  import React from 'react';
3
3
  export interface DropdownContentProps {
4
4
  className?: string;
5
+ align?: 'start' | 'center' | 'end';
5
6
  }
6
7
  export declare const styles: {
7
8
  minWidth: number;
@@ -1,4 +1,4 @@
1
- var _excluded = ["className"],
1
+ var _excluded = ["className", "align"],
2
2
  _excluded2 = ["className"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -18,11 +18,14 @@ export var styles = {
18
18
  };
19
19
  export var DropdownContent = /*#__PURE__*/React.forwardRef(function (_ref, forwardRef) {
20
20
  var className = _ref.className,
21
+ _ref$align = _ref.align,
22
+ align = _ref$align === void 0 ? 'center' : _ref$align,
21
23
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
22
24
  return _jsx(DropdownMenuPrimitive.DropdownMenuContent, _extends({
23
25
  className: classNames('vip-dropdown-menu-content', className),
24
26
  ref: forwardRef,
25
- sx: styles
27
+ sx: styles,
28
+ align: align
26
29
  }, props));
27
30
  });
28
31
  DropdownContent.displayName = 'DropdownContent';
@@ -1,5 +1,6 @@
1
1
  /** @jsxImportSource theme-ui */
2
2
  import React from 'react';
3
+ import { DropdownContentProps } from '../Dropdown/DropdownContent';
3
4
  import { DropdownCheckboxItemProps } from '../Dropdown/DropdownItem';
4
5
  export type FilterDropdownCheckItemProps = DropdownCheckboxItemProps & {
5
6
  checked: boolean;
@@ -23,5 +24,6 @@ export type FilterDropdownProps = {
23
24
  label?: React.ReactNode | string;
24
25
  onSelect: (filter: FilterDropDownFilterProp, key: string) => void;
25
26
  defaultValue?: string | null;
27
+ contentProps?: DropdownContentProps;
26
28
  };
27
- export declare const FilterDropdown: ({ className, filters, label, onSelect, defaultValue, }: FilterDropdownProps) => React.JSX.Element;
29
+ export declare const FilterDropdown: ({ className, filters, label, onSelect, defaultValue, contentProps, }: FilterDropdownProps) => React.JSX.Element;
@@ -33,7 +33,9 @@ export var FilterDropdown = function FilterDropdown(_ref2) {
33
33
  label = _ref2.label,
34
34
  onSelect = _ref2.onSelect,
35
35
  _ref2$defaultValue = _ref2.defaultValue,
36
- defaultValue = _ref2$defaultValue === void 0 ? null : _ref2$defaultValue;
36
+ defaultValue = _ref2$defaultValue === void 0 ? null : _ref2$defaultValue,
37
+ _ref2$contentProps = _ref2.contentProps,
38
+ contentProps = _ref2$contentProps === void 0 ? {} : _ref2$contentProps;
37
39
  var translate = useTranslate();
38
40
  var filterKeys = Object.keys(filters);
39
41
  var firstFilter = filterKeys[0];
@@ -41,6 +43,7 @@ export var FilterDropdown = function FilterDropdown(_ref2) {
41
43
  filter = _useState[0],
42
44
  setFilter = _useState[1];
43
45
  return _jsx(Dropdown.Root, {
46
+ contentProps: contentProps,
44
47
  trigger: _jsxs(Button, {
45
48
  className: classNames('vip-filter-dropdown-trigger', className),
46
49
  variant: "secondary",
@@ -4,7 +4,7 @@ import { FilterDropdown } from './FilterDropdown';
4
4
  import type { StoryObj } from '@storybook/react';
5
5
  declare const _default: {
6
6
  title: string;
7
- component: ({ className, filters, label, onSelect, defaultValue, }: import("./FilterDropdown").FilterDropdownProps) => import("react").JSX.Element;
7
+ component: ({ className, filters, label, onSelect, defaultValue, contentProps, }: import("./FilterDropdown").FilterDropdownProps) => import("react").JSX.Element;
8
8
  parameters: {
9
9
  docs: {
10
10
  description: {
@@ -80,9 +80,8 @@ export var Snackbar = /*#__PURE__*/React.forwardRef(function (_ref2, forwardRef)
80
80
  variant: "notice",
81
81
  sx: _extends({
82
82
  p: 4,
83
- boxShadow: 'none',
83
+ boxShadow: 'low',
84
84
  bg: 'snackbar.background',
85
- border: '1px solid',
86
85
  borderRadius: 1,
87
86
  color: 'snackbar.text',
88
87
  fontSize: 2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip-design-system",
3
- "version": "2.12.0",
3
+ "version": "2.12.2",
4
4
  "main": "build/system/index.js",
5
5
  "scripts": {
6
6
  "build-storybook": "storybook build",
@@ -6,6 +6,7 @@ import React from 'react';
6
6
 
7
7
  export interface DropdownContentProps {
8
8
  className?: string;
9
+ align?: 'start' | 'center' | 'end';
9
10
  }
10
11
 
11
12
  export const styles = {
@@ -18,11 +19,12 @@ export const styles = {
18
19
  };
19
20
 
20
21
  export const DropdownContent = React.forwardRef< HTMLDivElement, DropdownContentProps >(
21
- ( { className, ...props }, forwardRef ) => (
22
+ ( { className, align = 'center', ...props }, forwardRef ) => (
22
23
  <DropdownMenuPrimitive.DropdownMenuContent
23
24
  className={ classNames( 'vip-dropdown-menu-content', className ) }
24
25
  ref={ forwardRef }
25
26
  sx={ styles }
27
+ align={ align }
26
28
  { ...props }
27
29
  />
28
30
  )
@@ -7,6 +7,7 @@ import { MdCheck, MdKeyboardArrowDown } from 'react-icons/md';
7
7
 
8
8
  import { Button } from '../Button';
9
9
  import * as Dropdown from '../Dropdown';
10
+ import { DropdownContentProps } from '../Dropdown/DropdownContent';
10
11
  import { DropdownCheckboxItemProps } from '../Dropdown/DropdownItem';
11
12
  import ScreenReaderText from '../ScreenReaderText';
12
13
 
@@ -43,6 +44,7 @@ export type FilterDropdownProps = {
43
44
  label?: React.ReactNode | string;
44
45
  onSelect: ( filter: FilterDropDownFilterProp, key: string ) => void;
45
46
  defaultValue?: string | null;
47
+ contentProps?: DropdownContentProps;
46
48
  };
47
49
 
48
50
  export const FilterDropdown = ( {
@@ -51,6 +53,7 @@ export const FilterDropdown = ( {
51
53
  label,
52
54
  onSelect,
53
55
  defaultValue = null,
56
+ contentProps = {},
54
57
  }: FilterDropdownProps ) => {
55
58
  const translate = useTranslate();
56
59
  const filterKeys = Object.keys( filters );
@@ -59,6 +62,7 @@ export const FilterDropdown = ( {
59
62
 
60
63
  return (
61
64
  <Dropdown.Root
65
+ contentProps={ contentProps }
62
66
  trigger={
63
67
  <Button
64
68
  className={ classNames( 'vip-filter-dropdown-trigger', className ) }
@@ -88,9 +88,8 @@ export const Snackbar = React.forwardRef< HTMLDivElement, SnackbarProps >(
88
88
  variant="notice"
89
89
  sx={ {
90
90
  p: 4,
91
- boxShadow: 'none',
91
+ boxShadow: 'low',
92
92
  bg: 'snackbar.background',
93
- border: '1px solid',
94
93
  borderRadius: 1,
95
94
  color: 'snackbar.text',
96
95
  fontSize: 2,