create-modoock-app 1.0.1 → 2.0.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 (75) hide show
  1. package/README.md +68 -237
  2. package/dist/cli.js +112 -43
  3. package/package.json +22 -22
  4. package/template/.cursor/hooks/gate-ui-pack.mjs +108 -0
  5. package/template/.cursor/hooks.json +18 -0
  6. package/template/.cursor/rules/honey.mdc +11 -3
  7. package/template/AGENTS.md +13 -12
  8. package/template/README.md +225 -175
  9. package/template/app/(local)/components/page.tsx +3 -3
  10. package/template/app/(local)/design-system/page.tsx +2 -2
  11. package/template/components/layout/app-layout.tsx +17 -6
  12. package/template/components/layout/header.tsx +19 -1
  13. package/template/components/layout/side-nav.tsx +103 -30
  14. package/template/postcss.config.mjs +7 -7
  15. package/template/public/identity/full_logo_black.svg +26 -26
  16. package/template/public/identity/full_logo_color.svg +37 -37
  17. package/template/public/identity/full_logo_white.svg +33 -33
  18. package/template/public/identity/logo_icon_black.svg +5 -5
  19. package/template/public/identity/logo_icon_color.svg +12 -12
  20. package/template/public/identity/logo_icon_white.svg +12 -12
  21. package/template/components/ui/action-stack.tsx +0 -42
  22. package/template/components/ui/badge.tsx +0 -43
  23. package/template/components/ui/button.tsx +0 -104
  24. package/template/components/ui/icon.tsx +0 -78
  25. package/template/components/ui/index.ts +0 -28
  26. package/template/components/ui/input.tsx +0 -376
  27. package/template/components/ui/loader.tsx +0 -78
  28. package/template/components/ui/metric-bar.tsx +0 -49
  29. package/template/components/ui/modal.tsx +0 -177
  30. package/template/components/ui/select.tsx +0 -458
  31. package/template/components/ui/stepper.tsx +0 -96
  32. package/template/components/ui/tab.tsx +0 -85
  33. package/template/components/ui/user-table.tsx +0 -806
  34. package/template/knowledge-base/design-system/components/action-stack.mdc +0 -17
  35. package/template/knowledge-base/design-system/components/badges.mdc +0 -16
  36. package/template/knowledge-base/design-system/components/buttons.mdc +0 -21
  37. package/template/knowledge-base/design-system/components/detail-header.mdc +0 -17
  38. package/template/knowledge-base/design-system/components/dropdowns.mdc +0 -12
  39. package/template/knowledge-base/design-system/components/info-list.mdc +0 -17
  40. package/template/knowledge-base/design-system/components/inputs.mdc +0 -23
  41. package/template/knowledge-base/design-system/components/menu.mdc +0 -20
  42. package/template/knowledge-base/design-system/components/modals.mdc +0 -24
  43. package/template/knowledge-base/design-system/components/selects.mdc +0 -39
  44. package/template/knowledge-base/design-system/components/stepper.mdc +0 -18
  45. package/template/knowledge-base/design-system/components/tables.mdc +0 -59
  46. package/template/knowledge-base/design-system/components/tabs.mdc +0 -17
  47. package/template/knowledge-base/design-system/components.mdc +0 -91
  48. package/template/knowledge-base/design-system/tokens.mdc +0 -24
  49. package/template/knowledge-base/examples/bad/README.md +0 -8
  50. package/template/knowledge-base/examples/good/README.md +0 -13
  51. package/template/knowledge-base/metadata/catalog.yaml +0 -245
  52. package/template/knowledge-base/patterns/components/reuse-existing.mdc +0 -26
  53. package/template/knowledge-base/patterns/data-fetching/local-data.mdc +0 -20
  54. package/template/knowledge-base/patterns/layouts/app-shell.mdc +0 -20
  55. package/template/knowledge-base/patterns/pages/data-table-page.mdc +0 -31
  56. package/template/knowledge-base/patterns/pages/workflow-page.mdc +0 -27
  57. package/template/knowledge-base/rules/accessibility/responsive.mdc +0 -31
  58. package/template/knowledge-base/rules/architecture/layout.mdc +0 -52
  59. package/template/knowledge-base/rules/architecture/single-screen.mdc +0 -62
  60. package/template/knowledge-base/rules/code-quality/jsx.mdc +0 -19
  61. package/template/knowledge-base/rules/global/naming.mdc +0 -12
  62. package/template/knowledge-base/rules/global/technology.mdc +0 -19
  63. package/template/knowledge-base/rules/global/ui-copy.mdc +0 -20
  64. package/template/knowledge-base/rules/performance/client.mdc +0 -20
  65. package/template/knowledge-base/rules/ui/information-density.mdc +0 -36
  66. package/template/knowledge-base/rules/ui/interaction.mdc +0 -47
  67. package/template/knowledge-base/rules/ui/simple-ui.mdc +0 -58
  68. package/template/knowledge-base/validation/accessibility.mdc +0 -13
  69. package/template/knowledge-base/validation/architecture.mdc +0 -10
  70. package/template/knowledge-base/validation/ast-grep/do-what-brooooooklyn-said.yml +0 -15
  71. package/template/knowledge-base/validation/ast-grep/no-nested-links.yml +0 -12
  72. package/template/knowledge-base/validation/ast-grep/rewrite-svg-attribute.yml +0 -19
  73. package/template/knowledge-base/validation/code-quality.mdc +0 -18
  74. package/template/knowledge-base/validation/performance.mdc +0 -11
  75. package/template/knowledge-base/validation/ui.mdc +0 -26
