@almanaclabs/blaze-ui 0.10.0 → 0.12.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.
Files changed (106) hide show
  1. package/dist/components/app-shell/app-shell.d.ts +90 -0
  2. package/dist/components/app-shell/app-shell.d.ts.map +1 -0
  3. package/dist/components/app-shell/app-shell.js +149 -0
  4. package/dist/components/app-shell/index.d.ts +2 -0
  5. package/dist/components/app-shell/index.d.ts.map +1 -0
  6. package/dist/components/approval-card/approval-card.d.ts +19 -0
  7. package/dist/components/approval-card/approval-card.d.ts.map +1 -0
  8. package/dist/components/approval-card/approval-card.js +42 -0
  9. package/dist/components/approval-card/index.d.ts +2 -0
  10. package/dist/components/approval-card/index.d.ts.map +1 -0
  11. package/dist/components/badge/badge.d.ts +1 -1
  12. package/dist/components/chat-bar/chat-bar.d.ts +26 -0
  13. package/dist/components/chat-bar/chat-bar.d.ts.map +1 -0
  14. package/dist/components/chat-bar/chat-bar.js +58 -0
  15. package/dist/components/chat-bar/index.d.ts +2 -0
  16. package/dist/components/chat-bar/index.d.ts.map +1 -0
  17. package/dist/components/dense-table/dense-table.d.ts +36 -0
  18. package/dist/components/dense-table/dense-table.d.ts.map +1 -0
  19. package/dist/components/dense-table/dense-table.js +41 -0
  20. package/dist/components/dense-table/index.d.ts +2 -0
  21. package/dist/components/dense-table/index.d.ts.map +1 -0
  22. package/dist/components/editable-text/editable-text.d.ts +26 -0
  23. package/dist/components/editable-text/editable-text.d.ts.map +1 -0
  24. package/dist/components/editable-text/editable-text.js +82 -0
  25. package/dist/components/editable-text/index.d.ts +2 -0
  26. package/dist/components/editable-text/index.d.ts.map +1 -0
  27. package/dist/components/face-stack-button/face-stack-button.d.ts +31 -0
  28. package/dist/components/face-stack-button/face-stack-button.d.ts.map +1 -0
  29. package/dist/components/face-stack-button/face-stack-button.js +47 -0
  30. package/dist/components/face-stack-button/index.d.ts +2 -0
  31. package/dist/components/face-stack-button/index.d.ts.map +1 -0
  32. package/dist/components/filter-chips/filter-chips.d.ts +23 -0
  33. package/dist/components/filter-chips/filter-chips.d.ts.map +1 -0
  34. package/dist/components/filter-chips/filter-chips.js +34 -0
  35. package/dist/components/filter-chips/index.d.ts +2 -0
  36. package/dist/components/filter-chips/index.d.ts.map +1 -0
  37. package/dist/components/goal-card/goal-card.d.ts +51 -0
  38. package/dist/components/goal-card/goal-card.d.ts.map +1 -0
  39. package/dist/components/goal-card/goal-card.js +109 -0
  40. package/dist/components/goal-card/index.d.ts +2 -0
  41. package/dist/components/goal-card/index.d.ts.map +1 -0
  42. package/dist/components/input-group/input-group.d.ts +1 -1
  43. package/dist/components/item/item.d.ts +1 -1
  44. package/dist/components/item/item.d.ts.map +1 -1
  45. package/dist/components/item/item.js +3 -2
  46. package/dist/components/media-thumbnail/index.d.ts +2 -0
  47. package/dist/components/media-thumbnail/index.d.ts.map +1 -0
  48. package/dist/components/media-thumbnail/media-thumbnail.d.ts +21 -0
  49. package/dist/components/media-thumbnail/media-thumbnail.d.ts.map +1 -0
  50. package/dist/components/media-thumbnail/media-thumbnail.js +50 -0
  51. package/dist/components/metric-tile/index.d.ts +2 -0
  52. package/dist/components/metric-tile/index.d.ts.map +1 -0
  53. package/dist/components/metric-tile/metric-tile.d.ts +34 -0
  54. package/dist/components/metric-tile/metric-tile.d.ts.map +1 -0
  55. package/dist/components/metric-tile/metric-tile.js +75 -0
  56. package/dist/components/page-header/index.d.ts +2 -0
  57. package/dist/components/page-header/index.d.ts.map +1 -0
  58. package/dist/components/page-header/page-header.d.ts +16 -0
  59. package/dist/components/page-header/page-header.d.ts.map +1 -0
  60. package/dist/components/page-header/page-header.js +38 -0
  61. package/dist/components/platform-avatar/index.d.ts +2 -0
  62. package/dist/components/platform-avatar/index.d.ts.map +1 -0
  63. package/dist/components/platform-avatar/platform-avatar.d.ts +23 -0
  64. package/dist/components/platform-avatar/platform-avatar.d.ts.map +1 -0
  65. package/dist/components/platform-avatar/platform-avatar.js +54 -0
  66. package/dist/components/platform-icon/index.d.ts +2 -0
  67. package/dist/components/platform-icon/index.d.ts.map +1 -0
  68. package/dist/components/platform-icon/platform-icon.d.ts +38 -0
  69. package/dist/components/platform-icon/platform-icon.d.ts.map +1 -0
  70. package/dist/components/platform-icon/platform-icon.js +272 -0
  71. package/dist/components/sidebar/sidebar.js +19 -19
  72. package/dist/components/signal-strip/index.d.ts +2 -0
  73. package/dist/components/signal-strip/index.d.ts.map +1 -0
  74. package/dist/components/signal-strip/signal-strip.d.ts +34 -0
  75. package/dist/components/signal-strip/signal-strip.d.ts.map +1 -0
  76. package/dist/components/signal-strip/signal-strip.js +84 -0
  77. package/dist/components/source-avatar/index.d.ts +2 -0
  78. package/dist/components/source-avatar/index.d.ts.map +1 -0
  79. package/dist/components/source-avatar/source-avatar.d.ts +16 -0
  80. package/dist/components/source-avatar/source-avatar.d.ts.map +1 -0
  81. package/dist/components/source-avatar/source-avatar.js +15 -0
  82. package/dist/components/stacked-bar-chart/index.d.ts +2 -0
  83. package/dist/components/stacked-bar-chart/index.d.ts.map +1 -0
  84. package/dist/components/stacked-bar-chart/stacked-bar-chart.d.ts +80 -0
  85. package/dist/components/stacked-bar-chart/stacked-bar-chart.d.ts.map +1 -0
  86. package/dist/components/stacked-bar-chart/stacked-bar-chart.js +240 -0
  87. package/dist/components/state-banner/index.d.ts +2 -0
  88. package/dist/components/state-banner/index.d.ts.map +1 -0
  89. package/dist/components/state-banner/state-banner.d.ts +32 -0
  90. package/dist/components/state-banner/state-banner.d.ts.map +1 -0
  91. package/dist/components/state-banner/state-banner.js +70 -0
  92. package/dist/components/status-indicator/index.d.ts +2 -0
  93. package/dist/components/status-indicator/index.d.ts.map +1 -0
  94. package/dist/components/status-indicator/status-indicator.d.ts +21 -0
  95. package/dist/components/status-indicator/status-indicator.d.ts.map +1 -0
  96. package/dist/components/status-indicator/status-indicator.js +30 -0
  97. package/dist/components/suggest-chips/index.d.ts +2 -0
  98. package/dist/components/suggest-chips/index.d.ts.map +1 -0
  99. package/dist/components/suggest-chips/suggest-chips.d.ts +13 -0
  100. package/dist/components/suggest-chips/suggest-chips.d.ts.map +1 -0
  101. package/dist/components/suggest-chips/suggest-chips.js +24 -0
  102. package/dist/index.d.ts +20 -1
  103. package/dist/index.d.ts.map +1 -1
  104. package/dist/index.js +68 -49
  105. package/package.json +1 -1
  106. package/src/styles/globals.css +40 -0
