@nexus-cross/design-system 1.1.0 → 2.0.0-beta.1

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 (72) hide show
  1. package/claude-rules/nexus/CLAUDE.md +34 -6
  2. package/cursor-rules/CLAUDE.md +38 -9
  3. package/cursor-rules/nexus-project-setup.mdc +30 -16
  4. package/cursor-rules/nexus-ui-api.mdc +127 -41
  5. package/cursor-rules/nexus-ui-decisions.mdc +6 -2
  6. package/dist/chunks/{chunk-G3RLK2HS.js → chunk-3SCSND6S.js} +1 -1
  7. package/dist/chunks/{chunk-56ZOOQFE.mjs → chunk-AG2UJPFX.mjs} +124 -17
  8. package/dist/chunks/{chunk-EILXBLEV.mjs → chunk-QWK4CLS2.mjs} +1 -1
  9. package/dist/chunks/{chunk-5ASTWFJW.js → chunk-RC2Y4UH7.js} +127 -17
  10. package/dist/combobox.js +15 -3
  11. package/dist/combobox.mjs +1 -1
  12. package/dist/components/Combobox.d.ts +53 -8
  13. package/dist/components/Combobox.d.ts.map +1 -1
  14. package/dist/index.d.ts +2 -2
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +35 -24
  17. package/dist/index.mjs +4 -5
  18. package/dist/modal/index.js +11 -11
  19. package/dist/modal/index.mjs +2 -2
  20. package/dist/schemas/_all.json +62 -17
  21. package/dist/schemas/combobox.d.ts +33 -10
  22. package/dist/schemas/combobox.d.ts.map +1 -1
  23. package/dist/schemas/combobox.json +6 -6
  24. package/dist/schemas/comboboxOption.json +16 -11
  25. package/dist/schemas/comboboxOptionDescription.json +20 -0
  26. package/dist/schemas/comboboxOptionMeta.json +20 -0
  27. package/dist/schemas/index.d.ts +1 -1
  28. package/dist/schemas/index.d.ts.map +1 -1
  29. package/dist/schemas.js +74 -13
  30. package/dist/schemas.mjs +72 -13
  31. package/dist/styles/.generated/built.d.ts +1 -1
  32. package/dist/styles/.generated/built.d.ts.map +1 -1
  33. package/dist/styles/layer.js +2 -2
  34. package/dist/styles/layer.mjs +1 -1
  35. package/dist/styles.css +13 -0
  36. package/dist/styles.js +2 -2
  37. package/dist/styles.layered.css +13 -0
  38. package/dist/styles.mjs +1 -1
  39. package/dist/tailwind-v4.css +19 -0
  40. package/dist/tokens/TOKENS.md +426 -0
  41. package/dist/tokens/company.css +410 -0
  42. package/dist/tokens/css.css +405 -0
  43. package/dist/tokens/data/borderWidth.json +38 -0
  44. package/dist/tokens/data/breakpoint.json +23 -0
  45. package/dist/tokens/data/color.json +973 -0
  46. package/dist/tokens/data/index.ts +63 -0
  47. package/dist/tokens/data/motion.json +64 -0
  48. package/dist/tokens/data/opacity.json +65 -0
  49. package/dist/tokens/data/radius.json +25 -0
  50. package/dist/tokens/data/shadow.json +76 -0
  51. package/dist/tokens/data/size.json +46 -0
  52. package/dist/tokens/data/space.json +86 -0
  53. package/dist/tokens/data/typography.json +626 -0
  54. package/dist/tokens/data/zIndex.json +22 -0
  55. package/dist/tokens/index.d.ts +11 -0
  56. package/dist/tokens/index.d.ts.map +1 -0
  57. package/dist/tokens/index.js +12 -0
  58. package/dist/tokens/index.mjs +1 -0
  59. package/dist/tokens/tailwind.js +260 -0
  60. package/dist/tokens-domains/data/index.ts +16 -0
  61. package/dist/tokens-domains/data/prediction/domain.json +324 -0
  62. package/dist/tokens-domains/index.d.ts +12 -0
  63. package/dist/tokens-domains/index.d.ts.map +1 -0
  64. package/dist/tokens-domains/index.js +12 -0
  65. package/dist/tokens-domains/index.mjs +1 -0
  66. package/dist/tokens-domains/prediction-vars.css +154 -0
  67. package/dist/tokens-domains/prediction.css +153 -0
  68. package/dist/tokens-domains/prediction.md +70 -0
  69. package/dist/tokens-domains/tailwind.js +59 -0
  70. package/package.json +27 -6
  71. package/dist/chunks/{chunk-5ZVPTIL3.mjs → chunk-3VFBPFZF.mjs} +1 -1
  72. package/dist/chunks/{chunk-7F4SOLAC.js → chunk-U53UA76K.js} +1 -1
