@ssa-ui-kit/core 2.28.3 → 2.29.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.
@@ -1,4 +1,4 @@
1
1
  import { DropdownOptionProps } from '../DropdownOptions/types';
2
2
  import { DropdownProps } from './types';
3
- declare const Dropdown: <T extends DropdownOptionProps>({ selectedItem, isDisabled, isOpen: isInitOpen, children, onChange: handleChange, className, placeholder, }: DropdownProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
3
+ declare const Dropdown: <T extends DropdownOptionProps>({ selectedItem, isDisabled, isOpen: isInitOpen, children, onChange: handleChange, className, placeholder, dropdownProps: componentProps, }: DropdownProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
4
  export default Dropdown;
@@ -1,5 +1,8 @@
1
+ import React from 'react';
1
2
  import { DropdownOptionProps } from '../DropdownOptions';
2
3
  import { CommonProps } from '../../types/emotion';
4
+ import { IconProps } from '../Icon/types';
5
+ export type ControlledButtonProps = 'onClick' | 'onFocus' | 'disabled' | 'type' | 'role' | 'aria-expanded' | 'aria-haspopup' | 'aria-labelledby' | 'aria-controls' | 'children';
3
6
  export interface DropdownProps<P extends DropdownOptionProps> extends CommonProps {
4
7
  selectedItem?: P;
5
8
  onChange?: (item: P) => void;
@@ -8,6 +11,11 @@ export interface DropdownProps<P extends DropdownOptionProps> extends CommonProp
8
11
  children?: React.ReactNode;
9
12
  className?: string;
10
13
  isOpen?: boolean;
14
+ dropdownProps?: {
15
+ base?: React.HTMLAttributes<HTMLDivElement>;
16
+ toggleButton?: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, ControlledButtonProps>;
17
+ toggleButtonArrow?: Omit<IconProps, 'name' | 'size'>;
18
+ };
11
19
  }
12
20
  export interface DropdownContextType {
13
21
  onChange: (item?: string) => void;
@@ -3,7 +3,8 @@ export declare const DropdownArrowBase: import("@emotion/styled").StyledComponen
3
3
  theme?: import("@emotion/react").Theme;
4
4
  as?: React.ElementType;
5
5
  } & CommonProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
- declare const DropdownArrow: ({ isUp }: {
6
+ interface DropdownArrowProps extends CommonProps {
7
7
  isUp: boolean;
8
- }) => import("@emotion/react/jsx-runtime").JSX.Element;
8
+ }
9
+ declare const DropdownArrow: ({ isUp, ...restProps }: DropdownArrowProps) => import("@emotion/react/jsx-runtime").JSX.Element;
9
10
  export default DropdownArrow;
@@ -2,6 +2,6 @@ import { DropdownToggleProps } from './types';
2
2
  export declare const DropdownToggleBase: import("@emotion/styled").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme;
4
4
  as?: React.ElementType;
5
- } & Pick<DropdownToggleProps, "colors" | "disabled" | "isOpen" | "isMultiple" | "selectedCount">, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
6
- declare const DropdownToggle: ({ onClick, onFocus, isOpen, isMultiple, selectedCount, disabled, children, ariaLabelledby, ariaControls, colors, className, }: DropdownToggleProps) => import("@emotion/react/jsx-runtime").JSX.Element;
5
+ } & Pick<DropdownToggleProps, "colors" | "disabled" | "isMultiple" | "isOpen" | "selectedCount">, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
6
+ declare const DropdownToggle: ({ onClick, onFocus, isOpen, isMultiple, selectedCount, disabled, children, ariaLabelledby, ariaControls, colors, className, ...restProps }: DropdownToggleProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
7
  export default DropdownToggle;
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Theme } from '@emotion/react';
3
3
  import { CommonProps } from '../../types/emotion';
