@salt-ds/lab 1.0.0-alpha.24 → 1.0.0-alpha.26
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/css/salt-lab.css +107 -185
- package/dist-cjs/combo-box-next/ComboBoxNext.js +1 -1
- package/dist-cjs/combo-box-next/ComboBoxNext.js.map +1 -1
- package/dist-cjs/dropdown-next/DropdownNext.js +1 -2
- package/dist-cjs/dropdown-next/DropdownNext.js.map +1 -1
- package/dist-cjs/file-drop-zone/FileDropZone.css.js +1 -1
- package/dist-cjs/file-drop-zone/FileDropZone.js +32 -132
- package/dist-cjs/file-drop-zone/FileDropZone.js.map +1 -1
- package/dist-cjs/file-drop-zone/FileDropZoneIcon.js +25 -0
- package/dist-cjs/file-drop-zone/FileDropZoneIcon.js.map +1 -0
- package/dist-cjs/file-drop-zone/FileDropZoneTrigger.js +52 -0
- package/dist-cjs/file-drop-zone/FileDropZoneTrigger.js.map +1 -0
- package/dist-cjs/file-drop-zone/internal/utils.js +4 -13
- package/dist-cjs/file-drop-zone/internal/utils.js.map +1 -1
- package/dist-cjs/index.js +8 -3
- package/dist-cjs/index.js.map +1 -1
- package/dist-cjs/pagination/CompactInput.css.js +6 -0
- package/dist-cjs/pagination/CompactInput.css.js.map +1 -0
- package/dist-cjs/pagination/CompactInput.js +31 -35
- package/dist-cjs/pagination/CompactInput.js.map +1 -1
- package/dist-cjs/pagination/CompactPaginator.css.js +6 -0
- package/dist-cjs/pagination/CompactPaginator.css.js.map +1 -0
- package/dist-cjs/pagination/CompactPaginator.js +76 -0
- package/dist-cjs/pagination/CompactPaginator.js.map +1 -0
- package/dist-cjs/pagination/GoToInput.css.js +6 -0
- package/dist-cjs/pagination/GoToInput.css.js.map +1 -0
- package/dist-cjs/pagination/GoToInput.js +37 -59
- package/dist-cjs/pagination/GoToInput.js.map +1 -1
- package/dist-cjs/pagination/PageButton.css.js +6 -0
- package/dist-cjs/pagination/PageButton.css.js.map +1 -0
- package/dist-cjs/pagination/PageButton.js +34 -33
- package/dist-cjs/pagination/PageButton.js.map +1 -1
- package/dist-cjs/pagination/PageRanges.css.js +6 -0
- package/dist-cjs/pagination/PageRanges.css.js.map +1 -0
- package/dist-cjs/pagination/PageRanges.js +73 -0
- package/dist-cjs/pagination/PageRanges.js.map +1 -0
- package/dist-cjs/pagination/Pagination.css.js +1 -1
- package/dist-cjs/pagination/Pagination.js +21 -38
- package/dist-cjs/pagination/Pagination.js.map +1 -1
- package/dist-cjs/pagination/PaginationContext.js +1 -6
- package/dist-cjs/pagination/PaginationContext.js.map +1 -1
- package/dist-cjs/pagination/Paginator.css.js +6 -0
- package/dist-cjs/pagination/Paginator.css.js.map +1 -0
- package/dist-cjs/pagination/Paginator.js +33 -43
- package/dist-cjs/pagination/Paginator.js.map +1 -1
- package/dist-cjs/pagination/usePaginationContext.js +1 -1
- package/dist-cjs/pagination/usePaginationContext.js.map +1 -1
- package/dist-cjs/pill-next/PillNext.css.js +1 -1
- package/dist-cjs/pill-next/PillNext.js +26 -31
- package/dist-cjs/pill-next/PillNext.js.map +1 -1
- package/dist-es/combo-box-next/ComboBoxNext.js +1 -1
- package/dist-es/combo-box-next/ComboBoxNext.js.map +1 -1
- package/dist-es/dropdown-next/DropdownNext.js +1 -2
- package/dist-es/dropdown-next/DropdownNext.js.map +1 -1
- package/dist-es/file-drop-zone/FileDropZone.css.js +1 -1
- package/dist-es/file-drop-zone/FileDropZone.js +36 -136
- package/dist-es/file-drop-zone/FileDropZone.js.map +1 -1
- package/dist-es/file-drop-zone/FileDropZoneIcon.js +21 -0
- package/dist-es/file-drop-zone/FileDropZoneIcon.js.map +1 -0
- package/dist-es/file-drop-zone/FileDropZoneTrigger.js +48 -0
- package/dist-es/file-drop-zone/FileDropZoneTrigger.js.map +1 -0
- package/dist-es/file-drop-zone/internal/utils.js +5 -12
- package/dist-es/file-drop-zone/internal/utils.js.map +1 -1
- package/dist-es/index.js +4 -1
- package/dist-es/index.js.map +1 -1
- package/dist-es/pagination/CompactInput.css.js +4 -0
- package/dist-es/pagination/CompactInput.css.js.map +1 -0
- package/dist-es/pagination/CompactInput.js +32 -36
- package/dist-es/pagination/CompactInput.js.map +1 -1
- package/dist-es/pagination/CompactPaginator.css.js +4 -0
- package/dist-es/pagination/CompactPaginator.css.js.map +1 -0
- package/dist-es/pagination/CompactPaginator.js +72 -0
- package/dist-es/pagination/CompactPaginator.js.map +1 -0
- package/dist-es/pagination/GoToInput.css.js +4 -0
- package/dist-es/pagination/GoToInput.css.js.map +1 -0
- package/dist-es/pagination/GoToInput.js +40 -62
- package/dist-es/pagination/GoToInput.js.map +1 -1
- package/dist-es/pagination/PageButton.css.js +4 -0
- package/dist-es/pagination/PageButton.css.js.map +1 -0
- package/dist-es/pagination/PageButton.js +34 -33
- package/dist-es/pagination/PageButton.js.map +1 -1
- package/dist-es/pagination/PageRanges.css.js +4 -0
- package/dist-es/pagination/PageRanges.css.js.map +1 -0
- package/dist-es/pagination/PageRanges.js +69 -0
- package/dist-es/pagination/PageRanges.js.map +1 -0
- package/dist-es/pagination/Pagination.css.js +1 -1
- package/dist-es/pagination/Pagination.js +20 -37
- package/dist-es/pagination/Pagination.js.map +1 -1
- package/dist-es/pagination/PaginationContext.js +1 -6
- package/dist-es/pagination/PaginationContext.js.map +1 -1
- package/dist-es/pagination/Paginator.css.js +4 -0
- package/dist-es/pagination/Paginator.css.js.map +1 -0
- package/dist-es/pagination/Paginator.js +32 -42
- package/dist-es/pagination/Paginator.js.map +1 -1
- package/dist-es/pagination/usePaginationContext.js +1 -1
- package/dist-es/pagination/usePaginationContext.js.map +1 -1
- package/dist-es/pill-next/PillNext.css.js +1 -1
- package/dist-es/pill-next/PillNext.js +28 -33
- package/dist-es/pill-next/PillNext.js.map +1 -1
- package/dist-types/combo-box-next/useComboBox.d.ts +2 -2
- package/dist-types/combo-box-next/useComboboxPortal.d.ts +2 -2
- package/dist-types/dialog/useDialog.d.ts +6 -7
- package/dist-types/drawer/useDrawer.d.ts +6 -7
- package/dist-types/dropdown-next/useDropdownNext.d.ts +12 -4
- package/dist-types/file-drop-zone/FileDropZone.d.ts +7 -44
- package/dist-types/file-drop-zone/FileDropZoneIcon.d.ts +9 -0
- package/dist-types/file-drop-zone/FileDropZoneTrigger.d.ts +22 -0
- package/dist-types/file-drop-zone/index.d.ts +2 -1
- package/dist-types/file-drop-zone/internal/utils.d.ts +0 -6
- package/dist-types/pagination/CompactInput.d.ts +2 -8
- package/dist-types/pagination/CompactPaginator.d.ts +1 -0
- package/dist-types/pagination/GoToInput.d.ts +13 -4
- package/dist-types/pagination/PageButton.d.ts +2 -3
- package/dist-types/pagination/PageRanges.d.ts +5 -0
- package/dist-types/pagination/Pagination.d.ts +15 -4
- package/dist-types/pagination/PaginationContext.d.ts +2 -4
- package/dist-types/pagination/Paginator.d.ts +6 -3
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/pill-next/PillNext.d.ts +1 -4
- package/dist-types/tabs/drag-drop/drag-utils.d.ts +6 -6
- package/package.json +5 -5
- package/dist-cjs/file-drop-zone/validators.js +0 -38
- package/dist-cjs/file-drop-zone/validators.js.map +0 -1
- package/dist-cjs/pagination/ArrowButton.js +0 -64
- package/dist-cjs/pagination/ArrowButton.js.map +0 -1
- package/dist-cjs/pagination/CompactControls.js +0 -38
- package/dist-cjs/pagination/CompactControls.js.map +0 -1
- package/dist-cjs/pagination/RegularControls.js +0 -58
- package/dist-cjs/pagination/RegularControls.js.map +0 -1
- package/dist-cjs/pagination/utils.js +0 -10
- package/dist-cjs/pagination/utils.js.map +0 -1
- package/dist-es/file-drop-zone/validators.js +0 -29
- package/dist-es/file-drop-zone/validators.js.map +0 -1
- package/dist-es/pagination/ArrowButton.js +0 -60
- package/dist-es/pagination/ArrowButton.js.map +0 -1
- package/dist-es/pagination/CompactControls.js +0 -34
- package/dist-es/pagination/CompactControls.js.map +0 -1
- package/dist-es/pagination/RegularControls.js +0 -54
- package/dist-es/pagination/RegularControls.js.map +0 -1
- package/dist-es/pagination/utils.js +0 -6
- package/dist-es/pagination/utils.js.map +0 -1
- package/dist-types/file-drop-zone/validators.d.ts +0 -21
- package/dist-types/pagination/ArrowButton.d.ts +0 -7
- package/dist-types/pagination/CompactControls.d.ts +0 -8
- package/dist-types/pagination/RegularControls.d.ts +0 -8
- package/dist-types/pagination/utils.d.ts +0 -1
|
@@ -1,40 +1,30 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useForkRef } from '@salt-ds/core';
|
|
3
|
-
import { ChevronLeftIcon, ChevronRightIcon } from '@salt-ds/icons';
|
|
4
2
|
import { clsx } from 'clsx';
|
|
5
|
-
import { forwardRef
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { makePrefixer, Button } from '@salt-ds/core';
|
|
5
|
+
import { ChevronLeftIcon, ChevronRightIcon } from '@salt-ds/icons';
|
|
6
|
+
import { PageRanges } from './PageRanges.js';
|
|
9
7
|
import { usePaginationContext } from './usePaginationContext.js';
|
|
10
|
-
import { withBaseName } from './utils.js';
|
|
11
8
|
import { useWindow } from '@salt-ds/window';
|
|
12
9
|
import { useComponentCssInjection } from '@salt-ds/styles';
|
|
13
|
-
import css_248z from './
|
|
10
|
+
import css_248z from './Paginator.css.js';
|
|
14
11
|
|
|
12
|
+
const withBaseName = makePrefixer("saltPaginator");
|
|
15
13
|
const Paginator = forwardRef(
|
|
16
|
-
({
|
|
17
|
-
className,
|
|
18
|
-
boundaryCount,
|
|
19
|
-
siblingCount,
|
|
20
|
-
showPreviousNext = true,
|
|
21
|
-
FormFieldProps: FormFieldProps2,
|
|
22
|
-
...restProps
|
|
23
|
-
}, forwardedRef) => {
|
|
14
|
+
function Paginator2({ className, boundaryCount, siblingCount, ...restProps }, ref) {
|
|
24
15
|
const targetWindow = useWindow();
|
|
25
16
|
useComponentCssInjection({
|
|
26
|
-
testId: "salt-
|
|
17
|
+
testId: "salt-paginator",
|
|
27
18
|
css: css_248z,
|
|
28
19
|
window: targetWindow
|
|
29
20
|
});
|
|
30
|
-
const { count, page, onPageChange
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, [page, onPageChange, count]);
|
|
21
|
+
const { count, page, onPageChange } = usePaginationContext();
|
|
22
|
+
const onPreviousPage = (event) => {
|
|
23
|
+
onPageChange(event, Math.max(1, page - 1));
|
|
24
|
+
};
|
|
25
|
+
const onNextPage = (event) => {
|
|
26
|
+
onPageChange(event, Math.min(page + 1, count));
|
|
27
|
+
};
|
|
38
28
|
const isOnFirstPage = page === 1;
|
|
39
29
|
const isOnLastPage = page === count;
|
|
40
30
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -42,29 +32,29 @@ const Paginator = forwardRef(
|
|
|
42
32
|
...restProps,
|
|
43
33
|
ref,
|
|
44
34
|
children: [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
/* @__PURE__ */ jsx(Button, {
|
|
36
|
+
variant: "secondary",
|
|
37
|
+
"aria-label": "Previous Page",
|
|
38
|
+
onClick: onPreviousPage,
|
|
48
39
|
disabled: isOnFirstPage,
|
|
49
|
-
|
|
40
|
+
className: withBaseName("arrowButton-previous"),
|
|
41
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, {
|
|
42
|
+
"aria-hidden": true
|
|
43
|
+
})
|
|
50
44
|
}),
|
|
51
|
-
|
|
52
|
-
count,
|
|
53
|
-
page,
|
|
54
|
-
onPageChange,
|
|
55
|
-
FormFieldProps: FormFieldProps2
|
|
56
|
-
}) : /* @__PURE__ */ jsx(RegularControls, {
|
|
57
|
-
count,
|
|
58
|
-
page,
|
|
59
|
-
onPageChange,
|
|
45
|
+
/* @__PURE__ */ jsx(PageRanges, {
|
|
60
46
|
siblingCount,
|
|
61
47
|
boundaryCount
|
|
62
48
|
}),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
49
|
+
/* @__PURE__ */ jsx(Button, {
|
|
50
|
+
variant: "secondary",
|
|
51
|
+
"aria-label": "Next Page",
|
|
52
|
+
onClick: onNextPage,
|
|
66
53
|
disabled: isOnLastPage,
|
|
67
|
-
|
|
54
|
+
className: withBaseName("arrowButton-next"),
|
|
55
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
56
|
+
"aria-hidden": true
|
|
57
|
+
})
|
|
68
58
|
})
|
|
69
59
|
]
|
|
70
60
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paginator.js","sources":["../src/pagination/Paginator.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Paginator.js","sources":["../src/pagination/Paginator.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { forwardRef, HTMLAttributes, MouseEventHandler } from \"react\";\nimport { Button, makePrefixer } from \"@salt-ds/core\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"@salt-ds/icons\";\nimport { PageRanges } from \"./PageRanges\";\nimport { usePaginationContext } from \"./usePaginationContext\";\n\nimport { useWindow } from \"@salt-ds/window\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\n\nimport paginatorCss from \"./Paginator.css\";\n\nconst withBaseName = makePrefixer(\"saltPaginator\");\n\nexport interface PaginatorProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Number of pages next to the arrow buttons when page range is truncated.\n */\n boundaryCount?: number;\n /**\n * Number of pages on each side of the current page when page range is truncated.\n */\n siblingCount?: number;\n}\n\nexport const Paginator = forwardRef<HTMLDivElement, PaginatorProps>(\n function Paginator(\n { className, boundaryCount, siblingCount, ...restProps },\n ref\n ) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-paginator\",\n css: paginatorCss,\n window: targetWindow,\n });\n\n const { count, page, onPageChange } = usePaginationContext();\n\n const onPreviousPage: MouseEventHandler<HTMLButtonElement> = (event) => {\n onPageChange(event, Math.max(1, page - 1));\n };\n\n const onNextPage: MouseEventHandler<HTMLButtonElement> = (event) => {\n onPageChange(event, Math.min(page + 1, count));\n };\n\n const isOnFirstPage = page === 1;\n const isOnLastPage = page === count;\n\n return (\n <div className={clsx(withBaseName(), className)} {...restProps} ref={ref}>\n <Button\n variant=\"secondary\"\n aria-label=\"Previous Page\"\n onClick={onPreviousPage}\n disabled={isOnFirstPage}\n className={withBaseName(\"arrowButton-previous\")}\n >\n <ChevronLeftIcon aria-hidden />\n </Button>\n <PageRanges siblingCount={siblingCount} boundaryCount={boundaryCount} />\n <Button\n variant=\"secondary\"\n aria-label=\"Next Page\"\n onClick={onNextPage}\n disabled={isOnLastPage}\n className={withBaseName(\"arrowButton-next\")}\n >\n <ChevronRightIcon aria-hidden />\n </Button>\n </div>\n );\n }\n);\n"],"names":["Paginator","paginatorCss"],"mappings":";;;;;;;;;;;AAYA,MAAM,YAAA,GAAe,aAAa,eAAe,CAAA,CAAA;AAa1C,MAAM,SAAY,GAAA,UAAA;AAAA,EACvB,SAASA,WACP,EAAE,SAAA,EAAW,eAAe,YAAiB,EAAA,GAAA,SAAA,IAC7C,GACA,EAAA;AACA,IAAA,MAAM,eAAe,SAAU,EAAA,CAAA;AAC/B,IAAyB,wBAAA,CAAA;AAAA,MACvB,MAAQ,EAAA,gBAAA;AAAA,MACR,GAAK,EAAAC,QAAA;AAAA,MACL,MAAQ,EAAA,YAAA;AAAA,KACT,CAAA,CAAA;AAED,IAAA,MAAM,EAAE,KAAA,EAAO,IAAM,EAAA,YAAA,KAAiB,oBAAqB,EAAA,CAAA;AAE3D,IAAM,MAAA,cAAA,GAAuD,CAAC,KAAU,KAAA;AACtE,MAAA,YAAA,CAAa,OAAO,IAAK,CAAA,GAAA,CAAI,CAAG,EAAA,IAAA,GAAO,CAAC,CAAC,CAAA,CAAA;AAAA,KAC3C,CAAA;AAEA,IAAM,MAAA,UAAA,GAAmD,CAAC,KAAU,KAAA;AAClE,MAAA,YAAA,CAAa,OAAO,IAAK,CAAA,GAAA,CAAI,IAAO,GAAA,CAAA,EAAG,KAAK,CAAC,CAAA,CAAA;AAAA,KAC/C,CAAA;AAEA,IAAA,MAAM,gBAAgB,IAAS,KAAA,CAAA,CAAA;AAC/B,IAAA,MAAM,eAAe,IAAS,KAAA,KAAA,CAAA;AAE9B,IAAA,uBACG,IAAA,CAAA,KAAA,EAAA;AAAA,MAAI,SAAW,EAAA,IAAA,CAAK,YAAa,EAAA,EAAG,SAAS,CAAA;AAAA,MAAI,GAAG,SAAA;AAAA,MAAW,GAAA;AAAA,MAC9D,QAAA,EAAA;AAAA,wBAAC,GAAA,CAAA,MAAA,EAAA;AAAA,UACC,OAAQ,EAAA,WAAA;AAAA,UACR,YAAW,EAAA,eAAA;AAAA,UACX,OAAS,EAAA,cAAA;AAAA,UACT,QAAU,EAAA,aAAA;AAAA,UACV,SAAA,EAAW,aAAa,sBAAsB,CAAA;AAAA,UAE9C,QAAC,kBAAA,GAAA,CAAA,eAAA,EAAA;AAAA,YAAgB,aAAW,EAAA,IAAA;AAAA,WAAC,CAAA;AAAA,SAC/B,CAAA;AAAA,wBACC,GAAA,CAAA,UAAA,EAAA;AAAA,UAAW,YAAA;AAAA,UAA4B,aAAA;AAAA,SAA8B,CAAA;AAAA,wBACrE,GAAA,CAAA,MAAA,EAAA;AAAA,UACC,OAAQ,EAAA,WAAA;AAAA,UACR,YAAW,EAAA,WAAA;AAAA,UACX,OAAS,EAAA,UAAA;AAAA,UACT,QAAU,EAAA,YAAA;AAAA,UACV,SAAA,EAAW,aAAa,kBAAkB,CAAA;AAAA,UAE1C,QAAC,kBAAA,GAAA,CAAA,gBAAA,EAAA;AAAA,YAAiB,aAAW,EAAA,IAAA;AAAA,WAAC,CAAA;AAAA,SAChC,CAAA;AAAA,OAAA;AAAA,KACF,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaginationContext.js","sources":["../src/pagination/usePaginationContext.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"usePaginationContext.js","sources":["../src/pagination/usePaginationContext.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { paginationContext } from \"./PaginationContext\";\n\nexport const usePaginationContext = () => {\n const context = useContext(paginationContext);\n if (process.env.NODE_ENV !== \"production\") {\n if (!context) {\n console.error(`usePaginationContext should be used inside of Pagination`);\n }\n }\n return context;\n};\n"],"names":[],"mappings":";;;AAGO,MAAM,uBAAuB,MAAM;AACxC,EAAM,MAAA,OAAA,GAAU,WAAW,iBAAiB,CAAA,CAAA;AAC5C,EAAI,IAAA,OAAA,CAAQ,GAAI,CAAA,QAAA,KAAa,YAAc,EAAA;AACzC,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAA,OAAA,CAAQ,MAAM,CAA0D,wDAAA,CAAA,CAAA,CAAA;AAAA,KAC1E;AAAA,GACF;AACA,EAAO,OAAA,OAAA,CAAA;AACT;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var css_248z = "/* Styles applied to the root element */\n
|
|
1
|
+
var css_248z = "/* Styles applied to the root element */\n.saltPillNext {\n appearance: none;\n display: inline-flex;\n align-items: center;\n background: var(--saltPillNext-background, var(--salt-actionable-primary-background));\n border-radius: 0;\n border: 0;\n height: calc(var(--salt-size-base) - var(--salt-spacing-100));\n min-height: var(--salt-text-minHeight);\n outline: 0;\n position: relative;\n gap: var(--salt-spacing-50);\n padding-left: var(--salt-spacing-50);\n padding-right: var(--salt-spacing-50);\n color: var(--saltPillNext-color, var(--salt-actionable-primary-foreground));\n font-family: var(--salt-text-fontFamily);\n font-size: var(--salt-text-fontSize);\n font-weight: var(--salt-text-fontWeight);\n line-height: var(--salt-text-lineHeight);\n overflow: hidden;\n white-space: nowrap;\n}\n\n/* Style applied to Pill if pill is clickable */\n.saltPillNext-clickable {\n cursor: var(--salt-selectable-cursor-hover);\n}\n\n.saltPillNext-clickable:hover,\n.saltPillNext-clickable:focus-visible {\n color: var(--salt-actionable-primary-foreground-hover);\n background: var(--salt-actionable-primary-background-hover);\n}\n\n.saltPillNext-clickable.saltPillNext-active,\n.saltPillNext-clickable:active {\n background: var(--salt-actionable-primary-background-active);\n color: var(--salt-actionable-primary-foreground-active);\n}\n\n/* Style applied to Pill on focus */\n.saltPillNext:focus-visible {\n outline: var(--salt-focused-outline);\n}\n\n/* Style applied to Pill when disabled */\n.saltPillNext:disabled,\n.saltPillNext:disabled:hover {\n color: var(--salt-actionable-primary-foreground-disabled);\n background: var(--salt-actionable-primary-background-disabled);\n cursor: var(--salt-selectable-cursor-disabled);\n}\n";
|
|
2
2
|
|
|
3
3
|
export { css_248z as default };
|
|
4
4
|
//# sourceMappingURL=PillNext.css.js.map
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useWindow } from '@salt-ds/window';
|
|
5
5
|
import { useComponentCssInjection } from '@salt-ds/styles';
|
|
6
|
-
import { makePrefixer, useButton
|
|
6
|
+
import { makePrefixer, useButton } from '@salt-ds/core';
|
|
7
7
|
import css_248z from './PillNext.css.js';
|
|
8
|
-
import { CloseIcon } from '@salt-ds/icons';
|
|
9
8
|
|
|
10
9
|
const withBaseName = makePrefixer("saltPillNext");
|
|
11
10
|
const PillNext = forwardRef(
|
|
12
|
-
function PillNext2({
|
|
11
|
+
function PillNext2({
|
|
12
|
+
children,
|
|
13
|
+
className,
|
|
14
|
+
disabled,
|
|
15
|
+
onKeyUp,
|
|
16
|
+
onKeyDown,
|
|
17
|
+
onClick,
|
|
18
|
+
onBlur,
|
|
19
|
+
...rest
|
|
20
|
+
}, ref) {
|
|
13
21
|
const targetWindow = useWindow();
|
|
14
22
|
useComponentCssInjection({
|
|
15
23
|
testId: "salt-pill-next",
|
|
@@ -18,37 +26,24 @@ const PillNext = forwardRef(
|
|
|
18
26
|
});
|
|
19
27
|
const { buttonProps, active } = useButton({
|
|
20
28
|
disabled,
|
|
21
|
-
|
|
29
|
+
onKeyUp,
|
|
30
|
+
onKeyDown,
|
|
31
|
+
onClick,
|
|
32
|
+
onBlur
|
|
22
33
|
});
|
|
23
34
|
const { tabIndex, ...restButtonProps } = buttonProps;
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
children: [
|
|
37
|
-
icon,
|
|
38
|
-
/* @__PURE__ */ jsx("span", {
|
|
39
|
-
className: withBaseName("label"),
|
|
40
|
-
children
|
|
41
|
-
})
|
|
42
|
-
]
|
|
43
|
-
}),
|
|
44
|
-
onClose && /* @__PURE__ */ jsx(Button, {
|
|
45
|
-
"data-testid": "pill-close-button",
|
|
46
|
-
className: withBaseName("close-button"),
|
|
47
|
-
disabled,
|
|
48
|
-
onClick: onClose,
|
|
49
|
-
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
50
|
-
})
|
|
51
|
-
]
|
|
35
|
+
return /* @__PURE__ */ jsx("button", {
|
|
36
|
+
"data-testid": "pill",
|
|
37
|
+
ref,
|
|
38
|
+
className: clsx(
|
|
39
|
+
withBaseName(),
|
|
40
|
+
withBaseName("clickable"),
|
|
41
|
+
{ [withBaseName("active")]: active },
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
...restButtonProps,
|
|
45
|
+
...rest,
|
|
46
|
+
children
|
|
52
47
|
});
|
|
53
48
|
}
|
|
54
49
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillNext.js","sources":["../src/pill-next/PillNext.tsx"],"sourcesContent":["import { forwardRef, ComponentPropsWithoutRef
|
|
1
|
+
{"version":3,"file":"PillNext.js","sources":["../src/pill-next/PillNext.tsx"],"sourcesContent":["import { forwardRef, ComponentPropsWithoutRef } from \"react\";\nimport clsx from \"clsx\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { makePrefixer, useButton } from \"@salt-ds/core\";\nimport pillCss from \"./PillNext.css\";\n\nconst withBaseName = makePrefixer(\"saltPillNext\");\n\n/* eslint-disable @typescript-eslint/no-empty-interface */\nexport interface PillNextProps extends ComponentPropsWithoutRef<\"button\"> {}\n\nexport const PillNext = forwardRef<HTMLButtonElement, PillNextProps>(\n function PillNext(\n {\n children,\n className,\n disabled,\n onKeyUp,\n onKeyDown,\n onClick,\n onBlur,\n ...rest\n },\n ref\n ) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-pill-next\",\n css: pillCss,\n window: targetWindow,\n });\n const { buttonProps, active } = useButton<HTMLButtonElement>({\n disabled,\n onKeyUp,\n onKeyDown,\n onClick,\n onBlur,\n });\n // we do not want to spread tab index in this case because the button element\n // does not require tabindex=\"0\" attribute\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { tabIndex, ...restButtonProps } = buttonProps;\n return (\n <button\n data-testid=\"pill\"\n ref={ref}\n className={clsx(\n withBaseName(),\n withBaseName(\"clickable\"),\n { [withBaseName(\"active\")]: active },\n className\n )}\n {...restButtonProps}\n {...rest}\n >\n {children}\n </button>\n );\n }\n);\n"],"names":["PillNext","pillCss"],"mappings":";;;;;;;;AAOA,MAAM,YAAA,GAAe,aAAa,cAAc,CAAA,CAAA;AAKzC,MAAM,QAAW,GAAA,UAAA;AAAA,EACtB,SAASA,SACP,CAAA;AAAA,IACE,QAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,IACA,MAAA;AAAA,IACG,GAAA,IAAA;AAAA,KAEL,GACA,EAAA;AACA,IAAA,MAAM,eAAe,SAAU,EAAA,CAAA;AAC/B,IAAyB,wBAAA,CAAA;AAAA,MACvB,MAAQ,EAAA,gBAAA;AAAA,MACR,GAAK,EAAAC,QAAA;AAAA,MACL,MAAQ,EAAA,YAAA;AAAA,KACT,CAAA,CAAA;AACD,IAAA,MAAM,EAAE,WAAA,EAAa,MAAO,EAAA,GAAI,SAA6B,CAAA;AAAA,MAC3D,QAAA;AAAA,MACA,OAAA;AAAA,MACA,SAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,KACD,CAAA,CAAA;AAID,IAAM,MAAA,EAAE,QAAa,EAAA,GAAA,eAAA,EAAoB,GAAA,WAAA,CAAA;AACzC,IAAA,uBACG,GAAA,CAAA,QAAA,EAAA;AAAA,MACC,aAAY,EAAA,MAAA;AAAA,MACZ,GAAA;AAAA,MACA,SAAW,EAAA,IAAA;AAAA,QACT,YAAa,EAAA;AAAA,QACb,aAAa,WAAW,CAAA;AAAA,QACxB,EAAE,CAAC,YAAa,CAAA,QAAQ,IAAI,MAAO,EAAA;AAAA,QACnC,SAAA;AAAA,OACF;AAAA,MACC,GAAG,eAAA;AAAA,MACH,GAAG,IAAA;AAAA,MAEH,QAAA;AAAA,KACH,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -17,8 +17,8 @@ export declare const useComboBox: ({ defaultInputValue, onFocus, onMouseOver, on
|
|
|
17
17
|
portalProps: {
|
|
18
18
|
open: boolean;
|
|
19
19
|
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
20
|
-
floating: (node: HTMLElement | null) => void;
|
|
21
|
-
reference: (node: import("@floating-ui/react").ReferenceType | null) => void;
|
|
20
|
+
floating: ((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void);
|
|
21
|
+
reference: ((node: import("@floating-ui/react-dom").ReferenceType | null) => void) & ((node: import("@floating-ui/react").ReferenceType | null) => void);
|
|
22
22
|
getTriggerProps: () => Record<string, unknown>;
|
|
23
23
|
getPortalProps: () => import("react").HTMLProps<HTMLDivElement>;
|
|
24
24
|
getPosition: () => {
|
|
@@ -8,8 +8,8 @@ export interface UseComboBoxPortalProps {
|
|
|
8
8
|
export declare function useComboboxPortal(props?: UseComboBoxPortalProps): {
|
|
9
9
|
open: boolean;
|
|
10
10
|
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
11
|
-
floating: (node: HTMLElement | null) => void;
|
|
12
|
-
reference: (node: import("@floating-ui/react").ReferenceType | null) => void;
|
|
11
|
+
floating: ((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void);
|
|
12
|
+
reference: ((node: import("@floating-ui/react-dom").ReferenceType | null) => void) & ((node: import("@floating-ui/react").ReferenceType | null) => void);
|
|
13
13
|
getPortalProps: () => HTMLProps<HTMLDivElement>;
|
|
14
14
|
getTriggerProps: () => Record<string, unknown>;
|
|
15
15
|
getPosition: () => {
|
|
@@ -3,19 +3,18 @@ export declare type UseDialogProps = Partial<Pick<UseFloatingUIProps, "onOpenCha
|
|
|
3
3
|
export declare function useDialog(props: UseDialogProps): {
|
|
4
4
|
getFloatingProps: (userProps?: import("react").HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
5
5
|
getReferenceProps: (userProps?: import("react").HTMLProps<Element> | undefined) => Record<string, unknown>;
|
|
6
|
-
floating: (node: HTMLElement | null) => void;
|
|
6
|
+
floating: ((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void);
|
|
7
7
|
context: {
|
|
8
|
-
x: number
|
|
9
|
-
y: number
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
10
|
placement: import("@floating-ui/utils").Placement;
|
|
11
11
|
strategy: import("@floating-ui/utils").Strategy;
|
|
12
12
|
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
13
|
-
reference: (node: import("@floating-ui/react").ReferenceType | null) => void;
|
|
14
|
-
floating: (node: HTMLElement | null) => void;
|
|
15
|
-
update: () => void;
|
|
16
13
|
isPositioned: boolean;
|
|
14
|
+
update: () => void;
|
|
15
|
+
floatingStyles: import("react").CSSProperties;
|
|
17
16
|
open: boolean;
|
|
18
|
-
onOpenChange: (open: boolean) => void;
|
|
17
|
+
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
19
18
|
events: import("@floating-ui/react").FloatingEvents;
|
|
20
19
|
dataRef: import("react").MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
21
20
|
nodeId: string | undefined;
|
|
@@ -3,19 +3,18 @@ export declare type UseDrawerProps = Partial<Pick<UseFloatingUIProps, "onOpenCha
|
|
|
3
3
|
export declare function useDrawer(props: UseDrawerProps): {
|
|
4
4
|
getFloatingProps: (userProps?: import("react").HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
5
5
|
getReferenceProps: (userProps?: import("react").HTMLProps<Element> | undefined) => Record<string, unknown>;
|
|
6
|
-
floating: (node: HTMLElement | null) => void;
|
|
6
|
+
floating: ((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void);
|
|
7
7
|
context: {
|
|
8
|
-
x: number
|
|
9
|
-
y: number
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
10
|
placement: import("@floating-ui/utils").Placement;
|
|
11
11
|
strategy: import("@floating-ui/utils").Strategy;
|
|
12
12
|
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
13
|
-
reference: (node: import("@floating-ui/react").ReferenceType | null) => void;
|
|
14
|
-
floating: (node: HTMLElement | null) => void;
|
|
15
|
-
update: () => void;
|
|
16
13
|
isPositioned: boolean;
|
|
14
|
+
update: () => void;
|
|
15
|
+
floatingStyles: import("react").CSSProperties;
|
|
17
16
|
open: boolean;
|
|
18
|
-
onOpenChange: (open: boolean) => void;
|
|
17
|
+
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
19
18
|
events: import("@floating-ui/react").FloatingEvents;
|
|
20
19
|
dataRef: import("react").MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
21
20
|
nodeId: string | undefined;
|
|
@@ -13,10 +13,18 @@ export declare const useDropdownNext: ({ listProps, openControlProp, onOpenChang
|
|
|
13
13
|
mouseDownHandler: () => void;
|
|
14
14
|
listSelectHandler: () => void;
|
|
15
15
|
};
|
|
16
|
-
refs:
|
|
16
|
+
refs: {
|
|
17
|
+
reference: import("react").MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
18
|
+
floating: import("react").MutableRefObject<HTMLElement | null>;
|
|
19
|
+
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
20
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
21
|
+
} & import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
17
22
|
open: boolean;
|
|
18
23
|
getReferenceProps: (userProps?: HTMLProps<Element> | undefined) => Record<string, unknown>;
|
|
19
|
-
getItemProps: (userProps?: HTMLProps<HTMLElement
|
|
24
|
+
getItemProps: (userProps?: (Omit<HTMLProps<HTMLElement>, "selected" | "active"> & {
|
|
25
|
+
active?: boolean | undefined;
|
|
26
|
+
selected?: boolean | undefined;
|
|
27
|
+
}) | undefined) => Record<string, unknown>;
|
|
20
28
|
activeDescendant: string | undefined;
|
|
21
29
|
selectedItem: string | undefined;
|
|
22
30
|
setSelectedItem: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
@@ -26,8 +34,8 @@ export declare const useDropdownNext: ({ listProps, openControlProp, onOpenChang
|
|
|
26
34
|
portalProps: {
|
|
27
35
|
open: boolean;
|
|
28
36
|
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
29
|
-
floating: (node: HTMLElement | null) => void;
|
|
30
|
-
reference: (node: import("@floating-ui/react").ReferenceType | null) => void;
|
|
37
|
+
floating: ((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void);
|
|
38
|
+
reference: ((node: import("@floating-ui/react-dom").ReferenceType | null) => void) & ((node: import("@floating-ui/react").ReferenceType | null) => void);
|
|
31
39
|
getFloatingProps: (userProps?: HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
32
40
|
getDropdownNextProps: () => HTMLProps<HTMLDivElement>;
|
|
33
41
|
getPosition: () => {
|
|
@@ -1,54 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
export declare type FilesRejectedEventHandler<ErrorType = string> = (errors: ReadonlyArray<ErrorType>, event: SyntheticEvent) => void;
|
|
5
|
-
/**
|
|
6
|
-
* Removed deprecated props
|
|
7
|
-
*
|
|
8
|
-
* - onDrop
|
|
9
|
-
* - onFileTypeError
|
|
10
|
-
* - showUploadButton
|
|
11
|
-
*/
|
|
12
|
-
export interface FileDropZoneProps extends HTMLAttributes<HTMLDivElement> {
|
|
13
|
-
/**
|
|
14
|
-
* `accept` attribute for HTML <input>.
|
|
15
|
-
*
|
|
16
|
-
* A comma separated list of file types the user can pick from the file input dialog box.
|
|
17
|
-
*/
|
|
18
|
-
accept?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The text content of the drop area component.
|
|
21
|
-
*/
|
|
22
|
-
children?: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* Additional usage information.
|
|
25
|
-
*/
|
|
26
|
-
description?: string;
|
|
1
|
+
import { ValidationStatus } from "@salt-ds/core";
|
|
2
|
+
import { DragEvent, ComponentPropsWithoutRef } from "react";
|
|
3
|
+
export interface FileDropZoneProps extends Omit<ComponentPropsWithoutRef<"div">, "onDrop"> {
|
|
27
4
|
/**
|
|
28
5
|
* If `true`, the file drop zone will be disabled.
|
|
29
6
|
*/
|
|
30
7
|
disabled?: boolean;
|
|
31
8
|
/**
|
|
32
|
-
*
|
|
33
|
-
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
34
|
-
*/
|
|
35
|
-
id?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Callback on successful file drop or selection.
|
|
38
|
-
*/
|
|
39
|
-
onFilesAccepted?: FilesAcceptedEventHandler;
|
|
40
|
-
/**
|
|
41
|
-
* @see `validate` prop
|
|
42
|
-
* Callback on drop or input in case of an error. A list of errors will be provided as input.
|
|
9
|
+
* Status indicator to be displayed.
|
|
43
10
|
*/
|
|
44
|
-
|
|
11
|
+
status?: Omit<ValidationStatus, "info" | "warning">;
|
|
45
12
|
/**
|
|
46
|
-
*
|
|
47
|
-
* thus can perform validations on all files. Each function needs to return one or more errors in case of
|
|
48
|
-
* a failed validation, or `undefined` in case of a successful one.
|
|
49
|
-
*
|
|
50
|
-
* All errors are collected in the end and returned as an array to `onFilesRejected`.
|
|
13
|
+
* Callback for on drop event
|
|
51
14
|
*/
|
|
52
|
-
|
|
15
|
+
onDrop?: (event: DragEvent<HTMLDivElement>, files: File[]) => void;
|
|
53
16
|
}
|
|
54
17
|
export declare const FileDropZone: import("react").ForwardRefExoticComponent<FileDropZoneProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ValidationStatus } from "@salt-ds/core";
|
|
2
|
+
import { IconProps } from "@salt-ds/icons";
|
|
3
|
+
export interface FileDropZoneIconProps extends IconProps {
|
|
4
|
+
/**
|
|
5
|
+
* Status indicator to be displayed.
|
|
6
|
+
*/
|
|
7
|
+
status?: ValidationStatus;
|
|
8
|
+
}
|
|
9
|
+
export declare const FileDropZoneIcon: import("react").ForwardRefExoticComponent<FileDropZoneIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { HTMLAttributes, SyntheticEvent } from "react";
|
|
2
|
+
export interface FileDropZoneTriggerProps extends Omit<HTMLAttributes<HTMLButtonElement>, "onChange"> {
|
|
3
|
+
/**
|
|
4
|
+
* `accept` attribute for HTML <input>.
|
|
5
|
+
*
|
|
6
|
+
* A comma separated list of file types the user can pick from the file input dialog box.
|
|
7
|
+
*/
|
|
8
|
+
accept?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Disable all trigger elements.
|
|
11
|
+
*/
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Allows multiple files to be uploaded.
|
|
15
|
+
*/
|
|
16
|
+
multiple?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Callback for input change event
|
|
19
|
+
*/
|
|
20
|
+
onChange?: (event: SyntheticEvent<HTMLInputElement>, files: File[]) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const FileDropZoneTrigger: import("react").ForwardRefExoticComponent<FileDropZoneTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { DragEvent } from "react";
|
|
2
|
-
import { FilesValidator } from "../validators";
|
|
3
|
-
export declare const toArray: (obj: any) => any[];
|
|
4
2
|
export declare const containsFiles: (e: DragEvent) => boolean | FileList | null;
|
|
5
3
|
export declare const extractFiles: (e: DragEvent) => File[];
|
|
6
|
-
export declare const validateFiles: ({ files, validate, }: {
|
|
7
|
-
files: ReadonlyArray<File>;
|
|
8
|
-
validate: ReadonlyArray<FilesValidator>;
|
|
9
|
-
}) => string[];
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
count: number;
|
|
4
|
-
page: number;
|
|
5
|
-
onPageChange: (page: number) => void;
|
|
6
|
-
FormFieldProps?: Partial<FormFieldProps>;
|
|
7
|
-
}
|
|
8
|
-
export declare const CompactInput: ({ page, count, onPageChange, FormFieldProps: { className, ...restFormFieldLegacyProps }, }: CompactInputProps) => JSX.Element;
|
|
1
|
+
import { InputProps } from "@salt-ds/core";
|
|
2
|
+
export declare const CompactInput: import("react").ForwardRefExoticComponent<Pick<InputProps, "variant" | "inputRef"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CompactPaginator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import { HTMLAttributes } from "react";
|
|
2
|
-
import { FormFieldLegacyProps as FormFieldProps } from "../form-field-legacy";
|
|
1
|
+
import { HTMLAttributes, Ref } from "react";
|
|
3
2
|
export interface GoToInputProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Input label.
|
|
5
|
+
*/
|
|
4
6
|
label?: string;
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Optional ref for the input component
|
|
9
|
+
*/
|
|
10
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
11
|
+
/**
|
|
12
|
+
* Change input variant.
|
|
13
|
+
*/
|
|
14
|
+
inputVariant?: "primary" | "secondary";
|
|
6
15
|
}
|
|
7
|
-
export declare const GoToInput: import("react").ForwardRefExoticComponent<GoToInputProps & import("react").RefAttributes<
|
|
16
|
+
export declare const GoToInput: import("react").ForwardRefExoticComponent<GoToInputProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export interface PageButtonProps {
|
|
2
2
|
page: number;
|
|
3
|
-
|
|
4
|
-
onPageChange: (page: number) => void;
|
|
3
|
+
selected?: boolean;
|
|
5
4
|
disabled?: boolean;
|
|
6
5
|
}
|
|
7
|
-
export declare const PageButton: (
|
|
6
|
+
export declare const PageButton: import("react").ForwardRefExoticComponent<PageButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import { HTMLAttributes } from "react";
|
|
1
|
+
import { HTMLAttributes, SyntheticEvent } from "react";
|
|
2
2
|
export interface PaginationProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Number of pages.
|
|
5
|
+
*/
|
|
3
6
|
count: number;
|
|
7
|
+
/**
|
|
8
|
+
* Current/active page.
|
|
9
|
+
*/
|
|
4
10
|
page?: number;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Default current/active page.
|
|
13
|
+
*/
|
|
14
|
+
defaultPage?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Callback function triggered when current page changed.
|
|
17
|
+
*/
|
|
18
|
+
onPageChange?: (event: SyntheticEvent, page: number) => void;
|
|
8
19
|
}
|
|
9
20
|
export declare const Pagination: import("react").ForwardRefExoticComponent<PaginationProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { SyntheticEvent } from "react";
|
|
1
2
|
export interface PaginationContext {
|
|
2
3
|
page: number;
|
|
3
4
|
count: number;
|
|
4
|
-
|
|
5
|
-
onPageChange: (page: number) => void;
|
|
6
|
-
paginatorElement?: HTMLDivElement;
|
|
7
|
-
setPaginatorElement: (element: HTMLDivElement) => void;
|
|
5
|
+
onPageChange: (event: SyntheticEvent, page: number) => void;
|
|
8
6
|
}
|
|
9
7
|
export declare const paginationContext: import("react").Context<PaginationContext>;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
|
-
import { FormFieldLegacyProps as FormFieldProps } from "../form-field-legacy";
|
|
3
2
|
export interface PaginatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Number of pages next to the arrow buttons when page range is truncated.
|
|
5
|
+
*/
|
|
4
6
|
boundaryCount?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Number of pages on each side of the current page when page range is truncated.
|
|
9
|
+
*/
|
|
5
10
|
siblingCount?: number;
|
|
6
|
-
showPreviousNext?: boolean;
|
|
7
|
-
FormFieldProps?: Partial<FormFieldProps>;
|
|
8
11
|
}
|
|
9
12
|
export declare const Paginator: import("react").ForwardRefExoticComponent<PaginatorProps & import("react").RefAttributes<HTMLDivElement>>;
|