@cognite/aura 0.1.6 → 0.2.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/DESIGN.md +1211 -0
- package/README.md +24 -0
- package/dist/colors.css +441 -214
- package/dist/components/index.d.ts +17 -1
- package/dist/components/index.js +344 -269
- package/dist/components/ui/core/accordion/accordion.js +22 -22
- package/dist/components/ui/core/alert/alert.d.ts +3 -2
- package/dist/components/ui/core/alert/alert.js +111 -87
- package/dist/components/ui/core/alert/alert.metadata.js +1 -1
- package/dist/components/ui/core/avatar/avatar.js +10 -10
- package/dist/components/ui/core/badge/badge.d.ts +2 -2
- package/dist/components/ui/core/badge/badge.js +13 -13
- package/dist/components/ui/core/banner/banner.d.ts +4 -4
- package/dist/components/ui/core/breadcrumb/breadcrumb.d.ts +11 -0
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +190 -0
- package/dist/components/ui/core/breadcrumb/breadcrumb.metadata.d.ts +2 -0
- package/dist/components/ui/core/breadcrumb/breadcrumb.metadata.js +9 -0
- package/dist/components/ui/core/button/button.d.ts +1 -1
- package/dist/components/ui/core/card/card.d.ts +7 -4
- package/dist/components/ui/core/card/card.js +131 -87
- package/dist/components/ui/core/card/card.metadata.js +1 -1
- package/dist/components/ui/core/checkbox/checkbox.d.ts +13 -0
- package/dist/components/ui/core/checkbox/checkbox.js +129 -0
- package/dist/components/ui/core/checkbox/checkbox.metadata.d.ts +2 -0
- package/dist/components/ui/core/checkbox/checkbox.metadata.js +8 -0
- package/dist/components/ui/core/code-block/code-block.d.ts +5 -1
- package/dist/components/ui/core/code-block/code-block.js +200 -132
- package/dist/components/ui/core/command/command.d.ts +2 -2
- package/dist/components/ui/core/count/count.d.ts +8 -0
- package/dist/components/ui/core/count/count.js +32 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +43 -40
- package/dist/components/ui/core/inline-citation/inline-citation.js +8 -8
- package/dist/components/ui/core/input-group/input-group.d.ts +1 -1
- package/dist/components/ui/core/kbd/kbd.d.ts +3 -0
- package/dist/components/ui/core/kbd/kbd.js +36 -0
- package/dist/components/ui/core/kbd/kbd.metadata.d.ts +2 -0
- package/dist/components/ui/core/kbd/kbd.metadata.js +9 -0
- package/dist/components/ui/core/loader/loader.d.ts +9 -1
- package/dist/components/ui/core/loader/loader.js +106 -107
- package/dist/components/ui/core/loader/loader.metadata.js +2 -2
- package/dist/components/ui/core/popover/popover.d.ts +1 -1
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +1 -1
- package/dist/components/ui/core/radio-group/radio-group.d.ts +16 -0
- package/dist/components/ui/core/radio-group/radio-group.js +110 -0
- package/dist/components/ui/core/radio-group/radio-group.metadata.d.ts +2 -0
- package/dist/components/ui/core/radio-group/radio-group.metadata.js +9 -0
- package/dist/components/ui/core/scroll-area/scroll-area.d.ts +3 -0
- package/dist/components/ui/core/scroll-area/scroll-area.js +71 -0
- package/dist/components/ui/core/scroll-area/scroll-area.metadata.d.ts +2 -0
- package/dist/components/ui/core/scroll-area/scroll-area.metadata.js +9 -0
- package/dist/components/ui/core/segmented-control/segmented-control.d.ts +16 -0
- package/dist/components/ui/core/segmented-control/segmented-control.js +169 -0
- package/dist/components/ui/core/sonner-toast/sonner-toast.d.ts +3 -0
- package/dist/components/ui/core/sonner-toast/sonner-toast.js +48 -0
- package/dist/components/ui/core/sonner-toast/sonner-toast.metadata.d.ts +2 -0
- package/dist/components/ui/core/sonner-toast/sonner-toast.metadata.js +9 -0
- package/dist/components/ui/core/tabs/tabs.d.ts +23 -0
- package/dist/components/ui/core/tabs/tabs.js +222 -0
- package/dist/components/ui/core/tabs/tabs.utils.d.ts +2 -0
- package/dist/components/ui/core/tabs/tabs.utils.js +9 -0
- package/dist/components/ui/core/tool/tool.js +31 -27
- package/dist/components/ui/core/topbar/topbar.d.ts +30 -0
- package/dist/components/ui/core/topbar/topbar.js +190 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +312 -248
- package/dist/lib/utils.d.ts +11 -0
- package/dist/lib/utils.js +40 -29
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +66 -7
- package/package.json +11 -6
package/dist/lib/utils.d.ts
CHANGED
|
@@ -26,6 +26,17 @@ export declare const focusState: "focus-visible:shadow-focus-ring focus-visible:
|
|
|
26
26
|
export declare const invalidState: "aria-invalid:border-destructive-foreground aria-invalid:shadow-focus-ring-destructive aria-invalid:border-transparent aria-invalid:text-foreground aria-invalid:focus-visible:shadow-focus-ring aria-invalid:focus-visible:bg-background aria-invalid:focus-visible:border-transparent aria-invalid:focus-visible:text-foreground outline-none";
|
|
27
27
|
export declare const disabledState: "disabled:bg-disabled-background disabled:border-transparent disabled:text-disabled-foreground disabled:placeholder:text-disabled-foreground disabled:pointer-events-none disabled:cursor-not-allowed";
|
|
28
28
|
export declare const readOnlyState: "read-only:border-transparent read-only:text-muted-foreground read-only:cursor-default read-only:hover:border-transparent read-only:focus-visible:shadow-none read-only:focus-visible:border-transparent read-only:focus-visible:bg-muted-background [&:read-only:not(:placeholder-shown)]:text-muted-foreground";
|
|
29
|
+
/**
|
|
30
|
+
* Reusable styles for selection-control rows (radio group items, checkbox items, etc.).
|
|
31
|
+
* These provide the shared layout, card variant, label, and description classes
|
|
32
|
+
* without baking in a parent group name (ancestor `group-has-[...]/<name>` selectors
|
|
33
|
+
* must stay inline in each consumer so they reference that component's own `group/<name>`).
|
|
34
|
+
*/
|
|
35
|
+
export declare const selectionItemBase: "grid max-w-150 cursor-pointer grid-cols-[auto_1fr] items-start gap-x-2 gap-y-1 has-[[data-disabled]]:cursor-not-allowed";
|
|
36
|
+
export declare const selectionItemDefault: "min-h-9 py-2";
|
|
37
|
+
export declare const selectionItemCard: string;
|
|
38
|
+
export declare const selectionItemLabel: "col-start-2 text-sm font-medium leading-4.5 tracking-normal text-secondary-foreground dark:text-secondary-foreground";
|
|
39
|
+
export declare const selectionItemDescription: "col-start-2 text-xs font-normal leading-3.5 tracking-tightest text-muted-foreground";
|
|
29
40
|
export declare function slugToPascalCase(slug: string): string;
|
|
30
41
|
/**
|
|
31
42
|
* Safely extracts hostname from a URL string.
|
package/dist/lib/utils.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { clsx as u } from "clsx";
|
|
2
2
|
import { codeToHtml as i } from "shiki";
|
|
3
|
-
import { twMerge as
|
|
3
|
+
import { twMerge as b } from "tailwind-merge";
|
|
4
4
|
import d from "./style-scope.js";
|
|
5
5
|
let s = null, l = !1;
|
|
6
|
-
function
|
|
7
|
-
return
|
|
6
|
+
function f(...e) {
|
|
7
|
+
return b(u(e));
|
|
8
8
|
}
|
|
9
|
-
const w = typeof window < "u" && window.__STORYBOOK_TEST__ === !0,
|
|
9
|
+
const w = typeof window < "u" && window.__STORYBOOK_TEST__ === !0, g = {
|
|
10
10
|
name: "strip-pre-styles",
|
|
11
11
|
pre(e) {
|
|
12
12
|
e.properties.style = void 0;
|
|
@@ -32,37 +32,43 @@ const w = typeof window < "u" && window.__STORYBOOK_TEST__ === !0, b = {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
async function x(e, t, r = !1) {
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
const o = [
|
|
36
|
+
g,
|
|
37
37
|
...r ? [p] : []
|
|
38
38
|
];
|
|
39
39
|
return await Promise.all([
|
|
40
40
|
i(e, {
|
|
41
41
|
lang: t,
|
|
42
42
|
theme: "one-light",
|
|
43
|
-
transformers:
|
|
43
|
+
transformers: o
|
|
44
44
|
}),
|
|
45
45
|
i(e, {
|
|
46
46
|
lang: t,
|
|
47
47
|
theme: "one-dark-pro",
|
|
48
|
-
transformers:
|
|
48
|
+
transformers: o
|
|
49
49
|
})
|
|
50
50
|
]);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function k(e) {
|
|
53
53
|
const t = e.trim().split(/\s+/);
|
|
54
54
|
if (t.length === 0 || !t[0])
|
|
55
55
|
return "";
|
|
56
56
|
if (t.length === 1)
|
|
57
57
|
return t[0].slice(0, 2).toUpperCase();
|
|
58
|
-
const r = t[0].charAt(0).toUpperCase(),
|
|
59
|
-
return r +
|
|
58
|
+
const r = t[0].charAt(0).toUpperCase(), o = t[t.length - 1].charAt(0).toUpperCase();
|
|
59
|
+
return r + o;
|
|
60
60
|
}
|
|
61
|
-
const
|
|
62
|
-
|
|
61
|
+
const C = "focus-visible:shadow-focus-ring outline-none", S = "focus-visible:shadow-focus-ring-destructive outline-none", I = "border border-transparent rounded-lg bg-muted-background py-2 pl-2 pr-1 text-sm leading-5 tracking-tight text-muted-foreground placeholder:text-muted-foreground", P = "hover:bg-accent-background hover:border hover:border-border-emphasized", T = "[&:not(:placeholder-shown):not(:focus)]:bg-muted-background [&:not(:placeholder-shown)]:text-foreground", O = "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:shadow-focus-ring-destructive aria-invalid:border-transparent aria-invalid:text-foreground aria-invalid:focus-visible:shadow-focus-ring aria-invalid:focus-visible:bg-background aria-invalid:focus-visible:border-transparent aria-invalid:focus-visible:text-foreground outline-none", U = "disabled:bg-disabled-background disabled:border-transparent disabled:text-disabled-foreground disabled:placeholder:text-disabled-foreground disabled:pointer-events-none disabled:cursor-not-allowed", _ = "read-only:border-transparent read-only:text-muted-foreground read-only:cursor-default read-only:hover:border-transparent read-only:focus-visible:shadow-none read-only:focus-visible:border-transparent read-only:focus-visible:bg-muted-background [&:read-only:not(:placeholder-shown)]:text-muted-foreground", B = "grid max-w-150 cursor-pointer grid-cols-[auto_1fr] items-start gap-x-2 gap-y-1 has-[[data-disabled]]:cursor-not-allowed", E = "min-h-9 py-2", z = f(
|
|
62
|
+
"w-64 rounded-md border border-transparent p-3 bg-card-background",
|
|
63
|
+
"has-[[data-checked]]:bg-active-muted-background",
|
|
64
|
+
"hover:border-border-emphasized hover:bg-accent-background",
|
|
65
|
+
"has-[[data-disabled]]:border-border has-[[data-disabled]]:bg-transparent",
|
|
66
|
+
"has-[[data-disabled]]:hover:border-border has-[[data-disabled]]:hover:bg-transparent"
|
|
67
|
+
), A = "col-start-2 text-sm font-medium leading-4.5 tracking-normal text-secondary-foreground dark:text-secondary-foreground", R = "col-start-2 text-xs font-normal leading-3.5 tracking-tightest text-muted-foreground";
|
|
68
|
+
function j(e) {
|
|
63
69
|
return e.split("-").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join("");
|
|
64
70
|
}
|
|
65
|
-
function
|
|
71
|
+
function D(e) {
|
|
66
72
|
if (!e) return "unknown";
|
|
67
73
|
try {
|
|
68
74
|
return new URL(e).hostname;
|
|
@@ -70,9 +76,9 @@ function A(e) {
|
|
|
70
76
|
return e;
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
|
-
const
|
|
74
|
-
const t = !!(e && Object.keys(e).length > 0), r = e?.id ?? d.portalContainer,
|
|
75
|
-
a.id = r, a.className =
|
|
79
|
+
const H = (e) => {
|
|
80
|
+
const t = !!(e && Object.keys(e).length > 0), r = e?.id ?? d.portalContainer, o = e?.className ?? d.styleScope, c = (a) => {
|
|
81
|
+
a.id = r, a.className = o, a.style.position = e?.style?.position ?? "fixed", a.style.zIndex = e?.style?.zIndex ?? "1000", e?.style && Object.assign(a.style, e.style);
|
|
76
82
|
};
|
|
77
83
|
if (s)
|
|
78
84
|
return t && console.warn(
|
|
@@ -83,24 +89,29 @@ const B = (e) => {
|
|
|
83
89
|
t && !l && (console.warn(
|
|
84
90
|
"Custom portal container props can lead to unintended behavior. Use with caution."
|
|
85
91
|
), l = !0);
|
|
86
|
-
let
|
|
87
|
-
return
|
|
92
|
+
let n = document?.getElementById(r);
|
|
93
|
+
return n || (n = document.createElement("div"), document.body.appendChild(n)), c(n), s = n, n;
|
|
88
94
|
};
|
|
89
95
|
export {
|
|
90
|
-
|
|
96
|
+
f as cn,
|
|
91
97
|
U as disabledState,
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
T as filledState,
|
|
99
|
+
C as focusRing,
|
|
94
100
|
S as focusRingDestructive,
|
|
95
101
|
O as focusState,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
I as formElementBase,
|
|
103
|
+
D as getHostname,
|
|
104
|
+
k as getInitials,
|
|
105
|
+
H as getPortalContainer,
|
|
100
106
|
x as highlightCode,
|
|
101
|
-
|
|
107
|
+
P as hoverState,
|
|
102
108
|
N as invalidState,
|
|
103
109
|
w as isStorybookTestEnv,
|
|
104
|
-
|
|
105
|
-
|
|
110
|
+
_ as readOnlyState,
|
|
111
|
+
B as selectionItemBase,
|
|
112
|
+
z as selectionItemCard,
|
|
113
|
+
E as selectionItemDefault,
|
|
114
|
+
R as selectionItemDescription,
|
|
115
|
+
A as selectionItemLabel,
|
|
116
|
+
j as slugToPascalCase
|
|
106
117
|
};
|