@wavv/ui 2.4.8-alpha.3 → 2.4.8-alpha.5

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.
@@ -427,7 +427,7 @@ declare const Accordion: {
427
427
  className?: import("react-aria-components").DisclosurePanelProps["className"];
428
428
  style?: import("react-aria-components").DisclosurePanelProps["style"];
429
429
  background?: string;
430
- } & MaxHeight & import("react-aria-components").DisclosurePanelProps): import("react/jsx-runtime").JSX.Element;
430
+ } & MaxHeight & import("../types").Padding & import("react-aria-components").DisclosurePanelProps): import("react/jsx-runtime").JSX.Element;
431
431
  displayName: string;
432
432
  };
433
433
  };
@@ -1,11 +1,11 @@
1
1
  import { type DisclosurePanelProps } from 'react-aria-components';
2
- import type { MaxHeight } from '../types';
2
+ import type { MaxHeight, Padding } from '../types';
3
3
  type PanelProps = {
4
4
  children: DisclosurePanelProps['children'];
5
5
  className?: DisclosurePanelProps['className'];
6
6
  style?: DisclosurePanelProps['style'];
7
7
  background?: string;
8
- } & MaxHeight & DisclosurePanelProps;
8
+ } & MaxHeight & Padding & DisclosurePanelProps;
9
9
  declare const Panel: {
10
10
  ({ children, maxHeight, ...props }: PanelProps): import("react/jsx-runtime").JSX.Element;
11
11
  displayName: string;
@@ -4,6 +4,7 @@ import { useRef, useState } from "react";
4
4
  import { DisclosurePanel } from "react-aria-components";
5
5
  import { useElementObserver } from "../../hooks/index.js";
6
6
  import isPropAllowed from "../helpers/isPropAllowed.js";
7
+ import { paddingProps } from "../helpers/styledProps.js";
7
8
  const Panel = ({ children, maxHeight, ...props })=>{
8
9
  const contentRef = useRef(null);
9
10
  const [calculatedMaxHeight, setCalculatedMaxHeight] = useState();
@@ -42,7 +43,10 @@ const PanelContainer = styled(DisclosurePanel, {
42
43
  'defaultPadding',
43
44
  'maxHeight'
44
45
  ])
45
- })(({ theme, maxHeight, defaultPadding, background })=>({
46
+ })(({ theme, maxHeight, defaultPadding, background, ...props })=>{
47
+ const hasPaddingProps = void 0 !== props.padding || void 0 !== props.paddingTop || void 0 !== props.paddingBottom || void 0 !== props.paddingRight || void 0 !== props.paddingLeft;
48
+ const paddingValue = !hasPaddingProps && defaultPadding ? '8px 16px' : void 0;
49
+ return {
46
50
  backgroundColor: background || theme.scale0,
47
51
  color: theme.scale10,
48
52
  fontSize: theme.font.size.md,
@@ -56,9 +60,13 @@ const PanelContainer = styled(DisclosurePanel, {
56
60
  opacity: 0
57
61
  },
58
62
  '&[aria-hidden="false"]': {
59
- padding: defaultPadding ? '8px 16px' : void 0
63
+ ...paddingProps({
64
+ padding: paddingValue,
65
+ ...props
66
+ })
60
67
  }
61
- }));
68
+ };
69
+ });
62
70
  Panel.displayName = 'Accordion.Panel';
63
71
  const Accordion_Panel = Panel;
64
72
  export { Accordion_Panel as default };
@@ -64,14 +64,27 @@ type BaseSelectInputProps = {
64
64
  after?: ReactNode;
65
65
  maxHeight?: PopoverProps['maxHeight'];
66
66
  } & Omit<InputProps, 'iconRight'> & ShowHideCallbacks & Pick<PopoverProps, 'maxHeight'>;
67
- export type SelectInputProps = BaseSelectInputProps & {
67
+ type SingleSelectInputProps = BaseSelectInputProps & {
68
+ /** The selection mode for the select */
69
+ selectionMode?: 'single';
70
+ /** The controlled value of the input */
71
+ value?: Key;
72
+ /** The uncontrolled initial value of the input */
73
+ defaultValue?: Key;
74
+ /** The function to be called when an option is selected */
75
+ onChange?: (key: string) => void;
76
+ };
77
+ type MultipleSelectInputProps = BaseSelectInputProps & {
78
+ /** The selection mode for the select */
79
+ selectionMode: 'multiple';
68
80
  /** The controlled value of the input */
69
81
  value?: Key | Key[];
70
82
  /** The uncontrolled initial value of the input */
71
83
  defaultValue?: Key | Key[];
72
- /** The function to be called when an option is selected */
73
- onChange?: (key: string | string[]) => void;
84
+ /** The function to be called when options are selected */
85
+ onChange?: (keys: string | string[]) => void;
74
86
  };
87
+ export type SelectInputProps = SingleSelectInputProps | MultipleSelectInputProps;
75
88
  export type ComboBoxInputProps = BaseSelectInputProps & {
76
89
  /** The controlled value of the input */
77
90
  value?: Key;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavv/ui",
3
- "version": "2.4.8-alpha.3",
3
+ "version": "2.4.8-alpha.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {