@croquiscom/pds 16.19.0 → 16.20.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @croquiscom/pds
2
2
 
3
+ ## 16.20.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c4805cc: CopyText 컴포넌트 추가
8
+
3
9
  ## 16.19.0
4
10
 
5
11
  ### Minor Changes
@@ -0,0 +1,43 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { BaseTextProps } from '../text';
3
+ import { TooltipProps } from '../tooltip';
4
+ export interface CopyTextProps {
5
+ /**
6
+ * 복사할 텍스트 내용
7
+ */
8
+ text: string;
9
+ /**
10
+ * 복사할 텍스트 Props(BaseText Props)
11
+ * @default { kind: 'Body_12_Regular', color: semantic_colors.content.primary }
12
+ */
13
+ textProps?: BaseTextProps;
14
+ /**
15
+ * 복사할 텍스트 내용을 대체할 노드
16
+ * displayText가 있으면 text를 대체하여 보여지고, 실제 복사는 text 정보를 사용합니다.
17
+ */
18
+ displayText?: ReactNode;
19
+ /**
20
+ * 복사 완료 시 표시할 텍스트
21
+ * @default "복사했어요."
22
+ */
23
+ copiedText?: string;
24
+ /**
25
+ * 툴팁 Props(Tooltip Props)
26
+ * @default { content: '복사', placement: 'top', openerTriggerEvent: 'hover' }
27
+ */
28
+ tooltipProps?: Omit<TooltipProps, 'children'>;
29
+ /**
30
+ * @default false
31
+ */
32
+ disabled?: boolean;
33
+ className?: string;
34
+ /**
35
+ * 복사 완료 시 호출되는 콜백
36
+ */
37
+ onCopy?: (text: string) => void;
38
+ /**
39
+ * 복사 실패 시 호출되는 콜백
40
+ */
41
+ onCopyFailed?: (error: Error) => void;
42
+ }
43
+ export declare const CopyText: React.ForwardRefExoticComponent<CopyTextProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { CopyText } from './CopyText';
3
+ declare const meta: Meta<typeof CopyText>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof CopyText>;
6
+ export declare const Default: Story;
7
+ export declare const CustomCopiedMessage: Story;
8
+ export declare const Disabled: Story;
9
+ export declare const CustomKindColor: Story;
10
+ export declare const CustomTooltipPlacement: Story;
11
+ export declare const DisplayText: Story;
12
+ export declare const OtherAlign: Story;
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { CopyText } from './CopyText';
3
+ declare const meta: Meta<typeof CopyText>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof CopyText>;
6
+ export declare const BasicCopyTest: Story;
7
+ export declare const DisabledStateTest: Story;
8
+ export declare const DisplayTextTest: Story;
@@ -0,0 +1 @@
1
+ export { CopyText } from './CopyText';
@@ -0,0 +1 @@
1
+ export declare const copy_text_base_css: import("@emotion/utils").SerializedStyles;
@@ -40,3 +40,4 @@ export * from './image';
40
40
  export * from './ul';
41
41
  export * from './segmented-control';
42
42
  export * from './tree';
43
+ export * from './copy-text';