@croquiscom/pds 0.3.0 → 0.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.
@@ -1,9 +1,6 @@
1
1
  import React from 'react';
2
- import { InputProps } from './Input';
3
- declare const _default: {
4
- title: string;
5
- component: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
6
- };
2
+ import { ComponentMeta } from '@storybook/react';
3
+ declare const _default: ComponentMeta<React.ForwardRefExoticComponent<import("./Input").InputProps & React.RefAttributes<HTMLInputElement>>>;
7
4
  export default _default;
8
5
  export declare const Base: any;
9
6
  export declare const Error: any;
@@ -1,9 +1,7 @@
1
1
  import React from 'react';
2
+ import { ComponentMeta } from '@storybook/react';
2
3
  import { NumericInputProps } from './NumericInput';
3
- declare const _default: {
4
- title: string;
5
- component: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "width" | "onChange"> & import("./NumericInput").NumericInputBaseType & React.RefAttributes<HTMLInputElement>>;
6
- };
4
+ declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "width" | "onChange"> & import("./NumericInput").NumericInputBaseType & React.RefAttributes<HTMLInputElement>>>;
7
5
  export default _default;
8
6
  export declare const Base: any;
9
7
  export declare const Addon: any;
@@ -1,9 +1,14 @@
1
1
  import React, { InputHTMLAttributes } from 'react';
2
+ import { RadioItemType } from './RadioGroup';
2
3
  export interface RadioProps extends Exclude<InputHTMLAttributes<HTMLInputElement>, 'type'> {
3
4
  /**
4
5
  * @default false
5
6
  */
6
7
  fill?: boolean;
7
8
  className?: string;
9
+ /**
10
+ * @default default
11
+ */
12
+ radioItemType?: RadioItemType;
8
13
  }
9
14
  export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
- declare const _default: {
3
- title: string;
4
- component: React.ForwardRefExoticComponent<import("./Radio").RadioProps & React.RefAttributes<HTMLInputElement>>;
5
- };
2
+ import { ComponentMeta } from '@storybook/react';
3
+ declare const _default: ComponentMeta<React.ForwardRefExoticComponent<import("./Radio").RadioProps & React.RefAttributes<HTMLInputElement>>>;
6
4
  export default _default;
7
5
  export declare const Base: any;
8
6
  export declare const Checked: any;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- declare type AlignType = 'horizontal' | 'vertical';
