@leitware/dockets 0.1.0 → 0.2.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgCpC,eAAO,MAAM,UAAU,SAoFnB,CAAC"}
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgCpC,eAAO,MAAM,UAAU,SA0FnB,CAAC"}
@@ -27,6 +27,7 @@ export const addCommand = new Command("add")
27
27
  .argument("<components...>", "component name(s) to add")
28
28
  .option("-d, --dest <path>", "project root (files install relative to this)", ".")
29
29
  .option("-y, --yes", "overwrite existing files without prompting", false)
30
+ .option("-a, --alias <prefix>", "import alias prefix (default: @/)", "@/")
30
31
  .action((components, options) => {
31
32
  const projectRoot = resolve(process.cwd(), options.dest);
32
33
  // Resolve all requested components + their deps
@@ -61,7 +62,12 @@ export const addCommand = new Command("add")
61
62
  if (!existsSync(destDir)) {
62
63
  mkdirSync(destDir, { recursive: true });
63
64
  }
64
- writeFileSync(dest, readFileSync(src, "utf-8"));
65
+ let content = readFileSync(src, "utf-8");
66
+ if (options.alias && options.alias !== "@/") {
67
+ content = content.replaceAll("'@/", `'${options.alias}`);
68
+ content = content.replaceAll('"@/', `"${options.alias}`);
69
+ }
70
+ writeFileSync(dest, content);
65
71
  console.log(`${pc.green("✓")} ${pc.cyan(file.dest)}`);
66
72
  filesWritten++;
67
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"add.js","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,SAAS,EAA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,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CACT,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,YAAY,QAAQ,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,UAAU,CAChF,CAAC;IACJ,CAAC;IACD,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CACT,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,YAAY,QAAQ,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,UAAU,CACjF,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leitware/dockets",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "CLI to add Leitware design system components to your project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,10 @@
12
12
  "default": "./dist/index.js"
13
13
  }
14
14
  },
