@calcifer-design/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/Button.d.ts +12 -0
- package/dist/components/Button/Button.js +26 -0
- package/dist/components/Button/Button.module.js +6 -0
- package/dist/components/Button/Button_module.css +79 -0
- package/dist/components/Button/LinkButton.d.ts +19 -0
- package/dist/components/Button/LinkButton.js +24 -0
- package/dist/components/Card/Card.d.ts +15 -0
- package/dist/components/Card/Card.js +31 -0
- package/dist/components/Card/Card.module.js +9 -0
- package/dist/components/Card/Card_module.css +55 -0
- package/dist/components/DataTable/DataTable.d.ts +46 -0
- package/dist/components/DataTable/DataTable.js +98 -0
- package/dist/components/DataTable/DataTable.module.js +13 -0
- package/dist/components/DataTable/DataTable_module.css +149 -0
- package/dist/components/LiveRegion/LiveRegion.d.ts +5 -0
- package/dist/components/LiveRegion/LiveRegion.js +13 -0
- package/dist/components/LiveRegion/LiveRegion.module.js +5 -0
- package/dist/components/LiveRegion/LiveRegion_module.css +12 -0
- package/dist/components/NavMenu/NavMenu.d.ts +19 -0
- package/dist/components/NavMenu/NavMenu.js +86 -0
- package/dist/components/NavMenu/NavMenu.module.js +12 -0
- package/dist/components/NavMenu/NavMenu_module.css +85 -0
- package/dist/components/PageHeading/PageHeading.d.ts +16 -0
- package/dist/components/PageHeading/PageHeading.js +32 -0
- package/dist/components/PageHeading/PageHeading.module.js +7 -0
- package/dist/components/PageHeading/PageHeading_module.css +53 -0
- package/dist/components/SkipLink/SkipLink.d.ts +6 -0
- package/dist/components/SkipLink/SkipLink.js +11 -0
- package/dist/components/SkipLink/SkipLink.module.js +5 -0
- package/dist/components/SkipLink/SkipLink_module.css +24 -0
- package/dist/components/StatusDot/StatusDot.d.ts +17 -0
- package/dist/components/StatusDot/StatusDot.js +26 -0
- package/dist/components/StatusDot/StatusDot.module.js +9 -0
- package/dist/components/StatusDot/StatusDot_module.css +73 -0
- package/dist/components/Tabs/Tabs.d.ts +16 -0
- package/dist/components/Tabs/Tabs.js +35 -0
- package/dist/components/Tabs/Tabs.module.js +8 -0
- package/dist/components/Tabs/Tabs_module.css +53 -0
- package/dist/components/Tag/Tag.d.ts +6 -0
- package/dist/components/Tag/Tag.js +10 -0
- package/dist/components/Tag/Tag.module.js +5 -0
- package/dist/components/Tag/Tag_module.css +20 -0
- package/dist/hooks/useMediaQuery.d.ts +3 -0
- package/dist/hooks/useMediaQuery.js +22 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +12 -0
- package/dist/styles/base.css +58 -0
- package/package.json +69 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Button as BaseButton } from '@base-ui/react/button';
|
|
2
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'ghost';
|
|
4
|
+
export type ButtonSize = 'md' | 'sm';
|
|
5
|
+
export interface ButtonProps extends Omit<ComponentPropsWithoutRef<typeof BaseButton>, 'className'> {
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
/** Shows a busy state, keeps the button focusable, and blocks activation. */
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Button({ variant, size, loading, disabled, className, children, nativeButton, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "@base-ui/react/button";
|
|
3
|
+
import Button_module from "./Button.module.js";
|
|
4
|
+
function Button_Button({ variant = 'primary', size = 'md', loading = false, disabled, className, children, nativeButton, ...rest }) {
|
|
5
|
+
const isDisabled = Boolean(disabled) || loading;
|
|
6
|
+
const isNativeButton = nativeButton ?? !rest.render;
|
|
7
|
+
return /*#__PURE__*/ jsx(Button, {
|
|
8
|
+
...rest,
|
|
9
|
+
nativeButton: isNativeButton,
|
|
10
|
+
className: [
|
|
11
|
+
Button_module.root,
|
|
12
|
+
className
|
|
13
|
+
].filter(Boolean).join(' '),
|
|
14
|
+
"data-variant": variant,
|
|
15
|
+
"data-size": size,
|
|
16
|
+
"data-loading": loading ? '' : void 0,
|
|
17
|
+
disabled: isDisabled,
|
|
18
|
+
focusableWhenDisabled: loading,
|
|
19
|
+
"aria-busy": loading || void 0,
|
|
20
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
21
|
+
className: Button_module.label,
|
|
22
|
+
children: children
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export { Button_Button as Button };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.root-kIffN {
|
|
2
|
+
justify-content: center;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: var(--space-2);
|
|
5
|
+
min-height: var(--size-touch);
|
|
6
|
+
min-width: var(--size-touch);
|
|
7
|
+
padding: var(--space-2) var(--space-5);
|
|
8
|
+
border-radius: var(--radius-full);
|
|
9
|
+
font-size: var(--text-md);
|
|
10
|
+
font-weight: 500;
|
|
11
|
+
line-height: var(--leading-snug);
|
|
12
|
+
letter-spacing: var(--tracking-body);
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
transition-property: background-color, color, border-color, box-shadow, transform;
|
|
16
|
+
transition-duration: var(--motion-duration-1);
|
|
17
|
+
transition-timing-function: var(--motion-ease);
|
|
18
|
+
-webkit-tap-highlight-color: transparent;
|
|
19
|
+
border: 1px solid #0000;
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.root-kIffN[data-size="sm"] {
|
|
25
|
+
min-height: 2.5rem;
|
|
26
|
+
padding: var(--space-1) var(--space-4);
|
|
27
|
+
font-size: var(--text-sm);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.root-kIffN[data-variant="primary"] {
|
|
31
|
+
background: var(--color-accent);
|
|
32
|
+
color: var(--color-accent-text);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.root-kIffN[data-variant="secondary"] {
|
|
36
|
+
border-radius: var(--radius-md);
|
|
37
|
+
background: var(--color-surface-raised);
|
|
38
|
+
color: var(--color-text);
|
|
39
|
+
border-color: var(--color-border-strong);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.root-kIffN[data-variant="ghost"] {
|
|
43
|
+
padding-inline: var(--space-2);
|
|
44
|
+
border-radius: var(--radius-md);
|
|
45
|
+
color: var(--color-link);
|
|
46
|
+
background: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@media (hover: hover) {
|
|
50
|
+
.root-kIffN[data-variant="primary"]:hover:not([data-disabled]) {
|
|
51
|
+
background: var(--color-accent-hover);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.root-kIffN[data-variant="secondary"]:hover:not([data-disabled]) {
|
|
55
|
+
background: var(--color-surface-2);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.root-kIffN[data-variant="ghost"]:hover:not([data-disabled]) {
|
|
59
|
+
text-decoration: underline;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.root-kIffN:active:not([data-disabled]) {
|
|
64
|
+
transform: scale(.98);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.root-kIffN[data-disabled] {
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
opacity: .45;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.label-Ujxp1 {
|
|
73
|
+
display: inline-block;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.root-kIffN[data-loading] .label-Ujxp1 {
|
|
77
|
+
opacity: .7;
|
|
78
|
+
}
|
|
79
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
3
|
+
import type { ButtonSize, ButtonVariant } from './Button.js';
|
|
4
|
+
export interface LinkButtonProps extends ComponentPropsWithRef<'a'> {
|
|
5
|
+
variant?: ButtonVariant;
|
|
6
|
+
size?: ButtonSize;
|
|
7
|
+
/**
|
|
8
|
+
* Replaces the rendered `<a>` so a router link can wear the button styling; the
|
|
9
|
+
* element's own props are merged with the ones this component supplies.
|
|
10
|
+
*/
|
|
11
|
+
render?: useRender.RenderProp;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A link that looks like a `Button`. It shares `Button`'s styling but none of its
|
|
15
|
+
* semantics: no `role`, no button behaviour, so assistive technology announces a
|
|
16
|
+
* destination change rather than an action. Use it for navigation; use `Button` for
|
|
17
|
+
* anything that acts on the current page.
|
|
18
|
+
*/
|
|
19
|
+
export declare function LinkButton({ variant, size, className, children, render, ref, ...rest }: LinkButtonProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import Button_module from "./Button.module.js";
|
|
4
|
+
function LinkButton({ variant = 'primary', size = 'md', className, children, render, ref, ...rest }) {
|
|
5
|
+
return useRender({
|
|
6
|
+
defaultTagName: 'a',
|
|
7
|
+
render,
|
|
8
|
+
ref,
|
|
9
|
+
props: {
|
|
10
|
+
...rest,
|
|
11
|
+
className: [
|
|
12
|
+
Button_module.root,
|
|
13
|
+
className
|
|
14
|
+
].filter(Boolean).join(' '),
|
|
15
|
+
'data-variant': variant,
|
|
16
|
+
'data-size': size,
|
|
17
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
18
|
+
className: Button_module.label,
|
|
19
|
+
children: children
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export { LinkButton };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface CardProps {
|
|
3
|
+
as?: 'div' | 'article' | 'section';
|
|
4
|
+
heading?: ReactNode;
|
|
5
|
+
headingLevel?: 2 | 3;
|
|
6
|
+
/** Rendered on the heading's row, pushed to the end: a status pill, a version, a badge. */
|
|
7
|
+
headingAside?: ReactNode;
|
|
8
|
+
footer?: ReactNode;
|
|
9
|
+
/** `danger` is the failed-remote card: tinted surface and border. */
|
|
10
|
+
tone?: 'default' | 'danger';
|
|
11
|
+
/** Lifts on hover; use when the card's main action is a link inside it. */
|
|
12
|
+
interactive?: boolean;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function Card({ as: Element, heading, headingLevel, headingAside, footer, tone, interactive, children, }: CardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Card_module from "./Card.module.js";
|
|
3
|
+
function Card({ as: Element = 'div', heading, headingLevel = 3, headingAside, footer, tone = 'default', interactive = false, children }) {
|
|
4
|
+
const Heading = 2 === headingLevel ? 'h2' : 'h3';
|
|
5
|
+
return /*#__PURE__*/ jsxs(Element, {
|
|
6
|
+
className: Card_module.root,
|
|
7
|
+
"data-tone": tone,
|
|
8
|
+
"data-interactive": interactive ? '' : void 0,
|
|
9
|
+
children: [
|
|
10
|
+
heading ? /*#__PURE__*/ jsxs("div", {
|
|
11
|
+
className: Card_module.header,
|
|
12
|
+
children: [
|
|
13
|
+
/*#__PURE__*/ jsx(Heading, {
|
|
14
|
+
className: Card_module.heading,
|
|
15
|
+
children: heading
|
|
16
|
+
}),
|
|
17
|
+
headingAside
|
|
18
|
+
]
|
|
19
|
+
}) : null,
|
|
20
|
+
/*#__PURE__*/ jsx("div", {
|
|
21
|
+
className: Card_module.body,
|
|
22
|
+
children: children
|
|
23
|
+
}),
|
|
24
|
+
footer ? /*#__PURE__*/ jsx("div", {
|
|
25
|
+
className: Card_module.footer,
|
|
26
|
+
children: footer
|
|
27
|
+
}) : null
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export { Card };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.root-Burn_ {
|
|
2
|
+
gap: var(--space-3);
|
|
3
|
+
padding: var(--space-5);
|
|
4
|
+
background: var(--color-surface-raised);
|
|
5
|
+
border: 1px solid var(--color-card-border);
|
|
6
|
+
border-radius: var(--radius-xl);
|
|
7
|
+
box-shadow: var(--elevation-1);
|
|
8
|
+
transition-property: transform, box-shadow;
|
|
9
|
+
transition-duration: var(--motion-duration-3);
|
|
10
|
+
transition-timing-function: var(--motion-ease);
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
display: flex;
|
|
13
|
+
position: relative;
|
|
14
|
+
container-type: inline-size;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.root-Burn_[data-tone="danger"] {
|
|
18
|
+
background: var(--color-danger-surface);
|
|
19
|
+
border-color: var(--color-danger-border);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media (hover: hover) {
|
|
23
|
+
.root-Burn_[data-interactive]:hover {
|
|
24
|
+
box-shadow: var(--elevation-2);
|
|
25
|
+
transform: translateY(-2px);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.header-vKZVf {
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: var(--space-2);
|
|
33
|
+
display: flex;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.heading-ZZrOA {
|
|
37
|
+
font-size: var(--text-h3);
|
|
38
|
+
line-height: var(--leading-snug);
|
|
39
|
+
letter-spacing: var(--tracking-heading);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.body-na04U {
|
|
43
|
+
gap: var(--space-3);
|
|
44
|
+
color: var(--color-text-muted);
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
display: flex;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.footer-bRVor {
|
|
50
|
+
gap: var(--space-2);
|
|
51
|
+
flex-wrap: wrap;
|
|
52
|
+
margin-top: auto;
|
|
53
|
+
display: flex;
|
|
54
|
+
}
|
|
55
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type ColumnDef as TanStackColumnDef, type RowData, type SortingState } from '@tanstack/react-table';
|
|
2
|
+
import type { BreakpointName } from '@calcifer-design/tokens';
|
|
3
|
+
declare const features: {
|
|
4
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
5
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
6
|
+
sortFns: {
|
|
7
|
+
alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
8
|
+
text: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
9
|
+
datetime: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type ColumnDef<Row extends RowData, Value = unknown> = TanStackColumnDef<typeof features, Row, Value>;
|
|
13
|
+
export type { SortingState };
|
|
14
|
+
/**
|
|
15
|
+
* Thin wrapper so consumers call `createColumnHelper<Row>()` exactly as they would
|
|
16
|
+
* against the v8 API.
|
|
17
|
+
*
|
|
18
|
+
* Build the resulting column array with `columnHelper.columns([...])`, not a plain
|
|
19
|
+
* array literal: under v9's feature-based typing, wrapping the array through the
|
|
20
|
+
* helper is what preserves each individual column's `TValue`, rather than widening
|
|
21
|
+
* every column to the union of all of them.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createColumnHelper<Row extends RowData>(): import("@tanstack/react-table").ColumnHelper<{
|
|
24
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
25
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
26
|
+
sortFns: {
|
|
27
|
+
alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
28
|
+
text: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
29
|
+
datetime: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
30
|
+
};
|
|
31
|
+
}, Row>;
|
|
32
|
+
export interface DataTableProps<Row extends RowData> {
|
|
33
|
+
caption: string;
|
|
34
|
+
/** Build with `columnHelper.columns([...])` (see `createColumnHelper` above), not a plain array literal. */
|
|
35
|
+
columns: ColumnDef<Row, unknown>[];
|
|
36
|
+
data: Row[];
|
|
37
|
+
getRowId?: (row: Row) => string;
|
|
38
|
+
initialSort?: SortingState;
|
|
39
|
+
/** Below this breakpoint, rows render stacked with header labels. */
|
|
40
|
+
stackBelow?: BreakpointName;
|
|
41
|
+
/** Drop the wrapper's own border, radius and surface when a panel already frames it. */
|
|
42
|
+
bare?: boolean;
|
|
43
|
+
/** Keep the caption for assistive tech but hide it visually (the panel shows the title). */
|
|
44
|
+
hideCaption?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare function DataTable<Row extends RowData>({ caption, columns, data, getRowId, initialSort, stackBelow, bare, hideCaption, }: DataTableProps<Row>): import("react").JSX.Element;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createColumnHelper, createSortedRowModel, flexRender, rowSortingFeature, sortFn_alphanumeric, sortFn_datetime, sortFn_text, tableFeatures, useTable } from "@tanstack/react-table";
|
|
3
|
+
import { useId, useState } from "react";
|
|
4
|
+
import { minWidth, useMediaQuery } from "../../hooks/useMediaQuery.js";
|
|
5
|
+
import DataTable_module from "./DataTable.module.js";
|
|
6
|
+
const features = tableFeatures({
|
|
7
|
+
rowSortingFeature: rowSortingFeature,
|
|
8
|
+
sortedRowModel: createSortedRowModel(),
|
|
9
|
+
sortFns: {
|
|
10
|
+
alphanumeric: sortFn_alphanumeric,
|
|
11
|
+
text: sortFn_text,
|
|
12
|
+
datetime: sortFn_datetime
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
function DataTable_createColumnHelper() {
|
|
16
|
+
return createColumnHelper();
|
|
17
|
+
}
|
|
18
|
+
const ariaSortByDirection = {
|
|
19
|
+
asc: 'ascending',
|
|
20
|
+
desc: 'descending'
|
|
21
|
+
};
|
|
22
|
+
function DataTable({ caption, columns, data, getRowId, initialSort = [], stackBelow, bare = false, hideCaption = false }) {
|
|
23
|
+
const [sorting, setSorting] = useState(initialSort);
|
|
24
|
+
const captionId = useId();
|
|
25
|
+
const isWide = useMediaQuery(stackBelow ? minWidth(stackBelow) : '(min-width: 0px)');
|
|
26
|
+
const stacked = Boolean(stackBelow) && !isWide;
|
|
27
|
+
const table = useTable({
|
|
28
|
+
features: features,
|
|
29
|
+
data,
|
|
30
|
+
columns,
|
|
31
|
+
state: {
|
|
32
|
+
sorting
|
|
33
|
+
},
|
|
34
|
+
onSortingChange: setSorting,
|
|
35
|
+
getRowId
|
|
36
|
+
});
|
|
37
|
+
return /*#__PURE__*/ jsx("div", {
|
|
38
|
+
className: DataTable_module.scroll,
|
|
39
|
+
"data-bare": bare ? '' : void 0,
|
|
40
|
+
role: "region",
|
|
41
|
+
"aria-labelledby": captionId,
|
|
42
|
+
tabIndex: 0,
|
|
43
|
+
children: /*#__PURE__*/ jsxs("table", {
|
|
44
|
+
className: DataTable_module.table,
|
|
45
|
+
"data-stacked": stacked ? '' : void 0,
|
|
46
|
+
children: [
|
|
47
|
+
/*#__PURE__*/ jsx("caption", {
|
|
48
|
+
id: captionId,
|
|
49
|
+
className: DataTable_module.caption,
|
|
50
|
+
"data-hidden": hideCaption ? '' : void 0,
|
|
51
|
+
children: caption
|
|
52
|
+
}),
|
|
53
|
+
/*#__PURE__*/ jsx("thead", {
|
|
54
|
+
className: DataTable_module.head,
|
|
55
|
+
children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ jsx("tr", {
|
|
56
|
+
children: headerGroup.headers.map((header)=>{
|
|
57
|
+
const sortDirection = header.column.getIsSorted();
|
|
58
|
+
const canSort = header.column.getCanSort();
|
|
59
|
+
return /*#__PURE__*/ jsx("th", {
|
|
60
|
+
scope: "col",
|
|
61
|
+
className: DataTable_module.headerCell,
|
|
62
|
+
"aria-sort": sortDirection ? ariaSortByDirection[sortDirection] : void 0,
|
|
63
|
+
children: canSort ? /*#__PURE__*/ jsxs("button", {
|
|
64
|
+
type: "button",
|
|
65
|
+
className: DataTable_module.sortButton,
|
|
66
|
+
onClick: header.column.getToggleSortingHandler(),
|
|
67
|
+
children: [
|
|
68
|
+
flexRender(header.column.columnDef.header, header.getContext()),
|
|
69
|
+
/*#__PURE__*/ jsx("span", {
|
|
70
|
+
"aria-hidden": "true",
|
|
71
|
+
className: DataTable_module.sortIcon,
|
|
72
|
+
"data-direction": sortDirection || 'none'
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
}) : flexRender(header.column.columnDef.header, header.getContext())
|
|
76
|
+
}, header.id);
|
|
77
|
+
})
|
|
78
|
+
}, headerGroup.id))
|
|
79
|
+
}),
|
|
80
|
+
/*#__PURE__*/ jsx("tbody", {
|
|
81
|
+
children: table.getRowModel().rows.map((row)=>/*#__PURE__*/ jsx("tr", {
|
|
82
|
+
className: DataTable_module.row,
|
|
83
|
+
children: row.getAllCells().map((cell)=>{
|
|
84
|
+
const header = cell.column.columnDef.header;
|
|
85
|
+
const headerLabel = 'string' == typeof header ? header : cell.column.id;
|
|
86
|
+
return /*#__PURE__*/ jsx("td", {
|
|
87
|
+
className: DataTable_module.cell,
|
|
88
|
+
"data-label": headerLabel,
|
|
89
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
90
|
+
}, cell.id);
|
|
91
|
+
})
|
|
92
|
+
}, row.id))
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
export { DataTable, DataTable_createColumnHelper as createColumnHelper };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "./DataTable_module.css";
|
|
2
|
+
const DataTable_module = {
|
|
3
|
+
scroll: "scroll-vHFjf",
|
|
4
|
+
table: "table-H20Eb",
|
|
5
|
+
caption: "caption-glW7e",
|
|
6
|
+
head: "head-KQpiR",
|
|
7
|
+
headerCell: "headerCell-Bm5aB",
|
|
8
|
+
sortButton: "sortButton-b2Ze6",
|
|
9
|
+
sortIcon: "sortIcon-sc98J",
|
|
10
|
+
row: "row-oItIj",
|
|
11
|
+
cell: "cell-L4VgS"
|
|
12
|
+
};
|
|
13
|
+
export default DataTable_module;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
.scroll-vHFjf {
|
|
2
|
+
border: 1px solid var(--color-border);
|
|
3
|
+
border-radius: var(--radius-lg);
|
|
4
|
+
background: var(--color-surface-raised);
|
|
5
|
+
overflow-x: auto;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.scroll-vHFjf[data-bare] {
|
|
9
|
+
background: none;
|
|
10
|
+
border: 0;
|
|
11
|
+
border-radius: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.table-H20Eb {
|
|
15
|
+
border-collapse: collapse;
|
|
16
|
+
width: 100%;
|
|
17
|
+
font-size: var(--text-sm);
|
|
18
|
+
font-variant-numeric: tabular-nums;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.caption-glW7e {
|
|
22
|
+
padding: var(--space-3) var(--space-5);
|
|
23
|
+
text-align: left;
|
|
24
|
+
color: var(--color-text);
|
|
25
|
+
caption-side: top;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.caption-glW7e[data-hidden] {
|
|
30
|
+
clip-path: inset(50%);
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
border: 0;
|
|
33
|
+
width: 1px;
|
|
34
|
+
height: 1px;
|
|
35
|
+
margin: -1px;
|
|
36
|
+
padding: 0;
|
|
37
|
+
position: absolute;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.head-KQpiR {
|
|
42
|
+
background: var(--color-surface-2);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.headerCell-Bm5aB {
|
|
46
|
+
padding: var(--space-1) var(--space-3);
|
|
47
|
+
border-block: 1px solid var(--color-border);
|
|
48
|
+
text-align: left;
|
|
49
|
+
font-family: var(--font-mono);
|
|
50
|
+
font-size: var(--text-2xs);
|
|
51
|
+
letter-spacing: var(--tracking-wide);
|
|
52
|
+
text-transform: uppercase;
|
|
53
|
+
color: var(--color-text-subtle);
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
font-weight: 500;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.sortButton-b2Ze6 {
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: var(--space-1);
|
|
61
|
+
min-height: var(--size-touch);
|
|
62
|
+
font: inherit;
|
|
63
|
+
letter-spacing: inherit;
|
|
64
|
+
text-transform: inherit;
|
|
65
|
+
color: inherit;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
background: none;
|
|
68
|
+
border: 0;
|
|
69
|
+
padding: 0;
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.sortIcon-sc98J:after {
|
|
74
|
+
content: "↕";
|
|
75
|
+
color: var(--color-text-subtle);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.sortIcon-sc98J[data-direction="asc"]:after {
|
|
79
|
+
content: "↑";
|
|
80
|
+
color: var(--color-link);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.sortIcon-sc98J[data-direction="desc"]:after {
|
|
84
|
+
content: "↓";
|
|
85
|
+
color: var(--color-link);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.row-oItIj {
|
|
89
|
+
border-bottom: 1px solid var(--color-border);
|
|
90
|
+
transition-property: background-color;
|
|
91
|
+
transition-duration: var(--motion-duration-1);
|
|
92
|
+
transition-timing-function: var(--motion-ease);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@media (hover: hover) {
|
|
96
|
+
.row-oItIj:hover {
|
|
97
|
+
background: var(--color-surface-2);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.cell-L4VgS {
|
|
102
|
+
height: 2.75rem;
|
|
103
|
+
padding: var(--space-2) var(--space-3);
|
|
104
|
+
vertical-align: middle;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.headerCell-Bm5aB:first-child, .cell-L4VgS:first-child {
|
|
109
|
+
padding-inline-start: var(--space-5);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.headerCell-Bm5aB:last-child, .cell-L4VgS:last-child {
|
|
113
|
+
padding-inline-end: var(--space-5);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.table-H20Eb[data-stacked] .head-KQpiR {
|
|
117
|
+
clip-path: inset(50%);
|
|
118
|
+
width: 1px;
|
|
119
|
+
height: 1px;
|
|
120
|
+
position: absolute;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.table-H20Eb[data-stacked] .row-oItIj {
|
|
125
|
+
gap: var(--space-1);
|
|
126
|
+
padding: var(--space-3) var(--space-5);
|
|
127
|
+
display: grid;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.table-H20Eb[data-stacked] .cell-L4VgS {
|
|
131
|
+
gap: var(--space-2);
|
|
132
|
+
white-space: normal;
|
|
133
|
+
overflow-wrap: anywhere;
|
|
134
|
+
grid-template-columns: minmax(6rem, 30%) 1fr;
|
|
135
|
+
height: auto;
|
|
136
|
+
padding: 0;
|
|
137
|
+
display: grid;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.table-H20Eb[data-stacked] .cell-L4VgS:before {
|
|
141
|
+
content: attr(data-label);
|
|
142
|
+
font-family: var(--font-mono);
|
|
143
|
+
font-size: var(--text-2xs);
|
|
144
|
+
letter-spacing: var(--tracking-wide);
|
|
145
|
+
text-transform: uppercase;
|
|
146
|
+
color: var(--color-text-subtle);
|
|
147
|
+
font-weight: 500;
|
|
148
|
+
}
|
|
149
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import LiveRegion_module from "./LiveRegion.module.js";
|
|
3
|
+
function LiveRegion({ message, politeness = 'polite' }) {
|
|
4
|
+
const role = 'assertive' === politeness ? 'alert' : 'status';
|
|
5
|
+
return /*#__PURE__*/ jsx("div", {
|
|
6
|
+
className: LiveRegion_module.root,
|
|
7
|
+
role: role,
|
|
8
|
+
"aria-live": politeness,
|
|
9
|
+
"aria-atomic": "true",
|
|
10
|
+
children: message
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export { LiveRegion };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
export interface NavItem {
|
|
3
|
+
href: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface LinkRenderProps {
|
|
7
|
+
className: string;
|
|
8
|
+
'aria-current'?: 'page';
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface NavMenuProps {
|
|
12
|
+
items: NavItem[];
|
|
13
|
+
currentPath: string;
|
|
14
|
+
/** Accessible name for the navigation landmark. */
|
|
15
|
+
label?: string;
|
|
16
|
+
/** Lets the shell render router links; defaults to a plain anchor. */
|
|
17
|
+
renderLink?: (item: NavItem, props: LinkRenderProps) => ReactElement;
|
|
18
|
+
}
|
|
19
|
+
export declare function NavMenu({ items, currentPath, label, renderLink, }: NavMenuProps): import("react").JSX.Element;
|