@reco-inc/upbox-ui 1.2.0 → 1.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.
package/FigmaConnect.md CHANGED
@@ -136,7 +136,6 @@
136
136
  | Vue Prop | 타입 | 기본값 | 설명 |
137
137
  |---|---|---|---|
138
138
  | `loading` | `boolean` | `false` | 로딩 스피너 자동 노출, 클릭 무시 |
139
- | `autoLoading` | `boolean` | `false` | 클릭 핸들러가 돌려준 Promise 가 끝날 때까지 스스로 loading |
140
139
  | `block` | `boolean` | `false` | 가로 100% |
141
140
  | `type` | `button / submit / reset` | `button` | 네이티브 `type` |
142
141
  | `class` | `string` | - | 추가 클래스 |
@@ -151,7 +150,7 @@
151
150
 
152
151
  | Slot | 설명 |
153
152
  |---|---|
154
- | `default` | 본문 텍스트. 좌·우 아이콘은 슬롯 안에 `<lucide />` 직접 배치 |
153
+ | `default` | 본문 텍스트. 좌·우 아이콘은 슬롯 안에 `<Icon src="..." />` 또는 `<lucide />` 직접 배치. `Icon` 은 색을 variant 텍스트 색(currentColor)으로, 크기를 size 에 맞춰(16/16/20/20/24) 자동 적용 |
155
154
 
156
155
  ### Code Example
157
156
 
@@ -136,7 +136,6 @@
136
136
  | Vue Prop | 타입 | 기본값 | 설명 |
137
137
  |---|---|---|---|
138
138
  | `loading` | `boolean` | `false` | 로딩 스피너 자동 노출, 클릭 무시 |
139
- | `autoLoading` | `boolean` | `false` | 클릭 핸들러가 돌려준 Promise 가 끝날 때까지 스스로 loading |
140
139
  | `block` | `boolean` | `false` | 가로 100% |
141
140
  | `type` | `button / submit / reset` | `button` | 네이티브 `type` |
142
141
  | `class` | `string` | - | 추가 클래스 |
@@ -151,7 +150,7 @@
151
150
 
152
151
  | Slot | 설명 |
153
152
  |---|---|
154
- | `default` | 본문 텍스트. 좌·우 아이콘은 슬롯 안에 `<lucide />` 직접 배치 |
153
+ | `default` | 본문 텍스트. 좌·우 아이콘은 슬롯 안에 `<Icon src="..." />` 또는 `<lucide />` 직접 배치. `Icon` 은 색을 variant 텍스트 색(currentColor)으로, 크기를 size 에 맞춰(16/16/20/20/24) 자동 적용 |
155
154
 
156
155
  ### Code Example
157
156
 
@@ -2,7 +2,7 @@ import { HTMLAttributes } from 'vue';
2
2
  import { VariantProps } from 'class-variance-authority';
3
3
  export { default as BadgeDivider } from './BadgeDivider';
