@create-ui/cli 0.5.8 → 0.5.9

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 (74) hide show
  1. package/dist/{chunk-RMTTHCB3.js → chunk-2ELKDGGM.js} +3 -3
  2. package/dist/{chunk-RMTTHCB3.js.map → chunk-2ELKDGGM.js.map} +1 -1
  3. package/dist/chunk-643QI2I2.js +102 -0
  4. package/dist/chunk-643QI2I2.js.map +1 -0
  5. package/dist/{chunk-NQFMXHMH.js → chunk-KQTXDVKV.js} +3 -3
  6. package/dist/chunk-KQTXDVKV.js.map +1 -0
  7. package/dist/index.d.ts +360 -360
  8. package/dist/index.js +2 -2
  9. package/dist/index.js.map +1 -1
  10. package/dist/mcp/index.js +1 -1
  11. package/dist/registry/index.d.ts +2 -2
  12. package/dist/registry/index.js +1 -1
  13. package/dist/schema/index.d.ts +715 -715
  14. package/dist/skills/createui/SKILL.md +201 -177
  15. package/dist/skills/createui/agents/openai.yml +1 -1
  16. package/dist/skills/createui/cli.md +42 -42
  17. package/dist/skills/createui/customization.md +20 -15
  18. package/dist/skills/createui/evals/evals.json +68 -5
  19. package/dist/skills/createui/mcp.md +14 -5
  20. package/dist/skills/createui/reference/accordion.md +127 -0
  21. package/dist/skills/createui/reference/app-store-badge.md +88 -0
  22. package/dist/skills/createui/reference/aspect-ratio.md +52 -0
  23. package/dist/skills/createui/reference/avatar.md +230 -0
  24. package/dist/skills/createui/reference/badge.md +110 -0
  25. package/dist/skills/createui/reference/breadcrumb.md +153 -0
  26. package/dist/skills/createui/reference/button-group.md +116 -0
  27. package/dist/skills/createui/reference/button.md +104 -0
  28. package/dist/skills/createui/reference/checkbox-group.md +118 -0
  29. package/dist/skills/createui/reference/checkbox.md +79 -0
  30. package/dist/skills/createui/reference/chip.md +115 -0
  31. package/dist/skills/createui/reference/close-button.md +83 -0
  32. package/dist/skills/createui/reference/command.md +69 -0
  33. package/dist/skills/createui/reference/country-flag.md +109 -0
  34. package/dist/skills/createui/reference/credit-card-input.md +76 -0
  35. package/dist/skills/createui/reference/date-input.md +71 -0
  36. package/dist/skills/createui/reference/dropdown-menu.md +164 -0
  37. package/dist/skills/createui/reference/field.md +186 -0
  38. package/dist/skills/createui/reference/info-tooltip.md +110 -0
  39. package/dist/skills/createui/reference/inline-alert.md +146 -0
  40. package/dist/skills/createui/reference/input-group.md +171 -0
  41. package/dist/skills/createui/reference/input-otp.md +130 -0
  42. package/dist/skills/createui/reference/input-stepper.md +120 -0
  43. package/dist/skills/createui/reference/input.md +118 -0
  44. package/dist/skills/createui/reference/label.md +121 -0
  45. package/dist/skills/createui/reference/pagination.md +157 -0
  46. package/dist/skills/createui/reference/password-strength.md +70 -0
  47. package/dist/skills/createui/reference/phone-input.md +77 -0
  48. package/dist/skills/createui/reference/progress.md +158 -0
  49. package/dist/skills/createui/reference/radio-group.md +133 -0
  50. package/dist/skills/createui/reference/radio.md +79 -0
  51. package/dist/skills/createui/reference/scroll-area.md +212 -0
  52. package/dist/skills/createui/reference/segmented-control.md +146 -0
  53. package/dist/skills/createui/reference/select.md +204 -0
  54. package/dist/skills/createui/reference/separator.md +99 -0
  55. package/dist/skills/createui/reference/social-login-button.md +130 -0
  56. package/dist/skills/createui/reference/spinner.md +68 -0
  57. package/dist/skills/createui/reference/status-badge.md +89 -0
  58. package/dist/skills/createui/reference/switch-group.md +122 -0
  59. package/dist/skills/createui/reference/switch.md +75 -0
  60. package/dist/skills/createui/reference/tab-menu.md +165 -0
  61. package/dist/skills/createui/reference/text-link.md +84 -0
  62. package/dist/skills/createui/reference/textarea.md +50 -0
  63. package/dist/skills/createui/reference/toast.md +162 -0
  64. package/dist/skills/createui/reference/tooltip.md +63 -0
  65. package/dist/skills/createui/rules/composition.md +41 -25
  66. package/dist/skills/createui/rules/design.md +266 -0
  67. package/dist/skills/createui/rules/forms.md +44 -15
  68. package/dist/skills/createui/rules/icons.md +64 -18
  69. package/dist/skills/createui/rules/styling.md +53 -14
  70. package/dist/utils/index.js +1 -1
  71. package/package.json +1 -1
  72. package/dist/chunk-M5DYT2NE.js +0 -64
  73. package/dist/chunk-M5DYT2NE.js.map +0 -1
  74. package/dist/chunk-NQFMXHMH.js.map +0 -1