@@ -1,6 +1,6 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
3
- <g id="Layer_1-2" data-name="Layer 1">
4
- <path d="M512,151.91v70.97l-48.49,12.97c-91.39,24.54-145.66,118.52-121.18,209.97l17.76,66.18h-71.7c-34.19-97.17-126.17-160.16-226.14-160.16-20.55,0-41.44,2.66-62.25,8.25v-70.97l48.49-12.97c91.39-24.54,145.66-118.52,121.18-209.97L151.91,0h71.7c34.19,97.17,126.17,160.16,226.14,160.16,20.55,0,41.44-2.66,62.25-8.25Z"/>
5
- </g>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
3
+ <g id="Layer_1-2" data-name="Layer 1">
4
+ <path d="M512,151.91v70.97l-48.49,12.97c-91.39,24.54-145.66,118.52-121.18,209.97l17.76,66.18h-71.7c-34.19-97.17-126.17-160.16-226.14-160.16-20.55,0-41.44,2.66-62.25,8.25v-70.97l48.49-12.97c91.39-24.54,145.66-118.52,121.18-209.97L151.91,0h71.7c34.19,97.17,126.17,160.16,226.14,160.16,20.55,0,41.44-2.66,62.25-8.25Z"/>
5
+ </g>
6
6
  </svg>
@@ -1,13 +1,13 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
3
- <defs>
4
- <style>
5
- .cls-1 {
6
- fill: #17e4a1;
7
- }
8
- </style>
9
- </defs>
10
- <g id="Layer_1-2" data-name="Layer 1">
11
- <path class="cls-1" d="M512,151.91v70.97l-48.49,12.97c-91.39,24.54-145.66,118.52-121.18,209.97l17.76,66.18h-71.7c-34.19-97.17-126.17-160.16-226.14-160.16-20.55,0-41.44,2.66-62.25,8.25v-70.97l48.49-12.97c91.39-24.54,145.66-118.52,121.18-209.97L151.91,0h71.7c34.19,97.17,126.17,160.16,226.14,160.16,20.55,0,41.44-2.66,62.25-8.25Z"/>
12
- </g>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
3
+ <defs>
4
+ <style>
5
+ .cls-1 {
6
+ fill: #17e4a1;
7
+ }
8
+ </style>
9
+ </defs>
10
+ <g id="Layer_1-2" data-name="Layer 1">
11
+ <path class="cls-1" d="M512,151.91v70.97l-48.49,12.97c-91.39,24.54-145.66,118.52-121.18,209.97l17.76,66.18h-71.7c-34.19-97.17-126.17-160.16-226.14-160.16-20.55,0-41.44,2.66-62.25,8.25v-70.97l48.49-12.97c91.39-24.54,145.66-118.52,121.18-209.97L151.91,0h71.7c34.19,97.17,126.17,160.16,226.14,160.16,20.55,0,41.44-2.66,62.25-8.25Z"/>
12
+ </g>
13
13
  </svg>