15
- "files": ["dist", "templates"],
15
+ "files": [
16
+ "dist",
17
+ "templates"
18
+ ],
16
19
  "scripts": {
17
20
  "build": "tsc -p tsconfig.json",
18
21
  "dev": "bun run src/cli.ts",
@@ -37,7 +37,7 @@ function ConfirmDialog({
37
37
  }: ConfirmDialogProps) {
38
38
  return (
39
39
  <AlertDialog open={open} onOpenChange={onOpenChange}>
40
- {trigger && <AlertDialogTrigger asChild>{trigger}</AlertDialogTrigger>}
40
+ {trigger && <AlertDialogTrigger>{trigger}</AlertDialogTrigger>}
41
41
  <AlertDialogContent>
42
42
  <AlertDialogHeader>
43
43
  <AlertDialogTitle>{title}</AlertDialogTitle>
@@ -1,6 +1,4 @@
1
- import * as React from 'react'
2
1
  import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'
3
- import { cn } from '@/lib/utils'
4
2
 
5
3
  export interface UserAvatarProps {
6
4
  src?: string
@@ -12,7 +12,6 @@ import {
12
12
  CommandShortcut,
13
13
  } from '@/components/ui/command'
14
14
  import { Dialog as DialogPrimitive } from '@base-ui/react/dialog'
15
- import { cn } from '@/lib/utils'
16
15
 
17
16
  function CommandDialog({
18
17
  open,
@@ -1,4 +1,3 @@
1
- import * as React from 'react'
2
1
  import {
3
2
  Pagination,
4
3
  PaginationContent,
@@ -44,7 +43,7 @@ function SimplePagination({ page, totalPages, onPageChange, className }: SimpleP
44
43
  disabled={page <= 1}
45
44
  />
46
45
  </PaginationItem>
47
- {visiblePages.map((p, i) =>
46
+ {visiblePages.map((p) =>
48
47
  typeof p === 'string' ? (
49
48
  <PaginationItem key={p}>
50
49
  <PaginationEllipsis />
@@ -1,4 +1,3 @@
1
- import * as React from 'react'
2
1
  import { Progress } from '@/components/ui/progress'
3
2
  import { cn } from '@/lib/utils'
4
3
 
@@ -20,7 +19,7 @@ function LabelledProgress({ value, max = 100, label, showValue = false, classNam
20
19
  {showValue && <span className="text-muted-foreground">{pct != null ? `${pct}%` : '–'}</span>}
21
20
  </div>
22
21
  )}
23
- <Progress value={value} max={max} />
22
+ <Progress value={value ?? null} max={max} />
24
23
  </div>
25
24
  )
26
25
  }
@@ -1,4 +1,3 @@
1
- import * as React from 'react'
2
1
  import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'
3
2
  import { Label } from '@/components/ui/label'
4
3
  import { cn } from '@/lib/utils'
@@ -1,4 +1,3 @@
1
- import * as React from 'react'
2
1
  import { Skeleton, SkeletonText } from '@/components/ui/skeleton'
3
2
  import { cn } from '@/lib/utils'
4
3
 
@@ -1,4 +1,3 @@
1
- import * as React from 'react'
2
1
  import { Slider } from '@/components/ui/slider'
3
2
  import { cn } from '@/lib/utils'
4
3
 
@@ -10,7 +9,7 @@ export interface LabelledSliderProps {
10
9
  step?: number
11
10
  label?: string
12
11
  showValue?: boolean
13
- onValueChange?: (value: number[]) => void
12
+ onValueChange?: (value: number | readonly number[]) => void
14
13
  className?: string
15
14
  disabled?: boolean
16
15
  }
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'
4
4
  import { CheckIcon, MinusIcon } from 'lucide-react'
5
- import * as React from 'react'
6
5
  import { cn } from '@/lib/utils'
7
6
 
8
7
  function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { Collapsible as CollapsiblePrimitive } from '@base-ui/react/collapsible'
4
4
  import { ChevronDownIcon, ChevronUpIcon } from 'lucide-react'
5
- import * as React from 'react'
6
5
  import { cn } from '@/lib/utils'
7
6
 
8
7
  function Collapsible({ className, ...props }: CollapsiblePrimitive.Root.Props) {
@@ -1,7 +1,6 @@
1
1
  'use client'
2
2
 
3
3
  import { PreviewCard as PreviewCardPrimitive } from '@base-ui/react/preview-card'
4
- import type * as React from 'react'
5
4
  import { cn } from '@/lib/utils'
6
5
 
7
6
  function HoverCard({ ...props }: PreviewCardPrimitive.Root.Props) {
@@ -54,7 +54,7 @@ function PaginationLink({ className, isActive, disabled, ...props }: PaginationL
54
54
  )
55
55
  }
56
56
 
57
- function PaginationPrevious({ className, ...props }: React.ComponentProps<'a'>) {
57
+ function PaginationPrevious({ className, ...props }: PaginationLinkProps) {
58
58
  return (
59
59
  <PaginationLink
60
60
  data-slot="pagination-previous"
@@ -68,7 +68,7 @@ function PaginationPrevious({ className, ...props }: React.ComponentProps<'a'>)
68
68
  )
69
69
  }
70
70
 
71
- function PaginationNext({ className, ...props }: React.ComponentProps<'a'>) {
71
+ function PaginationNext({ className, ...props }: PaginationLinkProps) {
72
72
  return (
73
73
  <PaginationLink
74
74
  data-slot="pagination-next"
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { Popover as PopoverPrimitive } from '@base-ui/react/popover'
4
4
  import { XIcon } from 'lucide-react'
5
- import type * as React from 'react'
6
5
  import { cn } from '@/lib/utils'
7
6
 
8
7
  function Popover({ ...props }: PopoverPrimitive.Root.Props) {
@@ -1,7 +1,6 @@
1
1
  'use client'
2
2
 
3
3
  import { Progress as ProgressPrimitive } from '@base-ui/react/progress'
4
- import * as React from 'react'
5
4
  import { cn } from '@/lib/utils'
6
5
 
7
6
  function Progress({
@@ -1,12 +1,12 @@
1
1
  'use client'
2
2
 
3
3
  import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group'
4
- import * as React from 'react'
4
+ import { Radio } from '@base-ui/react/radio'
5
5
  import { cn } from '@/lib/utils'
6
6
 
7
- function RadioGroup({ className, ...props }: RadioGroupPrimitive.Root.Props) {
7
+ function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {
8
8
  return (
9
- <RadioGroupPrimitive.Root
9
+ <RadioGroupPrimitive
10
10
  data-slot="radio-group"
11
11
  className={cn('flex flex-col gap-2', className)}
12
12
  {...props}
@@ -14,9 +14,9 @@ function RadioGroup({ className, ...props }: RadioGroupPrimitive.Root.Props) {
14
14
  )
15
15
  }
16
16
 
17
- function RadioGroupItem({ className, ...props }: RadioGroupPrimitive.Item.Props) {
17
+ function RadioGroupItem({ className, ...props }: Radio.Root.Props) {
18
18
  return (
19
- <RadioGroupPrimitive.Item
19
+ <Radio.Root
20
20
  data-slot="radio-group-item"
21
21
  className={cn(
22
22
  'peer flex size-4 shrink-0 items-center justify-center rounded-[var(--radius)] border-[length:var(--border-width)] border-foreground bg-transparent',
@@ -28,13 +28,13 @@ function RadioGroupItem({ className, ...props }: RadioGroupPrimitive.Item.Props)
28
28
  )}
29
29
  {...props}
30
30
  >
31
- <RadioGroupPrimitive.Indicator
31
+ <Radio.Indicator
32
32
  data-slot="radio-group-indicator"
33
33
  className="flex items-center justify-center"
34
34
  >
35
35
  <div className="size-1.5 rounded-[var(--radius)] bg-background" />
36
- </RadioGroupPrimitive.Indicator>
37
- </RadioGroupPrimitive.Item>
36
+ </Radio.Indicator>
37
+ </Radio.Root>
38
38
  )
39
39
  }
40
40
 
@@ -1,7 +1,6 @@
1
1
  'use client'
2
2
 
3
3
  import { Slider as SliderPrimitive } from '@base-ui/react/slider'
4
- import * as React from 'react'
5
4
  import { cn } from '@/lib/utils'
6
5
 
7
6
  function Slider({ className, ...props }: SliderPrimitive.Root.Props) {
@@ -32,9 +31,9 @@ function SliderTrack({ className, ...props }: SliderPrimitive.Track.Props) {
32
31
  )
33
32
  }
34
33
 
35
- function SliderFill({ className, ...props }: SliderPrimitive.Fill.Props) {
34
+ function SliderFill({ className, ...props }: SliderPrimitive.Indicator.Props) {
36
35
  return (
37
- <SliderPrimitive.Fill
36
+ <SliderPrimitive.Indicator
38
37
  data-slot="slider-fill"
39
38
  className={cn('absolute h-full bg-foreground', className)}
40
39
  {...props}
@@ -1,7 +1,6 @@
1
1
  'use client'
2
2
 
3
3
  import { Switch as SwitchPrimitive } from '@base-ui/react/switch'
4
- import * as React from 'react'
5
4
  import { cn } from '@/lib/utils'
6
5
 
7
6
  function Switch({ className, ...props }: SwitchPrimitive.Root.Props) {
@@ -1,6 +1,7 @@
1
1
  'use client'
2
2
 
3
3
  import { ToggleGroup as ToggleGroupPrimitive } from '@base-ui/react/toggle-group'
4
+ import { Toggle as TogglePrimitive } from '@base-ui/react/toggle'
4
5
  import * as React from 'react'
5
6
  import { cn } from '@/lib/utils'
6
7
  import { toggleVariants } from '@/components/ui/toggle'
@@ -19,10 +20,10 @@ function ToggleGroup({
19
20
  size = 'default',
20
21
  children,
21
22
  ...props
22
- }: ToggleGroupPrimitive.Root.Props & VariantProps<typeof toggleVariants>) {
23
+ }: ToggleGroupPrimitive.Props & VariantProps<typeof toggleVariants>) {
23
24
  return (
24
25
  <ToggleGroupContext.Provider value={{ variant, size }}>
25
- <ToggleGroupPrimitive.Root
26
+ <ToggleGroupPrimitive
26
27
  data-slot="toggle-group"
27
28
  className={cn(
28
29
  // Container holds left+top border; items add right+bottom (newspaper pattern)
@@ -32,7 +33,7 @@ function ToggleGroup({
32
33
  {...props}
33
34
  >
34
35
  {children}
35
- </ToggleGroupPrimitive.Root>
36
+ </ToggleGroupPrimitive>
36
37
  </ToggleGroupContext.Provider>
37
38
  )
38
39
  }
@@ -43,13 +44,13 @@ function ToggleGroupItem({
43
44
  size,
44
45
  children,
45
46
  ...props
46
- }: ToggleGroupPrimitive.Item.Props & VariantProps<typeof toggleVariants>) {
47
+ }: TogglePrimitive.Props & VariantProps<typeof toggleVariants>) {
47
48
  const ctx = React.useContext(ToggleGroupContext)
48
49
  const resolvedVariant = variant ?? ctx.variant
49
50
  const resolvedSize = size ?? ctx.size
50
51
 
51
52
  return (
52
- <ToggleGroupPrimitive.Item
53
+ <TogglePrimitive
53
54
  data-slot="toggle-group-item"
54
55
  className={cn(
55
56
  toggleVariants({ variant: resolvedVariant, size: resolvedSize }),
@@ -61,7 +62,7 @@ function ToggleGroupItem({
61
62
  {...props}
62
63
  >
63
64
  {children}
64
- </ToggleGroupPrimitive.Item>
65
+ </TogglePrimitive>
65
66
  )
66
67
  }
67
68
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { Toggle as TogglePrimitive } from '@base-ui/react/toggle'
4
4
  import { cva, type VariantProps } from 'class-variance-authority'
5
- import * as React from 'react'
6
5
  import { cn } from '@/lib/utils'
7
6
 
8
7
  const toggleVariants = cva(
@@ -34,9 +33,9 @@ function Toggle({
34
33
  variant,
35
34
  size,
36
35
  ...props
37
- }: TogglePrimitive.Root.Props & VariantProps<typeof toggleVariants>) {
36
+ }: TogglePrimitive.Props & VariantProps<typeof toggleVariants>) {
38
37
  return (
39
- <TogglePrimitive.Root
38
+ <TogglePrimitive
40
39
  data-slot="toggle"
41
40
  className={cn(toggleVariants({ variant, size }), className)}
42
41
  {...props}