@ncds/ui-admin 0.0.24 → 0.0.26
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/dist/cjs/index.js +132 -0
- package/dist/cjs/src/components/button/ButtonGroup.js +12 -5
- package/dist/cjs/src/components/checkbox/Checkbox.js +2 -2
- package/dist/cjs/src/components/checkbox/CheckboxInput.js +41 -12
- package/dist/cjs/src/components/date-picker/RangeDatePickerWithButtons.js +90 -0
- package/dist/cjs/src/components/date-picker/index.js +22 -0
- package/dist/cjs/src/components/featured-icon/FeaturedIcon.js +1 -18
- package/dist/cjs/src/components/index.js +30 -8
- package/dist/cjs/src/components/input/InputBase.js +2 -1
- package/dist/cjs/src/components/input/PasswordInput.js +1 -0
- package/dist/cjs/src/components/input/Textarea.js +12 -6
- package/dist/cjs/src/components/modal/index.js +11 -7
- package/dist/cjs/src/components/notification/index.js +11 -11
- package/dist/cjs/src/components/select/Select.js +3 -0
- package/dist/cjs/src/components/tab/TabButton.js +1 -1
- package/dist/cjs/src/components/tag/Tag.js +5 -5
- package/dist/cjs/src/constant/date-picker.js +63 -0
- package/dist/cjs/src/constant/index.js +11 -0
- package/dist/cjs/src/utils/date-picker.js +26 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/src/components/button/ButtonGroup.js +12 -5
- package/dist/esm/src/components/checkbox/Checkbox.js +2 -2
- package/dist/esm/src/components/checkbox/CheckboxInput.js +42 -13
- package/dist/esm/src/components/date-picker/RangeDatePickerWithButtons.js +83 -0
- package/dist/esm/src/components/date-picker/index.js +3 -1
- package/dist/esm/src/components/featured-icon/FeaturedIcon.js +1 -18
- package/dist/esm/src/components/index.js +3 -1
- package/dist/esm/src/components/input/InputBase.js +2 -1
- package/dist/esm/src/components/input/PasswordInput.js +1 -0
- package/dist/esm/src/components/input/Textarea.js +12 -6
- package/dist/esm/src/components/modal/index.js +1 -1
- package/dist/esm/src/components/notification/index.js +2 -2
- package/dist/esm/src/components/select/Select.js +3 -0
- package/dist/esm/src/components/tab/TabButton.js +1 -1
- package/dist/esm/src/components/tag/Tag.js +5 -5
- package/dist/esm/src/constant/date-picker.js +57 -0
- package/dist/esm/src/constant/index.js +2 -1
- package/dist/esm/src/utils/date-picker.js +17 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/src/components/button/ButtonGroup.d.ts +4 -2
- package/dist/types/src/components/checkbox/CheckboxInput.d.ts +3 -0
- package/dist/types/src/components/date-picker/RangeDatePickerWithButtons.d.ts +12 -0
- package/dist/types/src/components/date-picker/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts +3 -1
- package/dist/types/src/components/input/InputBase.d.ts +2 -1
- package/dist/types/src/components/input/Textarea.d.ts +2 -0
- package/dist/types/src/components/modal/index.d.ts +1 -2
- package/dist/types/src/components/notification/index.d.ts +1 -1
- package/dist/types/src/components/select/Select.d.ts +4 -1
- package/dist/types/src/constant/date-picker.d.ts +58 -0
- package/dist/types/src/constant/index.d.ts +1 -0
- package/dist/types/src/utils/date-picker.d.ts +9 -0
- package/dist/ui-admin/assets/styles/style.css +187 -84
- package/package.json +1 -1
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './size';
|
|
1
|
+
export * from './size';
|
|
2
|
+
export * from './date-picker';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import moment from 'moment';
|
|
2
|
+
export function getDateFormat(date) {
|
|
3
|
+
if (date === void 0) {
|
|
4
|
+
date = getToday();
|
|
5
|
+
}
|
|
6
|
+
return moment(date).format('YYYY-MM-DD');
|
|
7
|
+
}
|
|
8
|
+
export function getToday() {
|
|
9
|
+
return moment().toDate();
|
|
10
|
+
}
|
|
11
|
+
export function getSubtractDate(_a) {
|
|
12
|
+
var _b = _a.date,
|
|
13
|
+
date = _b === void 0 ? getToday() : _b,
|
|
14
|
+
period = _a.period,
|
|
15
|
+
unit = _a.unit;
|
|
16
|
+
return moment(date).subtract(period, unit).toDate();
|
|
17
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
export * from './src/components/badge';
|
|
2
|
+
export * from './src/components/breadcrumb';
|
|
2
3
|
export * from './src/components/button';
|
|
3
4
|
export * from './src/components/carousel';
|
|
4
5
|
export * from './src/components/checkbox';
|
|
5
6
|
export * from './src/components/date-picker';
|
|
7
|
+
export * from './src/components/divider';
|
|
8
|
+
export * from './src/components/dropdown';
|
|
9
|
+
export * from './src/components/empty-state';
|
|
10
|
+
export * from './src/components/featured-icon';
|
|
6
11
|
export * from './src/components/input';
|
|
12
|
+
export * from './src/components/modal';
|
|
13
|
+
export * from './src/components/notification';
|
|
7
14
|
export * from './src/components/pagination';
|
|
15
|
+
export * from './src/components/progress-bar';
|
|
16
|
+
export * from './src/components/progress-circle';
|
|
8
17
|
export * from './src/components/radio';
|
|
9
18
|
export * from './src/components/select';
|
|
10
19
|
export * from './src/components/shared/hintText';
|
|
11
20
|
export * from './src/components/shared/label';
|
|
12
21
|
export * from './src/components/shared';
|
|
22
|
+
export * from './src/components/slider';
|
|
13
23
|
export * from './src/components/spinner';
|
|
24
|
+
export * from './src/components/tab';
|
|
25
|
+
export * from './src/components/tag';
|
|
14
26
|
export * from './src/components/toggle';
|
|
15
27
|
export * from './src/components/tooltip';
|
|
16
28
|
export * from './src/components';
|
|
@@ -9,7 +9,7 @@ interface SideCommon {
|
|
|
9
9
|
interface SideIcon {
|
|
10
10
|
type: 'icon';
|
|
11
11
|
icon: IconName;
|
|
12
|
-
size?:
|
|
12
|
+
size?: number;
|
|
13
13
|
color?: ColorKeyType;
|
|
14
14
|
}
|
|
15
15
|
interface SideCustom {
|
|
@@ -19,10 +19,12 @@ interface SideCustom {
|
|
|
19
19
|
type SideSlotType = SideCommon & (SideIcon | SideCustom);
|
|
20
20
|
interface ButtonGroupItemCommonProps {
|
|
21
21
|
label?: string;
|
|
22
|
+
size?: ButtonGroupSize;
|
|
22
23
|
icon?: SideSlotType;
|
|
23
24
|
children?: React.ReactNode;
|
|
24
25
|
onlyIcon?: boolean;
|
|
25
26
|
disabled?: boolean;
|
|
27
|
+
isCurrent?: boolean;
|
|
26
28
|
}
|
|
27
29
|
interface ButtonGroupItemButtonProps extends ButtonGroupItemCommonProps, ComponentProps<'button'> {
|
|
28
30
|
as?: 'button';
|
|
@@ -42,7 +44,7 @@ interface ButtonGroupProps {
|
|
|
42
44
|
}
|
|
43
45
|
export declare const ButtonGroup: {
|
|
44
46
|
({ children, className, hasBorder, size, onlyIcon, disabled, }: ButtonGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
-
Item({ as, label, onlyIcon, icon, disabled, children, ...props }: ButtonGroupItemProps): React.ReactElement<{
|
|
47
|
+
Item({ as, label, size, onlyIcon, icon, disabled, children, isCurrent, ...props }: ButtonGroupItemProps): React.ReactElement<{
|
|
46
48
|
ref?: React.LegacyRef<HTMLButtonElement> | undefined;
|
|
47
49
|
key?: React.Key | null | undefined;
|
|
48
50
|
form?: string | undefined;
|
|
@@ -6,5 +6,8 @@ export interface CheckboxInputProps extends Omit<ComponentPropsWithRef<'input'>,
|
|
|
6
6
|
destructive?: boolean;
|
|
7
7
|
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* 현재 destructive 속성은 현재 디자인 시스템에 존재하지 않으니 사용하지 않는 것을 권장합니다.
|
|
11
|
+
*/
|
|
9
12
|
export declare const CheckboxInput: import("react").ForwardRefExoticComponent<CheckboxInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
13
|
//# sourceMappingURL=CheckboxInput.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { RangeDatePickerProps } from './RangeDatePicker';
|
|
3
|
+
import { PERIOD_ITEM } from '../../constant/date-picker';
|
|
4
|
+
export type PeriodKeyType = keyof typeof PERIOD_ITEM;
|
|
5
|
+
type RangeDatePickerWithButtonsProps = {
|
|
6
|
+
currentButtonId: PeriodKeyType;
|
|
7
|
+
setCurrentButtonId: Dispatch<SetStateAction<PeriodKeyType>>;
|
|
8
|
+
periodKeys: PeriodKeyType[];
|
|
9
|
+
} & RangeDatePickerProps;
|
|
10
|
+
export declare const RangeDatePickerWithButtons: ({ currentButtonId, setCurrentButtonId, startDateOptions, endDateOptions, validationOption, periodKeys, onDateValidation, }: RangeDatePickerWithButtonsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=RangeDatePickerWithButtons.d.ts.map
|
|
@@ -4,9 +4,10 @@ export * from './button';
|
|
|
4
4
|
export * from './carousel';
|
|
5
5
|
export * from './checkbox';
|
|
6
6
|
export * from './date-picker';
|
|
7
|
-
export * from './featured-icon';
|
|
8
7
|
export * from './divider';
|
|
8
|
+
export * from './dropdown';
|
|
9
9
|
export * from './empty-state';
|
|
10
|
+
export * from './featured-icon';
|
|
10
11
|
export * from './input';
|
|
11
12
|
export * from './modal';
|
|
12
13
|
export * from './notification';
|
|
@@ -16,6 +17,7 @@ export * from './progress-circle';
|
|
|
16
17
|
export * from './radio';
|
|
17
18
|
export * from './select';
|
|
18
19
|
export * from './shared';
|
|
20
|
+
export * from './slider';
|
|
19
21
|
export * from './spinner';
|
|
20
22
|
export * from './tab';
|
|
21
23
|
export * from './tag';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IconName } from '@ncds/ui-admin-icon';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { COLOR } from '../../../constant/color';
|
|
4
|
+
import { Size } from '../../../constant/size';
|
|
4
5
|
interface InputSideButtonSlot {
|
|
5
6
|
type: 'button';
|
|
6
7
|
label: string;
|
|
@@ -29,7 +30,7 @@ interface InputBaseCommonProps extends Omit<React.InputHTMLAttributes<HTMLInputE
|
|
|
29
30
|
required?: boolean;
|
|
30
31
|
label?: string;
|
|
31
32
|
hintText?: string;
|
|
32
|
-
size?: 'xs' | 'md'
|
|
33
|
+
size?: Extract<Size, 'xs' | 'md'>;
|
|
33
34
|
disabled?: boolean;
|
|
34
35
|
validation?: boolean;
|
|
35
36
|
destructive?: boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { Size } from '../../../constant/size';
|
|
2
3
|
interface TextareaProps extends ComponentPropsWithRef<'textarea'> {
|
|
3
4
|
className?: string;
|
|
5
|
+
size?: Extract<Size, 'sm' | 'md'>;
|
|
4
6
|
label?: string;
|
|
5
7
|
hintText?: string;
|
|
6
8
|
required?: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Icon, { IconName } from '@ncds/ui-admin-icon';
|
|
2
|
+
import { COLOR } from '@ncds/ui-admin/constant/color';
|
|
2
3
|
import { Size } from '@ncds/ui/constant/size';
|
|
3
4
|
import { ComponentPropsWithRef, PropsWithChildren } from 'react';
|
|
4
5
|
import { UseFormRegisterReturn } from 'react-hook-form';
|
|
5
|
-
import { COLOR } from '@ncds/ui-admin/constant/color';
|
|
6
6
|
type BaseSelectProps = Omit<ComponentPropsWithRef<'select'>, 'size'>;
|
|
7
7
|
export type OptionType = {
|
|
8
8
|
id: string | number;
|
|
@@ -24,6 +24,9 @@ export interface SelectProps extends PropsWithChildren<BaseSelectProps> {
|
|
|
24
24
|
register?: UseFormRegisterReturn;
|
|
25
25
|
type?: 'default' | 'simple';
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* 현재 icon과 destructive 속성은 현재 디자인 시스템에 존재하지 않으니 사용하지 않는 것을 권장합니다.
|
|
29
|
+
*/
|
|
27
30
|
export declare const Select: import("react").ForwardRefExoticComponent<Omit<SelectProps, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
28
31
|
export {};
|
|
29
32
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare const PERIOD_ITEM: {
|
|
2
|
+
TODAY: {
|
|
3
|
+
text: string;
|
|
4
|
+
period: number;
|
|
5
|
+
unit: string;
|
|
6
|
+
};
|
|
7
|
+
YESTERDAY: {
|
|
8
|
+
text: string;
|
|
9
|
+
period: number;
|
|
10
|
+
unit: string;
|
|
11
|
+
};
|
|
12
|
+
'3DAYS': {
|
|
13
|
+
text: string;
|
|
14
|
+
period: number;
|
|
15
|
+
unit: string;
|
|
16
|
+
};
|
|
17
|
+
'7DAYS': {
|
|
18
|
+
text: string;
|
|
19
|
+
period: number;
|
|
20
|
+
unit: string;
|
|
21
|
+
};
|
|
22
|
+
'1WEEK': {
|
|
23
|
+
text: string;
|
|
24
|
+
period: number;
|
|
25
|
+
unit: string;
|
|
26
|
+
};
|
|
27
|
+
'15DAYS': {
|
|
28
|
+
text: string;
|
|
29
|
+
period: number;
|
|
30
|
+
unit: string;
|
|
31
|
+
};
|
|
32
|
+
'1MONTHS': {
|
|
33
|
+
text: string;
|
|
34
|
+
period: number;
|
|
35
|
+
unit: string;
|
|
36
|
+
};
|
|
37
|
+
'3MONTHS': {
|
|
38
|
+
text: string;
|
|
39
|
+
period: number;
|
|
40
|
+
unit: string;
|
|
41
|
+
};
|
|
42
|
+
'1YEAR': {
|
|
43
|
+
text: string;
|
|
44
|
+
period: number;
|
|
45
|
+
unit: string;
|
|
46
|
+
};
|
|
47
|
+
ENTIRE: {
|
|
48
|
+
text: string;
|
|
49
|
+
period: number;
|
|
50
|
+
unit: null;
|
|
51
|
+
};
|
|
52
|
+
NONE: {
|
|
53
|
+
text: string;
|
|
54
|
+
period: number;
|
|
55
|
+
unit: null;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=date-picker.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DurationInputArg1, DurationInputArg2 } from 'moment';
|
|
2
|
+
export declare function getDateFormat(date?: Date | string): string;
|
|
3
|
+
export declare function getToday(): Date;
|
|
4
|
+
export declare function getSubtractDate({ date, period, unit, }: {
|
|
5
|
+
date?: string | Date;
|
|
6
|
+
period: DurationInputArg1;
|
|
7
|
+
unit: DurationInputArg2;
|
|
8
|
+
}): Date;
|
|
9
|
+
//# sourceMappingURL=date-picker.d.ts.map
|