4
- export interface DropdownToggleProps extends CommonProps {
4
+ import { ControlledButtonProps } from '../Dropdown/types';
5
+ export interface DropdownToggleProps extends CommonProps, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, ControlledButtonProps> {
5
6
  onClick: (e: React.MouseEvent<HTMLElement>) => void;
6
7
  onFocus: (e: React.FocusEvent<HTMLButtonElement, Element>) => void;
7
8
  isOpen: boolean;
@@ -1,2 +1,2 @@
1
1
  import { UserProfileProps } from './types';
2
- export declare const UserProfile: ({ name, email, trigger, onClick, logOutText, className, }: UserProfileProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare const UserProfile: ({ name, email, trigger, onClick, logOutText, className, additionalInfo, customContent, }: UserProfileProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -4,3 +4,29 @@ export declare const ContentWrapper: (theme: Theme) => import("@emotion/react").
4
4
  export declare const UserInfo: import("@emotion/react").SerializedStyles;
5
5
  export declare const LogoutWrapper: (theme: Theme) => import("@emotion/react").SerializedStyles;
6
6
  export declare const CustomButton: import("@emotion/react").SerializedStyles;
7
+ export declare const AdditionalInfoWrapper: import("@emotion/styled").StyledComponent<{
8
+ theme?: Theme;
9
+ as?: React.ElementType;
10
+ } & {
11
+ avatarSize?: number;
12
+ direction?: string;
13
+ alignItems?: string;
14
+ fade?: boolean;
15
+ fadeDelay?: number;
16
+ isVisible?: boolean;
17
+ } & import("../..").CommonProps & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
18
+ theme?: Theme;
19
+ }, {}, {}>;
20
+ export declare const CustomContentWrapper: import("@emotion/styled").StyledComponent<{
21
+ theme?: Theme;
22
+ as?: React.ElementType;
23
+ } & {
24
+ avatarSize?: number;
25
+ direction?: string;
26
+ alignItems?: string;
27
+ fade?: boolean;
28
+ fadeDelay?: number;
29
+ isVisible?: boolean;
30
+ } & import("../..").CommonProps & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
31
+ theme?: Theme;
32
+ }, {}, {}>;
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface UserProfileProps {
2
3
  name: string;
3
4
  email: string;
@@ -5,4 +6,6 @@ export interface UserProfileProps {
5
6
  onClick: () => void;
6
7
  logOutText?: string;
7
8
  className?: string;
9
+ additionalInfo?: ReactNode[];
10
+ customContent?: ReactNode;
8
11
  }
package/dist/index.js CHANGED
@@ -4645,8 +4645,10 @@ const DropdownToggle = ({
4645
4645
  ariaLabelledby,
4646
4646
  ariaControls,
4647
4647
  colors,
4648
- className
4648
+ className,
4649
+ ...restProps
4649
4650
  }) => (0,jsx_runtime_namespaceObject.jsx)(DropdownToggleBase, {
4651
+ ...restProps,
4650
4652
  className: className,
4651
4653
  colors: colors,
4652
4654
  isOpen: isOpen,
@@ -4682,9 +4684,11 @@ const DropdownArrowBase = /*#__PURE__*/base_default()("div", true ? {
4682
4684
  styles: "display:flex;align-items:center"
4683
4685
  } : 0);
4684
4686
  const DropdownArrow = ({
4685
- isUp
4687
+ isUp,
4688
+ ...restProps
4686
4689
  }) => (0,jsx_runtime_namespaceObject.jsx)(DropdownArrowBase, {
4687
4690
  children: (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
4691
+ ...restProps,
4688
4692
  name: `carrot-${isUp ? 'up' : 'down'}`,
4689
4693
  size: 12
4690
4694
  })
@@ -4831,7 +4835,8 @@ const Dropdown = ({
4831
4835
  children,
4832
4836
  onChange: handleChange,
4833
4837
  className,
4834
- placeholder = 'Select something'
4838
+ placeholder = 'Select something',
4839
+ dropdownProps: componentProps
4835
4840
  }) => {
4836
4841
  const theme = (0,react_namespaceObject.useTheme)();
4837
4842
  const dropdownRef = (0,external_react_namespaceObject.useRef)(null);
@@ -4890,9 +4895,11 @@ const Dropdown = ({
4890
4895
  return (0,jsx_runtime_namespaceObject.jsx)(Dropdown_context.Provider, {
4891
4896
  value: contextValue,
4892
4897
  children: (0,jsx_runtime_namespaceObject.jsxs)(DropdownBase, {
4898
+ ...componentProps?.base,
4893
4899
  ref: dropdownRef,
4894
4900
  "data-testid": "dropdown",
4895
4901
  children: [(0,jsx_runtime_namespaceObject.jsxs)(DropdownToggle_DropdownToggle, {
4902
+ ...componentProps?.toggleButton,
4896
4903
  className: className,
4897
4904
  isOpen: isOpen,
4898
4905
  disabled: isDisabled,
@@ -4902,6 +4909,7 @@ const Dropdown = ({
4902
4909
  ariaLabelledby: `dropdown-label-${dropdownId}`,
4903
4910
  ariaControls: `dropdown-popup-${dropdownId}`,
4904
4911
  children: [value, (0,jsx_runtime_namespaceObject.jsx)(DropdownArrow_DropdownArrow, {
4912
+ ...componentProps?.toggleButtonArrow,
4905
4913
  isUp: isOpen
4906
4914
  })]
4907
4915
  }), isOpen ? (0,jsx_runtime_namespaceObject.jsx)(DropdownOptions_DropdownOptions, {
@@ -19738,22 +19746,36 @@ const highlightInputMatch = (item, keyword) => {
19738
19746
 
19739
19747
 
19740
19748
  ;// ./src/components/UserProfile/styles.ts
19749
+
19741
19750
  function UserProfile_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
19742
19751
 
19752
+
19743
19753
  const styles_ResetBtnStyles = true ? {
19744
19754
  name: "2hrei",
19745
19755
  styles: "padding:0;height:auto;background:none;&:focus,&:hover{border:none;background:none;box-shadow:none;&::before{border:none;}}"
19746
19756
  } : 0;
19747
- const styles_ContentWrapper = theme => /*#__PURE__*/(0,react_namespaceObject.css)("width:224px;background:", theme.colors.greyPopoverLight, ";border-radius:20px;box-shadow:0px 4px 15px 0px ", theme.colors.black25, ";" + ( true ? "" : 0), true ? "" : 0);
19757
+ const styles_ContentWrapper = theme => /*#__PURE__*/(0,react_namespaceObject.css)("width:224px;background:", theme.colors.greyPopoverLight, ";border-radius:20px;box-shadow:0 4px 15px 0 ", theme.colors.black25, ";" + ( true ? "" : 0), true ? "" : 0);
19748
19758
  const UserInfo = true ? {
19749
19759
  name: "fwy071",
19750
19760
  styles: "gap:2px;width:100%;padding:10px"
19751
19761
  } : 0;
19752
- const LogoutWrapper = theme => /*#__PURE__*/(0,react_namespaceObject.css)("width:100%;padding:10px 10px 18px 10px;border-top:0.4px solid ", theme.colors.greyGraphite70, ";" + ( true ? "" : 0), true ? "" : 0);
19762
+ const LogoutWrapper = theme => /*#__PURE__*/(0,react_namespaceObject.css)("width:100%;padding:10px 10px 18px 10px;border-top:0.5px solid ", theme.colors.greyGraphite70, ";" + ( true ? "" : 0), true ? "" : 0);
19753
19763
  const CustomButton = true ? {
19754
19764
  name: "1t1u438",
19755
19765
  styles: "justify-content:center;gap:8px;width:100%;padding:8px;font-size:14px;line-height:19px;font-weight:500"
19756
19766
  } : 0;
19767
+ const AdditionalInfoWrapper = /*#__PURE__*/base_default()(Wrapper_Wrapper, true ? {
19768
+ target: "e13e77x11"
19769
+ } : 0)("flex-direction:column;align-items:flex-start;margin-top:4px;font-size:14px;font-weight:400;color:", ({
19770
+ theme
19771
+ }) => theme.colors.greyDropdownFocused, ";" + ( true ? "" : 0));
19772
+ const CustomContentWrapper = /*#__PURE__*/base_default()(Wrapper_Wrapper, true ? {
19773
+ target: "e13e77x10"
19774
+ } : 0)("width:100%;padding:10px;border-top:0.5px solid ", ({
19775
+ theme
19776
+ }) => theme.colors.greyGraphite70, ";border-bottom:0.5px solid ", ({
19777
+ theme
19778
+ }) => theme.colors.greyGraphite70, ";" + ( true ? "" : 0));
19757
19779
  ;// ./src/components/UserProfile/UserProfile.tsx
19758
19780
  function UserProfile_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
19759
19781
 
@@ -19772,7 +19794,9 @@ const UserProfile = ({
19772
19794
  trigger,
19773
19795
  onClick,
19774
19796
  logOutText = 'Log Out',
19775
- className
19797
+ className,
19798
+ additionalInfo,
19799
+ customContent
19776
19800
  }) => {
19777
19801
  const theme = (0,react_namespaceObject.useTheme)();
19778
19802
  return (0,jsx_runtime_namespaceObject.jsxs)(Popover, {
@@ -19795,7 +19819,13 @@ const UserProfile = ({
19795
19819
  weight: "regular",
19796
19820
  color: theme.colors.greyDropdownFocused,
19797
19821
  children: email
19822
+ }), additionalInfo && additionalInfo.length > 0 && (0,jsx_runtime_namespaceObject.jsx)(AdditionalInfoWrapper, {
19823
+ children: additionalInfo.map((item, index) => (0,jsx_runtime_namespaceObject.jsx)("div", {
19824
+ children: item
19825
+ }, index))
19798
19826
  })]
19827
+ }), customContent && (0,jsx_runtime_namespaceObject.jsx)(CustomContentWrapper, {
19828
+ children: customContent
19799
19829
  }), (0,jsx_runtime_namespaceObject.jsx)("div", {
19800
19830
  css: LogoutWrapper,
19801
19831
  children: (0,jsx_runtime_namespaceObject.jsxs)(Button_Button, {