@nadicodeai/ui 12.1.26 → 12.1.28
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/.build-kind +1 -0
- package/dist/components/absence-note.d.ts +23 -0
- package/dist/components/absence-note.d.ts.map +1 -0
- package/dist/components/absence-note.js +19 -0
- package/dist/components/drawer.js +1 -1
- package/dist/eslint/index.js +3 -0
- package/dist/eslint/rules/overlay-mounts-closed.js +102 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/internal/assistant-ui/tool-fallback.d.ts.map +1 -1
- package/dist/internal/assistant-ui/tool-fallback.js +3 -3
- package/dist/internal/assistant-ui/tool-group.d.ts.map +1 -1
- package/dist/internal/assistant-ui/tool-group.js +3 -3
- package/dist/lib/absence-note.d.ts +11 -0
- package/dist/lib/absence-note.d.ts.map +1 -0
- package/dist/lib/absence-note.js +16 -0
- package/package.json +6 -2
package/dist/.build-kind
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
clean
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What stands where a missing page or record would have been
|
|
3
|
+
* ([Failure surfaces](../../../design-system/DESIGN.md#failure-surfaces)): a
|
|
4
|
+
* short note signed by Nadia, one line at a time so the stanza breathes on the
|
|
5
|
+
* spacing ladder rather than on a private leading.
|
|
6
|
+
*
|
|
7
|
+
* The note is written copy signed by Nadia, not a report of anything she did,
|
|
8
|
+
* so the orb takes ambient motion and claims no activity. `orb` is false where
|
|
9
|
+
* the surface's picture already gives Nadia a place to turn in, which is where
|
|
10
|
+
* she belongs when there is one. `scale` is the register the surface reads in:
|
|
11
|
+
* a product screen sets the note one step below a page title, the website one
|
|
12
|
+
* step above it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function AbsenceNote({ note, byline, scale, align, orb, className, }: {
|
|
15
|
+
/** The piece, one line per newline. */
|
|
16
|
+
note: string;
|
|
17
|
+
byline: string;
|
|
18
|
+
scale?: "product" | "site";
|
|
19
|
+
align?: "center" | "start";
|
|
20
|
+
orb?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=absence-note.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"absence-note.d.ts","sourceRoot":"","sources":["../../src/components/absence-note.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,MAAM,EACN,KAAiB,EACjB,KAAgB,EAChB,GAAU,EACV,SAAS,GACV,EAAE;IACD,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA4BA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AgentOrb } from "./agent-orb.js";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
/**
|
|
5
|
+
* What stands where a missing page or record would have been
|
|
6
|
+
* ([Failure surfaces](../../../design-system/DESIGN.md#failure-surfaces)): a
|
|
7
|
+
* short note signed by Nadia, one line at a time so the stanza breathes on the
|
|
8
|
+
* spacing ladder rather than on a private leading.
|
|
9
|
+
*
|
|
10
|
+
* The note is written copy signed by Nadia, not a report of anything she did,
|
|
11
|
+
* so the orb takes ambient motion and claims no activity. `orb` is false where
|
|
12
|
+
* the surface's picture already gives Nadia a place to turn in, which is where
|
|
13
|
+
* she belongs when there is one. `scale` is the register the surface reads in:
|
|
14
|
+
* a product screen sets the note one step below a page title, the website one
|
|
15
|
+
* step above it.
|
|
16
|
+
*/
|
|
17
|
+
export function AbsenceNote({ note, byline, scale = "product", align = "center", orb = true, className, }) {
|
|
18
|
+
return (_jsxs("div", { className: cn("grid gap-6", align === "center" ? "justify-items-center text-center" : "justify-items-start text-start", className), children: [orb ? (_jsx(AgentOrb, { decorative: true, form: "nadia", motion: "ambient", size: scale === "site" ? 160 : 96 })) : null, _jsx("blockquote", { className: "grid gap-3", children: note.split("\n").map((line) => (_jsx("p", { className: cn("text-balance font-normal", scale === "site" ? "nc-type-heading-lg" : "nc-type-heading-md"), children: line }, line))) }), _jsx("p", { className: "nc-type-label-mono text-muted-foreground", children: byline })] }));
|
|
19
|
+
}
|
|
@@ -46,7 +46,7 @@ function DrawerContent({ className, children, ...props }) {
|
|
|
46
46
|
// Stack.
|
|
47
47
|
"[--bleed:3rem] [--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]",
|
|
48
48
|
// Transitions.
|
|
49
|
-
"data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*var(--nc-duration-drawer-swipe))] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*var(--nc-duration-drawer-swipe))] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*var(--nc-duration-drawer-swipe))] motion-reduce:data-ending-style:transform-none motion-reduce:data-starting-style:transform-none",
|
|
49
|
+
"data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*var(--nc-duration-drawer-swipe))] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*var(--nc-duration-drawer-swipe))] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*var(--nc-duration-drawer-swipe))] motion-reduce:data-ending-style:transform-none motion-reduce:data-starting-style:transform-none motion-reduce:data-ending-style:opacity-0 motion-reduce:data-starting-style:opacity-0",
|
|
50
50
|
// Axis: y.
|
|
51
51
|
"data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)",
|
|
52
52
|
// Axis: x.
|
package/dist/eslint/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import { noPairedSizeUtility } from "./rules/no-paired-size-utility.js";
|
|
|
20
20
|
import { noRestingSettingsControl } from "./rules/no-resting-settings-control.js";
|
|
21
21
|
import { oneControlHeight } from "./rules/one-control-height.js";
|
|
22
22
|
import { overlayBodyOwnsScroll } from "./rules/overlay-body-owns-scroll.js";
|
|
23
|
+
import { overlayMountsClosed } from "./rules/overlay-mounts-closed.js";
|
|
23
24
|
import { tableColumnWrapsByMeta } from "./rules/table-column-wraps-by-meta.js";
|
|
24
25
|
import { noShadcnAppearanceOverride } from "./rules/no-shadcn-appearance-override.js";
|
|
25
26
|
import { noSubjectDerivedExpectation } from "./rules/no-subject-derived-expectation.js";
|
|
@@ -98,6 +99,7 @@ export const strictDesignSystemRules = {
|
|
|
98
99
|
"nadicodeai/no-shadcn-appearance-override": "error",
|
|
99
100
|
"nadicodeai/no-token-category-bypass": "error",
|
|
100
101
|
"nadicodeai/overlay-body-owns-scroll": "error",
|
|
102
|
+
"nadicodeai/overlay-mounts-closed": "error",
|
|
101
103
|
"nadicodeai/prefer-radio-for-few-static-options": "error",
|
|
102
104
|
};
|
|
103
105
|
|
|
@@ -135,6 +137,7 @@ const plugin = {
|
|
|
135
137
|
"no-token-category-bypass": noTokenCategoryBypass,
|
|
136
138
|
"one-control-height": oneControlHeight,
|
|
137
139
|
"overlay-body-owns-scroll": overlayBodyOwnsScroll,
|
|
140
|
+
"overlay-mounts-closed": overlayMountsClosed,
|
|
138
141
|
"table-column-wraps-by-meta": tableColumnWrapsByMeta,
|
|
139
142
|
"server-action-discipline": serverActionDiscipline,
|
|
140
143
|
"settings-section-description": settingsSectionDescription,
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* An overlay is mounted closed and then opened, so its entry runs.
|
|
3
|
+
*
|
|
4
|
+
* A dialog, drawer, sheet or menu fades in from its starting style when its
|
|
5
|
+
* `open` turns true on a mounted element. One that first mounts already open
|
|
6
|
+
* has no earlier frame to transition from, so it appears at full opacity, and
|
|
7
|
+
* one that unmounts on dismissal never plays its exit. Three spellings mount an
|
|
8
|
+
* overlay open: an `open` fixed to true (its parent mounts it on demand), a
|
|
9
|
+
* truthy `defaultOpen`, and a `key` that changes per opening, which remounts it
|
|
10
|
+
* in the same render that opens it. A list key inside a `.map` callback and a
|
|
11
|
+
* literal key are an element's identity, not an opening.
|
|
12
|
+
*
|
|
13
|
+
* Standard tool checked first: `no-restricted-syntax` can match the attribute,
|
|
14
|
+
* but not the renamed import or the enclosing `.map` a list key sits in, so the
|
|
15
|
+
* shared component-name reader resolves it here.
|
|
16
|
+
*/
|
|
17
|
+
import { jsxComponentName } from "./jsx-class-utility.js";
|
|
18
|
+
|
|
19
|
+
const OVERLAY = /Dialog|Drawer|Sheet|Popover|Menu|Tooltip|HoverCard|Combobox/;
|
|
20
|
+
const PART =
|
|
21
|
+
/(Content|Trigger|Title|Description|Header|Footer|Body|Item|Group|Label|Separator|Close|Portal|Overlay|Backdrop)$/;
|
|
22
|
+
const LIST_CALLBACK = new Set(["map", "flatMap"]);
|
|
23
|
+
|
|
24
|
+
function attribute(node, name) {
|
|
25
|
+
return node.attributes.find(
|
|
26
|
+
(entry) =>
|
|
27
|
+
entry.type === "JSXAttribute" &&
|
|
28
|
+
entry.name.type === "JSXIdentifier" &&
|
|
29
|
+
entry.name.name === name,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function isTrue(entry) {
|
|
34
|
+
if (!entry) return false;
|
|
35
|
+
if (entry.value === null) return true;
|
|
36
|
+
return (
|
|
37
|
+
entry.value.type === "JSXExpressionContainer" &&
|
|
38
|
+
entry.value.expression.type === "Literal" &&
|
|
39
|
+
entry.value.expression.value === true
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function isLiteralKey(entry) {
|
|
44
|
+
if (entry.value?.type === "Literal") return true;
|
|
45
|
+
const expression =
|
|
46
|
+
entry.value?.type === "JSXExpressionContainer" ? entry.value.expression : undefined;
|
|
47
|
+
return (
|
|
48
|
+
expression?.type === "Literal" ||
|
|
49
|
+
(expression?.type === "TemplateLiteral" && expression.expressions.length === 0)
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function insideListCallback(node, context) {
|
|
54
|
+
return context.sourceCode
|
|
55
|
+
.getAncestors(node)
|
|
56
|
+
.some(
|
|
57
|
+
(ancestor) =>
|
|
58
|
+
(ancestor.type === "ArrowFunctionExpression" || ancestor.type === "FunctionExpression") &&
|
|
59
|
+
ancestor.parent?.type === "CallExpression" &&
|
|
60
|
+
ancestor.parent.arguments.includes(ancestor) &&
|
|
61
|
+
ancestor.parent.callee.type === "MemberExpression" &&
|
|
62
|
+
LIST_CALLBACK.has(ancestor.parent.callee.property.name),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const overlayMountsClosed = {
|
|
67
|
+
meta: {
|
|
68
|
+
type: "problem",
|
|
69
|
+
docs: {
|
|
70
|
+
description:
|
|
71
|
+
"Disallow an overlay that mounts already open, so its entry and exit transitions run",
|
|
72
|
+
},
|
|
73
|
+
schema: [],
|
|
74
|
+
messages: {
|
|
75
|
+
openFixed:
|
|
76
|
+
"<{{name}}> is given `open` fixed to true, so it only exists while open and neither its fade in nor its fade out runs. Keep it mounted and drive `open` from state.",
|
|
77
|
+
defaultOpen:
|
|
78
|
+
"<{{name}}> mounts open through `defaultOpen`, so its entry never runs. Mount it closed and open it from state.",
|
|
79
|
+
keyPerOpening:
|
|
80
|
+
"<{{name}}> takes a `key` that remounts it, so an opening that changes the key mounts it already open and its fade in never runs. Keep one mounted overlay and reset its content another way, such as a key on the content inside it.",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
create(context) {
|
|
84
|
+
return {
|
|
85
|
+
JSXOpeningElement(node) {
|
|
86
|
+
const name = jsxComponentName(node, context);
|
|
87
|
+
if (!name || !OVERLAY.test(name) || PART.test(name)) return;
|
|
88
|
+
|
|
89
|
+
if (isTrue(attribute(node, "open"))) {
|
|
90
|
+
context.report({ node, messageId: "openFixed", data: { name } });
|
|
91
|
+
}
|
|
92
|
+
if (isTrue(attribute(node, "defaultOpen"))) {
|
|
93
|
+
context.report({ node, messageId: "defaultOpen", data: { name } });
|
|
94
|
+
}
|
|
95
|
+
const key = attribute(node, "key");
|
|
96
|
+
if (key && !isLiteralKey(key) && !insideListCallback(node, context)) {
|
|
97
|
+
context.report({ node, messageId: "keyPerOpening", data: { name } });
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAA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AAc,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-fallback.d.ts","sourceRoot":"","sources":["../../../src/internal/assistant-ui/tool-fallback.tsx"],"names":[],"mappings":"AAUA,OAAO,EAOL,KAAK,4BAA4B,EAClC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAA0C,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-fallback.d.ts","sourceRoot":"","sources":["../../../src/internal/assistant-ui/tool-fallback.tsx"],"names":[],"mappings":"AAUA,OAAO,EAOL,KAAK,4BAA4B,EAClC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAA0C,MAAM,0BAA0B,CAAC;AAO/F,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,EACxC,MAAM,GAAG,cAAc,CACxB,GAAG;IACF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAydF,QAAA,MAAM,YAAY,EAAwC,4BAA4B,CAAC;AAIvF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -5,13 +5,13 @@ import { AlertCircleIcon, CheckIcon, ChevronDownIcon, CircleDotIcon, XCircleIcon
|
|
|
5
5
|
import { useScrollLock, useToolCallElapsed, } from "@assistant-ui/react";
|
|
6
6
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../components/collapsible.js";
|
|
7
7
|
import { cn } from "../../lib/utils.js";
|
|
8
|
+
import { disclosureDuration, disclosureDurationMs } from "../../lib/motion.js";
|
|
8
9
|
import { Button } from "../../components/button.js";
|
|
9
|
-
const ANIMATION_DURATION = 200;
|
|
10
10
|
const pressable = "active:scale-[0.98]";
|
|
11
11
|
function ToolFallbackRoot({ className, open: controlledOpen, onOpenChange: controlledOnOpenChange, defaultOpen = false, children, ...props }) {
|
|
12
12
|
const collapsibleRef = useRef(null);
|
|
13
13
|
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
14
|
-
const lockScroll = useScrollLock(collapsibleRef,
|
|
14
|
+
const lockScroll = useScrollLock(collapsibleRef, disclosureDurationMs);
|
|
15
15
|
const isControlled = controlledOpen !== undefined;
|
|
16
16
|
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
17
17
|
const handleOpenChange = useCallback((open) => {
|
|
@@ -22,7 +22,7 @@ function ToolFallbackRoot({ className, open: controlledOpen, onOpenChange: contr
|
|
|
22
22
|
controlledOnOpenChange?.(open);
|
|
23
23
|
}, [lockScroll, isControlled, controlledOnOpenChange]);
|
|
24
24
|
return (_jsx(Collapsible, { ref: collapsibleRef, "data-slot": "tool-fallback-root", open: isOpen, onOpenChange: handleOpenChange, className: cn("aui-tool-fallback-root group/tool-fallback-root w-full", className), style: {
|
|
25
|
-
"--animation-duration":
|
|
25
|
+
"--animation-duration": disclosureDuration,
|
|
26
26
|
}, ...props, children: children }));
|
|
27
27
|
}
|
|
28
28
|
const statusIconMap = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-group.d.ts","sourceRoot":"","sources":["../../../src/internal/assistant-ui/tool-group.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-group.d.ts","sourceRoot":"","sources":["../../../src/internal/assistant-ui/tool-group.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAI/F,QAAA,MAAM,iBAAiB;;8EASrB,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,EACxC,MAAM,GAAG,cAAc,CACxB,GACC,YAAY,CAAC,OAAO,iBAAiB,CAAC,GAAG;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEJ,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,OAAO,EACP,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,sBAAsB,EACpC,WAAmB,EACnB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,kBAAkB,+BAqCpB;AAED,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,MAAc,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,GAAG;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,+BAwCA;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,+BAyBjD;AAED,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { cva } from "class-variance-authority";
|
|
|
6
6
|
import { useScrollLock } from "@assistant-ui/react";
|
|
7
7
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../components/collapsible.js";
|
|
8
8
|
import { cn } from "../../lib/utils.js";
|
|
9
|
-
|
|
9
|
+
import { disclosureDuration, disclosureDurationMs } from "../../lib/motion.js";
|
|
10
10
|
const toolGroupVariants = cva("aui-tool-group-root group/tool-group w-full", {
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
@@ -20,7 +20,7 @@ const toolGroupVariants = cva("aui-tool-group-root group/tool-group w-full", {
|
|
|
20
20
|
function ToolGroupRoot({ className, variant, open: controlledOpen, onOpenChange: controlledOnOpenChange, defaultOpen = false, children, ...props }) {
|
|
21
21
|
const collapsibleRef = useRef(null);
|
|
22
22
|
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
23
|
-
const lockScroll = useScrollLock(collapsibleRef,
|
|
23
|
+
const lockScroll = useScrollLock(collapsibleRef, disclosureDurationMs);
|
|
24
24
|
const isControlled = controlledOpen !== undefined;
|
|
25
25
|
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
26
26
|
const handleOpenChange = useCallback((open) => {
|
|
@@ -31,7 +31,7 @@ function ToolGroupRoot({ className, variant, open: controlledOpen, onOpenChange:
|
|
|
31
31
|
controlledOnOpenChange?.(open);
|
|
32
32
|
}, [lockScroll, isControlled, controlledOnOpenChange]);
|
|
33
33
|
return (_jsx(Collapsible, { ref: collapsibleRef, "data-slot": "tool-group-root", "data-variant": variant ?? "outline", open: isOpen, onOpenChange: handleOpenChange, className: cn(toolGroupVariants({ variant }), "group/tool-group-root", className), style: {
|
|
34
|
-
"--animation-duration":
|
|
34
|
+
"--animation-duration": disclosureDuration,
|
|
35
35
|
}, ...props, children: children }));
|
|
36
36
|
}
|
|
37
37
|
function ToolGroupTrigger({ count, active = false, className, ...props }) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which of a surface's absence notes an address gets.
|
|
3
|
+
*
|
|
4
|
+
* The choice is a hash of the address, not a draw: the same address always
|
|
5
|
+
* shows the same note, so a reader who reloads is not handed a different one,
|
|
6
|
+
* two readers comparing the same broken link see the same thing, and a test can
|
|
7
|
+
* name the note it expects. FNV-1a over the path, 32-bit, through `Math.imul`
|
|
8
|
+
* so the multiply stays integer.
|
|
9
|
+
*/
|
|
10
|
+
export declare function absenceNoteFor<Note>(path: string, notes: readonly [Note, ...Note[]]): Note;
|
|
11
|
+
//# sourceMappingURL=absence-note.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"absence-note.d.ts","sourceRoot":"","sources":["../../src/lib/absence-note.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAM1F"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which of a surface's absence notes an address gets.
|
|
3
|
+
*
|
|
4
|
+
* The choice is a hash of the address, not a draw: the same address always
|
|
5
|
+
* shows the same note, so a reader who reloads is not handed a different one,
|
|
6
|
+
* two readers comparing the same broken link see the same thing, and a test can
|
|
7
|
+
* name the note it expects. FNV-1a over the path, 32-bit, through `Math.imul`
|
|
8
|
+
* so the multiply stays integer.
|
|
9
|
+
*/
|
|
10
|
+
export function absenceNoteFor(path, notes) {
|
|
11
|
+
let hash = 0x811c9dc5;
|
|
12
|
+
for (let index = 0; index < path.length; index += 1) {
|
|
13
|
+
hash = Math.imul(hash ^ path.charCodeAt(index), 0x01000193) >>> 0;
|
|
14
|
+
}
|
|
15
|
+
return notes[hash % notes.length];
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -36,6 +36,10 @@
|
|
|
36
36
|
"types": "./dist/lib/theme-mode.d.ts",
|
|
37
37
|
"import": "./dist/lib/theme-mode.js"
|
|
38
38
|
},
|
|
39
|
+
"./lib/absence-note": {
|
|
40
|
+
"types": "./dist/lib/absence-note.d.ts",
|
|
41
|
+
"import": "./dist/lib/absence-note.js"
|
|
42
|
+
},
|
|
39
43
|
"./lib/format-token-count": {
|
|
40
44
|
"types": "./dist/lib/format-token-count.d.ts",
|
|
41
45
|
"import": "./dist/lib/format-token-count.js"
|
|
@@ -72,7 +76,7 @@
|
|
|
72
76
|
"@assistant-ui/react": "0.15.21",
|
|
73
77
|
"@assistant-ui/react-markdown": "0.14.16",
|
|
74
78
|
"@base-ui/react": "^1.8.0",
|
|
75
|
-
"@nadicodeai/design-system": "12.1.
|
|
79
|
+
"@nadicodeai/design-system": "12.1.28",
|
|
76
80
|
"class-variance-authority": "^0.7.1",
|
|
77
81
|
"clsx": "^2.1.1",
|
|
78
82
|
"cmdk": "^1.1.1",
|