@nurihaus/web-design-system 3.3.0 → 3.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.
Files changed (87) hide show
  1. package/README.md +36 -0
  2. package/dist/ai/components.md +120 -9
  3. package/dist/avatar.js +5 -5
  4. package/dist/bottom-nav.js +22 -8
  5. package/dist/breadcrumb.js +25 -10
  6. package/dist/check-box.js +24 -8
  7. package/dist/chip-group.js +21 -7
  8. package/dist/{chunk-563.js → chunk-1563.js} +26 -13
  9. package/dist/{chunk-657.js → chunk-1657.js} +2 -2
  10. package/dist/{chunk-777.js → chunk-2777.js} +2 -2
  11. package/dist/{chunk-558.js → chunk-4558.js} +2 -2
  12. package/dist/chunk-4560.js +77 -0
  13. package/dist/{chunk-917.js → chunk-4917.js} +2 -2
  14. package/dist/{chunk-77.js → chunk-5077.js} +2 -2
  15. package/dist/{chunk-149.js → chunk-6149.js} +2 -2
  16. package/dist/{chunk-302.js → chunk-6302.js} +2 -2
  17. package/dist/{chunk-364.js → chunk-6364.js} +2 -2
  18. package/dist/{chunk-713.js → chunk-6713.js} +2 -2
  19. package/dist/{chunk-298.js → chunk-7298.js} +2 -2
  20. package/dist/{chunk-653.js → chunk-7653.js} +2 -2
  21. package/dist/{chunk-739.js → chunk-7739.js} +2 -2
  22. package/dist/{chunk-309.js → chunk-8690.js} +2 -2
  23. package/dist/{chunk-933.js → chunk-8933.js} +2 -2
  24. package/dist/chunk-910.js +23 -10
  25. package/dist/{chunk-387.js → chunk-9387.js} +2 -2
  26. package/dist/{chunk-436.js → chunk-9436.js} +2 -2
  27. package/dist/{chunk-976.js → chunk-9976.js} +3 -3
  28. package/dist/collapsible-menu.js +25 -12
  29. package/dist/components/badge/badge-props.d.ts +4 -4
  30. package/dist/components/badge/badge.stories.d.ts +1 -1
  31. package/dist/components/bottom-nav/bottom-nav-type.d.ts +5 -2
  32. package/dist/components/breadcrumb/breadcrumb-type.d.ts +2 -1
  33. package/dist/components/button/button-props.d.ts +2 -2
  34. package/dist/components/button/button-type.d.ts +2 -1
  35. package/dist/components/button/button.stories.d.ts +1 -1
  36. package/dist/components/check-box/check-box-type.d.ts +2 -1
  37. package/dist/components/chip-group/chip-group-type.d.ts +2 -1
  38. package/dist/components/collapsible-menu/collapsible-menu-type.d.ts +2 -1
  39. package/dist/components/drawer/drawer-type.d.ts +2 -1
  40. package/dist/components/drop-down/drop-down-type.d.ts +2 -1
  41. package/dist/components/logging/log-context.d.ts +9 -0
  42. package/dist/components/logging/logging-type.d.ts +25 -0
  43. package/dist/components/logging/logging.d.ts +5 -0
  44. package/dist/components/logging/logging.stories.d.ts +18 -0
  45. package/dist/components/modal/modal-type.d.ts +2 -1
  46. package/dist/components/pagination/pagination-type.d.ts +2 -1
  47. package/dist/components/radio/radio-type.d.ts +3 -1
  48. package/dist/components/radio/radio.d.ts +2 -1
  49. package/dist/components/radio/radio.stories.d.ts +1 -1
  50. package/dist/components/skeleton/skeleton.stories.d.ts +5 -5
  51. package/dist/components/switch/switch-type.d.ts +2 -1
  52. package/dist/components/table/table-type.d.ts +2 -1
  53. package/dist/components/tabs/tabs-type.d.ts +2 -1
  54. package/dist/components/text-area/text-area-type.d.ts +2 -1
  55. package/dist/components/text-field/text-field-type.d.ts +2 -1
  56. package/dist/components/toast/toast-type.d.ts +2 -1
  57. package/dist/components/toast/toast.stories.d.ts +8 -6
  58. package/dist/components/tooltip/tooltip-type.d.ts +2 -1
  59. package/dist/components.css +38 -0
  60. package/dist/cta-button.js +35 -20
  61. package/dist/data-table.js +19 -7
  62. package/dist/drawer.js +23 -9
  63. package/dist/drop-down.js +25 -9
  64. package/dist/helpers/hooks/useTrack.d.ts +3 -0
  65. package/dist/icon-text-badge.js +12 -10
  66. package/dist/icon-text-option-badge.js +6 -6
  67. package/dist/icon.js +5 -5
  68. package/dist/index.d.ts +2 -0
  69. package/dist/index.js +433 -80
  70. package/dist/loading.js +6 -6
  71. package/dist/logging.js +147 -0
  72. package/dist/modal-with-double-button.js +14 -12
  73. package/dist/modal.js +39 -26
  74. package/dist/option-badge.js +12 -10
  75. package/dist/pagination.js +23 -9
  76. package/dist/radio.js +24 -10
  77. package/dist/skeleton.js +4 -4
  78. package/dist/step-progress.js +3 -3
  79. package/dist/styles.css +32 -0
  80. package/dist/switch.js +24 -8
  81. package/dist/tabs.js +22 -6
  82. package/dist/text-area.js +30 -8
  83. package/dist/text-field.js +31 -9
  84. package/dist/text.js +5 -5
  85. package/dist/toast.js +32 -15
  86. package/dist/tooltip.js +33 -18
  87. package/package.json +5 -1
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- export const __webpack_esm_id__ = 976;
3
- export const __webpack_esm_ids__ = [976];
2
+ export const __webpack_esm_id__ = 9976;
3
+ export const __webpack_esm_ids__ = [9976];
4
4
  export const __webpack_esm_modules__ = {
5
5
 
6
6
  /***/ 9976
@@ -12,7 +12,7 @@ export const __webpack_esm_modules__ = {
12
12
  /* unused harmony exports variant, sizes */
13
13
  /* harmony import */ var _helpers_props_common_props__WEBPACK_IMPORTED_MODULE_0__ = __nuri_require__(7298);
14
14
 
15
- var variant = ['primary', 'secondary', 'ghost', 'neutral', 'confirm', 'outlined'];
15
+ var variant = ['primary', 'secondary', 'ghost', 'neutral', 'confirm', 'outlined', 'social'];
16
16
  var sizes = ['xs', 's', 'm', 'l', 'xl'];
17
17
  var ctaButtonProps = {
18
18
  variant: {
@@ -17,6 +17,8 @@ __nuri_require__.d(__webpack_exports__, {
17
17
  var jsx_runtime_ = __nuri_require__(612);
18
18
  // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react","module":"react"}
19
19
  var external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_ = __nuri_require__(1041);
20
+ // EXTERNAL MODULE: ./helpers/hooks/useTrack.ts
21
+ var useTrack = __nuri_require__(4560);
20
22
  // EXTERNAL MODULE: ./helpers/utils/classNames.js
21
23
  var classNames = __nuri_require__(3274);
22
24
  // EXTERNAL MODULE: ./helpers/utils/getMergedProps.ts
@@ -117,6 +119,7 @@ var collapsible_menu_assign = undefined && undefined.__assign || function () {
117
119
 
118
120
 
119
121
 
122
+
120
123
  var Anchor = function Anchor(props) {
121
124
  return (0,jsx_runtime_.jsx)("a", collapsible_menu_assign({}, props));
122
125
  };
@@ -130,7 +133,13 @@ var CollapsibleMenu = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
130
133
  onActiveKeyChange = _a.onActiveKeyChange,
131
134
  _b = _a.indent,
132
135
  indent = _b === void 0 ? 12 : _b,
133
- linkComponent = _a.linkComponent;
136
+ linkComponent = _a.linkComponent,
137
+ track = _a.track,
138
+ trackProps = _a.trackProps;
139
+ var emit = (0,useTrack/* useTrack */.n)('CollapsibleMenu', {
140
+ track: track,
141
+ trackProps: trackProps
142
+ });
134
143
  var Link = linkComponent !== null && linkComponent !== void 0 ? linkComponent : Anchor;
135
144
  var rootClassName = (0,classNames/* classNames */.x)(className, 'collapsible-menu');
136
145
  var _hasActiveDescendant = function hasActiveDescendant(item) {
@@ -139,6 +148,12 @@ var CollapsibleMenu = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
139
148
  if (item.key === activeKey) return true;
140
149
  return (_b = (_a = item.children) === null || _a === void 0 ? void 0 : _a.some(_hasActiveDescendant)) !== null && _b !== void 0 ? _b : false;
141
150
  };
151
+ var selectItem = function selectItem(item) {
152
+ var _a;
153
+ emit('navigate', item.key);
154
+ onActiveKeyChange === null || onActiveKeyChange === void 0 ? void 0 : onActiveKeyChange(item.key);
155
+ (_a = item.onSelect) === null || _a === void 0 ? void 0 : _a.call(item);
156
+ };
142
157
  var _renderItems = function renderItems(targetItems, depth) {
143
158
  var indentStyle = {
144
159
  paddingLeft: "".concat(depth * indent, "px")
@@ -179,13 +194,11 @@ var CollapsibleMenu = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
179
194
  "aria-current": isActive ? 'page' : undefined,
180
195
  "aria-disabled": item.disabled ? 'true' : undefined,
181
196
  onClick: function onClick(e) {
182
- var _a;
183
197
  if (item.disabled) {
184
198
  e.preventDefault();
185
199
  return;
186
200
  }
187
- onActiveKeyChange === null || onActiveKeyChange === void 0 ? void 0 : onActiveKeyChange(item.key);
188
- (_a = item.onSelect) === null || _a === void 0 ? void 0 : _a.call(item);
201
+ selectItem(item);
189
202
  },
190
203
  children: left
191
204
  }, item.key);
@@ -195,9 +208,7 @@ var CollapsibleMenu = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
195
208
  className: itemClassName,
196
209
  disabled: item.disabled,
197
210
  onClick: function onClick() {
198
- var _a;
199
- onActiveKeyChange === null || onActiveKeyChange === void 0 ? void 0 : onActiveKeyChange(item.key);
200
- (_a = item.onSelect) === null || _a === void 0 ? void 0 : _a.call(item);
211
+ return selectItem(item);
201
212
  },
202
213
  children: left
203
214
  }, item.key);
@@ -234,7 +245,7 @@ var x = (y) => {
234
245
  var x = {}; __nuri_require__.d(x, y); return x
235
246
  }
236
247
  var y = (x) => (() => (x))
237
- module.exports = x({ ["forwardRef"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.forwardRef) });
248
+ module.exports = x({ ["createContext"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.createContext), ["forwardRef"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.forwardRef), ["useCallback"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useCallback), ["useContext"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useContext), ["useRef"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useRef) });
238
249
 
239
250
  /***/ },
240
251
 
@@ -339,7 +350,7 @@ module.exports = x({ ["jsx"]: () => (__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime
339
350
  /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
340
351
  /******/ // [resolve, Promise] = chunk loading, 0 = chunk loaded
341
352
  /******/ var installedChunks = {
342
- /******/ 311: 0
353
+ /******/ 6311: 0
343
354
  /******/ };
344
355
  /******/
345
356
  /******/ var installChunk = (data) => {
@@ -379,15 +390,17 @@ module.exports = x({ ["jsx"]: () => (__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime
379
390
  /******/
380
391
  /************************************************************************/
381
392
  /******/
382
- /******/ import * as __webpack_chunk_1__ from "./chunk-364.js";
393
+ /******/ import * as __webpack_chunk_1__ from "./chunk-6364.js";
383
394
  /******/ __nuri_require__.C(__webpack_chunk_1__);
384
- /******/ import * as __webpack_chunk_2__ from "./chunk-917.js";
395
+ /******/ import * as __webpack_chunk_2__ from "./chunk-4560.js";
385
396
  /******/ __nuri_require__.C(__webpack_chunk_2__);
397
+ /******/ import * as __webpack_chunk_3__ from "./chunk-4917.js";
398
+ /******/ __nuri_require__.C(__webpack_chunk_3__);
386
399
  /******/
387
400
  /******/ // startup
388
401
  /******/ // Load entry module and return exports
389
402
  /******/ // This entry module depends on other loaded chunks and execution need to be delayed
390
- /******/ var __webpack_exports__ = __nuri_require__.O(undefined, [364,917], () => (__nuri_require__(5932)))
403
+ /******/ var __webpack_exports__ = __nuri_require__.O(undefined, [6364,4560,4917], () => (__nuri_require__(5932)))
391
404
  /******/ __webpack_exports__ = __nuri_require__.O(__webpack_exports__);
392
405
  /******/ const __webpack_exports__default = __webpack_exports__.A;
393
406
  /******/ export { __webpack_exports__default as default };
@@ -1,10 +1,10 @@
1
- export declare const variant: readonly ["neutral", "primary", "danger", "outlined"];
1
+ export declare const variant: readonly ["neutral", "primary", "danger", "outlined", "callout"];
2
2
  export declare const sizes: readonly ["xs", "s", "m", "l", "xl"];
3
3
  export declare const iconTextBadgeProps: {
4
4
  variant: {
5
5
  type: "className";
6
6
  className: string;
7
- values: readonly ["neutral", "primary", "danger", "outlined"];
7
+ values: readonly ["neutral", "primary", "danger", "outlined", "callout"];
8
8
  default: "neutral";
9
9
  };
10
10
  size: import("../../helpers/types/propsDef").ClassNamePropsType<readonly ["xs", "s", "m", "l", "xl"]>;
@@ -14,7 +14,7 @@ export declare const iconTextOptionBadgeProps: {
14
14
  variant: {
15
15
  type: "className";
16
16
  className: string;
17
- values: readonly ["neutral", "primary", "danger", "outlined"];
17
+ values: readonly ["neutral", "primary", "danger", "outlined", "callout"];
18
18
  default: "neutral";
19
19
  };
20
20
  size: import("../../helpers/types/propsDef").ClassNamePropsType<readonly ["xs", "s", "m", "l", "xl"]>;
@@ -24,7 +24,7 @@ export declare const optionBadgeProps: {
24
24
  variant: {
25
25
  type: "className";
26
26
  className: string;
27
- values: readonly ["neutral", "primary", "danger", "outlined"];
27
+ values: readonly ["neutral", "primary", "danger", "outlined", "callout"];
28
28
  default: "neutral";
29
29
  };
30
30
  size: import("../../helpers/types/propsDef").ClassNamePropsType<readonly ["xs", "s", "m", "l", "xl"]>;
@@ -7,7 +7,7 @@ declare const meta: {
7
7
  control: {
8
8
  type: "select";
9
9
  };
10
- options: readonly ["neutral", "primary", "danger", "outlined"];
10
+ options: readonly ["neutral", "primary", "danger", "outlined", "callout"];
11
11
  };
12
12
  size: {
13
13
  control: {
@@ -1,6 +1,7 @@
1
- import type { ComponentPropsWithRef, ComponentType, ReactNode } from 'react';
1
+ import type { ComponentPropsWithRef, ComponentType, MouseEventHandler, ReactNode } from 'react';
2
2
  import { StyleProps } from '../../helpers/types/common-props';
3
3
  import { IconName } from '../icon/icon-type';
4
+ import { TrackProps } from '../logging/logging-type';
4
5
  export interface BottomNavBadge {
5
6
  /** 숫자. 없으면 점으로 그린다. 99 를 넘으면 99+ */
6
7
  count?: number;
@@ -21,8 +22,10 @@ export interface BottomNavLinkProps {
21
22
  className: string;
22
23
  children: ReactNode;
23
24
  'aria-current'?: 'page';
25
+ /** `track` 을 주면 누를 때 로그를 보낸다. 직접 만든 `linkComponent` 는 이 값을 `<a>` 에 넘긴다 */
26
+ onClick?: MouseEventHandler<HTMLAnchorElement>;
24
27
  }
25
- export interface BottomNavProps extends StyleProps {
28
+ export interface BottomNavProps extends StyleProps, TrackProps {
26
29
  items: BottomNavItem[];
27
30
  /** 지금 화면의 탭 id. 주소에서 정하므로 탭 바가 스스로 바꾸지 않는다 */
28
31
  value?: string;
@@ -1,5 +1,6 @@
1
1
  import { ComponentPropsWithRef, ElementType, ReactNode } from 'react';
2
2
  import { AsChildProps, StyleProps } from '../../helpers/types/common-props';
3
+ import { TrackProps } from '../logging/logging-type';
3
4
  import { sizes } from './breadcrumb-props';
4
5
  export type BreadcrumbRootProps = ComponentPropsWithRef<'nav'>;
5
6
  export type BreadcrumbListProps = ComponentPropsWithRef<'ol'>;
@@ -17,7 +18,7 @@ export interface BreadcrumbItem {
17
18
  /** 없으면 링크가 아닌 글자로 그린다. 마지막 항목은 href 가 있어도 현재 위치로 그린다. */
18
19
  href?: string;
19
20
  }
20
- export interface BreadcrumbProps extends StyleProps {
21
+ export interface BreadcrumbProps extends StyleProps, TrackProps {
21
22
  items: BreadcrumbItem[];
22
23
  size?: (typeof sizes)[number];
23
24
  /** 마지막(현재 위치) 항목이 아닌 항목을 클릭하면 그 id 로 불린다. */
@@ -1,10 +1,10 @@
1
- export declare const variant: readonly ["primary", "secondary", "ghost", "neutral", "confirm", "outlined"];
1
+ export declare const variant: readonly ["primary", "secondary", "ghost", "neutral", "confirm", "outlined", "social"];
2
2
  export declare const sizes: readonly ["xs", "s", "m", "l", "xl"];
3
3
  export declare const ctaButtonProps: {
4
4
  variant: {
5
5
  type: "className";
6
6
  className: string;
7
- values: readonly ["primary", "secondary", "ghost", "neutral", "confirm", "outlined"];
7
+ values: readonly ["primary", "secondary", "ghost", "neutral", "confirm", "outlined", "social"];
8
8
  default: "primary";
9
9
  };
10
10
  size: import("../../helpers/types/propsDef").ClassNamePropsType<readonly ["xs", "s", "m", "l", "xl"]>;
@@ -1,5 +1,6 @@
1
1
  import { ComponentPropsWithRef, ReactNode } from 'react';
2
2
  import { AsChildProps } from '../../helpers/types/common-props';
3
+ import { TrackProps } from '../logging/logging-type';
3
4
  import { sizes, variant } from './button-props';
4
5
  export interface CommonButtonProps {
5
6
  loading?: boolean;
@@ -8,7 +9,7 @@ export interface BaseButtonProps extends ComponentPropsWithRef<'button'>, Common
8
9
  children?: ReactNode;
9
10
  loadingComponent?: ReactNode;
10
11
  }
11
- export interface CTAButtonProps extends ComponentPropsWithRef<'button'>, CommonButtonProps {
12
+ export interface CTAButtonProps extends ComponentPropsWithRef<'button'>, CommonButtonProps, TrackProps {
12
13
  variant?: (typeof variant)[number];
13
14
  size?: (typeof sizes)[number];
14
15
  text: string | ReactNode;
@@ -7,7 +7,7 @@ declare const meta: {
7
7
  control: {
8
8
  type: "select";
9
9
  };
10
- options: readonly ["primary", "secondary", "ghost", "neutral", "confirm", "outlined"];
10
+ options: readonly ["primary", "secondary", "ghost", "neutral", "confirm", "outlined", "social"];
11
11
  };
12
12
  size: {
13
13
  control: {
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { AsChildProps } from '../../helpers/types/common-props';
3
+ import { TrackProps } from '../logging/logging-type';
3
4
  import { sizes } from './check-box-props';
4
5
  export interface CheckBoxRootProps {
5
6
  checked?: boolean;
@@ -15,7 +16,7 @@ export interface CheckBoxLabelProps extends AsChildProps {
15
16
  preventChangeOnClick?: boolean;
16
17
  className?: string;
17
18
  }
18
- export interface CheckBoxProps extends CheckBoxRootProps {
19
+ export interface CheckBoxProps extends CheckBoxRootProps, TrackProps {
19
20
  label: string | ReactNode;
20
21
  size?: (typeof sizes)[number];
21
22
  className?: string;
@@ -1,5 +1,6 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
2
  import { StyleProps } from '../../helpers/types/common-props';
3
+ import { TrackProps } from '../logging/logging-type';
3
4
  export interface ChipGroupItem {
4
5
  id: string;
5
6
  label: ReactNode;
@@ -7,7 +8,7 @@ export interface ChipGroupItem {
7
8
  count?: number;
8
9
  disabled?: boolean;
9
10
  }
10
- export interface ChipGroupProps extends StyleProps {
11
+ export interface ChipGroupProps extends StyleProps, TrackProps {
11
12
  items: ChipGroupItem[];
12
13
  value?: string;
13
14
  defaultValue?: string;
@@ -1,5 +1,6 @@
1
1
  import { ComponentType, MouseEvent, ReactNode } from 'react';
2
2
  import { AsChildProps, StyleProps } from '../../helpers/types/common-props';
3
+ import { TrackProps } from '../logging/logging-type';
3
4
  import { sizes } from './collapsible-menu-props';
4
5
  export interface CollapsibleMenuRootProps {
5
6
  defaultOpen?: boolean;
@@ -30,7 +31,7 @@ export interface CollapsibleMenuLinkProps {
30
31
  'aria-current'?: 'page';
31
32
  'aria-disabled'?: 'true';
32
33
  }
33
- export interface CollapsibleMenuProps extends StyleProps {
34
+ export interface CollapsibleMenuProps extends StyleProps, TrackProps {
34
35
  size?: (typeof sizes)[number];
35
36
  items: CollapsibleMenuItem[];
36
37
  activeKey?: string;
@@ -1,5 +1,6 @@
1
1
  import { ComponentPropsWithRef, ReactElement, ReactNode } from 'react';
2
2
  import { AsChildProps, StyleProps } from '../../helpers/types/common-props';
3
+ import { TrackProps } from '../logging/logging-type';
3
4
  import { sides, sizes } from './drawer-props';
4
5
  export interface DrawerRootProps {
5
6
  open?: boolean;
@@ -15,7 +16,7 @@ export interface DrawerDescriptionProps extends ComponentPropsWithRef<'p'>, AsCh
15
16
  }
16
17
  export interface DrawerCloseProps extends ComponentPropsWithRef<'button'>, AsChildProps {
17
18
  }
18
- export interface DrawerProps extends DrawerRootProps, StyleProps {
19
+ export interface DrawerProps extends DrawerRootProps, StyleProps, TrackProps {
19
20
  /** asChild 로 감싸 클릭하면 열리는 요소. 없으면 open·defaultOpen 으로만 연다 */
20
21
  trigger?: ReactElement;
21
22
  title: ReactNode;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { AsChildProps, StyleProps } from '../../helpers/types/common-props';
3
+ import { TrackProps } from '../logging/logging-type';
3
4
  import { sizes } from './drop-down-props';
4
5
  export interface DropDownRootProps {
5
6
  defaultOpen?: boolean;
@@ -27,7 +28,7 @@ export interface DropDownItemProps extends AsChildProps {
27
28
  disabled?: boolean;
28
29
  onClick?: () => void;
29
30
  }
30
- export interface DropDownProps extends StyleProps {
31
+ export interface DropDownProps extends StyleProps, TrackProps {
31
32
  size?: (typeof sizes)[number];
32
33
  defaultValue?: string;
33
34
  value?: string;
@@ -0,0 +1,9 @@
1
+ import { LogEvent, LogProviderProps } from './logging-type';
2
+ type Emit = (event: LogEvent) => void;
3
+ export declare const LogProvider: {
4
+ (props: LogProviderProps): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
7
+ /** LogProvider 가 둔 emit 함수. Provider 밖이면 null 이다. */
8
+ export declare const useLogEmitter: () => Emit | null;
9
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { ReactNode } from 'react';
2
+ /** 디자인시스템 컴포넌트가 내보내는 행동 이름. 수동 로그(useLog)는 다른 문자열도 쓸 수 있다. */
3
+ export type LogAction = 'click' | 'open' | 'close' | 'change' | 'show' | 'navigate';
4
+ export interface LogEvent {
5
+ /** 컴포넌트 displayName. 수동 로그는 화면·모듈 이름 */
6
+ component: string;
7
+ action: LogAction | (string & {});
8
+ /** 쓰는 쪽이 준 식별자. 예: 'report/download' */
9
+ track: string;
10
+ /** 개발자가 정한 id 만 (탭 id, 칩 id, 옵션 value, 탭 바 id). 사용자가 입력한 글자는 절대 넣지 않는다 */
11
+ value?: string;
12
+ /** 쓰는 쪽이 trackProps 로 명시한 값 */
13
+ props?: Record<string, string | number | boolean>;
14
+ timestamp: number;
15
+ }
16
+ /** 상호작용 컴포넌트가 공개 Props 에 extends 하는 두 prop */
17
+ export interface TrackProps {
18
+ /** 주면 이 컴포넌트의 상호작용이 LogProvider.onEvent 로 간다. 없으면 아무것도 보내지 않는다 */
19
+ track?: string;
20
+ trackProps?: LogEvent['props'];
21
+ }
22
+ export interface LogProviderProps {
23
+ onEvent: (event: LogEvent) => void;
24
+ children?: ReactNode;
25
+ }
@@ -0,0 +1,5 @@
1
+ import { LogEvent } from './logging-type';
2
+ export { LogProvider } from './log-context';
3
+ /** 컴포넌트 밖의 사용 로그를 남긴다. LogProvider 밖이면 아무것도 하지 않는다. */
4
+ export declare const useLog: () => ((event: Omit<LogEvent, "timestamp">) => void);
5
+ export type { LogEvent, LogAction, LogProviderProps, TrackProps } from './logging-type';
@@ -0,0 +1,18 @@
1
+ import type { StoryObj } from '@storybook/react-webpack5';
2
+ declare const meta: {
3
+ title: string;
4
+ component: {
5
+ (props: import("./logging-type").LogProviderProps): import("react/jsx-runtime").JSX.Element;
6
+ displayName: string;
7
+ };
8
+ parameters: {
9
+ layout: string;
10
+ };
11
+ args: {
12
+ onEvent: () => void;
13
+ };
14
+ };
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+ /** 버튼을 누르거나 탭을 바꾸면 onEvent 가 받은 이벤트가 아래 목록 맨 위에 쌓인다. */
18
+ export declare const Default: Story;
@@ -1,6 +1,7 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
2
  import { AsChildProps, StyleProps } from '../../helpers/types/common-props';
3
3
  import { CTAButtonProps } from '../button/button-type';
4
+ import { TrackProps } from '../logging/logging-type';
4
5
  import { sizes } from './modal-props';
5
6
  export interface ModalRootProps {
6
7
  open?: boolean;
@@ -36,7 +37,7 @@ export interface ModalWithDoubleButtonProps {
36
37
  right: CTAButtonProps;
37
38
  size?: (typeof sizes)[number];
38
39
  }
39
- export interface ModalProps extends ModalRootProps, StyleProps {
40
+ export interface ModalProps extends ModalRootProps, StyleProps, TrackProps {
40
41
  /** 있으면 `Modal.Trigger asChild` 로 감싸 클릭하면 열리는 요소가 된다. */
41
42
  trigger?: ReactElement;
42
43
  title: ReactNode;
@@ -1,4 +1,5 @@
1
1
  import { ComponentPropsWithRef } from 'react';
2
+ import { TrackProps } from '../logging/logging-type';
2
3
  import { sizes } from './pagination-props';
3
4
  export interface PaginationRootProps extends ComponentPropsWithRef<'nav'> {
4
5
  disabled?: boolean;
@@ -9,7 +10,7 @@ export interface PaginationItemProps extends ComponentPropsWithRef<'button'> {
9
10
  disabled?: boolean;
10
11
  }
11
12
  export type PaginationEllipsisProps = ComponentPropsWithRef<'span'>;
12
- export interface PaginationProps extends PaginationRootProps {
13
+ export interface PaginationProps extends PaginationRootProps, TrackProps {
13
14
  totalPages: number;
14
15
  page?: number;
15
16
  defaultPage?: number;
@@ -1,6 +1,7 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
2
  import { ComponentPropsWithRef } from 'react';
3
3
  import { AsChildProps } from '../../helpers/types/common-props';
4
+ import { TrackProps } from '../logging/logging-type';
4
5
  export interface RadioRootProps {
5
6
  options: {
6
7
  id: string;
@@ -22,4 +23,5 @@ export interface RadioButtonProps extends ComponentPropsWithRef<'button'>, AsChi
22
23
  export interface RadioIndicatorProps extends HTMLAttributes<HTMLDivElement>, AsChildProps {
23
24
  id: string;
24
25
  }
25
- export type RadioProps = RadioRootProps;
26
+ export interface RadioProps extends RadioRootProps, TrackProps {
27
+ }
@@ -1,3 +1,4 @@
1
- declare const Radio: import("react").ForwardRefExoticComponent<import("./radio-type").RadioRootProps & import("react").RefAttributes<HTMLUListElement>>;
1
+ import { RadioProps } from './radio-type';
2
+ declare const Radio: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<HTMLUListElement>>;
2
3
  export default Radio;
3
4
  export type { RadioProps } from './radio-type';
@@ -1,7 +1,7 @@
1
1
  import type { StoryObj } from '@storybook/react-webpack5';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: import("react").ForwardRefExoticComponent<import("./radio-type").RadioRootProps & import("react").RefAttributes<HTMLUListElement>>;
4
+ component: import("react").ForwardRefExoticComponent<import("./radio-type").RadioProps & import("react").RefAttributes<HTMLUListElement>>;
5
5
  args: {
6
6
  options: {
7
7
  id: string;
@@ -38,9 +38,10 @@ declare const meta: {
38
38
  animated: true;
39
39
  };
40
40
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
41
- className?: string | undefined | undefined;
41
+ slot?: string | undefined | undefined;
42
42
  style?: import("react").CSSProperties | undefined;
43
- children?: import("react").ReactNode;
43
+ title?: string | undefined | undefined;
44
+ key?: import("react").Key | null | undefined;
44
45
  defaultChecked?: boolean | undefined | undefined;
45
46
  defaultValue?: string | number | readonly string[] | undefined;
46
47
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -48,6 +49,7 @@ declare const meta: {
48
49
  accessKey?: string | undefined | undefined;
49
50
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
50
51
  autoFocus?: boolean | undefined | undefined;
52
+ className?: string | undefined | undefined;
51
53
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
52
54
  contextMenu?: string | undefined | undefined;
53
55
  dir?: string | undefined | undefined;
@@ -57,10 +59,8 @@ declare const meta: {
57
59
  id?: string | undefined | undefined;
58
60
  lang?: string | undefined | undefined;
59
61
  nonce?: string | undefined | undefined;
60
- slot?: string | undefined | undefined;
61
62
  spellCheck?: (boolean | "true" | "false") | undefined;
62
63
  tabIndex?: number | undefined | undefined;
63
- title?: string | undefined | undefined;
64
64
  translate?: "yes" | "no" | undefined | undefined;
65
65
  radioGroup?: string | undefined | undefined;
66
66
  role?: import("react").AriaRole | undefined;
@@ -143,6 +143,7 @@ declare const meta: {
143
143
  "aria-valuemin"?: number | undefined | undefined;
144
144
  "aria-valuenow"?: number | undefined | undefined;
145
145
  "aria-valuetext"?: string | undefined | undefined;
146
+ children?: import("react").ReactNode;
146
147
  dangerouslySetInnerHTML?: {
147
148
  __html: string | TrustedHTML;
148
149
  } | undefined | undefined;
@@ -304,7 +305,6 @@ declare const meta: {
304
305
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLSpanElement> | undefined;
305
306
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
306
307
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
307
- key?: import("react").Key | null | undefined;
308
308
  height?: number | string | undefined;
309
309
  width?: number | string | undefined;
310
310
  shape?: (typeof shapes)[number] | undefined;
@@ -1,5 +1,6 @@
1
1
  import { ComponentPropsWithRef, ReactNode } from 'react';
2
2
  import { AsChildProps } from '../../helpers/types/common-props';
3
+ import { TrackProps } from '../logging/logging-type';
3
4
  import { sizes } from './switch-props';
4
5
  export interface SwitchRootProps extends Omit<ComponentPropsWithRef<'button'>, 'id' | 'onChange' | 'value'> {
5
6
  id: string;
@@ -13,7 +14,7 @@ export type SwitchThumbProps = ComponentPropsWithRef<'span'>;
13
14
  export interface SwitchLabelProps extends AsChildProps {
14
15
  className?: string;
15
16
  }
16
- export interface SwitchProps extends SwitchRootProps {
17
+ export interface SwitchProps extends SwitchRootProps, TrackProps {
17
18
  label?: ReactNode;
18
19
  size?: (typeof sizes)[number];
19
20
  }
@@ -1,4 +1,5 @@
1
1
  import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { TrackProps } from '../logging/logging-type';
2
3
  export interface TableProps {
3
4
  children: React.ReactNode;
4
5
  }
@@ -23,7 +24,7 @@ type ColumnsType<T extends readonly RowItem[]> = Array<{
23
24
  onClickCell?: () => void;
24
25
  };
25
26
  }>;
26
- export interface DataTableProps<T extends readonly RowItem[]> {
27
+ export interface DataTableProps<T extends readonly RowItem[]> extends TrackProps {
27
28
  rows: T;
28
29
  columns: ColumnsType<T>;
29
30
  fixedRowsIndex?: number;
@@ -1,5 +1,6 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
2
  import { AsChildProps, StyleProps } from '../../helpers/types/common-props';
3
+ import { TrackProps } from '../logging/logging-type';
3
4
  import { variant } from './tabs-props';
4
5
  export type TabsValue = string | null;
5
6
  export type TabsVariant = (typeof variant)[number];
@@ -10,7 +11,7 @@ export interface TabsItem {
10
11
  disabled?: boolean;
11
12
  leftIcon?: ReactNode;
12
13
  }
13
- export interface TabsProps extends StyleProps {
14
+ export interface TabsProps extends StyleProps, TrackProps {
14
15
  items: TabsItem[];
15
16
  variant?: TabsVariant;
16
17
  value?: TabsValue;
@@ -1,4 +1,5 @@
1
1
  import { ChangeEvent, ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { TrackProps } from '../logging/logging-type';
2
3
  import { resize, sizes } from './text-area-props';
3
4
  export interface TextAreaRootProps {
4
5
  children: ReactNode;
@@ -20,7 +21,7 @@ export interface TextAreaHelperTextProps {
20
21
  text: ReactNode;
21
22
  className?: string;
22
23
  }
23
- export interface TextAreaProps extends Omit<ComponentPropsWithRef<'textarea'>, 'title'> {
24
+ export interface TextAreaProps extends Omit<ComponentPropsWithRef<'textarea'>, 'title'>, TrackProps {
24
25
  size?: (typeof sizes)[number];
25
26
  width?: number | string;
26
27
  resize?: (typeof resize)[number];
@@ -1,4 +1,5 @@
1
1
  import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { TrackProps } from '../logging/logging-type';
2
3
  import { sizes } from './text-field-props';
3
4
  export interface TextFieldRootProps {
4
5
  children: React.ReactNode;
@@ -20,7 +21,7 @@ export interface TextFieldHelperTextProps {
20
21
  text: ReactNode;
21
22
  className?: string;
22
23
  }
23
- export interface TextFieldProps extends Omit<ComponentPropsWithRef<'input'>, 'title' | 'size'> {
24
+ export interface TextFieldProps extends Omit<ComponentPropsWithRef<'input'>, 'title' | 'size'>, TrackProps {
24
25
  size: (typeof sizes)[number];
25
26
  width: number | string;
26
27
  leftIcon?: ReactNode;
@@ -1,5 +1,6 @@
1
1
  import { ComponentPropsWithRef, ReactNode } from 'react';
2
2
  import { AsChildProps, StyleProps } from '../../helpers/types/common-props';
3
+ import { TrackProps } from '../logging/logging-type';
3
4
  import { positions, variants } from './toast-props';
4
5
  export interface ToastProviderProps {
5
6
  children: ReactNode;
@@ -36,7 +37,7 @@ export interface ToastAction {
36
37
  onClick: () => void;
37
38
  altText: string;
38
39
  }
39
- export interface ToastProps extends Omit<ToastRootProps, 'children' | keyof StyleProps>, StyleProps {
40
+ export interface ToastProps extends Omit<ToastRootProps, 'children' | keyof StyleProps>, StyleProps, TrackProps {
40
41
  title: ReactNode;
41
42
  description?: ReactNode;
42
43
  variant?: (typeof variants)[number];