package/dist/schemas.mjs CHANGED
@@ -165,22 +165,57 @@ var selectItemPropsSchema = z.object({
165
165
  disabled: z.boolean().optional().describe("Disabled"),
166
166
  className: z.string().optional().describe("Style override")
167
167
  }).describe("Individual option within Select.");
168
- var comboboxOptionSchema = z.object({
169
- value: z.string().describe("Option value (unique key)"),
170
- label: z.any().describe("Display label (string | ReactNode)"),
171
- description: z.any().optional().describe("Secondary text below label (ReactNode)"),
172
- disabled: z.boolean().optional().describe("Disabled option")
173
- }).describe("Single Combobox option.");
168
+ var comboboxOptionPropsSchema = z.object({
169
+ value: z.string().describe(
170
+ "Unique value (string, required). Duplicate values within one Combobox produce a dev-mode console.error and the duplicate option is dropped."
171
+ ),
172
+ disabled: z.boolean().optional().describe(
173
+ "Disable selection. Skipped by keyboard navigation (Arrow Up/Down, Home/End)."
174
+ ),
175
+ textValue: z.string().optional().describe(
176
+ 'Text used for client-side filtering and the input display when this option is selected. If omitted, derived from `children` (string nodes only; OptionDescription / OptionMeta are excluded). Set this when label contains icons or non-text nodes you still want searchable (e.g. textValue="apple \uC0AC\uACFC fruit").'
177
+ ),
178
+ className: z.string().optional().describe('Class merged onto the rendered <div role="option">.'),
179
+ children: z.any().optional().describe(
180
+ "Label content + optional <Combobox.OptionDescription> / <Combobox.OptionMeta> slots."
181
+ )
182
+ }).describe(
183
+ `Single Combobox option. Direct child of <Combobox> only.
184
+
185
+ WHEN TO USE:
186
+ \u2022 One per selectable item; \`value\` MUST be unique within the Combobox
187
+ \u2022 Wrap rich content (icons, badges) directly as children \u2014 no escape hatch needed
188
+ \u2022 Use textValue when label is non-text (e.g. <Combobox.Option value="apple" textValue="\uC0AC\uACFC apple">\u{1F34E}</Combobox.Option>)
189
+
190
+ ANTI-PATTERNS:
191
+ \u2717 <Combobox><div><Combobox.Option/></div></Combobox> \u2014 Option must be a direct child
192
+ \u2717 Same value on two options \u2192 dev warning + silent drop; pick unique values
193
+ \u2717 Putting label text inside <Combobox.OptionDescription> \u2014 that slot is the secondary line below the label`
194
+ );
195
+ var comboboxOptionDescriptionPropsSchema = z.object({
196
+ children: z.any().optional().describe("Secondary text below the label (ReactNode)."),
197
+ className: z.string().optional().describe("Class for the description node.")
198
+ }).describe(
199
+ 'Secondary text shown below an option label. Use for hints like "Republic of Korea" beneath "\uD55C\uAD6D". Excluded from textValue-based search.'
200
+ );
201
+ var comboboxOptionMetaPropsSchema = z.object({
202
+ children: z.any().optional().describe("Right-aligned meta content (price, badge, shortcut, etc.)."),
203
+ className: z.string().optional().describe("Class for the meta slot.")
204
+ }).describe(
205
+ "Right-aligned slot inside an option. Use for prices, keyboard shortcuts, version tags, status badges. Excluded from textValue-based search."
206
+ );
174
207
  var comboboxPropsSchema = z.object({
175
- options: z.any().describe("Available options array (ComboboxOption[], required)"),
208
+ children: z.any().describe(
209
+ "<Combobox.Option> elements (required). Other children are ignored with a dev-mode warning. Async-search consumers swap this list as `onSearch` results arrive."
210
+ ),
176
211
  value: z.any().optional().describe("Selected value. string for single, string[] for multiple"),
177
212
  defaultValue: z.any().optional().describe("Initial value (uncontrolled)"),
178
213
  onValueChange: z.any().optional().describe("Value change callback. (value: string | string[]) => void"),
179
214
  multiple: z.boolean().default(false).describe("Multi-select mode. Selected values shown as chips inside input"),
180
- onSearch: z.any().optional().describe("Async search callback. (query: string) => void. Triggers external data fetching with debounce"),
215
+ onSearch: z.any().optional().describe("Async search callback. (query: string) => void. Triggers external data fetching with debounce. When set, the built-in client filter is disabled \u2014 render whatever <Combobox.Option> children match the latest results."),
181
216
  searchDebounce: z.number().default(250).describe("Debounce delay (ms) before onSearch fires"),
182
- loading: z.boolean().default(false).describe("Externally-controlled loading state. Shows spinner in input suffix"),
183
- filter: z.any().optional().describe("Custom client-side filter. (option, query) => boolean. Default: case-insensitive label includes match"),
217
+ loading: z.boolean().default(false).describe("Externally-controlled loading state. Shows spinner in input suffix and a status row inside the popover."),
218
+ filter: z.any().optional().describe("Custom client-side filter. (option: { value, textValue, disabled }, query: string) => boolean. Default: case-insensitive textValue includes match. Ignored when onSearch is set."),
184
219
  placeholder: z.string().optional().describe("Input placeholder"),
185
220
  emptyMessage: z.any().optional().describe('Message when no options match (string | ReactNode). Default: "\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C"'),
186
221
  loadingMessage: z.any().optional().describe('Message during loading state inside popover (string | ReactNode). Default: "\uAC80\uC0C9 \uC911\u2026"'),
@@ -194,7 +229,7 @@ var comboboxPropsSchema = z.object({
194
229
  className: z.string().optional().describe("Wrapper className"),
195
230
  popoverClassName: z.string().optional().describe("Popover content className")
196
231
  }).describe(
197
- `Searchable select. Text input + popover listbox. Single/multi-select. Sync (auto-filter) or async (onSearch + loading) modes.
232
+ `Searchable select with compound option API. Text input + popover listbox. Single/multi-select. Sync (auto-filter) or async (onSearch + loading) modes.
198
233
 
199
234
  WHEN TO USE:
200
235
  \u2022 Options \u2265 7, OR labels are long, OR search/filter is needed \u2192 Combobox (not Select)
@@ -202,8 +237,29 @@ WHEN TO USE:
202
237
  \u2022 Async data from server \u2192 set onSearch + loading
203
238
  For \u22647 simple options use Select. For free-text tags use TagInput.
204
239
 
240
+ COMPOUND API:
241
+ <Combobox value={v} onValueChange={setV} placeholder="\u2026">
242
+ <Combobox.Option value="kr">\uD55C\uAD6D</Combobox.Option>
243
+ <Combobox.Option value="jp" disabled>
244
+ \uC77C\uBCF8
245
+ <Combobox.OptionDescription>\uD488\uC808</Combobox.OptionDescription>
246
+ <Combobox.OptionMeta>JP</Combobox.OptionMeta>
247
+ </Combobox.Option>
248
+ </Combobox>
249
+
250
+ \u2022 <Combobox.Option> requires unique \`value\` (dev mode warns on duplicates and drops the duplicate)
251
+ \u2022 <Combobox.OptionDescription> = secondary line under label
252
+ \u2022 <Combobox.OptionMeta> = right-aligned slot (price, shortcut, badge)
253
+ \u2022 Both slots are excluded from textValue-based search
254
+
205
255
  ASYNC PATTERN:
206
- <Combobox options={results} loading={isFetching} onSearch={(q) => mutate(q)} />
256
+ <Combobox loading={isFetching} onSearch={(q) => mutate(q)}>
257
+ {results.map((u) => (
258
+ <Combobox.Option key={u.id} value={u.id}>{u.name}
259
+ <Combobox.OptionDescription>{u.email}</Combobox.OptionDescription>
260
+ </Combobox.Option>
261
+ ))}
262
+ </Combobox>
207
263
  \u2014 onSearch fires after searchDebounce (default 250ms). Do NOT clear input on result update; component preserves user's typing.
208
264
 
209
265
  IME (Korean/Japanese/Chinese): Enter during composition is ignored automatically \u2014 do not add custom keydown handlers.
@@ -211,6 +267,9 @@ IME (Korean/Japanese/Chinese): Enter during composition is ignored automatically
211
267
  ANTI-PATTERNS:
212
268
  \u2717 <Select> with 20 options \u2192 <Combobox>
213
269
  \u2717 Manual <input> + dropdown div + filter logic \u2192 <Combobox>
270
+ \u2717 Passing options through a prop array (legacy API removed) \u2192 use <Combobox.Option> children
271
+ \u2717 Wrapping options in extra elements (<div><Combobox.Option/></div>) \u2192 keep them as direct children
272
+ \u2717 Same \`value\` on two <Combobox.Option> \u2014 duplicates are warned + dropped in dev mode
214
273
  \u2717 Setting value externally to clear input mid-typing \u2192 use onValueChange instead`
215
274
  );
216
275
  var dropdownMenuItemSchema = z.object({
@@ -1596,4 +1655,4 @@ ANTI-PATTERNS:
1596
1655
  \u2717 Storing image as data-URL value (use File via onChange and upload to server)`
1597
1656
  );
1598
1657
 
1599
- export { accordionPropsSchema, alertPropsSchema, avatarPropsSchema, badgePropsSchema, breadcrumbPropsSchema, buttonPropsSchema, carouselButtonPropsSchema, carouselDotsPropsSchema, carouselPropsSchema, carouselSlidePropsSchema, checkBoxPropsSchema, chipPropsSchema, clientOnlyPropsSchema, comboboxOptionSchema, comboboxPropsSchema, countdownPropsSchema, counterPropsSchema, dataGridPropsSchema, dataListPropsSchema, datePickerPropsSchema, dividerPropsSchema, drawerClosePropsSchema, drawerContentPropsSchema, drawerDescriptionPropsSchema, drawerPropsSchema, drawerTitlePropsSchema, drawerTriggerPropsSchema, dropdownMenuPropsSchema, ellipsisPropsSchema, emptyStatePropsSchema, errorBoundaryPropsSchema, imageUploadPropsSchema, infiniteScrollPropsSchema, marqueePropsSchema, modalCallSchema, modalTemplatePropsSchema, numberInputPropsSchema, nxImagePropsSchema, paginationPropsSchema, popoverPropsSchema, priceInputPropsSchema, progressPropsSchema, radioGroupPropsSchema, radioItemPropsSchema, selectItemPropsSchema, selectPropsSchema, skeletonPropsSchema, sliderPropsSchema, spinnerPropsSchema, stepperPropsSchema, switchPropsSchema, tabPropsSchema, tablePropsSchema, tableRowPropsSchema, tagInputPropsSchema, tdColumnPropsSchema, textAreaPropsSchema, textInputPropsSchema, toastOptionsSchema, toasterPropsSchema, toggleGroupPropsSchema, tooltipPropsSchema, virtualGridPropsSchema, virtualListPropsSchema };
1658
+ export { accordionPropsSchema, alertPropsSchema, avatarPropsSchema, badgePropsSchema, breadcrumbPropsSchema, buttonPropsSchema, carouselButtonPropsSchema, carouselDotsPropsSchema, carouselPropsSchema, carouselSlidePropsSchema, checkBoxPropsSchema, chipPropsSchema, clientOnlyPropsSchema, comboboxOptionDescriptionPropsSchema, comboboxOptionMetaPropsSchema, comboboxOptionPropsSchema, comboboxPropsSchema, countdownPropsSchema, counterPropsSchema, dataGridPropsSchema, dataListPropsSchema, datePickerPropsSchema, dividerPropsSchema, drawerClosePropsSchema, drawerContentPropsSchema, drawerDescriptionPropsSchema, drawerPropsSchema, drawerTitlePropsSchema, drawerTriggerPropsSchema, dropdownMenuPropsSchema, ellipsisPropsSchema, emptyStatePropsSchema, errorBoundaryPropsSchema, imageUploadPropsSchema, infiniteScrollPropsSchema, marqueePropsSchema, modalCallSchema, modalTemplatePropsSchema, numberInputPropsSchema, nxImagePropsSchema, paginationPropsSchema, popoverPropsSchema, priceInputPropsSchema, progressPropsSchema, radioGroupPropsSchema, radioItemPropsSchema, selectItemPropsSchema, selectPropsSchema, skeletonPropsSchema, sliderPropsSchema, spinnerPropsSchema, stepperPropsSchema, switchPropsSchema, tabPropsSchema, tablePropsSchema, tableRowPropsSchema, tagInputPropsSchema, tdColumnPropsSchema, textAreaPropsSchema, textInputPropsSchema, toastOptionsSchema, toasterPropsSchema, toggleGroupPropsSchema, tooltipPropsSchema, virtualGridPropsSchema, virtualListPropsSchema };