@cognite/aura 0.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/dist/components/index.d.ts +53 -0
- package/dist/components/ui/core/alert/alert.d.ts +19 -0
- package/dist/components/ui/core/alert/alert.js +180 -0
- package/dist/components/ui/core/alert/alert.metadata.d.ts +2 -0
- package/dist/components/ui/core/alert/alert.metadata.js +9 -0
- package/dist/components/ui/core/avatar/avatar.d.ts +10 -0
- package/dist/components/ui/core/avatar/avatar.js +94 -0
- package/dist/components/ui/core/avatar/avatar.metadata.d.ts +8 -0
- package/dist/components/ui/core/avatar/avatar.metadata.js +9 -0
- package/dist/components/ui/core/badge/badge.d.ts +14 -0
- package/dist/components/ui/core/badge/badge.js +116 -0
- package/dist/components/ui/core/badge/badge.metadata.d.ts +2 -0
- package/dist/components/ui/core/badge/badge.metadata.js +8 -0
- package/dist/components/ui/core/button/button.d.ts +9 -0
- package/dist/components/ui/core/button/button.js +50 -0
- package/dist/components/ui/core/button/button.metadata.d.ts +2 -0
- package/dist/components/ui/core/button/button.metadata.js +9 -0
- package/dist/components/ui/core/button-group/button-group.d.ts +11 -0
- package/dist/components/ui/core/button-group/button-group.js +83 -0
- package/dist/components/ui/core/button-group/button-group.metadata.d.ts +2 -0
- package/dist/components/ui/core/button-group/button-group.metadata.js +8 -0
- package/dist/components/ui/core/code-block/code-block.d.ts +21 -0
- package/dist/components/ui/core/code-block/code-block.js +146 -0
- package/dist/components/ui/core/code-block/code-block.metadata.d.ts +2 -0
- package/dist/components/ui/core/code-block/code-block.metadata.js +8 -0
- package/dist/components/ui/core/collapsible/collapsible.d.ts +4 -0
- package/dist/components/ui/core/collapsible/collapsible.js +44 -0
- package/dist/components/ui/core/collapsible/collapsible.metadata.d.ts +2 -0
- package/dist/components/ui/core/collapsible/collapsible.metadata.js +9 -0
- package/dist/components/ui/core/command/command.d.ts +86 -0
- package/dist/components/ui/core/command/command.js +150 -0
- package/dist/components/ui/core/command/command.metadata.d.ts +2 -0
- package/dist/components/ui/core/command/command.metadata.js +9 -0
- package/dist/components/ui/core/dialog/dialog.d.ts +18 -0
- package/dist/components/ui/core/dialog/dialog.js +155 -0
- package/dist/components/ui/core/dialog/dialog.metadata.d.ts +2 -0
- package/dist/components/ui/core/dialog/dialog.metadata.js +9 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +53 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +250 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.d.ts +2 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.js +9 -0
- package/dist/components/ui/core/helper-text/helper-text.d.ts +12 -0
- package/dist/components/ui/core/helper-text/helper-text.js +65 -0
- package/dist/components/ui/core/helper-text/helper-text.metadata.d.ts +2 -0
- package/dist/components/ui/core/helper-text/helper-text.metadata.js +9 -0
- package/dist/components/ui/core/hover-card/hover-card.d.ts +12 -0
- package/dist/components/ui/core/hover-card/hover-card.js +76 -0
- package/dist/components/ui/core/hover-card/hover-card.metadata.d.ts +2 -0
- package/dist/components/ui/core/hover-card/hover-card.metadata.js +8 -0
- package/dist/components/ui/core/inline-citation/inline-citation.d.ts +33 -0
- package/dist/components/ui/core/inline-citation/inline-citation.js +170 -0
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.d.ts +2 -0
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.js +8 -0
- package/dist/components/ui/core/input/input.d.ts +6 -0
- package/dist/components/ui/core/input/input.js +34 -0
- package/dist/components/ui/core/input/input.metadata.d.ts +2 -0
- package/dist/components/ui/core/input/input.metadata.js +9 -0
- package/dist/components/ui/core/input-group/input-group.d.ts +15 -0
- package/dist/components/ui/core/input-group/input-group.js +144 -0
- package/dist/components/ui/core/input-group/input-group.metadata.d.ts +2 -0
- package/dist/components/ui/core/input-group/input-group.metadata.js +9 -0
- package/dist/components/ui/core/label/label.d.ts +2 -0
- package/dist/components/ui/core/label/label.js +20 -0
- package/dist/components/ui/core/label/label.metadata.d.ts +2 -0
- package/dist/components/ui/core/label/label.metadata.js +9 -0
- package/dist/components/ui/core/loader/loader.d.ts +7 -0
- package/dist/components/ui/core/loader/loader.js +119 -0
- package/dist/components/ui/core/loader/loader.metadata.d.ts +2 -0
- package/dist/components/ui/core/loader/loader.metadata.js +9 -0
- package/dist/components/ui/core/message/message.d.ts +55 -0
- package/dist/components/ui/core/message/message.js +169 -0
- package/dist/components/ui/core/message/message.metadata.d.ts +2 -0
- package/dist/components/ui/core/popover/popover.d.ts +8 -0
- package/dist/components/ui/core/popover/popover.metadata.d.ts +2 -0
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +161 -0
- package/dist/components/ui/core/prompt-input/prompt-input.js +402 -0
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.d.ts +2 -0
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.js +9 -0
- package/dist/components/ui/core/reasoning/reasoning.d.ts +9 -0
- package/dist/components/ui/core/reasoning/reasoning.js +85 -0
- package/dist/components/ui/core/reasoning/reasoning.metadata.d.ts +2 -0
- package/dist/components/ui/core/reasoning/reasoning.metadata.js +8 -0
- package/dist/components/ui/core/select/select.d.ts +44 -0
- package/dist/components/ui/core/select/select.js +279 -0
- package/dist/components/ui/core/select/select.metadata.d.ts +2 -0
- package/dist/components/ui/core/select/select.metadata.js +9 -0
- package/dist/components/ui/core/separator/separator.d.ts +6 -0
- package/dist/components/ui/core/separator/separator.js +25 -0
- package/dist/components/ui/core/separator/separator.metadata.d.ts +2 -0
- package/dist/components/ui/core/separator/separator.metadata.js +8 -0
- package/dist/components/ui/core/shimmer/shimmer.d.ts +14 -0
- package/dist/components/ui/core/shimmer/shimmer.js +69 -0
- package/dist/components/ui/core/shimmer/shimmer.metadata.d.ts +2 -0
- package/dist/components/ui/core/shimmer/shimmer.metadata.js +9 -0
- package/dist/components/ui/core/skeleton/skeleton.d.ts +2 -0
- package/dist/components/ui/core/skeleton/skeleton.js +18 -0
- package/dist/components/ui/core/skeleton/skeleton.metadata.d.ts +2 -0
- package/dist/components/ui/core/skeleton/skeleton.metadata.js +9 -0
- package/dist/components/ui/core/sources/sources.d.ts +16 -0
- package/dist/components/ui/core/sources/sources.metadata.d.ts +2 -0
- package/dist/components/ui/core/textarea/textarea.d.ts +9 -0
- package/dist/components/ui/core/textarea/textarea.js +49 -0
- package/dist/components/ui/core/textarea/textarea.metadata.d.ts +2 -0
- package/dist/components/ui/core/textarea/textarea.metadata.js +9 -0
- package/dist/components/ui/core/tool/tool.d.ts +21 -0
- package/dist/components/ui/core/tool/tool.js +151 -0
- package/dist/components/ui/core/tool/tool.metadata.d.ts +2 -0
- package/dist/components/ui/core/tool/tool.metadata.js +8 -0
- package/dist/components/ui/core/tooltip/tooltip.d.ts +10 -0
- package/dist/components/ui/core/tooltip/tooltip.js +82 -0
- package/dist/components/ui/core/tooltip/tooltip.metadata.d.ts +8 -0
- package/dist/components/ui/core/tooltip/tooltip.metadata.js +9 -0
- package/dist/components/ui/lab/breadcrumb/breadcrumb.d.ts +134 -0
- package/dist/components/ui/lab/breadcrumb/breadcrumb.metadata.d.ts +2 -0
- package/dist/components/ui/lab/topbar/topbar.d.ts +10 -0
- package/dist/components/ui/lab/topbar/topbar.metadata.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +229 -0
- package/dist/lib/ai/types.d.ts +53 -0
- package/dist/lib/component-status-config.d.ts +12 -0
- package/dist/lib/style-scope.d.ts +5 -0
- package/dist/lib/style-scope.js +7 -0
- package/dist/lib/types.d.ts +50 -0
- package/dist/lib/use-controllable-state.d.ts +11 -0
- package/dist/lib/use-controllable-state.js +32 -0
- package/dist/lib/utils.d.ts +45 -0
- package/dist/lib/utils.js +92 -0
- package/package.json +51 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type ChatStatus = 'submitted' | 'streaming' | 'ready' | 'error';
|
|
2
|
+
export type TextUIPart = {
|
|
3
|
+
type: 'text';
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
export type FileUIPart = {
|
|
7
|
+
type: 'file';
|
|
8
|
+
/**
|
|
9
|
+
* IANA media type of the file.
|
|
10
|
+
*/
|
|
11
|
+
mediaType: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional filename of the file.
|
|
14
|
+
*/
|
|
15
|
+
filename?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The URL of the file.
|
|
18
|
+
* It can either be a URL to a hosted file or a Data URL.
|
|
19
|
+
*/
|
|
20
|
+
url: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Simplified ToolUIPart type for basic tool rendering.
|
|
24
|
+
* Full type in AI SDK is more complex with generics and state management.
|
|
25
|
+
*/
|
|
26
|
+
export type ToolUIPart = {
|
|
27
|
+
type: string;
|
|
28
|
+
toolCallId?: string;
|
|
29
|
+
toolName?: string;
|
|
30
|
+
input?: unknown;
|
|
31
|
+
output?: unknown;
|
|
32
|
+
errorText?: string;
|
|
33
|
+
state?: 'input-streaming' | 'input-available' | 'output-available' | 'output-error';
|
|
34
|
+
};
|
|
35
|
+
export type MessageUIPart = TextUIPart | FileUIPart | ToolUIPart;
|
|
36
|
+
export interface UIMessage<METADATA = unknown> {
|
|
37
|
+
/**
|
|
38
|
+
* A unique identifier for the message.
|
|
39
|
+
*/
|
|
40
|
+
id: string;
|
|
41
|
+
/**
|
|
42
|
+
* The role of the message.
|
|
43
|
+
*/
|
|
44
|
+
role: 'system' | 'user' | 'assistant';
|
|
45
|
+
/**
|
|
46
|
+
* The metadata of the message.
|
|
47
|
+
*/
|
|
48
|
+
metadata?: METADATA;
|
|
49
|
+
/**
|
|
50
|
+
* The parts of the message. Use this for rendering the message in the UI.
|
|
51
|
+
*/
|
|
52
|
+
parts: Array<MessageUIPart>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StatusConfig, ComponentStatusType } from './types';
|
|
2
|
+
export declare const STATUS_CONFIG: Record<ComponentStatusType, StatusConfig>;
|
|
3
|
+
/**
|
|
4
|
+
* Get the configuration for a specific status type.
|
|
5
|
+
* Falls back to 'draft' if status is not recognized.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getStatusConfig(status: ComponentStatusType): StatusConfig;
|
|
8
|
+
/**
|
|
9
|
+
* Get inline styles for a status badge that work in both light and dark modes.
|
|
10
|
+
* Uses CSS custom properties for dark mode support.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getStatusStyles(status: ComponentStatusType, isDark?: boolean): React.CSSProperties;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface ComponentExample {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
component: React.ComponentType;
|
|
5
|
+
code: string;
|
|
6
|
+
tags?: string[];
|
|
7
|
+
difficulty?: 'beginner' | 'intermediate' | 'advanced';
|
|
8
|
+
notes?: string;
|
|
9
|
+
category?: 'usage' | 'variants' | 'advanced';
|
|
10
|
+
}
|
|
11
|
+
export type ComponentExamples = Record<string, ComponentExample>;
|
|
12
|
+
export interface PropDefinition {
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
default?: string;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
description: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ComponentMeta {
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
/** Component status - defaults to 'draft' if not specified */
|
|
23
|
+
status?: ComponentStatusType;
|
|
24
|
+
llmUsage?: string;
|
|
25
|
+
importPath?: string;
|
|
26
|
+
apiReference?: {
|
|
27
|
+
props: PropDefinition[];
|
|
28
|
+
};
|
|
29
|
+
relatedComponents?: string[];
|
|
30
|
+
notes?: string[];
|
|
31
|
+
codeExamples?: CodeExample[];
|
|
32
|
+
}
|
|
33
|
+
export interface CodeExample {
|
|
34
|
+
/** Title of the code example */
|
|
35
|
+
title: string;
|
|
36
|
+
/** Optional description */
|
|
37
|
+
description?: string;
|
|
38
|
+
/** The actual code string */
|
|
39
|
+
code: string;
|
|
40
|
+
}
|
|
41
|
+
export type ComponentStatusType = 'deprecated' | 'planned' | 'shadcn-ui' | 'experimental' | 'draft' | 'in-progress-storybook' | 'in-progress-code-review' | 'in-progress-chromatic' | 'in-progress-design-conformance' | 'ready-for-ga' | 'stable';
|
|
42
|
+
export interface StatusConfig {
|
|
43
|
+
label: string;
|
|
44
|
+
color: string;
|
|
45
|
+
colorDark: string;
|
|
46
|
+
bgColor: string;
|
|
47
|
+
bgColorDark: string;
|
|
48
|
+
borderColor: string;
|
|
49
|
+
borderColorDark: string;
|
|
50
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type UseControllableStateParams<T> = {
|
|
2
|
+
prop?: T;
|
|
3
|
+
defaultProp: T;
|
|
4
|
+
onChange?: (next: T) => void;
|
|
5
|
+
};
|
|
6
|
+
type SetStateAction<T> = T | ((prev: T) => T);
|
|
7
|
+
export declare function useControllableState<T>({ prop, defaultProp, onChange, }: UseControllableStateParams<T>): readonly [
|
|
8
|
+
T,
|
|
9
|
+
(next: SetStateAction<T>) => void
|
|
10
|
+
];
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
function l(e) {
|
|
3
|
+
return typeof e == "function";
|
|
4
|
+
}
|
|
5
|
+
function R({
|
|
6
|
+
prop: e,
|
|
7
|
+
defaultProp: a,
|
|
8
|
+
onChange: r
|
|
9
|
+
}) {
|
|
10
|
+
const [f, i] = o.useState(a), u = e !== void 0, d = u ? e : f, n = o.useRef(r);
|
|
11
|
+
o.useEffect(() => {
|
|
12
|
+
n.current = r;
|
|
13
|
+
}, [r]);
|
|
14
|
+
const v = o.useCallback(
|
|
15
|
+
(t) => {
|
|
16
|
+
if (u) {
|
|
17
|
+
const s = l(t) ? t(e) : t;
|
|
18
|
+
n.current?.(s);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
i((s) => {
|
|
22
|
+
const c = l(t) ? t(s) : t;
|
|
23
|
+
return n.current?.(c), c;
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
[u, e]
|
|
27
|
+
);
|
|
28
|
+
return [d, v];
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
R as useControllableState
|
|
32
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import { BundledLanguage } from 'shiki';
|
|
3
|
+
type PortalContainerOptions = {
|
|
4
|
+
id?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
7
|
+
};
|
|
8
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
9
|
+
export declare const isStorybookTestEnv: boolean;
|
|
10
|
+
export declare function highlightCode(code: string, language: BundledLanguage, showLineNumbers?: boolean): Promise<[string, string]>;
|
|
11
|
+
export declare function getInitials(name: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Focus rings for non-form interactive elements (buttons, etc.).
|
|
14
|
+
* These provide only the shadow-based focus ring without background/border changes.
|
|
15
|
+
*/
|
|
16
|
+
export declare const focusRing: "focus-visible:shadow-focus-ring outline-none";
|
|
17
|
+
export declare const focusRingDestructive: "focus-visible:shadow-focus-ring-destructive outline-none";
|
|
18
|
+
/**
|
|
19
|
+
* Reusable form element state Tailwind classes.
|
|
20
|
+
* Import these to maintain consistent styling across all form components.
|
|
21
|
+
*/
|
|
22
|
+
export declare const formElementBase: "rounded-md border border-border bg-background p-1.75 text-base leading-5 tracking-tightest text-muted-foreground";
|
|
23
|
+
export declare const hoverState: "hover:bg-accent hover:text-accent-foreground";
|
|
24
|
+
export declare const filledState: "filled:bg-background filled:border-border filled:text-foreground";
|
|
25
|
+
export declare const focusState: "focus-visible:shadow-focus-ring focus-visible:bg-background focus-visible:border-transparent focus-visible:text-foreground outline-none";
|
|
26
|
+
export declare const invalidState: "aria-invalid:border-destructive-foreground aria-invalid:focus-visible:shadow-focus-ring-destructive aria-invalid:focus-visible:border-transparent aria-invalid:focus-visible:text-foreground outline-none";
|
|
27
|
+
export declare const disabledState: "disabled:bg-disabled disabled:border-transparent disabled:text-disabled-foreground disabled:pointer-events-none disabled:cursor-not-allowed";
|
|
28
|
+
export declare const readOnlyState: "read-only:border-transparent read-only:text-foreground read-only:cursor-default read-only:hover:border-transparent read-only:focus-visible:shadow-none read-only:focus-visible:border-transparent";
|
|
29
|
+
export declare function slugToPascalCase(slug: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Safely extracts hostname from a URL string.
|
|
32
|
+
* Returns the hostname if valid, otherwise returns the original string or "unknown".
|
|
33
|
+
*
|
|
34
|
+
* @param url - URL string to extract hostname from (optional)
|
|
35
|
+
* @returns The hostname, original string, or "unknown" if url is undefined
|
|
36
|
+
*/
|
|
37
|
+
export declare function getHostname(url: string | undefined): string;
|
|
38
|
+
/**
|
|
39
|
+
* Gets or creates the portal container for portalled UI components.
|
|
40
|
+
* Container is created in document.body to avoid positioning issues
|
|
41
|
+
* from the shell app's container query context.
|
|
42
|
+
* The result is cached to avoid side effects on subsequent calls during React renders.
|
|
43
|
+
*/
|
|
44
|
+
export declare const getPortalContainer: (options?: PortalContainerOptions) => HTMLElement | undefined;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { clsx as u } from "clsx";
|
|
2
|
+
import { codeToHtml as a } from "shiki";
|
|
3
|
+
import { twMerge as f } from "tailwind-merge";
|
|
4
|
+
import d from "./style-scope.js";
|
|
5
|
+
let s = null, l = !1;
|
|
6
|
+
function y(...e) {
|
|
7
|
+
return f(u(e));
|
|
8
|
+
}
|
|
9
|
+
const w = typeof window < "u" && window.__STORYBOOK_TEST__ === !0, b = {
|
|
10
|
+
name: "strip-pre-styles",
|
|
11
|
+
pre(e) {
|
|
12
|
+
e.properties.style = void 0;
|
|
13
|
+
}
|
|
14
|
+
}, p = {
|
|
15
|
+
name: "line-numbers",
|
|
16
|
+
line(e, o) {
|
|
17
|
+
e.children.unshift({
|
|
18
|
+
type: "element",
|
|
19
|
+
tagName: "span",
|
|
20
|
+
properties: {
|
|
21
|
+
className: [
|
|
22
|
+
"inline-block",
|
|
23
|
+
"min-w-10",
|
|
24
|
+
"mr-4",
|
|
25
|
+
"text-right",
|
|
26
|
+
"select-none",
|
|
27
|
+
"text-muted-foreground"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
children: [{ type: "text", value: String(o) }]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
async function x(e, o, n = !1) {
|
|
35
|
+
const r = [
|
|
36
|
+
b,
|
|
37
|
+
...n ? [p] : []
|
|
38
|
+
];
|
|
39
|
+
return await Promise.all([
|
|
40
|
+
a(e, {
|
|
41
|
+
lang: o,
|
|
42
|
+
theme: "one-light",
|
|
43
|
+
transformers: r
|
|
44
|
+
}),
|
|
45
|
+
a(e, {
|
|
46
|
+
lang: o,
|
|
47
|
+
theme: "one-dark-pro",
|
|
48
|
+
transformers: r
|
|
49
|
+
})
|
|
50
|
+
]);
|
|
51
|
+
}
|
|
52
|
+
const C = "focus-visible:shadow-focus-ring outline-none", S = "focus-visible:shadow-focus-ring-destructive outline-none", k = "rounded-md border border-border bg-background p-1.75 text-base leading-5 tracking-tightest text-muted-foreground", P = "hover:bg-accent hover:text-accent-foreground", T = "filled:bg-background filled:border-border filled:text-foreground", E = "focus-visible:shadow-focus-ring focus-visible:bg-background focus-visible:border-transparent focus-visible:text-foreground outline-none", N = "aria-invalid:border-destructive-foreground aria-invalid:focus-visible:shadow-focus-ring-destructive aria-invalid:focus-visible:border-transparent aria-invalid:focus-visible:text-foreground outline-none", O = "disabled:bg-disabled disabled:border-transparent disabled:text-disabled-foreground disabled:pointer-events-none disabled:cursor-not-allowed", _ = "read-only:border-transparent read-only:text-foreground read-only:cursor-default read-only:hover:border-transparent read-only:focus-visible:shadow-none read-only:focus-visible:border-transparent";
|
|
53
|
+
function B(e) {
|
|
54
|
+
if (!e) return "unknown";
|
|
55
|
+
try {
|
|
56
|
+
return new URL(e).hostname;
|
|
57
|
+
} catch {
|
|
58
|
+
return e;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const R = (e) => {
|
|
62
|
+
const o = !!e, n = d.portalContainer, r = d.styleScope, c = (i) => {
|
|
63
|
+
i.id = n, i.className = r, i.style.position = "fixed", i.style.zIndex = "1000";
|
|
64
|
+
};
|
|
65
|
+
if (s)
|
|
66
|
+
return o && console.warn(
|
|
67
|
+
"getPortalContainer: Portal container already exists. Custom options will be ignored to prevent side effects."
|
|
68
|
+
), s;
|
|
69
|
+
if (typeof window > "u")
|
|
70
|
+
return;
|
|
71
|
+
o && !l && (console.warn(
|
|
72
|
+
"Custom portal container props can lead to unintended behavior. Use with caution."
|
|
73
|
+
), l = !0);
|
|
74
|
+
let t = document?.getElementById(n);
|
|
75
|
+
return t || (t = document.createElement("div"), document.body.appendChild(t)), c(t), s = t, t;
|
|
76
|
+
};
|
|
77
|
+
export {
|
|
78
|
+
y as cn,
|
|
79
|
+
O as disabledState,
|
|
80
|
+
T as filledState,
|
|
81
|
+
C as focusRing,
|
|
82
|
+
S as focusRingDestructive,
|
|
83
|
+
E as focusState,
|
|
84
|
+
k as formElementBase,
|
|
85
|
+
B as getHostname,
|
|
86
|
+
R as getPortalContainer,
|
|
87
|
+
x as highlightCode,
|
|
88
|
+
P as hoverState,
|
|
89
|
+
N as invalidState,
|
|
90
|
+
w as isStorybookTestEnv,
|
|
91
|
+
_ as readOnlyState
|
|
92
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cognite/aura",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./components": {
|
|
7
|
+
"@fusion/source": "./src/components/index.ts",
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts"
|
|
10
|
+
},
|
|
11
|
+
"./styles.css": {
|
|
12
|
+
"@fusion/source": "./src/styles.css",
|
|
13
|
+
"default": "./src/styles.css"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@base-ui/react": "^1.1.0",
|
|
21
|
+
"@tabler/icons-react": "^3.35.0",
|
|
22
|
+
"class-variance-authority": "^0.7.1",
|
|
23
|
+
"clsx": "^2.1.1",
|
|
24
|
+
"cmdk": "^1.1.1",
|
|
25
|
+
"framer-motion": "^11.0.3",
|
|
26
|
+
"shiki": "^3.19.0",
|
|
27
|
+
"streamdown": "^1.6.10",
|
|
28
|
+
"tailwind-merge": "^3.4.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@storybook/addon-docs": "10.2.4",
|
|
32
|
+
"@storybook/addon-vitest": "10.2.4",
|
|
33
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
34
|
+
"@testing-library/react": "16.0.1",
|
|
35
|
+
"@types/react": "18.3.14",
|
|
36
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
37
|
+
"@vitest/browser": "^4.0.18",
|
|
38
|
+
"@vitest/browser-playwright": "^4.0.18",
|
|
39
|
+
"tailwindcss": "^4.1.17",
|
|
40
|
+
"tw-animate-css": "^1.4.0",
|
|
41
|
+
"typescript": "5.8.3",
|
|
42
|
+
"vite-plugin-dts": "^4.5.4"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": "^18.3.1"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"registry:build": "node --loader @swc-node/register/esm scripts/build-registry.ts && npx --yes shadcn@3.8.2 build",
|
|
49
|
+
"registry:clean": "node -e \"const fs=require('node:fs');fs.rmSync('public/r',{recursive:true,force:true});fs.mkdirSync('public/r',{recursive:true});\""
|
|
50
|
+
}
|
|
51
|
+
}
|