@nadicodeai/ui 1.0.2 → 1.1.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/AGENTS.md +13 -13
- package/README.md +1 -1
- package/dist/agents.d.ts +8 -8
- package/dist/components/accordion.js +1 -1
- package/dist/components/action-band.js +1 -1
- package/dist/components/agent-card.d.ts +1 -1
- package/dist/components/agent-visual.d.ts +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/automation-section.d.ts +2 -2
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +3 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/brand-icons/apple.d.ts +1 -1
- package/dist/components/brand-icons/linux.d.ts +1 -1
- package/dist/components/brand-icons/windows.d.ts +1 -1
- package/dist/components/brand-icons.d.ts +4 -4
- package/dist/components/button-group.d.ts +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.d.ts +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +2 -4
- package/dist/components/carousel.d.ts +1 -1
- package/dist/components/carousel.d.ts.map +1 -1
- package/dist/components/chart-breakdown-table.d.ts +2 -2
- package/dist/components/chart-bullet-bar.js +5 -5
- package/dist/components/chart-date-range-control.d.ts +1 -1
- package/dist/components/chart-kpi-stat.d.ts +1 -1
- package/dist/components/chart-time-series.d.ts +1 -1
- package/dist/components/chart-time-series.d.ts.map +1 -1
- package/dist/components/chart-time-series.js +10 -9
- package/dist/components/chart.d.ts.map +1 -1
- package/dist/components/chart.js +13 -3
- package/dist/components/checkbox.js +1 -1
- package/dist/components/combobox.js +2 -2
- package/dist/components/command.d.ts +1 -1
- package/dist/components/command.d.ts.map +1 -1
- package/dist/components/command.js +2 -2
- package/dist/components/context-menu.js +1 -1
- package/dist/components/dashboard-shell.d.ts +1 -1
- package/dist/components/disclosure-row.d.ts.map +1 -1
- package/dist/components/disclosure-row.js +1 -3
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/faq-item.d.ts +1 -1
- package/dist/components/faq-item.d.ts.map +1 -1
- package/dist/components/faq-item.js +2 -2
- package/dist/components/feedback-state.d.ts +1 -1
- package/dist/components/field.d.ts +1 -1
- package/dist/components/footer.d.ts.map +1 -1
- package/dist/components/footer.js +1 -1
- package/dist/components/form.d.ts +1 -1
- package/dist/components/glass-control.js +1 -1
- package/dist/components/hero.js +1 -1
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/input-group.js +3 -3
- package/dist/components/input-otp.d.ts.map +1 -1
- package/dist/components/input-otp.js +6 -3
- package/dist/components/input.js +1 -1
- package/dist/components/integration-flow.d.ts.map +1 -1
- package/dist/components/integration-flow.js +5 -5
- package/dist/components/item.d.ts +1 -1
- package/dist/components/item.js +1 -1
- package/dist/components/label-system.js +1 -1
- package/dist/components/live-demo.js +2 -2
- package/dist/components/menubar.d.ts +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/native-select.js +1 -1
- package/dist/components/nav-bar.d.ts.map +1 -1
- package/dist/components/nav-bar.js +1 -1
- package/dist/components/navigation-menu.d.ts.map +1 -1
- package/dist/components/navigation-menu.js +5 -5
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/plugin-slot-boundary.d.ts.map +1 -1
- package/dist/components/plugin-slot-boundary.js +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/resizable.d.ts.map +1 -1
- package/dist/components/resizable.js +4 -2
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/seam-grid.d.ts +1 -1
- package/dist/components/select.js +4 -4
- package/dist/components/settings-section.d.ts +1 -1
- package/dist/components/sidebar.d.ts +4 -4
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +6 -7
- package/dist/components/slider.js +1 -1
- package/dist/components/status-dot.js +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/textarea.js +1 -1
- package/dist/components/texture-strip.d.ts.map +1 -1
- package/dist/components/texture-strip.js +3 -0
- package/dist/components/theme-mode-switcher.d.ts +2 -2
- package/dist/components/toggle-group.d.ts +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/eslint/index.js +23 -17
- package/dist/eslint/rules/confirm-destructive-action.js +177 -0
- package/dist/eslint/rules/jsx-class-utility.js +162 -176
- package/dist/eslint/rules/no-app-feature-component.js +100 -0
- package/dist/eslint/rules/no-deprecated-zod-api.js +63 -15
- package/dist/eslint/rules/no-elevated-edge.js +144 -0
- package/dist/eslint/rules/no-mono-title-register.js +73 -0
- package/dist/eslint/rules/no-native-visible-control.js +6 -3
- package/dist/eslint/rules/no-package-component-redefinition.js +175 -0
- package/dist/eslint/rules/no-paired-size-utility.js +66 -0
- package/dist/eslint/rules/no-repainted-focus.js +80 -0
- package/dist/eslint/rules/no-resting-settings-control.js +87 -0
- package/dist/eslint/rules/no-shadcn-appearance-override.js +30 -56
- package/dist/eslint/rules/no-unpinned-vercel-functions-import.js +25 -23
- package/dist/eslint/rules/server-action-discipline.js +182 -0
- package/dist/eslint/rules/shadcn-composition.js +131 -0
- package/dist/hooks/index.d.ts +3 -3
- package/dist/index.d.ts +132 -132
- package/dist/internal/agent-visual/poster.d.ts +1 -1
- package/dist/internal/agent-visual/renderer.d.ts +1 -1
- package/dist/internal/assistant-ui/attachment.js +1 -1
- package/dist/internal/assistant-ui/follow-up-suggestions.d.ts.map +1 -1
- package/dist/internal/assistant-ui/follow-up-suggestions.js +5 -1
- package/dist/internal/assistant-ui/reasoning.d.ts +1 -1
- package/dist/internal/assistant-ui/tool-fallback.d.ts +1 -1
- package/dist/internal/assistant-ui/tool-group.d.ts +1 -1
- package/dist/internal/assistant-ui/tooltip-icon-button.d.ts +1 -1
- package/dist/styles/globals.css +37 -12
- package/docs/consuming-cross-repo.md +2 -2
- package/docs/contract.md +30 -20
- package/docs/migration/base-ui-migration.md +2 -2
- package/package.json +7 -6
- package/dist/eslint/rules/no-design-system-src-import.js +0 -11
- package/dist/eslint/rules/no-raw-color-utility.js +0 -109
- package/dist/eslint/rules/no-raw-focus-ring-width.js +0 -30
- package/dist/eslint/rules/no-raw-logo-import.js +0 -41
- package/dist/eslint/rules/no-ui-src-import.js +0 -10
- package/dist/eslint/rules/src-import-boundary.js +0 -207
|
@@ -12,10 +12,10 @@ function SelectValue({ className, ...props }) {
|
|
|
12
12
|
return (_jsx(SelectPrimitive.Value, { "data-slot": "select-value", className: cn("flex flex-1 text-left", className), ...props }));
|
|
13
13
|
}
|
|
14
14
|
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
15
|
-
return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("flex h-control-height min-h-touch-target w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-background py-2 pr-2 pl-control-padding-inline text-sm whitespace-nowrap transition-colors
|
|
15
|
+
return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("flex h-control-height min-h-touch-target w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-background py-2 pr-2 pl-control-padding-inline text-sm whitespace-nowrap transition-colors select-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive data-placeholder:text-placeholder data-[size=sm]:h-7 [@media(hover:hover)_and_(pointer:fine)]:min-h-0 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { render: _jsx(ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" }) })] }));
|
|
16
16
|
}
|
|
17
17
|
function SelectContent({ className, children, side = "bottom", sideOffset = 4, align = "center", alignOffset = 0, alignItemWithTrigger = true, ...props }) {
|
|
18
|
-
return (_jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, alignItemWithTrigger: alignItemWithTrigger, className: "isolate z-50", children: _jsxs(SelectPrimitive.Popup, { "data-slot": "select-content", "data-align-trigger": alignItemWithTrigger, className: cn("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 overflow-x-hidden overflow-y-auto rounded-2xl border-0
|
|
18
|
+
return (_jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, alignItemWithTrigger: alignItemWithTrigger, className: "isolate z-50", children: _jsxs(SelectPrimitive.Popup, { "data-slot": "select-content", "data-align-trigger": alignItemWithTrigger, className: cn("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 overflow-x-hidden overflow-y-auto rounded-2xl border-0 nc-glass text-popover-foreground smooth-shadow-ring-xl data-[align-trigger=true]:transition-none", anchoredOverlayMotion, className), ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.List, { children: children }), _jsx(SelectScrollDownButton, {})] }) }) }));
|
|
19
19
|
}
|
|
20
20
|
function SelectLabel({ className, ...props }) {
|
|
21
21
|
return (_jsx(SelectPrimitive.GroupLabel, { "data-slot": "select-label", className: cn("px-1.5 py-1 text-xs text-muted-foreground", className), ...props }));
|
|
@@ -27,9 +27,9 @@ function SelectSeparator({ className, ...props }) {
|
|
|
27
27
|
return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className), ...props }));
|
|
28
28
|
}
|
|
29
29
|
function SelectScrollUpButton({ className, ...props }) {
|
|
30
|
-
return (_jsx(SelectPrimitive.ScrollUpArrow, { "data-slot": "select-scroll-up-button", className: cn("top-0 z-10 flex w-full cursor-default items-center justify-center
|
|
30
|
+
return (_jsx(SelectPrimitive.ScrollUpArrow, { "data-slot": "select-scroll-up-button", className: cn("top-0 z-10 flex w-full cursor-default items-center justify-center nc-glass py-1 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: _jsx(ChevronUpIcon, {}) }));
|
|
31
31
|
}
|
|
32
32
|
function SelectScrollDownButton({ className, ...props }) {
|
|
33
|
-
return (_jsx(SelectPrimitive.ScrollDownArrow, { "data-slot": "select-scroll-down-button", className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center
|
|
33
|
+
return (_jsx(SelectPrimitive.ScrollDownArrow, { "data-slot": "select-scroll-down-button", className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center nc-glass py-1 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: _jsx(ChevronDownIcon, {}) }));
|
|
34
34
|
}
|
|
35
35
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
3
|
import { type VariantProps } from "class-variance-authority";
|
|
4
|
-
import { Button } from "./button";
|
|
5
|
-
import { Input } from "./input";
|
|
6
|
-
import { Separator } from "./separator";
|
|
7
|
-
import { TooltipContent } from "./tooltip";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { Input } from "./input.js";
|
|
6
|
+
import { Separator } from "./separator.js";
|
|
7
|
+
import { TooltipContent } from "./tooltip.js";
|
|
8
8
|
type SidebarContextProps = {
|
|
9
9
|
state: "expanded" | "collapsed";
|
|
10
10
|
open: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/components/sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,OAAO,EAAE,MAAM,EAAE,MAAM,qB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M,EACN,IAAW,EACX,QAAgB,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,GAC9B,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,0EAoBF;AAED,OAAO,EACL,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,CAAC"}
|
|
@@ -108,8 +108,7 @@ function SidebarRail({ className, "aria-label": ariaLabel = "Toggle Sidebar", ti
|
|
|
108
108
|
return (_jsx("button", { "data-sidebar": "rail", "data-slot": "sidebar-rail", "aria-label": ariaLabel, title: title ?? ariaLabel, tabIndex: -1, onClick: toggleSidebar, className: cn("absolute inset-y-0 z-20 hidden w-11 group-data-[side=left]:-right-11 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-0.5 hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2 [@media(hover:hover)_and_(pointer:fine)]:w-4 [@media(hover:hover)_and_(pointer:fine)]:group-data-[side=left]:-right-4", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className), ...props }));
|
|
109
109
|
}
|
|
110
110
|
function SidebarInset({ className, focusTarget = false, ...props }) {
|
|
111
|
-
return (_jsx("main", { "data-slot": "sidebar-inset", className: cn("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-md md:peer-data-[variant=inset]:border md:peer-data-[variant=inset]:border-border md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", focusTarget &&
|
|
112
|
-
"focus-visible:outline-none focus-visible:ring-[length:var(--ring-width-focus)] focus-visible:ring-inset focus-visible:ring-ring", className), ...props }));
|
|
111
|
+
return (_jsx("main", { "data-slot": "sidebar-inset", className: cn("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-md md:peer-data-[variant=inset]:border md:peer-data-[variant=inset]:border-border md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", focusTarget && "focus-visible:-outline-offset-[var(--outline-offset-focus)]", className), ...props }));
|
|
113
112
|
}
|
|
114
113
|
function SidebarInput({ className, ...props }) {
|
|
115
114
|
return (_jsx(Input, { "data-slot": "sidebar-input", "data-sidebar": "input", className: cn("h-control-height w-full bg-background shadow-none", className), ...props }));
|
|
@@ -133,7 +132,7 @@ function SidebarGroupLabel({ className, render, ...props }) {
|
|
|
133
132
|
return useRender({
|
|
134
133
|
defaultTagName: "div",
|
|
135
134
|
props: mergeProps({
|
|
136
|
-
className: cn("flex h-control-height shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70
|
|
135
|
+
className: cn("flex h-control-height shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 [&>svg]:size-4 [&>svg]:shrink-0", className),
|
|
137
136
|
}, props),
|
|
138
137
|
render,
|
|
139
138
|
state: {
|
|
@@ -146,7 +145,7 @@ function SidebarGroupAction({ className, render, ...props }) {
|
|
|
146
145
|
return useRender({
|
|
147
146
|
defaultTagName: "button",
|
|
148
147
|
props: mergeProps({
|
|
149
|
-
className: cn("absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground
|
|
148
|
+
className: cn("absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground group-data-[collapsible=icon]:hidden after:absolute after:top-1/2 after:left-1/2 after:size-touch-target after:-translate-x-1/2 after:-translate-y-1/2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [@media(hover:hover)_and_(pointer:fine)]:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", className),
|
|
150
149
|
}, props),
|
|
151
150
|
render,
|
|
152
151
|
state: {
|
|
@@ -164,7 +163,7 @@ function SidebarMenu({ className, ...props }) {
|
|
|
164
163
|
function SidebarMenuItem({ className, ...props }) {
|
|
165
164
|
return (_jsx("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn("group/menu-item relative", className), ...props }));
|
|
166
165
|
}
|
|
167
|
-
const sidebarMenuButtonVariants = cva("nc-transition-paint peer/menu-button group/menu-button flex min-h-touch-target min-w-touch-target w-full items-center gap-2 overflow-hidden rounded-md border border-transparent p-2 text-left text-sm
|
|
166
|
+
const sidebarMenuButtonVariants = cva("nc-transition-paint peer/menu-button group/menu-button flex min-h-touch-target min-w-touch-target w-full items-center gap-2 overflow-hidden rounded-md border border-transparent p-2 text-left text-sm group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-control-height! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-primary data-active:font-medium data-active:text-sidebar-primary-foreground data-active:hover:bg-sidebar-primary-hover data-active:hover:text-sidebar-primary-foreground [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [@media(hover:hover)_and_(pointer:fine)]:min-w-0 [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate", {
|
|
168
167
|
variants: {
|
|
169
168
|
variant: {
|
|
170
169
|
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
@@ -210,7 +209,7 @@ function SidebarMenuAction({ className, render, showOnHover = false, ...props })
|
|
|
210
209
|
return useRender({
|
|
211
210
|
defaultTagName: "button",
|
|
212
211
|
props: mergeProps({
|
|
213
|
-
className: cn("absolute top-3 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground
|
|
212
|
+
className: cn("absolute top-3 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-primary-foreground after:absolute after:top-1/2 after:left-1/2 after:size-touch-target after:-translate-x-1/2 after:-translate-y-1/2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [@media(hover:hover)_and_(pointer:fine)]:peer-data-[size=default]/menu-button:top-1.5 [@media(hover:hover)_and_(pointer:fine)]:peer-data-[size=lg]/menu-button:top-2.5 [@media(hover:hover)_and_(pointer:fine)]:peer-data-[size=sm]/menu-button:top-1 [@media(hover:hover)_and_(pointer:fine)]:after:hidden [&_svg]:size-4 [&_svg]:shrink-0", showOnHover &&
|
|
214
213
|
"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0", className),
|
|
215
214
|
}, props),
|
|
216
215
|
render,
|
|
@@ -242,7 +241,7 @@ function SidebarMenuSubButton({ render, size = "md", isActive = false, className
|
|
|
242
241
|
return useRender({
|
|
243
242
|
defaultTagName: "a",
|
|
244
243
|
props: mergeProps({
|
|
245
|
-
className: cn("flex h-7 min-h-touch-target min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md border border-transparent px-2 text-sidebar-foreground
|
|
244
|
+
className: cn("flex h-7 min-h-touch-target min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md border border-transparent px-2 text-sidebar-foreground transition-colors group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-primary data-active:text-sidebar-primary-foreground data-active:hover:bg-sidebar-primary-hover data-active:hover:text-sidebar-primary-foreground [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", className),
|
|
246
245
|
}, props),
|
|
247
246
|
render,
|
|
248
247
|
state: {
|
|
@@ -7,6 +7,6 @@ function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }
|
|
|
7
7
|
: Array.isArray(defaultValue)
|
|
8
8
|
? defaultValue
|
|
9
9
|
: [min, max];
|
|
10
|
-
return (_jsx(SliderPrimitive.Root, { className: cn("data-horizontal:w-full data-vertical:h-full", className), "data-slot": "slider", defaultValue: defaultValue, value: value, min: min, max: max, thumbAlignment: "edge", ...props, children: _jsxs(SliderPrimitive.Control, { className: "relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col", children: [_jsx(SliderPrimitive.Track, { "data-slot": "slider-track", className: "relative grow overflow-hidden rounded-full bg-muted select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1", children: _jsx(SliderPrimitive.Indicator, { "data-slot": "slider-range", className: "bg-primary select-none data-horizontal:h-full data-vertical:w-full" }) }), Array.from({ length: _values.length }, (_, index) => (_jsx(SliderPrimitive.Thumb, { "data-slot": "slider-thumb", className: "relative block size-3 shrink-0 rounded-full border border-input bg-background
|
|
10
|
+
return (_jsx(SliderPrimitive.Root, { className: cn("data-horizontal:w-full data-vertical:h-full", className), "data-slot": "slider", defaultValue: defaultValue, value: value, min: min, max: max, thumbAlignment: "edge", ...props, children: _jsxs(SliderPrimitive.Control, { className: "relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col", children: [_jsx(SliderPrimitive.Track, { "data-slot": "slider-track", className: "relative grow overflow-hidden rounded-full bg-muted select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1", children: _jsx(SliderPrimitive.Indicator, { "data-slot": "slider-range", className: "bg-primary select-none data-horizontal:h-full data-vertical:w-full" }) }), Array.from({ length: _values.length }, (_, index) => (_jsx(SliderPrimitive.Thumb, { "data-slot": "slider-thumb", className: "relative block size-3 shrink-0 rounded-full border border-input bg-background transition-colors select-none after:absolute after:top-1/2 after:left-1/2 after:size-touch-target after:-translate-x-1/2 after:-translate-y-1/2 hover:outline hover:outline-[length:var(--outline-width-focus)] hover:outline-offset-[var(--outline-offset-focus)] active:outline active:outline-[length:var(--outline-width-focus)] active:outline-offset-[var(--outline-offset-focus)] disabled:pointer-events-none disabled:opacity-50 [@media(hover:hover)_and_(pointer:fine)]:after:hidden" }, index)))] }) }));
|
|
11
11
|
}
|
|
12
12
|
export { Slider };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
|
-
const
|
|
3
|
+
const TONE_BG_CLASS = {
|
|
4
4
|
good: "bg-success",
|
|
5
5
|
muted: "bg-[var(--nc-muted)]",
|
|
6
6
|
warn: "bg-warning",
|
|
7
7
|
bad: "bg-destructive",
|
|
8
8
|
};
|
|
9
9
|
function StatusDot({ className, tone, ...props }) {
|
|
10
|
-
return (_jsx("span", { "aria-hidden": "true", className: cn("inline-block size-1.5 rounded-full",
|
|
10
|
+
return (_jsx("span", { "aria-hidden": "true", className: cn("inline-block size-1.5 rounded-full", TONE_BG_CLASS[tone], className), "data-slot": "status-dot", "data-tone": tone, ...props }));
|
|
11
11
|
}
|
|
12
12
|
export { StatusDot };
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
function Switch({ className, size = "default", ...props }) {
|
|
5
|
-
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn("nc-transition-paint peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent
|
|
5
|
+
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn("nc-transition-paint peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent after:absolute after:top-1/2 after:left-1/2 after:size-touch-target after:-translate-x-1/2 after:-translate-y-1/2 aria-invalid:border-destructive data-[size=default]:h-[18.4px] data-[size=default]:w-control-height data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-50 [@media(hover:hover)_and_(pointer:fine)]:after:hidden", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: "nc-transition-transform pointer-events-none block rounded-full bg-background ring-0 group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0" }) }));
|
|
6
6
|
}
|
|
7
7
|
export { Switch };
|
package/dist/components/tabs.js
CHANGED
|
@@ -20,7 +20,7 @@ function TabsList({ className, variant = "default", ...props }) {
|
|
|
20
20
|
return (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", "data-variant": variant, className: cn(tabsListVariants({ variant }), className), ...props }));
|
|
21
21
|
}
|
|
22
22
|
function TabsTrigger({ className, ...props }) {
|
|
23
|
-
return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", className: cn("nc-transition-paint relative inline-flex h-[calc(100%-1px)] min-h-touch-target min-w-touch-target flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground
|
|
23
|
+
return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", className: cn("nc-transition-paint relative inline-flex h-[calc(100%-1px)] min-h-touch-target min-w-touch-target flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-[variant=default]/tabs-list:data-active:shadow-none group-data-[variant=line]/tabs-list:data-active:shadow-none [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [@media(hover:hover)_and_(pointer:fine)]:min-w-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent", "data-active:bg-background data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity after:duration-[var(--nc-duration-confirm)] after:ease-[var(--nc-ease-out-strong)] group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100 motion-reduce:after:transition-none", className), ...props }));
|
|
24
24
|
}
|
|
25
25
|
function TabsContent({ className, ...props }) {
|
|
26
26
|
return (_jsx(TabsPrimitive.Panel, { "data-slot": "tabs-content", className: cn("flex-1 text-sm outline-none", className), ...props }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
function Textarea({ className, ...props }) {
|
|
4
|
-
return (_jsx("textarea", { "data-slot": "textarea", className: cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-background px-control-padding-inline py-2 text-base transition-colors
|
|
4
|
+
return (_jsx("textarea", { "data-slot": "textarea", className: cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-background px-control-padding-inline py-2 text-base transition-colors placeholder:text-placeholder disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive md:text-sm", className), ...props }));
|
|
5
5
|
}
|
|
6
6
|
export { Textarea };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"texture-strip.d.ts","sourceRoot":"","sources":["../../src/components/texture-strip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;;;;GAYG;AAEH,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAazE;AAED;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAW9E;
|
|
1
|
+
{"version":3,"file":"texture-strip.d.ts","sourceRoot":"","sources":["../../src/components/texture-strip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;;;;GAYG;AAEH,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAazE;AAED;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAW9E;AAKD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -26,4 +26,7 @@ function TextureStrip({ className, ...props }) {
|
|
|
26
26
|
function TextureStripChip({ className, ...props }) {
|
|
27
27
|
return (_jsx("span", { "data-slot": "texture-strip-chip", className: cn("nc-type-caption-mono rounded-full border border-border bg-background px-3 py-1 text-muted-foreground uppercase", className), ...props }));
|
|
28
28
|
}
|
|
29
|
+
// The deprecated export is named here because this is where it is DEFINED —
|
|
30
|
+
// re-exporting it is what keeps the 0.10 public API alive.
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- the export of the deprecated symbol itself
|
|
29
32
|
export { TextureStrip, TextureStripChip };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { RadioGroup } from "./radio-group";
|
|
3
|
-
import { isThemeMode, themeModes, type ThemeMode } from "../lib/theme-mode";
|
|
2
|
+
import { RadioGroup } from "./radio-group.js";
|
|
3
|
+
import { isThemeMode, themeModes, type ThemeMode } from "../lib/theme-mode.js";
|
|
4
4
|
export { isThemeMode, themeModes };
|
|
5
5
|
export type { ThemeMode };
|
|
6
6
|
export type ThemeModeOptionLabels = Record<ThemeMode, string>;
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
3
3
|
import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group";
|
|
4
4
|
import { type VariantProps } from "class-variance-authority";
|
|
5
|
-
import { toggleVariants } from "./toggle";
|
|
5
|
+
import { toggleVariants } from "./toggle.js";
|
|
6
6
|
declare function ToggleGroup({ className, variant, size, spacing, orientation, style, children, ...props }: ToggleGroupPrimitive.Props & VariantProps<typeof toggleVariants> & {
|
|
7
7
|
spacing?: number;
|
|
8
8
|
orientation?: "horizontal" | "vertical";
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
|
-
const toggleVariants = cva("group/toggle inline-flex min-h-touch-target min-w-touch-target items-center justify-center gap-1 rounded-md border border-transparent text-sm font-medium whitespace-nowrap transition-[background-color,border-color,color,opacity] duration-[var(--nc-duration-confirm)] ease-[var(--nc-ease-out-strong)] motion-reduce:transition-none
|
|
6
|
+
const toggleVariants = cva("group/toggle inline-flex min-h-touch-target min-w-touch-target items-center justify-center gap-1 rounded-md border border-transparent text-sm font-medium whitespace-nowrap transition-[background-color,border-color,color,opacity] duration-[var(--nc-duration-confirm)] ease-[var(--nc-ease-out-strong)] motion-reduce:transition-none hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-pressed:bg-muted data-pressed:bg-muted [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [@media(hover:hover)_and_(pointer:fine)]:min-w-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
9
|
default: "bg-transparent",
|
package/dist/eslint/index.js
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { confirmDestructiveAction } from "./rules/confirm-destructive-action.js";
|
|
4
|
+
import { noAppFeatureComponent } from "./rules/no-app-feature-component.js";
|
|
5
|
+
import { noElevatedEdge } from "./rules/no-elevated-edge.js";
|
|
4
6
|
import { noDeprecatedZodApi } from "./rules/no-deprecated-zod-api.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
+
import { noMonoTitleRegister } from "./rules/no-mono-title-register.js";
|
|
8
|
+
import { noPackageComponentRedefinition } from "./rules/no-package-component-redefinition.js";
|
|
9
|
+
import { noPairedSizeUtility } from "./rules/no-paired-size-utility.js";
|
|
10
|
+
import { noRestingSettingsControl } from "./rules/no-resting-settings-control.js";
|
|
7
11
|
import { noShadcnAppearanceOverride } from "./rules/no-shadcn-appearance-override.js";
|
|
8
12
|
import { noUnpinnedVercelFunctionsImport } from "./rules/no-unpinned-vercel-functions-import.js";
|
|
9
|
-
import { noUiSrcImport } from "./rules/no-ui-src-import.js";
|
|
10
13
|
import { noNativeVisibleControl } from "./rules/no-native-visible-control.js";
|
|
11
|
-
import {
|
|
14
|
+
import { noRepaintedFocus } from "./rules/no-repainted-focus.js";
|
|
12
15
|
import { noInvalidTokenUtility } from "./rules/no-invalid-token-utility.js";
|
|
13
16
|
import { noTokenCategoryBypass } from "./rules/no-token-category-bypass.js";
|
|
17
|
+
import { serverActionDiscipline } from "./rules/server-action-discipline.js";
|
|
18
|
+
import { shadcnComposition } from "./rules/shadcn-composition.js";
|
|
14
19
|
|
|
15
20
|
/**
|
|
16
21
|
* The plugin carries no version of its own. Its bytes are published inside
|
|
17
22
|
* `@nadicodeai/ui`, whose version the release gate already forces to move in
|
|
18
23
|
* lockstep, so that manifest is the one home of the number and this reads it.
|
|
19
24
|
* The published copy of this file sits at `<ui>/dist/eslint/index.js` and the
|
|
20
|
-
* source sits at `
|
|
25
|
+
* source sits at `packages/eslint-plugin/index.js`, which puts the
|
|
21
26
|
* manifest at one of two places relative to here; the `name` field says which
|
|
22
27
|
* candidate is the right one, so the repository root's own manifest — also two
|
|
23
28
|
* levels up — cannot answer by accident.
|
|
24
29
|
*/
|
|
25
30
|
const PUBLISHING_PACKAGE = "@nadicodeai/ui";
|
|
26
|
-
const MANIFEST_CANDIDATES = ["../../package.json",
|
|
31
|
+
const MANIFEST_CANDIDATES = ["../../package.json", "../ui/package.json"];
|
|
27
32
|
|
|
28
33
|
const version = readPublishedVersion();
|
|
29
34
|
|
|
@@ -45,15 +50,11 @@ function readPublishedVersion() {
|
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
export const strictDesignSystemRules = {
|
|
48
|
-
"nadicodeai/no-design-system-src-import": "error",
|
|
49
53
|
"nadicodeai/no-invalid-token-utility": "error",
|
|
50
54
|
"nadicodeai/no-native-visible-control": "error",
|
|
51
|
-
"nadicodeai/no-
|
|
52
|
-
"nadicodeai/no-raw-focus-ring-width": "error",
|
|
53
|
-
"nadicodeai/no-raw-logo-import": "error",
|
|
55
|
+
"nadicodeai/no-repainted-focus": "error",
|
|
54
56
|
"nadicodeai/no-shadcn-appearance-override": "error",
|
|
55
57
|
"nadicodeai/no-token-category-bypass": "error",
|
|
56
|
-
"nadicodeai/no-ui-src-import": "error",
|
|
57
58
|
};
|
|
58
59
|
|
|
59
60
|
/** @type {import('eslint').ESLint.Plugin} */
|
|
@@ -64,17 +65,22 @@ const plugin = {
|
|
|
64
65
|
},
|
|
65
66
|
configs: {},
|
|
66
67
|
rules: {
|
|
68
|
+
"confirm-destructive-action": confirmDestructiveAction,
|
|
69
|
+
"no-app-feature-component": noAppFeatureComponent,
|
|
70
|
+
"no-elevated-edge": noElevatedEdge,
|
|
67
71
|
"no-deprecated-zod-api": noDeprecatedZodApi,
|
|
68
|
-
"no-
|
|
69
|
-
"no-
|
|
72
|
+
"no-mono-title-register": noMonoTitleRegister,
|
|
73
|
+
"no-package-component-redefinition": noPackageComponentRedefinition,
|
|
74
|
+
"no-paired-size-utility": noPairedSizeUtility,
|
|
75
|
+
"no-resting-settings-control": noRestingSettingsControl,
|
|
70
76
|
"no-shadcn-appearance-override": noShadcnAppearanceOverride,
|
|
71
77
|
"no-native-visible-control": noNativeVisibleControl,
|
|
72
|
-
"no-
|
|
78
|
+
"no-repainted-focus": noRepaintedFocus,
|
|
73
79
|
"no-unpinned-vercel-functions-import": noUnpinnedVercelFunctionsImport,
|
|
74
|
-
"no-ui-src-import": noUiSrcImport,
|
|
75
|
-
"no-design-system-src-import": noDesignSystemSrcImport,
|
|
76
80
|
"no-invalid-token-utility": noInvalidTokenUtility,
|
|
77
81
|
"no-token-category-bypass": noTokenCategoryBypass,
|
|
82
|
+
"server-action-discipline": serverActionDiscipline,
|
|
83
|
+
"shadcn-composition": shadcnComposition,
|
|
78
84
|
},
|
|
79
85
|
};
|
|
80
86
|
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A destructive Server Action never fires on a bare form or submit button.
|
|
3
|
+
*
|
|
4
|
+
* Two shapes are destructive, and both are read off the JSX itself rather than
|
|
5
|
+
* out of a registry:
|
|
6
|
+
*
|
|
7
|
+
* - the bound symbol follows the Portal's destructive-action naming convention
|
|
8
|
+
* (`archiveThingAction`, `removeMemberAction`, `revokeInstallationAction`);
|
|
9
|
+
* - the form submits a lifecycle change to `archived`, which is how an archive
|
|
10
|
+
* is written through an otherwise ordinary update action — the hidden field
|
|
11
|
+
* is the destructive part, not the symbol's name.
|
|
12
|
+
*
|
|
13
|
+
* The approved carriers are `ConfirmedActionForm` and a destructive
|
|
14
|
+
* `ActionDialogForm`. A component that receives a destructive action as a prop
|
|
15
|
+
* binds it under that prop's name, so the convention holds at the site where
|
|
16
|
+
* the binding is actually written and this rule sees it there.
|
|
17
|
+
*
|
|
18
|
+
* Standard tool checked (ADR 0057 tier 2): `no-restricted-syntax` judges one
|
|
19
|
+
* node at a time, and the archive shape is a relationship between two — an
|
|
20
|
+
* ordinary `action={updateCustomerAction}` binding on the form, and the
|
|
21
|
+
* `lifecycle_status="archived"` field somewhere below it, which is what makes
|
|
22
|
+
* that ordinary binding destructive. A selector can match either node alone;
|
|
23
|
+
* neither alone is a violation. Customer archival in
|
|
24
|
+
* `apps/portal/src/components/customers/customer-settings-tab.tsx` is exactly that
|
|
25
|
+
* shape, so the relationship has to be read, and that is what this rule does.
|
|
26
|
+
*
|
|
27
|
+
* Replaces the vitest guard that joined a hand-kept `CONFIRM_REQUIRED_ACTIONS`
|
|
28
|
+
* ledger of file paths and symbols against a TypeScript AST walk (#821, #822).
|
|
29
|
+
* What the ledger held that a derivation cannot — an action that destroys
|
|
30
|
+
* nothing yet still deserves a confirmation, such as starting an impersonation,
|
|
31
|
+
* and the `confirm*` callbacks behind `ConfirmDialog` — is judgment, and ADR
|
|
32
|
+
* 0057 puts judgment in review rather than in machinery.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
const DESTRUCTIVE_ACTION_NAME =
|
|
36
|
+
/^(?:archive|cancel|decline|remove|revoke|suspend|unassign)[A-Z][A-Za-z]*Action$/;
|
|
37
|
+
const BINDING_ATTRIBUTES = new Set(["action", "formAction"]);
|
|
38
|
+
const LIFECYCLE_FIELD = "lifecycle_status";
|
|
39
|
+
const ARCHIVED = "archived";
|
|
40
|
+
|
|
41
|
+
function elementName(openingElement) {
|
|
42
|
+
return openingElement?.name?.type === "JSXIdentifier" ? openingElement.name.name : undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function openingElementOf(node) {
|
|
46
|
+
if (node.type === "JSXElement") return node.openingElement;
|
|
47
|
+
return node.type === "JSXOpeningElement" ? node : undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function attributeValue(openingElement, name) {
|
|
51
|
+
for (const attribute of openingElement.attributes) {
|
|
52
|
+
if (attribute.type !== "JSXAttribute" || attribute.name.name !== name) continue;
|
|
53
|
+
const value = attribute.value;
|
|
54
|
+
if (value === null) return true;
|
|
55
|
+
if (value.type === "Literal") return value.value;
|
|
56
|
+
if (value.type === "JSXExpressionContainer" && value.expression.type === "Literal") {
|
|
57
|
+
return value.expression.value;
|
|
58
|
+
}
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Every identifier named anywhere inside a subtree. */
|
|
65
|
+
function identifiers(node, found = []) {
|
|
66
|
+
if (!node || typeof node.type !== "string") return found;
|
|
67
|
+
if (node.type === "Identifier") {
|
|
68
|
+
found.push(node.name);
|
|
69
|
+
return found;
|
|
70
|
+
}
|
|
71
|
+
for (const [key, value] of Object.entries(node)) {
|
|
72
|
+
if (key === "parent") continue;
|
|
73
|
+
if (Array.isArray(value)) {
|
|
74
|
+
for (const child of value) identifiers(child, found);
|
|
75
|
+
} else if (value && typeof value === "object") {
|
|
76
|
+
identifiers(value, found);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return found;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
* The children a JSX subtree renders. A field is as often written inside a
|
|
84
|
+
* `{condition && <input …/>}` or a ternary as it is written bare, so the walk
|
|
85
|
+
* steps through the expression container and the two operators that carry JSX
|
|
86
|
+
* inside it. Nothing is evaluated: both branches of a `&&` or a `?:` count as
|
|
87
|
+
* rendered, because either one may be.
|
|
88
|
+
*/
|
|
89
|
+
function renderedChildren(node) {
|
|
90
|
+
switch (node.type) {
|
|
91
|
+
case "JSXElement":
|
|
92
|
+
case "JSXFragment":
|
|
93
|
+
return node.children;
|
|
94
|
+
case "JSXExpressionContainer":
|
|
95
|
+
return [node.expression];
|
|
96
|
+
case "LogicalExpression":
|
|
97
|
+
return [node.left, node.right];
|
|
98
|
+
case "ConditionalExpression":
|
|
99
|
+
return [node.consequent, node.alternate];
|
|
100
|
+
default:
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** True when the subtree submits a lifecycle change to `archived`. */
|
|
106
|
+
function submitsArchive(node) {
|
|
107
|
+
const opening = openingElementOf(node);
|
|
108
|
+
if (
|
|
109
|
+
opening &&
|
|
110
|
+
attributeValue(opening, "name") === LIFECYCLE_FIELD &&
|
|
111
|
+
attributeValue(opening, "value") === ARCHIVED
|
|
112
|
+
) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
return renderedChildren(node).some((child) => submitsArchive(child));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function enclosingForm(node, sourceCode) {
|
|
119
|
+
const ancestors = sourceCode.getAncestors(node);
|
|
120
|
+
for (let index = ancestors.length - 1; index >= 0; index -= 1) {
|
|
121
|
+
const ancestor = ancestors[index];
|
|
122
|
+
if (ancestor.type === "JSXElement" && elementName(ancestor.openingElement) === "form") {
|
|
123
|
+
return ancestor;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export const confirmDestructiveAction = {
|
|
130
|
+
meta: {
|
|
131
|
+
type: "problem",
|
|
132
|
+
docs: {
|
|
133
|
+
description:
|
|
134
|
+
"Require a destructive Server Action to be bound through an approved confirmation component",
|
|
135
|
+
},
|
|
136
|
+
schema: [],
|
|
137
|
+
messages: {
|
|
138
|
+
unconfirmed:
|
|
139
|
+
"A destructive Server Action has no opt-out: bind {{binding}} through ConfirmedActionForm, a destructive ActionDialogForm, or ConfirmDialog onConfirm — never on a bare <{{tag}}>.",
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
create(context) {
|
|
143
|
+
return {
|
|
144
|
+
JSXOpeningElement(node) {
|
|
145
|
+
const tag = elementName(node);
|
|
146
|
+
if (!tag) return;
|
|
147
|
+
|
|
148
|
+
for (const attribute of node.attributes) {
|
|
149
|
+
if (attribute.type !== "JSXAttribute" || attribute.name.type !== "JSXIdentifier")
|
|
150
|
+
continue;
|
|
151
|
+
if (!BINDING_ATTRIBUTES.has(attribute.name.name)) continue;
|
|
152
|
+
|
|
153
|
+
const bound = identifiers(attribute.value).filter((name) =>
|
|
154
|
+
DESTRUCTIVE_ACTION_NAME.test(name),
|
|
155
|
+
);
|
|
156
|
+
const scope =
|
|
157
|
+
attribute.name.name === "formAction"
|
|
158
|
+
? enclosingForm(node, context.sourceCode)
|
|
159
|
+
: node.parent;
|
|
160
|
+
const destructive = bound.length > 0 || (scope ? submitsArchive(scope) : false);
|
|
161
|
+
if (!destructive) continue;
|
|
162
|
+
|
|
163
|
+
const approved =
|
|
164
|
+
tag === "ConfirmedActionForm" ||
|
|
165
|
+
(tag === "ActionDialogForm" && attributeValue(node, "destructive") !== undefined);
|
|
166
|
+
if (approved) continue;
|
|
167
|
+
|
|
168
|
+
context.report({
|
|
169
|
+
node: attribute,
|
|
170
|
+
messageId: "unconfirmed",
|
|
171
|
+
data: { binding: bound[0] ?? `the ${ARCHIVED} lifecycle change`, tag },
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
};
|