2
+ export declare type AlignType = 'horizontal' | 'vertical';
3
+ export declare type RadioItemType = 'default' | 'box';
3
4
  interface RadioItem<RadioValue> {
4
5
  label: React.ReactNode;
5
6
  value: RadioValue;
@@ -11,9 +12,15 @@ export interface RadioGroupProps<RadioValue> {
11
12
  value?: RadioValue;
12
13
  name?: string;
13
14
  items: RadioItem<RadioValue>[];
15
+ /**
16
+ * @default 24
17
+ * radioItmType - 'box': spacing 속성 미적용
18
+ */
14
19
  spacing?: number;
15
20
  disabled?: boolean;
16
21
  align?: AlignType;
22
+ radioItemType?: RadioItemType;
23
+ keyExtractor?: (item: RadioItem<RadioValue>, index: number) => string | number;
17
24
  onChange?: (value: RadioValue) => void;
18
25
  }
19
26
  export interface RadioGroupInstance<RadioValue> {
@@ -1,13 +1,12 @@
1
1
  import React from 'react';
2
- declare const _default: {
3
- title: string;
4
- component: <RadioValue>(props: import("./RadioGroup").RadioGroupProps<RadioValue> & {
5
- ref?: React.Ref<import("./RadioGroup").RadioGroupInstance<RadioValue>>;
6
- }) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
7
- };
2
+ import { ComponentMeta } from '@storybook/react';
3
+ declare const _default: ComponentMeta<(<RadioValue>(props: import("./RadioGroup").RadioGroupProps<RadioValue> & {
4
+ ref?: React.Ref<import("./RadioGroup").RadioGroupInstance<RadioValue>>;
5
+ }) => React.ReactElement<any, string | React.JSXElementConstructor<any>>)>;
8
6
  export default _default;
9
7
  export declare const Base: any;
10
8
  export declare const Spacing: any;
11
9
  export declare const Disabled: any;
12
10
  export declare const VerticalAlign: any;
13
11
  export declare const Controlled: () => JSX.Element;
12
+ export declare const BoxRadio: () => JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { RadioItemType, AlignType } from './RadioGroup';
2
+ export declare const getRadioGroupStyleByProps: ({ radio_item_type, align, spacing, }: {
3
+ radio_item_type?: RadioItemType;
4
+ align?: AlignType;
5
+ spacing?: Number;
6
+ }) => import("@emotion/utils").SerializedStyles;
7
+ export declare const getRadioStyleByProps: ({ radio_item_type, fill, disabled, checked, }: {
8
+ radio_item_type?: RadioItemType;
9
+ fill?: boolean;
10
+ disabled?: boolean;
11
+ checked?: boolean;
12
+ }) => import("@emotion/utils").SerializedStyles;
@@ -1,11 +1,9 @@
1
1
  import React from 'react';
2
- declare const _default: {
3
- title: string;
4
- component: import("@emotion/styled").StyledComponent<{
5
- theme?: import("@emotion/react").Theme;
6
- as?: React.ElementType<any>;
7
- } & import("./HStack").HStackProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
8
- };
2
+ import { ComponentMeta } from '@storybook/react';
3
+ declare const _default: ComponentMeta<import("@emotion/styled").StyledComponent<{
4
+ theme?: import("@emotion/react").Theme;
5
+ as?: React.ElementType<any>;
6
+ } & import("./HStack").HStackProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>>;
9
7
  export default _default;
10
8
  export declare const Base: any;
11
9
  export declare const Spacing: any;
@@ -1,11 +1,9 @@
1
1
  import React from 'react';
2
- declare const _default: {
3
- title: string;
4
- component: import("@emotion/styled").StyledComponent<{
5
- theme?: import("@emotion/react").Theme;
6
- as?: React.ElementType<any>;
7
- } & import("./VStack").VStackProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
8
- };
2
+ import { ComponentMeta } from '@storybook/react';
3
+ declare const _default: ComponentMeta<import("@emotion/styled").StyledComponent<{
4
+ theme?: import("@emotion/react").Theme;
5
+ as?: React.ElementType<any>;
6
+ } & import("./VStack").VStackProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>>;
9
7
  export default _default;
10
8
  export declare const Base: any;
11
9
  export declare const Spacing: any;
@@ -0,0 +1,21 @@
1
+ import React, { ButtonHTMLAttributes } from 'react';
2
+ export declare type SwitchSize = 'small' | 'large';
3
+ export interface SwitchProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
+ /**
5
+ * @default true
6
+ */
7
+ isOn?: boolean;
8
+ /**
9
+ * @default small
10
+ */
11
+ size?: SwitchSize;
12
+ /**
13
+ * @default ON
14
+ */
15
+ onText?: string;
16
+ /**
17
+ * @default OFF
18
+ */
19
+ offText?: string;
20
+ }
21
+ export declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { ComponentMeta } from '@storybook/react';
3
+ declare const _default: ComponentMeta<React.ForwardRefExoticComponent<import("./Switch").SwitchProps & React.RefAttributes<HTMLButtonElement>>>;
4
+ export default _default;
5
+ export declare const Base: any;
@@ -0,0 +1 @@
1
+ export * from './Switch';
@@ -0,0 +1,4 @@
1
+ import { SwitchSize } from './Switch';
2
+ export declare const switch_base_css: import("@emotion/utils").SerializedStyles;
3
+ export declare const getStylesByActive: (isOn: boolean) => import("@emotion/utils").SerializedStyles;
4
+ export declare const getStyleByProps: (size: SwitchSize, isOn: boolean) => import("@emotion/utils").SerializedStyles;
@@ -1,9 +1,6 @@
1
1
  import React from 'react';
2
- import { BaseTextProps } from './BaseText';
3
- declare const _default: {
4
- title: string;
5
- component: React.FC<BaseTextProps & (React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> | React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement> | React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> | React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement> | React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>)>;
6
- };
2
+ import { ComponentMeta } from '@storybook/react';
3
+ declare const _default: ComponentMeta<React.FC<import("./BaseText").BaseTextProps & (React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> | React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement> | React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> | React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement> | React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>)>>;
7
4
  export default _default;
8
5
  export declare const Base: any;
9
6
  export declare const Alignment: any;
@@ -1,9 +1,6 @@
1
1
  import React from 'react';
2
- import { TextareaProps } from './Textarea';
3
- declare const _default: {
4
- title: string;
5
- component: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
6
- };
2
+ import { ComponentMeta } from '@storybook/react';
3
+ declare const _default: ComponentMeta<React.ForwardRefExoticComponent<import("./Textarea").TextareaProps & React.RefAttributes<HTMLTextAreaElement>>>;
7
4
  export default _default;
8
5
  export declare const Base: any;
9
6
  export declare const Error: any;
@@ -0,0 +1,3 @@
1
+ export declare function getKeyFromItem<Item extends {
2
+ value: unknown;
3
+ }>(item: Item, index: number): string | number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@croquiscom/pds",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Design system for Zigzag's Partner Center",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.es.js",
@@ -1,22 +0,0 @@
1
- import React, { ButtonHTMLAttributes } from 'react';
2
- export declare type ToggleSwitchSize = 'small' | 'large';
3
- export interface ToggleSwitchProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
- /**
5
- * @default true
6
- */
7
- isOn?: boolean;
8
- /**
9
- * @default small
10
- */
11
- size?: ToggleSwitchSize;
12
- /**
13
- * @default ON
14
- */
15
- onText?: string;
16
- /**
17
- * @default OFF
18
- */
19
- offText?: string;
20
- }
21
- export declare const ToggleSwitch: React.ForwardRefExoticComponent<ToggleSwitchProps & React.RefAttributes<HTMLButtonElement>>;
22
- export default ToggleSwitch;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { ToggleSwitchProps } from './ToggleSwitch';
3
- declare const _default: {
4
- title: string;
5
- component: React.ForwardRefExoticComponent<ToggleSwitchProps & React.RefAttributes<HTMLButtonElement>>;
6
- };
7
- export default _default;
8
- export declare const Base: any;
@@ -1 +0,0 @@
1
- export * from './ToggleSwitch';
@@ -1,4 +0,0 @@
1
- import { ToggleSwitchSize } from './ToggleSwitch';
2
- export declare const toggle_switch_base_css: import("@emotion/utils").SerializedStyles;
3
- export declare const getStylesByActive: (isOn: boolean) => import("@emotion/utils").SerializedStyles;
4
- export declare const getStyleByProps: (size: ToggleSwitchSize, isOn: boolean) => import("@emotion/utils").SerializedStyles;