@@ -0,0 +1,90 @@
1
+ import * as React from 'react';
2
+ type AppShellProps = React.ComponentProps<'div'> & {
3
+ /** The left column, usually an `AppSidebar`. It spans both rows. */
4
+ sidebar?: React.ReactNode;
5
+ /** The top row right of the sidebar, usually an `AppTopBar`. */
6
+ topBar?: React.ReactNode;
7
+ /** Classes for the white main panel. */
8
+ mainClassName?: string;
9
+ };
10
+ /**
11
+ * The application frame: a 188px sidebar column, a 56px top bar row, and the page in a white panel on the canvas.
12
+ * The panel is positioned, so a `ChatBar` or other floating element can sit inside it.
13
+ */
14
+ declare function AppShell({ sidebar, topBar, mainClassName, className, children, ...props }: AppShellProps): React.JSX.Element;
15
+ type AppTopBarProps = React.ComponentProps<'header'> & {
16
+ /** Content at the end of the bar, such as the account avatar. */
17
+ end?: React.ReactNode;
18
+ };
19
+ /** The header row right of the sidebar. `children` fill the start; `end` sits at the right. */
20
+ declare function AppTopBar({ end, className, children, ...props }: AppTopBarProps): React.JSX.Element;
21
+ type AppSidebarIcon = React.ComponentType<{
22
+ 'aria-hidden'?: boolean | 'true' | 'false';
23
+ className?: string;
24
+ }>;
25
+ type AppSidebarItem = {
26
+ /** Unique within the sidebar; compared with `activeId`. */
27
+ id: string;
28
+ label: React.ReactNode;
29
+ icon?: AppSidebarIcon;
30
+ /** Something waiting for the owner. Shown as a count pill when above zero. */
31
+ count?: number;
32
+ /** Render the row as a link. */
33
+ href?: string;
34
+ onSelect?: () => void;
35
+ };
36
+ type AppSidebarSection = {
37
+ id: string;
38
+ /** The group label. Leave it out for an unlabelled group. */
39
+ label?: React.ReactNode;
40
+ items: readonly AppSidebarItem[];
41
+ };
42
+ type AppSidebarProps = Omit<React.ComponentProps<'aside'>, 'onSelect'> & {
43
+ /** The workspace switcher at the top, usually an `AppSidebarWorkspace`. */
44
+ workspace?: React.ReactNode;
45
+ /**
46
+ * The plain "New" row. It leads the first section when that section has no label, and otherwise sits in its own
47
+ * group. Its icon defaults to a plus.
48
+ */
49
+ newItem?: Omit<AppSidebarItem, 'icon' | 'count'> & {
50
+ icon?: AppSidebarIcon;
51
+ };
52
+ sections: readonly AppSidebarSection[];
53
+ /** The group pinned to the bottom, such as settings. */
54
+ bottomItems?: readonly AppSidebarItem[];
55
+ /** The id of the current page. */
56
+ activeId?: string;
57
+ /** Called with the item whenever a row is picked, after the item's own `onSelect`. */
58
+ onNavigate?: (item: AppSidebarItem) => void;
59
+ /** The navigation landmark's name. */
60
+ navLabel?: string;
61
+ /**
62
+ * Renders a row that has an `href`, for a router's own link (an Inertia or Next `Link`, say). Return the element
63
+ * with its `href` set; the row merges its classes, state and click handler onto it. Defaults to a plain `<a>`.
64
+ */
65
+ renderLink?: AppSidebarRenderLink;
66
+ };
67
+ /** Builds the link element for a sidebar row with an `href`. */
68
+ type AppSidebarRenderLink = (item: AppSidebarItem & {
69
+ href: string;
70
+ }) => React.ReactElement;
71
+ /**
72
+ * The application's left navigation: a workspace switcher, a plain "New" row, labelled sections of destinations with
73
+ * optional counts, and a group pinned to the bottom. The current destination is the raised white row.
74
+ */
75
+ declare function AppSidebar({ workspace, newItem, sections, bottomItems, activeId, onNavigate, navLabel, renderLink, className, ...props }: AppSidebarProps): React.JSX.Element;
76
+ type AppSidebarWorkspaceProps = {
77
+ /** The workspace or business name. */
78
+ name: string;
79
+ /** The workspace's logo, usually an `<img alt="">`. Shown at 32px. */
80
+ logo?: React.ReactNode;
81
+ /** The menu's items, such as `DropdownMenuItem`s for each workspace and "New workspace". */
82
+ children?: React.ReactNode;
83
+ /** The trigger's accessible name. Defaults to "Open workspace menu for <name>". */
84
+ triggerLabel?: string;
85
+ className?: string;
86
+ };
87
+ /** The workspace switcher at the top of `AppSidebar`: the logo and name, opening a menu. */
88
+ declare function AppSidebarWorkspace({ name, logo, children, triggerLabel, className, }: AppSidebarWorkspaceProps): React.JSX.Element;
89
+ export { AppShell, AppSidebar, AppSidebarWorkspace, AppTopBar, type AppShellProps, type AppSidebarIcon, type AppSidebarItem, type AppSidebarProps, type AppSidebarRenderLink, type AppSidebarSection, type AppSidebarWorkspaceProps, type AppTopBarProps, };
90
+ //# sourceMappingURL=app-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,149 @@
1
+ import { cn as e } from "../../lib/utils.js";
2
+ import { Button as t } from "../button/button.js";
3
+ import { DropdownMenu as n, DropdownMenuContent as r, DropdownMenuTrigger as i } from "../dropdown-menu/dropdown-menu.js";
4
+ import { SidebarGroup as a, SidebarGroupContent as o, SidebarGroupLabel as s, SidebarMenu as c, SidebarMenuBadge as l, SidebarMenuButton as u, SidebarMenuItem as d, SidebarProvider as f } from "../sidebar/sidebar.js";
5
+ import "react";
6
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
7
+ import { IconChevronDown as h, IconPlus as g } from "@tabler/icons-react";
8
+ //#region src/components/app-shell/app-shell.tsx
9
+ function _({ sidebar: t, topBar: n, mainClassName: r, className: i, children: a, ...o }) {
10
+ return /* @__PURE__ */ m("div", {
11
+ "data-slot": "app-shell",
12
+ className: e("grid min-h-screen grid-cols-[188px_minmax(0,1fr)] grid-rows-[56px_1fr] gap-x-2.5 bg-background px-4 pb-2.5 text-foreground", i),
13
+ ...o,
14
+ children: [
15
+ t,
16
+ n ?? /* @__PURE__ */ p("div", { "data-slot": "app-shell-top-bar-placeholder" }),
17
+ /* @__PURE__ */ p("main", {
18
+ "data-slot": "app-shell-main",
19
+ className: e("relative min-w-0 rounded-2xl bg-card shadow-[0_1px_2px_rgb(0_0_0/0.04),0_6px_20px_rgb(0_0_0/0.07)]", r),
20
+ children: a
21
+ })
22
+ ]
23
+ });
24
+ }
25
+ function v({ end: t, className: n, children: r, ...i }) {
26
+ return /* @__PURE__ */ m("header", {
27
+ "data-slot": "app-top-bar",
28
+ className: e("flex min-w-0 items-center gap-3", n),
29
+ ...i,
30
+ children: [/* @__PURE__ */ p("div", {
31
+ "data-slot": "app-top-bar-start",
32
+ className: "flex min-w-0 flex-1",
33
+ children: r
34
+ }), t ? /* @__PURE__ */ p("div", {
35
+ "data-slot": "app-top-bar-end",
36
+ className: "flex flex-none items-center gap-2",
37
+ children: t
38
+ }) : null]
39
+ });
40
+ }
41
+ var y = (e) => /* @__PURE__ */ p("a", { href: e.href });
42
+ function b({ item: e, active: t, onNavigate: n, renderLink: r }) {
43
+ let i = e.icon, a = () => {
44
+ e.onSelect?.(), n?.(e);
45
+ };
46
+ return /* @__PURE__ */ m(d, {
47
+ "data-slot": "app-sidebar-item",
48
+ children: [/* @__PURE__ */ m(u, {
49
+ variant: "raised",
50
+ isActive: t,
51
+ "aria-current": t ? "page" : void 0,
52
+ render: e.href ? r({
53
+ ...e,
54
+ href: e.href
55
+ }) : void 0,
56
+ onClick: a,
57
+ children: [i ? /* @__PURE__ */ p(i, { "aria-hidden": "true" }) : null, /* @__PURE__ */ p("span", { children: e.label })]
58
+ }), e.count ? /* @__PURE__ */ p(l, {
59
+ className: "top-1.5 rounded-full bg-primary/10 font-semibold text-primary",
60
+ children: e.count
61
+ }) : null]
62
+ });
63
+ }
64
+ function x({ label: e, children: t }) {
65
+ return /* @__PURE__ */ m(a, {
66
+ className: "p-0",
67
+ children: [e ? /* @__PURE__ */ p(s, {
68
+ className: "px-2.5",
69
+ children: e
70
+ }) : null, /* @__PURE__ */ p(o, { children: /* @__PURE__ */ p(c, {
71
+ className: "gap-px",
72
+ children: t
73
+ }) })]
74
+ });
75
+ }
76
+ function S({ workspace: t, newItem: n, sections: r, bottomItems: i, activeId: a, onNavigate: o, navLabel: s = "Workspace", renderLink: c = y, className: l, ...u }) {
77
+ let d = (e) => /* @__PURE__ */ p(b, {
78
+ item: e,
79
+ active: e.id === a,
80
+ onNavigate: o,
81
+ renderLink: c
82
+ }, e.id), h = n ? d({
83
+ ...n,
84
+ icon: n.icon ?? g
85
+ }) : null, [_, ...v] = r, S = !!(h && _ && !_.label);
86
+ return /* @__PURE__ */ p("aside", {
87
+ "data-slot": "app-sidebar",
88
+ className: e("sticky top-0 row-span-2 flex h-screen flex-col self-start overflow-y-auto pt-2.5 pb-3", l),
89
+ ...u,
90
+ children: /* @__PURE__ */ m(f, {
91
+ className: "contents",
92
+ children: [
93
+ t,
94
+ /* @__PURE__ */ m("nav", {
95
+ "aria-label": s,
96
+ className: "flex flex-col gap-4",
97
+ children: [
98
+ h && !S ? /* @__PURE__ */ p(x, { children: h }) : null,
99
+ _ ? /* @__PURE__ */ m(x, {
100
+ label: _.label,
101
+ children: [S ? h : null, _.items.map(d)]
102
+ }, _.id) : null,
103
+ v.map((e) => /* @__PURE__ */ p(x, {
104
+ label: e.label,
105
+ children: e.items.map(d)
106
+ }, e.id))
107
+ ]
108
+ }),
109
+ i?.length ? /* @__PURE__ */ p("div", {
110
+ "data-slot": "app-sidebar-bottom",
111
+ className: "mt-auto pt-4",
112
+ children: /* @__PURE__ */ p(x, { children: i.map(d) })
113
+ }) : null
114
+ ]
115
+ })
116
+ });
117
+ }
118
+ function C({ name: a, logo: o, children: s, triggerLabel: c, className: l }) {
119
+ return /* @__PURE__ */ m(n, { children: [/* @__PURE__ */ m(i, {
120
+ render: /* @__PURE__ */ p(t, {
121
+ type: "button",
122
+ variant: "tertiary",
123
+ size: "lg",
124
+ "data-slot": "app-sidebar-workspace",
125
+ "aria-label": c ?? `Open workspace menu for ${a}`,
126
+ className: e("mb-4 w-full justify-start gap-2.5 px-1.5", l)
127
+ }),
128
+ children: [
129
+ o ? /* @__PURE__ */ p("span", {
130
+ className: "flex size-8 flex-none items-center justify-center overflow-hidden rounded-md [&>img]:size-full [&>img]:object-cover",
131
+ children: o
132
+ }) : null,
133
+ /* @__PURE__ */ p("span", {
134
+ className: "type-label flex-1 truncate text-left font-medium",
135
+ children: a
136
+ }),
137
+ /* @__PURE__ */ p(h, {
138
+ "aria-hidden": "true",
139
+ className: "icon-optical-16 text-muted-foreground"
140
+ })
141
+ ]
142
+ }), s ? /* @__PURE__ */ p(r, {
143
+ align: "start",
144
+ className: "min-w-56",
145
+ children: s
146
+ }) : null] });
147
+ }
148
+ //#endregion
149
+ export { _ as AppShell, S as AppSidebar, C as AppSidebarWorkspace, v as AppTopBar };
@@ -0,0 +1,2 @@
1
+ export * from './app-shell';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ type ApprovalCardProps = Omit<React.ComponentProps<'article'>, 'title'> & {
3
+ /** A small line above the title naming where the request comes from. */
4
+ eyebrow?: React.ReactNode;
5
+ /** What the owner is asked to do. */
6
+ title: React.ReactNode;
7
+ /** One muted line saying why. */
8
+ description?: React.ReactNode;
9
+ /** The primary action at the right, usually a `Button`. */
10
+ action?: React.ReactNode;
11
+ };
12
+ /**
13
+ * A request waiting for the owner, as in a "For your approval" list: an
14
+ * eyebrow, a title, one muted line, and the action at the right. `children`
15
+ * sit under the description, for a preview or extra detail.
16
+ */
17
+ declare function ApprovalCard({ eyebrow, title, description, action, className, children, ...props }: ApprovalCardProps): React.JSX.Element;
18
+ export { ApprovalCard, type ApprovalCardProps };
19
+ //# sourceMappingURL=approval-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval-card.d.ts","sourceRoot":"","sources":["../../../src/components/approval-card/approval-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,KAAK,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,GAAG;IACxE,wEAAwE;IACxE,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,qCAAqC;IACrC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,iCAAiC;IACjC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB,CAAA;AAED;;;;GAIG;AACH,iBAAS,YAAY,CAAC,EACpB,OAAO,EACP,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,iBAAiB,qBAiDnB;AAED,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,CAAA"}
@@ -0,0 +1,42 @@
1
+ import { cn as e } from "../../lib/utils.js";
2
+ import * as t from "react";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ //#region src/components/approval-card/approval-card.tsx
5
+ function i({ eyebrow: i, title: a, description: o, action: s, className: c, children: l, ...u }) {
6
+ let d = t.useId();
7
+ return /* @__PURE__ */ r("article", {
8
+ "data-slot": "approval-card",
9
+ "aria-labelledby": d,
10
+ className: e("flex flex-col gap-4 rounded-xl border border-border-subtle bg-card p-4 text-card-foreground sm:flex-row sm:items-center sm:gap-6", c),
11
+ ...u,
12
+ children: [/* @__PURE__ */ r("div", {
13
+ "data-slot": "approval-card-content",
14
+ className: "min-w-0 flex-1",
15
+ children: [
16
+ i ? /* @__PURE__ */ n("p", {
17
+ "data-slot": "approval-card-eyebrow",
18
+ className: "type-meta text-muted-foreground",
19
+ children: i
20
+ }) : null,
21
+ /* @__PURE__ */ n("h3", {
22
+ id: d,
23
+ "data-slot": "approval-card-title",
24
+ className: "type-item-title font-medium",
25
+ children: a
26
+ }),
27
+ o ? /* @__PURE__ */ n("p", {
28
+ "data-slot": "approval-card-description",
29
+ className: "type-body mt-1 text-muted-foreground",
30
+ children: o
31
+ }) : null,
32
+ l
33
+ ]
34
+ }), s ? /* @__PURE__ */ n("div", {
35
+ "data-slot": "approval-card-action",
36
+ className: "flex flex-none items-center gap-2",
37
+ children: s
38
+ }) : null]
39
+ });
40
+ }
41
+ //#endregion
42
+ export { i as ApprovalCard };
@@ -0,0 +1,2 @@
1
+ export * from './approval-card';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/approval-card/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { useRender } from '@base-ui/react/use-render';
2
2
  import { VariantProps } from 'class-variance-authority';
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "secondary" | "destructive" | "link" | "default" | "success" | "warning" | "info" | "outline" | "ghost" | "area-website" | "area-social" | "area-search" | "area-ads" | "area-calls" | "area-reviews" | null | undefined;
4
+ variant?: "secondary" | "destructive" | "link" | "default" | "outline" | "success" | "warning" | "info" | "ghost" | "area-website" | "area-social" | "area-search" | "area-ads" | "area-calls" | "area-reviews" | null | undefined;
5
5
  size?: "md" | "default" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  declare function Badge({ className, variant, size, render, ...props }: useRender.ComponentProps<'span'> & VariantProps<typeof badgeVariants>): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
