@adea-ai/ui 0.107.0 → 0.108.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/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts +55 -0
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts.map +1 -0
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +199 -0
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -0
- package/dist/components/layout/contextual-sidebar/index.d.ts +3 -0
- package/dist/components/layout/contextual-sidebar/index.d.ts.map +1 -0
- package/dist/components/layout/contextual-sidebar/index.js +3 -0
- package/dist/components/layout/pixel-resize-handle/index.d.ts +2 -0
- package/dist/components/layout/pixel-resize-handle/index.d.ts.map +1 -0
- package/dist/components/layout/pixel-resize-handle/index.js +2 -0
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts +29 -0
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -0
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +183 -0
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -0
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.d.ts +3 -19
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js +8 -76
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js.map +1 -1
- package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable/resizable.js +2 -2
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/lint/index.d.ts.map +1 -1
- package/dist/lint.js +154 -20
- package/dist/lint.js.map +1 -1
- package/dist/r/contextual-sidebar.json +25 -0
- package/dist/r/pixel-resize-handle.json +23 -0
- package/dist/r/registry.json +49 -1
- package/dist/r/sidebar-nav.json +1 -1
- package/dist/r/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +180 -0
- package/dist/r/src/components/layout/contextual-sidebar/index.ts +6 -0
- package/dist/r/src/components/layout/pixel-resize-handle/index.ts +1 -0
- package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +177 -0
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx +7 -55
- package/dist/r/src/components/ui/resizable/resizable.tsx +4 -2
- package/package.json +3 -1
- package/registry.json +49 -1
- package/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +180 -0
- package/src/components/layout/contextual-sidebar/index.ts +6 -0
- package/src/components/layout/pixel-resize-handle/index.ts +1 -0
- package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +177 -0
- package/src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx +7 -55
- package/src/components/ui/resizable/resizable.tsx +4 -2
- package/src/index.ts +1 -0
- package/src/lint/index.ts +234 -22
|
@@ -1,82 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createComponent } from "solid-js/web";
|
|
3
|
-
import Resizable from "@corvu/resizable";
|
|
1
|
+
import { PixelResizeHandle } from "../pixel-resize-handle/pixel-resize-handle.js";
|
|
2
|
+
import { createComponent, mergeProps } from "solid-js/web";
|
|
4
3
|
//#region src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx
|
|
5
|
-
/**
|
|
6
|
-
* Resize a contextual sidebar without making its host recreate a separator
|
|
7
|
-
* widget. Corvu owns pointer capture, cancellation, constraints, keyboard
|
|
8
|
-
* movement and cleanup. Its two invisible panels provide a bounded pixel
|
|
9
|
-
* ruler; the host retains the real pane layout and preference persistence.
|
|
10
|
-
* Place this inside the positioned sidebar. The ruler can extend over the
|
|
11
|
-
* adjacent content, but only its handle participates in pointer hit testing.
|
|
12
|
-
*/
|
|
4
|
+
/** Keep the established left-sidebar API as a thin adapter over the shared edge ruler. */
|
|
13
5
|
function SidebarNavResizeHandle(props) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return createComponent(Resizable, {
|
|
19
|
-
orientation: "horizontal",
|
|
20
|
-
get sizes() {
|
|
21
|
-
return [value() / maximum(), 1 - value() / maximum()];
|
|
22
|
-
},
|
|
23
|
-
get keyboardDelta() {
|
|
24
|
-
return `${props.step ?? 16}px`;
|
|
25
|
-
},
|
|
26
|
-
get style() {
|
|
27
|
-
return { width: `${maximum()}px` };
|
|
28
|
-
},
|
|
29
|
-
get ["class"]() {
|
|
30
|
-
return cn("pointer-events-none absolute inset-y-0 start-0 flex", props.class);
|
|
31
|
-
},
|
|
32
|
-
onSizesChange: (sizes) => {
|
|
33
|
-
const next = Math.round((sizes[0] ?? 0) * maximum());
|
|
34
|
-
if (next !== value()) props.onChange(Math.min(maximum(), Math.max(minimum(), next)));
|
|
35
|
-
},
|
|
36
|
-
get children() {
|
|
37
|
-
return [
|
|
38
|
-
createComponent(Resizable.Panel, {
|
|
39
|
-
get minSize() {
|
|
40
|
-
return minimum() / maximum();
|
|
41
|
-
},
|
|
42
|
-
maxSize: 1,
|
|
43
|
-
"aria-hidden": "true"
|
|
44
|
-
}),
|
|
45
|
-
createComponent(Resizable.Handle, {
|
|
46
|
-
get ["aria-label"]() {
|
|
47
|
-
return props.label ?? "Resize navigation";
|
|
48
|
-
},
|
|
49
|
-
get ["aria-controls"]() {
|
|
50
|
-
return props.controls;
|
|
51
|
-
},
|
|
52
|
-
"aria-orientation": "vertical",
|
|
53
|
-
get ["aria-valuemin"]() {
|
|
54
|
-
return minimum();
|
|
55
|
-
},
|
|
56
|
-
get ["aria-valuemax"]() {
|
|
57
|
-
return maximum();
|
|
58
|
-
},
|
|
59
|
-
get ["aria-valuenow"]() {
|
|
60
|
-
return value();
|
|
61
|
-
},
|
|
62
|
-
onHandleDragEnd: commit,
|
|
63
|
-
onKeyUp: (event) => {
|
|
64
|
-
if ([
|
|
65
|
-
"ArrowLeft",
|
|
66
|
-
"ArrowRight",
|
|
67
|
-
"Home",
|
|
68
|
-
"End"
|
|
69
|
-
].includes(event.key)) commit();
|
|
70
|
-
},
|
|
71
|
-
"class": "pointer-events-auto relative z-(--z-docked) w-px -translate-x-full shrink-0 bg-transparent after:absolute after:inset-y-0 after:-inset-x-1 after:w-3 hover:bg-primary focus-visible:bg-primary focus-visible:ring-3 focus-visible:ring-primary-subtle focus-visible:outline-none"
|
|
72
|
-
}),
|
|
73
|
-
createComponent(Resizable.Panel, {
|
|
74
|
-
minSize: 0,
|
|
75
|
-
"aria-hidden": "true"
|
|
76
|
-
})
|
|
77
|
-
];
|
|
6
|
+
return createComponent(PixelResizeHandle, mergeProps(props, {
|
|
7
|
+
side: "left",
|
|
8
|
+
get label() {
|
|
9
|
+
return props.label ?? "Resize navigation";
|
|
78
10
|
}
|
|
79
|
-
});
|
|
11
|
+
}));
|
|
80
12
|
}
|
|
81
13
|
//#endregion
|
|
82
14
|
export { SidebarNavResizeHandle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-nav-resize-handle.js","names":["
|
|
1
|
+
{"version":3,"file":"sidebar-nav-resize-handle.js","names":["PixelResizeHandle","PixelResizeHandleProps","SidebarNavResizeHandleProps","Omit","SidebarNavResizeHandle","props","_$createComponent","_$mergeProps","side","label","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx"],"sourcesContent":["import {\n PixelResizeHandle,\n type PixelResizeHandleProps,\n} from '../pixel-resize-handle/pixel-resize-handle'\n\nexport type SidebarNavResizeHandleProps = Omit<PixelResizeHandleProps, 'side'>\n\n/** Keep the established left-sidebar API as a thin adapter over the shared edge ruler. */\nexport function SidebarNavResizeHandle(props: SidebarNavResizeHandleProps) {\n return <PixelResizeHandle {...props} side=\"left\" label={props.label ?? 'Resize navigation'} />\n}\n"],"mappings":";;;;AAQA,SAAgBI,uBAAuBC,OAAoC;CACzE,OAAAC,gBAAQN,mBAAiBO,WAAKF,OAAK;EAAEG,MAAI;EAAA,IAAQC,QAAK;GAAA,OAAEJ,MAAMI,SAAS;EAAmB;CAAA,CAAA,CAAA;AAC5F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/resizable/resizable.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAA;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAuB9C,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/resizable/resizable.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAA;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAuB9C,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,kCAa/F;AAgBD,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,kCAchG;AAED,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,GAAG;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,kCA+B1D"}
|
|
@@ -18,7 +18,7 @@ var _tmpl$ = /*#__PURE__*/ template(`<div class="bg-border z-(--z-docked) flex h
|
|
|
18
18
|
* adjusted from the keyboard; a bare `cursor-col-resize` div cannot.
|
|
19
19
|
*/
|
|
20
20
|
/**
|
|
21
|
-
* Whether the group was given `initialSizes`. Those are corvu's to apply, and a
|
|
21
|
+
* Whether the group was given `initialSizes` or controlled `sizes`. Those are corvu's to apply, and a
|
|
22
22
|
* panel's own `initialSize` overrides them — so an unsized panel must not invent
|
|
23
23
|
* one when the group already has an answer.
|
|
24
24
|
*/
|
|
@@ -26,7 +26,7 @@ var GroupSizesContext = createContext(() => false);
|
|
|
26
26
|
function ResizablePanelGroup(props) {
|
|
27
27
|
const [local, rest] = splitProps(props, ["class"]);
|
|
28
28
|
return createComponent(GroupSizesContext.Provider, {
|
|
29
|
-
value: () => rest.initialSizes !== void 0,
|
|
29
|
+
value: () => rest.initialSizes !== void 0 || rest.sizes !== void 0,
|
|
30
30
|
get children() {
|
|
31
31
|
return createComponent(Resizable, mergeProps({ get ["class"]() {
|
|
32
32
|
return cn("flex size-full data-[orientation=vertical]:flex-col", local.class);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.js","names":["Resizable","GripVertical","ComponentProps","createContext","splitProps","useContext","cn","GroupSizesContext","ResizablePanelGroup","props","class","local","rest","_$createComponent","Provider","value","initialSizes","undefined","children","_$mergeProps","remainingSize","
|
|
1
|
+
{"version":3,"file":"resizable.js","names":["Resizable","GripVertical","ComponentProps","createContext","splitProps","useContext","cn","GroupSizesContext","ResizablePanelGroup","props","class","local","rest","_$createComponent","Provider","value","initialSizes","undefined","sizes","children","_$mergeProps","remainingSize","left","reduce","total","size","length","ResizablePanel","Panel","group","contextId","groupHasSizes","initialSize","ResizableHandleProps","Handle","withHandle","label","ResizableHandle","aria-label","aria-orientation","orientation","_$memo","_el$","_tmpl$","_$insert","_$createComponent","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/resizable/resizable.tsx"],"sourcesContent":["import Resizable from '@corvu/resizable'\nimport { GripVertical } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { createContext, splitProps, useContext } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Resizable.\n *\n * A split layout: panels the user can resize, with a handle between them. This\n * is the shape of every IDE-like surface — rail, file tree, editor, terminal —\n * and the reason it is a primitive rather than something each view improvises.\n *\n * corvu supplies the pointer capture, the min/max constraints and the keyboard\n * resizing, which is what makes a divider operable without a mouse. The handle\n * is a real focusable element with an accessible role, so a split pane can be\n * adjusted from the keyboard; a bare `cursor-col-resize` div cannot.\n */\n/**\n * Whether the group was given `initialSizes` or controlled `sizes`. Those are corvu's to apply, and a\n * panel's own `initialSize` overrides them — so an unsized panel must not invent\n * one when the group already has an answer.\n */\nconst GroupSizesContext = createContext<() => boolean>(() => false)\n\nexport function ResizablePanelGroup(props: ComponentProps<typeof Resizable> & { class?: string }) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <GroupSizesContext.Provider\n value={() => rest.initialSizes !== undefined || rest.sizes !== undefined}\n >\n <Resizable\n class={cn('flex size-full data-[orientation=vertical]:flex-col', local.class)}\n {...rest}\n />\n </GroupSizesContext.Provider>\n )\n}\n\n/**\n * The size an unsized panel registers with: whatever its earlier siblings left.\n *\n * corvu registers a panel without `initialSize` at a flat 50%, so `0.28` beside\n * an unsized panel summed to 78% and left a gap. Panels register in document\n * order, so at registration `sizes` holds exactly the panels before this one.\n * When nothing is left — a second unsized panel — it takes an equal share, and\n * corvu shrinks the earlier panels by that share to keep the total at 100%.\n */\nfunction remainingSize(sizes: readonly number[]): number {\n const left = 1 - sizes.reduce((total, size) => total + size, 0)\n return left > 0.001 ? left : 1 / (sizes.length + 1)\n}\n\nexport function ResizablePanel(props: ComponentProps<typeof Resizable.Panel> & { class?: string }) {\n const [local, rest] = splitProps(props, ['class', 'initialSize'])\n const group = Resizable.useContext(rest.contextId)\n const groupHasSizes = useContext(GroupSizesContext)\n\n return (\n <Resizable.Panel\n initialSize={\n local.initialSize ?? (groupHasSizes() ? undefined : remainingSize(group.sizes()))\n }\n class={cn('min-h-0 min-w-0 overflow-hidden', local.class)}\n {...rest}\n />\n )\n}\n\nexport type ResizableHandleProps = ComponentProps<typeof Resizable.Handle> & {\n class?: string\n /** Draw a visible grip in the middle of the divider. */\n withHandle?: boolean\n /**\n * The divider's accessible name. It is a focusable control — arrow keys move\n * the split — so it needs one; without it a screen reader announces an\n * unlabelled button between the two panels.\n */\n label?: string\n}\n\nexport function ResizableHandle(props: ResizableHandleProps) {\n const [local, rest] = splitProps(props, ['class', 'withHandle', 'label'])\n const group = Resizable.useContext(rest.contextId)\n\n return (\n <Resizable.Handle\n aria-label={local.label ?? 'Resize panels'}\n // A separator's orientation is the line's own, which runs across the\n // group: a row of panels is divided by a vertical line, a column by a\n // horizontal one. corvu reports the group's orientation instead.\n aria-orientation={group.orientation() === 'horizontal' ? 'vertical' : 'horizontal'}\n class={cn(\n 'group/resize bg-border relative flex w-px shrink-0 items-center justify-center',\n /* Widen the hit target without moving the visual line: the divider is\n a hairline, but a hairline is far too small to grab. */\n 'after:absolute after:inset-y-0 after:-inset-x-1 after:w-3',\n 'transition-colors ease-out hover:bg-primary',\n 'focus-visible:bg-primary focus-visible:outline-none',\n 'data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full',\n 'data-[orientation=vertical]:after:inset-x-0 data-[orientation=vertical]:after:-inset-y-1 data-[orientation=vertical]:after:h-3 data-[orientation=vertical]:after:w-full',\n local.class\n )}\n {...rest}\n >\n {local.withHandle ? (\n <div class=\"bg-border z-(--z-docked) flex h-4 w-2.5 items-center justify-center rounded-sm border border-border\">\n <GripVertical class=\"size-2.5 text-muted-foreground\" />\n </div>\n ) : null}\n </Resizable.Handle>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAMO,oBAAoBJ,oBAAmC,KAAK;AAElE,SAAgBK,oBAAoBC,OAA8D;CAChG,MAAM,CAACE,OAAOC,QAAQR,WA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M,eAAe,aAAa;EAAY;EAAA,KAAA,WAAA;GAAA,OAC3ElC,GACL,kFAGA,6DACA,+CACA,uDACA,uEACA,2KACAK,MAAMD,KACR;EAAC;CAAA,GACGE,MAAI,EAAA,IAAAO,WAAA;EAAA,OAEPsB,WAAA,CAAA,CAAA9B,MAAMwB,UAAU,CAAA,CAAA,WAAA;GAAA,IAAAO,OAAAC,OAAA;GAAAC,OAAAF,MAAA7B,gBAEZZ,cAAY,EAAA,SAAA,iCAAA,CAAA,CAAA;GAAA,OAAAyC;EAAA,EAAA,CAAA,IAEb;CAAI,EAAA,CAAA,CAAA;AAGd"}
|
package/dist/index.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ export * from './components/layout/page';
|
|
|
83
83
|
export * from './components/layout/panel';
|
|
84
84
|
export * from './components/layout/side-rail';
|
|
85
85
|
export * from './components/layout/sidebar-nav';
|
|
86
|
+
export * from './components/layout/contextual-sidebar';
|
|
86
87
|
export * from './components/layout/status-bar';
|
|
87
88
|
export * from './components/layout/top-bar';
|
|
88
89
|
export * from './components/conversation';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,C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EAAE,MAAM,qBAAqB,CAAA;AAC3F,OAAO,EACL,aAAa,EACb,SAAS,EACT,WAAW,EACX,aAAa,EACb,YAAY,EACZ,eAAe,EACf,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,SAAS,GACf,MAAM,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -83,7 +83,9 @@ import { Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFoote
|
|
|
83
83
|
import { useSideRail } from "./components/layout/side-rail/side-rail-context.js";
|
|
84
84
|
import { SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection } from "./components/layout/side-rail/side-rail.js";
|
|
85
85
|
import { SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavRow, SidebarNavSection, SidebarNavTitle, sidebarNavItemClass, sidebarNavItemStateClass } from "./components/layout/sidebar-nav/sidebar-nav.js";
|
|
86
|
+
import { PixelResizeHandle } from "./components/layout/pixel-resize-handle/pixel-resize-handle.js";
|
|
86
87
|
import { SidebarNavResizeHandle } from "./components/layout/sidebar-nav/sidebar-nav-resize-handle.js";
|
|
88
|
+
import { ContextualSidebar } from "./components/layout/contextual-sidebar/contextual-sidebar.js";
|
|
87
89
|
import { StatusBar, StatusBarItem, StatusBarSpacer } from "./components/layout/status-bar/status-bar.js";
|
|
88
90
|
import { TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle } from "./components/layout/top-bar/top-bar.js";
|
|
89
91
|
import { BusySendButton } from "./components/conversation/busy-send-button.js";
|
|
@@ -126,4 +128,4 @@ import { AboutDialog } from "./components/composites/about-dialog/about-dialog.j
|
|
|
126
128
|
import { HelpCenter } from "./components/composites/help-center/help-center.js";
|
|
127
129
|
import { WorkspaceMark } from "./components/composites/workspace-mark/workspace-mark.js";
|
|
128
130
|
import { writeClipboardText } from "./lib/clipboard.js";
|
|
129
|
-
export { APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, AspectRatio, AttachmentCard, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbSeparator, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CalendarSurface, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChatComposer, Checkbox, CheckboxDescription, CheckboxLabel, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, ComposerAttachmentButton, ComposerHint, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ConversationAvatar, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, ListGroup, ListRow, ListRowControl, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MessageBody, MessageComposer, MessageDayDivider, MessageGroup, MessageRow, ModalDialog, Motion, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Spinner, SplitLayout, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, TranscriptComposition, Tree, TreeRow, UpdateDialog, ValueCombobox, VirtualWindow, WorkspaceMark, accentPresets, alertVariants, allTokens, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, builtinThemes, buttonVariants, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, closePane, cn, colorTokens, computeLayoutFrames, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countLeaves, countLines, createAppMenuItems, createLayoutState, cva, defaultDarkThemeId, defaultLightThemeId, defaultThemeSelection, densityTokens, designTokens, diffLineVariants, diffStats, diffTargetPath, elevationTokens, entityIconVariants, expandAll, findTokenRanges, focusPane, fontOptions, fontSettingsBootstrapScript, formatBytes, formatReleaseDate, formatToken, headingElement, headingVariants, initialsFrom, inlineScriptLiteral, isPasteBlock, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, monogram, motionTokens, movePane, neighborLeaf, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeLayout, parseDiff, plainTextFromMarkdown, pruneBlocks, radiusTokens, recollapsePastes, remapCarriedBlocks, resizeFloatingPreview, resizePreviewMiniPlayer, resizeSplit, resolveAccentPreset, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame, resolvedDensity, sheetVariants, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, splitPane, statusDotVariants, stripTrailingBlankLines, surfaceInteractive, swapPanes, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, transcriptDisclosureKey, typographyTokens, undoClosePane, undocumentedTokenAliases, useSideRail, useTheme, validateTheme, validateThemeRegistry, withAccent, writeClipboardText, zIndexTokens };
|
|
131
|
+
export { APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, AspectRatio, AttachmentCard, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbSeparator, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CalendarSurface, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChatComposer, Checkbox, CheckboxDescription, CheckboxLabel, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, ComposerAttachmentButton, ComposerHint, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, ListGroup, ListRow, ListRowControl, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MessageBody, MessageComposer, MessageDayDivider, MessageGroup, MessageRow, ModalDialog, Motion, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelResizeHandle, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Spinner, SplitLayout, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, TranscriptComposition, Tree, TreeRow, UpdateDialog, ValueCombobox, VirtualWindow, WorkspaceMark, accentPresets, alertVariants, allTokens, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, builtinThemes, buttonVariants, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, closePane, cn, colorTokens, computeLayoutFrames, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countLeaves, countLines, createAppMenuItems, createLayoutState, cva, defaultDarkThemeId, defaultLightThemeId, defaultThemeSelection, densityTokens, designTokens, diffLineVariants, diffStats, diffTargetPath, elevationTokens, entityIconVariants, expandAll, findTokenRanges, focusPane, fontOptions, fontSettingsBootstrapScript, formatBytes, formatReleaseDate, formatToken, headingElement, headingVariants, initialsFrom, inlineScriptLiteral, isPasteBlock, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, monogram, motionTokens, movePane, neighborLeaf, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeLayout, parseDiff, plainTextFromMarkdown, pruneBlocks, radiusTokens, recollapsePastes, remapCarriedBlocks, resizeFloatingPreview, resizePreviewMiniPlayer, resizeSplit, resolveAccentPreset, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame, resolvedDensity, sheetVariants, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, splitPane, statusDotVariants, stripTrailingBlankLines, surfaceInteractive, swapPanes, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, transcriptDisclosureKey, typographyTokens, undoClosePane, undocumentedTokenAliases, useSideRail, useTheme, validateTheme, validateThemeRegistry, withAccent, writeClipboardText, zIndexTokens };
|
package/dist/lint/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lint/index.ts"],"names":[],"mappings":"AAmBA,KAAK,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAa/E,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS,CAAA;QACf,IAAI,EAAE;YAAE,WAAW,EAAE,MAAM,CAAA;SAAE,CAAA;QAC7B,MAAM,EAAE,IAAI,EAAE,CAAA;QACd,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACjC,CAAA;IACD,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC,CAAA;CACtE,CAAA;AAED,UAAU,WAAW;IACnB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE;QACX,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,SAAS,GAAG,SAAS,CAAA;KACpD,CAAA;IACD,MAAM,EAAE,CAAC,UAAU,EAAE;QACn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AChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;KAC5B,KAAK,IAAI,CAAA;CACX;AAED,UAAU,SAAS;IACjB,GAAG,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAkhCD,QAAA,MAAM,MAAM;;;;;;;;;;;;CAUX,CAAA;AAED,eAAe,MAAM,CAAA"}
|
package/dist/lint.js
CHANGED
|
@@ -575,6 +575,111 @@ var staticStringValue = (node) => {
|
|
|
575
575
|
if (node?.type === "TemplateLiteral" && node.expressions.length === 0) return node.quasis[0].value.cooked ?? node.quasis[0].value.raw;
|
|
576
576
|
return null;
|
|
577
577
|
};
|
|
578
|
+
var isImportedJsxComponent = (name, imports, context, namespaceExport) => {
|
|
579
|
+
if (name?.type === "JSXIdentifier" || name?.type === "Identifier") return isImportedBinding(name, imports.named, context);
|
|
580
|
+
const memberName = name?.property?.name;
|
|
581
|
+
return (name?.type === "JSXMemberExpression" || name?.type === "MemberExpression") && (name.object?.type === "JSXIdentifier" || name.object?.type === "Identifier") && (name.property?.type === "JSXIdentifier" || name.property?.type === "Identifier") && (namespaceExport ? memberName === namespaceExport : /^[A-Z]/.test(memberName ?? "")) && isImportedBinding(name.object, imports.namespaces, context);
|
|
582
|
+
};
|
|
583
|
+
var CONTENT_OVERRIDE_PROPS = /* @__PURE__ */ new Set([
|
|
584
|
+
"children",
|
|
585
|
+
"dangerouslySetInnerHTML",
|
|
586
|
+
"innerHTML",
|
|
587
|
+
"textContent"
|
|
588
|
+
]);
|
|
589
|
+
/** Opaque spreads and objects containing content props may override children. */
|
|
590
|
+
var spreadMayOverrideContent = (argument) => {
|
|
591
|
+
while (argument?.type === "TSAsExpression" || argument?.type === "TSSatisfiesExpression" || argument?.type === "TSNonNullExpression") argument = argument.expression;
|
|
592
|
+
if (argument?.type !== "ObjectExpression") return true;
|
|
593
|
+
return argument.properties.some((property) => {
|
|
594
|
+
if (property.type !== "Property") return true;
|
|
595
|
+
const key = staticPropertyKey(property.key, property.computed === true);
|
|
596
|
+
return key === null || CONTENT_OVERRIDE_PROPS.has(key);
|
|
597
|
+
});
|
|
598
|
+
};
|
|
599
|
+
var hasContentOverride = (openingElement) => (openingElement?.attributes ?? []).some((attribute) => {
|
|
600
|
+
if (attribute.type === "JSXSpreadAttribute") return spreadMayOverrideContent(attribute.argument);
|
|
601
|
+
return attribute.type === "JSXAttribute" && attribute.name?.type === "JSXIdentifier" && CONTENT_OVERRIDE_PROPS.has(attribute.name.name);
|
|
602
|
+
});
|
|
603
|
+
var iconChildrenKind = (children, icons, context) => {
|
|
604
|
+
let hasIcon = false;
|
|
605
|
+
for (const child of children) {
|
|
606
|
+
const kind = iconChildKind(child, icons, context);
|
|
607
|
+
if (kind === "text" || kind === "unknown") return kind;
|
|
608
|
+
if (kind === "icon") hasIcon = true;
|
|
609
|
+
}
|
|
610
|
+
return hasIcon ? "icon" : "empty";
|
|
611
|
+
};
|
|
612
|
+
var SVG_TEXT_CONTAINERS = /* @__PURE__ */ new Set(["text", "foreignObject"]);
|
|
613
|
+
/** A raw SVG may be labelled or contain dynamic text instead of an icon. */
|
|
614
|
+
var svgMayContainVisibleText = (children) => {
|
|
615
|
+
for (const child of children) {
|
|
616
|
+
if (!child) return true;
|
|
617
|
+
if (child.type === "JSXText") {
|
|
618
|
+
if (String(child.value ?? "").trim()) return true;
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
if (child.type === "JSXFragment") {
|
|
622
|
+
if (svgMayContainVisibleText(child.children ?? [])) return true;
|
|
623
|
+
continue;
|
|
624
|
+
}
|
|
625
|
+
if (child.type === "JSXExpressionContainer") {
|
|
626
|
+
const expression = child.expression;
|
|
627
|
+
if (!expression || expression.type === "JSXEmptyExpression") continue;
|
|
628
|
+
if (expression.type === "JSXElement" || expression.type === "JSXFragment") {
|
|
629
|
+
if (svgMayContainVisibleText(expression.type === "JSXElement" ? [expression] : expression.children ?? [])) return true;
|
|
630
|
+
continue;
|
|
631
|
+
}
|
|
632
|
+
const text = staticStringValue(expression);
|
|
633
|
+
if (text !== null) {
|
|
634
|
+
if (text.trim()) return true;
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
if (expression.type === "Literal" && (expression.value === null || typeof expression.value === "boolean")) continue;
|
|
638
|
+
return true;
|
|
639
|
+
}
|
|
640
|
+
if (child.type !== "JSXElement") return true;
|
|
641
|
+
const name = child.openingElement?.name;
|
|
642
|
+
if (name?.type !== "JSXIdentifier") return true;
|
|
643
|
+
if (SVG_TEXT_CONTAINERS.has(name.name)) return true;
|
|
644
|
+
if (hasContentOverride(child.openingElement)) return true;
|
|
645
|
+
if (name.name === "title" || name.name === "desc") continue;
|
|
646
|
+
if (!/^[a-z]/.test(name.name) || name.name.includes("-")) return true;
|
|
647
|
+
if (svgMayContainVisibleText(child.children ?? [])) return true;
|
|
648
|
+
}
|
|
649
|
+
return false;
|
|
650
|
+
};
|
|
651
|
+
/**
|
|
652
|
+
* Proves only the uncomplicated icon-only forms that can be read without
|
|
653
|
+
* executing Solid expressions: imported Lucide components, raw SVG, fragments,
|
|
654
|
+
* whitespace, and spans that contain only those forms.
|
|
655
|
+
*/
|
|
656
|
+
var iconChildKind = (child, icons, context) => {
|
|
657
|
+
if (!child) return "unknown";
|
|
658
|
+
if (child.type === "JSXText") return String(child.value ?? "").trim() ? "text" : "empty";
|
|
659
|
+
if (child.type === "JSXFragment") return iconChildrenKind(child.children ?? [], icons, context);
|
|
660
|
+
if (child.type === "JSXExpressionContainer") {
|
|
661
|
+
const expression = child.expression;
|
|
662
|
+
if (!expression || expression.type === "JSXEmptyExpression") return "empty";
|
|
663
|
+
if (expression.type === "JSXElement" || expression.type === "JSXFragment") return iconChildKind(expression, icons, context);
|
|
664
|
+
const text = staticStringValue(expression);
|
|
665
|
+
if (text !== null) return text.trim() ? "text" : "empty";
|
|
666
|
+
if (expression.type === "Literal" && (expression.value === null || typeof expression.value === "boolean")) return "empty";
|
|
667
|
+
if (expression.type === "Literal" && typeof expression.value === "number") return "text";
|
|
668
|
+
return "unknown";
|
|
669
|
+
}
|
|
670
|
+
if (child.type !== "JSXElement") return "unknown";
|
|
671
|
+
const name = child.openingElement?.name;
|
|
672
|
+
if (name?.type === "JSXIdentifier" && name.name === "svg") return hasContentOverride(child.openingElement) || svgMayContainVisibleText(child.children ?? []) ? "unknown" : "icon";
|
|
673
|
+
if (isImportedJsxComponent(name, icons, context)) return hasContentOverride(child.openingElement) ? "unknown" : "icon";
|
|
674
|
+
if (name?.type === "JSXIdentifier" && name.name === "span") {
|
|
675
|
+
if (hasContentOverride(child.openingElement)) return "unknown";
|
|
676
|
+
return iconChildrenKind(child.children ?? [], icons, context);
|
|
677
|
+
}
|
|
678
|
+
return "unknown";
|
|
679
|
+
};
|
|
680
|
+
var hasStaticallyIconOnlyChildren = (node, icons, context) => {
|
|
681
|
+
return !hasContentOverride(node.openingElement) && iconChildrenKind(node.children ?? [], icons, context) === "icon";
|
|
682
|
+
};
|
|
578
683
|
var isIconButtonSize = (node) => attributeValues(node, "size").some((value) => {
|
|
579
684
|
const size = staticStringValue(value);
|
|
580
685
|
return size !== null && ICON_BUTTON_SIZES.has(size);
|
|
@@ -587,7 +692,6 @@ var actionTooltipStatus = (node) => {
|
|
|
587
692
|
if (strings.every((value) => value !== null)) return "blank";
|
|
588
693
|
return "unknown";
|
|
589
694
|
};
|
|
590
|
-
var isImportedComponent = (identifier, imports) => identifier?.type === "Identifier" && imports.has(identifier.name);
|
|
591
695
|
var plugin = {
|
|
592
696
|
meta: { name: "adea" },
|
|
593
697
|
rules: {
|
|
@@ -652,47 +756,77 @@ var plugin = {
|
|
|
652
756
|
"require-action-button-tooltip": {
|
|
653
757
|
meta: {
|
|
654
758
|
type: "problem",
|
|
655
|
-
docs: { description: "
|
|
759
|
+
docs: { description: "Icon-sized shared Buttons and statically proven icon-only Buttons use ActionButton with a tooltip; icon-only ActionButtons need one too." },
|
|
656
760
|
schema: [],
|
|
657
761
|
messages: {
|
|
658
|
-
useActionButton: "Icon-size Button actions use ActionButton with a nonblank tooltip. Keep the control name in aria-label; the tooltip explains the action.",
|
|
659
|
-
missingTooltip: "An icon-size ActionButton needs a supplied nonblank tooltip. Keep its accessible name in aria-label as well."
|
|
762
|
+
useActionButton: "Icon-size or icon-only Button actions must use ActionButton with a nonblank tooltip. Keep the control name in aria-label; the tooltip explains the action.",
|
|
763
|
+
missingTooltip: "An icon-size or icon-only ActionButton needs a supplied nonblank tooltip. Keep its accessible name in aria-label as well."
|
|
660
764
|
}
|
|
661
765
|
},
|
|
662
766
|
create(context) {
|
|
663
|
-
const buttons =
|
|
664
|
-
|
|
767
|
+
const buttons = {
|
|
768
|
+
named: /* @__PURE__ */ new WeakSet(),
|
|
769
|
+
namespaces: /* @__PURE__ */ new WeakSet()
|
|
770
|
+
};
|
|
771
|
+
const actionButtons = {
|
|
772
|
+
named: /* @__PURE__ */ new WeakSet(),
|
|
773
|
+
namespaces: /* @__PURE__ */ new WeakSet()
|
|
774
|
+
};
|
|
775
|
+
const icons = {
|
|
776
|
+
named: /* @__PURE__ */ new WeakSet(),
|
|
777
|
+
namespaces: /* @__PURE__ */ new WeakSet()
|
|
778
|
+
};
|
|
665
779
|
const recordImports = (node) => {
|
|
666
780
|
const source = node.source?.value;
|
|
667
781
|
const target = source === BUTTON_MODULE ? buttons : source === ACTION_BUTTON_MODULE ? actionButtons : null;
|
|
782
|
+
if (source === "lucide-solid") {
|
|
783
|
+
if (node.importKind === "type") return;
|
|
784
|
+
for (const specifier of node.specifiers ?? []) {
|
|
785
|
+
if (!specifier.local || specifier.importKind === "type") continue;
|
|
786
|
+
if (specifier.type === "ImportNamespaceSpecifier") icons.namespaces.add(specifier.local);
|
|
787
|
+
else if (specifier.type === "ImportSpecifier") {
|
|
788
|
+
const imported = specifier.imported?.name ?? specifier.imported?.value;
|
|
789
|
+
if (typeof imported === "string" && /^[A-Z]/.test(imported)) icons.named.add(specifier.local);
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
668
794
|
if (!target) return;
|
|
795
|
+
if (node.importKind === "type") return;
|
|
669
796
|
for (const specifier of node.specifiers ?? []) {
|
|
670
|
-
if (specifier.type
|
|
797
|
+
if (specifier.type === "ImportNamespaceSpecifier" && specifier.local) {
|
|
798
|
+
target.namespaces.add(specifier.local);
|
|
799
|
+
continue;
|
|
800
|
+
}
|
|
801
|
+
if (specifier.type !== "ImportSpecifier" || !specifier.local || specifier.importKind === "type") continue;
|
|
671
802
|
const imported = specifier.imported?.name ?? specifier.imported?.value;
|
|
672
|
-
if (source === BUTTON_MODULE && imported === "Button" || source === ACTION_BUTTON_MODULE && imported === "ActionButton") target.add(specifier.local
|
|
803
|
+
if (source === BUTTON_MODULE && imported === "Button" || source === ACTION_BUTTON_MODULE && imported === "ActionButton") target.named.add(specifier.local);
|
|
673
804
|
}
|
|
674
805
|
};
|
|
675
806
|
return {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
const
|
|
681
|
-
const
|
|
682
|
-
const
|
|
683
|
-
const
|
|
684
|
-
const
|
|
807
|
+
Program(node) {
|
|
808
|
+
for (const statement of node.body ?? []) if (statement.type === "ImportDeclaration") recordImports(statement);
|
|
809
|
+
},
|
|
810
|
+
JSXElement(node) {
|
|
811
|
+
const opening = node.openingElement;
|
|
812
|
+
const isButton = isImportedJsxComponent(opening.name, buttons, context, "Button");
|
|
813
|
+
const isActionButton = isImportedJsxComponent(opening.name, actionButtons, context, "ActionButton");
|
|
814
|
+
const asValues = attributeValues(opening, "as");
|
|
815
|
+
const targetsButton = asValues.some((value) => isImportedJsxComponent(value, buttons, context, "Button"));
|
|
816
|
+
const targetsActionButton = asValues.some((value) => isImportedJsxComponent(value, actionButtons, context, "ActionButton"));
|
|
817
|
+
if (!isButton && !isActionButton && !targetsButton && !targetsActionButton) return;
|
|
818
|
+
if (!isIconButtonSize(opening) && !hasStaticallyIconOnlyChildren(node, icons, context)) return;
|
|
685
819
|
if (isButton || targetsButton) {
|
|
686
820
|
context.report({
|
|
687
|
-
node,
|
|
821
|
+
node: opening,
|
|
688
822
|
messageId: "useActionButton"
|
|
689
823
|
});
|
|
690
824
|
return;
|
|
691
825
|
}
|
|
692
826
|
if (!isActionButton && !targetsActionButton) return;
|
|
693
|
-
const status = actionTooltipStatus(
|
|
827
|
+
const status = actionTooltipStatus(opening);
|
|
694
828
|
if (status === "missing" || status === "blank") context.report({
|
|
695
|
-
node,
|
|
829
|
+
node: opening,
|
|
696
830
|
messageId: "missingTooltip"
|
|
697
831
|
});
|
|
698
832
|
}
|