@@ -0,0 +1,115 @@
1
+ <!-- GENERATED FILE - do not edit. Source: registry/ui/chip.tsx. Regenerate with `pnpm skill:build`. Curated notes: apps/v4/scripts/skill-reference/notes/chip.md -->
2
+
3
+ # chip
4
+
5
+ Interactive removable tag with closable, onClose and selected props; icon or Avatar auto-slots as the first child
6
+
7
+ Install: `npx @create-ui/cli add chip`
8
+
9
+ ## Import
10
+
11
+ ```tsx
12
+ import { Chip } from "@/components/ui/chip"
13
+ ```
14
+
15
+ Also exported: `chipVariants`
16
+
17
+ ## Chip props
18
+
19
+ | Prop | Type | Default |
20
+ | --- | --- | --- |
21
+ | variant | `neutral \| info \| danger \| success` | `neutral` |
22
+ | appearance | `outline \| soft` | `outline` |
23
+ | size | `xs \| sm \| md \| lg \| xl` | `lg` |
24
+ | shape | `pill \| rounded` | `rounded` |
25
+ | selected | `boolean` (controlled-only; Chip sets data-selected for styling but never toggles it itself (see chip-interactive)) | `false` |
26
+ | disabled | `boolean` | `false` |
27
+ | dragging | `boolean` (visual-only (drag shadow + data-dragging styles); drive it from your dnd library state, Chip wires no drag handlers) | `false` |
28
+ | onClose | `(e: React.MouseEvent) => void` | - |
29
+ | closable | `boolean` (shows the built-in close button; defaults to true when onClose is set, closable={false} hides it) | - |
30
+
31
+ Extends `React.ComponentProps<"div">`.
32
+
33
+ ## Examples
34
+
35
+ From `chip-demo`:
36
+
37
+ ```tsx
38
+ "use client"
39
+
40
+ import { RiCheckboxCircleFill, RiSparklingFill } from "@create-ui/assets/icons"
41
+
42
+ import { Chip } from "@/components/ui/chip"
43
+
44
+ export default function ChipDemo() {
45
+ return (
46
+ <div className="flex flex-wrap items-center gap-2">
47
+ <Chip shape="pill" variant="success" appearance="soft">
48
+ Live
49
+ </Chip>
50
+ <Chip shape="pill" variant="info">
51
+ In Review
52
+ </Chip>
53
+ <Chip shape="pill" variant="danger" appearance="soft">
54
+ Blocked
55
+ </Chip>
56
+ <Chip shape="pill">Draft</Chip>
57
+ <Chip shape="pill" variant="info" appearance="soft" selected>
58
+ <RiCheckboxCircleFill />
59
+ Approved
60
+ </Chip>
61
+ <Chip shape="pill" appearance="soft" closable onClose={() => {}}>
62
+ <RiSparklingFill />
63
+ Featured
64
+ </Chip>
65
+ </div>
66
+ )
67
+ }
68
+ ```
69
+
70
+ From `chip-with-icon`:
71
+
72
+ ```tsx
73
+ import { RiFilter3Fill } from "@create-ui/assets/icons"
74
+
75
+ import { Chip } from "@/components/ui/chip"
76
+
77
+ export default function ChipWithIcon() {
78
+ return (
79
+ <div className="flex flex-wrap items-center gap-2">
80
+ <Chip variant="info">
81
+ <RiFilter3Fill />
82
+ Filter
83
+ </Chip>
84
+ <Chip variant="success" appearance="soft">
85
+ <RiFilter3Fill />
86
+ Filter
87
+ </Chip>
88
+ <Chip variant="danger" shape="pill">
89
+ <RiFilter3Fill />
90
+ Filter
91
+ </Chip>
92
+ </div>
93
+ )
94
+ }
95
+ ```
96
+
97
+ More: `npx @create-ui/cli view chip` or MCP `get_item_examples_from_registries` with "chip-demo" / "chip-example".
98
+
99
+ ## When to use
100
+
101
+ Interactive or removable tags: filter rows, selected entities, tag-entry tokens. Passive status or count labels are `Badge`; primary actions are `Button`; a lone on/off form control is `Switch`.
102
+
103
+ ## Gotchas
104
+
105
+ - Chip has NO `leadingIcon`/`avatar`/`flag` props. The first element child is auto-hoisted into the lead slot and force-sized by the chip's `size`; string children become the label:
106
+
107
+ ```tsx
108
+ <Chip closable onClose={remove}><RiUserLine />Ayse Yilmaz</Chip>
109
+ <Chip><Avatar size="2xs" stroke={false}><AvatarImage src={src} /></Avatar>Ayse</Chip>
110
+ ```
111
+
112
+ - Hoisting means there is no trailing icon slot: an element placed AFTER the text still renders in the lead position, and wrapping the label in a `<span>` hoists it too. Keep the label as plain text; the only trailing affordance is the built-in close button.
113
+ - `Avatar`, flag, and brand leads are auto-detected as media: the chip swaps to tighter uniform padding and clips the lead (circular under `shape="pill"`). Plain `Ri*` icons are not media. Never hand-size or hand-pad either kind.
114
+ - The close button is built in; never append your own X icon. Its click stops propagation (root `onClick` will not fire) and it is mouse-only (no tabIndex, no key handler), so wire keyboard removal yourself if you need it.
115
+ - `onClick` adds `role="button"` and a pointer cursor but NO Enter/Space handler. The root always has `tabIndex={0}` even without `onClick`, so purely decorative chips still land in the tab order.
@@ -0,0 +1,83 @@
1
+ <!-- GENERATED FILE - do not edit. Source: registry/ui/close-button.tsx. Regenerate with `pnpm skill:build`. Curated notes: apps/v4/scripts/skill-reference/notes/close-button.md -->
2
+
3
+ # close-button
4
+
5
+ Icon-only X dismiss button for modals, toasts and overlays; neutral/inverse variants, four appearances, xs to 2xl sizes
6
+
7
+ Install: `npx @create-ui/cli add close-button`
8
+
9
+ ## Import
10
+
11
+ ```tsx
12
+ import { CloseButton } from "@/components/ui/close-button"
13
+ ```
14
+
15
+ Also exported: `closeButtonVariants`
16
+
17
+ ## CloseButton props
18
+
19
+ | Prop | Type | Default |
20
+ | --- | --- | --- |
21
+ | variant | `neutral \| inverse` (Theme-relative, not absolute luminance: the static-*-alpha tokens it uses remap under .dark, so neutral tracks the theme background and inverse pairs with theme-inverted surfaces like bg-strongest panels.) | `neutral` |
22
+ | appearance | `solid \| outline \| ghost \| soft` | `ghost` |
23
+ | size | `xs \| sm \| md \| lg \| xl \| 2xl` | `md` |
24
+ | shape | `rounded \| pill \| square` (rounded is size-aware: the radius scales from rounded-xs at xs/sm up to rounded-lg at 2xl via compound variants.) | `rounded` |
25
+ | asChild | `boolean` (Drops the built-in X icon; you must supply your own child element. Also stops setting type=button and maps disabled to aria-disabled plus tabIndex={-1} instead of the native disabled attribute.) | `false` |
26
+
27
+ Extends `React.ComponentProps<"button">`.
28
+
29
+ ## Examples
30
+
31
+ From `close-button-demo`:
32
+
33
+ ```tsx
34
+ import { CloseButton } from "@/components/ui/close-button"
35
+
36
+ export default function CloseButtonDemo() {
37
+ return <CloseButton />
38
+ }
39
+ ```
40
+
41
+ From `close-button-composition`:
42
+
43
+ ```tsx
44
+ import { RiInformationFill } from "@create-ui/assets/icons"
45
+
46
+ import {
47
+ InlineAlert,
48
+ InlineAlertClose,
49
+ InlineAlertContent,
50
+ InlineAlertHeading,
51
+ InlineAlertIcon,
52
+ InlineAlertTitle,
53
+ } from "@/components/ui/inline-alert"
54
+
55
+ export default function CloseButtonComposition() {
56
+ return (
57
+ <InlineAlert variant="info">
58
+ <InlineAlertIcon>
59
+ <RiInformationFill />
60
+ </InlineAlertIcon>
61
+ <InlineAlertContent>
62
+ <InlineAlertHeading>
63
+ <InlineAlertTitle>Heads up</InlineAlertTitle>
64
+ </InlineAlertHeading>
65
+ </InlineAlertContent>
66
+ <InlineAlertClose />
67
+ </InlineAlert>
68
+ )
69
+ }
70
+ ```
71
+
72
+ More: `npx @create-ui/cli view close-button` or MCP `get_item_examples_from_registries` with "close-button-demo" / "close-button-example".
73
+
74
+ ## When to use
75
+ The dismiss control for surfaces: dialog corners, toast trailing slots, banner and drawer close affordances. It renders RiCloseLargeLine with aria-label="Close" automatically, so bare `<CloseButton />` is the normal usage. For any other icon-only action use Button with `iconOnly` + `leadingIcon` + `aria-label`; for a labeled action ("Cancel", "Close") use Button with text; for removable tags use Chip's `closable`/`onClose`.
76
+
77
+ ## Gotchas
78
+ - The X icon is baked in. Without `asChild`, `children` are silently discarded, so passing a custom icon child does nothing; the only icon-swap path is `asChild` with your own child element.
79
+ - Do not hand-place CloseButton inside components that ship their own close slot: InlineAlert has `InlineAlertClose`, Toast has `ToastClose`, Chip has `closable`/`onClose`. Those wrappers handle placement and wiring (see close-button-composition).
80
+ - `aria-label="Close"` is set before the props spread, so passing your own `aria-label` (e.g. "Dismiss notification") overrides it cleanly.
81
+ - Despite the "static" prefix, the `static-black/white-alpha-*` classes behind outline/ghost/soft remap under `.dark`, so colors follow the theme. On a surface whose luminance is fixed regardless of theme (photo overlay, brand color), neither variant stays correct across modes.
82
+ - Native render hard-sets `type="button"`, so it never submits a wrapping form; with `asChild` no `type` is set and the host element's default applies.
83
+ - `disabled` behaves differently per render mode: native gets the real `disabled` attribute; `asChild` gets `aria-disabled` + `tabIndex={-1}` (base classes add `aria-disabled:pointer-events-none`).
@@ -0,0 +1,69 @@
1
+ <!-- GENERATED FILE - do not edit. Source: registry/ui/command.tsx, registry/ui/dialog.tsx. Regenerate with `pnpm skill:build`. Curated notes: apps/v4/scripts/skill-reference/notes/command.md -->
2
+
3
+ # command
4
+
5
+ cmdk command palette; Command renders inline while CommandDialog opens as a modal (bundles dialog.tsx)
6
+
7
+ Install: `npx @create-ui/cli add command`
8
+
9
+ ## Import
10
+
11
+ ```tsx
12
+ import { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator } from "@/components/ui/command"
13
+ import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "@/components/ui/dialog"
14
+ ```
15
+
16
+ ## CommandDialog props
17
+
18
+ | Prop | Type | Default |
19
+ | --- | --- | --- |
20
+ | title | `string` | `Command Palette` |
21
+ | description | `string` | `Search for a command to run...` |
22
+ | className | `string` | - |
23
+ | showCloseButton | `boolean` | `false` |
24
+
25
+ Extends `React.ComponentProps<typeof Dialog>`.
26
+
27
+ ## DialogContent props
28
+
29
+ | Prop | Type | Default |
30
+ | --- | --- | --- |
31
+ | showCloseButton | `boolean` | `true` |
32
+
33
+ Extends `React.ComponentProps<typeof DialogPrimitive.Content>`.
34
+
35
+ ## DialogFooter props
36
+
37
+ | Prop | Type | Default |
38
+ | --- | --- | --- |
39
+ | showCloseButton | `boolean` | `false` |
40
+
41
+ Extends `React.ComponentProps<"div">`.
42
+
43
+ ## Examples
44
+
45
+ More: `npx @create-ui/cli view command` or MCP `get_item_examples_from_registries` with "command-demo" / "command-example".
46
+
47
+ ## When to use
48
+ Command is a searchable command palette built on cmdk: CommandDialog for a modal Cmd+K palette, bare Command for an inline list. Do not use it to pick a form value (use Select) or for a small action menu on a trigger (use DropdownMenu).
49
+ ## Gotchas
50
+ - CommandDialog does NOT wrap children in Command (unlike shadcn): its children go directly into DialogContent. Nest Command yourself or filtering and keyboard navigation will not work:
51
+
52
+ ```tsx
53
+ <CommandDialog open={open} onOpenChange={setOpen}>
54
+ <Command>
55
+ <CommandInput placeholder="Type a command or search..." />
56
+ <CommandList>
57
+ <CommandEmpty>No results found.</CommandEmpty>
58
+ <CommandGroup heading="Suggestions">
59
+ <CommandItem>Calendar</CommandItem>
60
+ </CommandGroup>
61
+ </CommandList>
62
+ </Command>
63
+ </CommandDialog>
64
+ ```
65
+ - No built-in trigger or Cmd+K key handler, and DialogTrigger cannot be composed (all children land inside DialogContent). Drive it with open/onOpenChange state; the examples use a Button onClick.
66
+ - CommandInput renders a trailing RiSearchLine icon on the right (not shadcn's left-side icon). Do not add your own search icon.
67
+ - CommandItem auto-appends a RiCheckLine indicator: it shows only when you set data-checked="true" on the item (nothing sets this attribute for you), and it is hidden entirely whenever the item contains a CommandShortcut. Do not add your own check icon for selected state.
68
+ - CommandDialog already renders sr-only DialogTitle/DialogDescription from its title/description props and pins the panel to the top third of the viewport with zero padding; do not add DialogHeader or try to re-center it.
69
+ - Follow the example item anatomy: bare <RiIcon /> from @create-ui/assets/icons, then <span> text, optional CommandShortcut last; items sit in CommandGroup (with heading) inside CommandList.
@@ -0,0 +1,109 @@
1
+ <!-- GENERATED FILE - do not edit. Source: registry/ui/country-flag.tsx. Regenerate with `pnpm skill:build`. Curated notes: apps/v4/scripts/skill-reference/notes/country-flag.md -->
2
+
3
+ # country-flag
4
+
5
+ CountryFlag and CurrencyFlag SVG icons resolved from an ISO code prop, with a dashed-circle fallback
6
+
7
+ Install: `npx @create-ui/cli add country-flag`
8
+
9
+ ## Import
10
+
11
+ ```tsx
12
+ import { CountryFlag, CurrencyFlag, FlagFallback } from "@/components/ui/country-flag"
13
+ ```
14
+
15
+ ## CountryFlag props
16
+
17
+ | Prop | Type | Default |
18
+ | --- | --- | --- |
19
+ | code | `string` (ISO 3166-1 alpha-2 country code for CountryFlag (US, TR; plus supranational EU); ISO 4217 currency code for CurrencyFlag (USD, EUR). Lookup is case-insensitive.) | - |
20
+ | fallback | `ReactNode` (Checked with !== undefined, so fallback={null} renders nothing at all instead of the dashed circle.) | - |
21
+
22
+ Extends `React.SVGProps<SVGSVGElement>`.
23
+
24
+ ## CurrencyFlag props
25
+
26
+ | Prop | Type | Default |
27
+ | --- | --- | --- |
28
+ | code | `string` (ISO 3166-1 alpha-2 country code for CountryFlag (US, TR; plus supranational EU); ISO 4217 currency code for CurrencyFlag (USD, EUR). Lookup is case-insensitive.) | - |
29
+ | fallback | `ReactNode` (Checked with !== undefined, so fallback={null} renders nothing at all instead of the dashed circle.) | - |
30
+
31
+ Extends `React.SVGProps<SVGSVGElement>`.
32
+
33
+ ## Examples
34
+
35
+ From `input-group-amount`:
36
+
37
+ ```tsx
38
+ "use client"
39
+
40
+ import * as React from "react"
41
+
42
+ import { CurrencyFlag } from "@/components/ui/country-flag"
43
+ import { Field, FieldLabel } from "@/components/ui/field"
44
+ import {
45
+ InputGroup,
46
+ InputGroupControl,
47
+ InputGroupLeadingIcon,
48
+ InputGroupSelect,
49
+ InputGroupSlot,
50
+ } from "@/components/ui/input-group"
51
+ import { SelectItem } from "@/components/ui/select"
52
+
53
+ const CURRENCIES = ["USD", "EUR", "GBP"] as const
54
+
55
+ const CURRENCY_SYMBOLS: Record<(typeof CURRENCIES)[number], string> = {
56
+ USD: "$",
57
+ EUR: "€",
58
+ GBP: "£",
59
+ }
60
+
61
+ export default function InputGroupAmount() {
62
+ const [currency, setCurrency] = React.useState("USD")
63
+
64
+ return (
65
+ <Field className="max-w-md">
66
+ <FieldLabel htmlFor="input-group-amount">Amount</FieldLabel>
67
+ <InputGroup>
68
+ <InputGroupLeadingIcon>
69
+ <span className="font-medium">
70
+ {CURRENCY_SYMBOLS[currency as (typeof CURRENCIES)[number]]}
71
+ </span>
72
+ </InputGroupLeadingIcon>
73
+ <InputGroupSlot>
74
+ <InputGroupControl
75
+ id="input-group-amount"
76
+ placeholder="0.00"
77
+ defaultValue="1,250.00"
78
+ inputMode="decimal"
79
+ />
80
+ </InputGroupSlot>
81
+ <InputGroupSelect
82
+ value={currency}
83
+ onValueChange={setCurrency}
84
+ prefix={<CurrencyFlag code={currency} className="size-5" />}
85
+ valueChildren={currency}
86
+ >
87
+ {CURRENCIES.map((c) => (
88
+ <SelectItem key={c} value={c}>
89
+ <CurrencyFlag code={c} className="size-5" />
90
+ {c}
91
+ </SelectItem>
92
+ ))}
93
+ </InputGroupSelect>
94
+ </InputGroup>
95
+ </Field>
96
+ )
97
+ }
98
+ ```
99
+
100
+ More: `npx @create-ui/cli view country-flag` or MCP `get_item_examples_from_registries` with "country-flag-demo" / "country-flag-example".
101
+
102
+ ## When to use
103
+ CountryFlag resolves an SVG flag from a runtime country code; CurrencyFlag maps a currency code to its country's flag (EUR renders the EU flag). Use them when the code is dynamic data: select values, currency pickers, table rows. When the country is statically known at write time, do NOT use these; import the named mark directly from `@create-ui/assets/flags` (e.g. `Turkey`), as select-example does.
104
+ ## Gotchas
105
+ - The two components take DIFFERENT code formats: `<CountryFlag code="USD" />` or `<CurrencyFlag code="US" />` silently renders the dashed-circle fallback, with no error or console warning.
106
+ - There is no size prop; dimensions come from className on top of the default `size-6 shrink-0`. Canonical examples use `className="size-5"` inside `InputGroupSelect` prefix and `SelectItem`.
107
+ - CurrencyFlag only covers the ~50 currencies in `CURRENCY_TO_COUNTRY` (`lib/currency-flags.ts`); unlisted currencies hit the fallback. Extend that map rather than special-casing in app code.
108
+ - Flags render `aria-hidden="true"` by default (the fallback always does): they are decorative, so the adjacent text must carry the meaning, e.g. `<CurrencyFlag code={c} /> {c}` inside a SelectItem.
109
+ - Both components reject children (typed as `Omit<..., "children">`); they are leaf SVGs, not wrappers.
@@ -0,0 +1,76 @@
1
+ <!-- GENERATED FILE - do not edit. Source: registry/ui/credit-card-input.tsx. Regenerate with `pnpm skill:build`. Curated notes: apps/v4/scripts/skill-reference/notes/credit-card-input.md -->
2
+
3
+ # credit-card-input
4
+
5
+ Masked card number input that detects the brand and shows its badge plus a validity icon; onValueChange reports details
6
+
7
+ Install: `npx @create-ui/cli add credit-card-input`
8
+
9
+ ## Import
10
+
11
+ ```tsx
12
+ import { CreditCardInput } from "@/components/ui/credit-card-input"
13
+ ```
14
+
15
+ ## CreditCardInput props
16
+
17
+ | Prop | Type | Default |
18
+ | --- | --- | --- |
19
+ | defaultValue | `string` (Raw digit string; the only way to seed the value - the input is uncontrolled (value/onChange are omitted from the props type).) | - |
20
+ | onValueChange | `(value: string, details: CreditCardDetails) => void` (Receives the unmasked digit string (separators stripped) plus { cardType, isValid, isPotentiallyValid }; fires from an effect one render after each accepted keystroke and never on mount.) | - |
21
+ | size | `xs \| sm \| md` | - |
22
+ | invalid | `boolean` (Styles the group only; the trailing validity glyph renders with invalidIcon={null}, so the card's own valid/invalid icon stays authoritative under form errors.) | - |
23
+ | disabled | `boolean` | - |
24
+ | loading | `boolean` | - |
25
+ | showLeadingIcon | `boolean` | `true` |
26
+ | leadingIcon | `ReactNode` | - |
27
+ | showBadge | `boolean` | `true` |
28
+ | showValidationIcon | `boolean` | `true` |
29
+ | badges | `Partial<Record<CardType, CardBadge>>` (Replaces the whole CardType-to-badge map (not merged); brands without an entry fall back to the generic card glyph.) | - |
30
+ | className | `string` | - |
31
+ | ref | `React.Ref<HTMLInputElement>` | - |
32
+
33
+ Extends `React.ComponentProps<"input">`.
34
+
35
+ ## Icons
36
+
37
+ Icons go through icon props - never as children next to text, and never with sizing classes (the component sizes icons per `size`): `CreditCardInput` (`leadingIcon`). Import icons from `@create-ui/assets/icons` (Remix `Ri*`).
38
+
39
+ ## Examples
40
+
41
+ From `input-group-credit-card`:
42
+
43
+ ```tsx
44
+ "use client"
45
+
46
+ import { CreditCardInput } from "@/components/ui/credit-card-input"
47
+ import { Field, FieldLabel } from "@/components/ui/field"
48
+
49
+ export default function InputGroupCreditCard() {
50
+ return (
51
+ <Field className="max-w-md">
52
+ <FieldLabel htmlFor="input-group-credit-card">Card Number</FieldLabel>
53
+ <CreditCardInput
54
+ id="input-group-credit-card"
55
+ defaultValue="5555555555554444"
56
+ onValueChange={(value, { cardType, isValid }) =>
57
+ console.log(value, cardType, isValid)
58
+ }
59
+ />
60
+ </Field>
61
+ )
62
+ }
63
+ ```
64
+
65
+ More: `npx @create-ui/cli view credit-card-input` or MCP `get_item_examples_from_registries` with "credit-card-input-demo" / "credit-card-input-example".
66
+
67
+ ## When to use
68
+ Card-number entry: a masked input (4-4-4-4 grouping, auto-switching to Amex 4-6-5 on a 34/37 prefix) with brand detection, a trailing brand badge, and a live validity icon driven by card-validator. It covers the card number only; build expiry and CVC as separate Field + Input controls. For plain text use Input, for custom masked/affixed compositions use InputGroup with InputGroupControl, and for one-time codes use InputOTP.
69
+
70
+ ## Gotchas
71
+ - It already renders a complete InputGroup internally; never wrap it in InputGroup or rebuild it from InputGroupControl. Compose as Field > FieldLabel + CreditCardInput, wiring the label via id/htmlFor.
72
+ - Uncontrolled only: there is no `value` prop and no plain `onChange`. Read state exclusively through onValueChange; an AI reaching for the shadcn controlled-input pattern will hit a type error.
73
+ - size/invalid/disabled/loading cascade from a surrounding Field when left unset (resolved by the internal InputGroup); do not hard-set size inside a sized Field.
74
+ - The validity icon is self-managing: hidden while empty or loading, check icon once the number is valid, error icon only when it can no longer become valid. showValidationIcon={false} removes it entirely.
75
+ - There is no trailingIcon prop (despite the generic Icons blurb); the trailing area is owned by the validation icon and the brand badge. Only leadingIcon is customizable, and showBadge={false} drops the badge cell.
76
+ - placeholder defaults to the mask string itself (zeros with bullet separators); pass placeholder to override it.
@@ -0,0 +1,71 @@
1
+ <!-- GENERATED FILE - do not edit. Source: registry/ui/date-input.tsx. Regenerate with `pnpm skill:build`. Curated notes: apps/v4/scripts/skill-reference/notes/date-input.md -->
2
+
3
+ # date-input
4
+
5
+ Masked date field with configurable order (DMY/MDY/YMD); onValueChange emits the ISO string and a Date object
6
+
7
+ Install: `npx @create-ui/cli add date-input`
8
+
9
+ ## Import
10
+
11
+ ```tsx
12
+ import { DateInput } from "@/components/ui/date-input"
13
+ ```
14
+
15
+ ## DateInput props
16
+
17
+ | Prop | Type | Default |
18
+ | --- | --- | --- |
19
+ | defaultValue | `string` (Masked display string in the active order (e.g. \"31 / 12 / 2024\" for DMY), NOT an ISO string) | - |
20
+ | order | `DateOrder` (Static per mount, not reactive; remount with a key to switch order at runtime) | `DMY` |
21
+ | onValueChange | `(iso: string, date: Date \| null) => void` (iso is \"\" and date is null until every segment is complete) | - |
22
+ | size | `xs \| sm \| md` | - |
23
+ | invalid | `boolean` | - |
24
+ | disabled | `boolean` | - |
25
+ | loading | `boolean` | - |
26
+ | showLeadingIcon | `boolean` | `true` |
27
+ | leadingIcon | `ReactNode` | - |
28
+ | className | `string` | - |
29
+ | ref | `React.Ref<HTMLInputElement>` | - |
30
+
31
+ Extends `React.ComponentProps<"input">`.
32
+
33
+ ## Icons
34
+
35
+ Icons go through icon props - never as children next to text, and never with sizing classes (the component sizes icons per `size`): `DateInput` (`leadingIcon`). Import icons from `@create-ui/assets/icons` (Remix `Ri*`).
36
+
37
+ ## Examples
38
+
39
+ From `input-group-date`:
40
+
41
+ ```tsx
42
+ "use client"
43
+
44
+ import { DateInput } from "@/components/ui/date-input"
45
+ import { Field, FieldLabel } from "@/components/ui/field"
46
+
47
+ export default function InputGroupDate() {
48
+ return (
49
+ <Field className="max-w-md">
50
+ <FieldLabel htmlFor="input-group-date">Date</FieldLabel>
51
+ <DateInput
52
+ id="input-group-date"
53
+ onValueChange={(iso, date) => console.log(iso, date)}
54
+ />
55
+ </Field>
56
+ )
57
+ }
58
+ ```
59
+
60
+ More: `npx @create-ui/cli view date-input` or MCP `get_item_examples_from_registries` with "date-input-demo" / "date-input-example".
61
+
62
+ ## When to use
63
+ Masked type-in date field: the user types digits and the mask inserts " / " separators per the DMY/MDY/YMD order, emitting an ISO string plus Date via onValueChange. It is typed entry only; Create UI has no Calendar or DatePicker component, so do not build a shadcn-style Popover+Calendar around it. For free-form text use Input; for other masked composites use PhoneInput or CreditCardInput.
64
+
65
+ ## Gotchas
66
+ - Uncontrolled only: `value` and `onChange` are stripped from the input props, and `defaultValue` is repurposed to seed the mask. There is no controlled mode; read the value through `onValueChange` or the ref.
67
+ - The calendar leading icon (RiCalendarLine) is purely decorative; it does not open a picker and nothing in the component is clickable besides the input itself.
68
+ - It already composes InputGroup + InputGroupSlot + InputGroupControl internally. Never wrap it in another InputGroup or place it inside an InputGroupSlot; put it directly under Field and label it via `id` + `FieldLabel htmlFor` (Field context does not auto-wire ids).
69
+ - `size`, `invalid`, `disabled`, `loading` fall through to the surrounding Field context when unset (then default size "sm"), because the internal InputGroup resolves `prop ?? fieldCtx ?? default`.
70
+ - Mask auto-behaviors: day/month autofix-pad ("5" becomes "05"), day clamped 1-31, month 1-12, year 1900-2100 (years outside the range cannot be typed); `inputMode="numeric"` is set automatically.
71
+ - The emitted iso is `toISOString()` of a Date built at local midnight, so it is a full UTC timestamp whose date part can differ from the typed day in non-UTC timezones; use the second `date` argument instead of string-slicing the iso.