4
4
  export declare const badgeDividerVariants: (props?: ({
5
- variant?: "navy" | "green" | null | undefined;
5
+ variant?: "green" | "navy" | null | undefined;
6
6
  size?: "3xsmall" | "2xsmall" | "xsmall" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
8
  export type BadgeDividerVariants = VariantProps<typeof badgeDividerVariants>;
@@ -1,5 +1,4 @@
1
1
  import { HTMLAttributes } from 'vue';
2
- export type ButtonClickHandler = (event: MouseEvent) => unknown;
3
2
  export interface ButtonProps {
4
3
  variant?: 'primary' | 'destructive' | 'secondary' | 'tertiary';
5
4
  theme?: 'filled' | 'outlined';
@@ -7,18 +6,6 @@ export interface ButtonProps {
7
6
  block?: boolean;
8
7
  disabled?: boolean;
9
8
  loading?: boolean;
10
- /**
11
- * 클릭 핸들러가 Promise 를 돌려주면 끝날 때까지 스스로 loading 상태를 유지한다.
12
- * 그 사이 다시 누른 클릭은 무시한다. 핸들러는 API 호출(과 성공 후 화면 이동)을 `await` 하거나 `return` 해야 한다
13
- */
14
- autoLoading?: boolean;
15
- /**
16
- * `@click` 핸들러. emit 이 아니라 prop 으로 받아야 핸들러가 돌려준 Promise 를 기다릴 수 있다.
17
- * reka 트리거의 `as-child` 로 감싸면 트리거 핸들러와 합쳐져 배열로 들어온다
18
- */
19
- onClick?: ButtonClickHandler | ButtonClickHandler[];
20
- /** `@click.once` 핸들러. emit 을 쓰던 때처럼 처음 한 번만 부른다 */
21
- onClickOnce?: ButtonClickHandler | ButtonClickHandler[];
22
9
  type?: 'button' | 'submit' | 'reset';
23
10
  class?: HTMLAttributes['class'];
24
11
  }
@@ -31,7 +18,11 @@ declare function __VLS_template(): {
31
18
  rootEl: HTMLButtonElement;
32
19
  };
33
20
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
34
- declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
21
+ declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
22
+ click: (event: MouseEvent) => any;
23
+ }, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{
24
+ onClick?: ((event: MouseEvent) => any) | undefined;
25
+ }>, {
35
26
  disabled: boolean;
36
27
  type: "button" | "submit" | "reset";
37
28
  size: "xsmall" | "small" | "regular" | "large" | "xlarge";
@@ -39,7 +30,6 @@ declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}
39
30
  loading: boolean;
40
31
  variant: "primary" | "destructive" | "secondary" | "tertiary";
41
32
  block: boolean;
42
- autoLoading: boolean;
43
33
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
44
34
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
45
35
  export default _default;
@@ -2,7 +2,11 @@ import { StoryObj } from '@storybook/vue3-vite';
2
2
  declare const meta: {
3
3
  title: string;
4
4
  component: {
5
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./Button').ButtonProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
5
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./Button').ButtonProps> & Readonly<{
6
+ onClick?: ((event: MouseEvent) => any) | undefined;
7
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
+ click: (event: MouseEvent) => any;
9
+ }, import('vue').PublicProps, {
6
10
  disabled: boolean;
7
11
  type: "button" | "submit" | "reset";
8
12
  size: "xsmall" | "small" | "regular" | "large" | "xlarge";
@@ -10,7 +14,6 @@ declare const meta: {
10
14
  loading: boolean;
11
15
  variant: "primary" | "destructive" | "secondary" | "tertiary";
12
16
  block: boolean;
13
- autoLoading: boolean;
14
17
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLButtonElement, import('vue').ComponentProvideOptions, {
15
18
  P: {};
16
19
  B: {};
@@ -18,7 +21,9 @@ declare const meta: {
18
21
  C: {};
19
22
  M: {};
20
23
  Defaults: {};
21
- }, Readonly<import('./Button').ButtonProps> & Readonly<{}>, {}, {}, {}, {}, {
24
+ }, Readonly<import('./Button').ButtonProps> & Readonly<{
25
+ onClick?: ((event: MouseEvent) => any) | undefined;
26
+ }>, {}, {}, {}, {}, {
22
27
  disabled: boolean;
23
28
  type: "button" | "submit" | "reset";
24
29
  size: "xsmall" | "small" | "regular" | "large" | "xlarge";
@@ -26,12 +31,15 @@ declare const meta: {
26
31
  loading: boolean;
27
32
  variant: "primary" | "destructive" | "secondary" | "tertiary";
28
33
  block: boolean;
29
- autoLoading: boolean;
30
34
  }>;
31
35
  __isFragment?: never;
32
36
  __isTeleport?: never;
33
37
  __isSuspense?: never;
34
- } & import('vue').ComponentOptionsBase<Readonly<import('./Button').ButtonProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
38
+ } & import('vue').ComponentOptionsBase<Readonly<import('./Button').ButtonProps> & Readonly<{
39
+ onClick?: ((event: MouseEvent) => any) | undefined;
40
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
41
+ click: (event: MouseEvent) => any;
42
+ }, string, {
35
43
  disabled: boolean;
36
44
  type: "button" | "submit" | "reset";
37
45
  size: "xsmall" | "small" | "regular" | "large" | "xlarge";
@@ -39,7 +47,6 @@ declare const meta: {
39
47
  loading: boolean;
40
48
  variant: "primary" | "destructive" | "secondary" | "tertiary";
41
49
  block: boolean;
42
- autoLoading: boolean;
43
50
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
44
51
  $slots: {
45
52
  default?(_: {}): any;
@@ -79,11 +86,6 @@ export declare const Primary: Story;
79
86
  export declare const Variants: Story;
80
87
  export declare const Sizes: Story;
81
88
  export declare const Loading: Story;
82
- /**
83
- * `auto-loading` 을 붙이면 클릭 핸들러가 돌려준 Promise 가 끝날 때까지 스스로 loading 이 된다.
84
- * 그 사이 다시 누른 클릭은 무시되어, 저장 요청이 두 번 나가지 않는다.
85
- */
86
- export declare const AutoLoading: Story;
87
89
  export declare const Disabled: Story;
88
90
  /**
89
91
  * 특정 조건에 걸려 액션을 수행할 수 없는 경우에는 버튼을 `disabled` 로 막지 않는다.
@@ -0,0 +1,18 @@
1
+ import { IconProps } from '.';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ };
7
+ refs: {};
8
+ rootEl: HTMLSpanElement;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<IconProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
12
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
13
+ export default _default;
14
+ type __VLS_WithTemplateSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,40 @@
1
+ import { StoryObj } from '@storybook/vue3-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: {
5
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('.').IconProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLSpanElement, import('vue').ComponentProvideOptions, {
6
+ P: {};
7
+ B: {};
8
+ D: {};
9
+ C: {};
10
+ M: {};
11
+ Defaults: {};
12
+ }, Readonly<import('.').IconProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
13
+ __isFragment?: never;
14
+ __isTeleport?: never;
15
+ __isSuspense?: never;
16
+ } & import('vue').ComponentOptionsBase<Readonly<import('.').IconProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
17
+ $slots: {
18
+ default?(_: {}): any;
19
+ };
20
+ });
21
+ tags: string[];
22
+ argTypes: {
23
+ src: {
24
+ control: "text";
25
+ };
26
+ size: {
27
+ control: "number";
28
+ };
29
+ color: {
30
+ control: "color";
31
+ };
32
+ };
33
+ };
34
+ export default meta;
35
+ type Story = StoryObj<typeof meta>;
36
+ export declare const Default: Story;
37
+ export declare const InButton: Story;
38
+ export declare const ButtonSizes: Story;
39
+ export declare const InIconButton: Story;
40
+ export declare const ColorOverride: Story;
@@ -0,0 +1,6 @@
1
+ import { ComputedRef, InjectionKey } from 'vue';
2
+ /** 부모 컴포넌트(Button 등)가 자기 size 에 맞는 아이콘 px 를 내려준다 */
3
+ export interface IconContext {
4
+ size: ComputedRef<number>;
5
+ }
6
+ export declare const ICON_CONTEXT_KEY: InjectionKey<IconContext>;
@@ -0,0 +1,13 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ export { default as Icon } from './Icon';
3
+ export { ICON_CONTEXT_KEY } from './iconContext';
4
+ export type { IconContext } from './iconContext';
5
+ export interface IconProps {
6
+ /** 앱 Icon src 와 같은 경로 (`action/arrow-left-regular.svg`). 없으면 default slot 의 svg 를 쓴다 */
7
+ src?: string;
8
+ /** px. 없으면 부모(Button/IconButton) size 에 맞춘 값, 부모가 없으면 24 */
9
+ size?: number;
10
+ /** 기본은 currentColor 라 부모 텍스트 색(Button variant/hover/active)을 그대로 따른다 */
11
+ color?: string;
12
+ class?: HTMLAttributes["class"];
13
+ }
@@ -21,12 +21,12 @@ export interface TabsEmits {
21
21
  }
22
22
  export declare const tabsListVariants: (props?: ({
23
23
  variant?: "box" | "default" | "round" | null | undefined;
24
- color?: "navy" | "grey" | null | undefined;
24
+ color?: "grey" | "navy" | null | undefined;
25
25
  size?: "small" | "large" | "regular" | "xlarge" | null | undefined;
26
26
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
27
27
  export declare const tabsTriggerVariants: (props?: ({
28
28
  variant?: "box" | "default" | "round" | null | undefined;
29
- color?: "navy" | "grey" | null | undefined;
29
+ color?: "grey" | "navy" | null | undefined;
30
30
  size?: "small" | "large" | "regular" | "xlarge" | null | undefined;
31
31
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
32
32
  export type TabsListVariants = VariantProps<typeof tabsListVariants>;
package/dist/global.d.ts CHANGED
@@ -82,6 +82,7 @@ declare module 'vue' {
82
82
  FormLabel: typeof import('./components/form')['FormLabel'];
83
83
  FormMessage: typeof import('./components/form')['FormMessage'];
84
84
  TextField: typeof import('./components/text-field')['TextField'];
85
+ Icon: typeof import('./components/icon')['Icon'];
85
86
  InputGroup: typeof import('./components/input-group')['InputGroup'];
86
87
  InputGroupAddon: typeof import('./components/input-group')['InputGroupAddon'];
87
88
  InputGroupButton: typeof import('./components/input-group')['InputGroupButton'];
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from './components/badge-divider';
8
8
  export * from './components/breadcrumb';
9
9
  export * from './components/button';
10
10
  export * from './components/fab';
11
+ export * from './components/icon';
11
12
  export * from './components/icon-button';
12
13
  export * from './components/text-button';
13
14
  export * from './components/calendar';