@@ -1,13 +1,13 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
3
- <defs>
4
- <style>
5
- .cls-1 {
6
- fill: #fff;
7
- }
8
- </style>
9
- </defs>
10
- <g id="Layer_1-2" data-name="Layer 1">
11
- <path class="cls-1" d="M512,151.91v70.97l-48.49,12.97c-91.39,24.54-145.66,118.52-121.18,209.97l17.76,66.18h-71.7c-34.19-97.17-126.17-160.16-226.14-160.16-20.55,0-41.44,2.66-62.25,8.25v-70.97l48.49-12.97c91.39-24.54,145.66-118.52,121.18-209.97L151.91,0h71.7c34.19,97.17,126.17,160.16,226.14,160.16,20.55,0,41.44-2.66,62.25-8.25Z"/>
12
- </g>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
3
+ <defs>
4
+ <style>
5
+ .cls-1 {
6
+ fill: #fff;
7
+ }
8
+ </style>
9
+ </defs>
10
+ <g id="Layer_1-2" data-name="Layer 1">
11
+ <path class="cls-1" d="M512,151.91v70.97l-48.49,12.97c-91.39,24.54-145.66,118.52-121.18,209.97l17.76,66.18h-71.7c-34.19-97.17-126.17-160.16-226.14-160.16-20.55,0-41.44,2.66-62.25,8.25v-70.97l48.49-12.97c91.39-24.54,145.66-118.52,121.18-209.97L151.91,0h71.7c34.19,97.17,126.17,160.16,226.14,160.16,20.55,0,41.44-2.66,62.25-8.25Z"/>
12
+ </g>
13
13
  </svg>