@@ -0,0 +1,26 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ declare const chatBarFormVariants: (props?: ({
4
+ size?: "default" | "compact" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ type ChatBarProps = Omit<React.ComponentProps<'div'>, 'onSubmit' | 'defaultValue'> & VariantProps<typeof chatBarFormVariants> & {
7
+ /** Called with the trimmed message when the owner sends it. Empty messages are not sent. */
8
+ onSend?: (text: string) => void;
9
+ placeholder?: string;
10
+ /** The input's accessible name. */
11
+ inputLabel?: string;
12
+ /** The send button's accessible name. */
13
+ sendLabel?: string;
14
+ defaultValue?: string;
15
+ /**
16
+ * Float the bar at the foot of the scrolling panel, over a fade to the card surface. Turn it off to place the bar
17
+ * yourself.
18
+ */
19
+ floating?: boolean;
20
+ /** Content under the bar, such as suggestion chips. */
21
+ children?: React.ReactNode;
22
+ };
23
+ /** The chat bar: a floating rounded input with a round send button. Enter sends. */
24
+ declare function ChatBar({ onSend, placeholder, inputLabel, sendLabel, defaultValue, floating, size, className, children, ...props }: ChatBarProps): React.JSX.Element;
25
+ export { ChatBar, chatBarFormVariants, type ChatBarProps };
26
+ //# sourceMappingURL=chat-bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-bar.d.ts","sourceRoot":"","sources":["../../../src/components/chat-bar/chat-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,mBAAmB;;8EAYxB,CAAA;AAcD,KAAK,YAAY,GAAG,IAAI,CACtB,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B,UAAU,GAAG,cAAc,CAC5B,GACC,YAAY,CAAC,OAAO,mBAAmB,CAAC,GAAG;IACzC,4FAA4F;IAC5F,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAEH,oFAAoF;AACpF,iBAAS,OAAO,CAAC,EACf,MAAM,EACN,WAAsD,EACtD,UAAsB,EACtB,SAAkB,EAClB,YAAiB,EACjB,QAAe,EACf,IAAgB,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,YAAY,qBAqDd;AAED,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,CAAA"}
@@ -0,0 +1,58 @@
1
+ import { cn as e } from "../../lib/utils.js";
2
+ import { Button as t } from "../button/button.js";
3
+ import * as n from "react";
4
+ import { cva as r } from "class-variance-authority";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import { IconArrowUp as o } from "@tabler/icons-react";
7
+ //#region src/components/chat-bar/chat-bar.tsx
8
+ var s = r("pointer-events-auto mx-auto flex w-full items-center rounded-full border border-border bg-card", {
9
+ variants: { size: {
10
+ default: "min-h-[60px] max-w-[680px] gap-2.5 py-2 pr-2.5 pl-6 shadow-[0_10px_34px_-12px_rgb(0_0_0/.22),0_1px_3px_rgb(0_0_0/.06)]",
11
+ compact: "max-w-[560px] gap-2 py-1.5 pr-1.5 pl-5 shadow-sm"
12
+ } },
13
+ defaultVariants: { size: "default" }
14
+ }), c = r("flex-none rounded-full", {
15
+ variants: { size: {
16
+ default: "size-10 [--icon-stroke-width:var(--icon-stroke-20)] [&_svg:not([class*=size-])]:size-5",
17
+ compact: "size-8 [--icon-stroke-width:var(--icon-stroke-16)] [&_svg:not([class*=size-])]:size-4"
18
+ } },
19
+ defaultVariants: { size: "default" }
20
+ });
21
+ function l({ onSend: r, placeholder: l = "Ask me anything, or tell me what to do", inputLabel: u = "Message", sendLabel: d = "Send", defaultValue: f = "", floating: p = !0, size: m = "default", className: h, children: g, ..._ }) {
22
+ let [v, y] = n.useState(f), b = m === "compact" ? "max-w-[560px]" : "max-w-[680px]";
23
+ return /* @__PURE__ */ a("div", {
24
+ "data-slot": "chat-bar",
25
+ "data-size": m,
26
+ className: e(p && "pointer-events-none sticky bottom-0 z-10 rounded-b-2xl bg-linear-to-t from-card from-75% to-transparent px-6 pt-6 pb-6", h),
27
+ ..._,
28
+ children: [/* @__PURE__ */ a("form", {
29
+ "data-slot": "chat-bar-form",
30
+ className: s({ size: m }),
31
+ onSubmit: (e) => {
32
+ e.preventDefault();
33
+ let t = v.trim();
34
+ t && (r?.(t), y(""));
35
+ },
36
+ children: [/* @__PURE__ */ i("input", {
37
+ "data-slot": "chat-bar-input",
38
+ "aria-label": u,
39
+ value: v,
40
+ onChange: (e) => y(e.target.value),
41
+ placeholder: l,
42
+ className: "type-body min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-foreground-tertiary"
43
+ }), /* @__PURE__ */ i(t, {
44
+ type: "submit",
45
+ "aria-label": d,
46
+ size: m === "compact" ? "icon-md" : "icon-lg",
47
+ className: c({ size: m }),
48
+ children: /* @__PURE__ */ i(o, { "aria-hidden": "true" })
49
+ })]
50
+ }), g ? /* @__PURE__ */ i("div", {
51
+ "data-slot": "chat-bar-footer",
52
+ className: e("pointer-events-auto mx-auto mt-3", b),
53
+ children: g
54
+ }) : null]
55
+ });
56
+ }
57
+ //#endregion
58
+ export { l as ChatBar, s as chatBarFormVariants };
@@ -0,0 +1,2 @@
1
+ export * from './chat-bar';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/chat-bar/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
@@ -0,0 +1,36 @@
1
+ import { TableRow } from '../table';
2
+ import * as React from 'react';
3
+ export interface DenseTableColumn {
4
+ /** The header text. An empty header still needs `srLabel` for screen readers. */
5
+ label: React.ReactNode;
6
+ /** Right-aligns the header to sit over numbers. */
7
+ numeric?: boolean;
8
+ /** Names a column whose header is visually empty. */
9
+ srLabel?: string;
10
+ className?: string;
11
+ }
12
+ export interface DenseTableProps extends Omit<React.ComponentProps<'div'>, 'children'> {
13
+ columns: readonly DenseTableColumn[];
14
+ /** The rows: `DenseTableRow`s of `DenseTableCell`s. */
15
+ children: React.ReactNode;
16
+ /** Names the table for assistive technology. */
17
+ 'aria-label'?: string;
18
+ }
19
+ /**
20
+ * A data-heavy table on a white card: compact rows, small muted headers and
21
+ * right-aligned numbers, for scanning many figures at once.
22
+ */
23
+ declare function DenseTable({ columns, children, className, 'aria-label': ariaLabel, ...props }: DenseTableProps): React.JSX.Element;
24
+ declare const DenseTableRow: typeof TableRow;
25
+ export interface DenseTableCellProps extends React.ComponentProps<'td'> {
26
+ /** Right-aligned tabular figures in medium weight. */
27
+ numeric?: boolean;
28
+ /** A muted line under a number, such as "vs 120 the week before". */
29
+ sub?: React.ReactNode;
30
+ /** Text that wraps instead of staying on one line. Defaults to true for text cells. */
31
+ wrap?: boolean;
32
+ }
33
+ /** A dense cell: wrapping text, or a right-aligned number with an optional muted line. */
34
+ declare function DenseTableCell({ numeric, sub, wrap, className, children, ...props }: DenseTableCellProps): React.JSX.Element;
35
+ export { DenseTable, DenseTableCell, DenseTableRow };
36
+ //# sourceMappingURL=dense-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dense-table.d.ts","sourceRoot":"","sources":["../../../src/components/dense-table/dense-table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAML,QAAQ,EACT,MAAM,oBAAoB,CAAA;AAG3B,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,mDAAmD;IACnD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B,UAAU,CACX;IACC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACpC,uDAAuD;IACvD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;GAGG;AACH,iBAAS,UAAU,CAAC,EAClB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACT,EAAE,eAAe,qBAmCjB;AAED,QAAA,MAAM,aAAa,iBAAW,CAAA;AAE9B,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;IACrE,sDAAsD;IACtD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qEAAqE;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,uFAAuF;IACvF,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAED,0FAA0F;AAC1F,iBAAS,cAAc,CAAC,EACtB,OAAe,EACf,GAAG,EACH,IAAe,EACf,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,mBAAmB,qBAkBrB;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,CAAA"}
@@ -0,0 +1,41 @@
1
+ import { cn as e } from "../../lib/utils.js";
2
+ import { Table as t, TableBody as n, TableCell as r, TableHead as i, TableHeader as a, TableRow as o } from "../table/table.js";
3
+ import "react";
4
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
5
+ //#region src/components/dense-table/dense-table.tsx
6
+ function l({ columns: r, children: l, className: u, "aria-label": d, ...f }) {
7
+ return /* @__PURE__ */ s("div", {
8
+ "data-slot": "dense-table",
9
+ className: e("overflow-x-auto rounded-xl border border-border bg-card px-2", u),
10
+ ...f,
11
+ children: /* @__PURE__ */ c(t, {
12
+ density: "compact",
13
+ "aria-label": d,
14
+ children: [/* @__PURE__ */ s(a, { children: /* @__PURE__ */ s(o, { children: r.map((t, n) => /* @__PURE__ */ c(i, {
15
+ "data-numeric": t.numeric ? "" : void 0,
16
+ className: e("type-meta font-medium text-muted-foreground", t.numeric && "text-right", t.className),
17
+ children: [t.label, t.srLabel ? /* @__PURE__ */ s("span", {
18
+ className: "sr-only",
19
+ children: t.srLabel
20
+ }) : null]
21
+ }, n)) }) }), /* @__PURE__ */ s(n, { children: l })]
22
+ })
23
+ });
24
+ }
25
+ var u = o;
26
+ function d({ numeric: t = !1, sub: n, wrap: i = !t, className: a, children: o, ...l }) {
27
+ return /* @__PURE__ */ c(r, {
28
+ "data-numeric": t ? "" : void 0,
29
+ className: e("type-body align-top", t && "text-right tabular-nums", i && "whitespace-normal", a),
30
+ ...l,
31
+ children: [t ? /* @__PURE__ */ s("span", {
32
+ className: "font-medium",
33
+ children: o
34
+ }) : o, n ? /* @__PURE__ */ s("span", {
35
+ className: "type-meta block text-muted-foreground",
36
+ children: n
37
+ }) : null]
38
+ });
39
+ }
40
+ //#endregion
41
+ export { l as DenseTable, d as DenseTableCell, u as DenseTableRow };
@@ -0,0 +1,2 @@
1
+ export * from './dense-table';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/dense-table/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+ type EditableTextProps = Omit<React.ComponentProps<'div'>, 'onChange'> & {
3
+ /** The saved text. */
4
+ value: string;
5
+ /** Called with the new text when the owner saves a change. */
6
+ onSave?: (text: string) => void;
7
+ /** A short confirmation shown under the text after a save. Pass an empty string to show nothing. */
8
+ note?: React.ReactNode;
9
+ /** Start in the text box, e.g. when a "Change" button mounts it. */
10
+ defaultEditing?: boolean;
11
+ /** Always show the pencil and underline the text, for a page's edit mode. */
12
+ pencil?: boolean;
13
+ /** The type role for the text and the text box. */
14
+ textClassName?: string;
15
+ /** The text box's accessible name. */
16
+ inputLabel?: string;
17
+ saveLabel?: React.ReactNode;
18
+ cancelLabel?: React.ReactNode;
19
+ };
20
+ /**
21
+ * Text the owner can change in place. A click turns it into a text box with Save and Cancel; Enter saves (Shift+Enter
22
+ * adds a line) and Escape cancels.
23
+ */
24
+ declare function EditableText({ value, onSave, note, defaultEditing, pencil, textClassName, inputLabel, saveLabel, cancelLabel, className, ...props }: EditableTextProps): React.JSX.Element;
25
+ export { EditableText, type EditableTextProps };
26
+ //# sourceMappingURL=editable-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editable-text.d.ts","sourceRoot":"","sources":["../../../src/components/editable-text/editable-text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,KAAK,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACvE,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,8DAA8D;IAC9D,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,oGAAoG;IACpG,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,oEAAoE;IACpE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,sCAAsC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC3B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC9B,CAAA;AAED;;;GAGG;AACH,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,MAAM,EACN,IAAe,EACf,cAAsB,EACtB,MAAc,EACd,aAA2B,EAC3B,UAAwB,EACxB,SAAkB,EAClB,WAAsB,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,iBAAiB,qBAkJnB;AAED,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,CAAA"}
@@ -0,0 +1,82 @@
1
+ import { cn as e } from "../../lib/utils.js";
2
+ import { Button as t } from "../button/button.js";
3
+ import * as n from "react";
4
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ import { IconPencil as o } from "@tabler/icons-react";
6
+ //#region src/components/editable-text/editable-text.tsx
7
+ function s({ value: s, onSave: c, note: l = "Saved.", defaultEditing: u = !1, pencil: d = !1, textClassName: f = "type-body", inputLabel: p = "Edit text", saveLabel: m = "Save", cancelLabel: h = "Cancel", className: g, ..._ }) {
8
+ let [v, y] = n.useState(s), [b, x] = n.useState(s), [S, C] = n.useState(u), [w, T] = n.useState(!1), [E, D] = n.useState(s), O = n.useRef(null), k = n.useRef(null), A = n.useRef(!1);
9
+ s !== E && (D(s), y(s), S || x(s)), n.useEffect(() => {
10
+ let e = O.current;
11
+ !S || !e || (e.focus(), e.setSelectionRange(e.value.length, e.value.length));
12
+ }, [S]), n.useEffect(() => {
13
+ let e = O.current;
14
+ e && (e.style.height = "auto", e.style.height = `${e.scrollHeight}px`);
15
+ }, [b, S]), n.useEffect(() => {
16
+ !S && A.current && (A.current = !1, k.current?.focus());
17
+ }, [S]);
18
+ let j = () => {
19
+ A.current = !0, C(!1);
20
+ }, M = () => {
21
+ let e = b.trim();
22
+ e && e !== v && (y(e), T(!0), c?.(e)), j();
23
+ }, N = () => {
24
+ x(v), j();
25
+ };
26
+ return /* @__PURE__ */ i("div", {
27
+ "data-slot": "editable-text",
28
+ "data-state": S ? "editing" : "idle",
29
+ className: g,
30
+ ..._,
31
+ children: S ? /* @__PURE__ */ a("div", {
32
+ className: "flex flex-col gap-2",
33
+ children: [/* @__PURE__ */ i("textarea", {
34
+ ref: O,
35
+ "data-slot": "editable-text-input",
36
+ "aria-label": p,
37
+ value: b,
38
+ rows: 1,
39
+ onChange: (e) => x(e.target.value),
40
+ onKeyDown: (e) => {
41
+ e.key === "Enter" && !e.shiftKey && (e.preventDefault(), M()), e.key === "Escape" && (e.preventDefault(), N());
42
+ },
43
+ className: e(f, "w-full resize-none overflow-hidden rounded-sm border border-border bg-card px-2.5 py-1.5 text-foreground outline-none focus:border-ring")
44
+ }), /* @__PURE__ */ a("div", {
45
+ className: "flex gap-2",
46
+ children: [/* @__PURE__ */ i(t, {
47
+ size: "sm",
48
+ variant: "primary",
49
+ onClick: M,
50
+ children: m
51
+ }), /* @__PURE__ */ i(t, {
52
+ size: "sm",
53
+ variant: "tertiary",
54
+ onClick: N,
55
+ children: h
56
+ })]
57
+ })]
58
+ }) : /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a("button", {
59
+ ref: k,
60
+ type: "button",
61
+ "data-slot": "editable-text-trigger",
62
+ onClick: () => {
63
+ x(v), C(!0), T(!1);
64
+ },
65
+ className: e(f, "group/editable -mx-1.5 flex w-[calc(100%+12px)] items-start gap-2 rounded-sm px-1.5 text-left text-foreground outline-none hover:bg-muted focus-visible:ring-3 focus-visible:ring-border-subtle"),
66
+ children: [/* @__PURE__ */ i("span", {
67
+ className: e("flex-1 whitespace-pre-line", d && "underline decoration-foreground-tertiary/50 decoration-dotted underline-offset-4"),
68
+ children: v
69
+ }), /* @__PURE__ */ i(o, {
70
+ "aria-hidden": "true",
71
+ className: e("icon-optical-14 mt-1 shrink-0 text-muted-foreground", d ? "opacity-100" : "opacity-0 group-hover/editable:opacity-100 group-focus-visible/editable:opacity-100")
72
+ })]
73
+ }), w && l ? /* @__PURE__ */ i("p", {
74
+ "data-slot": "editable-text-note",
75
+ role: "status",
76
+ className: "type-meta mt-0.5 text-success",
77
+ children: l
78
+ }) : null] })
79
+ });
80
+ }
81
+ //#endregion
82
+ export { s as EditableText };
@@ -0,0 +1,2 @@
1
+ export * from './editable-text';
2
+ //# sourceMappingURL=index.d.ts.map