@croquiscom/pds 8.22.1 → 8.22.3

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @croquiscom/pds
2
2
 
3
+ ## 8.22.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 6b5d323: FormField 컴포넌트 사용 패턴 개선(status를 공유하는 형태로 제공)
8
+
9
+ ## 8.22.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 9c8c44e: DropdownItem transition 반영, selected 스타일적용되지 않는 이슈 수정
14
+
3
15
  ## 8.22.1
4
16
 
5
17
  ### Patch Changes
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof Dropdown>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Dropdown>;
6
6
  export declare const Base: Story;
7
+ export declare const NoOptions: Story;
7
8
  export declare const Error: Story;
8
9
  export declare const Flip: Story;
9
10
  export declare const WithFormHelperText: Story;
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode, CSSProperties } from 'react';
2
- import { ExtendedRefs, FloatingContext, MiddlewareData } from '@floating-ui/react';
2
+ import { ExtendedRefs, FloatingContext } from '@floating-ui/react';
3
3
  import { InputSize } from '../input/types';
4
4
  import { AriaFocusProps } from '../../types/common';
5
5
  import { DropdownOption } from '../dropdown';
@@ -10,10 +10,10 @@ export interface PopoverContentProps<OptionValue> {
10
10
  * @default 1030
11
11
  */
12
12
  zIndex?: number;
13
+ hasNoData?: boolean;
13
14
  /** @default large */
15
+ initialFocus?: number;
14
16
  size?: InputSize;
15
- /** @default false */
16
- opened: boolean;
17
17
  options: Array<DropdownOption<OptionValue>>;
18
18
  placeholder?: string;
19
19
  value?: OptionValue;
@@ -27,7 +27,6 @@ export interface PopoverContentProps<OptionValue> {
27
27
  context: FloatingContext;
28
28
  floatingStyles: CSSProperties;
29
29
  refs: ExtendedRefs<Element>;
30
- hide: MiddlewareData['hide'];
31
30
  setRefs: (node: HTMLElement | null, index: number) => void;
32
31
  }
33
- export declare const DropdownOptions: <OptionValue extends string | number>({ className, zIndex, size: sizeProp, options, opened, onClose, value: valueProp, unstableFocusVisible, keyExtractor, onChange, focusIndex, context, getFloatingProps, getItemProps, floatingStyles, refs, hide, setRefs, }: PopoverContentProps<OptionValue> & AriaFocusProps) => React.JSX.Element;
32
+ export declare const DropdownOptions: <OptionValue extends string | number>({ className, zIndex, size: sizeProp, initialFocus, options, onClose, hasNoData, value: valueProp, unstableFocusVisible, keyExtractor, onChange, focusIndex, context, getFloatingProps, getItemProps, floatingStyles, refs, setRefs, }: PopoverContentProps<OptionValue> & AriaFocusProps) => React.JSX.Element;
@@ -1,11 +1,18 @@
1
- import React, { ReactNode, PropsWithChildren } from 'react';
1
+ import React, { ReactNode, PropsWithChildren, ReactElement } from 'react';
2
2
  import { HelpTextProps } from '../text';
3
3
  import { VerticalAlignment } from '../stack';
4
4
  import { CSSValueWithLength } from '../../styles';
5
+ import { InputStatus } from '../input/types';
5
6
  type FormFieldAlignment = Extract<VerticalAlignment, 'top' | 'center'>;
6
7
  type FormFieldPosition = 'left' | 'top';
7
8
  export interface FormFieldProps {
8
9
  className?: string;
10
+ /**
11
+ * FormField의 상태를 지정하면 children과 formHelperText 상태를 공유합니다.
12
+ * PDS의 Input, Dropdown, DropdownInput, NumericInput 컴포넌트만 공유하도록 제한합니다.
13
+ * 다른 컴포넌트는 사용하더라도 formHelperText에만 status가 적용됩니다.
14
+ */
15
+ status?: InputStatus;
9
16
  label?: ReactNode;
10
17
  /**
11
18
  * 라벨 우측 렌더링될 Addon 요소
@@ -20,7 +27,7 @@ export interface FormFieldProps {
20
27
  */
21
28
  helper?: HelpTextProps;
22
29
  /**
23
- * FormHelperText 컴포넌트로 라벨 아래에 메세지를 표시합니다.
30
+ * FormHelperText 컴포넌트로 children 아래에 메세지를 표시합니다.
24
31
  */
25
32
  formHelperText?: ReactNode;
26
33
  /**
@@ -39,6 +46,9 @@ export interface FormFieldProps {
39
46
  * @default left
40
47
  */
41
48
  position?: FormFieldPosition;
49
+ children?: ReactElement<{
50
+ status?: InputStatus;
51
+ }>;
42
52
  }
43
- export declare const FormField: ({ className, label, rightAddon, required, helper, formHelperText, labelWidth, alignment, position, children, }: PropsWithChildren<FormFieldProps>) => React.JSX.Element;
53
+ export declare const FormField: ({ className, label, status, rightAddon, required, helper, formHelperText, labelWidth, alignment, position, children, }: PropsWithChildren<FormFieldProps>) => React.JSX.Element;
44
54
  export {};
@@ -10,7 +10,9 @@ export declare const WithCheckboxGroup: Story;
10
10
  export declare const WithHelpPopover: Story;
11
11
  export declare const TopAlign: Story;
12
12
  export declare const TopPosition: Story;
13
+ export declare const SuccessCheckboxGroup: Story;
13
14
  export declare const Error: Story;
15
+ export declare const ErrorDropdown: Story;
14
16
  export declare const ErrorLongLabel: Story;
15
17
  export declare const ErrorOverflowLabel: Story;
16
18
  export declare const ErrorTop: Story;