@@ -1,42 +0,0 @@
1
- import ClickableButton from "./button";
2
- import type { ButtonVariant } from "./button";
3
-
4
- export interface ActionStackItem {
5
- key: string;
6
- label: string;
7
- variant?: ButtonVariant;
8
- onClick: () => void;
9
- }
10
-
11
- /**
12
- * Pile verticale de boutons d'action, avec message si aucune action n'est disponible.
13
- */
14
- export default function ActionStack({
15
- actions,
16
- emptyMessage,
17
- }: {
18
- actions: ActionStackItem[];
19
- emptyMessage?: string;
20
- }) {
21
- if (actions.length === 0) {
22
- return emptyMessage ? (
23
- <p className="text-body text-muted-foreground">{emptyMessage}</p>
24
- ) : null;
25
- }
26
-
27
- return (
28
- <div className="flex flex-col gap-inline">
29
- {actions.map((action) => (
30
- <ClickableButton
31
- key={action.key}
32
- type="button"
33
- variant={action.variant}
34
- fullWidth
35
- onClick={action.onClick}
36
- >
37
- {action.label}
38
- </ClickableButton>
39
- ))}
40
- </div>
41
- );
42
- }
@@ -1,43 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- type BadgeVariant =
4
- | "default"
5
- | "primary"
6
- | "secondary"
7
- | "success"
8
- | "warning"
9
- | "danger"
10
- | "info"
11
- | "accent";
12
-
13
- export interface BadgeProps {
14
- children: ReactNode;
15
- variant?: BadgeVariant;
16
- className?: string;
17
- }
18
-
19
- const badgeStyles: Record<BadgeVariant, string> = {
20
- default: "bg-surface-muted text-muted-foreground",
21
- primary: "bg-primary-light text-primary",
22
- secondary: "bg-surface text-foreground border border-border",
23
- success: "bg-success-light text-success-foreground",
24
- warning: "bg-warning-light text-warning-foreground",
25
- danger: "bg-danger-light text-danger-foreground",
26
- info: "bg-info-light text-info-foreground",
27
- accent: "bg-accent-light text-accent",
28
- };
29
-
30
- export default function Badge({
31
- children,
32
- variant = "default",
33
- className = "",
34
- }: BadgeProps) {
35
- return (
36
- <span
37
- className={`inline-flex items-center justify-center rounded-full px-component py-micro text-label whitespace-nowrap ${badgeStyles[variant]} ${className}`}
38
- >
39
- {children}
40
- </span>
41
- );
42
- }
43
-
@@ -1,104 +0,0 @@
1
- import type { ButtonHTMLAttributes, ReactNode } from "react";
2
- import Icon from "./icon";
3
-
4
- export type ButtonVariant =
5
- | "primary"
6
- | "secondary"
7
- | "ghost"
8
- | "bare"
9
- | "success"
10
- | "warning"
11
- | "danger"
12
- | "info"
13
- | "accent";
14
-
15
- export type ButtonSize = "sm" | "md" | "lg" | "icon";
16
-
17
- export interface ClickableButtonProps
18
- extends ButtonHTMLAttributes<HTMLButtonElement> {
19
- children: ReactNode;
20
- variant?: ButtonVariant;
21
- /** Controls the height, padding and radius of the button. */
22
- size?: ButtonSize;
23
- /** Optional leading icon (replaced by a spinner while `loading`). */
24
- leftIcon?: ReactNode;
25
- /** Optional trailing icon. */
26
- rightIcon?: ReactNode;
27
- /** Shows a spinner, disables the button and prevents interactions. */
28
- loading?: boolean;
29
- /** Text displayed while `loading` (defaults to `children`). */
30
- loadingText?: string;
31
- /** Expands the button to fill the available width. */
32
- fullWidth?: boolean;
33
- }
34
-
35
- const BASE_CLASS =
36
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-medium text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60 [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0 [&_svg]:text-current";
37
-
38
- const SIZE_CLASS: Record<ButtonSize, string> = {
39
- sm: "h-9 px-3",
40
- md: "h-10 px-4",
41
- lg: "h-11 px-5",
42
- /* Icon-only button: square, no horizontal padding. */
43
- icon: "h-10 w-10 px-0",
44
- };
45
-
46
- const VARIANT_CLASS: Record<ButtonVariant, string> = {
47
- primary:
48
- "bg-primary text-white hover:bg-primary-hover active:bg-primary-active focus-visible:ring-primary",
49
- secondary:
50
- "border border-border bg-surface text-foreground hover:border-primary hover:text-primary focus-visible:ring-primary",
51
- ghost:
52
- "bg-transparent text-muted-foreground hover:text-primary focus-visible:ring-primary",
53
- success:
54
- "bg-success text-white hover:brightness-90 active:brightness-80 focus-visible:ring-success",
55
- warning:
56
- "bg-warning text-white hover:brightness-90 active:brightness-80 focus-visible:ring-warning",
57
- danger:
58
- "bg-danger text-white hover:brightness-90 active:brightness-80 focus-visible:ring-danger",
59
- info: "bg-info text-white hover:brightness-90 active:brightness-80 focus-visible:ring-info",
60
- accent:
61
- "bg-accent text-accent-foreground hover:bg-accent-hover active:brightness-80 focus-visible:ring-accent",
62
- /* No built-in styles: the caller provides everything via className. */
63
- bare: "",
64
- };
65
-
66
- export default function ClickableButton({
67
- children,
68
- variant = "primary",
69
- size = "md",
70
- leftIcon,
71
- rightIcon,
72
- loading = false,
73
- loadingText,
74
- fullWidth = false,
75
- disabled,
76
- className = "",
77
- ...props
78
- }: ClickableButtonProps) {
79
- const isDisabled = disabled || loading;
80
- const resolvedLabel = loading && loadingText ? loadingText : children;
81
-
82
- return (
83
- <button
84
- type="button"
85
- aria-busy={loading || undefined}
86
- disabled={isDisabled}
87
- className={`${BASE_CLASS} ${VARIANT_CLASS[variant]} ${SIZE_CLASS[size]} ${fullWidth ? "w-full" : ""} ${className}`}
88
- {...props}
89
- >
90
- {loading ? (
91
- <Icon
92
- name="LoaderCircle"
93
- size="small"
94
- className="animate-spin"
95
- aria-hidden="true"
96
- />
97
- ) : (
98
- leftIcon
99
- )}
100
- {resolvedLabel}
101
- {!loading && rightIcon}
102
- </button>
103
- );
104
- }
@@ -1,78 +0,0 @@
1
- import type { SVGProps } from "react";
2
- import { icons, type LucideIcon } from "lucide-react";
3
-
4
- /* ------------------------------------------------------------------ */
5
- /* Icon - centralized interface icon */
6
- /* */
7
- /* Single source of truth for icons. Only pick `name`, `variant` and */
8
- /* `size` from the allowed values defined by the Design System. */
9
- /* ------------------------------------------------------------------ */
10
-
11
- /** Available icon sizes from the Iconography section. */
12
- export type IconSize = "small" | "default" | "large" | "display";
13
-
14
- /** Available icon variants, aligned with the Design System colors. */
15
- export type IconVariant =
16
- | "default"
17
- | "muted"
18
- | "primary"
19
- | "success"
20
- | "warning"
21
- | "danger"
22
- | "white";
23
-
24
- /** Every exported Lucide icon name (e.g. "Search", "ArrowRight"). */
25
- export type IconName = keyof typeof icons;
26
-
27
- export interface IconProps extends Omit<SVGProps<SVGSVGElement>, "size"> {
28
- /** The Lucide icon name to render. */
29
- name: IconName;
30
- /** Color variant; defaults to a neutral foreground icon. */
31
- variant?: IconVariant;
32
- /** Size variant following the Iconography tokens. */
33
- size?: IconSize;
34
- /** Overrides the Design System default stroke weight (1.8). */
35
- strokeWidth?: number;
36
- className?: string;
37
- }
38
-
39
- /** Fallback base class: keeps the icon from shrinking inside flex rows. */
40
- const BASE_CLASS = "shrink-0";
41
-
42
- const SIZE_CLASS: Record<IconSize, string> = {
43
- small: "size-[var(--icon-small)]",
44
- default: "size-[var(--icon-default)]",
45
- large: "size-[var(--icon-large)]",
46
- display: "size-[var(--icon-display)]",
47
- };
48
-
49
- const VARIANT_CLASS: Record<IconVariant, string> = {
50
- default: "text-foreground",
51
- muted: "text-muted-foreground",
52
- primary: "text-primary",
53
- success: "text-success",
54
- warning: "text-warning",
55
- danger: "text-danger",
56
- /* White icon intended for colored surfaces (nav items, brand badges). */
57
- white: "text-white",
58
- };
59
-
60
- export default function Icon({
61
- name,
62
- variant = "default",
63
- size = "default",
64
- strokeWidth = 1.8,
65
- className = "",
66
- ...props
67
- }: IconProps) {
68
- const IconComponent: LucideIcon = icons[name];
69
-
70
- return (
71
- <IconComponent
72
- aria-hidden="true"
73
- strokeWidth={strokeWidth}
74
- className={`${BASE_CLASS} ${SIZE_CLASS[size]} ${VARIANT_CLASS[variant]} ${className}`}
75
- {...props}
76
- />
77
- );
78
- }
@@ -1,28 +0,0 @@
1
- export { default as ClickableButton } from "./button";
2
- export type {
3
- ClickableButtonProps,
4
- ButtonVariant,
5
- ButtonSize,
6
- } from "./button";
7
- export { default as Input, Textarea } from "./input";
8
- export type { InputState, InputProps, TextareaProps } from "./input";
9
- export {default as Badge} from "./badge";
10
- export type {BadgeProps} from "./badge";
11
- export {default as UserTable} from "./user-table";
12
- export type {Column, CardAction, UserTableCardActions} from "./user-table";
13
- export { Select, MultiSelect, SelectWithSearch, MultiSelectWithSearch, SelectFilter } from "./select";
14
- export type { SelectOption } from "./select";
15
- export { default as Modal } from "./modal";
16
- export { default as Tabs } from "./tab";
17
- export type { Tab } from "./tab";
18
- export { default as Icon } from "./icon";
19
- export type { IconName, IconVariant, IconSize, IconProps } from "./icon";
20
- export { default as Loader } from "./loader";
21
- export type { LoaderProps } from "./loader";
22
- export { default as MetricBar } from "./metric-bar";
23
- export type { MetricTone } from "./metric-bar";
24
- export { default as Stepper } from "./stepper";
25
- export type { StepperStepState } from "./stepper";
26
- export { default as ActionStack } from "./action-stack";
27
- export type { ActionStackItem } from "./action-stack";
28
-