@karakuri-ui/react 0.2.3 → 0.3.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.
- package/README.md +0 -1
- package/dist/components/ui/accordion.d.mts +40 -0
- package/dist/components/ui/accordion.d.ts +40 -0
- package/dist/components/ui/accordion.js +215 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/accordion.mjs +176 -0
- package/dist/components/ui/accordion.mjs.map +1 -0
- package/dist/components/ui/alert.d.mts +38 -0
- package/dist/components/ui/alert.d.ts +38 -0
- package/dist/components/ui/alert.js +217 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/alert.mjs +180 -0
- package/dist/components/ui/alert.mjs.map +1 -0
- package/dist/components/ui/avatar.d.mts +223 -0
- package/dist/components/ui/avatar.d.ts +223 -0
- package/dist/components/ui/avatar.js +245 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/avatar.mjs +204 -0
- package/dist/components/ui/avatar.mjs.map +1 -0
- package/dist/components/ui/badge.d.mts +31 -0
- package/dist/components/ui/badge.d.ts +31 -0
- package/dist/components/ui/badge.js +205 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/badge.mjs +170 -0
- package/dist/components/ui/badge.mjs.map +1 -0
- package/dist/components/ui/breadcrumb.d.mts +46 -0
- package/dist/components/ui/breadcrumb.d.ts +46 -0
- package/dist/components/ui/breadcrumb.js +201 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/breadcrumb.mjs +160 -0
- package/dist/components/ui/breadcrumb.mjs.map +1 -0
- package/dist/components/ui/button-group.d.mts +22 -0
- package/dist/components/ui/button-group.d.ts +22 -0
- package/dist/components/ui/button-group.js +107 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button-group.mjs +72 -0
- package/dist/components/ui/button-group.mjs.map +1 -0
- package/dist/components/ui/button.d.mts +31 -0
- package/dist/components/ui/button.d.ts +31 -0
- package/dist/components/ui/button.js +176 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/button.mjs +141 -0
- package/dist/components/ui/button.mjs.map +1 -0
- package/dist/components/ui/card.d.mts +60 -0
- package/dist/components/ui/card.d.ts +60 -0
- package/dist/components/ui/card.js +361 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/card.mjs +319 -0
- package/dist/components/ui/card.mjs.map +1 -0
- package/dist/{chart.d.mts → components/ui/chart.d.mts} +2 -18
- package/dist/{chart.d.ts → components/ui/chart.d.ts} +2 -18
- package/dist/{chart.js → components/ui/chart.js} +30 -55
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/{chart.mjs → components/ui/chart.mjs} +22 -46
- package/dist/components/ui/chart.mjs.map +1 -0
- package/dist/components/ui/checkbox.d.mts +24 -0
- package/dist/components/ui/checkbox.d.ts +24 -0
- package/dist/components/ui/checkbox.js +173 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/checkbox.mjs +138 -0
- package/dist/components/ui/checkbox.mjs.map +1 -0
- package/dist/components/ui/divider.d.mts +27 -0
- package/dist/components/ui/divider.d.ts +27 -0
- package/dist/components/ui/divider.js +147 -0
- package/dist/components/ui/divider.js.map +1 -0
- package/dist/components/ui/divider.mjs +112 -0
- package/dist/components/ui/divider.mjs.map +1 -0
- package/dist/components/ui/drawer.d.mts +36 -0
- package/dist/components/ui/drawer.d.ts +36 -0
- package/dist/components/ui/drawer.js +211 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/drawer.mjs +165 -0
- package/dist/components/ui/drawer.mjs.map +1 -0
- package/dist/components/ui/dropdown.d.mts +34 -0
- package/dist/components/ui/dropdown.d.ts +34 -0
- package/dist/components/ui/dropdown.js +295 -0
- package/dist/components/ui/dropdown.js.map +1 -0
- package/dist/components/ui/dropdown.mjs +248 -0
- package/dist/components/ui/dropdown.mjs.map +1 -0
- package/dist/components/ui/field.d.mts +26 -0
- package/dist/components/ui/field.d.ts +26 -0
- package/dist/components/ui/field.js +141 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/field.mjs +103 -0
- package/dist/components/ui/field.mjs.map +1 -0
- package/dist/components/ui/icon-button.d.mts +20 -0
- package/dist/components/ui/icon-button.d.ts +20 -0
- package/dist/components/ui/icon-button.js +147 -0
- package/dist/components/ui/icon-button.js.map +1 -0
- package/dist/components/ui/icon-button.mjs +112 -0
- package/dist/components/ui/icon-button.mjs.map +1 -0
- package/dist/components/ui/index.d.mts +55 -0
- package/dist/components/ui/index.d.ts +55 -0
- package/dist/components/ui/index.js +468 -0
- package/dist/components/ui/index.js.map +1 -0
- package/dist/components/ui/index.mjs +242 -0
- package/dist/components/ui/index.mjs.map +1 -0
- package/dist/components/ui/input.d.mts +20 -0
- package/dist/components/ui/input.d.ts +20 -0
- package/dist/components/ui/input.js +250 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/input.mjs +215 -0
- package/dist/components/ui/input.mjs.map +1 -0
- package/dist/components/ui/metric-card.d.mts +38 -0
- package/dist/components/ui/metric-card.d.ts +38 -0
- package/dist/components/ui/metric-card.js +250 -0
- package/dist/components/ui/metric-card.js.map +1 -0
- package/dist/components/ui/metric-card.mjs +209 -0
- package/dist/components/ui/metric-card.mjs.map +1 -0
- package/dist/components/ui/modal.d.mts +47 -0
- package/dist/components/ui/modal.d.ts +47 -0
- package/dist/components/ui/modal.js +371 -0
- package/dist/components/ui/modal.js.map +1 -0
- package/dist/components/ui/modal.mjs +313 -0
- package/dist/components/ui/modal.mjs.map +1 -0
- package/dist/components/ui/navigation-menu.d.mts +120 -0
- package/dist/components/ui/navigation-menu.d.ts +120 -0
- package/dist/components/ui/navigation-menu.js +521 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/navigation-menu.mjs +478 -0
- package/dist/components/ui/navigation-menu.mjs.map +1 -0
- package/dist/components/ui/pagination.d.mts +113 -0
- package/dist/components/ui/pagination.d.ts +113 -0
- package/dist/components/ui/pagination.js +484 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/pagination.mjs +438 -0
- package/dist/components/ui/pagination.mjs.map +1 -0
- package/dist/components/ui/popover.d.mts +29 -0
- package/dist/components/ui/popover.d.ts +29 -0
- package/dist/components/ui/popover.js +165 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/popover.mjs +124 -0
- package/dist/components/ui/popover.mjs.map +1 -0
- package/dist/components/ui/progress.d.mts +35 -0
- package/dist/components/ui/progress.d.ts +35 -0
- package/dist/components/ui/progress.js +194 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/progress.mjs +159 -0
- package/dist/components/ui/progress.mjs.map +1 -0
- package/dist/components/ui/radio-group.d.mts +35 -0
- package/dist/components/ui/radio-group.d.ts +35 -0
- package/dist/components/ui/radio-group.js +174 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/radio-group.mjs +137 -0
- package/dist/components/ui/radio-group.mjs.map +1 -0
- package/dist/components/ui/segmented.d.mts +25 -0
- package/dist/components/ui/segmented.d.ts +25 -0
- package/dist/components/ui/segmented.js +238 -0
- package/dist/components/ui/segmented.js.map +1 -0
- package/dist/components/ui/segmented.mjs +201 -0
- package/dist/components/ui/segmented.mjs.map +1 -0
- package/dist/components/ui/select.d.mts +20 -0
- package/dist/components/ui/select.d.ts +20 -0
- package/dist/components/ui/select.js +308 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/select.mjs +267 -0
- package/dist/components/ui/select.mjs.map +1 -0
- package/dist/components/ui/skeleton.d.mts +26 -0
- package/dist/components/ui/skeleton.d.ts +26 -0
- package/dist/components/ui/skeleton.js +144 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/skeleton.mjs +109 -0
- package/dist/components/ui/skeleton.mjs.map +1 -0
- package/dist/components/ui/slider.d.mts +38 -0
- package/dist/components/ui/slider.d.ts +38 -0
- package/dist/components/ui/slider.js +180 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/slider.mjs +145 -0
- package/dist/components/ui/slider.mjs.map +1 -0
- package/dist/components/ui/spinner.d.mts +23 -0
- package/dist/components/ui/spinner.d.ts +23 -0
- package/dist/components/ui/spinner.js +471 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/spinner.mjs +436 -0
- package/dist/components/ui/spinner.mjs.map +1 -0
- package/dist/components/ui/switch.d.mts +22 -0
- package/dist/components/ui/switch.d.ts +22 -0
- package/dist/components/ui/switch.js +173 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/switch.mjs +138 -0
- package/dist/components/ui/switch.mjs.map +1 -0
- package/dist/components/ui/table.d.mts +60 -0
- package/dist/components/ui/table.d.ts +60 -0
- package/dist/components/ui/table.js +231 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/table.mjs +190 -0
- package/dist/components/ui/table.mjs.map +1 -0
- package/dist/components/ui/tabs.d.mts +31 -0
- package/dist/components/ui/tabs.d.ts +31 -0
- package/dist/components/ui/tabs.js +233 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/tabs.mjs +194 -0
- package/dist/components/ui/tabs.mjs.map +1 -0
- package/dist/components/ui/textarea.d.mts +19 -0
- package/dist/components/ui/textarea.d.ts +19 -0
- package/dist/components/ui/textarea.js +181 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/textarea.mjs +146 -0
- package/dist/components/ui/textarea.mjs.map +1 -0
- package/dist/components/ui/toast.d.mts +93 -0
- package/dist/components/ui/toast.d.ts +93 -0
- package/dist/components/ui/toast.js +429 -0
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/toast.mjs +393 -0
- package/dist/components/ui/toast.mjs.map +1 -0
- package/dist/components/ui/toggle-group.d.mts +42 -0
- package/dist/components/ui/toggle-group.d.ts +42 -0
- package/dist/components/ui/toggle-group.js +183 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle-group.mjs +146 -0
- package/dist/components/ui/toggle-group.mjs.map +1 -0
- package/dist/components/ui/toggle.d.mts +19 -0
- package/dist/components/ui/toggle.d.ts +19 -0
- package/dist/components/ui/toggle.js +194 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/toggle.mjs +159 -0
- package/dist/components/ui/toggle.mjs.map +1 -0
- package/dist/components/ui/tooltip.d.mts +26 -0
- package/dist/components/ui/tooltip.d.ts +26 -0
- package/dist/components/ui/tooltip.js +128 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/ui/tooltip.mjs +88 -0
- package/dist/components/ui/tooltip.mjs.map +1 -0
- package/dist/lib/code-generator.d.mts +60 -0
- package/dist/lib/code-generator.d.ts +60 -0
- package/dist/lib/code-generator.js +224 -0
- package/dist/lib/code-generator.js.map +1 -0
- package/dist/lib/code-generator.mjs +159 -0
- package/dist/lib/code-generator.mjs.map +1 -0
- package/dist/lib/utils.d.mts +10 -0
- package/dist/lib/utils.d.ts +10 -0
- package/dist/lib/utils.js +33 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/utils.mjs +9 -0
- package/dist/lib/utils.mjs.map +1 -0
- package/package.json +11 -11
- package/dist/chart.js.map +0 -1
- package/dist/chart.mjs.map +0 -1
- package/dist/index.d.mts +0 -1636
- package/dist/index.d.ts +0 -1636
- package/dist/index.js +0 -7291
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -7048
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var code_generator_exports = {};
|
|
20
|
+
__export(code_generator_exports, {
|
|
21
|
+
ACCORDION_NAMES: () => ACCORDION_NAMES,
|
|
22
|
+
ALERT_MODAL_NAMES: () => ALERT_MODAL_NAMES,
|
|
23
|
+
ALERT_NAMES: () => ALERT_NAMES,
|
|
24
|
+
AVATAR_NAMES: () => AVATAR_NAMES,
|
|
25
|
+
BADGE_NAMES: () => BADGE_NAMES,
|
|
26
|
+
BREADCRUMB_NAMES: () => BREADCRUMB_NAMES,
|
|
27
|
+
BUTTON_GROUP_NAMES: () => BUTTON_GROUP_NAMES,
|
|
28
|
+
BUTTON_NAMES: () => BUTTON_NAMES,
|
|
29
|
+
CARD_NAMES: () => CARD_NAMES,
|
|
30
|
+
CHART_NAMES: () => CHART_NAMES,
|
|
31
|
+
CHECKBOX_NAMES: () => CHECKBOX_NAMES,
|
|
32
|
+
DIVIDER_NAMES: () => DIVIDER_NAMES,
|
|
33
|
+
DRAWER_NAMES: () => DRAWER_NAMES,
|
|
34
|
+
DROPDOWN_NAMES: () => DROPDOWN_NAMES,
|
|
35
|
+
FIELD_NAMES: () => FIELD_NAMES,
|
|
36
|
+
ICON_BUTTON_NAMES: () => ICON_BUTTON_NAMES,
|
|
37
|
+
INPUT_NAMES: () => INPUT_NAMES,
|
|
38
|
+
METRIC_CARD_NAMES: () => METRIC_CARD_NAMES,
|
|
39
|
+
MODAL_NAMES: () => MODAL_NAMES,
|
|
40
|
+
NAVIGATION_MENU_NAMES: () => NAVIGATION_MENU_NAMES,
|
|
41
|
+
PAGINATION_NAMES: () => PAGINATION_NAMES,
|
|
42
|
+
POPOVER_NAMES: () => POPOVER_NAMES,
|
|
43
|
+
PROGRESS_NAMES: () => PROGRESS_NAMES,
|
|
44
|
+
RADIO_GROUP_NAMES: () => RADIO_GROUP_NAMES,
|
|
45
|
+
REACT_NAMES: () => REACT_NAMES,
|
|
46
|
+
RECHARTS_NAMES: () => RECHARTS_NAMES,
|
|
47
|
+
SEGMENTED_NAMES: () => SEGMENTED_NAMES,
|
|
48
|
+
SELECT_NAMES: () => SELECT_NAMES,
|
|
49
|
+
SKELETON_NAMES: () => SKELETON_NAMES,
|
|
50
|
+
SLIDER_NAMES: () => SLIDER_NAMES,
|
|
51
|
+
SPINNER_NAMES: () => SPINNER_NAMES,
|
|
52
|
+
SWITCH_NAMES: () => SWITCH_NAMES,
|
|
53
|
+
TABLE_NAMES: () => TABLE_NAMES,
|
|
54
|
+
TABS_NAMES: () => TABS_NAMES,
|
|
55
|
+
TEXTAREA_NAMES: () => TEXTAREA_NAMES,
|
|
56
|
+
TOAST_NAMES: () => TOAST_NAMES,
|
|
57
|
+
TOGGLE_GROUP_NAMES: () => TOGGLE_GROUP_NAMES,
|
|
58
|
+
TOGGLE_NAMES: () => TOGGLE_NAMES,
|
|
59
|
+
TOOLTIP_NAMES: () => TOOLTIP_NAMES,
|
|
60
|
+
buildImport: () => buildImport,
|
|
61
|
+
extractUsedNames: () => extractUsedNames,
|
|
62
|
+
importUsed: () => importUsed
|
|
63
|
+
});
|
|
64
|
+
module.exports = __toCommonJS(code_generator_exports);
|
|
65
|
+
const ACCORDION_NAMES = ["Accordion", "AccordionContent", "AccordionItem", "AccordionTrigger"];
|
|
66
|
+
const ALERT_NAMES = ["Alert", "AlertDescription", "AlertTitle"];
|
|
67
|
+
const AVATAR_NAMES = ["Avatar", "AvatarFallback", "AvatarGroup", "AvatarImage"];
|
|
68
|
+
const BADGE_NAMES = ["Badge"];
|
|
69
|
+
const BREADCRUMB_NAMES = ["Breadcrumb", "BreadcrumbEllipsis", "BreadcrumbItem", "BreadcrumbLink", "BreadcrumbList", "BreadcrumbPage", "BreadcrumbSeparator"];
|
|
70
|
+
const BUTTON_NAMES = ["Button"];
|
|
71
|
+
const BUTTON_GROUP_NAMES = ["ButtonGroup"];
|
|
72
|
+
const CARD_NAMES = ["Card", "CardAction", "CardContent", "CardDescription", "CardFooter", "CardHeader", "CardImage", "CardTitle"];
|
|
73
|
+
const CHECKBOX_NAMES = ["Checkbox"];
|
|
74
|
+
const DIVIDER_NAMES = ["Divider"];
|
|
75
|
+
const DRAWER_NAMES = ["Drawer", "DrawerBody", "DrawerClose", "DrawerContent", "DrawerDescription", "DrawerFooter", "DrawerHeader", "DrawerOverlay", "DrawerPortal", "DrawerTitle", "DrawerTrigger"];
|
|
76
|
+
const DROPDOWN_NAMES = ["DropdownMenu", "DropdownMenuCheckboxItem", "DropdownMenuContent", "DropdownMenuGroup", "DropdownMenuItem", "DropdownMenuLabel", "DropdownMenuRadioGroup", "DropdownMenuRadioItem", "DropdownMenuSeparator", "DropdownMenuShortcut", "DropdownMenuSub", "DropdownMenuSubContent", "DropdownMenuSubTrigger", "DropdownMenuTrigger"];
|
|
77
|
+
const FIELD_NAMES = ["Field", "FieldCharCount", "FieldError", "FieldLabel"];
|
|
78
|
+
const ICON_BUTTON_NAMES = ["IconButton"];
|
|
79
|
+
const INPUT_NAMES = ["Input"];
|
|
80
|
+
const METRIC_CARD_NAMES = ["MetricCard", "MetricCardDescription", "MetricCardHeader", "MetricCardSymbol", "MetricCardTitle", "MetricCardTrend", "MetricCardValue"];
|
|
81
|
+
const MODAL_NAMES = ["Modal", "ModalBody", "ModalClose", "ModalContent", "ModalDescription", "ModalFooter", "ModalHeader", "ModalOverlay", "ModalPortal", "ModalTitle", "ModalTrigger"];
|
|
82
|
+
const ALERT_MODAL_NAMES = ["AlertModal", "AlertModalAction", "AlertModalBody", "AlertModalCancel", "AlertModalContent", "AlertModalDescription", "AlertModalFooter", "AlertModalHeader", "AlertModalOverlay", "AlertModalPortal", "AlertModalTitle", "AlertModalTrigger"];
|
|
83
|
+
const NAVIGATION_MENU_NAMES = ["NavigationMenu", "NavigationMenuContent", "NavigationMenuGroup", "NavigationMenuIndicator", "NavigationMenuItem", "NavigationMenuLink", "NavigationMenuList", "NavigationMenuTrigger", "NavigationMenuViewport"];
|
|
84
|
+
const PAGINATION_NAMES = ["Pagination", "PaginationContent", "PaginationEllipsis", "PaginationFirst", "PaginationItem", "PaginationItems", "PaginationLast", "PaginationLink", "PaginationNext", "PaginationPrevious"];
|
|
85
|
+
const POPOVER_NAMES = ["Popover", "PopoverAnchor", "PopoverArrow", "PopoverClose", "PopoverContent", "PopoverPortal", "PopoverTrigger"];
|
|
86
|
+
const PROGRESS_NAMES = ["Progress"];
|
|
87
|
+
const RADIO_GROUP_NAMES = ["RadioGroup", "RadioGroupItem"];
|
|
88
|
+
const SEGMENTED_NAMES = ["Segmented", "SegmentedItem"];
|
|
89
|
+
const SELECT_NAMES = ["Select", "SelectContent", "SelectGroup", "SelectItem", "SelectLabel", "SelectSeparator", "SelectTrigger", "SelectValue"];
|
|
90
|
+
const SKELETON_NAMES = ["Skeleton"];
|
|
91
|
+
const SLIDER_NAMES = ["Slider"];
|
|
92
|
+
const SPINNER_NAMES = ["Spinner"];
|
|
93
|
+
const SWITCH_NAMES = ["Switch"];
|
|
94
|
+
const TABLE_NAMES = ["Table", "TableBody", "TableCaption", "TableCell", "TableFooter", "TableHead", "TableHeader", "TableRow"];
|
|
95
|
+
const TABS_NAMES = ["Tabs", "TabsContent", "TabsList", "TabsTrigger"];
|
|
96
|
+
const TEXTAREA_NAMES = ["Textarea"];
|
|
97
|
+
const TOAST_NAMES = ["Toaster"];
|
|
98
|
+
const TOGGLE_NAMES = ["Toggle"];
|
|
99
|
+
const TOGGLE_GROUP_NAMES = ["ToggleGroup", "ToggleGroupItem"];
|
|
100
|
+
const TOOLTIP_NAMES = ["Tooltip", "TooltipArrow", "TooltipContent", "TooltipPortal", "TooltipProvider", "TooltipTrigger"];
|
|
101
|
+
const CHART_NAMES = [
|
|
102
|
+
"Chart",
|
|
103
|
+
"ChartArea",
|
|
104
|
+
"ChartBar",
|
|
105
|
+
"ChartLegend",
|
|
106
|
+
"ChartLegendContent",
|
|
107
|
+
"ChartLine",
|
|
108
|
+
"ChartPie",
|
|
109
|
+
"ChartStyle",
|
|
110
|
+
"ChartTooltip",
|
|
111
|
+
"ChartTooltipContent",
|
|
112
|
+
"ChartXAxis",
|
|
113
|
+
"ChartYAxis"
|
|
114
|
+
];
|
|
115
|
+
const RECHARTS_NAMES = [
|
|
116
|
+
"AreaChart",
|
|
117
|
+
"BarChart",
|
|
118
|
+
"CartesianGrid",
|
|
119
|
+
"Cell",
|
|
120
|
+
"LabelList",
|
|
121
|
+
"LineChart",
|
|
122
|
+
"Pie",
|
|
123
|
+
"PieChart"
|
|
124
|
+
];
|
|
125
|
+
const REACT_NAMES = [
|
|
126
|
+
...ACCORDION_NAMES,
|
|
127
|
+
...ALERT_NAMES,
|
|
128
|
+
...AVATAR_NAMES,
|
|
129
|
+
...BADGE_NAMES,
|
|
130
|
+
...BREADCRUMB_NAMES,
|
|
131
|
+
...BUTTON_NAMES,
|
|
132
|
+
...BUTTON_GROUP_NAMES,
|
|
133
|
+
...CARD_NAMES,
|
|
134
|
+
...CHECKBOX_NAMES,
|
|
135
|
+
...DIVIDER_NAMES,
|
|
136
|
+
...DRAWER_NAMES,
|
|
137
|
+
...DROPDOWN_NAMES,
|
|
138
|
+
...FIELD_NAMES,
|
|
139
|
+
...ICON_BUTTON_NAMES,
|
|
140
|
+
...INPUT_NAMES,
|
|
141
|
+
...METRIC_CARD_NAMES,
|
|
142
|
+
...MODAL_NAMES,
|
|
143
|
+
...ALERT_MODAL_NAMES,
|
|
144
|
+
...NAVIGATION_MENU_NAMES,
|
|
145
|
+
...PAGINATION_NAMES,
|
|
146
|
+
...POPOVER_NAMES,
|
|
147
|
+
...PROGRESS_NAMES,
|
|
148
|
+
...RADIO_GROUP_NAMES,
|
|
149
|
+
...SEGMENTED_NAMES,
|
|
150
|
+
...SELECT_NAMES,
|
|
151
|
+
...SKELETON_NAMES,
|
|
152
|
+
...SLIDER_NAMES,
|
|
153
|
+
...SPINNER_NAMES,
|
|
154
|
+
...SWITCH_NAMES,
|
|
155
|
+
...TABLE_NAMES,
|
|
156
|
+
...TABS_NAMES,
|
|
157
|
+
...TEXTAREA_NAMES,
|
|
158
|
+
...TOAST_NAMES,
|
|
159
|
+
...TOGGLE_NAMES,
|
|
160
|
+
...TOGGLE_GROUP_NAMES,
|
|
161
|
+
...TOOLTIP_NAMES
|
|
162
|
+
];
|
|
163
|
+
function extractUsedNames(jsxBody, namePool) {
|
|
164
|
+
return namePool.filter((n) => new RegExp(`<${n}[\\s/>]`).test(jsxBody));
|
|
165
|
+
}
|
|
166
|
+
function buildImport(names, pkg, opts = {}) {
|
|
167
|
+
if (names.length === 0) return "";
|
|
168
|
+
const { multiline = true } = opts;
|
|
169
|
+
if (multiline && names.length > 3) {
|
|
170
|
+
return `import {
|
|
171
|
+
${names.join(",\n ")},
|
|
172
|
+
} from '${pkg}'`;
|
|
173
|
+
}
|
|
174
|
+
return `import { ${names.join(", ")} } from '${pkg}'`;
|
|
175
|
+
}
|
|
176
|
+
function importUsed(jsxBody, namePool, pkg, opts = {}) {
|
|
177
|
+
return buildImport(extractUsedNames(jsxBody, namePool), pkg, opts);
|
|
178
|
+
}
|
|
179
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
180
|
+
0 && (module.exports = {
|
|
181
|
+
ACCORDION_NAMES,
|
|
182
|
+
ALERT_MODAL_NAMES,
|
|
183
|
+
ALERT_NAMES,
|
|
184
|
+
AVATAR_NAMES,
|
|
185
|
+
BADGE_NAMES,
|
|
186
|
+
BREADCRUMB_NAMES,
|
|
187
|
+
BUTTON_GROUP_NAMES,
|
|
188
|
+
BUTTON_NAMES,
|
|
189
|
+
CARD_NAMES,
|
|
190
|
+
CHART_NAMES,
|
|
191
|
+
CHECKBOX_NAMES,
|
|
192
|
+
DIVIDER_NAMES,
|
|
193
|
+
DRAWER_NAMES,
|
|
194
|
+
DROPDOWN_NAMES,
|
|
195
|
+
FIELD_NAMES,
|
|
196
|
+
ICON_BUTTON_NAMES,
|
|
197
|
+
INPUT_NAMES,
|
|
198
|
+
METRIC_CARD_NAMES,
|
|
199
|
+
MODAL_NAMES,
|
|
200
|
+
NAVIGATION_MENU_NAMES,
|
|
201
|
+
PAGINATION_NAMES,
|
|
202
|
+
POPOVER_NAMES,
|
|
203
|
+
PROGRESS_NAMES,
|
|
204
|
+
RADIO_GROUP_NAMES,
|
|
205
|
+
REACT_NAMES,
|
|
206
|
+
RECHARTS_NAMES,
|
|
207
|
+
SEGMENTED_NAMES,
|
|
208
|
+
SELECT_NAMES,
|
|
209
|
+
SKELETON_NAMES,
|
|
210
|
+
SLIDER_NAMES,
|
|
211
|
+
SPINNER_NAMES,
|
|
212
|
+
SWITCH_NAMES,
|
|
213
|
+
TABLE_NAMES,
|
|
214
|
+
TABS_NAMES,
|
|
215
|
+
TEXTAREA_NAMES,
|
|
216
|
+
TOAST_NAMES,
|
|
217
|
+
TOGGLE_GROUP_NAMES,
|
|
218
|
+
TOGGLE_NAMES,
|
|
219
|
+
TOOLTIP_NAMES,
|
|
220
|
+
buildImport,
|
|
221
|
+
extractUsedNames,
|
|
222
|
+
importUsed
|
|
223
|
+
});
|
|
224
|
+
//# sourceMappingURL=code-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/code-generator.ts"],"sourcesContent":["// Derive `import { ... }` from JSX body so generated code structurally\n// mirrors actual rendered JSX. Prevents over-import and under-import bugs.\n//\n// Contract: extractUsedNames(jsxBody, pool) returns names from `pool` that\n// appear as JSX tags (`<Name>` / `<Name ` / `<Name/>`) in `jsxBody`. The\n// regex boundary `<${name}[\\s/>]` prevents prefix collision — `<Card>` does\n// not match `CardHeader`, and `<CardHeader>` does not match `Card`.\n\n// ---- Component name pools (source of truth: src/components/ui/index.ts) ----\n\nexport const ACCORDION_NAMES = ['Accordion', 'AccordionContent', 'AccordionItem', 'AccordionTrigger'] as const\nexport const ALERT_NAMES = ['Alert', 'AlertDescription', 'AlertTitle'] as const\nexport const AVATAR_NAMES = ['Avatar', 'AvatarFallback', 'AvatarGroup', 'AvatarImage'] as const\nexport const BADGE_NAMES = ['Badge'] as const\nexport const BREADCRUMB_NAMES = ['Breadcrumb', 'BreadcrumbEllipsis', 'BreadcrumbItem', 'BreadcrumbLink', 'BreadcrumbList', 'BreadcrumbPage', 'BreadcrumbSeparator'] as const\nexport const BUTTON_NAMES = ['Button'] as const\nexport const BUTTON_GROUP_NAMES = ['ButtonGroup'] as const\nexport const CARD_NAMES = ['Card', 'CardAction', 'CardContent', 'CardDescription', 'CardFooter', 'CardHeader', 'CardImage', 'CardTitle'] as const\nexport const CHECKBOX_NAMES = ['Checkbox'] as const\nexport const DIVIDER_NAMES = ['Divider'] as const\nexport const DRAWER_NAMES = ['Drawer', 'DrawerBody', 'DrawerClose', 'DrawerContent', 'DrawerDescription', 'DrawerFooter', 'DrawerHeader', 'DrawerOverlay', 'DrawerPortal', 'DrawerTitle', 'DrawerTrigger'] as const\nexport const DROPDOWN_NAMES = ['DropdownMenu', 'DropdownMenuCheckboxItem', 'DropdownMenuContent', 'DropdownMenuGroup', 'DropdownMenuItem', 'DropdownMenuLabel', 'DropdownMenuRadioGroup', 'DropdownMenuRadioItem', 'DropdownMenuSeparator', 'DropdownMenuShortcut', 'DropdownMenuSub', 'DropdownMenuSubContent', 'DropdownMenuSubTrigger', 'DropdownMenuTrigger'] as const\nexport const FIELD_NAMES = ['Field', 'FieldCharCount', 'FieldError', 'FieldLabel'] as const\nexport const ICON_BUTTON_NAMES = ['IconButton'] as const\nexport const INPUT_NAMES = ['Input'] as const\nexport const METRIC_CARD_NAMES = ['MetricCard', 'MetricCardDescription', 'MetricCardHeader', 'MetricCardSymbol', 'MetricCardTitle', 'MetricCardTrend', 'MetricCardValue'] as const\nexport const MODAL_NAMES = ['Modal', 'ModalBody', 'ModalClose', 'ModalContent', 'ModalDescription', 'ModalFooter', 'ModalHeader', 'ModalOverlay', 'ModalPortal', 'ModalTitle', 'ModalTrigger'] as const\nexport const ALERT_MODAL_NAMES = ['AlertModal', 'AlertModalAction', 'AlertModalBody', 'AlertModalCancel', 'AlertModalContent', 'AlertModalDescription', 'AlertModalFooter', 'AlertModalHeader', 'AlertModalOverlay', 'AlertModalPortal', 'AlertModalTitle', 'AlertModalTrigger'] as const\nexport const NAVIGATION_MENU_NAMES = ['NavigationMenu', 'NavigationMenuContent', 'NavigationMenuGroup', 'NavigationMenuIndicator', 'NavigationMenuItem', 'NavigationMenuLink', 'NavigationMenuList', 'NavigationMenuTrigger', 'NavigationMenuViewport'] as const\nexport const PAGINATION_NAMES = ['Pagination', 'PaginationContent', 'PaginationEllipsis', 'PaginationFirst', 'PaginationItem', 'PaginationItems', 'PaginationLast', 'PaginationLink', 'PaginationNext', 'PaginationPrevious'] as const\nexport const POPOVER_NAMES = ['Popover', 'PopoverAnchor', 'PopoverArrow', 'PopoverClose', 'PopoverContent', 'PopoverPortal', 'PopoverTrigger'] as const\nexport const PROGRESS_NAMES = ['Progress'] as const\nexport const RADIO_GROUP_NAMES = ['RadioGroup', 'RadioGroupItem'] as const\nexport const SEGMENTED_NAMES = ['Segmented', 'SegmentedItem'] as const\nexport const SELECT_NAMES = ['Select', 'SelectContent', 'SelectGroup', 'SelectItem', 'SelectLabel', 'SelectSeparator', 'SelectTrigger', 'SelectValue'] as const\nexport const SKELETON_NAMES = ['Skeleton'] as const\nexport const SLIDER_NAMES = ['Slider'] as const\nexport const SPINNER_NAMES = ['Spinner'] as const\nexport const SWITCH_NAMES = ['Switch'] as const\nexport const TABLE_NAMES = ['Table', 'TableBody', 'TableCaption', 'TableCell', 'TableFooter', 'TableHead', 'TableHeader', 'TableRow'] as const\nexport const TABS_NAMES = ['Tabs', 'TabsContent', 'TabsList', 'TabsTrigger'] as const\nexport const TEXTAREA_NAMES = ['Textarea'] as const\nexport const TOAST_NAMES = ['Toaster'] as const\nexport const TOGGLE_NAMES = ['Toggle'] as const\nexport const TOGGLE_GROUP_NAMES = ['ToggleGroup', 'ToggleGroupItem'] as const\nexport const TOOLTIP_NAMES = ['Tooltip', 'TooltipArrow', 'TooltipContent', 'TooltipPortal', 'TooltipProvider', 'TooltipTrigger'] as const\n\n// Chart exports from `@karakuri-ui/react/chart` subpath. Charts ship behind\n// an opt-in subpath because `recharts` is a heavy optional peer dep.\nexport const CHART_NAMES = [\n 'Chart',\n 'ChartArea',\n 'ChartBar',\n 'ChartLegend',\n 'ChartLegendContent',\n 'ChartLine',\n 'ChartPie',\n 'ChartStyle',\n 'ChartTooltip',\n 'ChartTooltipContent',\n 'ChartXAxis',\n 'ChartYAxis',\n] as const\n\n// Recharts primitives used inside chart demos (`recharts` peer dep).\nexport const RECHARTS_NAMES = [\n 'AreaChart',\n 'BarChart',\n 'CartesianGrid',\n 'Cell',\n 'LabelList',\n 'LineChart',\n 'Pie',\n 'PieChart',\n] as const\n\n// Flat pool of every `@karakuri-ui/react` JSX component. Used when a page\n// mixes several compounds + atoms (e.g. Card page also renders Button,\n// IconButton, DropdownMenu).\nexport const REACT_NAMES = [\n ...ACCORDION_NAMES,\n ...ALERT_NAMES,\n ...AVATAR_NAMES,\n ...BADGE_NAMES,\n ...BREADCRUMB_NAMES,\n ...BUTTON_NAMES,\n ...BUTTON_GROUP_NAMES,\n ...CARD_NAMES,\n ...CHECKBOX_NAMES,\n ...DIVIDER_NAMES,\n ...DRAWER_NAMES,\n ...DROPDOWN_NAMES,\n ...FIELD_NAMES,\n ...ICON_BUTTON_NAMES,\n ...INPUT_NAMES,\n ...METRIC_CARD_NAMES,\n ...MODAL_NAMES,\n ...ALERT_MODAL_NAMES,\n ...NAVIGATION_MENU_NAMES,\n ...PAGINATION_NAMES,\n ...POPOVER_NAMES,\n ...PROGRESS_NAMES,\n ...RADIO_GROUP_NAMES,\n ...SEGMENTED_NAMES,\n ...SELECT_NAMES,\n ...SKELETON_NAMES,\n ...SLIDER_NAMES,\n ...SPINNER_NAMES,\n ...SWITCH_NAMES,\n ...TABLE_NAMES,\n ...TABS_NAMES,\n ...TEXTAREA_NAMES,\n ...TOAST_NAMES,\n ...TOGGLE_NAMES,\n ...TOGGLE_GROUP_NAMES,\n ...TOOLTIP_NAMES,\n] as const\n\n// ---- Helpers ----\n\nexport function extractUsedNames(jsxBody: string, namePool: readonly string[]): string[] {\n // Prefix-collision-safe: char after name must be whitespace, `/`, or `>`\n return namePool.filter((n) => new RegExp(`<${n}[\\\\s/>]`).test(jsxBody))\n}\n\nexport interface BuildImportOptions {\n /** Break into multi-line `import { ... }` when >3 names (default: true). */\n multiline?: boolean\n}\n\nexport function buildImport(\n names: string[],\n pkg: string,\n opts: BuildImportOptions = {},\n): string {\n if (names.length === 0) return ''\n const { multiline = true } = opts\n if (multiline && names.length > 3) {\n return `import {\\n ${names.join(',\\n ')},\\n} from '${pkg}'`\n }\n return `import { ${names.join(', ')} } from '${pkg}'`\n}\n\n/**\n * Derive a single `import { ... } from pkg` from the JSX body.\n *\n * Usage — one per branch inside generateCode:\n * ```ts\n * const jsxBody = `<Card><CardHeader>...</CardHeader></Card>`\n * return `${importUsed(jsxBody, CARD_NAMES, pkg)}\\n\\n${jsxBody}`\n * ```\n *\n * **Never union pools across branches** — each branch's jsxBody must feed\n * its own import derivation to guarantee structural 1:1.\n */\nexport function importUsed(\n jsxBody: string,\n namePool: readonly string[],\n pkg: string,\n opts: BuildImportOptions = {},\n): string {\n return buildImport(extractUsedNames(jsxBody, namePool), pkg, opts)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AAO,YAAY,iBAAiB,SAAS,QAAQ,GAAG,KAAK,IAAI;AACnE;","names":[]}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
const ACCORDION_NAMES = ["Accordion", "AccordionContent", "AccordionItem", "AccordionTrigger"];
|
|
2
|
+
const ALERT_NAMES = ["Alert", "AlertDescription", "AlertTitle"];
|
|
3
|
+
const AVATAR_NAMES = ["Avatar", "AvatarFallback", "AvatarGroup", "AvatarImage"];
|
|
4
|
+
const BADGE_NAMES = ["Badge"];
|
|
5
|
+
const BREADCRUMB_NAMES = ["Breadcrumb", "BreadcrumbEllipsis", "BreadcrumbItem", "BreadcrumbLink", "BreadcrumbList", "BreadcrumbPage", "BreadcrumbSeparator"];
|
|
6
|
+
const BUTTON_NAMES = ["Button"];
|
|
7
|
+
const BUTTON_GROUP_NAMES = ["ButtonGroup"];
|
|
8
|
+
const CARD_NAMES = ["Card", "CardAction", "CardContent", "CardDescription", "CardFooter", "CardHeader", "CardImage", "CardTitle"];
|
|
9
|
+
const CHECKBOX_NAMES = ["Checkbox"];
|
|
10
|
+
const DIVIDER_NAMES = ["Divider"];
|
|
11
|
+
const DRAWER_NAMES = ["Drawer", "DrawerBody", "DrawerClose", "DrawerContent", "DrawerDescription", "DrawerFooter", "DrawerHeader", "DrawerOverlay", "DrawerPortal", "DrawerTitle", "DrawerTrigger"];
|
|
12
|
+
const DROPDOWN_NAMES = ["DropdownMenu", "DropdownMenuCheckboxItem", "DropdownMenuContent", "DropdownMenuGroup", "DropdownMenuItem", "DropdownMenuLabel", "DropdownMenuRadioGroup", "DropdownMenuRadioItem", "DropdownMenuSeparator", "DropdownMenuShortcut", "DropdownMenuSub", "DropdownMenuSubContent", "DropdownMenuSubTrigger", "DropdownMenuTrigger"];
|
|
13
|
+
const FIELD_NAMES = ["Field", "FieldCharCount", "FieldError", "FieldLabel"];
|
|
14
|
+
const ICON_BUTTON_NAMES = ["IconButton"];
|
|
15
|
+
const INPUT_NAMES = ["Input"];
|
|
16
|
+
const METRIC_CARD_NAMES = ["MetricCard", "MetricCardDescription", "MetricCardHeader", "MetricCardSymbol", "MetricCardTitle", "MetricCardTrend", "MetricCardValue"];
|
|
17
|
+
const MODAL_NAMES = ["Modal", "ModalBody", "ModalClose", "ModalContent", "ModalDescription", "ModalFooter", "ModalHeader", "ModalOverlay", "ModalPortal", "ModalTitle", "ModalTrigger"];
|
|
18
|
+
const ALERT_MODAL_NAMES = ["AlertModal", "AlertModalAction", "AlertModalBody", "AlertModalCancel", "AlertModalContent", "AlertModalDescription", "AlertModalFooter", "AlertModalHeader", "AlertModalOverlay", "AlertModalPortal", "AlertModalTitle", "AlertModalTrigger"];
|
|
19
|
+
const NAVIGATION_MENU_NAMES = ["NavigationMenu", "NavigationMenuContent", "NavigationMenuGroup", "NavigationMenuIndicator", "NavigationMenuItem", "NavigationMenuLink", "NavigationMenuList", "NavigationMenuTrigger", "NavigationMenuViewport"];
|
|
20
|
+
const PAGINATION_NAMES = ["Pagination", "PaginationContent", "PaginationEllipsis", "PaginationFirst", "PaginationItem", "PaginationItems", "PaginationLast", "PaginationLink", "PaginationNext", "PaginationPrevious"];
|
|
21
|
+
const POPOVER_NAMES = ["Popover", "PopoverAnchor", "PopoverArrow", "PopoverClose", "PopoverContent", "PopoverPortal", "PopoverTrigger"];
|
|
22
|
+
const PROGRESS_NAMES = ["Progress"];
|
|
23
|
+
const RADIO_GROUP_NAMES = ["RadioGroup", "RadioGroupItem"];
|
|
24
|
+
const SEGMENTED_NAMES = ["Segmented", "SegmentedItem"];
|
|
25
|
+
const SELECT_NAMES = ["Select", "SelectContent", "SelectGroup", "SelectItem", "SelectLabel", "SelectSeparator", "SelectTrigger", "SelectValue"];
|
|
26
|
+
const SKELETON_NAMES = ["Skeleton"];
|
|
27
|
+
const SLIDER_NAMES = ["Slider"];
|
|
28
|
+
const SPINNER_NAMES = ["Spinner"];
|
|
29
|
+
const SWITCH_NAMES = ["Switch"];
|
|
30
|
+
const TABLE_NAMES = ["Table", "TableBody", "TableCaption", "TableCell", "TableFooter", "TableHead", "TableHeader", "TableRow"];
|
|
31
|
+
const TABS_NAMES = ["Tabs", "TabsContent", "TabsList", "TabsTrigger"];
|
|
32
|
+
const TEXTAREA_NAMES = ["Textarea"];
|
|
33
|
+
const TOAST_NAMES = ["Toaster"];
|
|
34
|
+
const TOGGLE_NAMES = ["Toggle"];
|
|
35
|
+
const TOGGLE_GROUP_NAMES = ["ToggleGroup", "ToggleGroupItem"];
|
|
36
|
+
const TOOLTIP_NAMES = ["Tooltip", "TooltipArrow", "TooltipContent", "TooltipPortal", "TooltipProvider", "TooltipTrigger"];
|
|
37
|
+
const CHART_NAMES = [
|
|
38
|
+
"Chart",
|
|
39
|
+
"ChartArea",
|
|
40
|
+
"ChartBar",
|
|
41
|
+
"ChartLegend",
|
|
42
|
+
"ChartLegendContent",
|
|
43
|
+
"ChartLine",
|
|
44
|
+
"ChartPie",
|
|
45
|
+
"ChartStyle",
|
|
46
|
+
"ChartTooltip",
|
|
47
|
+
"ChartTooltipContent",
|
|
48
|
+
"ChartXAxis",
|
|
49
|
+
"ChartYAxis"
|
|
50
|
+
];
|
|
51
|
+
const RECHARTS_NAMES = [
|
|
52
|
+
"AreaChart",
|
|
53
|
+
"BarChart",
|
|
54
|
+
"CartesianGrid",
|
|
55
|
+
"Cell",
|
|
56
|
+
"LabelList",
|
|
57
|
+
"LineChart",
|
|
58
|
+
"Pie",
|
|
59
|
+
"PieChart"
|
|
60
|
+
];
|
|
61
|
+
const REACT_NAMES = [
|
|
62
|
+
...ACCORDION_NAMES,
|
|
63
|
+
...ALERT_NAMES,
|
|
64
|
+
...AVATAR_NAMES,
|
|
65
|
+
...BADGE_NAMES,
|
|
66
|
+
...BREADCRUMB_NAMES,
|
|
67
|
+
...BUTTON_NAMES,
|
|
68
|
+
...BUTTON_GROUP_NAMES,
|
|
69
|
+
...CARD_NAMES,
|
|
70
|
+
...CHECKBOX_NAMES,
|
|
71
|
+
...DIVIDER_NAMES,
|
|
72
|
+
...DRAWER_NAMES,
|
|
73
|
+
...DROPDOWN_NAMES,
|
|
74
|
+
...FIELD_NAMES,
|
|
75
|
+
...ICON_BUTTON_NAMES,
|
|
76
|
+
...INPUT_NAMES,
|
|
77
|
+
...METRIC_CARD_NAMES,
|
|
78
|
+
...MODAL_NAMES,
|
|
79
|
+
...ALERT_MODAL_NAMES,
|
|
80
|
+
...NAVIGATION_MENU_NAMES,
|
|
81
|
+
...PAGINATION_NAMES,
|
|
82
|
+
...POPOVER_NAMES,
|
|
83
|
+
...PROGRESS_NAMES,
|
|
84
|
+
...RADIO_GROUP_NAMES,
|
|
85
|
+
...SEGMENTED_NAMES,
|
|
86
|
+
...SELECT_NAMES,
|
|
87
|
+
...SKELETON_NAMES,
|
|
88
|
+
...SLIDER_NAMES,
|
|
89
|
+
...SPINNER_NAMES,
|
|
90
|
+
...SWITCH_NAMES,
|
|
91
|
+
...TABLE_NAMES,
|
|
92
|
+
...TABS_NAMES,
|
|
93
|
+
...TEXTAREA_NAMES,
|
|
94
|
+
...TOAST_NAMES,
|
|
95
|
+
...TOGGLE_NAMES,
|
|
96
|
+
...TOGGLE_GROUP_NAMES,
|
|
97
|
+
...TOOLTIP_NAMES
|
|
98
|
+
];
|
|
99
|
+
function extractUsedNames(jsxBody, namePool) {
|
|
100
|
+
return namePool.filter((n) => new RegExp(`<${n}[\\s/>]`).test(jsxBody));
|
|
101
|
+
}
|
|
102
|
+
function buildImport(names, pkg, opts = {}) {
|
|
103
|
+
if (names.length === 0) return "";
|
|
104
|
+
const { multiline = true } = opts;
|
|
105
|
+
if (multiline && names.length > 3) {
|
|
106
|
+
return `import {
|
|
107
|
+
${names.join(",\n ")},
|
|
108
|
+
} from '${pkg}'`;
|
|
109
|
+
}
|
|
110
|
+
return `import { ${names.join(", ")} } from '${pkg}'`;
|
|
111
|
+
}
|
|
112
|
+
function importUsed(jsxBody, namePool, pkg, opts = {}) {
|
|
113
|
+
return buildImport(extractUsedNames(jsxBody, namePool), pkg, opts);
|
|
114
|
+
}
|
|
115
|
+
export {
|
|
116
|
+
ACCORDION_NAMES,
|
|
117
|
+
ALERT_MODAL_NAMES,
|
|
118
|
+
ALERT_NAMES,
|
|
119
|
+
AVATAR_NAMES,
|
|
120
|
+
BADGE_NAMES,
|
|
121
|
+
BREADCRUMB_NAMES,
|
|
122
|
+
BUTTON_GROUP_NAMES,
|
|
123
|
+
BUTTON_NAMES,
|
|
124
|
+
CARD_NAMES,
|
|
125
|
+
CHART_NAMES,
|
|
126
|
+
CHECKBOX_NAMES,
|
|
127
|
+
DIVIDER_NAMES,
|
|
128
|
+
DRAWER_NAMES,
|
|
129
|
+
DROPDOWN_NAMES,
|
|
130
|
+
FIELD_NAMES,
|
|
131
|
+
ICON_BUTTON_NAMES,
|
|
132
|
+
INPUT_NAMES,
|
|
133
|
+
METRIC_CARD_NAMES,
|
|
134
|
+
MODAL_NAMES,
|
|
135
|
+
NAVIGATION_MENU_NAMES,
|
|
136
|
+
PAGINATION_NAMES,
|
|
137
|
+
POPOVER_NAMES,
|
|
138
|
+
PROGRESS_NAMES,
|
|
139
|
+
RADIO_GROUP_NAMES,
|
|
140
|
+
REACT_NAMES,
|
|
141
|
+
RECHARTS_NAMES,
|
|
142
|
+
SEGMENTED_NAMES,
|
|
143
|
+
SELECT_NAMES,
|
|
144
|
+
SKELETON_NAMES,
|
|
145
|
+
SLIDER_NAMES,
|
|
146
|
+
SPINNER_NAMES,
|
|
147
|
+
SWITCH_NAMES,
|
|
148
|
+
TABLE_NAMES,
|
|
149
|
+
TABS_NAMES,
|
|
150
|
+
TEXTAREA_NAMES,
|
|
151
|
+
TOAST_NAMES,
|
|
152
|
+
TOGGLE_GROUP_NAMES,
|
|
153
|
+
TOGGLE_NAMES,
|
|
154
|
+
TOOLTIP_NAMES,
|
|
155
|
+
buildImport,
|
|
156
|
+
extractUsedNames,
|
|
157
|
+
importUsed
|
|
158
|
+
};
|
|
159
|
+
//# sourceMappingURL=code-generator.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/code-generator.ts"],"sourcesContent":["// Derive `import { ... }` from JSX body so generated code structurally\n// mirrors actual rendered JSX. Prevents over-import and under-import bugs.\n//\n// Contract: extractUsedNames(jsxBody, pool) returns names from `pool` that\n// appear as JSX tags (`<Name>` / `<Name ` / `<Name/>`) in `jsxBody`. The\n// regex boundary `<${name}[\\s/>]` prevents prefix collision — `<Card>` does\n// not match `CardHeader`, and `<CardHeader>` does not match `Card`.\n\n// ---- Component name pools (source of truth: src/components/ui/index.ts) ----\n\nexport const ACCORDION_NAMES = ['Accordion', 'AccordionContent', 'AccordionItem', 'AccordionTrigger'] as const\nexport const ALERT_NAMES = ['Alert', 'AlertDescription', 'AlertTitle'] as const\nexport const AVATAR_NAMES = ['Avatar', 'AvatarFallback', 'AvatarGroup', 'AvatarImage'] as const\nexport const BADGE_NAMES = ['Badge'] as const\nexport const BREADCRUMB_NAMES = ['Breadcrumb', 'BreadcrumbEllipsis', 'BreadcrumbItem', 'BreadcrumbLink', 'BreadcrumbList', 'BreadcrumbPage', 'BreadcrumbSeparator'] as const\nexport const BUTTON_NAMES = ['Button'] as const\nexport const BUTTON_GROUP_NAMES = ['ButtonGroup'] as const\nexport const CARD_NAMES = ['Card', 'CardAction', 'CardContent', 'CardDescription', 'CardFooter', 'CardHeader', 'CardImage', 'CardTitle'] as const\nexport const CHECKBOX_NAMES = ['Checkbox'] as const\nexport const DIVIDER_NAMES = ['Divider'] as const\nexport const DRAWER_NAMES = ['Drawer', 'DrawerBody', 'DrawerClose', 'DrawerContent', 'DrawerDescription', 'DrawerFooter', 'DrawerHeader', 'DrawerOverlay', 'DrawerPortal', 'DrawerTitle', 'DrawerTrigger'] as const\nexport const DROPDOWN_NAMES = ['DropdownMenu', 'DropdownMenuCheckboxItem', 'DropdownMenuContent', 'DropdownMenuGroup', 'DropdownMenuItem', 'DropdownMenuLabel', 'DropdownMenuRadioGroup', 'DropdownMenuRadioItem', 'DropdownMenuSeparator', 'DropdownMenuShortcut', 'DropdownMenuSub', 'DropdownMenuSubContent', 'DropdownMenuSubTrigger', 'DropdownMenuTrigger'] as const\nexport const FIELD_NAMES = ['Field', 'FieldCharCount', 'FieldError', 'FieldLabel'] as const\nexport const ICON_BUTTON_NAMES = ['IconButton'] as const\nexport const INPUT_NAMES = ['Input'] as const\nexport const METRIC_CARD_NAMES = ['MetricCard', 'MetricCardDescription', 'MetricCardHeader', 'MetricCardSymbol', 'MetricCardTitle', 'MetricCardTrend', 'MetricCardValue'] as const\nexport const MODAL_NAMES = ['Modal', 'ModalBody', 'ModalClose', 'ModalContent', 'ModalDescription', 'ModalFooter', 'ModalHeader', 'ModalOverlay', 'ModalPortal', 'ModalTitle', 'ModalTrigger'] as const\nexport const ALERT_MODAL_NAMES = ['AlertModal', 'AlertModalAction', 'AlertModalBody', 'AlertModalCancel', 'AlertModalContent', 'AlertModalDescription', 'AlertModalFooter', 'AlertModalHeader', 'AlertModalOverlay', 'AlertModalPortal', 'AlertModalTitle', 'AlertModalTrigger'] as const\nexport const NAVIGATION_MENU_NAMES = ['NavigationMenu', 'NavigationMenuContent', 'NavigationMenuGroup', 'NavigationMenuIndicator', 'NavigationMenuItem', 'NavigationMenuLink', 'NavigationMenuList', 'NavigationMenuTrigger', 'NavigationMenuViewport'] as const\nexport const PAGINATION_NAMES = ['Pagination', 'PaginationContent', 'PaginationEllipsis', 'PaginationFirst', 'PaginationItem', 'PaginationItems', 'PaginationLast', 'PaginationLink', 'PaginationNext', 'PaginationPrevious'] as const\nexport const POPOVER_NAMES = ['Popover', 'PopoverAnchor', 'PopoverArrow', 'PopoverClose', 'PopoverContent', 'PopoverPortal', 'PopoverTrigger'] as const\nexport const PROGRESS_NAMES = ['Progress'] as const\nexport const RADIO_GROUP_NAMES = ['RadioGroup', 'RadioGroupItem'] as const\nexport const SEGMENTED_NAMES = ['Segmented', 'SegmentedItem'] as const\nexport const SELECT_NAMES = ['Select', 'SelectContent', 'SelectGroup', 'SelectItem', 'SelectLabel', 'SelectSeparator', 'SelectTrigger', 'SelectValue'] as const\nexport const SKELETON_NAMES = ['Skeleton'] as const\nexport const SLIDER_NAMES = ['Slider'] as const\nexport const SPINNER_NAMES = ['Spinner'] as const\nexport const SWITCH_NAMES = ['Switch'] as const\nexport const TABLE_NAMES = ['Table', 'TableBody', 'TableCaption', 'TableCell', 'TableFooter', 'TableHead', 'TableHeader', 'TableRow'] as const\nexport const TABS_NAMES = ['Tabs', 'TabsContent', 'TabsList', 'TabsTrigger'] as const\nexport const TEXTAREA_NAMES = ['Textarea'] as const\nexport const TOAST_NAMES = ['Toaster'] as const\nexport const TOGGLE_NAMES = ['Toggle'] as const\nexport const TOGGLE_GROUP_NAMES = ['ToggleGroup', 'ToggleGroupItem'] as const\nexport const TOOLTIP_NAMES = ['Tooltip', 'TooltipArrow', 'TooltipContent', 'TooltipPortal', 'TooltipProvider', 'TooltipTrigger'] as const\n\n// Chart exports from `@karakuri-ui/react/chart` subpath. Charts ship behind\n// an opt-in subpath because `recharts` is a heavy optional peer dep.\nexport const CHART_NAMES = [\n 'Chart',\n 'ChartArea',\n 'ChartBar',\n 'ChartLegend',\n 'ChartLegendContent',\n 'ChartLine',\n 'ChartPie',\n 'ChartStyle',\n 'ChartTooltip',\n 'ChartTooltipContent',\n 'ChartXAxis',\n 'ChartYAxis',\n] as const\n\n// Recharts primitives used inside chart demos (`recharts` peer dep).\nexport const RECHARTS_NAMES = [\n 'AreaChart',\n 'BarChart',\n 'CartesianGrid',\n 'Cell',\n 'LabelList',\n 'LineChart',\n 'Pie',\n 'PieChart',\n] as const\n\n// Flat pool of every `@karakuri-ui/react` JSX component. Used when a page\n// mixes several compounds + atoms (e.g. Card page also renders Button,\n// IconButton, DropdownMenu).\nexport const REACT_NAMES = [\n ...ACCORDION_NAMES,\n ...ALERT_NAMES,\n ...AVATAR_NAMES,\n ...BADGE_NAMES,\n ...BREADCRUMB_NAMES,\n ...BUTTON_NAMES,\n ...BUTTON_GROUP_NAMES,\n ...CARD_NAMES,\n ...CHECKBOX_NAMES,\n ...DIVIDER_NAMES,\n ...DRAWER_NAMES,\n ...DROPDOWN_NAMES,\n ...FIELD_NAMES,\n ...ICON_BUTTON_NAMES,\n ...INPUT_NAMES,\n ...METRIC_CARD_NAMES,\n ...MODAL_NAMES,\n ...ALERT_MODAL_NAMES,\n ...NAVIGATION_MENU_NAMES,\n ...PAGINATION_NAMES,\n ...POPOVER_NAMES,\n ...PROGRESS_NAMES,\n ...RADIO_GROUP_NAMES,\n ...SEGMENTED_NAMES,\n ...SELECT_NAMES,\n ...SKELETON_NAMES,\n ...SLIDER_NAMES,\n ...SPINNER_NAMES,\n ...SWITCH_NAMES,\n ...TABLE_NAMES,\n ...TABS_NAMES,\n ...TEXTAREA_NAMES,\n ...TOAST_NAMES,\n ...TOGGLE_NAMES,\n ...TOGGLE_GROUP_NAMES,\n ...TOOLTIP_NAMES,\n] as const\n\n// ---- Helpers ----\n\nexport function extractUsedNames(jsxBody: string, namePool: readonly string[]): string[] {\n // Prefix-collision-safe: char after name must be whitespace, `/`, or `>`\n return namePool.filter((n) => new RegExp(`<${n}[\\\\s/>]`).test(jsxBody))\n}\n\nexport interface BuildImportOptions {\n /** Break into multi-line `import { ... }` when >3 names (default: true). */\n multiline?: boolean\n}\n\nexport function buildImport(\n names: string[],\n pkg: string,\n opts: BuildImportOptions = {},\n): string {\n if (names.length === 0) return ''\n const { multiline = true } = opts\n if (multiline && names.length > 3) {\n return `import {\\n ${names.join(',\\n ')},\\n} from '${pkg}'`\n }\n return `import { ${names.join(', ')} } from '${pkg}'`\n}\n\n/**\n * Derive a single `import { ... } from pkg` from the JSX body.\n *\n * Usage — one per branch inside generateCode:\n * ```ts\n * const jsxBody = `<Card><CardHeader>...</CardHeader></Card>`\n * return `${importUsed(jsxBody, CARD_NAMES, pkg)}\\n\\n${jsxBody}`\n * ```\n *\n * **Never union pools across branches** — each branch's jsxBody must feed\n * its own import derivation to guarantee structural 1:1.\n */\nexport function importUsed(\n jsxBody: string,\n namePool: readonly string[],\n pkg: string,\n opts: BuildImportOptions = {},\n): string {\n return buildImport(extractUsedNames(jsxBody, namePool), pkg, opts)\n}\n"],"mappings":"AAUO,MAAM,kBAAkB,CAAC,aAAa,oBAAoB,iBAAiB,kBAAkB;AAC7F,MAAM,cAAc,CAAC,SAAS,oBAAoB,YAAY;AAC9D,MAAM,eAAe,CAAC,UAAU,kBAAkB,eAAe,aAAa;AAC9E,MAAM,cAAc,CAAC,OAAO;AAC5B,MAAM,mBAAmB,CAAC,cAAc,sBAAsB,kBAAkB,kBAAkB,kBAAkB,kBAAkB,qBAAqB;AAC3J,MAAM,eAAe,CAAC,QAAQ;AAC9B,MAAM,qBAAqB,CAAC,aAAa;AACzC,MAAM,aAAa,CAAC,QAAQ,cAAc,eAAe,mBAAmB,cAAc,cAAc,aAAa,WAAW;AAChI,MAAM,iBAAiB,CAAC,UAAU;AAClC,MAAM,gBAAgB,CAAC,SAAS;AAChC,MAAM,eAAe,CAAC,UAAU,cAAc,eAAe,iBAAiB,qBAAqB,gBAAgB,gBAAgB,iBAAiB,gBAAgB,eAAe,eAAe;AAClM,MAAM,iBAAiB,CAAC,gBAAgB,4BAA4B,uBAAuB,qBAAqB,oBAAoB,qBAAqB,0BAA0B,yBAAyB,yBAAyB,wBAAwB,mBAAmB,0BAA0B,0BAA0B,qBAAqB;AACzV,MAAM,cAAc,CAAC,SAAS,kBAAkB,cAAc,YAAY;AAC1E,MAAM,oBAAoB,CAAC,YAAY;AACvC,MAAM,cAAc,CAAC,OAAO;AAC5B,MAAM,oBAAoB,CAAC,cAAc,yBAAyB,oBAAoB,oBAAoB,mBAAmB,mBAAmB,iBAAiB;AACjK,MAAM,cAAc,CAAC,SAAS,aAAa,cAAc,gBAAgB,oBAAoB,eAAe,eAAe,gBAAgB,eAAe,cAAc,cAAc;AACtL,MAAM,oBAAoB,CAAC,cAAc,oBAAoB,kBAAkB,oBAAoB,qBAAqB,yBAAyB,oBAAoB,oBAA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
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
cn: () => cn
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(utils_exports);
|
|
24
|
+
var import_clsx = require("clsx");
|
|
25
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
26
|
+
function cn(...inputs) {
|
|
27
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
28
|
+
}
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
cn
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\n/**\n * Combines class names with Tailwind CSS class merging\n * @param inputs - Class values to combine\n * @returns Merged class string\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAsC;AACtC,4BAAwB;AAOjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\n/**\n * Combines class names with Tailwind CSS class merging\n * @param inputs - Class values to combine\n * @returns Merged class string\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":"AAAA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAOjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@karakuri-ui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css"
|
|
7
7
|
],
|
|
8
8
|
"description": "Enterprise React component library with design token system",
|
|
9
|
-
"main": "./dist/index.js",
|
|
10
|
-
"module": "./dist/index.mjs",
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
9
|
+
"main": "./dist/components/ui/index.js",
|
|
10
|
+
"module": "./dist/components/ui/index.mjs",
|
|
11
|
+
"types": "./dist/components/ui/index.d.ts",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
15
|
-
"import": "./dist/index.mjs",
|
|
16
|
-
"require": "./dist/index.js"
|
|
14
|
+
"types": "./dist/components/ui/index.d.ts",
|
|
15
|
+
"import": "./dist/components/ui/index.mjs",
|
|
16
|
+
"require": "./dist/components/ui/index.js"
|
|
17
17
|
},
|
|
18
18
|
"./chart": {
|
|
19
|
-
"types": "./dist/chart.d.ts",
|
|
20
|
-
"import": "./dist/chart.mjs",
|
|
21
|
-
"require": "./dist/chart.js"
|
|
19
|
+
"types": "./dist/components/ui/chart.d.ts",
|
|
20
|
+
"import": "./dist/components/ui/chart.mjs",
|
|
21
|
+
"require": "./dist/components/ui/chart.js"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"typesVersions": {
|
|
25
25
|
"*": {
|
|
26
|
-
"chart": ["./dist/chart.d.ts"]
|
|
26
|
+
"chart": ["./dist/components/ui/chart.d.ts"]
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"files": [
|