@ogcio/design-system-react 1.12.3 → 1.13.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/accordion/accordion-item.js +1 -1
- package/dist/alert/alert.js +1 -1
- package/dist/autocomplete/autocomplete.js +124 -198
- package/dist/autocomplete/types.d.ts +23 -5
- package/dist/autocomplete/use-autocomplete-controller.d.ts +10 -0
- package/dist/autocomplete/use-autocomplete-controller.js +125 -0
- package/dist/button/helpers.d.ts +1 -1
- package/dist/button/helpers.js +14 -12
- package/dist/button/types.d.ts +1 -1
- package/dist/button-group/button-group.d.ts +1 -0
- package/dist/button-group/button-group.js +67 -60
- package/dist/card/card-next.js +28 -28
- package/dist/checkbox/checkbox.d.ts +7 -1
- package/dist/combo-box/dropdown-item.js +30 -30
- package/dist/data-grid/editable-table-cell.d.ts +3 -0
- package/dist/data-grid/editable-table-cell.js +73 -0
- package/dist/data-grid/tanstack/tanstack-helpers.d.ts +11 -0
- package/dist/data-grid/tanstack/tanstack-helpers.js +1799 -0
- package/dist/data-grid/types.d.ts +20 -0
- package/dist/data-grid/types.js +1 -0
- package/dist/drawer/drawer.content.js +6 -6
- package/dist/drawer/drawer.js +8 -8
- package/dist/error-text/error-text.js +1 -1
- package/dist/forms/form-field/form-field.js +15 -15
- package/dist/forms/form-field-with-tag/form-field-with-tag.js +1 -1
- package/dist/header/components/header-slot.js +38 -27
- package/dist/header/header.js +5 -5
- package/dist/heading/heading.js +1 -1
- package/dist/hint-text/hint-text.js +1 -1
- package/dist/hooks/use-aria-hider.d.ts +1 -0
- package/dist/hooks/use-aria-hider.js +20 -0
- package/dist/hooks/use-focus-trap.d.ts +2 -0
- package/dist/hooks/use-focus-trap.js +678 -0
- package/dist/icon/icon.js +32 -32
- package/dist/icon/icons.d.ts +2 -2
- package/dist/icon/icons.js +5 -1
- package/dist/icon/svgs/placeholder.js +2 -2
- package/dist/icon-button/icon-button.js +17 -17
- package/dist/index-2sRBqKFV.js +78 -0
- package/dist/{index-DNkhmzZp.js → index-CB-zPpNk.js} +44 -44
- package/dist/index.d.ts +6 -4
- package/dist/index.js +135 -130
- package/dist/input-checkbox/input-checkbox.d.ts +9 -2
- package/dist/input-checkbox/input-checkbox.js +65 -42
- package/dist/input-checkbox/types.d.ts +5 -0
- package/dist/input-checkbox-group/input-checkbox-group.js +22 -16
- package/dist/input-checkbox-group/types.d.ts +1 -0
- package/dist/input-radio/input-radio.js +15 -15
- package/dist/input-radio-group/input-radio-group.js +24 -17
- package/dist/input-radio-group/types.d.ts +1 -0
- package/dist/input-text/input-text.d.ts +22 -0
- package/dist/input-text/input-text.js +121 -100
- package/dist/input-text/type.d.ts +5 -0
- package/dist/label/label.js +1 -1
- package/dist/link/link.js +1 -1
- package/dist/list/list.js +2 -2
- package/dist/lodash-D1c5hFAM.js +3677 -0
- package/dist/modal/modal.content.js +1 -1
- package/dist/modal/modal.js +141 -127
- package/dist/popover/popover.js +464 -466
- package/dist/primitives/anchor.js +1 -1
- package/dist/progress-bar/progress-bar.js +8 -8
- package/dist/progress-stepper/progress-stepper.js +12 -12
- package/dist/score-select/score-select.js +3 -3
- package/dist/select/select-menu.d.ts +1 -1
- package/dist/select/select-menu.js +96 -90
- package/dist/select/select-native.d.ts +5 -2
- package/dist/select/select-native.js +45 -15
- package/dist/select/select-next.d.ts +3 -2
- package/dist/select/select-next.js +125 -92
- package/dist/select/select-search.d.ts +3 -0
- package/dist/select/select-search.js +24 -0
- package/dist/select/select.d.ts +4 -2
- package/dist/select/select.js +3 -2
- package/dist/select/types.d.ts +22 -0
- package/dist/side-nav/side-nav.js +23 -23
- package/dist/spinner/spinner.js +1 -1
- package/dist/stack/stack.js +40 -49
- package/dist/styles.css +2 -3
- package/dist/table/index.d.ts +8 -0
- package/dist/table/index.js +19 -0
- package/dist/table/table-data.d.ts +16 -2
- package/dist/table/table-data.js +64 -17
- package/dist/table/table-header.d.ts +4 -1
- package/dist/table/table-header.js +58 -18
- package/dist/table/table-pagination.d.ts +8 -0
- package/dist/table/table-pagination.js +97 -0
- package/dist/table/table-row.js +7 -6
- package/dist/table/table.d.ts +4 -1
- package/dist/table/table.js +22 -15
- package/dist/text-input/text-input.d.ts +1 -0
- package/dist/textarea/textarea.js +18 -17
- package/dist/toast/ds-toast.js +1 -1
- package/dist/tooltip/tooltip.js +1 -1
- package/package.json +5 -5
- package/dist/index-ntYL1VRC.js +0 -64
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Caption } from './caption.js';
|
|
2
|
+
export { TableBody } from './table-body.js';
|
|
3
|
+
export { TableData, TableCell } from './table-data.js';
|
|
4
|
+
export { TableFoot } from './table-foot.js';
|
|
5
|
+
export { TableHead } from './table-head.js';
|
|
6
|
+
export { TableHeader } from './table-header.js';
|
|
7
|
+
export { TableRow } from './table-row.js';
|
|
8
|
+
export { Table } from './table.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Caption as r } from "./caption.js";
|
|
2
|
+
import { TableBody as t } from "./table-body.js";
|
|
3
|
+
import { TableCell as p, TableData as b } from "./table-data.js";
|
|
4
|
+
import { TableFoot as m } from "./table-foot.js";
|
|
5
|
+
import { TableHead as T } from "./table-head.js";
|
|
6
|
+
import { TableHeader as C } from "./table-header.js";
|
|
7
|
+
import { TableRow as i } from "./table-row.js";
|
|
8
|
+
import { Table as w } from "./table.js";
|
|
9
|
+
export {
|
|
10
|
+
r as Caption,
|
|
11
|
+
w as Table,
|
|
12
|
+
t as TableBody,
|
|
13
|
+
p as TableCell,
|
|
14
|
+
b as TableData,
|
|
15
|
+
m as TableFoot,
|
|
16
|
+
T as TableHead,
|
|
17
|
+
C as TableHeader,
|
|
18
|
+
i as TableRow
|
|
19
|
+
};
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
import { TdHTMLAttributes } from 'react';
|
|
1
|
+
import { TdHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { TableAlign, VerticalAlign } from './table.js';
|
|
3
3
|
interface TableDataProps extends TdHTMLAttributes<HTMLTableCellElement> {
|
|
4
4
|
align?: TableAlign;
|
|
5
5
|
valign?: VerticalAlign;
|
|
6
|
+
tableCellClassName?: string;
|
|
7
|
+
children: any;
|
|
6
8
|
}
|
|
7
|
-
|
|
9
|
+
type TableCellProps = {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
type TableExpandIconProps = {
|
|
14
|
+
expanded?: boolean;
|
|
15
|
+
onClick: any;
|
|
16
|
+
};
|
|
17
|
+
type TableDataSlotProps = Omit<TableDataProps, 'align' | 'valign'>;
|
|
18
|
+
export declare function TableData({ align, valign, className, children, tableCellClassName, ...props }: TableDataProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const TableCell: ({ children, className }: TableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const TableExpandIcon: ({ expanded, onClick, }: TableExpandIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const TableDataSlot: ({ children, className, ...props }: TableDataSlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
22
|
export {};
|
package/dist/table/table-data.js
CHANGED
|
@@ -1,35 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as d, useState as g, useEffect as u } from "react";
|
|
4
|
+
import { cn as c } from "../cn.js";
|
|
5
|
+
import { IconButton as w } from "../icon-button/icon-button.js";
|
|
6
|
+
function C({
|
|
4
7
|
align: t = "left",
|
|
5
8
|
valign: e = "middle",
|
|
6
|
-
className:
|
|
7
|
-
children:
|
|
8
|
-
|
|
9
|
+
className: r,
|
|
10
|
+
children: o,
|
|
11
|
+
tableCellClassName: i,
|
|
12
|
+
...m
|
|
9
13
|
}) {
|
|
10
|
-
const
|
|
14
|
+
const a = {
|
|
11
15
|
left: "gi-text-left",
|
|
12
16
|
center: "gi-text-center",
|
|
13
17
|
right: "gi-text-right"
|
|
14
|
-
}[t],
|
|
18
|
+
}[t], s = {
|
|
15
19
|
top: "gi-align-top",
|
|
16
20
|
middle: "gi-align-middle",
|
|
17
21
|
bottom: "gi-align-bottom"
|
|
18
|
-
}[e];
|
|
19
|
-
return
|
|
22
|
+
}[e], l = d(null), [f, p] = g(!1);
|
|
23
|
+
return u(() => {
|
|
24
|
+
if (!l.current)
|
|
25
|
+
return;
|
|
26
|
+
const b = l.current.querySelectorAll("input, select, button");
|
|
27
|
+
p(b.length > 0);
|
|
28
|
+
}, []), /* @__PURE__ */ n(
|
|
20
29
|
"td",
|
|
21
30
|
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
31
|
+
ref: l,
|
|
32
|
+
className: c(
|
|
33
|
+
a,
|
|
34
|
+
s,
|
|
25
35
|
"gi-table-td",
|
|
26
|
-
|
|
36
|
+
r
|
|
27
37
|
),
|
|
28
|
-
...
|
|
29
|
-
children:
|
|
38
|
+
...m,
|
|
39
|
+
children: f ? o : /* @__PURE__ */ n(x, { className: i, children: o })
|
|
30
40
|
}
|
|
31
41
|
);
|
|
32
42
|
}
|
|
43
|
+
const x = ({ children: t, className: e }) => /* @__PURE__ */ n("div", { className: c("gi-table-data-cell", e), children: t }), E = ({
|
|
44
|
+
expanded: t,
|
|
45
|
+
onClick: e
|
|
46
|
+
}) => {
|
|
47
|
+
const [r, o] = g("md"), i = d(null);
|
|
48
|
+
return u(() => {
|
|
49
|
+
var l;
|
|
50
|
+
const a = (l = i.current) == null ? void 0 : l.closest(".gi-table"), s = a == null ? void 0 : a.getAttribute("data-row-size");
|
|
51
|
+
s && o(s);
|
|
52
|
+
}, []), /* @__PURE__ */ n("div", { ref: i, className: "gi-table-expand-icon-container", children: /* @__PURE__ */ n(
|
|
53
|
+
w,
|
|
54
|
+
{
|
|
55
|
+
variant: "flat",
|
|
56
|
+
appearance: "dark",
|
|
57
|
+
size: {
|
|
58
|
+
sm: "medium",
|
|
59
|
+
md: "large",
|
|
60
|
+
lg: "extraLarge"
|
|
61
|
+
}[r],
|
|
62
|
+
icon: {
|
|
63
|
+
icon: t ? "keyboard_arrow_up" : "keyboard_arrow_down"
|
|
64
|
+
},
|
|
65
|
+
"aria-label": t ? "Collapse row" : "Expand row",
|
|
66
|
+
className: "gi-cursor-pointer",
|
|
67
|
+
onClick: (a) => {
|
|
68
|
+
a.preventDefault(), e();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
) });
|
|
72
|
+
}, S = ({
|
|
73
|
+
children: t,
|
|
74
|
+
className: e,
|
|
75
|
+
...r
|
|
76
|
+
}) => /* @__PURE__ */ n("td", { className: "gi-table-td", ...r, children: /* @__PURE__ */ n("div", { className: c("gi-table-data-slot-container", e), children: t }) });
|
|
33
77
|
export {
|
|
34
|
-
|
|
78
|
+
x as TableCell,
|
|
79
|
+
C as TableData,
|
|
80
|
+
S as TableDataSlot,
|
|
81
|
+
E as TableExpandIcon
|
|
35
82
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ThHTMLAttributes } from 'react';
|
|
2
2
|
import { TableAlign, VerticalAlign } from './table.js';
|
|
3
|
+
type SortedType = 'asc' | 'desc' | false;
|
|
3
4
|
interface TableHeaderProps extends ThHTMLAttributes<HTMLTableCellElement> {
|
|
4
5
|
align?: TableAlign;
|
|
5
6
|
valign?: VerticalAlign;
|
|
7
|
+
sorted?: SortedType;
|
|
8
|
+
onSort?: (event: React.MouseEvent) => void;
|
|
6
9
|
}
|
|
7
|
-
export declare function TableHeader({ align, valign, className, children, ...props }: TableHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function TableHeader({ align, valign, className, sorted, onSort, children, ...props }: TableHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
export {};
|
|
@@ -1,35 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o, jsxs as x } from "react/jsx-runtime";
|
|
3
|
+
import { Children as y } from "react";
|
|
4
|
+
import { cn as d } from "../cn.js";
|
|
5
|
+
import { Icon as m } from "../icon/icon.js";
|
|
6
|
+
const b = (e, r) => e ? r ? /* @__PURE__ */ o(
|
|
7
|
+
m,
|
|
8
|
+
{
|
|
9
|
+
inline: !0,
|
|
10
|
+
icon: r === "asc" ? "arrow_upward" : "arrow_downward",
|
|
11
|
+
size: "sm"
|
|
12
|
+
}
|
|
13
|
+
) : /* @__PURE__ */ o(m, { inline: !0, icon: "swap_vert", size: "sm" }) : null;
|
|
14
|
+
function K({
|
|
15
|
+
align: e = "left",
|
|
16
|
+
valign: r = "middle",
|
|
17
|
+
className: u,
|
|
18
|
+
sorted: a = !1,
|
|
19
|
+
onSort: i,
|
|
7
20
|
children: l,
|
|
8
|
-
...
|
|
21
|
+
...h
|
|
9
22
|
}) {
|
|
10
|
-
const
|
|
23
|
+
const t = typeof l == "string", c = {
|
|
11
24
|
left: "gi-text-left",
|
|
12
25
|
center: "gi-text-center",
|
|
13
26
|
right: "gi-text-right"
|
|
14
|
-
}[
|
|
27
|
+
}[e], p = {
|
|
15
28
|
top: "gi-align-top",
|
|
16
29
|
middle: "gi-align-middle",
|
|
17
30
|
bottom: "gi-align-bottom"
|
|
18
|
-
}[
|
|
19
|
-
|
|
31
|
+
}[r], g = (n) => {
|
|
32
|
+
i && t && (n.preventDefault(), i(n));
|
|
33
|
+
}, f = (n) => {
|
|
34
|
+
n.key === "Enter" && g(n);
|
|
35
|
+
}, w = y.count(l) > 0;
|
|
36
|
+
let s;
|
|
37
|
+
return a && t ? s = "button" : w || (s = "cell"), /* @__PURE__ */ o(
|
|
20
38
|
"th",
|
|
21
39
|
{
|
|
22
|
-
className:
|
|
23
|
-
|
|
24
|
-
|
|
40
|
+
className: d(
|
|
41
|
+
c,
|
|
42
|
+
p,
|
|
25
43
|
"gi-table-th",
|
|
26
|
-
|
|
44
|
+
u,
|
|
45
|
+
{ "gi-w-12": !t }
|
|
27
46
|
),
|
|
28
|
-
|
|
29
|
-
|
|
47
|
+
role: s,
|
|
48
|
+
"data-sorted": !!i,
|
|
49
|
+
"data-header-string": t,
|
|
50
|
+
tabIndex: i && t ? 0 : -1,
|
|
51
|
+
onKeyDown: f,
|
|
52
|
+
...h,
|
|
53
|
+
children: /* @__PURE__ */ x(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: d(c, {
|
|
57
|
+
"gi-flex gi-gap-1 gi-h-full gi-items-center": t,
|
|
58
|
+
"gi-justify-center": e === "center",
|
|
59
|
+
"gi-justify-start": e === "left",
|
|
60
|
+
"gi-justify-end": e === "right"
|
|
61
|
+
}),
|
|
62
|
+
onClick: g,
|
|
63
|
+
onKeyDown: f,
|
|
64
|
+
children: [
|
|
65
|
+
l,
|
|
66
|
+
!!i && b(t, a)
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
)
|
|
30
70
|
}
|
|
31
71
|
);
|
|
32
72
|
}
|
|
33
73
|
export {
|
|
34
|
-
|
|
74
|
+
K as TableHeader
|
|
35
75
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type TablePaginationProps = {
|
|
2
|
+
align?: 'start' | 'center' | 'end';
|
|
3
|
+
currentPage: number;
|
|
4
|
+
totalPages: number;
|
|
5
|
+
onPageChange: (page: number) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const TablePagination: React.FC<TablePaginationProps>;
|
|
8
|
+
export default TablePagination;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsxs as t, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { cn as f } from "../cn.js";
|
|
3
|
+
import { translate as e } from "../i18n/utility.js";
|
|
4
|
+
import { IconButton as o } from "../icon-button/icon-button.js";
|
|
5
|
+
const v = ({
|
|
6
|
+
currentPage: i,
|
|
7
|
+
totalPages: a,
|
|
8
|
+
onPageChange: n,
|
|
9
|
+
align: s = "end"
|
|
10
|
+
}) => {
|
|
11
|
+
const c = () => {
|
|
12
|
+
i > 1 && n(i - 1);
|
|
13
|
+
}, d = () => {
|
|
14
|
+
i < a && n(i + 1);
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ t(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: f(
|
|
20
|
+
{
|
|
21
|
+
"gi-justify-first": s === "start",
|
|
22
|
+
"gi-justify-center": s === "center",
|
|
23
|
+
"gi-justify-end": s === "end"
|
|
24
|
+
},
|
|
25
|
+
"gi-table-pagination"
|
|
26
|
+
),
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ l(
|
|
29
|
+
o,
|
|
30
|
+
{
|
|
31
|
+
disabled: i === 1,
|
|
32
|
+
onClick: () => n(1),
|
|
33
|
+
appearance: "dark",
|
|
34
|
+
variant: "flat",
|
|
35
|
+
className: "gi-mr-4",
|
|
36
|
+
icon: {
|
|
37
|
+
icon: "first_page"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ l(
|
|
42
|
+
o,
|
|
43
|
+
{
|
|
44
|
+
disabled: i === 1,
|
|
45
|
+
onClick: c,
|
|
46
|
+
appearance: "dark",
|
|
47
|
+
variant: "flat",
|
|
48
|
+
className: "gi-mr-2",
|
|
49
|
+
icon: {
|
|
50
|
+
icon: "chevron_left"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ t("div", { className: "gi-table-pagination-label", "aria-live": "polite", children: [
|
|
55
|
+
/* @__PURE__ */ l("span", { className: "gi-font-bold", children: e("table.pagination.page", {
|
|
56
|
+
currentPage: i,
|
|
57
|
+
defaultValue: `Page ${i} `
|
|
58
|
+
}) }),
|
|
59
|
+
e("table.pagination.ofTotal", {
|
|
60
|
+
totalPages: a,
|
|
61
|
+
defaultValue: `of ${a}`
|
|
62
|
+
})
|
|
63
|
+
] }),
|
|
64
|
+
/* @__PURE__ */ l(
|
|
65
|
+
o,
|
|
66
|
+
{
|
|
67
|
+
onClick: d,
|
|
68
|
+
disabled: i === a,
|
|
69
|
+
appearance: "dark",
|
|
70
|
+
variant: "flat",
|
|
71
|
+
className: "gi-ml-2",
|
|
72
|
+
icon: {
|
|
73
|
+
icon: "chevron_right"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ l(
|
|
78
|
+
o,
|
|
79
|
+
{
|
|
80
|
+
disabled: i === a,
|
|
81
|
+
onClick: () => n(a),
|
|
82
|
+
appearance: "dark",
|
|
83
|
+
variant: "flat",
|
|
84
|
+
className: "gi-ml-4",
|
|
85
|
+
icon: {
|
|
86
|
+
icon: "last_page"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
export {
|
|
95
|
+
v as TablePagination,
|
|
96
|
+
v as default
|
|
97
|
+
};
|
package/dist/table/table-row.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { cn as e } from "../cn.js";
|
|
3
|
+
function c({
|
|
4
|
+
children: t,
|
|
5
|
+
...r
|
|
5
6
|
}) {
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ a("tr", { className: e(r.className, "gi-table-tr"), ...r, children: t });
|
|
7
8
|
}
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
c as TableRow
|
|
10
11
|
};
|
package/dist/table/table.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ declare const tableVariants: import('tailwind-variants').TVReturnType<{
|
|
|
20
20
|
}, undefined, "gi-table", TVConfig<V, EV>, unknown, unknown, undefined>>;
|
|
21
21
|
export type TableProps = VariantProps<typeof tableVariants> & {
|
|
22
22
|
dataTestid?: string;
|
|
23
|
+
rowSize?: 'sm' | 'md' | 'lg';
|
|
24
|
+
stripped?: boolean;
|
|
25
|
+
noBorder?: boolean;
|
|
23
26
|
} & React.TableHTMLAttributes<HTMLTableElement>;
|
|
24
|
-
export declare function Table({ layout, dataTestid, children, ...props }: React.PropsWithChildren<TableProps>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function Table({ layout, rowSize, stripped, noBorder, dataTestid, children, className, ...props }: React.PropsWithChildren<TableProps>): import("react/jsx-runtime").JSX.Element;
|
|
25
28
|
export {};
|
package/dist/table/table.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { c as b } from "../index-CB-zPpNk.js";
|
|
3
|
+
import { cn as f } from "../cn.js";
|
|
4
|
+
const m = b({
|
|
5
5
|
base: "gi-table",
|
|
6
6
|
variants: {
|
|
7
7
|
layout: {
|
|
@@ -10,24 +10,31 @@ const b = l({
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
function
|
|
13
|
+
function g({
|
|
14
14
|
layout: t = "auto",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
rowSize: a = "md",
|
|
16
|
+
stripped: e = !1,
|
|
17
|
+
noBorder: o = !1,
|
|
18
|
+
dataTestid: r,
|
|
19
|
+
children: s,
|
|
20
|
+
className: i,
|
|
21
|
+
...l
|
|
18
22
|
}) {
|
|
19
|
-
const
|
|
20
|
-
return /* @__PURE__ */
|
|
23
|
+
const n = m({ layout: t });
|
|
24
|
+
return /* @__PURE__ */ d(
|
|
21
25
|
"table",
|
|
22
26
|
{
|
|
23
|
-
className:
|
|
27
|
+
className: f(n, i),
|
|
24
28
|
role: "table",
|
|
25
|
-
"data-testid":
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
"data-testid": r,
|
|
30
|
+
"data-row-size": a,
|
|
31
|
+
"data-stripped": e.toString(),
|
|
32
|
+
"data-no-border": o.toString(),
|
|
33
|
+
...l,
|
|
34
|
+
children: s
|
|
28
35
|
}
|
|
29
36
|
);
|
|
30
37
|
}
|
|
31
38
|
export {
|
|
32
|
-
|
|
39
|
+
g as Table
|
|
33
40
|
};
|
|
@@ -18,6 +18,7 @@ export declare const TextInput: import('react').ForwardRefExoticComponent<import
|
|
|
18
18
|
type?: "text" | "date" | "datetime-local" | "email" | "month" | "number" | "password" | "tel" | "time" | "url" | "week" | "search";
|
|
19
19
|
halfFluid?: boolean;
|
|
20
20
|
clearButtonEnabled?: boolean;
|
|
21
|
+
containerProps?: any;
|
|
21
22
|
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
22
23
|
/** @deprecated Use InputTextProps instead */
|
|
23
24
|
export type TextInputProps = InputTextProps;
|
|
@@ -9,24 +9,24 @@ import { IconButton as O } from "../icon-button/icon-button.js";
|
|
|
9
9
|
const E = R(
|
|
10
10
|
({
|
|
11
11
|
value: i,
|
|
12
|
-
rows:
|
|
13
|
-
cols:
|
|
12
|
+
rows: g = 4,
|
|
13
|
+
cols: f = 100,
|
|
14
14
|
autoComplete: h = "on",
|
|
15
15
|
maxChars: t,
|
|
16
|
-
halfFluid:
|
|
16
|
+
halfFluid: v = !1,
|
|
17
17
|
iconStart: c,
|
|
18
|
-
className:
|
|
19
|
-
clearButtonEnabled:
|
|
18
|
+
className: x,
|
|
19
|
+
clearButtonEnabled: s,
|
|
20
20
|
...a
|
|
21
21
|
}, N) => {
|
|
22
|
-
const e = j(null), [
|
|
22
|
+
const e = j(null), [o, C] = m(
|
|
23
23
|
t
|
|
24
24
|
);
|
|
25
25
|
p(N, () => e.current);
|
|
26
|
-
const [I, V] = m(""),
|
|
26
|
+
const [I, V] = m(""), l = typeof i == "string" ? i : I;
|
|
27
27
|
y(() => {
|
|
28
|
-
t !== void 0 && C(t -
|
|
29
|
-
}, [
|
|
28
|
+
t !== void 0 && C(t - l.length);
|
|
29
|
+
}, [l, t]);
|
|
30
30
|
const b = (r) => {
|
|
31
31
|
const T = r.target.value;
|
|
32
32
|
i === void 0 && V(T), a.onChange && a.onChange(r);
|
|
@@ -45,26 +45,27 @@ const E = R(
|
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
47
|
className: u("gi-textarea-inner", {
|
|
48
|
-
"gi-input-half-width":
|
|
48
|
+
"gi-input-half-width": v
|
|
49
49
|
}),
|
|
50
50
|
children: [
|
|
51
51
|
c && /* @__PURE__ */ n("div", { className: "gi-text-area-icon-start", children: /* @__PURE__ */ n(H, { icon: c, size: "md", disabled: a.disabled }) }),
|
|
52
52
|
/* @__PURE__ */ n(
|
|
53
53
|
"textarea",
|
|
54
54
|
{
|
|
55
|
-
rows:
|
|
56
|
-
cols:
|
|
55
|
+
rows: g,
|
|
56
|
+
cols: f,
|
|
57
57
|
autoComplete: h,
|
|
58
|
-
className: u(
|
|
58
|
+
className: u(x, "gi-textarea"),
|
|
59
59
|
ref: e,
|
|
60
60
|
"data-icon-start": !!c,
|
|
61
|
-
"data-clear-enabled":
|
|
61
|
+
"data-clear-enabled": s,
|
|
62
62
|
maxLength: t,
|
|
63
|
+
value: l,
|
|
63
64
|
onChange: b,
|
|
64
65
|
...a
|
|
65
66
|
}
|
|
66
67
|
),
|
|
67
|
-
|
|
68
|
+
s ? /* @__PURE__ */ n("div", { className: "gi-text-area-end-element", children: /* @__PURE__ */ n(
|
|
68
69
|
O,
|
|
69
70
|
{
|
|
70
71
|
disabled: a.disabled,
|
|
@@ -84,8 +85,8 @@ const E = R(
|
|
|
84
85
|
z,
|
|
85
86
|
{
|
|
86
87
|
text: A("textarea.remainingChars", {
|
|
87
|
-
remainingChars:
|
|
88
|
-
defaultValue: `You have ${
|
|
88
|
+
remainingChars: o,
|
|
89
|
+
defaultValue: `You have ${o} characters remaining`
|
|
89
90
|
})
|
|
90
91
|
}
|
|
91
92
|
) })
|
package/dist/toast/ds-toast.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as n, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { c as u } from "../index-
|
|
3
|
+
import { c as u } from "../index-CB-zPpNk.js";
|
|
4
4
|
import { Icon as p } from "../icon/icon.js";
|
|
5
5
|
import { IconButton as v } from "../icon-button/icon-button.js";
|
|
6
6
|
import { Link as w } from "../link/link.js";
|
package/dist/tooltip/tooltip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as b, jsx as g } from "react/jsx-runtime";
|
|
3
3
|
import { useState as c, useId as h, useCallback as d, useEffect as v } from "react";
|
|
4
|
-
import { c as y } from "../index-
|
|
4
|
+
import { c as y } from "../index-CB-zPpNk.js";
|
|
5
5
|
const T = ["top", "bottom", "left", "right"], E = y({
|
|
6
6
|
base: "gi-tooltip",
|
|
7
7
|
variants: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ogcio/design-system-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "The GOV IE design system React components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"postcss-import": "^16.1.0",
|
|
51
51
|
"react": "19.0.0",
|
|
52
52
|
"react-dom": "19.0.0",
|
|
53
|
-
"@ogcio/design-system-eslint-config": "1.2.
|
|
54
|
-
"@ogcio/design-system-prettier-config": "1.0.
|
|
55
|
-
"@ogcio/design-system-tailwind": "1.
|
|
53
|
+
"@ogcio/design-system-eslint-config": "1.2.6",
|
|
54
|
+
"@ogcio/design-system-prettier-config": "1.0.6",
|
|
55
|
+
"@ogcio/design-system-tailwind": "1.12.0",
|
|
56
56
|
"@ogcio/theme-doete": "1.0.0",
|
|
57
|
-
"@ogcio/theme-govie": "1.
|
|
57
|
+
"@ogcio/theme-govie": "1.6.0"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"format": "prettier 'src/**/*.{ts,tsx}' --write",
|
package/dist/index-ntYL1VRC.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import * as i from "react";
|
|
2
|
-
import { jsx as c, Fragment as d } from "react/jsx-runtime";
|
|
3
|
-
function p(e, r) {
|
|
4
|
-
if (typeof e == "function")
|
|
5
|
-
return e(r);
|
|
6
|
-
e != null && (e.current = r);
|
|
7
|
-
}
|
|
8
|
-
function m(...e) {
|
|
9
|
-
return (r) => {
|
|
10
|
-
let n = !1;
|
|
11
|
-
const l = e.map((t) => {
|
|
12
|
-
const o = p(t, r);
|
|
13
|
-
return !n && typeof o == "function" && (n = !0), o;
|
|
14
|
-
});
|
|
15
|
-
if (n)
|
|
16
|
-
return () => {
|
|
17
|
-
for (let t = 0; t < l.length; t++) {
|
|
18
|
-
const o = l[t];
|
|
19
|
-
typeof o == "function" ? o() : p(e[t], null);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
var y = i.forwardRef((e, r) => {
|
|
25
|
-
const { children: n, ...l } = e, t = i.Children.toArray(n), o = t.find(h);
|
|
26
|
-
if (o) {
|
|
27
|
-
const s = o.props.children, a = t.map((u) => u === o ? i.Children.count(s) > 1 ? i.Children.only(null) : i.isValidElement(s) ? s.props.children : null : u);
|
|
28
|
-
return /* @__PURE__ */ c(f, { ...l, ref: r, children: i.isValidElement(s) ? i.cloneElement(s, void 0, a) : null });
|
|
29
|
-
}
|
|
30
|
-
return /* @__PURE__ */ c(f, { ...l, ref: r, children: n });
|
|
31
|
-
});
|
|
32
|
-
y.displayName = "Slot";
|
|
33
|
-
var f = i.forwardRef((e, r) => {
|
|
34
|
-
const { children: n, ...l } = e;
|
|
35
|
-
if (i.isValidElement(n)) {
|
|
36
|
-
const t = R(n), o = C(l, n.props);
|
|
37
|
-
return n.type !== i.Fragment && (o.ref = r ? m(r, t) : t), i.cloneElement(n, o);
|
|
38
|
-
}
|
|
39
|
-
return i.Children.count(n) > 1 ? i.Children.only(null) : null;
|
|
40
|
-
});
|
|
41
|
-
f.displayName = "SlotClone";
|
|
42
|
-
var g = ({ children: e }) => /* @__PURE__ */ c(d, { children: e });
|
|
43
|
-
function h(e) {
|
|
44
|
-
return i.isValidElement(e) && e.type === g;
|
|
45
|
-
}
|
|
46
|
-
function C(e, r) {
|
|
47
|
-
const n = { ...r };
|
|
48
|
-
for (const l in r) {
|
|
49
|
-
const t = e[l], o = r[l];
|
|
50
|
-
/^on[A-Z]/.test(l) ? t && o ? n[l] = (...a) => {
|
|
51
|
-
o(...a), t(...a);
|
|
52
|
-
} : t && (n[l] = t) : l === "style" ? n[l] = { ...t, ...o } : l === "className" && (n[l] = [t, o].filter(Boolean).join(" "));
|
|
53
|
-
}
|
|
54
|
-
return { ...e, ...n };
|
|
55
|
-
}
|
|
56
|
-
function R(e) {
|
|
57
|
-
var l, t;
|
|
58
|
-
let r = (l = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : l.get, n = r && "isReactWarning" in r && r.isReactWarning;
|
|
59
|
-
return n ? e.ref : (r = (t = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : t.get, n = r && "isReactWarning" in r && r.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
60
|
-
}
|
|
61
|
-
export {
|
|
62
|
-
g as S,
|
|
63
|
-
y as a
|
|
64
|
-
};
|