@nexus-cross/design-system 1.0.3 → 1.0.4
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/cursor-rules/nexus-ui-api.mdc +208 -0
- package/dist/alert.d.mts +17 -0
- package/dist/alert.d.ts +17 -0
- package/dist/alert.js +16 -0
- package/dist/alert.mjs +3 -0
- package/dist/badge.d.mts +18 -0
- package/dist/badge.d.ts +18 -0
- package/dist/badge.js +16 -0
- package/dist/badge.mjs +3 -0
- package/dist/breadcrumb.d.mts +15 -0
- package/dist/breadcrumb.d.ts +15 -0
- package/dist/breadcrumb.js +12 -0
- package/dist/breadcrumb.mjs +3 -0
- package/dist/chunks/chunk-2N2EPBO4.js +120 -0
- package/dist/chunks/chunk-2UPGFY6E.mjs +76 -0
- package/dist/chunks/chunk-3ZWN66YH.js +53 -0
- package/dist/chunks/chunk-5PQ3UCKF.js +99 -0
- package/dist/chunks/chunk-6BWOKTVQ.mjs +87 -0
- package/dist/chunks/chunk-6DBRL6NA.mjs +81 -0
- package/dist/chunks/chunk-B5O6W3Z4.mjs +73 -0
- package/dist/chunks/chunk-C2DSAJTL.js +109 -0
- package/dist/chunks/chunk-CUTMLBC3.mjs +86 -0
- package/dist/chunks/chunk-CV4GMFWP.js +174 -0
- package/dist/chunks/chunk-DICN6GKE.js +99 -0
- package/dist/chunks/chunk-DYPPVXQF.js +143 -0
- package/dist/chunks/chunk-EJY7IVSK.mjs +31 -0
- package/dist/chunks/chunk-FUIBYZZ4.mjs +98 -0
- package/dist/chunks/chunk-H2G5FMRN.mjs +75 -0
- package/dist/chunks/chunk-H2V7RHYV.mjs +120 -0
- package/dist/chunks/chunk-KZ7S5VN2.js +7 -0
- package/dist/chunks/chunk-MMCA33FW.mjs +85 -0
- package/dist/chunks/chunk-NZHK76R3.js +109 -0
- package/dist/chunks/chunk-P73MEU7N.mjs +150 -0
- package/dist/chunks/chunk-PDJTSQOC.js +59 -0
- package/dist/chunks/chunk-PI464222.mjs +5 -0
- package/dist/chunks/chunk-S2GMEC43.js +109 -0
- package/dist/chunks/chunk-X3CTJ7TD.js +108 -0
- package/dist/chunks/chunk-YO5MSDPX.mjs +36 -0
- package/dist/chunks/chunk-ZI4LN2B2.js +96 -0
- package/dist/date-picker.d.mts +17 -0
- package/dist/date-picker.d.ts +17 -0
- package/dist/date-picker.js +12 -0
- package/dist/date-picker.mjs +3 -0
- package/dist/dropdown-menu.d.mts +30 -0
- package/dist/dropdown-menu.d.ts +30 -0
- package/dist/dropdown-menu.js +32 -0
- package/dist/dropdown-menu.mjs +3 -0
- package/dist/empty-state.d.mts +16 -0
- package/dist/empty-state.d.ts +16 -0
- package/dist/empty-state.js +16 -0
- package/dist/empty-state.mjs +3 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +267 -155
- package/dist/index.mjs +28 -16
- package/dist/modal/index.js +12 -12
- package/dist/modal/index.mjs +3 -3
- package/dist/nx-image.d.mts +13 -0
- package/dist/nx-image.d.ts +13 -0
- package/dist/nx-image.js +12 -0
- package/dist/nx-image.mjs +3 -0
- package/dist/progress.d.mts +18 -0
- package/dist/progress.d.ts +18 -0
- package/dist/progress.js +16 -0
- package/dist/progress.mjs +3 -0
- package/dist/schemas/_all.json +787 -4
- package/dist/schemas/alert.json +49 -0
- package/dist/schemas/badge.json +76 -0
- package/dist/schemas/breadcrumb.json +47 -0
- package/dist/schemas/datePicker.json +56 -0
- package/dist/schemas/dropdownMenu.json +83 -0
- package/dist/schemas/emptyState.json +44 -0
- package/dist/schemas/nxImage.json +56 -0
- package/dist/schemas/progress.json +63 -0
- package/dist/schemas/slider.json +78 -0
- package/dist/schemas/stepper.json +73 -0
- package/dist/schemas/tagInput.json +70 -0
- package/dist/schemas/toggleGroup.json +88 -0
- package/dist/schemas.d.mts +603 -143
- package/dist/schemas.d.ts +603 -143
- package/dist/schemas.js +160 -0
- package/dist/schemas.mjs +149 -1
- package/dist/slider.d.mts +20 -0
- package/dist/slider.d.ts +20 -0
- package/dist/slider.js +16 -0
- package/dist/slider.mjs +3 -0
- package/dist/stepper.d.mts +20 -0
- package/dist/stepper.d.ts +20 -0
- package/dist/stepper.js +16 -0
- package/dist/stepper.mjs +3 -0
- package/dist/styles/layer.js +2 -2
- package/dist/styles/layer.mjs +1 -1
- package/dist/styles.css +1190 -69
- package/dist/styles.js +2 -2
- package/dist/styles.layered.css +1190 -69
- package/dist/styles.mjs +1 -1
- package/dist/tag-input.d.mts +21 -0
- package/dist/tag-input.d.ts +21 -0
- package/dist/tag-input.js +16 -0
- package/dist/tag-input.mjs +3 -0
- package/dist/toggle-group.d.mts +36 -0
- package/dist/toggle-group.d.ts +36 -0
- package/dist/toggle-group.js +16 -0
- package/dist/toggle-group.mjs +3 -0
- package/package.json +67 -2
- package/dist/chunks/chunk-RLPPNY5F.js +0 -7
- package/dist/chunks/chunk-W7IPMNN2.mjs +0 -5
- package/dist/chunks/{chunk-3VFBPFZF.mjs → chunk-CWMLTXOH.mjs} +2 -2
- package/dist/chunks/{chunk-U53UA76K.js → chunk-HFBTS42N.js} +2 -2
|
@@ -1023,6 +1023,214 @@ Price/amount input field with prefix, suffix, balance display, and auto-fill on
|
|
|
1023
1023
|
|
|
1024
1024
|
---
|
|
1025
1025
|
|
|
1026
|
+
## Badge
|
|
1027
|
+
|
|
1028
|
+
Badge indicator. Dot or count display. Wraps children when provided.
|
|
1029
|
+
|
|
1030
|
+
| Prop | Type | Default | Description |
|
|
1031
|
+
|---|---|---|---|
|
|
1032
|
+
| `count` | `number` | - | Badge count number |
|
|
1033
|
+
| `max` | `number` | `99` | Max count (shows "99+" when exceeded) |
|
|
1034
|
+
| `dot` | `boolean` | `false` | Show as dot instead of count |
|
|
1035
|
+
| `showZero` | `boolean` | `false` | Show badge when count is 0 |
|
|
1036
|
+
| `variant` | `'danger'` \| `'primary'` \| `'secondary'` \| `'info'` \| `'success'` \| `'warning'` | `"danger"` | Color variant |
|
|
1037
|
+
| `size` | `'sm'` \| `'md'` \| `'lg'` | `"md"` | Size |
|
|
1038
|
+
| `offset` | `any` | - | Position offset [x, y] in px |
|
|
1039
|
+
| `children` | `ReactNode` | - | Anchor element to attach badge to (ReactNode) |
|
|
1040
|
+
| `className` | `string` | - | Style override |
|
|
1041
|
+
|
|
1042
|
+
---
|
|
1043
|
+
|
|
1044
|
+
## Progress
|
|
1045
|
+
|
|
1046
|
+
Progress bar. Linear progress indicator with percentage display.
|
|
1047
|
+
|
|
1048
|
+
| Prop | Type | Default | Description |
|
|
1049
|
+
|---|---|---|---|
|
|
1050
|
+
| `value` | `number` | `0` | Current progress value |
|
|
1051
|
+
| `max` | `number` | `100` | Maximum value |
|
|
1052
|
+
| `variant` | `'primary'` \| `'success'` \| `'warning'` \| `'danger'` \| `'info'` | `"primary"` | Color variant |
|
|
1053
|
+
| `size` | `'sm'` \| `'md'` \| `'lg'` | `"md"` | Bar height |
|
|
1054
|
+
| `showValue` | `boolean` | `false` | Show percentage text |
|
|
1055
|
+
| `indeterminate` | `boolean` | `false` | Indeterminate loading animation |
|
|
1056
|
+
| `label` | `string` | - | Label text above the bar |
|
|
1057
|
+
| `className` | `string` | - | Style override |
|
|
1058
|
+
|
|
1059
|
+
---
|
|
1060
|
+
|
|
1061
|
+
## Alert
|
|
1062
|
+
|
|
1063
|
+
Alert / Banner. Inline notification with icon, title, description.
|
|
1064
|
+
|
|
1065
|
+
| Prop | Type | Default | Description |
|
|
1066
|
+
|---|---|---|---|
|
|
1067
|
+
| `variant` | `'info'` \| `'success'` \| `'warning'` \| `'danger'` | `"info"` | Alert type / color |
|
|
1068
|
+
| `title` | `string` | - | Alert title (bold) |
|
|
1069
|
+
| `children` | `ReactNode` | - | Alert description (ReactNode) |
|
|
1070
|
+
| `icon` | `ReactNode` | - | Custom icon (ReactNode). Auto icon by variant if omitted |
|
|
1071
|
+
| `closable` | `boolean` | `false` | Show close button |
|
|
1072
|
+
| `onClose` | `ReactNode` | - | Close callback () => void |
|
|
1073
|
+
| `action` | `ReactNode` | - | Action area (ReactNode, e.g. Button) |
|
|
1074
|
+
| `className` | `string` | - | Style override |
|
|
1075
|
+
|
|
1076
|
+
---
|
|
1077
|
+
|
|
1078
|
+
## EmptyState
|
|
1079
|
+
|
|
1080
|
+
Empty state placeholder. Shown when data is empty or unavailable.
|
|
1081
|
+
|
|
1082
|
+
| Prop | Type | Default | Description |
|
|
1083
|
+
|---|---|---|---|
|
|
1084
|
+
| `icon` | `ReactNode` | - | Custom icon (ReactNode). Default inbox icon |
|
|
1085
|
+
| `title` | `string` | - | Title text |
|
|
1086
|
+
| `description` | `string` | - | Description text |
|
|
1087
|
+
| `action` | `ReactNode` | - | Action area (ReactNode, e.g. Button) |
|
|
1088
|
+
| `size` | `'sm'` \| `'md'` \| `'lg'` | `"md"` | Overall size |
|
|
1089
|
+
| `children` | `ReactNode` | - | Additional content (ReactNode) |
|
|
1090
|
+
| `className` | `string` | - | Style override |
|
|
1091
|
+
|
|
1092
|
+
---
|
|
1093
|
+
|
|
1094
|
+
## Breadcrumb
|
|
1095
|
+
|
|
1096
|
+
Breadcrumb navigation. Shows current location path.
|
|
1097
|
+
|
|
1098
|
+
| Prop | Type | Default | Description |
|
|
1099
|
+
|---|---|---|---|
|
|
1100
|
+
| `items` | `object`[] | - | Breadcrumb items array (required) |
|
|
1101
|
+
| `separator` | `ReactNode` | - | Custom separator (ReactNode). Default: chevron |
|
|
1102
|
+
| `maxItems` | `number` | - | Max visible items (collapses middle with "...") |
|
|
1103
|
+
| `className` | `string` | - | Style override |
|
|
1104
|
+
|
|
1105
|
+
---
|
|
1106
|
+
|
|
1107
|
+
## Stepper
|
|
1108
|
+
|
|
1109
|
+
Stepper. Step-by-step progress indicator.
|
|
1110
|
+
|
|
1111
|
+
| Prop | Type | Default | Description |
|
|
1112
|
+
|---|---|---|---|
|
|
1113
|
+
| `steps` | `object`[] | - | Step items array (required) |
|
|
1114
|
+
| `current` | `number` | `0` | Current step index (0-based) |
|
|
1115
|
+
| `status` | `'process'` \| `'error'` | `"process"` | Current step status |
|
|
1116
|
+
| `orientation` | `'horizontal'` \| `'vertical'` | `"horizontal"` | Layout direction |
|
|
1117
|
+
| `size` | `'sm'` \| `'md'` | `"md"` | Size |
|
|
1118
|
+
| `className` | `string` | - | Style override |
|
|
1119
|
+
|
|
1120
|
+
---
|
|
1121
|
+
|
|
1122
|
+
## DropdownMenu
|
|
1123
|
+
|
|
1124
|
+
Dropdown menu. Based on Radix DropdownMenu. Action menu for context/more menus.
|
|
1125
|
+
|
|
1126
|
+
| Prop | Type | Default | Description |
|
|
1127
|
+
|---|---|---|---|
|
|
1128
|
+
| `children` | `ReactNode` | - | Trigger element (ReactNode, required) |
|
|
1129
|
+
| `items` | `object`[] | - | Menu items array (required) |
|
|
1130
|
+
| `align` | `'start'` \| `'center'` \| `'end'` | `"start"` | Alignment |
|
|
1131
|
+
| `side` | `'top'` \| `'right'` \| `'bottom'` \| `'left'` | `"bottom"` | Position |
|
|
1132
|
+
| `className` | `string` | - | Trigger wrapper style |
|
|
1133
|
+
| `contentClassName` | `string` | - | Content panel style |
|
|
1134
|
+
|
|
1135
|
+
---
|
|
1136
|
+
|
|
1137
|
+
## ToggleGroup
|
|
1138
|
+
|
|
1139
|
+
Toggle group / Segment control. Based on Radix ToggleGroup.
|
|
1140
|
+
|
|
1141
|
+
| Prop | Type | Default | Description |
|
|
1142
|
+
|---|---|---|---|
|
|
1143
|
+
| `type` | `'single'` \| `'multiple'` | `"single"` | Selection mode |
|
|
1144
|
+
| `items` | `object`[] | - | Toggle items array (required) |
|
|
1145
|
+
| `value` | `ReactNode` | - | Controlled value (string | string[]) |
|
|
1146
|
+
| `defaultValue` | `ReactNode` | - | Default value |
|
|
1147
|
+
| `onValueChange` | `ReactNode` | - | Value change callback |
|
|
1148
|
+
| `variant` | `'default'` \| `'outline'` | `"default"` | Style variant |
|
|
1149
|
+
| `size` | `'sm'` \| `'md'` \| `'lg'` | `"md"` | Size |
|
|
1150
|
+
| `disabled` | `boolean` | - | Disable all items |
|
|
1151
|
+
| `className` | `string` | - | Style override |
|
|
1152
|
+
|
|
1153
|
+
---
|
|
1154
|
+
|
|
1155
|
+
## Slider
|
|
1156
|
+
|
|
1157
|
+
Slider / Range input. Based on Radix Slider. Supports single and range mode.
|
|
1158
|
+
|
|
1159
|
+
| Prop | Type | Default | Description |
|
|
1160
|
+
|---|---|---|---|
|
|
1161
|
+
| `value` | `number`[] | - | Controlled value (number[]). Use [50] for single, [20, 80] for range |
|
|
1162
|
+
| `defaultValue` | `number`[] | - | Default value |
|
|
1163
|
+
| `min` | `number` | `0` | Minimum |
|
|
1164
|
+
| `max` | `number` | `100` | Maximum |
|
|
1165
|
+
| `step` | `number` | `1` | Step increment |
|
|
1166
|
+
| `size` | `'sm'` \| `'md'` \| `'lg'` | `"md"` | Track height / thumb size |
|
|
1167
|
+
| `showValue` | `boolean` | `false` | Show current value text |
|
|
1168
|
+
| `formatValue` | `ReactNode` | - | Value format function (value: number) => string |
|
|
1169
|
+
| `label` | `string` | - | Label text |
|
|
1170
|
+
| `disabled` | `boolean` | - | Disabled |
|
|
1171
|
+
| `onValueChange` | `ReactNode` | - | Value change callback (value: number[]) => void |
|
|
1172
|
+
| `onValueCommit` | `ReactNode` | - | Committed value callback (on pointer up) |
|
|
1173
|
+
| `className` | `string` | - | Style override |
|
|
1174
|
+
|
|
1175
|
+
---
|
|
1176
|
+
|
|
1177
|
+
## TagInput
|
|
1178
|
+
|
|
1179
|
+
Tag input. Enter key to add, Backspace to delete last tag.
|
|
1180
|
+
|
|
1181
|
+
| Prop | Type | Default | Description |
|
|
1182
|
+
|---|---|---|---|
|
|
1183
|
+
| `value` | `string`[] | - | Controlled tags array |
|
|
1184
|
+
| `defaultValue` | `string`[] | - | Default tags |
|
|
1185
|
+
| `onChange` | `ReactNode` | - | Tags change callback (tags: string[]) => void |
|
|
1186
|
+
| `placeholder` | `string` | `"태그 입력 후 Enter"` | Input placeholder |
|
|
1187
|
+
| `max` | `number` | - | Maximum number of tags |
|
|
1188
|
+
| `disabled` | `boolean` | - | Disabled |
|
|
1189
|
+
| `allowDuplicates` | `boolean` | `false` | Allow duplicate tags |
|
|
1190
|
+
| `label` | `string` | - | Label text |
|
|
1191
|
+
| `description` | `string` | - | Helper text below input |
|
|
1192
|
+
| `size` | `'sm'` \| `'md'` \| `'lg'` | `"md"` | Size |
|
|
1193
|
+
| `className` | `string` | - | Style override |
|
|
1194
|
+
|
|
1195
|
+
---
|
|
1196
|
+
|
|
1197
|
+
## NxImage
|
|
1198
|
+
|
|
1199
|
+
Enhanced image. Lazy loading, fallback, aspect-ratio support.
|
|
1200
|
+
|
|
1201
|
+
| Prop | Type | Default | Description |
|
|
1202
|
+
|---|---|---|---|
|
|
1203
|
+
| `src` | `string` | - | Image source URL |
|
|
1204
|
+
| `alt` | `string` | - | Alt text |
|
|
1205
|
+
| `fallback` | `ReactNode` | - | Custom fallback element (ReactNode) |
|
|
1206
|
+
| `fallbackSrc` | `string` | - | Fallback image URL on error |
|
|
1207
|
+
| `aspectRatio` | `string` | - | CSS aspect-ratio (e.g. "16/9", "1/1") |
|
|
1208
|
+
| `objectFit` | `'cover'` \| `'contain'` \| `'fill'` \| `'none'` | `"cover"` | Object-fit mode |
|
|
1209
|
+
| `lazy` | `boolean` | `true` | Enable lazy loading (loading="lazy") |
|
|
1210
|
+
| `wrapperClassName` | `string` | - | Wrapper div style |
|
|
1211
|
+
| `className` | `string` | - | Image element style |
|
|
1212
|
+
|
|
1213
|
+
---
|
|
1214
|
+
|
|
1215
|
+
## DatePicker
|
|
1216
|
+
|
|
1217
|
+
DatePicker. Calendar popup for date selection. Based on react-day-picker.
|
|
1218
|
+
|
|
1219
|
+
| Prop | Type | Default | Description |
|
|
1220
|
+
|---|---|---|---|
|
|
1221
|
+
| `value` | `ReactNode` | - | Controlled date value (Date) |
|
|
1222
|
+
| `defaultValue` | `ReactNode` | - | Default date (Date) |
|
|
1223
|
+
| `onChange` | `ReactNode` | - | Date change callback (date: Date | undefined) => void |
|
|
1224
|
+
| `placeholder` | `string` | `"날짜 선택"` | Placeholder text |
|
|
1225
|
+
| `disabled` | `boolean` | `false` | Disabled |
|
|
1226
|
+
| `minDate` | `ReactNode` | - | Minimum selectable date (Date) |
|
|
1227
|
+
| `maxDate` | `ReactNode` | - | Maximum selectable date (Date) |
|
|
1228
|
+
| `locale` | `'ko'` \| `'en'` | `"ko"` | Calendar locale |
|
|
1229
|
+
| `formatStr` | `string` | `"yyyy-MM-dd"` | Date format string (date-fns format) |
|
|
1230
|
+
| `className` | `string` | - | Style override |
|
|
1231
|
+
|
|
1232
|
+
---
|
|
1233
|
+
|
|
1026
1234
|
## Hooks
|
|
1027
1235
|
|
|
1028
1236
|
### useModal
|
package/dist/alert.d.mts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const alertVariants: (props?: ({
|
|
6
|
+
variant?: "danger" | "info" | "success" | "warning" | null | undefined;
|
|
7
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
8
|
+
interface AlertProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
|
|
9
|
+
title?: string;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
closable?: boolean;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
action?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
|
|
17
|
+
export { Alert, type AlertProps, alertVariants };
|
package/dist/alert.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const alertVariants: (props?: ({
|
|
6
|
+
variant?: "danger" | "info" | "success" | "warning" | null | undefined;
|
|
7
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
8
|
+
interface AlertProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
|
|
9
|
+
title?: string;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
closable?: boolean;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
action?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
|
|
17
|
+
export { Alert, type AlertProps, alertVariants };
|
package/dist/alert.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk5PQ3UCKF_js = require('./chunks/chunk-5PQ3UCKF.js');
|
|
4
|
+
require('./chunks/chunk-CZC76ZD5.js');
|
|
5
|
+
require('./chunks/chunk-JNMCYWGY.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "Alert", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunk5PQ3UCKF_js.Alert; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "alertVariants", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunk5PQ3UCKF_js.alertVariants; }
|
|
16
|
+
});
|
package/dist/alert.mjs
ADDED
package/dist/badge.d.mts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const badgeVariants: (props?: ({
|
|
6
|
+
variant?: "primary" | "secondary" | "danger" | "info" | "success" | "warning" | null | undefined;
|
|
7
|
+
size?: "lg" | "md" | "sm" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
10
|
+
count?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
dot?: boolean;
|
|
13
|
+
showZero?: boolean;
|
|
14
|
+
offset?: [number, number];
|
|
15
|
+
}
|
|
16
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
17
|
+
|
|
18
|
+
export { Badge, type BadgeProps, badgeVariants };
|
package/dist/badge.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const badgeVariants: (props?: ({
|
|
6
|
+
variant?: "primary" | "secondary" | "danger" | "info" | "success" | "warning" | null | undefined;
|
|
7
|
+
size?: "lg" | "md" | "sm" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
10
|
+
count?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
dot?: boolean;
|
|
13
|
+
showZero?: boolean;
|
|
14
|
+
offset?: [number, number];
|
|
15
|
+
}
|
|
16
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
17
|
+
|
|
18
|
+
export { Badge, type BadgeProps, badgeVariants };
|
package/dist/badge.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkS2GMEC43_js = require('./chunks/chunk-S2GMEC43.js');
|
|
4
|
+
require('./chunks/chunk-CZC76ZD5.js');
|
|
5
|
+
require('./chunks/chunk-JNMCYWGY.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "Badge", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkS2GMEC43_js.Badge; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "badgeVariants", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkS2GMEC43_js.badgeVariants; }
|
|
16
|
+
});
|
package/dist/badge.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface BreadcrumbItem {
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
href?: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
|
|
9
|
+
items: BreadcrumbItem[];
|
|
10
|
+
separator?: React.ReactNode;
|
|
11
|
+
maxItems?: number;
|
|
12
|
+
}
|
|
13
|
+
declare const Breadcrumb: React.ForwardRefExoticComponent<BreadcrumbProps & React.RefAttributes<HTMLElement>>;
|
|
14
|
+
|
|
15
|
+
export { Breadcrumb, type BreadcrumbItem, type BreadcrumbProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface BreadcrumbItem {
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
href?: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
|
|
9
|
+
items: BreadcrumbItem[];
|
|
10
|
+
separator?: React.ReactNode;
|
|
11
|
+
maxItems?: number;
|
|
12
|
+
}
|
|
13
|
+
declare const Breadcrumb: React.ForwardRefExoticComponent<BreadcrumbProps & React.RefAttributes<HTMLElement>>;
|
|
14
|
+
|
|
15
|
+
export { Breadcrumb, type BreadcrumbItem, type BreadcrumbProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk3ZWN66YH_js = require('./chunks/chunk-3ZWN66YH.js');
|
|
4
|
+
require('./chunks/chunk-CZC76ZD5.js');
|
|
5
|
+
require('./chunks/chunk-JNMCYWGY.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "Breadcrumb", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunk3ZWN66YH_js.Breadcrumb; }
|
|
12
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkCZC76ZD5_js = require('./chunk-CZC76ZD5.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var reactDayPicker = require('react-day-picker');
|
|
6
|
+
var dateFns = require('date-fns');
|
|
7
|
+
var locale = require('date-fns/locale');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
12
|
+
var n = Object.create(null);
|
|
13
|
+
if (e) {
|
|
14
|
+
Object.keys(e).forEach(function (k) {
|
|
15
|
+
if (k !== 'default') {
|
|
16
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return e[k]; }
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
n.default = e;
|
|
25
|
+
return Object.freeze(n);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
29
|
+
|
|
30
|
+
var CalendarIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsxs("svg", { className, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
31
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "4", width: "14", height: "14", rx: "2" }),
|
|
32
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 8h14M7 2v4M13 2v4", strokeLinecap: "round" })
|
|
33
|
+
] });
|
|
34
|
+
var DatePicker = ({
|
|
35
|
+
value,
|
|
36
|
+
defaultValue,
|
|
37
|
+
onChange,
|
|
38
|
+
placeholder = "\uB0A0\uC9DC \uC120\uD0DD",
|
|
39
|
+
disabled = false,
|
|
40
|
+
minDate,
|
|
41
|
+
maxDate,
|
|
42
|
+
locale: localeProp = "ko",
|
|
43
|
+
formatStr = "yyyy-MM-dd",
|
|
44
|
+
className
|
|
45
|
+
}) => {
|
|
46
|
+
const [internalDate, setInternalDate] = React__namespace.useState(defaultValue);
|
|
47
|
+
const [open, setOpen] = React__namespace.useState(false);
|
|
48
|
+
const wrapperRef = React__namespace.useRef(null);
|
|
49
|
+
const selected = value ?? internalDate;
|
|
50
|
+
const handleSelect = React__namespace.useCallback(
|
|
51
|
+
(date) => {
|
|
52
|
+
if (!value) setInternalDate(date);
|
|
53
|
+
onChange?.(date);
|
|
54
|
+
setOpen(false);
|
|
55
|
+
},
|
|
56
|
+
[value, onChange]
|
|
57
|
+
);
|
|
58
|
+
React__namespace.useEffect(() => {
|
|
59
|
+
const handleClickOutside = (e) => {
|
|
60
|
+
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
61
|
+
setOpen(false);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
if (open) document.addEventListener("mousedown", handleClickOutside);
|
|
65
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
66
|
+
}, [open]);
|
|
67
|
+
const displayText = selected ? dateFns.format(selected, formatStr, { locale: localeProp === "ko" ? locale.ko : void 0 }) : placeholder;
|
|
68
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: wrapperRef, className: chunkCZC76ZD5_js.cn("nexus-datepicker", className), children: [
|
|
69
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
70
|
+
"button",
|
|
71
|
+
{
|
|
72
|
+
type: "button",
|
|
73
|
+
className: chunkCZC76ZD5_js.cn(
|
|
74
|
+
"nexus-datepicker__trigger",
|
|
75
|
+
!selected && "nexus-datepicker__trigger--placeholder"
|
|
76
|
+
),
|
|
77
|
+
onClick: () => !disabled && setOpen(!open),
|
|
78
|
+
disabled,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, { className: "nexus-datepicker__icon" }),
|
|
81
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: displayText })
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
open && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-datepicker__popover", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
reactDayPicker.DayPicker,
|
|
87
|
+
{
|
|
88
|
+
mode: "single",
|
|
89
|
+
selected,
|
|
90
|
+
onSelect: handleSelect,
|
|
91
|
+
locale: localeProp === "ko" ? locale.ko : void 0,
|
|
92
|
+
disabled: [
|
|
93
|
+
...minDate ? [{ before: minDate }] : [],
|
|
94
|
+
...maxDate ? [{ after: maxDate }] : []
|
|
95
|
+
],
|
|
96
|
+
classNames: {
|
|
97
|
+
root: "nexus-calendar",
|
|
98
|
+
months: "nexus-calendar__months",
|
|
99
|
+
month_caption: "nexus-calendar__caption",
|
|
100
|
+
nav: "nexus-calendar__nav",
|
|
101
|
+
button_previous: "nexus-calendar__nav-btn",
|
|
102
|
+
button_next: "nexus-calendar__nav-btn",
|
|
103
|
+
month_grid: "nexus-calendar__grid",
|
|
104
|
+
weekdays: "nexus-calendar__head-row",
|
|
105
|
+
weekday: "nexus-calendar__head-cell",
|
|
106
|
+
week: "nexus-calendar__row",
|
|
107
|
+
day: "nexus-calendar__cell",
|
|
108
|
+
day_button: "nexus-calendar__day",
|
|
109
|
+
selected: "nexus-calendar__day--selected",
|
|
110
|
+
today: "nexus-calendar__day--today",
|
|
111
|
+
outside: "nexus-calendar__day--outside",
|
|
112
|
+
disabled: "nexus-calendar__day--disabled"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
) })
|
|
116
|
+
] });
|
|
117
|
+
};
|
|
118
|
+
DatePicker.displayName = "DatePicker";
|
|
119
|
+
|
|
120
|
+
exports.DatePicker = DatePicker;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { cn } from './chunk-MCKOWMLS.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var alertVariants = cva("nexus-alert", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
info: "nexus-alert--info",
|
|
10
|
+
success: "nexus-alert--success",
|
|
11
|
+
warning: "nexus-alert--warning",
|
|
12
|
+
danger: "nexus-alert--danger"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
variant: "info"
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var statusIcons = {
|
|
20
|
+
info: ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }),
|
|
21
|
+
success: ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }),
|
|
22
|
+
warning: ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
|
|
23
|
+
danger: ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) })
|
|
24
|
+
};
|
|
25
|
+
var CloseIcon = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M4 4l8 8M12 4l-8 8", strokeLinecap: "round" }) });
|
|
26
|
+
var Alert = React.forwardRef(
|
|
27
|
+
({
|
|
28
|
+
className,
|
|
29
|
+
children,
|
|
30
|
+
variant = "info",
|
|
31
|
+
title,
|
|
32
|
+
icon,
|
|
33
|
+
closable = false,
|
|
34
|
+
onClose,
|
|
35
|
+
action,
|
|
36
|
+
...props
|
|
37
|
+
}, ref) => {
|
|
38
|
+
const [visible, setVisible] = React.useState(true);
|
|
39
|
+
const handleClose = React.useCallback(() => {
|
|
40
|
+
setVisible(false);
|
|
41
|
+
onClose?.();
|
|
42
|
+
}, [onClose]);
|
|
43
|
+
if (!visible) return null;
|
|
44
|
+
const IconComp = icon === void 0 ? statusIcons[variant ?? "info"] : null;
|
|
45
|
+
return /* @__PURE__ */ jsxs(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
ref,
|
|
49
|
+
role: "alert",
|
|
50
|
+
className: cn(alertVariants({ variant }), className),
|
|
51
|
+
...props,
|
|
52
|
+
children: [
|
|
53
|
+
(icon || IconComp) && /* @__PURE__ */ jsx("span", { className: "nexus-alert__icon", children: icon ?? (IconComp && /* @__PURE__ */ jsx(IconComp, { className: "nexus-alert__icon-svg" })) }),
|
|
54
|
+
/* @__PURE__ */ jsxs("div", { className: "nexus-alert__body", children: [
|
|
55
|
+
title && /* @__PURE__ */ jsx("p", { className: "nexus-alert__title", children: title }),
|
|
56
|
+
children && /* @__PURE__ */ jsx("div", { className: "nexus-alert__description", children })
|
|
57
|
+
] }),
|
|
58
|
+
action && /* @__PURE__ */ jsx("div", { className: "nexus-alert__action", children: action }),
|
|
59
|
+
closable && /* @__PURE__ */ jsx(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
type: "button",
|
|
63
|
+
className: "nexus-alert__close",
|
|
64
|
+
onClick: handleClose,
|
|
65
|
+
"aria-label": "Close",
|
|
66
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { className: "nexus-alert__close-icon" })
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
Alert.displayName = "Alert";
|
|
75
|
+
|
|
76
|
+
export { Alert, alertVariants };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkCZC76ZD5_js = require('./chunk-CZC76ZD5.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var ChevronRight = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 4l4 4-4 4", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
28
|
+
var Breadcrumb = React__namespace.forwardRef(
|
|
29
|
+
({ className, items, separator, maxItems, ...props }, ref) => {
|
|
30
|
+
let displayItems = items;
|
|
31
|
+
let collapsed = false;
|
|
32
|
+
if (maxItems && maxItems > 2 && items.length > maxItems) {
|
|
33
|
+
displayItems = [
|
|
34
|
+
items[0],
|
|
35
|
+
{ label: "..." },
|
|
36
|
+
...items.slice(-(maxItems - 2))
|
|
37
|
+
];
|
|
38
|
+
collapsed = true;
|
|
39
|
+
}
|
|
40
|
+
const sep = separator ?? /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { className: "nexus-breadcrumb__separator-icon" });
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": "Breadcrumb", className: chunkCZC76ZD5_js.cn("nexus-breadcrumb", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "nexus-breadcrumb__list", children: displayItems.map((item, i) => {
|
|
42
|
+
const isLast = i === displayItems.length - 1;
|
|
43
|
+
const isCollapsed = collapsed && i === 1;
|
|
44
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "nexus-breadcrumb__item", children: [
|
|
45
|
+
i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-breadcrumb__separator", "aria-hidden": "true", children: sep }),
|
|
46
|
+
isCollapsed ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-breadcrumb__ellipsis", children: "\u2026" }) : isLast ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-breadcrumb__current", "aria-current": "page", children: item.label }) : item.href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href, className: "nexus-breadcrumb__link", onClick: item.onClick, children: item.label }) : item.onClick ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nexus-breadcrumb__link nexus-breadcrumb__link--btn", onClick: item.onClick, children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-breadcrumb__link", children: item.label })
|
|
47
|
+
] }, i);
|
|
48
|
+
}) }) });
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
52
|
+
|
|
53
|
+
exports.Breadcrumb = Breadcrumb;
|