@lerianstudio/sindarian-ui 2.0.0-beta.7 → 2.0.0-beta.9
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/breadcrumb/index.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.js +25 -1
- package/dist/components/card/account-card/index.js +5 -5
- package/dist/components/card/basic-card/index.d.ts.map +1 -1
- package/dist/components/card/basic-card/index.js +2 -2
- package/dist/components/card/entity-card/index.js +1 -1
- package/dist/components/entity-box/index.d.ts +18 -2
- package/dist/components/entity-box/index.d.ts.map +1 -1
- package/dist/components/entity-box/index.js +32 -4
- package/dist/components/form/password-field/index.d.ts +5 -1
- package/dist/components/form/password-field/index.d.ts.map +1 -1
- package/dist/components/form/password-field/index.js +2 -2
- package/dist/components/page-header/index.js +1 -1
- package/dist/components/table/id-table-cell.d.ts +5 -1
- package/dist/components/table/id-table-cell.d.ts.map +1 -1
- package/dist/components/table/id-table-cell.js +48 -6
- package/dist/components/ui/autocomplete/index.d.ts +24 -0
- package/dist/components/ui/autocomplete/index.d.ts.map +1 -1
- package/dist/components/ui/autocomplete/index.js +24 -0
- package/dist/components/ui/copy-field/index.d.ts.map +1 -1
- package/dist/components/ui/copy-field/index.js +1 -1
- package/dist/components/ui/sheet/index.d.ts.map +1 -1
- package/dist/components/ui/sheet/index.js +2 -2
- package/dist/components/ui/sidebar/index.d.ts +1 -0
- package/dist/components/ui/sidebar/index.d.ts.map +1 -1
- package/dist/components/ui/sidebar/index.js +1 -0
- package/dist/components/ui/sidebar/sidebar-expand-button.d.ts +1 -1
- package/dist/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
- package/dist/components/ui/sidebar/sidebar-expand-button.js +15 -1
- package/dist/components/ui/sidebar/sidebar-item.d.ts +1 -1
- package/dist/components/ui/sidebar/sidebar-item.d.ts.map +1 -1
- package/dist/components/ui/sidebar/sidebar-item.js +28 -4
- package/dist/components/ui/sidebar/sidebar-provider.d.ts +37 -0
- package/dist/components/ui/sidebar/sidebar-provider.d.ts.map +1 -1
- package/dist/components/ui/sidebar/sidebar-provider.js +125 -4
- package/dist/components/ui/sidebar/sidebar-root.d.ts +38 -1
- package/dist/components/ui/sidebar/sidebar-root.d.ts.map +1 -1
- package/dist/components/ui/sidebar/sidebar-root.js +100 -5
- package/dist/components/ui/sidebar/sidebar-trigger.d.ts +18 -0
- package/dist/components/ui/sidebar/sidebar-trigger.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-trigger.js +30 -0
- package/dist/esm/components/breadcrumb/index.d.ts.map +1 -1
- package/dist/esm/components/breadcrumb/index.js +25 -1
- package/dist/esm/components/card/account-card/index.js +5 -5
- package/dist/esm/components/card/basic-card/index.d.ts.map +1 -1
- package/dist/esm/components/card/basic-card/index.js +2 -2
- package/dist/esm/components/card/entity-card/index.js +1 -1
- package/dist/esm/components/entity-box/index.d.ts +18 -2
- package/dist/esm/components/entity-box/index.d.ts.map +1 -1
- package/dist/esm/components/entity-box/index.js +29 -4
- package/dist/esm/components/form/password-field/index.d.ts +5 -1
- package/dist/esm/components/form/password-field/index.d.ts.map +1 -1
- package/dist/esm/components/form/password-field/index.js +2 -2
- package/dist/esm/components/page-header/index.js +1 -1
- package/dist/esm/components/table/id-table-cell.d.ts +5 -1
- package/dist/esm/components/table/id-table-cell.d.ts.map +1 -1
- package/dist/esm/components/table/id-table-cell.js +48 -3
- package/dist/esm/components/ui/autocomplete/index.d.ts +24 -0
- package/dist/esm/components/ui/autocomplete/index.d.ts.map +1 -1
- package/dist/esm/components/ui/autocomplete/index.js +24 -0
- package/dist/esm/components/ui/copy-field/index.d.ts.map +1 -1
- package/dist/esm/components/ui/copy-field/index.js +1 -1
- package/dist/esm/components/ui/sheet/index.d.ts.map +1 -1
- package/dist/esm/components/ui/sheet/index.js +2 -2
- package/dist/esm/components/ui/sidebar/index.d.ts +1 -0
- package/dist/esm/components/ui/sidebar/index.d.ts.map +1 -1
- package/dist/esm/components/ui/sidebar/index.js +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts +1 -1
- package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
- package/dist/esm/components/ui/sidebar/sidebar-expand-button.js +15 -1
- package/dist/esm/components/ui/sidebar/sidebar-item.d.ts +1 -1
- package/dist/esm/components/ui/sidebar/sidebar-item.d.ts.map +1 -1
- package/dist/esm/components/ui/sidebar/sidebar-item.js +28 -4
- package/dist/esm/components/ui/sidebar/sidebar-provider.d.ts +37 -0
- package/dist/esm/components/ui/sidebar/sidebar-provider.d.ts.map +1 -1
- package/dist/esm/components/ui/sidebar/sidebar-provider.js +122 -1
- package/dist/esm/components/ui/sidebar/sidebar-root.d.ts +38 -1
- package/dist/esm/components/ui/sidebar/sidebar-root.d.ts.map +1 -1
- package/dist/esm/components/ui/sidebar/sidebar-root.js +102 -7
- package/dist/esm/components/ui/sidebar/sidebar-trigger.d.ts +18 -0
- package/dist/esm/components/ui/sidebar/sidebar-trigger.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-trigger.js +26 -0
- package/dist/globals.css +49 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,cAAc,EAAE,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,WAAW,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,cAAc,EAAE,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,WAAW,eAAe,sBAmDpD,CAAA"}
|
|
@@ -8,6 +8,30 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const breadcrumb_1 = require("../../components/ui/breadcrumb");
|
|
10
10
|
const Breadcrumb = ({ paths }) => {
|
|
11
|
-
|
|
11
|
+
const last = paths.length - 1;
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(breadcrumb_1.Breadcrumb, { children: (0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbList, { children: paths.map((path, index) => {
|
|
13
|
+
/**
|
|
14
|
+
* ⛔ THE LAST CRUMB IS THE PAGE, whatever the caller passed.
|
|
15
|
+
*
|
|
16
|
+
* The page marker used to be a side effect of the caller omitting
|
|
17
|
+
* `href`, and nothing in `getBreadcrumbPaths` makes the last entry
|
|
18
|
+
* omit one. A trail whose final entry carried an href therefore had
|
|
19
|
+
* no `aria-current="page"` anywhere — a screen reader could not tell
|
|
20
|
+
* which of three links was the page being read — and the crumb was a
|
|
21
|
+
* live link back to the page the reader is already on.
|
|
22
|
+
*
|
|
23
|
+
* ⚠️ AND AN HREF-LESS ANCESTOR IS NOT A SWITCHED-OFF LINK. It used
|
|
24
|
+
* to reach `BreadcrumbPage` too, which hard-codes `role="link"
|
|
25
|
+
* aria-disabled="true"` — the right shape for the page you are ON,
|
|
26
|
+
* a destination that exists and simply is not navigable from here.
|
|
27
|
+
* An ancestor with no href is a grouping label: there is no page
|
|
28
|
+
* behind it, so "Settings, link, dimmed" told the reader a
|
|
29
|
+
* destination was unavailable to them rather than that it was never
|
|
30
|
+
* a destination, and inflated the link count of the trail. It is
|
|
31
|
+
* plain text now, and only the last crumb is the page.
|
|
32
|
+
*/
|
|
33
|
+
const isLast = index === last;
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbItem, { children: path.href && !isLast ? ((0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbLink, { href: path.href, children: path.name })) : isLast ? ((0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbPage, { children: path.name })) : ((0, jsx_runtime_1.jsx)("span", { className: "breadcrumb-page", children: path.name })) }), !isLast && (0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbSeparator, {})] }, index));
|
|
35
|
+
}) }) }));
|
|
12
36
|
};
|
|
13
37
|
exports.Breadcrumb = Breadcrumb;
|
|
@@ -39,7 +39,7 @@ function AccountBalanceCardHeader({ className, ...props }) {
|
|
|
39
39
|
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "account-balance-card-header", className: (0, utils_1.cn)('flex flex-col', className), ...props }));
|
|
40
40
|
}
|
|
41
41
|
function AccountBalanceCardTitle({ className, ...props }) {
|
|
42
|
-
return ((0, jsx_runtime_1.jsx)("p", { "data-slot": "account-balance-card-title", className: (0, utils_1.cn)('text-
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)("p", { "data-slot": "account-balance-card-title", className: (0, utils_1.cn)('text-foreground text-lg font-bold', className), ...props }));
|
|
43
43
|
}
|
|
44
44
|
function AccountBalanceCardDeleteButton({ className, ...props }) {
|
|
45
45
|
return ((0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { variant: "outline", size: "small", rounded: true, "data-slot": "account-balance-card-delete-button", className: (0, utils_1.cn)('absolute top-3 right-3', className), ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Trash, { className: "text-muted-foreground h-4 w-4" }) }));
|
|
@@ -51,19 +51,19 @@ function AccountBalanceCardLoading({ className, ...props }) {
|
|
|
51
51
|
return ((0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { "data-slot": "account-balance-card-loading", className: (0, utils_1.cn)('bg-muted mt-3 h-3 w-full rounded-md', className), ...props }));
|
|
52
52
|
}
|
|
53
53
|
function AccountBalanceCardEmpty({ className, ...props }) {
|
|
54
|
-
return ((0, jsx_runtime_1.jsx)("p", { "data-slot": "account-balance-card-empty", className: (0, utils_1.cn)('text-
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)("p", { "data-slot": "account-balance-card-empty", className: (0, utils_1.cn)('text-muted-foreground mt-3 text-center text-sm font-normal', className), ...props }));
|
|
55
55
|
}
|
|
56
56
|
function AccountBalanceCardInfo({ className, assetCode, value, children: _children, ref, ...props }) {
|
|
57
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, "data-slot": "account-balance-card-info", className: (0, utils_1.cn)('text-
|
|
57
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, "data-slot": "account-balance-card-info", className: (0, utils_1.cn)('text-muted-foreground mt-3 flex flex-row items-center justify-between text-sm font-normal', className), ...props, children: [(0, jsx_runtime_1.jsx)("p", { children: assetCode }), (0, jsx_runtime_1.jsx)("p", { children: value })] }));
|
|
58
58
|
}
|
|
59
59
|
function AccountBalanceCardUpdateButton({ className: _className, loading, timestamp, loadingLabel = 'Updating...', updatedInLabel = 'Updated in', updatedLabel = 'Updated', onRefresh, children: _children, ref, ...props }) {
|
|
60
60
|
const _time = (0, use_time_1.useTime)({ interval: 1000 * 60 });
|
|
61
61
|
const updated = react_1.default.useMemo(() => {
|
|
62
62
|
return !(0, dayjs_1.default)(timestamp).isBefore((0, dayjs_1.default)().subtract(1, 'minute'));
|
|
63
63
|
}, [_time, timestamp]);
|
|
64
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-3 flex flex-row items-center justify-end gap-2", children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-3 flex flex-row items-center justify-end gap-2", children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-muted-foreground text-xs font-medium", children: [loading && loadingLabel, !loading && !updated && updatedInLabel, !loading && updated && updatedLabel] }), !loading && updated && ((0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "text-system-success-h1a h-4 w-4" })), (!updated || loading) && ((0, jsx_runtime_1.jsx)(button_1.Button, { ref: ref, variant: "link", "data-slot": "account-balance-card-update-button", className: "h-3 p-0", onClick: onRefresh, disabled: loading, ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)('size-4', { 'motion-safe:animate-spin': loading }) }) }))] }));
|
|
65
65
|
}
|
|
66
66
|
function AccountBalanceCardTrigger({ className, openLabel, closeLabel, children: _children, ...props }) {
|
|
67
67
|
const { open } = react_1.default.useContext(AccountBalanceCardContext);
|
|
68
|
-
return ((0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger, { asChild: true, children: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "link", "data-slot": "account-balance-card-trigger", className: (0, utils_1.cn)('text-
|
|
68
|
+
return ((0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger, { asChild: true, children: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "link", "data-slot": "account-balance-card-trigger", className: (0, utils_1.cn)('text-muted-foreground h-4 p-0 text-xs', className), ...props, children: !open ? openLabel : closeLabel }) }));
|
|
69
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/card/basic-card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAO7B;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBAO5B;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/card/basic-card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAO7B;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBAO5B;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAU7B;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAE7B"}
|
|
@@ -10,10 +10,10 @@ function BasicCard({ className, ...props }) {
|
|
|
10
10
|
return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('bg-card flex flex-col rounded-lg p-6', className), ...props }));
|
|
11
11
|
}
|
|
12
12
|
function BasicCardTitle({ className, ...props }) {
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)("h2", { className: (0, utils_1.cn)('text-
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("h2", { className: (0, utils_1.cn)('text-foreground mb-4 text-sm font-medium', className), ...props }));
|
|
14
14
|
}
|
|
15
15
|
function BasicCardContent({ className, ...props }) {
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('text-
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('text-muted-foreground mb-6 text-sm font-medium', className), ...props }));
|
|
17
17
|
}
|
|
18
18
|
function BasicCardAction({ className, ...props }) {
|
|
19
19
|
return (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('flex flex-col', className), ...props });
|
|
@@ -61,7 +61,7 @@ function EntityCardDescription({ className, ...props }) {
|
|
|
61
61
|
return ((0, jsx_runtime_1.jsx)("p", { "data-slot": "entity-card-description", className: (0, utils_1.cn)('text-muted-foreground text-xs font-medium', className), ...props }));
|
|
62
62
|
}
|
|
63
63
|
function EntityCardList({ className, ...props }) {
|
|
64
|
-
return ((0, jsx_runtime_1.jsx)("ul", { "data-slot": "entity-card-list", className: (0, utils_1.cn)('text-
|
|
64
|
+
return ((0, jsx_runtime_1.jsx)("ul", { "data-slot": "entity-card-list", className: (0, utils_1.cn)('text-muted-foreground mx-2 list-inside list-disc space-y-1 text-xs font-medium', className), ...props }));
|
|
65
65
|
}
|
|
66
66
|
function EntityCardFooter({ className, children, ...props }) {
|
|
67
67
|
return ((0, jsx_runtime_1.jsxs)("div", { "data-slot": "entity-card-footer", className: (0, utils_1.cn)('text-muted-foreground flex flex-col gap-2 text-xs font-medium', className), ...props, children: [(0, jsx_runtime_1.jsx)(separator_1.Separator, {}), (0, jsx_runtime_1.jsx)("div", { className: "[&>svg]:text-muted-foreground flex flex-row items-center gap-2 [&>svg]:size-4 [&>svg]:stroke-[1.5]", children: children })] }));
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CollapsibleContentProps, CollapsibleProps, CollapsibleTriggerProps } from '@radix-ui/react-collapsible';
|
|
3
3
|
declare function EntityBox({ className, children, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
4
|
-
declare function EntityBoxCollapsible({ className, ...props }: CollapsibleProps): React.JSX.Element;
|
|
5
|
-
|
|
4
|
+
declare function EntityBoxCollapsible({ className, open, defaultOpen, onOpenChange, ...props }: CollapsibleProps): React.JSX.Element;
|
|
5
|
+
export type EntityBoxCollapsibleTriggerProps = CollapsibleTriggerProps & {
|
|
6
|
+
/** Accessible name while the box is closed. */
|
|
7
|
+
expandLabel?: string;
|
|
8
|
+
/** Accessible name while the box is open. */
|
|
9
|
+
collapseLabel?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* ⛔ THIS TRIGGER HAS NO TEXT NODE. It is a `Settings2` glyph inside a Button,
|
|
13
|
+
* so without an `aria-label` a screen reader announced "button" and nothing
|
|
14
|
+
* else (SC 4.1.2) — and this is the control that opens the filter panel on
|
|
15
|
+
* every console list page.
|
|
16
|
+
*
|
|
17
|
+
* The name describes the ACTION and Radix's `aria-expanded` carries the state,
|
|
18
|
+
* so the two halves do not repeat each other. English defaults because no
|
|
19
|
+
* consumer passes a label today; a translated console overrides both.
|
|
20
|
+
*/
|
|
21
|
+
declare function EntityBoxCollapsibleTrigger({ expandLabel, collapseLabel, 'aria-label': ariaLabel, ...props }: EntityBoxCollapsibleTriggerProps): React.JSX.Element;
|
|
6
22
|
declare function EntityBoxCollapsibleContent({ children, ...props }: CollapsibleContentProps): React.JSX.Element;
|
|
7
23
|
export interface EntityBoxHeaderProps extends React.ComponentProps<'div'> {
|
|
8
24
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/entity-box/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAczB,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,6BAA6B,CAAA;AAIpC,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAa7B;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/entity-box/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAczB,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,uBAA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C,KAAK,CAAC,qBAU7B;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAa7B;AAED,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EACjB,CAAA"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.EntityBox = EntityBox;
|
|
4
7
|
exports.EntityBoxCollapsible = EntityBoxCollapsible;
|
|
@@ -8,6 +11,7 @@ exports.EntityBoxHeaderTitle = EntityBoxHeaderTitle;
|
|
|
8
11
|
exports.EntityBoxBanner = EntityBoxBanner;
|
|
9
12
|
exports.EntityBoxActions = EntityBoxActions;
|
|
10
13
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
14
|
+
const react_1 = __importDefault(require("react"));
|
|
11
15
|
const utils_1 = require("../../lib/utils");
|
|
12
16
|
const tooltip_1 = require("../ui/tooltip");
|
|
13
17
|
const lucide_react_1 = require("lucide-react");
|
|
@@ -17,11 +21,35 @@ const separator_1 = require("../ui/separator");
|
|
|
17
21
|
function EntityBox({ className, children, ...props }) {
|
|
18
22
|
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "entity-box", className: (0, utils_1.cn)('shadow-entity-box bg-card mb-2 flex items-center justify-between rounded-lg p-6', className), ...props, children: children }));
|
|
19
23
|
}
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The open state, republished for the trigger.
|
|
26
|
+
*
|
|
27
|
+
* Radix keeps it in a context it does not export, and the trigger one element
|
|
28
|
+
* down needs it to say what activating it will DO. Mirroring it here rather
|
|
29
|
+
* than forcing every consumer to lift the state: all ten console call sites
|
|
30
|
+
* render `<EntityBoxCollapsible>` uncontrolled.
|
|
31
|
+
*/
|
|
32
|
+
const EntityBoxCollapsibleContext = react_1.default.createContext(false);
|
|
33
|
+
function EntityBoxCollapsible({ className, open, defaultOpen, onOpenChange, ...props }) {
|
|
34
|
+
const [uncontrolled, setUncontrolled] = react_1.default.useState(defaultOpen ?? false);
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(EntityBoxCollapsibleContext.Provider, { value: open ?? uncontrolled, children: (0, jsx_runtime_1.jsx)(collapsible_1.Collapsible, { className: (0, utils_1.cn)('shadow-entity-box bg-card mb-2 flex flex-col rounded-lg', className), open: open, defaultOpen: defaultOpen, onOpenChange: (next) => {
|
|
36
|
+
setUncontrolled(next);
|
|
37
|
+
onOpenChange?.(next);
|
|
38
|
+
}, ...props }) }));
|
|
22
39
|
}
|
|
23
|
-
|
|
24
|
-
|
|
40
|
+
/**
|
|
41
|
+
* ⛔ THIS TRIGGER HAS NO TEXT NODE. It is a `Settings2` glyph inside a Button,
|
|
42
|
+
* so without an `aria-label` a screen reader announced "button" and nothing
|
|
43
|
+
* else (SC 4.1.2) — and this is the control that opens the filter panel on
|
|
44
|
+
* every console list page.
|
|
45
|
+
*
|
|
46
|
+
* The name describes the ACTION and Radix's `aria-expanded` carries the state,
|
|
47
|
+
* so the two halves do not repeat each other. English defaults because no
|
|
48
|
+
* consumer passes a label today; a translated console overrides both.
|
|
49
|
+
*/
|
|
50
|
+
function EntityBoxCollapsibleTrigger({ expandLabel = 'Expand', collapseLabel = 'Collapse', 'aria-label': ariaLabel, ...props }) {
|
|
51
|
+
const open = react_1.default.useContext(EntityBoxCollapsibleContext);
|
|
52
|
+
return ((0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger, { ...props, asChild: true, children: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "secondary", className: "h-[34px] w-[34px] p-2", "aria-label": ariaLabel ?? (open ? collapseLabel : expandLabel), children: (0, jsx_runtime_1.jsx)(lucide_react_1.Settings2, { size: 16, "aria-hidden": true }) }) }));
|
|
25
53
|
}
|
|
26
54
|
function EntityBoxCollapsibleContent({ children, ...props }) {
|
|
27
55
|
return ((0, jsx_runtime_1.jsxs)(collapsible_1.CollapsibleContent, { ...props, children: [(0, jsx_runtime_1.jsx)(separator_1.Separator, { orientation: "horizontal" }), (0, jsx_runtime_1.jsx)("div", { className: "grid w-full grid-cols-3 p-6", children: children })] }));
|
|
@@ -9,6 +9,10 @@ export type PasswordFieldProps<TFieldValues extends FieldValues = FieldValues, T
|
|
|
9
9
|
required?: boolean;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
'data-testid'?: string;
|
|
12
|
+
/** Accessible name of the eye button while the password is hidden. */
|
|
13
|
+
showPasswordLabel?: string;
|
|
14
|
+
/** Accessible name of the eye button while the password is showing. */
|
|
15
|
+
hidePasswordLabel?: string;
|
|
12
16
|
};
|
|
13
|
-
export declare function PasswordField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, tooltip, placeholder, control, required, disabled, 'data-testid': dataTestId }: PasswordFieldProps<TFieldValues, TName>): React.JSX.Element;
|
|
17
|
+
export declare function PasswordField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, tooltip, placeholder, control, required, disabled, 'data-testid': dataTestId, showPasswordLabel, hidePasswordLabel }: PasswordFieldProps<TFieldValues, TName>): React.JSX.Element;
|
|
14
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/password-field/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAajE,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AW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,EACA,IAAI,EACJ,KAAK,EACL,OAAO,EACP,WAAW,EACX,OAAO,EACP,QAAgB,EAChB,QAAgB,EAChB,aAAa,EAAE,UAAU,EACzB,iBAAmC,EACnC,iBAAmC,EACpC,EAAE,kBAAkB,CAAC,YAAY,EAAE,KAAK,CAAC,qBAuDzC"}
|
|
@@ -10,7 +10,7 @@ const form_1 = require("../../../components/ui/form");
|
|
|
10
10
|
const input_1 = require("../../../components/ui/input");
|
|
11
11
|
const lucide_react_1 = require("lucide-react");
|
|
12
12
|
const icon_button_1 = require("../../../components/ui/icon-button");
|
|
13
|
-
function PasswordField({ name, label, tooltip, placeholder, control, required = false, disabled = false, 'data-testid': dataTestId }) {
|
|
13
|
+
function PasswordField({ name, label, tooltip, placeholder, control, required = false, disabled = false, 'data-testid': dataTestId, showPasswordLabel = 'Show password', hidePasswordLabel = 'Hide password' }) {
|
|
14
14
|
const [show, setShow] = react_1.default.useState(false);
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)(form_1.FormField, { control: control, name: name, render: ({ field }) => ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, children: [(0, jsx_runtime_1.jsx)(form_1.FormLabel, { extra: tooltip ? (0, jsx_runtime_1.jsx)(form_1.FormTooltip, { children: tooltip }) : undefined, children: label }), (0, jsx_runtime_1.jsx)(form_1.FormControl, { children: (0, jsx_runtime_1.jsx)(input_1.Input, { ...field, type: show ? 'text' : 'password', placeholder: placeholder, endAdornment: (0, jsx_runtime_1.jsx)(input_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { type: "button", variant: "outline", rounded: true, onClick: () => setShow(!show), children: show ? (0, jsx_runtime_1.jsx)(lucide_react_1.EyeOff, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Eye, {}) }) }), disabled: disabled, className: "pr-10", "data-testid": dataTestId }) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {})] })) }));
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(form_1.FormField, { control: control, name: name, render: ({ field }) => ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, children: [(0, jsx_runtime_1.jsx)(form_1.FormLabel, { extra: tooltip ? (0, jsx_runtime_1.jsx)(form_1.FormTooltip, { children: tooltip }) : undefined, children: label }), (0, jsx_runtime_1.jsx)(form_1.FormControl, { children: (0, jsx_runtime_1.jsx)(input_1.Input, { ...field, type: show ? 'text' : 'password', placeholder: placeholder, endAdornment: (0, jsx_runtime_1.jsx)(input_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { type: "button", variant: "outline", rounded: true, "aria-label": show ? hidePasswordLabel : showPasswordLabel, onClick: () => setShow(!show), children: show ? (0, jsx_runtime_1.jsx)(lucide_react_1.EyeOff, { "aria-hidden": true }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Eye, { "aria-hidden": true }) }) }), disabled: disabled, className: "pr-10", "data-testid": dataTestId }) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {})] })) }));
|
|
16
16
|
}
|
|
@@ -76,5 +76,5 @@ function PageHeaderCollapsibleInfoTrigger({ question }) {
|
|
|
76
76
|
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "page-header-collapsible-info-trigger", children: (0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "link", className: "flex gap-2 pr-0", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-foreground text-sm font-medium", children: question }), (0, jsx_runtime_1.jsx)(lucide_react_1.HelpCircle, { className: "h-4 w-4" })] }) }) }));
|
|
77
77
|
}
|
|
78
78
|
function PageHeaderCollapsibleInfo({ question, answer, seeMore, href }) {
|
|
79
|
-
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "page-header-collapsible-info", children: (0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleContent, { children: (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full justify-between pt-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "mt-12 flex grow flex-col gap-3 pr-6", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-foreground text-xl font-bold", children: question }), (0, jsx_runtime_1.jsxs)("p", { className: "text-
|
|
79
|
+
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "page-header-collapsible-info", children: (0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleContent, { children: (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full justify-between pt-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "mt-12 flex grow flex-col gap-3 pr-6", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-foreground text-xl font-bold", children: question }), (0, jsx_runtime_1.jsxs)("p", { className: "text-muted-foreground text-sm leading-relaxed font-medium", children: [answer, seeMore && href && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [' ', (0, jsx_runtime_1.jsxs)("a", { target: "_blank", rel: "noopener noreferrer", href: href, className: "text-muted-foreground font-medium", children: [(0, jsx_runtime_1.jsx)("span", { className: "underline underline-offset-4", children: seeMore }), (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { size: 16, className: "ml-1 inline align-middle" })] })] }))] })] }), (0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger, { asChild: true, children: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "link", className: "cursor-pointer self-start", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { size: 24, className: "text-muted-foreground" }) }) })] }) }) }));
|
|
80
80
|
}
|
|
@@ -2,6 +2,10 @@ import { TableCell } from '../../components/ui/table';
|
|
|
2
2
|
export type IdTableCellProps = Omit<React.ComponentProps<typeof TableCell>, 'onCopy'> & {
|
|
3
3
|
id?: string;
|
|
4
4
|
onCopy?: (id: string) => void;
|
|
5
|
+
/** Characters kept from the start of the id. */
|
|
6
|
+
head?: number;
|
|
7
|
+
/** Characters kept from the end of the id. */
|
|
8
|
+
tail?: number;
|
|
5
9
|
};
|
|
6
|
-
export declare const IdTableCell: ({ id, onCopy, ...others }: IdTableCellProps) => import("react").JSX.Element;
|
|
10
|
+
export declare const IdTableCell: ({ id, onCopy, head, tail, ...others }: IdTableCellProps) => import("react").JSX.Element;
|
|
7
11
|
//# sourceMappingURL=id-table-cell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-table-cell.d.ts","sourceRoot":"","sources":["../../../src/components/table/id-table-cell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAGV,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"id-table-cell.d.ts","sourceRoot":"","sources":["../../../src/components/table/id-table-cell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAGV,MAAM,uBAAuB,CAAA;AAS9B,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,EACtC,QAAQ,CACT,GAAG;IACF,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AA6CD,eAAO,MAAM,WAAW,GAAI,uCAMzB,gBAAgB,gCAiClB,CAAA"}
|
|
@@ -1,19 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.IdTableCell = void 0;
|
|
7
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
5
|
const table_1 = require("../../components/ui/table");
|
|
9
6
|
const tooltip_1 = require("../../components/ui/tooltip");
|
|
10
|
-
const truncate_js_1 = __importDefault(require("lodash/truncate.js"));
|
|
11
7
|
const lucide_react_1 = require("lucide-react");
|
|
12
|
-
|
|
8
|
+
/**
|
|
9
|
+
* ⛔ TRUNCATE IN THE MIDDLE, NEVER FROM THE START.
|
|
10
|
+
*
|
|
11
|
+
* This cell renders UUIDs, and a ledger hands out long runs of them from a
|
|
12
|
+
* shared prefix — `00000000-0000-0000-0000-00000000000{1,2,3}`. Keeping the
|
|
13
|
+
* first 13 characters, which is what `truncate(id, { length: 16 })` did,
|
|
14
|
+
* rendered every one of those rows as the same string: the only part that told
|
|
15
|
+
* them apart was the part that was dropped, and the reader had to hover each
|
|
16
|
+
* row in turn to find the one they wanted.
|
|
17
|
+
*
|
|
18
|
+
* Both ends carry information — the head says which family the id belongs to,
|
|
19
|
+
* the tail says which member — so both ends stay.
|
|
20
|
+
*/
|
|
21
|
+
const DEFAULT_HEAD = 8;
|
|
22
|
+
const DEFAULT_TAIL = 4;
|
|
23
|
+
/**
|
|
24
|
+
* ⛔ A BAD LENGTH CANNOT THROW HERE. This runs in a render path, so refusing a
|
|
25
|
+
* malformed prop would unmount the whole table rather than one cell — a
|
|
26
|
+
* consumer computing `head` from data gets a broken cell, not a broken screen.
|
|
27
|
+
*
|
|
28
|
+
* `String.slice` reads a negative number as an offset from the END, so a
|
|
29
|
+
* negative `head` kept nearly the entire id and put an ellipsis in the middle
|
|
30
|
+
* of it, and `NaN` read as 0 and dropped the head — the exact failure middle
|
|
31
|
+
* truncation exists to prevent, and one character LONGER than the untruncated
|
|
32
|
+
* id. Clamped to a non-negative whole number; anything non-finite falls back
|
|
33
|
+
* to the default, which a caller passing `NaN` has already bypassed.
|
|
34
|
+
*/
|
|
35
|
+
function charCount(value, fallback) {
|
|
36
|
+
return Number.isFinite(value) ? Math.max(0, Math.trunc(value)) : fallback;
|
|
37
|
+
}
|
|
38
|
+
function truncateMiddle(id, head, tail) {
|
|
39
|
+
const start = charCount(head, DEFAULT_HEAD);
|
|
40
|
+
const end = charCount(tail, DEFAULT_TAIL);
|
|
41
|
+
// No ellipsis unless it actually saves characters: at head + tail + 1 the
|
|
42
|
+
// truncation is the same length as the id and hides a character for nothing.
|
|
43
|
+
return id.length <= start + end + 1
|
|
44
|
+
? id
|
|
45
|
+
: `${id.slice(0, start)}…${id.slice(id.length - end)}`;
|
|
46
|
+
}
|
|
47
|
+
const IdTableCell = ({ id, onCopy, head = DEFAULT_HEAD, tail = DEFAULT_TAIL, ...others }) => {
|
|
13
48
|
const handleCopyToClipboard = () => {
|
|
49
|
+
// The WHOLE id, never what is rendered. The cell is the only place most
|
|
50
|
+
// consoles expose it, and a truncated id pasted into a query matches
|
|
51
|
+
// nothing.
|
|
14
52
|
navigator.clipboard.writeText(id);
|
|
15
53
|
onCopy?.(id);
|
|
16
54
|
};
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)(table_1.TableCell, { onClick: handleCopyToClipboard,
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(table_1.TableCell, { onClick: handleCopyToClipboard,
|
|
56
|
+
// The tooltip is the styled affordance; `title` is the fallback that
|
|
57
|
+
// survives without it — a printed page, a portal that has not mounted,
|
|
58
|
+
// and the cell padding outside the trigger.
|
|
59
|
+
title: id, ...others, children: (0, jsx_runtime_1.jsxs)(table_1.TableCellWrapper, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipProvider, { children: (0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { delayDuration: 300, children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger, { children: id ? truncateMiddle(id, head, tail) : id }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipContent, { children: id })] }) }), (0, jsx_runtime_1.jsx)(table_1.TableCellAction, { children: (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "size-3.5" }) })] }) }));
|
|
18
60
|
};
|
|
19
61
|
exports.IdTableCell = IdTableCell;
|
|
@@ -25,14 +25,29 @@ export type AutocompleteTriggerProps = React.ComponentProps<'div'> & {
|
|
|
25
25
|
clearLabel?: string;
|
|
26
26
|
};
|
|
27
27
|
export declare function AutocompleteTrigger({ ref, className, onClear, clearLabel, children }: AutocompleteTriggerProps): React.JSX.Element;
|
|
28
|
+
export declare namespace AutocompleteTrigger {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
28
31
|
export declare function AutocompleteValue({ ref, className, value: valueProp, onValueChange, onBlur, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
|
|
32
|
+
export declare namespace AutocompleteValue {
|
|
33
|
+
var displayName: string;
|
|
34
|
+
}
|
|
29
35
|
export type AutocompleteMultipleValueProps = React.ComponentProps<typeof CommandPrimitive.Input> & {
|
|
30
36
|
/** Accessible label for each chip's remove button, prefixed to its value. */
|
|
31
37
|
clearLabel?: string;
|
|
32
38
|
};
|
|
33
39
|
export declare function AutocompleteMultipleValue({ ref, className, clearLabel, ...props }: AutocompleteMultipleValueProps): React.JSX.Element;
|
|
40
|
+
export declare namespace AutocompleteMultipleValue {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
34
43
|
export declare function AutocompleteEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element | null;
|
|
44
|
+
export declare namespace AutocompleteEmpty {
|
|
45
|
+
var displayName: string;
|
|
46
|
+
}
|
|
35
47
|
export declare function AutocompleteLoading({ className, ref, ...props }: React.ComponentProps<typeof CommandPrimitive.Loading>): React.JSX.Element;
|
|
48
|
+
export declare namespace AutocompleteLoading {
|
|
49
|
+
var displayName: string;
|
|
50
|
+
}
|
|
36
51
|
export declare const SIDE_OPTIONS: string[];
|
|
37
52
|
type Side = (typeof SIDE_OPTIONS)[number];
|
|
38
53
|
export type AutocompleteContentProps = React.ComponentProps<typeof CommandPrimitive.List> & {
|
|
@@ -41,7 +56,13 @@ export type AutocompleteContentProps = React.ComponentProps<typeof CommandPrimit
|
|
|
41
56
|
onPointerDownOutside?: (event: MouseEvent | TouchEvent) => void;
|
|
42
57
|
};
|
|
43
58
|
export declare function AutocompleteContent({ className, position, side, ref, children, onMouseEnter, onMouseLeave, onPointerDownOutside, ...props }: AutocompleteContentProps): React.JSX.Element;
|
|
59
|
+
export declare namespace AutocompleteContent {
|
|
60
|
+
var displayName: string;
|
|
61
|
+
}
|
|
44
62
|
export declare function AutocompleteGroup({ className, ...props }: React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>): React.JSX.Element;
|
|
63
|
+
export declare namespace AutocompleteGroup {
|
|
64
|
+
var displayName: string;
|
|
65
|
+
}
|
|
45
66
|
export type AutocompleteItemProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item> & {
|
|
46
67
|
/** Text this option reads as wherever it is rendered outside the list (the
|
|
47
68
|
* input, a chip and its remove button). Required only when the children are
|
|
@@ -78,5 +99,8 @@ export type AutocompleteProps = Omit<React.ComponentProps<typeof CommandPrimitiv
|
|
|
78
99
|
multiple?: boolean;
|
|
79
100
|
};
|
|
80
101
|
export declare function Autocomplete({ ref, value, defaultValue, onValueChange, onClear, className, open: openProp, onOpenChange, showValue, readOnly, disabled, multiple, onKeyDown, children, ...props }: AutocompleteProps): React.JSX.Element;
|
|
102
|
+
export declare namespace Autocomplete {
|
|
103
|
+
var displayName: string;
|
|
104
|
+
}
|
|
81
105
|
export {};
|
|
82
106
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/autocomplete/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAmB,MAAM,MAAM,CAAA;AAInE,MAAM,MAAM,uBAAuB,GACjC,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,GAAG;IAC3C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CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,KAAK,EACL,YAAY,EACZ,aAAa,EACb,OAAO,EACP,SAAS,EACT,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,iBAAiB,qBAmInB;yBAnJe,YAAY"}
|
|
@@ -414,3 +414,27 @@ function Autocomplete({ ref, value, defaultValue, onValueChange, onClear, classN
|
|
|
414
414
|
onKeyDown?.(e);
|
|
415
415
|
}, children: children }) }));
|
|
416
416
|
}
|
|
417
|
+
/**
|
|
418
|
+
* ⛔ THE REST OF THE SET, FOR THE SAME REASON AS `AutocompleteItem` ABOVE.
|
|
419
|
+
*
|
|
420
|
+
* A function component's `name` is whatever the bundler left it — one letter in
|
|
421
|
+
* a production build — so any lookup written against `child.type` needs an
|
|
422
|
+
* explicit string to compare. `AutocompleteItem` is the only part the walk
|
|
423
|
+
* reads TODAY, and it is the part that shipped an empty option registry to
|
|
424
|
+
* every consumer while it was anonymous. Naming the whole set costs a line each
|
|
425
|
+
* and removes the next instance of that defect before it is written; it also
|
|
426
|
+
* makes these parts legible in a React tree, which `MultipleSelect` next door
|
|
427
|
+
* has always done.
|
|
428
|
+
*
|
|
429
|
+
* `__tests__`-style enumeration lives in `autocomplete.test.tsx`: it reads the
|
|
430
|
+
* module's exports rather than a list, so a new part added without a name fails
|
|
431
|
+
* without anyone remembering to extend anything.
|
|
432
|
+
*/
|
|
433
|
+
Autocomplete.displayName = 'Autocomplete';
|
|
434
|
+
AutocompleteTrigger.displayName = 'AutocompleteTrigger';
|
|
435
|
+
AutocompleteValue.displayName = 'AutocompleteValue';
|
|
436
|
+
AutocompleteMultipleValue.displayName = 'AutocompleteMultipleValue';
|
|
437
|
+
AutocompleteContent.displayName = 'AutocompleteContent';
|
|
438
|
+
AutocompleteGroup.displayName = 'AutocompleteGroup';
|
|
439
|
+
AutocompleteEmpty.displayName = 'AutocompleteEmpty';
|
|
440
|
+
AutocompleteLoading.displayName = 'AutocompleteLoading';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/copy-field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAmCD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,MAAc,EACd,WAAW,EACX,WAA0B,EAC1B,SAAwB,EACxB,UAA4B,EAC5B,mBAAmB,EACpB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/copy-field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAmCD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,MAAc,EACd,WAAW,EACX,WAA0B,EAC1B,SAAwB,EACxB,UAA4B,EAC5B,mBAAmB,EACpB,EAAE,cAAc,qBAkKhB"}
|
|
@@ -151,5 +151,5 @@ function CopyField({ value, label, masked = false, onCopyLabel, revealLabel = 'S
|
|
|
151
151
|
// long value (e.g. a UUID recovery code) scrolls inside the field
|
|
152
152
|
// instead of overflowing its container. No `font-mono`: the value
|
|
153
153
|
// inherits the app sans font (Inter) so it matches every other field.
|
|
154
|
-
className: "text-input-foreground h-full min-w-0 flex-1 cursor-text border-none bg-transparent text-sm outline-none select-text focus:ring-0 focus:ring-offset-0" }), masked ? ((0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { type: "button", variant: "outline", size: "small", rounded: true, "aria-
|
|
154
|
+
className: "text-input-foreground h-full min-w-0 flex-1 cursor-text border-none bg-transparent text-sm outline-none select-text focus:ring-0 focus:ring-offset-0" }), masked ? ((0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { type: "button", variant: "outline", size: "small", rounded: true, "aria-label": revealed ? hideLabel : revealLabel, onClick: () => setRevealed((prev) => !prev), children: revealed ? (0, jsx_runtime_1.jsx)(lucide_react_1.EyeOff, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Eye, {}) })) : null, (0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { type: "button", variant: "outline", size: "small", rounded: true, "aria-label": copyAccessibleName, onClick: handleCopy, children: copied ? (0, jsx_runtime_1.jsx)(lucide_react_1.Check, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, {}) })] })] }));
|
|
155
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sheet/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,iBAAS,KAAK,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,qBAE5E;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,qBAErD;AAED,iBAAS,UAAU,CAAC,EAClB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,qBAEnD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,MAAM,CAAC,qBAEpD;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,qBAWrD;AAED,QAAA,MAAM,aAAa;;8EAiBlB,CAAA;AAED,KAAK,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,GAC1E,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAEpC,iBAAS,YAAY,CAAC,EACpB,IAAc,EACd,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,iBAAiB,
|
|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CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWxE;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,qBAWnD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,WAAW,CAAC,qBAQzD;AAED,OAAO,EACL,KAAK,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,gBAAgB,EACjB,CAAA"}
|
|
@@ -87,7 +87,7 @@ function SheetContent({ side = 'right', className, children, onInteractOutside,
|
|
|
87
87
|
}
|
|
88
88
|
onInteractOutside?.(event);
|
|
89
89
|
}, [onInteractOutside]);
|
|
90
|
-
return ((0, jsx_runtime_1.jsxs)(SheetPortal, { children: [(0, jsx_runtime_1.jsx)(SheetOverlay, {}), (0, jsx_runtime_1.jsxs)(SheetPrimitive.Content, { "data-slot": "sheet-content", className: (0, utils_1.cn)('flex max-h-screen flex-col overflow-x-auto px-8 pb-0', sheetVariants({ side }), className), onInteractOutside: handleInteractOutside, ...props, children: [children, (0, jsx_runtime_1.jsxs)(SheetPrimitive.Close, { className: "data-[state=open]:bg-secondary absolute top-7 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden disabled:pointer-events-none", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-6 w-6" }), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Close" })] })] })] }));
|
|
90
|
+
return ((0, jsx_runtime_1.jsxs)(SheetPortal, { children: [(0, jsx_runtime_1.jsx)(SheetOverlay, {}), (0, jsx_runtime_1.jsxs)(SheetPrimitive.Content, { "data-slot": "sheet-content", className: (0, utils_1.cn)('flex max-h-screen flex-col overflow-x-auto px-8 pb-0', sheetVariants({ side }), className), onInteractOutside: handleInteractOutside, ...props, children: [children, (0, jsx_runtime_1.jsxs)(SheetPrimitive.Close, { className: "data-[state=open]:bg-secondary ring-offset-background focus-visible:ring-ring absolute top-7 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-6 w-6" }), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Close" })] })] })] }));
|
|
91
91
|
}
|
|
92
92
|
function SheetHeader({ className, ...props }) {
|
|
93
93
|
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "sheet-header", className: (0, utils_1.cn)('mb-4 flex flex-col space-y-2 text-center sm:text-left', className), ...props }));
|
|
@@ -99,5 +99,5 @@ function SheetTitle({ className, ...props }) {
|
|
|
99
99
|
return ((0, jsx_runtime_1.jsx)(SheetPrimitive.Title, { "data-slot": "sheet-title", className: (0, utils_1.cn)('text-muted-foreground mb-2 flex text-xl font-bold', className), ...props }));
|
|
100
100
|
}
|
|
101
101
|
function SheetDescription({ className, ...props }) {
|
|
102
|
-
return ((0, jsx_runtime_1.jsx)(SheetPrimitive.Description, { "data-slot": "sheet-description", className: (0, utils_1.cn)('text-
|
|
102
|
+
return ((0, jsx_runtime_1.jsx)(SheetPrimitive.Description, { "data-slot": "sheet-description", className: (0, utils_1.cn)('text-muted-foreground text-sm font-medium', className), ...props }));
|
|
103
103
|
}
|
|
@@ -4,6 +4,7 @@ export * from './sidebar-item-icon-button';
|
|
|
4
4
|
export * from './sidebar-item-button';
|
|
5
5
|
export * from './sidebar-item';
|
|
6
6
|
export * from './sidebar-expand-button';
|
|
7
|
+
export * from './sidebar-trigger';
|
|
7
8
|
export * from './sidebar-back-button';
|
|
8
9
|
export * from './sidebar-provider';
|
|
9
10
|
export * from './sidebar-item-collapsible';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sidebar/index.tsx"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,yBAAyB,CAAA;AACvC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sidebar/index.tsx"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kBAAkB,CAAA"}
|
|
@@ -20,6 +20,7 @@ __exportStar(require("./sidebar-item-icon-button"), exports);
|
|
|
20
20
|
__exportStar(require("./sidebar-item-button"), exports);
|
|
21
21
|
__exportStar(require("./sidebar-item"), exports);
|
|
22
22
|
__exportStar(require("./sidebar-expand-button"), exports);
|
|
23
|
+
__exportStar(require("./sidebar-trigger"), exports);
|
|
23
24
|
__exportStar(require("./sidebar-back-button"), exports);
|
|
24
25
|
__exportStar(require("./sidebar-provider"), exports);
|
|
25
26
|
__exportStar(require("./sidebar-item-collapsible"), exports);
|
|
@@ -7,6 +7,6 @@ type SidebarExpandButtonProps = {
|
|
|
7
7
|
*/
|
|
8
8
|
tooltip?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare const SidebarExpandButton: ({ tooltip }: SidebarExpandButtonProps) => React.JSX.Element;
|
|
10
|
+
export declare const SidebarExpandButton: ({ tooltip }: SidebarExpandButtonProps) => React.JSX.Element | null;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=sidebar-expand-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-expand-button.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sidebar/sidebar-expand-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,KAAK,wBAAwB,GAAG;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,aAAa,wBAAwB,
|
|
1
|
+
{"version":3,"file":"sidebar-expand-button.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sidebar/sidebar-expand-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,KAAK,wBAAwB,GAAG;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,aAAa,wBAAwB,6BAwExE,CAAA"}
|
|
@@ -13,7 +13,21 @@ const sidebar_components_1 = require("./sidebar-components");
|
|
|
13
13
|
const tooltip_1 = require("../../ui/tooltip");
|
|
14
14
|
const icon_button_1 = require("../icon-button");
|
|
15
15
|
const SidebarExpandButton = ({ tooltip }) => {
|
|
16
|
-
const { isCollapsed, toggleSidebar } = (0, sidebar_provider_1.useSidebar)();
|
|
16
|
+
const { isCollapsed, isDrawer, toggleSidebar } = (0, sidebar_provider_1.useSidebar)();
|
|
17
|
+
/**
|
|
18
|
+
* Nothing to collapse in a drawer. The expanded branch below hangs its button
|
|
19
|
+
* at `right-[-20px]`, twenty pixels outside the rail — off the canvas of an
|
|
20
|
+
* overlay that has no page beside it — and collapsing to a 72px strip inside
|
|
21
|
+
* a 244px sheet is not a state worth reaching. The drawer's own close control
|
|
22
|
+
* and the backdrop are how it is dismissed.
|
|
23
|
+
*
|
|
24
|
+
* ⚠️ `isDrawer`, NOT `isMobile`. A consumer left on the default
|
|
25
|
+
* `mobile="inline"` still has a real rail below 768px, and its collapse
|
|
26
|
+
* control has to come with it.
|
|
27
|
+
*/
|
|
28
|
+
if (isDrawer) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
17
31
|
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [!isCollapsed && ((0, jsx_runtime_1.jsx)("div", { "data-slot": "sidebar-expand-button", className: "border-border bg-card flex w-full", children: (0, jsx_runtime_1.jsx)("div", { className: "absolute right-[-20px] bottom-4", children: (0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { variant: "secondary", rounded: true, onClick: toggleSidebar, "aria-label": tooltip || 'Collapse sidebar', "aria-expanded": true, children: (0, jsx_runtime_1.jsx)(lucide_react_1.PanelLeftClose, { className: "text-muted-foreground" }) }) }) })), isCollapsed && ((0, jsx_runtime_1.jsx)(sidebar_components_1.SidebarFooter, { children: (0, jsx_runtime_1.jsx)(tooltip_1.TooltipProvider, { children: (0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger
|
|
18
32
|
// `hover:text-accent-foreground` on the TRIGGER, not only on
|
|
19
33
|
// the glyph below. The base ink here used to be base/400, which
|
|
@@ -9,5 +9,5 @@ export type SidebarItemProps = React.ComponentProps<typeof SidebarItemButton> &
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
};
|
|
12
|
-
export declare const SidebarItem: ({ active, href, children: _children, ...props }: SidebarItemProps) => React.JSX.Element;
|
|
12
|
+
export declare const SidebarItem: ({ active, href, children: _children, onClick, ...props }: SidebarItemProps) => React.JSX.Element;
|
|
13
13
|
//# sourceMappingURL=sidebar-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-item.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sidebar/sidebar-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAIlE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,GAC3E,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,GAAG;IACnD,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAEH,eAAO,MAAM,WAAW,GAAI,
|
|
1
|
+
{"version":3,"file":"sidebar-item.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sidebar/sidebar-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAIlE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,GAC3E,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,GAAG;IACnD,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CA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