@ncds/ui-admin 1.5.4 → 1.5.5

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.
@@ -49,7 +49,8 @@ var DatePicker = exports.DatePicker = /*#__PURE__*/(0, _react.forwardRef)(functi
49
49
  _d = _a.isEndDate,
50
50
  isEndDate = _d === void 0 ? false : _d,
51
51
  onValidationError = _a.onValidationError,
52
- attrs = __rest(_a, ["shouldFocus", "currentDate", "size", "onChangeDate", "datePickerOptions", "isEndDate", "onValidationError"]);
52
+ className = _a.className,
53
+ attrs = __rest(_a, ["shouldFocus", "currentDate", "size", "onChangeDate", "datePickerOptions", "isEndDate", "onValidationError", "className"]);
53
54
  var flatpickrInstanceRef = (0, _react.useRef)(null);
54
55
  var dateFormatRef = (0, _react.useRef)('Y-m-d');
55
56
  var minMaxDateRef = (0, _react.useRef)({});
@@ -302,7 +303,7 @@ var DatePicker = exports.DatePicker = /*#__PURE__*/(0, _react.forwardRef)(functi
302
303
  'ncua-date-picker--disabled': attrs.disabled,
303
304
  'ncua-date-picker--has-time': hasTimeOption,
304
305
  'ncua-date-picker--destructive': attrs.destructive
305
- })
306
+ }, className)
306
307
  }, {
307
308
  children: [(0, _jsxRuntime.jsx)(_reactFlatpickr.default, __assign({}, attrs, {
308
309
  ref: ref || undefined,
@@ -150,7 +150,7 @@ var Dropdown = function (_a) {
150
150
  return null;
151
151
  };
152
152
  var renderItem = function (item) {
153
- var itemClasses = ['ncua-dropdown__item', item.disabled ? 'is-disabled' : '', item.type === 'danger' ? 'is-danger' : ''].filter(Boolean).join(' ');
153
+ var itemClasses = ['ncua-dropdown__item', item.disabled ? 'is-disabled' : '', item.type === 'danger' ? 'is-danger' : '', item.className].filter(Boolean).join(' ');
154
154
  return (0, _jsxRuntime.jsxs)("div", __assign({
155
155
  className: itemClasses
156
156
  }, {
@@ -112,6 +112,9 @@ var InputBase = exports.InputBase = /*#__PURE__*/(0, _react.forwardRef)(function
112
112
  })
113
113
  }));
114
114
  case 'custom':
115
+ if (slot.placement !== 'inside') {
116
+ return null;
117
+ }
115
118
  return slot.children;
116
119
  default:
117
120
  return null;
@@ -128,9 +128,10 @@ Modal.Header = function (_a) {
128
128
  });
129
129
  };
130
130
  Modal.Content = function (_a) {
131
- var children = _a.children;
131
+ var children = _a.children,
132
+ className = _a.className;
132
133
  return (0, _jsxRuntime.jsx)("div", __assign({
133
- className: "ncua-modal__content"
134
+ className: (0, _classnames.default)('ncua-modal__content', className)
134
135
  }, {
135
136
  children: children
136
137
  }));
@@ -171,12 +172,13 @@ Modal.Actions = function (_a) {
171
172
  showDivider = _c === void 0 ? false : _c,
172
173
  _d = _a.align,
173
174
  align = _d === void 0 ? 'stretch' : _d,
174
- checkboxContent = _a.checkboxContent;
175
+ checkboxContent = _a.checkboxContent,
176
+ className = _a.className;
175
177
  return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
176
178
  children: [showDivider && (0, _jsxRuntime.jsx)("div", {
177
179
  className: "ncua-modal__actions-divider"
178
180
  }), (0, _jsxRuntime.jsxs)("div", __assign({
179
- className: (0, _classnames.default)('ncua-modal__actions-wrapper', {
181
+ className: (0, _classnames.default)('ncua-modal__actions-wrapper', className, {
180
182
  'ncua-modal__actions-wrapper--checkbox': layout === 'checkbox'
181
183
  })
182
184
  }, {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.NavButton = void 0;
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
- var _Button = require("../button/Button");
8
+ var _button = require("../button");
9
9
  var __assign = void 0 && (void 0).__assign || function () {
10
10
  __assign = Object.assign || function (t) {
11
11
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -76,6 +76,6 @@ var NavButton = function (_a) {
76
76
  };
77
77
  // key 값 별도 계산
78
78
  var buttonKey = isNavigationButton ? "".concat(breakPoint, "-").concat(type) : undefined;
79
- return (0, _jsxRuntime.jsx)(_Button.Button, __assign({}, buttonProps), buttonKey);
79
+ return (0, _jsxRuntime.jsx)(_button.Button, __assign({}, buttonProps), buttonKey);
80
80
  };
81
81
  exports.NavButton = NavButton;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.SelectBox = exports.DEFAULT_MAX_HEIGHT = void 0;
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
8
  var _dynamic = _interopRequireDefault(require("@ncds/ui-admin-icon/dynamic"));
9
- var _color = require("@ncds/ui-admin/constant/color");
9
+ var _color = require("../../../constant/color");
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _react = require("react");
12
12
  var _dropdown = require("../../hooks/dropdown");
@@ -40,7 +40,8 @@ export var DatePicker = /*#__PURE__*/forwardRef(function (_a, ref) {
40
40
  _d = _a.isEndDate,
41
41
  isEndDate = _d === void 0 ? false : _d,
42
42
  onValidationError = _a.onValidationError,
43
- attrs = __rest(_a, ["shouldFocus", "currentDate", "size", "onChangeDate", "datePickerOptions", "isEndDate", "onValidationError"]);
43
+ className = _a.className,
44
+ attrs = __rest(_a, ["shouldFocus", "currentDate", "size", "onChangeDate", "datePickerOptions", "isEndDate", "onValidationError", "className"]);
44
45
  var flatpickrInstanceRef = useRef(null);
45
46
  var dateFormatRef = useRef('Y-m-d');
46
47
  var minMaxDateRef = useRef({});
@@ -293,7 +294,7 @@ export var DatePicker = /*#__PURE__*/forwardRef(function (_a, ref) {
293
294
  'ncua-date-picker--disabled': attrs.disabled,
294
295
  'ncua-date-picker--has-time': hasTimeOption,
295
296
  'ncua-date-picker--destructive': attrs.destructive
296
- })
297
+ }, className)
297
298
  }, {
298
299
  children: [_jsx(Flatpickr, __assign({}, attrs, {
299
300
  ref: ref || undefined,
@@ -143,7 +143,7 @@ export var Dropdown = function (_a) {
143
143
  return null;
144
144
  };
145
145
  var renderItem = function (item) {
146
- var itemClasses = ['ncua-dropdown__item', item.disabled ? 'is-disabled' : '', item.type === 'danger' ? 'is-danger' : ''].filter(Boolean).join(' ');
146
+ var itemClasses = ['ncua-dropdown__item', item.disabled ? 'is-disabled' : '', item.type === 'danger' ? 'is-danger' : '', item.className].filter(Boolean).join(' ');
147
147
  return _jsxs("div", __assign({
148
148
  className: itemClasses
149
149
  }, {
@@ -105,6 +105,9 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
105
105
  })
106
106
  }));
107
107
  case 'custom':
108
+ if (slot.placement !== 'inside') {
109
+ return null;
110
+ }
108
111
  return slot.children;
109
112
  default:
110
113
  return null;
@@ -120,9 +120,10 @@ Modal.Header = function (_a) {
120
120
  });
121
121
  };
122
122
  Modal.Content = function (_a) {
123
- var children = _a.children;
123
+ var children = _a.children,
124
+ className = _a.className;
124
125
  return _jsx("div", __assign({
125
- className: "ncua-modal__content"
126
+ className: classnames('ncua-modal__content', className)
126
127
  }, {
127
128
  children: children
128
129
  }));
@@ -163,12 +164,13 @@ Modal.Actions = function (_a) {
163
164
  showDivider = _c === void 0 ? false : _c,
164
165
  _d = _a.align,
165
166
  align = _d === void 0 ? 'stretch' : _d,
166
- checkboxContent = _a.checkboxContent;
167
+ checkboxContent = _a.checkboxContent,
168
+ className = _a.className;
167
169
  return _jsxs(_Fragment, {
168
170
  children: [showDivider && _jsx("div", {
169
171
  className: "ncua-modal__actions-divider"
170
172
  }), _jsxs("div", __assign({
171
- className: classnames('ncua-modal__actions-wrapper', {
173
+ className: classnames('ncua-modal__actions-wrapper', className, {
172
174
  'ncua-modal__actions-wrapper--checkbox': layout === 'checkbox'
173
175
  })
174
176
  }, {
@@ -9,7 +9,7 @@ var __assign = this && this.__assign || function () {
9
9
  return __assign.apply(this, arguments);
10
10
  };
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
- import { Button } from '../button/Button';
12
+ import { Button } from '../button';
13
13
  var NAV_BUTTON_CONFIG = {
14
14
  first: {
15
15
  label: '처음',
@@ -27,7 +27,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
27
27
  };
28
28
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
29
29
  import Icon from '@ncds/ui-admin-icon/dynamic';
30
- import { COLOR } from '@ncds/ui-admin/constant/color';
30
+ import { COLOR } from '../../../constant/color';
31
31
  import classNames from 'classnames';
32
32
  import { forwardRef, useCallback, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react';
33
33
  import { useDropdown, useScrollLock } from '../../hooks/dropdown';
@@ -11,7 +11,7 @@ var __assign = this && this.__assign || function () {
11
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  import Icon from '@ncds/ui-admin-icon/dynamic';
13
13
  import classNames from 'classnames';
14
- import { useState, useCallback, useRef } from 'react';
14
+ import { useCallback, useRef, useState } from 'react';
15
15
  import { COLOR } from '../../../constant/color';
16
16
  import { Dot } from '../dot';
17
17
  var MARGIN = 10;
@@ -1,7 +1,7 @@
1
- import { ColorTone } from '@ncds/ui-admin/constant/color';
2
- import { BadgeProps } from '.';
3
- import { Size } from '../../../constant/size';
4
- import { SideSlotType } from '../../types/side-slot';
1
+ import type { ColorTone } from '../../../constant/color';
2
+ import type { Size } from '../../../constant/size';
3
+ import type { SideSlotType } from '../../types/side-slot';
4
+ import { type BadgeProps } from '.';
5
5
  export type BadgeGroupSize = Extract<Size, 'xs' | 'sm'>;
6
6
  export type BadgeGroupColor = Extract<ColorTone, 'neutral' | 'error' | 'warning' | 'success'>;
7
7
  export type BadgeGroupProps = Omit<BadgeProps, 'type' | 'size' | 'color'> & {
@@ -5,7 +5,7 @@ import { DotProps } from '../dot';
5
5
  export type ButtonTheme = 'primary' | 'secondary' | 'secondary-gray' | 'tertiary-gray' | 'tertiary' | 'text' | 'text-gray' | 'text-red' | 'destructive';
6
6
  export type ButtonSize = Extract<Size, 'xxs' | 'xs' | 'sm' | 'md'>;
7
7
  type CommonButtonProps<T extends keyof HTMLElementTagNameMap> = Omit<ComponentProps<T>, 'ref'> & {
8
- label: string;
8
+ label: ReactNode;
9
9
  className?: string;
10
10
  hierarchy?: ButtonTheme;
11
11
  disabled?: boolean;
@@ -21,7 +21,7 @@ export declare const svgSize: Record<ButtonSize, number>;
21
21
  export declare const iconOnlySvgSize: Record<ButtonSize, number>;
22
22
  export declare const dotSize: Record<ButtonSize, DotProps['size']>;
23
23
  export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
24
- label: string;
24
+ label: ReactNode;
25
25
  className?: string | undefined;
26
26
  hierarchy?: ButtonTheme | undefined;
27
27
  disabled?: boolean | undefined;
@@ -15,9 +15,9 @@ interface ButtonGroupItemCommonProps {
15
15
  disabled?: boolean;
16
16
  isCurrent?: boolean;
17
17
  }
18
- interface ButtonGroupItemProps extends ButtonGroupItemCommonProps, ComponentProps<'button'> {
18
+ export interface ButtonGroupItemProps extends ButtonGroupItemCommonProps, ComponentProps<'button'> {
19
19
  }
20
- interface ButtonGroupProps {
20
+ export interface ButtonGroupProps {
21
21
  className?: string;
22
22
  size?: ButtonGroupSize;
23
23
  children: React.ReactNode;
@@ -9,6 +9,7 @@ export type DatePickerProps = {
9
9
  destructive?: string;
10
10
  placeholder?: string;
11
11
  isEndDate?: boolean;
12
+ className?: string;
12
13
  onChangeDate: (date: string) => void;
13
14
  onValidationError?: (error: {
14
15
  date: Date;
@@ -27,6 +27,7 @@ export type DropdownItemType = {
27
27
  onClick?: () => void;
28
28
  disabled?: boolean;
29
29
  type?: 'default' | 'danger';
30
+ className?: string;
30
31
  };
31
32
  export type DropdownGroup = {
32
33
  items: DropdownItemType[];
@@ -18,7 +18,7 @@ export type ModalProps = {
18
18
  export declare const Modal: {
19
19
  ({ isOpen, onClose, children, size, closeOnBackdropClick, closeOnEsc, className, zIndex, ...restProps }: ModalProps): import("react").ReactPortal | null;
20
20
  Header({ children, onClose, featuredIcon, title, subtitle, align, showDivider, hideCloseButton, }: ModalHeaderProps): import("react/jsx-runtime").JSX.Element;
21
- Content({ children }: ModalContentProps): import("react/jsx-runtime").JSX.Element;
21
+ Content({ children, className }: ModalContentProps): import("react/jsx-runtime").JSX.Element;
22
22
  /**
23
23
  * Modal.Actions - The actions area of the modal
24
24
  *
@@ -47,7 +47,7 @@ export declare const Modal: {
47
47
  * <Button size="sm" label="Confirm" onClick={handleConfirm} hierarchy="primary" />
48
48
  * </Modal.Actions>
49
49
  */
50
- Actions({ children, layout, showDivider, align, checkboxContent, }: ModalActionsProps): import("react/jsx-runtime").JSX.Element;
50
+ Actions({ children, layout, showDivider, align, checkboxContent, className, }: ModalActionsProps): import("react/jsx-runtime").JSX.Element;
51
51
  };
52
52
  export type ModalHeaderProps = {
53
53
  children?: ReactNode;
@@ -65,8 +65,10 @@ export type ModalHeaderProps = {
65
65
  };
66
66
  export type ModalContentProps = {
67
67
  children: ReactNode;
68
+ className?: string;
68
69
  };
69
70
  export type ModalActionsProps = {
71
+ className?: string;
70
72
  children: ReactNode;
71
73
  layout?: ModalActionsLayout;
72
74
  showDivider?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { ComponentPropsWithRef, PropsWithChildren } from 'react';
2
- import { UseFormRegisterReturn } from 'react-hook-form';
3
- import { Size } from '../../../constant/size';
2
+ import type { UseFormRegisterReturn } from 'react-hook-form';
3
+ import type { Size } from '../../../constant/size';
4
4
  import { OptionChangeHandler, OptionType, OptionValue } from '../../types/dropdown';
5
5
  export declare const DEFAULT_MAX_HEIGHT = 275;
6
6
  type BaseSelectBoxProps = Omit<ComponentPropsWithRef<'div'>, 'size' | 'onChange'>;
@@ -4,7 +4,7 @@ export type TabSize = 'sm' | 'md' | 'lg';
4
4
  export type TabType = 'button-primary' | 'button-white' | 'underline' | 'underline-fill' | 'line-vertical';
5
5
  type BaseTabButtonProps = {
6
6
  id?: string;
7
- label: string;
7
+ label?: string;
8
8
  size?: TabSize;
9
9
  tabButtonType?: TabType;
10
10
  isActive?: boolean;
@@ -1,6 +1,6 @@
1
- import { MouseEventHandler } from 'react';
2
- import { Size } from '../../../constant/size';
3
- import { SideSlotType } from '../../types/side-slot';
1
+ import { type MouseEventHandler } from 'react';
2
+ import type { Size } from '../../../constant/size';
3
+ import type { SideSlotType } from '../../types/side-slot';
4
4
  interface TagProps {
5
5
  size?: Extract<Size, 'sm' | 'md'>;
6
6
  icon?: SideSlotType;
@@ -1368,9 +1368,11 @@ button {
1368
1368
  padding: 4px 10px;
1369
1369
  }
1370
1370
  .ncua-input__field--xs {
1371
+ line-height: var(--line-heights-xs);
1371
1372
  padding: 4px 10px;
1372
1373
  }
1373
1374
  .ncua-input__field--sm {
1375
+ line-height: var(--line-heights-sm);
1374
1376
  padding: 6px 12px;
1375
1377
  }
1376
1378
  .ncua-input__field:has(.ncua-input__stepper-button-group ~ .ncua-input__number) {
@@ -1563,9 +1565,11 @@ button {
1563
1565
  padding: 4px 10px;
1564
1566
  }
1565
1567
  .ncua-input__leading-text-wrap .ncua-input__leading-text--xs {
1568
+ line-height: var(--line-heights-xs);
1566
1569
  padding: 4px 10px;
1567
1570
  }
1568
1571
  .ncua-input__leading-text-wrap .ncua-input__leading-text--sm {
1572
+ line-height: var(--line-heights-sm);
1569
1573
  padding: 6px 12px;
1570
1574
  }
1571
1575
  .ncua-input__leading-text-wrap .ncua-input__leading-text {
@@ -1588,9 +1592,11 @@ button {
1588
1592
  padding: 4px 10px;
1589
1593
  }
1590
1594
  .ncua-input__trailing-button .ncua-input__button--xs {
1595
+ line-height: var(--line-heights-xs);
1591
1596
  padding: 4px 10px;
1592
1597
  }
1593
1598
  .ncua-input__trailing-button .ncua-input__button--sm {
1599
+ line-height: var(--line-heights-sm);
1594
1600
  padding: 6px 12px;
1595
1601
  }
1596
1602
  .ncua-input__trailing-button .ncua-input__button {
@@ -1603,19 +1609,19 @@ button {
1603
1609
  cursor: pointer;
1604
1610
  }
1605
1611
  .ncua-input__trailing-button .ncua-input__button {
1606
- padding: 5px 10px;
1612
+ padding: 4px 10px;
1607
1613
  font-size: var(--font-size-xs);
1608
1614
  line-height: var(--line-heights-xs);
1609
1615
  font-weight: var(--font-weights-commerce-sans-1);
1610
1616
  }
1611
1617
  .ncua-input__trailing-button .ncua-input__button--xs {
1612
- padding: 5px 10px;
1618
+ padding: 4px 10px;
1613
1619
  font-size: var(--font-size-xs);
1614
1620
  line-height: var(--line-heights-xs);
1615
1621
  font-weight: var(--font-weights-commerce-sans-1);
1616
1622
  }
1617
1623
  .ncua-input__trailing-button .ncua-input__button--sm {
1618
- padding: 7px 14px;
1624
+ padding: 6px 12px;
1619
1625
  font-size: var(--font-size-sm);
1620
1626
  line-height: var(--line-heights-sm);
1621
1627
  font-weight: var(--font-weights-commerce-sans-2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ncds/ui-admin",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "nhn-commerce의 어드민 디자인 시스템입니다.",
5
5
  "scripts": {
6
6
  "barrel": "node barrel.js",