@hitachivantara/uikit-react-core 5.52.0 → 5.53.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/cjs/BaseSwitch/BaseSwitch.styles.cjs +1 -1
- package/dist/cjs/BaseSwitch/BaseSwitch.styles.cjs.map +1 -1
- package/dist/cjs/BreadCrumb/Page/Page.styles.cjs +2 -2
- package/dist/cjs/BreadCrumb/Page/Page.styles.cjs.map +1 -1
- package/dist/cjs/BulkActions/BulkActions.styles.cjs +1 -1
- package/dist/cjs/BulkActions/BulkActions.styles.cjs.map +1 -1
- package/dist/cjs/Pagination/Pagination.cjs +4 -1
- package/dist/cjs/Pagination/Pagination.cjs.map +1 -1
- package/dist/cjs/Pagination/Pagination.styles.cjs +3 -0
- package/dist/cjs/Pagination/Pagination.styles.cjs.map +1 -1
- package/dist/cjs/Pagination/Select.cjs +2 -1
- package/dist/cjs/Pagination/Select.cjs.map +1 -1
- package/dist/cjs/Pagination/Select.styles.cjs +1 -0
- package/dist/cjs/Pagination/Select.styles.cjs.map +1 -1
- package/dist/cjs/TableSection/TableSection.styles.cjs +7 -1
- package/dist/cjs/TableSection/TableSection.styles.cjs.map +1 -1
- package/dist/cjs/providers/Provider.cjs +8 -4
- package/dist/cjs/providers/Provider.cjs.map +1 -1
- package/dist/esm/BaseSwitch/BaseSwitch.styles.js +1 -1
- package/dist/esm/BaseSwitch/BaseSwitch.styles.js.map +1 -1
- package/dist/esm/BreadCrumb/Page/Page.styles.js +2 -2
- package/dist/esm/BreadCrumb/Page/Page.styles.js.map +1 -1
- package/dist/esm/BulkActions/BulkActions.styles.js +1 -1
- package/dist/esm/BulkActions/BulkActions.styles.js.map +1 -1
- package/dist/esm/Pagination/Pagination.js +4 -1
- package/dist/esm/Pagination/Pagination.js.map +1 -1
- package/dist/esm/Pagination/Pagination.styles.js +3 -0
- package/dist/esm/Pagination/Pagination.styles.js.map +1 -1
- package/dist/esm/Pagination/Select.js +2 -1
- package/dist/esm/Pagination/Select.js.map +1 -1
- package/dist/esm/Pagination/Select.styles.js +1 -0
- package/dist/esm/Pagination/Select.styles.js.map +1 -1
- package/dist/esm/TableSection/TableSection.styles.js +7 -1
- package/dist/esm/TableSection/TableSection.styles.js.map +1 -1
- package/dist/esm/providers/Provider.js +8 -4
- package/dist/esm/providers/Provider.js.map +1 -1
- package/dist/types/index.d.ts +11 -3
- package/package.json +2 -2
|
@@ -13,7 +13,7 @@ const { staticClasses, useClasses } = classes.createClasses("HvBaseSwitch", {
|
|
|
13
13
|
justifyContent: "center",
|
|
14
14
|
borderRadius: uikitStyles.theme.radii.base,
|
|
15
15
|
"&:hover": {
|
|
16
|
-
backgroundColor: uikitStyles.theme.colors.
|
|
16
|
+
backgroundColor: uikitStyles.theme.colors.containerBackgroundHover
|
|
17
17
|
},
|
|
18
18
|
// Higher CSS specificity here
|
|
19
19
|
"& $switchBase": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSwitch.styles.cjs","sources":["../../../src/BaseSwitch/BaseSwitch.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\nimport { createClasses } from \"../utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBaseSwitch\", {\n root: {\n padding: 0,\n cursor: \"pointer\",\n width: \"40px\",\n height: \"32px\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: theme.radii.base,\n\n \"&:hover\": {\n backgroundColor: theme.colors.
|
|
1
|
+
{"version":3,"file":"BaseSwitch.styles.cjs","sources":["../../../src/BaseSwitch/BaseSwitch.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\nimport { createClasses } from \"../utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBaseSwitch\", {\n root: {\n padding: 0,\n cursor: \"pointer\",\n width: \"40px\",\n height: \"32px\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: theme.radii.base,\n\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n\n // Higher CSS specificity here\n \"& $switchBase\": {\n \"&:hover\": {\n backgroundColor: \"transparent\",\n },\n\n \"&$checked\": {\n transform: \"translateX(16px)\",\n \"& + $track\": {\n opacity: 1,\n backgroundColor: theme.colors.secondary,\n },\n \"&:hover\": {\n backgroundColor: \"transparent\",\n },\n },\n },\n\n // Higher CSS specificity here\n \"&$disabled\": {\n \"& $switchBase\": {\n \"& + $track\": {\n opacity: 1,\n backgroundColor: theme.colors.atmo3,\n border: `solid 1px ${theme.colors.secondary_60}`,\n },\n },\n },\n },\n switch: {\n width: \"40px\",\n height: \"32px\",\n padding: 0,\n\n \"&$readOnly $switchBase\": {\n cursor: \"default\",\n },\n },\n switchBase: {\n width: \"40px\",\n height: \"32px\",\n padding: 0,\n },\n track: {\n opacity: 1,\n borderRadius: \"15px\",\n height: \"16px\",\n width: \"32px\",\n border: `solid 1px ${theme.colors.secondary}`,\n backgroundColor: theme.colors.atmo1,\n },\n thumb: {\n position: \"relative\",\n left: \"-9px\",\n width: \"12px\",\n height: \"12px\",\n border: `solid 1px ${theme.colors.secondary}`,\n backgroundColor: theme.colors.atmo1,\n marginLeft: \"2px\",\n marginTop: 0,\n boxShadow: \"none\",\n },\n checked: {},\n disabled: {\n cursor: \"not-allowed\",\n\n \"& $switch\": {\n cursor: \"not-allowed\",\n },\n\n \"& $thumb\": {\n backgroundColor: theme.colors.atmo3,\n border: `solid 1px ${theme.colors.secondary_60}`,\n },\n },\n readOnly: {},\n focusVisible: {\n borderRadius: \"8px\",\n ...outlineStyles,\n },\n});\n"],"names":["createClasses","theme","outlineStyles"],"mappings":";;;;;AAKO,MAAM,EAAE,eAAe,eAAeA,QAAAA,cAAc,gBAAgB;AAAA,EACzE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,OAAO;AA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YAAY;AAAA,IACZ,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AAAA,EACA,SAAS,CAAC;AAAA,EACV,UAAU;AAAA,IACR,QAAQ;AAAA,IAER,aAAa;AAAA,MACX,QAAQ;AAAA,IACV;AAAA,IAEA,YAAY;AAAA,MACV,iBAAiBA,YAAAA,MAAM,OAAO;AAAA,MAC9B,QAAQ,aAAaA,YAAM,MAAA,OAAO,YAAY;AAAA,IAChD;AAAA,EACF;AAAA,EACA,UAAU,CAAC;AAAA,EACX,cAAc;AAAA,IACZ,cAAc;AAAA,IACd,GAAGC,WAAA;AAAA,EACL;AACF,CAAC;;;"}
|
|
@@ -11,10 +11,10 @@ const { staticClasses, useClasses } = classes.createClasses("HvBreadCrumbPage",
|
|
|
11
11
|
textTransform: "capitalize",
|
|
12
12
|
"&:hover": {
|
|
13
13
|
cursor: "pointer",
|
|
14
|
-
backgroundColor: uikitStyles.theme.colors.
|
|
14
|
+
backgroundColor: uikitStyles.theme.colors.containerBackgroundHover
|
|
15
15
|
},
|
|
16
16
|
"&:focus": {
|
|
17
|
-
backgroundColor: uikitStyles.theme.colors.
|
|
17
|
+
backgroundColor: uikitStyles.theme.colors.containerBackgroundHover
|
|
18
18
|
},
|
|
19
19
|
"&:focus-visible": {
|
|
20
20
|
...focusUtils.outlineStyles
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.styles.cjs","sources":["../../../../src/BreadCrumb/Page/Page.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../../utils/classes\";\nimport { outlineStyles } from \"../../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBreadCrumbPage\", {\n link: {\n padding: `8px ${theme.space.xs}`,\n borderRadius: theme.radii.base,\n maxWidth: 170 + 16,\n textTransform: \"capitalize\",\n \"&:hover\": {\n cursor: \"pointer\",\n backgroundColor: theme.colors.
|
|
1
|
+
{"version":3,"file":"Page.styles.cjs","sources":["../../../../src/BreadCrumb/Page/Page.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../../utils/classes\";\nimport { outlineStyles } from \"../../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBreadCrumbPage\", {\n link: {\n padding: `8px ${theme.space.xs}`,\n borderRadius: theme.radii.base,\n maxWidth: 170 + 16,\n textTransform: \"capitalize\",\n \"&:hover\": {\n cursor: \"pointer\",\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n \"&:focus\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n \"&:focus-visible\": {\n ...outlineStyles,\n },\n },\n label: {},\n a: {},\n});\n"],"names":["createClasses","theme","outlineStyles"],"mappings":";;;;;AAKO,MAAM,EAAE,eAAe,eAAeA,QAAAA,cAAc,oBAAoB;AAAA,EAC7E,MAAM;AAAA,IACJ,SAAS,OAAOC,YAAM,MAAA,MAAM,EAAE;AAAA,IAC9B,cAAcA,YAAAA,MAAM,MAAM;AAAA,IAC1B,UAAU,MAAM;AAAA,IAChB,eAAe;AAAA,IACf,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,iBAAiBA,YAAAA,MAAM,OAAO;AAAA,IAChC;AAAA,IACA,WAAW;AAAA,MACT,iBAAiBA,YAAAA,MAAM,OAAO;AAAA,IAChC;AAAA,IACA,mBAAmB;AAAA,MACjB,GAAGC,WAAA;AAAA,IACL;AAAA,EACF;AAAA,EACA,OAAO,CAAC;AAAA,EACR,GAAG,CAAC;AACN,CAAC;;;"}
|
|
@@ -12,7 +12,7 @@ const { staticClasses, useClasses } = classes.createClasses("HvBulkActions", {
|
|
|
12
12
|
marginBottom: uikitStyles.theme.space.xs
|
|
13
13
|
},
|
|
14
14
|
semantic: {
|
|
15
|
-
backgroundColor: uikitStyles.theme.colors.
|
|
15
|
+
backgroundColor: uikitStyles.theme.colors.containerBackgroundHover,
|
|
16
16
|
"& $selectAll div": {
|
|
17
17
|
color: "inherit",
|
|
18
18
|
"&:hover:not(:disabled)": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkActions.styles.cjs","sources":["../../../src/BulkActions/BulkActions.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBulkActions\", {\n root: {\n display: \"flex\",\n alignItems: \"center\",\n border: `1px solid ${theme.colors.atmo4}`,\n backgroundColor: theme.colors.atmo2,\n padding: theme.spacing(\"xs\", \"md\"),\n marginBottom: theme.space.xs,\n },\n semantic: {\n backgroundColor: theme.colors.
|
|
1
|
+
{"version":3,"file":"BulkActions.styles.cjs","sources":["../../../src/BulkActions/BulkActions.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBulkActions\", {\n root: {\n display: \"flex\",\n alignItems: \"center\",\n border: `1px solid ${theme.colors.atmo4}`,\n backgroundColor: theme.colors.atmo2,\n padding: theme.spacing(\"xs\", \"md\"),\n marginBottom: theme.space.xs,\n },\n semantic: {\n backgroundColor: theme.colors.containerBackgroundHover,\n \"& $selectAll div\": {\n color: \"inherit\",\n\n \"&:hover:not(:disabled)\": {\n backgroundColor: theme.alpha(\"base_light\", 0.3),\n },\n\n \"& *\": {\n color: \"inherit\",\n backgroundColor: \"transparent\",\n },\n },\n\n \"& $selectAll:focus-within div\": {\n backgroundColor: theme.alpha(\"base_light\", 0.3),\n },\n },\n actions: { display: \"inline-flex\", marginLeft: \"auto\" },\n selectAllContainer: { display: \"flex\", alignItems: \"center\" },\n selectAll: {},\n selectAllPages: {},\n divider: {\n display: \"flex\",\n backgroundColor: theme.colors.atmo4,\n width: \"1px\",\n height: \"32px\",\n marginLeft: theme.space.sm,\n },\n});\n"],"names":["createClasses","theme"],"mappings":";;;;AAIO,MAAM,EAAE,eAAe,eAAeA,QAAAA,cAAc,iBAAiB;AAAA,EAC1E,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,QAAQ,aAAaC,YAAM,MAAA,OAAO,KAAK;AAAA,IACvC,iBAAiBA,YAAAA,MAAM,OAAO;AAAA,IAC9B,SAASA,YAAA,MAAM,QAAQ,MAAM,IAAI;AAAA,IACjC,cAAcA,YAAAA,MAAM,MAAM;AAAA,EAC5B;AAAA,EACA,UAAU;AAAA,IACR,iBAAiBA,YAAAA,MAAM,OAAO;AAAA,IAC9B,oBAAoB;AAAA,MAClB,OAAO;AAAA,MAEP,0BAA0B;AAAA,QACxB,iBAAiBA,YAAA,MAAM,MAAM,cAAc,GAAG;AAAA,MAChD;AAAA,MAEA,OAAO;AAAA,QACL,OAAO;AAAA,QACP,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,IAEA,iCAAiC;AAAA,MAC/B,iBAAiBA,YAAA,MAAM,MAAM,cAAc,GAAG;AAAA,IAChD;AAAA,EACF;AAAA,EACA,SAAS,EAAE,SAAS,eAAe,YAAY,OAAO;AAAA,EACtD,oBAAoB,EAAE,SAAS,QAAQ,YAAY,SAAS;AAAA,EAC5D,WAAW,CAAC;AAAA,EACZ,gBAAgB,CAAC;AAAA,EACjB,SAAS;AAAA,IACP,SAAS;AAAA,IACT,iBAAiBA,YAAAA,MAAM,OAAO;AAAA,IAC9B,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAYA,YAAAA,MAAM,MAAM;AAAA,EAC1B;AACF,CAAC;;;"}
|
|
@@ -130,7 +130,10 @@ const HvPagination = (props) => {
|
|
|
130
130
|
"aria-label": labels?.pageSizeSelectorDescription,
|
|
131
131
|
onChange: (_, val) => onPageSizeChange?.(val),
|
|
132
132
|
value: pageSize,
|
|
133
|
-
classes: {
|
|
133
|
+
classes: {
|
|
134
|
+
header: classes.pageSizeHeader,
|
|
135
|
+
root: classes.pageSizeRoot
|
|
136
|
+
},
|
|
134
137
|
children: pageSizeOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsx(Select.Option, { value: option, children: option }, option))
|
|
135
138
|
}
|
|
136
139
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.cjs","sources":["../../../src/Pagination/Pagination.tsx"],"sourcesContent":["import { HTMLAttributes, useCallback, useEffect } from \"react\";\n\nimport Hidden from \"@mui/material/Hidden\";\n\nimport {\n Start,\n End,\n Backwards,\n Forwards,\n} from \"@hitachivantara/uikit-react-icons\";\n\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\n\nimport { HvInput, HvInputProps } from \"../Input\";\nimport { HvTypography } from \"../Typography\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { setId } from \"../utils/setId\";\nimport { isKey } from \"../utils/keyboardUtils\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { IconButton } from \"../utils/IconButton\";\nimport { useLabels } from \"../hooks/useLabels\";\n\nimport HvSelect, { Option } from \"./Select\";\nimport { staticClasses, useClasses } from \"./Pagination.styles\";\nimport { usePageInput, getSafePage, setColor } from \"./utils\";\n\nexport { staticClasses as paginationClasses };\n\nexport type HvPaginationClasses = ExtractNames<typeof useClasses>;\n\nconst defaultPageSizeOptions = [5, 10, 20, 25, 50, 100];\n\nconst DEFAULT_LABELS = {\n /** The show label. */\n pageSizePrev: \"Show\",\n /** Indicate the units of the page size selection. */\n pageSizeEntryName: \"rows\",\n /** Used for the aria-label of the selection of number of unit.s */\n pageSizeSelectorDescription: \"Select how many to display\",\n /** Separator of current page and total pages. */\n pagesSeparator: \"/\",\n /** Title of button `firstPage`. @deprecated Use `firstPage` instead. */\n paginationFirstPageTitle: \"First page\",\n /** Title of button `previousPage`. @deprecated Use `previousPage` instead. */\n paginationPreviousPageTitle: \"Previous page\",\n /** Title of button `nextPage`. @deprecated Use `nextPage` instead. */\n paginationNextPageTitle: \"Next page\",\n /** Title of button `lastPage`. @deprecated Use `lastPage` instead. */\n paginationLastPageTitle: \"Last page\",\n /** Aria-label passed to the page input. */\n paginationInputLabel: \"Current page\",\n /** Label of the first page button */\n firstPage: \"First Page\",\n /** Label of the previous page button */\n previousPage: \"Previous Page\",\n /** Label of the next page button */\n nextPage: \"Next Page\",\n /** Label of the last page button */\n lastPage: \"Last Page\",\n};\n\nexport type HvPaginationLabels = Partial<typeof DEFAULT_LABELS>;\n\nexport interface HvPaginationProps extends HvBaseProps {\n /** The number of pages the component has. */\n pages?: number;\n /** The currently selected page (0-indexed). */\n page?: number;\n /** Controls whether the left page size mechanism should be visible. */\n showPageSizeOptions?: boolean;\n /** The array of possible page sizes for the dropdown. */\n pageSizeOptions?: number[];\n /** The currently selected page size. */\n pageSize?: number;\n /** Controls whether the central page changing mechanism should be visible. */\n showPageJump?: boolean;\n /** Controls whether the previous/first page buttons are enabled. */\n canPrevious?: boolean;\n /** Controls whether the next/last page buttons are enabled. */\n canNext?: boolean;\n /** Function called when the page changes. */\n onPageChange?: (page: number) => void;\n /** Function called when the page size changes. */\n onPageSizeChange?: (pageSize: number) => void;\n /** An object containing all the labels for the component. */\n labels?: HvPaginationLabels;\n /** Other props to show page component. */\n showPageProps?: HTMLAttributes<HTMLDivElement>;\n /** Other props to pagination component. */\n navigationProps?: HTMLAttributes<HTMLDivElement>;\n /** Extra properties passed to the input component representing the current pages. */\n currentPageInputProps?: HvInputProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvPaginationClasses;\n}\n\n/**\n * Pagination is the process of dividing a document into discrete pages. It relates to how users interact\n * with structured content on a website or application.\n */\nexport const HvPagination = (props: HvPaginationProps) => {\n const {\n classes: classesProp,\n className,\n id,\n pages = 1,\n page = 0,\n showPageSizeOptions = true,\n pageSizeOptions = defaultPageSizeOptions,\n pageSize = defaultPageSizeOptions[1],\n showPageJump = true,\n canPrevious = false,\n canNext = false,\n onPageChange,\n onPageSizeChange,\n labels: labelsProp,\n showPageProps,\n navigationProps,\n currentPageInputProps,\n ...others\n } = useDefaultProps(\"HvPagination\", props);\n\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n const [pageInput, handleInputChange] = usePageInput(page);\n const { classes, cx } = useClasses(classesProp);\n\n const changePage = useCallback(\n (newPage: number) => {\n const safePage: number = getSafePage(newPage, page, pages);\n\n onPageChange?.(safePage);\n handleInputChange(null, safePage + 1);\n },\n [page, pages, onPageChange, handleInputChange]\n );\n\n useEffect(() => {\n if (page >= pages && pages > 0) {\n changePage(page);\n }\n }, [changePage, page, pages]);\n\n useEffect(() => {\n if (pageInput !== page + 1) {\n handleInputChange(null, page + 1);\n }\n\n // we only want to \"fix\" the input's display value when `page` property changed\n // (either externally or when internally committed - onBlur or Enter),\n // not while editing the input.\n // breaking a rule of hooks isn't ideal and it's just a hack for fixing\n // a bug preventing properly controlling of the `page` property.\n // fixing it some other way would potentially introduce a breaking change.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [handleInputChange, page]);\n\n const renderPageJump = () => (\n <div className={classes.pageJump}>\n <HvInput\n id={setId(id, \"currentPage\")}\n labels={labels}\n inputProps={{\n \"aria-label\": labels?.paginationInputLabel,\n // We really want the native number input\n type: \"number\",\n }}\n classes={{\n root: classes?.pageSizeInputContainer,\n input: classes?.pageSizeInput,\n inputRoot: classes?.pageSizeInputRoot,\n }}\n onChange={(event, value) => handleInputChange(event, Number(value))}\n value={String(pageInput)}\n onBlur={(evt, value) => changePage(Number(value) - 1)}\n onKeyDown={(evt, value) =>\n isKey(evt, \"Enter\") && changePage(Number(value) - 1)\n }\n disabled={pageSize === 0}\n disableClear\n {...currentPageInputProps}\n />\n </div>\n );\n\n return (\n <div id={id} className={cx(classes.root, className)} {...others}>\n <div className={classes.pageSizeOptions} {...showPageProps}>\n {showPageSizeOptions && (\n <>\n <Hidden xsDown>\n <HvTypography\n component=\"span\"\n className={classes?.pageSizeTextContainer}\n >\n {labels?.pageSizePrev}\n </HvTypography>\n </Hidden>\n <HvSelect\n id={setId(id, \"pageSize\")}\n disabled={pageSize === 0}\n className={classes.pageSizeOptionsSelect}\n aria-label={labels?.pageSizeSelectorDescription}\n onChange={(_: any, val: number) => onPageSizeChange?.(val)}\n value={pageSize}\n classes={{ header: classes.pageSizeHeader }}\n >\n {pageSizeOptions.map((option) => (\n <Option key={option} value={option}>\n {option}\n </Option>\n ))}\n </HvSelect>\n <Hidden xsDown>\n <HvTypography\n component=\"span\"\n className={classes.pageSizeTextContainer}\n >\n {labels?.pageSizeEntryName}\n </HvTypography>\n </Hidden>\n </>\n )}\n </div>\n <div className={classes.pageNavigator} {...navigationProps}>\n <IconButton\n id={setId(id, \"firstPage-button\")}\n className={classes.iconContainer}\n disabled={!canPrevious}\n onClick={() => changePage(0)}\n title={labels?.firstPage || labels?.paginationFirstPageTitle}\n >\n <Start\n role=\"none\"\n className={classes.icon}\n color={setColor(!canPrevious)}\n iconSize=\"XS\"\n />\n </IconButton>\n <IconButton\n id={setId(id, \"previousPage-button\")}\n className={classes.iconContainer}\n disabled={!canPrevious}\n onClick={() => changePage(page - 1)}\n title={labels?.previousPage || labels?.paginationPreviousPageTitle}\n >\n <Backwards\n role=\"none\"\n className={classes.icon}\n color={setColor(!canPrevious)}\n iconSize=\"XS\"\n />\n </IconButton>\n <div className={classes.pageInfo}>\n {showPageJump ? (\n renderPageJump()\n ) : (\n <HvTypography variant=\"caption2\" component=\"span\">{`${\n page + 1\n }`}</HvTypography>\n )}\n <HvTypography component=\"span\">{`${labels?.pagesSeparator} `}</HvTypography>\n <HvTypography\n component=\"span\"\n id={setId(id, \"totalPages\")}\n className={classes.totalPagesTextContainer}\n >\n {pages}\n </HvTypography>\n </div>\n <IconButton\n id={setId(id, \"nextPage-button\")}\n className={classes.iconContainer}\n disabled={!canNext}\n onClick={() => changePage(page + 1)}\n title={labels?.nextPage || labels?.paginationNextPageTitle}\n >\n <Forwards\n role=\"none\"\n className={classes.icon}\n color={setColor(!canNext)}\n iconSize=\"XS\"\n />\n </IconButton>\n <IconButton\n id={setId(id, \"lastPage-button\")}\n className={classes.iconContainer}\n disabled={!canNext}\n onClick={() => changePage(pages - 1)}\n title={labels?.lastPage || labels?.paginationLastPageTitle}\n >\n <End\n className={classes.icon}\n color={setColor(!canNext)}\n iconSize=\"XS\"\n />\n </IconButton>\n </div>\n </div>\n );\n};\n"],"names":["useDefaultProps","useLabels","usePageInput","useClasses","useCallback","getSafePage","useEffect","jsx","HvInput","setId","isKey","jsxs","Fragment","Hidden","HvTypography","HvSelect","Option","IconButton","Start","setColor","Backwards","Forwards","End"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA,MAAM,yBAAyB,CAAC,GAAG,IAAI,IAAI,IAAI,IAAI,GAAG;AAEtD,MAAM,iBAAiB;AAAA;AAAA,EAErB,cAAc;AAAA;AAAA,EAEd,mBAAmB;AAAA;AAAA,EAEnB,6BAA6B;AAAA;AAAA,EAE7B,gBAAgB;AAAA;AAAA,EAEhB,0BAA0B;AAAA;AAAA,EAE1B,6BAA6B;AAAA;AAAA,EAE7B,yBAAyB;AAAA;AAAA,EAEzB,yBAAyB;AAAA;AAAA,EAEzB,sBAAsB;AAAA;AAAA,EAEtB,WAAW;AAAA;AAAA,EAEX,cAAc;AAAA;AAAA,EAEd,UAAU;AAAA;AAAA,EAEV,UAAU;AACZ;AAyCa,MAAA,eAAe,CAAC,UAA6B;AAClD,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,sBAAsB;AAAA,IACtB,kBAAkB;AAAA,IAClB,WAAW,uBAAuB,CAAC;AAAA,IACnC,eAAe;AAAA,IACf,cAAc;AAAA,IACd,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACDA,gBAAgB,gBAAA,gBAAgB,KAAK;AAEnC,QAAA,SAASC,UAAAA,UAAU,gBAAgB,UAAU;AACnD,QAAM,CAAC,WAAW,iBAAiB,IAAIC,mBAAa,IAAI;AACxD,QA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,QACH;AAAA,MAAA,GACF;AAAA,MACAF,2BAAA;AAAA,QAACU,WAAA;AAAA,QAAA;AAAA,UACC,IAAIR,MAAAA,MAAM,IAAI,iBAAiB;AAAA,UAC/B,WAAW,QAAQ;AAAA,UACnB,UAAU,CAAC;AAAA,UACX,SAAS,MAAM,WAAW,OAAO,CAAC;AAAA,UAClC,OAAO,QAAQ,YAAY,QAAQ;AAAA,UAEnC,UAAAF,2BAAA;AAAA,YAACc,gBAAA;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAW,QAAQ;AAAA,cACnB,OAAOF,MAAAA,SAAS,CAAC,OAAO;AAAA,cACxB,UAAS;AAAA,YAAA;AAAA,UACX;AAAA,QAAA;AAAA,MACF;AAAA,MACAZ,2BAAA;AAAA,QAACU,WAAA;AAAA,QAAA;AAAA,UACC,IAAIR,MAAAA,MAAM,IAAI,iBAAiB;AAAA,UAC/B,WAAW,QAAQ;AAAA,UACnB,UAAU,CAAC;AAAA,UACX,SAAS,MAAM,WAAW,QAAQ,CAAC;AAAA,UACnC,OAAO,QAAQ,YAAY,QAAQ;AAAA,UAEnC,UAAAF,2BAAA;AAAA,YAACe,gBAAA;AAAA,YAAA;AAAA,cACC,WAAW,QAAQ;AAAA,cACnB,OAAOH,MAAAA,SAAS,CAAC,OAAO;AAAA,cACxB,UAAS;AAAA,YAAA;AAAA,UACX;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ;;;"}
|
|
1
|
+
{"version":3,"file":"Pagination.cjs","sources":["../../../src/Pagination/Pagination.tsx"],"sourcesContent":["import { HTMLAttributes, useCallback, useEffect } from \"react\";\n\nimport Hidden from \"@mui/material/Hidden\";\n\nimport {\n Start,\n End,\n Backwards,\n Forwards,\n} from \"@hitachivantara/uikit-react-icons\";\n\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\n\nimport { HvInput, HvInputProps } from \"../Input\";\nimport { HvTypography } from \"../Typography\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { setId } from \"../utils/setId\";\nimport { isKey } from \"../utils/keyboardUtils\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { IconButton } from \"../utils/IconButton\";\nimport { useLabels } from \"../hooks/useLabels\";\n\nimport HvSelect, { Option } from \"./Select\";\nimport { staticClasses, useClasses } from \"./Pagination.styles\";\nimport { usePageInput, getSafePage, setColor } from \"./utils\";\n\nexport { staticClasses as paginationClasses };\n\nexport type HvPaginationClasses = ExtractNames<typeof useClasses>;\n\nconst defaultPageSizeOptions = [5, 10, 20, 25, 50, 100];\n\nconst DEFAULT_LABELS = {\n /** The show label. */\n pageSizePrev: \"Show\",\n /** Indicate the units of the page size selection. */\n pageSizeEntryName: \"rows\",\n /** Used for the aria-label of the selection of number of unit.s */\n pageSizeSelectorDescription: \"Select how many to display\",\n /** Separator of current page and total pages. */\n pagesSeparator: \"/\",\n /** Title of button `firstPage`. @deprecated Use `firstPage` instead. */\n paginationFirstPageTitle: \"First page\",\n /** Title of button `previousPage`. @deprecated Use `previousPage` instead. */\n paginationPreviousPageTitle: \"Previous page\",\n /** Title of button `nextPage`. @deprecated Use `nextPage` instead. */\n paginationNextPageTitle: \"Next page\",\n /** Title of button `lastPage`. @deprecated Use `lastPage` instead. */\n paginationLastPageTitle: \"Last page\",\n /** Aria-label passed to the page input. */\n paginationInputLabel: \"Current page\",\n /** Label of the first page button */\n firstPage: \"First Page\",\n /** Label of the previous page button */\n previousPage: \"Previous Page\",\n /** Label of the next page button */\n nextPage: \"Next Page\",\n /** Label of the last page button */\n lastPage: \"Last Page\",\n};\n\nexport type HvPaginationLabels = Partial<typeof DEFAULT_LABELS>;\n\nexport interface HvPaginationProps extends HvBaseProps {\n /** The number of pages the component has. */\n pages?: number;\n /** The currently selected page (0-indexed). */\n page?: number;\n /** Controls whether the left page size mechanism should be visible. */\n showPageSizeOptions?: boolean;\n /** The array of possible page sizes for the dropdown. */\n pageSizeOptions?: number[];\n /** The currently selected page size. */\n pageSize?: number;\n /** Controls whether the central page changing mechanism should be visible. */\n showPageJump?: boolean;\n /** Controls whether the previous/first page buttons are enabled. */\n canPrevious?: boolean;\n /** Controls whether the next/last page buttons are enabled. */\n canNext?: boolean;\n /** Function called when the page changes. */\n onPageChange?: (page: number) => void;\n /** Function called when the page size changes. */\n onPageSizeChange?: (pageSize: number) => void;\n /** An object containing all the labels for the component. */\n labels?: HvPaginationLabels;\n /** Other props to show page component. */\n showPageProps?: HTMLAttributes<HTMLDivElement>;\n /** Other props to pagination component. */\n navigationProps?: HTMLAttributes<HTMLDivElement>;\n /** Extra properties passed to the input component representing the current pages. */\n currentPageInputProps?: HvInputProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvPaginationClasses;\n}\n\n/**\n * Pagination is the process of dividing a document into discrete pages. It relates to how users interact\n * with structured content on a website or application.\n */\nexport const HvPagination = (props: HvPaginationProps) => {\n const {\n classes: classesProp,\n className,\n id,\n pages = 1,\n page = 0,\n showPageSizeOptions = true,\n pageSizeOptions = defaultPageSizeOptions,\n pageSize = defaultPageSizeOptions[1],\n showPageJump = true,\n canPrevious = false,\n canNext = false,\n onPageChange,\n onPageSizeChange,\n labels: labelsProp,\n showPageProps,\n navigationProps,\n currentPageInputProps,\n ...others\n } = useDefaultProps(\"HvPagination\", props);\n\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n const [pageInput, handleInputChange] = usePageInput(page);\n const { classes, cx } = useClasses(classesProp);\n\n const changePage = useCallback(\n (newPage: number) => {\n const safePage: number = getSafePage(newPage, page, pages);\n\n onPageChange?.(safePage);\n handleInputChange(null, safePage + 1);\n },\n [page, pages, onPageChange, handleInputChange]\n );\n\n useEffect(() => {\n if (page >= pages && pages > 0) {\n changePage(page);\n }\n }, [changePage, page, pages]);\n\n useEffect(() => {\n if (pageInput !== page + 1) {\n handleInputChange(null, page + 1);\n }\n\n // we only want to \"fix\" the input's display value when `page` property changed\n // (either externally or when internally committed - onBlur or Enter),\n // not while editing the input.\n // breaking a rule of hooks isn't ideal and it's just a hack for fixing\n // a bug preventing properly controlling of the `page` property.\n // fixing it some other way would potentially introduce a breaking change.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [handleInputChange, page]);\n\n const renderPageJump = () => (\n <div className={classes.pageJump}>\n <HvInput\n id={setId(id, \"currentPage\")}\n labels={labels}\n inputProps={{\n \"aria-label\": labels?.paginationInputLabel,\n // We really want the native number input\n type: \"number\",\n }}\n classes={{\n root: classes?.pageSizeInputContainer,\n input: classes?.pageSizeInput,\n inputRoot: classes?.pageSizeInputRoot,\n }}\n onChange={(event, value) => handleInputChange(event, Number(value))}\n value={String(pageInput)}\n onBlur={(evt, value) => changePage(Number(value) - 1)}\n onKeyDown={(evt, value) =>\n isKey(evt, \"Enter\") && changePage(Number(value) - 1)\n }\n disabled={pageSize === 0}\n disableClear\n {...currentPageInputProps}\n />\n </div>\n );\n\n return (\n <div id={id} className={cx(classes.root, className)} {...others}>\n <div className={classes.pageSizeOptions} {...showPageProps}>\n {showPageSizeOptions && (\n <>\n <Hidden xsDown>\n <HvTypography\n component=\"span\"\n className={classes?.pageSizeTextContainer}\n >\n {labels?.pageSizePrev}\n </HvTypography>\n </Hidden>\n <HvSelect\n id={setId(id, \"pageSize\")}\n disabled={pageSize === 0}\n className={classes.pageSizeOptionsSelect}\n aria-label={labels?.pageSizeSelectorDescription}\n onChange={(_: any, val: number) => onPageSizeChange?.(val)}\n value={pageSize}\n classes={{\n header: classes.pageSizeHeader,\n root: classes.pageSizeRoot,\n }}\n >\n {pageSizeOptions.map((option) => (\n <Option key={option} value={option}>\n {option}\n </Option>\n ))}\n </HvSelect>\n <Hidden xsDown>\n <HvTypography\n component=\"span\"\n className={classes.pageSizeTextContainer}\n >\n {labels?.pageSizeEntryName}\n </HvTypography>\n </Hidden>\n </>\n )}\n </div>\n <div className={classes.pageNavigator} {...navigationProps}>\n <IconButton\n id={setId(id, \"firstPage-button\")}\n className={classes.iconContainer}\n disabled={!canPrevious}\n onClick={() => changePage(0)}\n title={labels?.firstPage || labels?.paginationFirstPageTitle}\n >\n <Start\n role=\"none\"\n className={classes.icon}\n color={setColor(!canPrevious)}\n iconSize=\"XS\"\n />\n </IconButton>\n <IconButton\n id={setId(id, \"previousPage-button\")}\n className={classes.iconContainer}\n disabled={!canPrevious}\n onClick={() => changePage(page - 1)}\n title={labels?.previousPage || labels?.paginationPreviousPageTitle}\n >\n <Backwards\n role=\"none\"\n className={classes.icon}\n color={setColor(!canPrevious)}\n iconSize=\"XS\"\n />\n </IconButton>\n <div className={classes.pageInfo}>\n {showPageJump ? (\n renderPageJump()\n ) : (\n <HvTypography variant=\"caption2\" component=\"span\">{`${\n page + 1\n }`}</HvTypography>\n )}\n <HvTypography component=\"span\">{`${labels?.pagesSeparator} `}</HvTypography>\n <HvTypography\n component=\"span\"\n id={setId(id, \"totalPages\")}\n className={classes.totalPagesTextContainer}\n >\n {pages}\n </HvTypography>\n </div>\n <IconButton\n id={setId(id, \"nextPage-button\")}\n className={classes.iconContainer}\n disabled={!canNext}\n onClick={() => changePage(page + 1)}\n title={labels?.nextPage || labels?.paginationNextPageTitle}\n >\n <Forwards\n role=\"none\"\n className={classes.icon}\n color={setColor(!canNext)}\n iconSize=\"XS\"\n />\n </IconButton>\n <IconButton\n id={setId(id, \"lastPage-button\")}\n className={classes.iconContainer}\n disabled={!canNext}\n onClick={() => changePage(pages - 1)}\n title={labels?.lastPage || labels?.paginationLastPageTitle}\n >\n <End\n className={classes.icon}\n color={setColor(!canNext)}\n iconSize=\"XS\"\n />\n </IconButton>\n </div>\n </div>\n );\n};\n"],"names":["useDefaultProps","useLabels","usePageInput","useClasses","useCallback","getSafePage","useEffect","jsx","HvInput","setId","isKey","jsxs","Fragment","Hidden","HvTypography","HvSelect","Option","IconButton","Start","setColor","Backwards","Forwards","End"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA,MAAM,yBAAyB,CAAC,GAAG,IAAI,IAAI,IAAI,IAAI,GAAG;AAEtD,MAAM,iBA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nB,OAAOF,MAAAA,SAAS,CAAC,OAAO;AAAA,cACxB,UAAS;AAAA,YAAA;AAAA,UACX;AAAA,QAAA;AAAA,MACF;AAAA,MACAZ,2BAAA;AAAA,QAACU,WAAA;AAAA,QAAA;AAAA,UACC,IAAIR,MAAAA,MAAM,IAAI,iBAAiB;AAAA,UAC/B,WAAW,QAAQ;AAAA,UACnB,UAAU,CAAC;AAAA,UACX,SAAS,MAAM,WAAW,QAAQ,CAAC;AAAA,UACnC,OAAO,QAAQ,YAAY,QAAQ;AAAA,UAEnC,UAAAF,2BAAA;AAAA,YAACe,gBAAA;AAAA,YAAA;AAAA,cACC,WAAW,QAAQ;AAAA,cACnB,OAAOH,MAAAA,SAAS,CAAC,OAAO;AAAA,cACxB,UAAS;AAAA,YAAA;AAAA,UACX;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ;;;"}
|
|
@@ -52,6 +52,9 @@ const { staticClasses, useClasses } = classes.createClasses("HvPagination", {
|
|
|
52
52
|
marginTop: -2
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
+
pageSizeRoot: {
|
|
56
|
+
width: "auto"
|
|
57
|
+
},
|
|
55
58
|
/** Styles applied to the element that holds the labels for the page size selector */
|
|
56
59
|
pageSizeTextContainer: {
|
|
57
60
|
display: "flex",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.styles.cjs","sources":["../../../src/Pagination/Pagination.styles.tsx"],"sourcesContent":["import { CSSProperties } from \"react\";\n\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { inputClasses } from \"../Input\";\nimport { createClasses } from \"../utils/classes\";\nimport { baseDropdownClasses } from \"../BaseDropdown\";\n\nconst hoverColor = theme.colors.atmo3;\n\nexport const { staticClasses, useClasses } = createClasses(\"HvPagination\", {\n /** Styles applied to the component root class. */\n root: {\n position: \"relative\",\n zIndex: 1,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"stretch\",\n flexWrap: \"wrap\",\n marginTop: theme.space.sm,\n [`& $pageSizeInput`]: {\n ...(theme.typography.caption2 as CSSProperties),\n \"&:focus\": {\n padding: 0,\n },\n },\n [`& $pageSizeInputContainer`]: {\n width: 24,\n minWidth: 24,\n maxWidth: theme.spacing(8),\n },\n [`&& $pageSizeInputRoot`]: {\n backgroundColor: \"transparent\",\n height: \"24px\",\n \"&:focus, &:focus-within, &:hover\": {\n backgroundColor: hoverColor,\n },\n },\n },\n /** Styles applied to the page size selector container. */\n pageSizeOptions: {\n display: \"flex\",\n position: \"absolute\",\n height: 24,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n left: \"0\",\n },\n pageSizeHeader: {\n height: 24,\n display: \"flex\",\n alignItems: \"center\",\n [`& .${baseDropdownClasses.arrowContainer}`]: {\n marginTop: -2,\n },\n },\n /** Styles applied to the element that holds the labels for the page size selector */\n pageSizeTextContainer: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: \"24px\",\n padding: \"8px 0\",\n ...(theme.typography.caption2 as CSSProperties),\n },\n totalPagesTextContainer: {\n ...(theme.typography.caption2 as CSSProperties),\n },\n /** Styles applied to the page size selector dropdown element. */\n pageSizeOptionsSelect: {\n display: \"inline-block\",\n margin: `0px ${theme.space.xs}`,\n width: \"auto\",\n\n ...(theme.typography.caption2 as CSSProperties),\n },\n /** Styles applied to the page navigation container. */\n pageNavigator: {\n display: \"flex\",\n alignItems: \"center\",\n height: \"32px\",\n gap: 8,\n },\n /** Styles applied to each navigation `HvButton` icon container. */\n iconContainer: {\n padding: 0,\n },\n /** Styles applied to each navigation icon. */\n icon: {},\n /** Styles applied to the central page information container. */\n pageInfo: {\n display: \"inline-block\",\n whiteSpace: \"nowrap\",\n height: \"32px\",\n lineHeight: \"32px\",\n },\n /** Styles applied to the page selector input container. */\n pageJump: {\n display: \"inline-block\",\n marginRight: `4px`,\n [`& .${inputClasses.inputRoot}`]: {\n [`& $pageSizeInput`]: {\n paddingLeft: `4px`,\n paddingRight: `4px`,\n margin: 0,\n textAlign: \"center\",\n borderRadius: theme.radii.base,\n MozAppearance: \"textfield\",\n \"&:focus\": {\n backgroundColor: hoverColor,\n },\n \"&:hover\": {\n cursor: \"pointer\",\n },\n },\n },\n },\n /** Styles passed down to the page selector Input component as `input`. */\n pageSizeInput: {},\n /** Styles passed down to the page selector Input root. */\n pageSizeInputRoot: {},\n /** Styles passed down to the page selector Input component as `container`. */\n pageSizeInputContainer: {},\n});\n"],"names":["theme","createClasses","baseDropdownClasses","inputClasses"],"mappings":";;;;;;;AAQA,MAAM,aAAaA,YAAAA,MAAM,OAAO;AAEzB,MAAM,EAAE,eAAe,eAAeC,QAAAA,cAAc,gBAAgB;AAAA;AAAA,EAEzE,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,WAAWD,YAAAA,MAAM,MAAM;AAAA,IACvB,CAAC,kBAAkB,GAAG;AAAA,MACpB,GAAIA,YAAAA,MAAM,WAAW;AAAA,MACrB,WAAW;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,CAAC,2BAA2B,GAAG;AAAA,MAC7B,OAAO;AAAA,MACP,UAAU;AAAA,MACV,UAAUA,YAAAA,MAAM,QAAQ,CAAC;AAAA,IAC3B;AAAA,IACA,CAAC,uBAAuB,GAAG;AAAA,MACzB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,oCAAoC;AAAA,QAClC,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAEA,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,EACR;AAAA,EACA,gBAAgB;AAAA,IACd,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,YAAY;AAAA,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;AAAA;AAAA,EAEpB,wBAAwB,CAAC;AAC3B,CAAC;;;"}
|
|
1
|
+
{"version":3,"file":"Pagination.styles.cjs","sources":["../../../src/Pagination/Pagination.styles.tsx"],"sourcesContent":["import { CSSProperties } from \"react\";\n\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { inputClasses } from \"../Input\";\nimport { createClasses } from \"../utils/classes\";\nimport { baseDropdownClasses } from \"../BaseDropdown\";\n\nconst hoverColor = theme.colors.atmo3;\n\nexport const { staticClasses, useClasses } = createClasses(\"HvPagination\", {\n /** Styles applied to the component root class. */\n root: {\n position: \"relative\",\n zIndex: 1,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"stretch\",\n flexWrap: \"wrap\",\n marginTop: theme.space.sm,\n [`& $pageSizeInput`]: {\n ...(theme.typography.caption2 as CSSProperties),\n \"&:focus\": {\n padding: 0,\n },\n },\n [`& $pageSizeInputContainer`]: {\n width: 24,\n minWidth: 24,\n maxWidth: theme.spacing(8),\n },\n [`&& $pageSizeInputRoot`]: {\n backgroundColor: \"transparent\",\n height: \"24px\",\n \"&:focus, &:focus-within, &:hover\": {\n backgroundColor: hoverColor,\n },\n },\n },\n /** Styles applied to the page size selector container. */\n pageSizeOptions: {\n display: \"flex\",\n position: \"absolute\",\n height: 24,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n left: \"0\",\n },\n pageSizeHeader: {\n height: 24,\n display: \"flex\",\n alignItems: \"center\",\n [`& .${baseDropdownClasses.arrowContainer}`]: {\n marginTop: -2,\n },\n },\n pageSizeRoot: {\n width: \"auto\",\n },\n /** Styles applied to the element that holds the labels for the page size selector */\n pageSizeTextContainer: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: \"24px\",\n padding: \"8px 0\",\n ...(theme.typography.caption2 as CSSProperties),\n },\n totalPagesTextContainer: {\n ...(theme.typography.caption2 as CSSProperties),\n },\n /** Styles applied to the page size selector dropdown element. */\n pageSizeOptionsSelect: {\n display: \"inline-block\",\n margin: `0px ${theme.space.xs}`,\n width: \"auto\",\n\n ...(theme.typography.caption2 as CSSProperties),\n },\n /** Styles applied to the page navigation container. */\n pageNavigator: {\n display: \"flex\",\n alignItems: \"center\",\n height: \"32px\",\n gap: 8,\n },\n /** Styles applied to each navigation `HvButton` icon container. */\n iconContainer: {\n padding: 0,\n },\n /** Styles applied to each navigation icon. */\n icon: {},\n /** Styles applied to the central page information container. */\n pageInfo: {\n display: \"inline-block\",\n whiteSpace: \"nowrap\",\n height: \"32px\",\n lineHeight: \"32px\",\n },\n /** Styles applied to the page selector input container. */\n pageJump: {\n display: \"inline-block\",\n marginRight: `4px`,\n [`& .${inputClasses.inputRoot}`]: {\n [`& $pageSizeInput`]: {\n paddingLeft: `4px`,\n paddingRight: `4px`,\n margin: 0,\n textAlign: \"center\",\n borderRadius: theme.radii.base,\n MozAppearance: \"textfield\",\n \"&:focus\": {\n backgroundColor: hoverColor,\n },\n \"&:hover\": {\n cursor: \"pointer\",\n },\n },\n },\n },\n /** Styles passed down to the page selector Input component as `input`. */\n pageSizeInput: {},\n /** Styles passed down to the page selector Input root. */\n pageSizeInputRoot: {},\n /** Styles passed down to the page selector Input component as `container`. */\n pageSizeInputContainer: {},\n});\n"],"names":["theme","createClasses","baseDropdownClasses","inputClasses"],"mappings":";;;;;;;AAQA,MAAM,aAAaA,YAAAA,MAAM,OAAO;AAEzB,MAAM,EAAE,eAAe,eAAeC,QAAAA,cAAc,gBAAgB;AAAA;AAAA,EAEzE,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,WAAWD,YAAAA,MAAM,MAAM;AAAA,IACvB,CAAC,kBAAkB,GAAG;AAAA,MACpB,GAAIA,YAAAA,MAAM,WAAW;AAAA,MACrB,WAAW;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,CAAC,2BAA2B,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AAY;AAAA,IACZ,QAAQ;AAAA,IACR,YAAY;AAAA,EACd;AAAA;AAAA,EAEA,UAAU;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,IACb,CAAC,MAAMG,2BAAa,SAAS,EAAE,GAAG;AAAA,MAChC,CAAC,kBAAkB,GAAG;AAAA,QACpB,aAAa;AAAA,QACb,cAAc;AAAA,QACd,QAAQ;AAAA,QACR,WAAW;AAAA,QACX,cAAcH,YAAAA,MAAM,MAAM;AAAA,QAC1B,eAAe;AAAA,QACf,WAAW;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,QACA,WAAW;AAAA,UACT,QAAQ;AAAA,QACV;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAEA,eAAe,CAAC;AAAA;AAAA,EAEhB,mBAAmB,CAAC;AAAA;AAAA,EAEpB,wBAAwB,CAAC;AAC3B,CAAC;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.cjs","sources":["../../../src/Pagination/Select.tsx"],"sourcesContent":["import { SyntheticEvent, useState } from \"react\";\n\nimport { HvBaseDropdown, HvBaseDropdownProps } from \"../BaseDropdown\";\nimport { HvSelectionList, HvSelectionListProps } from \"../SelectionList\";\nimport { HvPanel } from \"../Panel\";\nimport { HvListItem, HvListItemProps } from \"../ListContainer\";\n\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\n\nimport { useClasses } from \"./Select.styles\";\n\nexport const Option = ({ ...props }: Partial<HvListItemProps>) => (\n <HvListItem {...props} />\n);\n\nexport interface HvPaginationSelectProps\n extends Omit<HvBaseDropdownProps, \"onChange\"> {\n onChange: (event: React.SyntheticEvent, val: number) => void;\n value: number;\n}\n\nconst HvSelect = (props: HvPaginationSelectProps) => {\n const {\n className,\n classes: classesProp,\n onChange,\n disabled,\n value,\n children,\n ...others\n } = useDefaultProps(\"HvPaginationSelect\", props);\n const { classes } = useClasses(classesProp);\n const [open, setOpen] = useState(false);\n\n const handleSelect: HvSelectionListProps[\"onChange\"] = (evt, val) => {\n onChange?.(evt, val);\n setOpen(false);\n };\n\n const handleToggle: HvBaseDropdownProps[\"onToggle\"] = (_evt, s) => {\n setOpen(s);\n };\n\n const setFocusToContent: HvBaseDropdownProps[\"onContainerCreation\"] = (\n containerRef\n ) => {\n const listItems =\n containerRef != null ? [...containerRef.getElementsByTagName(\"li\")] : [];\n listItems.every((listItem) => {\n if (listItem.tabIndex >= 0) {\n listItem.focus();\n return false;\n }\n return true;\n });\n };\n\n return (\n <HvBaseDropdown\n className={className}\n classes={{\n selection: classes.selection,\n header: classes.header,\n headerOpen: classes.headerOpen,\n }}\n expanded={open}\n onToggle={handleToggle}\n onContainerCreation={setFocusToContent}\n placeholder={value}\n disabled={disabled}\n variableWidth\n {...others}\n >\n <HvPanel>\n <HvSelectionList value={value} onChange={handleSelect}>\n {children}\n </HvSelectionList>\n </HvPanel>\n </HvBaseDropdown>\n );\n};\n\nexport default HvSelect;\n"],"names":["jsx","HvListItem","useDefaultProps","useClasses","useState","HvBaseDropdown","HvPanel","HvSelectionList"],"mappings":";;;;;;;;;;AAWa,MAAA,SAAS,CAAC,EAAE,GAAG,MAC1B,MAAAA,2BAAA,IAACC,qBAAY,EAAA,GAAG,OAAO;AASzB,MAAM,WAAW,CAAC,UAAmC;AAC7C,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACDC,gBAAgB,gBAAA,sBAAsB,KAAK;AAC/C,QAAM,EAAE,QAAA,IAAYC,cAAA,WAAW,WAAW;AAC1C,QAAM,CAAC,MAAM,OAAO,IAAIC,eAAS,KAAK;AAEhC,QAAA,eAAiD,CAAC,KAAK,QAAQ;AACnE,eAAW,KAAK,GAAG;AACnB,YAAQ,KAAK;AAAA,EAAA;AAGT,QAAA,eAAgD,CAAC,MAAM,MAAM;AACjE,YAAQ,CAAC;AAAA,EAAA;AAGL,QAAA,oBAAgE,CACpE,iBACG;AACG,UAAA,YACJ,gBAAgB,OAAO,CAAC,GAAG,aAAa,qBAAqB,IAAI,CAAC,IAAI;AAC9D,cAAA,MAAM,CAAC,aAAa;AACxB,UAAA,SAAS,YAAY,GAAG;AAC1B,iBAAS,MAAM;AACR,eAAA;AAAA,MACT;AACO,aAAA;AAAA,IAAA,CACR;AAAA,EAAA;AAID,SAAAJ,2BAAA;AAAA,IAACK,aAAA;AAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAS;AAAA,QACP,WAAW,QAAQ;AAAA,QACnB,QAAQ,QAAQ;AAAA,QAChB,YAAY,QAAQ;AAAA,
|
|
1
|
+
{"version":3,"file":"Select.cjs","sources":["../../../src/Pagination/Select.tsx"],"sourcesContent":["import { SyntheticEvent, useState } from \"react\";\n\nimport { HvBaseDropdown, HvBaseDropdownProps } from \"../BaseDropdown\";\nimport { HvSelectionList, HvSelectionListProps } from \"../SelectionList\";\nimport { HvPanel } from \"../Panel\";\nimport { HvListItem, HvListItemProps } from \"../ListContainer\";\n\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\n\nimport { useClasses } from \"./Select.styles\";\n\nexport const Option = ({ ...props }: Partial<HvListItemProps>) => (\n <HvListItem {...props} />\n);\n\nexport interface HvPaginationSelectProps\n extends Omit<HvBaseDropdownProps, \"onChange\"> {\n onChange: (event: React.SyntheticEvent, val: number) => void;\n value: number;\n}\n\nconst HvSelect = (props: HvPaginationSelectProps) => {\n const {\n className,\n classes: classesProp,\n onChange,\n disabled,\n value,\n children,\n ...others\n } = useDefaultProps(\"HvPaginationSelect\", props);\n const { classes } = useClasses(classesProp);\n const [open, setOpen] = useState(false);\n\n const handleSelect: HvSelectionListProps[\"onChange\"] = (evt, val) => {\n onChange?.(evt, val);\n setOpen(false);\n };\n\n const handleToggle: HvBaseDropdownProps[\"onToggle\"] = (_evt, s) => {\n setOpen(s);\n };\n\n const setFocusToContent: HvBaseDropdownProps[\"onContainerCreation\"] = (\n containerRef\n ) => {\n const listItems =\n containerRef != null ? [...containerRef.getElementsByTagName(\"li\")] : [];\n listItems.every((listItem) => {\n if (listItem.tabIndex >= 0) {\n listItem.focus();\n return false;\n }\n return true;\n });\n };\n\n return (\n <HvBaseDropdown\n className={className}\n classes={{\n selection: classes.selection,\n header: classes.header,\n headerOpen: classes.headerOpen,\n root: classes.root,\n }}\n expanded={open}\n onToggle={handleToggle}\n onContainerCreation={setFocusToContent}\n placeholder={value}\n disabled={disabled}\n variableWidth\n {...others}\n >\n <HvPanel>\n <HvSelectionList value={value} onChange={handleSelect}>\n {children}\n </HvSelectionList>\n </HvPanel>\n </HvBaseDropdown>\n );\n};\n\nexport default HvSelect;\n"],"names":["jsx","HvListItem","useDefaultProps","useClasses","useState","HvBaseDropdown","HvPanel","HvSelectionList"],"mappings":";;;;;;;;;;AAWa,MAAA,SAAS,CAAC,EAAE,GAAG,MAC1B,MAAAA,2BAAA,IAACC,qBAAY,EAAA,GAAG,OAAO;AASzB,MAAM,WAAW,CAAC,UAAmC;AAC7C,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACDC,gBAAgB,gBAAA,sBAAsB,KAAK;AAC/C,QAAM,EAAE,QAAA,IAAYC,cAAA,WAAW,WAAW;AAC1C,QAAM,CAAC,MAAM,OAAO,IAAIC,eAAS,KAAK;AAEhC,QAAA,eAAiD,CAAC,KAAK,QAAQ;AACnE,eAAW,KAAK,GAAG;AACnB,YAAQ,KAAK;AAAA,EAAA;AAGT,QAAA,eAAgD,CAAC,MAAM,MAAM;AACjE,YAAQ,CAAC;AAAA,EAAA;AAGL,QAAA,oBAAgE,CACpE,iBACG;AACG,UAAA,YACJ,gBAAgB,OAAO,CAAC,GAAG,aAAa,qBAAqB,IAAI,CAAC,IAAI;AAC9D,cAAA,MAAM,CAAC,aAAa;AACxB,UAAA,SAAS,YAAY,GAAG;AAC1B,iBAAS,MAAM;AACR,eAAA;AAAA,MACT;AACO,aAAA;AAAA,IAAA,CACR;AAAA,EAAA;AAID,SAAAJ,2BAAA;AAAA,IAACK,aAAA;AAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAS;AAAA,QACP,WAAW,QAAQ;AAAA,QACnB,QAAQ,QAAQ;AAAA,QAChB,YAAY,QAAQ;AAAA,QACpB,MAAM,QAAQ;AAAA,MAChB;AAAA,MACA,UAAU;AAAA,MACV,UAAU;AAAA,MACV,qBAAqB;AAAA,MACrB,aAAa;AAAA,MACb;AAAA,MACA,eAAa;AAAA,MACZ,GAAG;AAAA,MAEJ,UAAAL,2BAAAA,IAACM,MAAAA,WACC,UAACN,2BAAAA,IAAAO,cAAAA,iBAAA,EAAgB,OAAc,UAAU,cACtC,UACH,EACF,CAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAA,aAAe;;;"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
4
4
|
const classes = require("../utils/classes.cjs");
|
|
5
5
|
const { useClasses } = classes.createClasses("HvPaginationSelect", {
|
|
6
|
+
root: {},
|
|
6
7
|
header: {
|
|
7
8
|
backgroundColor: "transparent",
|
|
8
9
|
borderColor: uikitStyles.theme.colors.secondary_80,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.styles.cjs","sources":["../../../src/Pagination/Select.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { useClasses } = createClasses(\"HvPaginationSelect\", {\n header: {\n backgroundColor: \"transparent\",\n borderColor: theme.colors.secondary_80,\n \"&:hover\": {\n borderColor: theme.colors.secondary_80,\n },\n },\n selection: {\n padding: theme.spacing(0, \"md\", 0, \"xs\"),\n },\n headerOpen: {\n backgroundColor: theme.colors.atmo1,\n },\n});\n"],"names":["createClasses","theme"],"mappings":";;;;AAIO,MAAM,EAAE,WAAA,IAAeA,QAAA,cAAc,sBAAsB;AAAA,EAChE,QAAQ;AAAA,IACN,iBAAiB;AAAA,IACjB,aAAaC,YAAAA,MAAM,OAAO;AAAA,IAC1B,WAAW;AAAA,MACT,aAAaA,YAAAA,MAAM,OAAO;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,WAAW;AAAA,IACT,SAASA,YAAM,MAAA,QAAQ,GAAG,MAAM,GAAG,IAAI;AAAA,EACzC;AAAA,EACA,YAAY;AAAA,IACV,iBAAiBA,YAAAA,MAAM,OAAO;AAAA,EAChC;AACF,CAAC;;"}
|
|
1
|
+
{"version":3,"file":"Select.styles.cjs","sources":["../../../src/Pagination/Select.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { useClasses } = createClasses(\"HvPaginationSelect\", {\n root: {},\n header: {\n backgroundColor: \"transparent\",\n borderColor: theme.colors.secondary_80,\n \"&:hover\": {\n borderColor: theme.colors.secondary_80,\n },\n },\n selection: {\n padding: theme.spacing(0, \"md\", 0, \"xs\"),\n },\n headerOpen: {\n backgroundColor: theme.colors.atmo1,\n },\n});\n"],"names":["createClasses","theme"],"mappings":";;;;AAIO,MAAM,EAAE,WAAA,IAAeA,QAAA,cAAc,sBAAsB;AAAA,EAChE,MAAM,CAAC;AAAA,EACP,QAAQ;AAAA,IACN,iBAAiB;AAAA,IACjB,aAAaC,YAAAA,MAAM,OAAO;AAAA,IAC1B,WAAW;AAAA,MACT,aAAaA,YAAAA,MAAM,OAAO;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,WAAW;AAAA,IACT,SAASA,YAAM,MAAA,QAAQ,GAAG,MAAM,GAAG,IAAI;AAAA,EACzC;AAAA,EACA,YAAY;AAAA,IACV,iBAAiBA,YAAAA,MAAM,OAAO;AAAA,EAChC;AACF,CAAC;;"}
|
|
@@ -55,7 +55,7 @@ const { staticClasses, useClasses } = classes.createClasses("HvTableSection", {
|
|
|
55
55
|
// Remove border for the last table row
|
|
56
56
|
[`& .${TableRow_styles.staticClasses.root}`]: {
|
|
57
57
|
"&:last-child": {
|
|
58
|
-
[`& .${TableCell_styles.staticClasses.root}`]: {
|
|
58
|
+
[`& .${TableCell_styles.staticClasses.root}`]: { borderBottom: "none" }
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
[`& .${TableCell_styles.staticClasses.root}`]: {
|
|
@@ -81,6 +81,12 @@ const { staticClasses, useClasses } = classes.createClasses("HvTableSection", {
|
|
|
81
81
|
},
|
|
82
82
|
[`& .${Pagination_styles.staticClasses.pageSizeOptions}`]: {
|
|
83
83
|
left: uikitStyles.theme.space.sm
|
|
84
|
+
},
|
|
85
|
+
[`& .${Pagination_styles.staticClasses.pageSizeHeader}`]: {
|
|
86
|
+
border: "none",
|
|
87
|
+
"&:hover": {
|
|
88
|
+
border: "none"
|
|
89
|
+
}
|
|
84
90
|
}
|
|
85
91
|
},
|
|
86
92
|
hidden: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableSection.styles.cjs","sources":["../../../src/TableSection/TableSection.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { bulkActionsClasses } from \"../BulkActions\";\nimport { paginationClasses } from \"../Pagination\";\nimport { tableCellClasses } from \"../Table/TableCell\";\nimport { tableContainerClasses } from \"../Table/TableContainer\";\nimport { tableHeaderClasses } from \"../Table/TableHeader\";\nimport { createClasses } from \"../utils/classes\";\nimport { tableRowClasses } from \"../Table/TableRow\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableSection\", {\n root: {},\n header: {\n // Only apply the border to divide the header and content when both are displayed\n \"+ div\": { borderTop: `1px solid ${theme.colors.atmo3}` },\n },\n actions: {\n right: theme.space.sm,\n },\n content: {\n marginTop: 0,\n padding: 0,\n\n // Apply border radius to the first child if there's not an header\n \"&:first-of-type\": {\n \"& > :first-of-type\": {\n borderTopLeftRadius: theme.radii.round,\n borderTopRightRadius: theme.radii.round,\n },\n },\n\n \"& > :last-child\": {\n borderBottomLeftRadius: theme.radii.round,\n borderBottomRightRadius: theme.radii.round,\n },\n\n [`& .${tableContainerClasses.root}`]: {\n paddingBottom: 0,\n },\n\n [`& .${tableHeaderClasses.head}`]: {\n backgroundColor: theme.colors.atmo2,\n borderBottomColor: theme.colors.atmo3,\n [`&.${tableHeaderClasses.variantCheckbox}`]: {\n borderRight: \"none\",\n },\n [`&.${tableHeaderClasses.variantActions}`]: {\n borderLeft: \"none\",\n },\n },\n\n // Remove border for the last table row\n [`& .${tableRowClasses.root}`]: {\n \"&:last-child\": {\n [`& .${tableCellClasses.root}`]: {
|
|
1
|
+
{"version":3,"file":"TableSection.styles.cjs","sources":["../../../src/TableSection/TableSection.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { bulkActionsClasses } from \"../BulkActions\";\nimport { paginationClasses } from \"../Pagination\";\nimport { tableCellClasses } from \"../Table/TableCell\";\nimport { tableContainerClasses } from \"../Table/TableContainer\";\nimport { tableHeaderClasses } from \"../Table/TableHeader\";\nimport { createClasses } from \"../utils/classes\";\nimport { tableRowClasses } from \"../Table/TableRow\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableSection\", {\n root: {},\n header: {\n // Only apply the border to divide the header and content when both are displayed\n \"+ div\": { borderTop: `1px solid ${theme.colors.atmo3}` },\n },\n actions: {\n right: theme.space.sm,\n },\n content: {\n marginTop: 0,\n padding: 0,\n\n // Apply border radius to the first child if there's not an header\n \"&:first-of-type\": {\n \"& > :first-of-type\": {\n borderTopLeftRadius: theme.radii.round,\n borderTopRightRadius: theme.radii.round,\n },\n },\n\n \"& > :last-child\": {\n borderBottomLeftRadius: theme.radii.round,\n borderBottomRightRadius: theme.radii.round,\n },\n\n [`& .${tableContainerClasses.root}`]: {\n paddingBottom: 0,\n },\n\n [`& .${tableHeaderClasses.head}`]: {\n backgroundColor: theme.colors.atmo2,\n borderBottomColor: theme.colors.atmo3,\n [`&.${tableHeaderClasses.variantCheckbox}`]: {\n borderRight: \"none\",\n },\n [`&.${tableHeaderClasses.variantActions}`]: {\n borderLeft: \"none\",\n },\n },\n\n // Remove border for the last table row\n [`& .${tableRowClasses.root}`]: {\n \"&:last-child\": {\n [`& .${tableCellClasses.root}`]: { borderBottom: \"none\" },\n },\n },\n\n [`& .${tableCellClasses.root}`]: {\n borderBottomColor: theme.colors.atmo3,\n },\n\n [`& .${tableCellClasses.variantCheckbox}`]: {\n borderRight: \"none\",\n },\n\n [`& .${tableCellClasses.variantActions}`]: {\n borderLeft: \"none\",\n },\n\n [`& .${bulkActionsClasses.root}`]: {\n marginBottom: 0,\n border: \"none\",\n borderBottom: `1px solid ${theme.colors.atmo3}`,\n padding: theme.spacing(\"xs\", \"sm\"),\n },\n\n [`& .${paginationClasses.root}`]: {\n margin: 0,\n backgroundColor: theme.colors.atmo2,\n padding: theme.space.xs,\n borderTop: `1px solid ${theme.colors.atmo3}`,\n },\n\n [`& .${paginationClasses.pageSizeOptions}`]: {\n left: theme.space.sm,\n },\n [`& .${paginationClasses.pageSizeHeader}`]: {\n border: \"none\",\n \"&:hover\": {\n border: \"none\",\n },\n },\n },\n hidden: {},\n raisedHeader: {\n \"+ div\": {\n paddingTop: 0,\n },\n },\n spaceTop: { paddingTop: 0 },\n});\n"],"names":["createClasses","theme","tableContainerClasses","tableHeaderClasses","tableRowClasses","tableCellClasses","bulkActionsClasses","paginationClasses"],"mappings":";;;;;;;;;;;;;;;;;;AAUO,MAAM,EAAE,eAAe,eAAeA,QAAAA,cAAc,kBAAkB;AAAA,EAC3E,MAAM,CAAC;AAAA,EACP,QAAQ;AAAA;AAAA,IAEN,SAAS,EAAE,WAAW,aAAaC,YAAAA,MAAM,OAAO,KAAK,GAAG;AAAA,EAC1D;AAAA,EACA,SAAS;AAAA,IACP,OAAOA,YAAAA,MAAM,MAAM;AAAA,EACrB;AAAA,EACA,SAAS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AAc,aAAaL,YAAM,MAAA,OAAO,KAAK;AAAA,MAC7C,SAASA,YAAA,MAAM,QAAQ,MAAM,IAAI;AAAA,IACnC;AAAA,IAEA,CAAC,MAAMM,gCAAkB,IAAI,EAAE,GAAG;AAAA,MAChC,QAAQ;AAAA,MACR,iBAAiBN,YAAAA,MAAM,OAAO;AAAA,MAC9B,SAASA,YAAAA,MAAM,MAAM;AAAA,MACrB,WAAW,aAAaA,YAAM,MAAA,OAAO,KAAK;AAAA,IAC5C;AAAA,IAEA,CAAC,MAAMM,gCAAkB,eAAe,EAAE,GAAG;AAAA,MAC3C,MAAMN,YAAAA,MAAM,MAAM;AAAA,IACpB;AAAA,IACA,CAAC,MAAMM,gCAAkB,cAAc,EAAE,GAAG;AAAA,MAC1C,QAAQ;AAAA,MACR,WAAW;AAAA,QACT,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF;AAAA,EACA,QAAQ,CAAC;AAAA,EACT,cAAc;AAAA,IACZ,SAAS;AAAA,MACP,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EACA,UAAU,EAAE,YAAY,EAAE;AAC5B,CAAC;;;"}
|
|
@@ -21,14 +21,18 @@ const HvProvider = ({
|
|
|
21
21
|
themes,
|
|
22
22
|
theme: theme$1,
|
|
23
23
|
colorMode,
|
|
24
|
+
emotionCache: emotionCacheProp,
|
|
24
25
|
classNameKey = uikitReactShared.defaultCacheKey
|
|
25
26
|
}) => {
|
|
26
27
|
const scopedRootId = useUniqueId.useUniqueId(void 0, scopedRootPrefix);
|
|
27
28
|
const themesList = theme.processThemes(themes);
|
|
28
|
-
const emotionCache = React.useMemo(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const emotionCache = React.useMemo(() => {
|
|
30
|
+
if (emotionCacheProp)
|
|
31
|
+
return emotionCacheProp;
|
|
32
|
+
if (classNameKey === uikitReactShared.defaultCacheKey)
|
|
33
|
+
return uikitReactShared.defaultEmotionCache;
|
|
34
|
+
return createCache__default.default({ key: classNameKey, prepend: true });
|
|
35
|
+
}, [classNameKey, emotionCacheProp]);
|
|
32
36
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.CacheProvider, { value: emotionCache, children: [
|
|
33
37
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
34
38
|
react.Global,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.cjs","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\n\nimport createCache from \"@emotion/cache\";\nimport {\n css as cssReact,\n Global,\n CacheProvider,\n ClassNames,\n} from \"@emotion/react\";\n\nimport {\n CssBaseline,\n CssScopedBaseline,\n getThemesVars,\n HvThemeStructure,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { getElementById } from \"../utils/document\";\nimport { processThemes } from \"../utils/theme\";\nimport { HvTheme } from \"../types/theme\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\n\nimport {\n HvThemeProvider,\n defaultCacheKey,\n defaultEmotionCache,\n} from \"./ThemeProvider\";\n\n// Provider props\nexport interface HvProviderProps {\n /**\n * Your component tree.\n */\n children?: React.ReactNode;\n /**\n * Id of your root element.\n */\n rootElementId?: string;\n /**\n * By default the baseline styles are applied globally, `global`, to the application for the UI Kit components to work properly.\n * If you need to scope the baseline styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the baseline to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the baseline will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n * If you are providing your own baseline styles, you can set this property to `none` to disable the baseline styles.\n */\n cssBaseline?: \"global\" | \"scoped\" | \"none\";\n /**\n * By default the theme styles are applied globally, `global`, to the application.\n * If you need to scope the theme styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the theme to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the theme will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n */\n cssTheme?: \"global\" | \"scoped\";\n /**\n * The string used to prefix the class names and uniquely identify them. The key can only contain lower case alphabetical characters.\n * This is useful to avoid class name collisions.\n *\n * If no value is provided, the default is
|
|
1
|
+
{"version":3,"file":"Provider.cjs","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\n\nimport createCache, { EmotionCache } from \"@emotion/cache\";\nimport {\n css as cssReact,\n Global,\n CacheProvider,\n ClassNames,\n} from \"@emotion/react\";\n\nimport {\n CssBaseline,\n CssScopedBaseline,\n getThemesVars,\n HvThemeStructure,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { getElementById } from \"../utils/document\";\nimport { processThemes } from \"../utils/theme\";\nimport { HvTheme } from \"../types/theme\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\n\nimport {\n HvThemeProvider,\n defaultCacheKey,\n defaultEmotionCache,\n} from \"./ThemeProvider\";\n\n// Provider props\nexport interface HvProviderProps {\n /**\n * Your component tree.\n */\n children?: React.ReactNode;\n /**\n * Id of your root element.\n */\n rootElementId?: string;\n /**\n * By default the baseline styles are applied globally, `global`, to the application for the UI Kit components to work properly.\n * If you need to scope the baseline styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the baseline to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the baseline will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n * If you are providing your own baseline styles, you can set this property to `none` to disable the baseline styles.\n */\n cssBaseline?: \"global\" | \"scoped\" | \"none\";\n /**\n * By default the theme styles are applied globally, `global`, to the application.\n * If you need to scope the theme styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the theme to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the theme will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n */\n cssTheme?: \"global\" | \"scoped\";\n /**\n * The string used to prefix the class names and uniquely identify them. The key can only contain lower case alphabetical characters.\n * This is useful to avoid class name collisions.\n *\n * If `emotionCache` is passed, this is value is ignored.\n *\n * @default \"hv\"\n */\n classNameKey?: string;\n /**\n * The emotion cache instance to use. If no value is provided, the default cache is used.\n */\n emotionCache?: EmotionCache;\n /**\n * List of themes to be used by UI Kit.\n * You can provide your own themes created with the `createTheme` utility and/or the default themes `ds3` and `ds5` provided by UI Kit.\n *\n * If no value is provided, the `ds5` theme will be used.\n */\n themes?: (HvTheme | HvThemeStructure)[];\n /**\n * The active theme. It must be one of the themes passed to `themes`.\n *\n * If no value is provided, the first theme from the `themes` list is used. If no `themes` list is provided, the `ds5` theme will be used.\n */\n theme?: string;\n /**\n * The active color mode. It must be one of the color modes of the active theme.\n *\n * If no value is provided, the first color mode defined in the active theme is used.\n * For the default themes `ds3` and `ds5`, the `dawn` color mode is the one used.\n */\n colorMode?: string;\n}\n\nconst scopedRootPrefix = \"hv-uikit-scoped-root\" as const;\n\n/**\n * Enables theming capabilities and makes cross-component theme properties available down the tree.\n */\nexport const HvProvider = ({\n children,\n rootElementId,\n cssBaseline = \"global\",\n cssTheme = \"global\",\n themes,\n theme,\n colorMode,\n emotionCache: emotionCacheProp,\n classNameKey = defaultCacheKey,\n}: HvProviderProps) => {\n const scopedRootId = useUniqueId(undefined, scopedRootPrefix);\n\n // Themes\n const themesList: (HvTheme | HvThemeStructure)[] = processThemes(themes);\n\n // Emotion cache\n // Moves UI Kit styles to the top of the <head> so they're loaded first\n // This enables users to override the UI Kit styles if necessary\n const emotionCache = useMemo(() => {\n if (emotionCacheProp) return emotionCacheProp;\n // reuse the default shared cache if `classNameKey` is the same\n if (classNameKey === defaultCacheKey) return defaultEmotionCache;\n\n return createCache({ key: classNameKey, prepend: true });\n }, [classNameKey, emotionCacheProp]);\n\n return (\n <CacheProvider value={emotionCache}>\n <Global\n styles={cssReact`\n ${\n cssBaseline === \"global\" && {\n [`@layer hv-uikit-baseline`]: {\n ...CssBaseline,\n },\n }\n }\n ${getThemesVars(themesList)}\n `}\n />\n <HvThemeProvider\n themes={themesList}\n theme={theme || themesList[0].name}\n emotionCache={emotionCache}\n colorMode={colorMode || Object.keys(themesList[0].colors.modes)[0]}\n themeRootId={\n cssTheme === \"scoped\" ? rootElementId || scopedRootId : undefined\n }\n >\n <ClassNames>\n {({ css }) => {\n if (cssBaseline === \"scoped\") {\n const rootElement = getElementById(rootElementId);\n\n if (rootElement) {\n rootElement.classList.add(\n css({\n [`@layer ${rootElementId}-baseline`]: {\n ...CssScopedBaseline,\n },\n })\n );\n }\n }\n\n return (cssTheme === \"scoped\" || cssBaseline === \"scoped\") &&\n !rootElementId ? (\n <div\n id={scopedRootId}\n className={\n cssBaseline === \"scoped\"\n ? css({\n [`@layer ${rootElementId}-baseline`]: {\n ...CssScopedBaseline,\n },\n })\n : undefined\n }\n >\n {children}\n </div>\n ) : (\n children\n );\n }}\n </ClassNames>\n </HvThemeProvider>\n </CacheProvider>\n );\n};\n"],"names":["theme","defaultCacheKey","useUniqueId","processThemes","useMemo","defaultEmotionCache","createCache","jsxs","CacheProvider","jsx","Global","cssReact","CssBaseline","getThemesVars","HvThemeProvider","ClassNames","getElementById","CssScopedBaseline"],"mappings":";;;;;;;;;;;;;;AAwFA,MAAM,mBAAmB;AAKlB,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,WAAW;AAAA,EACX;AAAA,EAAA,OACAA;AAAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,eAAeC,iBAAA;AACjB,MAAuB;AACf,QAAA,eAAeC,YAAY,YAAA,QAAW,gBAAgB;AAGtD,QAAA,aAA6CC,oBAAc,MAAM;AAKjE,QAAA,eAAeC,MAAAA,QAAQ,MAAM;AAC7B,QAAA;AAAyB,aAAA;AAE7B,QAAI,iBAAiBH,iBAAA;AAAwB,aAAAI;AAE7C,WAAOC,qBAAAA,QAAY,EAAE,KAAK,cAAc,SAAS,MAAM;AAAA,EAAA,GACtD,CAAC,cAAc,gBAAgB,CAAC;AAGjC,SAAAC,2BAAA,KAACC,MAAc,eAAA,EAAA,OAAO,cACpB,UAAA;AAAA,IAAAC,2BAAA;AAAA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|
|
|
11
11
|
justifyContent: "center",
|
|
12
12
|
borderRadius: theme.radii.base,
|
|
13
13
|
"&:hover": {
|
|
14
|
-
backgroundColor: theme.colors.
|
|
14
|
+
backgroundColor: theme.colors.containerBackgroundHover
|
|
15
15
|
},
|
|
16
16
|
// Higher CSS specificity here
|
|
17
17
|
"& $switchBase": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSwitch.styles.js","sources":["../../../src/BaseSwitch/BaseSwitch.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\nimport { createClasses } from \"../utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBaseSwitch\", {\n root: {\n padding: 0,\n cursor: \"pointer\",\n width: \"40px\",\n height: \"32px\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: theme.radii.base,\n\n \"&:hover\": {\n backgroundColor: theme.colors.
|
|
1
|
+
{"version":3,"file":"BaseSwitch.styles.js","sources":["../../../src/BaseSwitch/BaseSwitch.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\nimport { createClasses } from \"../utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBaseSwitch\", {\n root: {\n padding: 0,\n cursor: \"pointer\",\n width: \"40px\",\n height: \"32px\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: theme.radii.base,\n\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n\n // Higher CSS specificity here\n \"& $switchBase\": {\n \"&:hover\": {\n backgroundColor: \"transparent\",\n },\n\n \"&$checked\": {\n transform: \"translateX(16px)\",\n \"& + $track\": {\n opacity: 1,\n backgroundColor: theme.colors.secondary,\n },\n \"&:hover\": {\n backgroundColor: \"transparent\",\n },\n },\n },\n\n // Higher CSS specificity here\n \"&$disabled\": {\n \"& $switchBase\": {\n \"& + $track\": {\n opacity: 1,\n backgroundColor: theme.colors.atmo3,\n border: `solid 1px ${theme.colors.secondary_60}`,\n },\n },\n },\n },\n switch: {\n width: \"40px\",\n height: \"32px\",\n padding: 0,\n\n \"&$readOnly $switchBase\": {\n cursor: \"default\",\n },\n },\n switchBase: {\n width: \"40px\",\n height: \"32px\",\n padding: 0,\n },\n track: {\n opacity: 1,\n borderRadius: \"15px\",\n height: \"16px\",\n width: \"32px\",\n border: `solid 1px ${theme.colors.secondary}`,\n backgroundColor: theme.colors.atmo1,\n },\n thumb: {\n position: \"relative\",\n left: \"-9px\",\n width: \"12px\",\n height: \"12px\",\n border: `solid 1px ${theme.colors.secondary}`,\n backgroundColor: theme.colors.atmo1,\n marginLeft: \"2px\",\n marginTop: 0,\n boxShadow: \"none\",\n },\n checked: {},\n disabled: {\n cursor: \"not-allowed\",\n\n \"& $switch\": {\n cursor: \"not-allowed\",\n },\n\n \"& $thumb\": {\n backgroundColor: theme.colors.atmo3,\n border: `solid 1px ${theme.colors.secondary_60}`,\n },\n },\n readOnly: {},\n focusVisible: {\n borderRadius: \"8px\",\n ...outlineStyles,\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,gBAAgB;AAAA,EACzE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,cAAc,MAAM,MAAM;AAAA,IAE1B,WAAW;AAAA,MACT,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA;AAAA,IAGA,iBAAiB;AAAA,MACf,WAAW;AAAA,QACT,iBAAiB;AAAA,MACnB;AAAA,MAEA,aAAa;AAAA,QACX,WAAW;AAAA,QACX,cAAc;AAAA,UACZ,SAAS;AAAA,UACT,iBAAiB,MAAM,OAAO;AAAA,QAChC;AAAA,QACA,WAAW;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF;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|
|
10
10
|
"&:hover": {
|
|
11
11
|
cursor: "pointer",
|
|
12
|
-
backgroundColor: theme.colors.
|
|
12
|
+
backgroundColor: theme.colors.containerBackgroundHover
|
|
13
13
|
},
|
|
14
14
|
"&:focus": {
|
|
15
|
-
backgroundColor: theme.colors.
|
|
15
|
+
backgroundColor: theme.colors.containerBackgroundHover
|
|
16
16
|
},
|
|
17
17
|
"&:focus-visible": {
|
|
18
18
|
...outlineStyles
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.styles.js","sources":["../../../../src/BreadCrumb/Page/Page.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../../utils/classes\";\nimport { outlineStyles } from \"../../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBreadCrumbPage\", {\n link: {\n padding: `8px ${theme.space.xs}`,\n borderRadius: theme.radii.base,\n maxWidth: 170 + 16,\n textTransform: \"capitalize\",\n \"&:hover\": {\n cursor: \"pointer\",\n backgroundColor: theme.colors.
|
|
1
|
+
{"version":3,"file":"Page.styles.js","sources":["../../../../src/BreadCrumb/Page/Page.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../../utils/classes\";\nimport { outlineStyles } from \"../../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBreadCrumbPage\", {\n link: {\n padding: `8px ${theme.space.xs}`,\n borderRadius: theme.radii.base,\n maxWidth: 170 + 16,\n textTransform: \"capitalize\",\n \"&:hover\": {\n cursor: \"pointer\",\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n \"&:focus\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n \"&:focus-visible\": {\n ...outlineStyles,\n },\n },\n label: {},\n a: {},\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,oBAAoB;AAAA,EAC7E,MAAM;AAAA,IACJ,SAAS,OAAO,MAAM,MAAM,EAAE;AAAA,IAC9B,cAAc,MAAM,MAAM;AAAA,IAC1B,UAAU,MAAM;AAAA,IAChB,eAAe;AAAA,IACf,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,IACA,WAAW;AAAA,MACT,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,IACA,mBAAmB;AAAA,MACjB,GAAG;AAAA,IACL;AAAA,EACF;AAAA,EACA,OAAO,CAAC;AAAA,EACR,GAAG,CAAC;AACN,CAAC;"}
|
|
@@ -10,7 +10,7 @@ const { staticClasses, useClasses } = createClasses("HvBulkActions", {
|
|
|
10
10
|
marginBottom: theme.space.xs
|
|
11
11
|
},
|
|
12
12
|
semantic: {
|
|
13
|
-
backgroundColor: theme.colors.
|
|
13
|
+
backgroundColor: theme.colors.containerBackgroundHover,
|
|
14
14
|
"& $selectAll div": {
|
|
15
15
|
color: "inherit",
|
|
16
16
|
"&:hover:not(:disabled)": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkActions.styles.js","sources":["../../../src/BulkActions/BulkActions.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBulkActions\", {\n root: {\n display: \"flex\",\n alignItems: \"center\",\n border: `1px solid ${theme.colors.atmo4}`,\n backgroundColor: theme.colors.atmo2,\n padding: theme.spacing(\"xs\", \"md\"),\n marginBottom: theme.space.xs,\n },\n semantic: {\n backgroundColor: theme.colors.
|
|
1
|
+
{"version":3,"file":"BulkActions.styles.js","sources":["../../../src/BulkActions/BulkActions.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBulkActions\", {\n root: {\n display: \"flex\",\n alignItems: \"center\",\n border: `1px solid ${theme.colors.atmo4}`,\n backgroundColor: theme.colors.atmo2,\n padding: theme.spacing(\"xs\", \"md\"),\n marginBottom: theme.space.xs,\n },\n semantic: {\n backgroundColor: theme.colors.containerBackgroundHover,\n \"& $selectAll div\": {\n color: \"inherit\",\n\n \"&:hover:not(:disabled)\": {\n backgroundColor: theme.alpha(\"base_light\", 0.3),\n },\n\n \"& *\": {\n color: \"inherit\",\n backgroundColor: \"transparent\",\n },\n },\n\n \"& $selectAll:focus-within div\": {\n backgroundColor: theme.alpha(\"base_light\", 0.3),\n },\n },\n actions: { display: \"inline-flex\", marginLeft: \"auto\" },\n selectAllContainer: { display: \"flex\", alignItems: \"center\" },\n selectAll: {},\n selectAllPages: {},\n divider: {\n display: \"flex\",\n backgroundColor: theme.colors.atmo4,\n width: \"1px\",\n height: \"32px\",\n marginLeft: theme.space.sm,\n },\n});\n"],"names":[],"mappings":";;AAIO,MAAM,EAAE,eAAe,eAAe,cAAc,iBAAiB;AAAA,EAC1E,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,QAAQ,aAAa,MAAM,OAAO,KAAK;AAAA,IACvC,iBAAiB,MAAM,OAAO;AAAA,IAC9B,SAAS,MAAM,QAAQ,MAAM,IAAI;AAAA,IACjC,cAAc,MAAM,MAAM;AAAA,EAC5B;AAAA,EACA,UAAU;AAAA,IACR,iBAAiB,MAAM,OAAO;AAAA,IAC9B,oBAAoB;AAAA,MAClB,OAAO;AAAA,MAEP,0BAA0B;AAAA,QACxB,iBAAiB,MAAM,MAAM,cAAc,GAAG;AAAA,MAChD;AAAA,MAEA,OAAO;AAAA,QACL,OAAO;AAAA,QACP,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,IAEA,iCAAiC;AAAA,MAC/B,iBAAiB,MAAM,MAAM,cAAc,GAAG;AAAA,IAChD;AAAA,EACF;AAAA,EACA,SAAS,EAAE,SAAS,eAAe,YAAY,OAAO;AAAA,EACtD,oBAAoB,EAAE,SAAS,QAAQ,YAAY,SAAS;AAAA,EAC5D,WAAW,CAAC;AAAA,EACZ,gBAAgB,CAAC;AAAA,EACjB,SAAS;AAAA,IACP,SAAS;AAAA,IACT,iBAAiB,MAAM,OAAO;AAAA,IAC9B,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAY,MAAM,MAAM;AAAA,EAC1B;AACF,CAAC;"}
|
|
@@ -127,7 +127,10 @@ const HvPagination = (props) => {
|
|
|
127
127
|
"aria-label": labels?.pageSizeSelectorDescription,
|
|
128
128
|
onChange: (_, val) => onPageSizeChange?.(val),
|
|
129
129
|
value: pageSize,
|
|
130
|
-
classes: {
|
|
130
|
+
classes: {
|
|
131
|
+
header: classes.pageSizeHeader,
|
|
132
|
+
root: classes.pageSizeRoot
|
|
133
|
+
},
|
|
131
134
|
children: pageSizeOptions.map((option) => /* @__PURE__ */ jsx(Option, { value: option, children: option }, option))
|
|
132
135
|
}
|
|
133
136
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sources":["../../../src/Pagination/Pagination.tsx"],"sourcesContent":["import { HTMLAttributes, useCallback, useEffect } from \"react\";\n\nimport Hidden from \"@mui/material/Hidden\";\n\nimport {\n Start,\n End,\n Backwards,\n Forwards,\n} from \"@hitachivantara/uikit-react-icons\";\n\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\n\nimport { HvInput, HvInputProps } from \"../Input\";\nimport { HvTypography } from \"../Typography\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { setId } from \"../utils/setId\";\nimport { isKey } from \"../utils/keyboardUtils\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { IconButton } from \"../utils/IconButton\";\nimport { useLabels } from \"../hooks/useLabels\";\n\nimport HvSelect, { Option } from \"./Select\";\nimport { staticClasses, useClasses } from \"./Pagination.styles\";\nimport { usePageInput, getSafePage, setColor } from \"./utils\";\n\nexport { staticClasses as paginationClasses };\n\nexport type HvPaginationClasses = ExtractNames<typeof useClasses>;\n\nconst defaultPageSizeOptions = [5, 10, 20, 25, 50, 100];\n\nconst DEFAULT_LABELS = {\n /** The show label. */\n pageSizePrev: \"Show\",\n /** Indicate the units of the page size selection. */\n pageSizeEntryName: \"rows\",\n /** Used for the aria-label of the selection of number of unit.s */\n pageSizeSelectorDescription: \"Select how many to display\",\n /** Separator of current page and total pages. */\n pagesSeparator: \"/\",\n /** Title of button `firstPage`. @deprecated Use `firstPage` instead. */\n paginationFirstPageTitle: \"First page\",\n /** Title of button `previousPage`. @deprecated Use `previousPage` instead. */\n paginationPreviousPageTitle: \"Previous page\",\n /** Title of button `nextPage`. @deprecated Use `nextPage` instead. */\n paginationNextPageTitle: \"Next page\",\n /** Title of button `lastPage`. @deprecated Use `lastPage` instead. */\n paginationLastPageTitle: \"Last page\",\n /** Aria-label passed to the page input. */\n paginationInputLabel: \"Current page\",\n /** Label of the first page button */\n firstPage: \"First Page\",\n /** Label of the previous page button */\n previousPage: \"Previous Page\",\n /** Label of the next page button */\n nextPage: \"Next Page\",\n /** Label of the last page button */\n lastPage: \"Last Page\",\n};\n\nexport type HvPaginationLabels = Partial<typeof DEFAULT_LABELS>;\n\nexport interface HvPaginationProps extends HvBaseProps {\n /** The number of pages the component has. */\n pages?: number;\n /** The currently selected page (0-indexed). */\n page?: number;\n /** Controls whether the left page size mechanism should be visible. */\n showPageSizeOptions?: boolean;\n /** The array of possible page sizes for the dropdown. */\n pageSizeOptions?: number[];\n /** The currently selected page size. */\n pageSize?: number;\n /** Controls whether the central page changing mechanism should be visible. */\n showPageJump?: boolean;\n /** Controls whether the previous/first page buttons are enabled. */\n canPrevious?: boolean;\n /** Controls whether the next/last page buttons are enabled. */\n canNext?: boolean;\n /** Function called when the page changes. */\n onPageChange?: (page: number) => void;\n /** Function called when the page size changes. */\n onPageSizeChange?: (pageSize: number) => void;\n /** An object containing all the labels for the component. */\n labels?: HvPaginationLabels;\n /** Other props to show page component. */\n showPageProps?: HTMLAttributes<HTMLDivElement>;\n /** Other props to pagination component. */\n navigationProps?: HTMLAttributes<HTMLDivElement>;\n /** Extra properties passed to the input component representing the current pages. */\n currentPageInputProps?: HvInputProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvPaginationClasses;\n}\n\n/**\n * Pagination is the process of dividing a document into discrete pages. It relates to how users interact\n * with structured content on a website or application.\n */\nexport const HvPagination = (props: HvPaginationProps) => {\n const {\n classes: classesProp,\n className,\n id,\n pages = 1,\n page = 0,\n showPageSizeOptions = true,\n pageSizeOptions = defaultPageSizeOptions,\n pageSize = defaultPageSizeOptions[1],\n showPageJump = true,\n canPrevious = false,\n canNext = false,\n onPageChange,\n onPageSizeChange,\n labels: labelsProp,\n showPageProps,\n navigationProps,\n currentPageInputProps,\n ...others\n } = useDefaultProps(\"HvPagination\", props);\n\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n const [pageInput, handleInputChange] = usePageInput(page);\n const { classes, cx } = useClasses(classesProp);\n\n const changePage = useCallback(\n (newPage: number) => {\n const safePage: number = getSafePage(newPage, page, pages);\n\n onPageChange?.(safePage);\n handleInputChange(null, safePage + 1);\n },\n [page, pages, onPageChange, handleInputChange]\n );\n\n useEffect(() => {\n if (page >= pages && pages > 0) {\n changePage(page);\n }\n }, [changePage, page, pages]);\n\n useEffect(() => {\n if (pageInput !== page + 1) {\n handleInputChange(null, page + 1);\n }\n\n // we only want to \"fix\" the input's display value when `page` property changed\n // (either externally or when internally committed - onBlur or Enter),\n // not while editing the input.\n // breaking a rule of hooks isn't ideal and it's just a hack for fixing\n // a bug preventing properly controlling of the `page` property.\n // fixing it some other way would potentially introduce a breaking change.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [handleInputChange, page]);\n\n const renderPageJump = () => (\n <div className={classes.pageJump}>\n <HvInput\n id={setId(id, \"currentPage\")}\n labels={labels}\n inputProps={{\n \"aria-label\": labels?.paginationInputLabel,\n // We really want the native number input\n type: \"number\",\n }}\n classes={{\n root: classes?.pageSizeInputContainer,\n input: classes?.pageSizeInput,\n inputRoot: classes?.pageSizeInputRoot,\n }}\n onChange={(event, value) => handleInputChange(event, Number(value))}\n value={String(pageInput)}\n onBlur={(evt, value) => changePage(Number(value) - 1)}\n onKeyDown={(evt, value) =>\n isKey(evt, \"Enter\") && changePage(Number(value) - 1)\n }\n disabled={pageSize === 0}\n disableClear\n {...currentPageInputProps}\n />\n </div>\n );\n\n return (\n <div id={id} className={cx(classes.root, className)} {...others}>\n <div className={classes.pageSizeOptions} {...showPageProps}>\n {showPageSizeOptions && (\n <>\n <Hidden xsDown>\n <HvTypography\n component=\"span\"\n className={classes?.pageSizeTextContainer}\n >\n {labels?.pageSizePrev}\n </HvTypography>\n </Hidden>\n <HvSelect\n id={setId(id, \"pageSize\")}\n disabled={pageSize === 0}\n className={classes.pageSizeOptionsSelect}\n aria-label={labels?.pageSizeSelectorDescription}\n onChange={(_: any, val: number) => onPageSizeChange?.(val)}\n value={pageSize}\n classes={{ header: classes.pageSizeHeader }}\n >\n {pageSizeOptions.map((option) => (\n <Option key={option} value={option}>\n {option}\n </Option>\n ))}\n </HvSelect>\n <Hidden xsDown>\n <HvTypography\n component=\"span\"\n className={classes.pageSizeTextContainer}\n >\n {labels?.pageSizeEntryName}\n </HvTypography>\n </Hidden>\n </>\n )}\n </div>\n <div className={classes.pageNavigator} {...navigationProps}>\n <IconButton\n id={setId(id, \"firstPage-button\")}\n className={classes.iconContainer}\n disabled={!canPrevious}\n onClick={() => changePage(0)}\n title={labels?.firstPage || labels?.paginationFirstPageTitle}\n >\n <Start\n role=\"none\"\n className={classes.icon}\n color={setColor(!canPrevious)}\n iconSize=\"XS\"\n />\n </IconButton>\n <IconButton\n id={setId(id, \"previousPage-button\")}\n className={classes.iconContainer}\n disabled={!canPrevious}\n onClick={() => changePage(page - 1)}\n title={labels?.previousPage || labels?.paginationPreviousPageTitle}\n >\n <Backwards\n role=\"none\"\n className={classes.icon}\n color={setColor(!canPrevious)}\n iconSize=\"XS\"\n />\n </IconButton>\n <div className={classes.pageInfo}>\n {showPageJump ? (\n renderPageJump()\n ) : (\n <HvTypography variant=\"caption2\" component=\"span\">{`${\n page + 1\n }`}</HvTypography>\n )}\n <HvTypography component=\"span\">{`${labels?.pagesSeparator} `}</HvTypography>\n <HvTypography\n component=\"span\"\n id={setId(id, \"totalPages\")}\n className={classes.totalPagesTextContainer}\n >\n {pages}\n </HvTypography>\n </div>\n <IconButton\n id={setId(id, \"nextPage-button\")}\n className={classes.iconContainer}\n disabled={!canNext}\n onClick={() => changePage(page + 1)}\n title={labels?.nextPage || labels?.paginationNextPageTitle}\n >\n <Forwards\n role=\"none\"\n className={classes.icon}\n color={setColor(!canNext)}\n iconSize=\"XS\"\n />\n </IconButton>\n <IconButton\n id={setId(id, \"lastPage-button\")}\n className={classes.iconContainer}\n disabled={!canNext}\n onClick={() => changePage(pages - 1)}\n title={labels?.lastPage || labels?.paginationLastPageTitle}\n >\n <End\n className={classes.icon}\n color={setColor(!canNext)}\n iconSize=\"XS\"\n />\n </IconButton>\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA8BA,MAAM,yBAAyB,CAAC,GAAG,IAAI,IAAI,IAAI,IAAI,GAAG;AAEtD,MAAM,iBAAiB;AAAA;AAAA,EAErB,cAAc;AAAA;AAAA,EAEd,mBAAmB;AAAA;AAAA,EAEnB,6BAA6B;AAAA;AAAA,EAE7B,gBAAgB;AAAA;AAAA,EAEhB,0BAA0B;AAAA;AAAA,EAE1B,6BAA6B;AAAA;AAAA,EAE7B,yBAAyB;AAAA;AAAA,EAEzB,yBAAyB;AAAA;AAAA,EAEzB,sBAAsB;AAAA;AAAA,EAEtB,WAAW;AAAA;AAAA,EAEX,cAAc;AAAA;AAAA,EAEd,UAAU;AAAA;AAAA,EAEV,UAAU;AACZ;AAyCa,MAAA,eAAe,CAAC,UAA6B;AAClD,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,sBAAsB;AAAA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;AAAA,MACA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAI,MAAM,IAAI,iBAAiB;AAAA,UAC/B,WAAW,QAAQ;AAAA,UACnB,UAAU,CAAC;AAAA,UACX,SAAS,MAAM,WAAW,OAAO,CAAC;AAAA,UAClC,OAAO,QAAQ,YAAY,QAAQ;AAAA,UAEnC,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAW,QAAQ;AAAA,cACnB,OAAO,SAAS,CAAC,OAAO;AAAA,cACxB,UAAS;AAAA,YAAA;AAAA,UACX;AAAA,QAAA;AAAA,MACF;AAAA,MACA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAI,MAAM,IAAI,iBAAiB;AAAA,UAC/B,WAAW,QAAQ;AAAA,UACnB,UAAU,CAAC;AAAA,UACX,SAAS,MAAM,WAAW,QAAQ,CAAC;AAAA,UACnC,OAAO,QAAQ,YAAY,QAAQ;AAAA,UAEnC,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,QAAQ;AAAA,cACnB,OAAO,SAAS,CAAC,OAAO;AAAA,cACxB,UAAS;AAAA,YAAA;AAAA,UACX;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../../src/Pagination/Pagination.tsx"],"sourcesContent":["import { HTMLAttributes, useCallback, useEffect } from \"react\";\n\nimport Hidden from \"@mui/material/Hidden\";\n\nimport {\n Start,\n End,\n Backwards,\n Forwards,\n} from \"@hitachivantara/uikit-react-icons\";\n\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\n\nimport { HvInput, HvInputProps } from \"../Input\";\nimport { HvTypography } from \"../Typography\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { setId } from \"../utils/setId\";\nimport { isKey } from \"../utils/keyboardUtils\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { IconButton } from \"../utils/IconButton\";\nimport { useLabels } from \"../hooks/useLabels\";\n\nimport HvSelect, { Option } from \"./Select\";\nimport { staticClasses, useClasses } from \"./Pagination.styles\";\nimport { usePageInput, getSafePage, setColor } from \"./utils\";\n\nexport { staticClasses as paginationClasses };\n\nexport type HvPaginationClasses = ExtractNames<typeof useClasses>;\n\nconst defaultPageSizeOptions = [5, 10, 20, 25, 50, 100];\n\nconst DEFAULT_LABELS = {\n /** The show label. */\n pageSizePrev: \"Show\",\n /** Indicate the units of the page size selection. */\n pageSizeEntryName: \"rows\",\n /** Used for the aria-label of the selection of number of unit.s */\n pageSizeSelectorDescription: \"Select how many to display\",\n /** Separator of current page and total pages. */\n pagesSeparator: \"/\",\n /** Title of button `firstPage`. @deprecated Use `firstPage` instead. */\n paginationFirstPageTitle: \"First page\",\n /** Title of button `previousPage`. @deprecated Use `previousPage` instead. */\n paginationPreviousPageTitle: \"Previous page\",\n /** Title of button `nextPage`. @deprecated Use `nextPage` instead. */\n paginationNextPageTitle: \"Next page\",\n /** Title of button `lastPage`. @deprecated Use `lastPage` instead. */\n paginationLastPageTitle: \"Last page\",\n /** Aria-label passed to the page input. */\n paginationInputLabel: \"Current page\",\n /** Label of the first page button */\n firstPage: \"First Page\",\n /** Label of the previous page button */\n previousPage: \"Previous Page\",\n /** Label of the next page button */\n nextPage: \"Next Page\",\n /** Label of the last page button */\n lastPage: \"Last Page\",\n};\n\nexport type HvPaginationLabels = Partial<typeof DEFAULT_LABELS>;\n\nexport interface HvPaginationProps extends HvBaseProps {\n /** The number of pages the component has. */\n pages?: number;\n /** The currently selected page (0-indexed). */\n page?: number;\n /** Controls whether the left page size mechanism should be visible. */\n showPageSizeOptions?: boolean;\n /** The array of possible page sizes for the dropdown. */\n pageSizeOptions?: number[];\n /** The currently selected page size. */\n pageSize?: number;\n /** Controls whether the central page changing mechanism should be visible. */\n showPageJump?: boolean;\n /** Controls whether the previous/first page buttons are enabled. */\n canPrevious?: boolean;\n /** Controls whether the next/last page buttons are enabled. */\n canNext?: boolean;\n /** Function called when the page changes. */\n onPageChange?: (page: number) => void;\n /** Function called when the page size changes. */\n onPageSizeChange?: (pageSize: number) => void;\n /** An object containing all the labels for the component. */\n labels?: HvPaginationLabels;\n /** Other props to show page component. */\n showPageProps?: HTMLAttributes<HTMLDivElement>;\n /** Other props to pagination component. */\n navigationProps?: HTMLAttributes<HTMLDivElement>;\n /** Extra properties passed to the input component representing the current pages. */\n currentPageInputProps?: HvInputProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvPaginationClasses;\n}\n\n/**\n * Pagination is the process of dividing a document into discrete pages. It relates to how users interact\n * with structured content on a website or application.\n */\nexport const HvPagination = (props: HvPaginationProps) => {\n const {\n classes: classesProp,\n className,\n id,\n pages = 1,\n page = 0,\n showPageSizeOptions = true,\n pageSizeOptions = defaultPageSizeOptions,\n pageSize = defaultPageSizeOptions[1],\n showPageJump = true,\n canPrevious = false,\n canNext = false,\n onPageChange,\n onPageSizeChange,\n labels: labelsProp,\n showPageProps,\n navigationProps,\n currentPageInputProps,\n ...others\n } = useDefaultProps(\"HvPagination\", props);\n\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n const [pageInput, handleInputChange] = usePageInput(page);\n const { classes, cx } = useClasses(classesProp);\n\n const changePage = useCallback(\n (newPage: number) => {\n const safePage: number = getSafePage(newPage, page, pages);\n\n onPageChange?.(safePage);\n handleInputChange(null, safePage + 1);\n },\n [page, pages, onPageChange, handleInputChange]\n );\n\n useEffect(() => {\n if (page >= pages && pages > 0) {\n changePage(page);\n }\n }, [changePage, page, pages]);\n\n useEffect(() => {\n if (pageInput !== page + 1) {\n handleInputChange(null, page + 1);\n }\n\n // we only want to \"fix\" the input's display value when `page` property changed\n // (either externally or when internally committed - onBlur or Enter),\n // not while editing the input.\n // breaking a rule of hooks isn't ideal and it's just a hack for fixing\n // a bug preventing properly controlling of the `page` property.\n // fixing it some other way would potentially introduce a breaking change.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [handleInputChange, page]);\n\n const renderPageJump = () => (\n <div className={classes.pageJump}>\n <HvInput\n id={setId(id, \"currentPage\")}\n labels={labels}\n inputProps={{\n \"aria-label\": labels?.paginationInputLabel,\n // We really want the native number input\n type: \"number\",\n }}\n classes={{\n root: classes?.pageSizeInputContainer,\n input: classes?.pageSizeInput,\n inputRoot: classes?.pageSizeInputRoot,\n }}\n onChange={(event, value) => handleInputChange(event, Number(value))}\n value={String(pageInput)}\n onBlur={(evt, value) => changePage(Number(value) - 1)}\n onKeyDown={(evt, value) =>\n isKey(evt, \"Enter\") && changePage(Number(value) - 1)\n }\n disabled={pageSize === 0}\n disableClear\n {...currentPageInputProps}\n />\n </div>\n );\n\n return (\n <div id={id} className={cx(classes.root, className)} {...others}>\n <div className={classes.pageSizeOptions} {...showPageProps}>\n {showPageSizeOptions && (\n <>\n <Hidden xsDown>\n <HvTypography\n component=\"span\"\n className={classes?.pageSizeTextContainer}\n >\n {labels?.pageSizePrev}\n </HvTypography>\n </Hidden>\n <HvSelect\n id={setId(id, \"pageSize\")}\n disabled={pageSize === 0}\n className={classes.pageSizeOptionsSelect}\n aria-label={labels?.pageSizeSelectorDescription}\n onChange={(_: any, val: number) => onPageSizeChange?.(val)}\n value={pageSize}\n classes={{\n header: classes.pageSizeHeader,\n root: classes.pageSizeRoot,\n }}\n >\n {pageSizeOptions.map((option) => (\n <Option key={option} value={option}>\n {option}\n </Option>\n ))}\n </HvSelect>\n <Hidden xsDown>\n <HvTypography\n component=\"span\"\n className={classes.pageSizeTextContainer}\n >\n {labels?.pageSizeEntryName}\n </HvTypography>\n </Hidden>\n </>\n )}\n </div>\n <div className={classes.pageNavigator} {...navigationProps}>\n <IconButton\n id={setId(id, \"firstPage-button\")}\n className={classes.iconContainer}\n disabled={!canPrevious}\n onClick={() => changePage(0)}\n title={labels?.firstPage || labels?.paginationFirstPageTitle}\n >\n <Start\n role=\"none\"\n className={classes.icon}\n color={setColor(!canPrevious)}\n iconSize=\"XS\"\n />\n </IconButton>\n <IconButton\n id={setId(id, \"previousPage-button\")}\n className={classes.iconContainer}\n disabled={!canPrevious}\n onClick={() => changePage(page - 1)}\n title={labels?.previousPage || labels?.paginationPreviousPageTitle}\n >\n <Backwards\n role=\"none\"\n className={classes.icon}\n color={setColor(!canPrevious)}\n iconSize=\"XS\"\n />\n </IconButton>\n <div className={classes.pageInfo}>\n {showPageJump ? (\n renderPageJump()\n ) : (\n <HvTypography variant=\"caption2\" component=\"span\">{`${\n page + 1\n }`}</HvTypography>\n )}\n <HvTypography component=\"span\">{`${labels?.pagesSeparator} `}</HvTypography>\n <HvTypography\n component=\"span\"\n id={setId(id, \"totalPages\")}\n className={classes.totalPagesTextContainer}\n >\n {pages}\n </HvTypography>\n </div>\n <IconButton\n id={setId(id, \"nextPage-button\")}\n className={classes.iconContainer}\n disabled={!canNext}\n onClick={() => changePage(page + 1)}\n title={labels?.nextPage || labels?.paginationNextPageTitle}\n >\n <Forwards\n role=\"none\"\n className={classes.icon}\n color={setColor(!canNext)}\n iconSize=\"XS\"\n />\n </IconButton>\n <IconButton\n id={setId(id, \"lastPage-button\")}\n className={classes.iconContainer}\n disabled={!canNext}\n onClick={() => changePage(pages - 1)}\n title={labels?.lastPage || labels?.paginationLastPageTitle}\n >\n <End\n className={classes.icon}\n color={setColor(!canNext)}\n iconSize=\"XS\"\n />\n </IconButton>\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA8BA,MAAM,yBAAyB,CAAC,GAAG,IAAI,IAAI,IAAI,IAAI,GAAG;AAEtD,MAAM,iBAAiB;AAAA;AAAA,EAErB,cAAc;AAAA;AAAA,EAEd,mBAAmB;AAAA;AAAA,EAEnB,6BAA6B;AAAA;AAAA,EAE7B,gBAAgB;AAAA;AAAA,EAEhB,0BAA0B;AAAA;AAAA,EAE1B,6BAA6B;AAAA;AAAA,EAE7B,yBAAyB;AAAA;AAAA,EAEzB,yBAAyB;AAAA;AAAA,EAEzB,sBAAsB;AAAA;AA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auto"
|
|
55
|
+
},
|
|
53
56
|
/** Styles applied to the element that holds the labels for the page size selector */
|
|
54
57
|
pageSizeTextContainer: {
|
|
55
58
|
display: "flex",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.styles.js","sources":["../../../src/Pagination/Pagination.styles.tsx"],"sourcesContent":["import { CSSProperties } from \"react\";\n\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { inputClasses } from \"../Input\";\nimport { createClasses } from \"../utils/classes\";\nimport { baseDropdownClasses } from \"../BaseDropdown\";\n\nconst hoverColor = theme.colors.atmo3;\n\nexport const { staticClasses, useClasses } = createClasses(\"HvPagination\", {\n /** Styles applied to the component root class. */\n root: {\n position: \"relative\",\n zIndex: 1,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"stretch\",\n flexWrap: \"wrap\",\n marginTop: theme.space.sm,\n [`& $pageSizeInput`]: {\n ...(theme.typography.caption2 as CSSProperties),\n \"&:focus\": {\n padding: 0,\n },\n },\n [`& $pageSizeInputContainer`]: {\n width: 24,\n minWidth: 24,\n maxWidth: theme.spacing(8),\n },\n [`&& $pageSizeInputRoot`]: {\n backgroundColor: \"transparent\",\n height: \"24px\",\n \"&:focus, &:focus-within, &:hover\": {\n backgroundColor: hoverColor,\n },\n },\n },\n /** Styles applied to the page size selector container. */\n pageSizeOptions: {\n display: \"flex\",\n position: \"absolute\",\n height: 24,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n left: \"0\",\n },\n pageSizeHeader: {\n height: 24,\n display: \"flex\",\n alignItems: \"center\",\n [`& .${baseDropdownClasses.arrowContainer}`]: {\n marginTop: -2,\n },\n },\n /** Styles applied to the element that holds the labels for the page size selector */\n pageSizeTextContainer: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: \"24px\",\n padding: \"8px 0\",\n ...(theme.typography.caption2 as CSSProperties),\n },\n totalPagesTextContainer: {\n ...(theme.typography.caption2 as CSSProperties),\n },\n /** Styles applied to the page size selector dropdown element. */\n pageSizeOptionsSelect: {\n display: \"inline-block\",\n margin: `0px ${theme.space.xs}`,\n width: \"auto\",\n\n ...(theme.typography.caption2 as CSSProperties),\n },\n /** Styles applied to the page navigation container. */\n pageNavigator: {\n display: \"flex\",\n alignItems: \"center\",\n height: \"32px\",\n gap: 8,\n },\n /** Styles applied to each navigation `HvButton` icon container. */\n iconContainer: {\n padding: 0,\n },\n /** Styles applied to each navigation icon. */\n icon: {},\n /** Styles applied to the central page information container. */\n pageInfo: {\n display: \"inline-block\",\n whiteSpace: \"nowrap\",\n height: \"32px\",\n lineHeight: \"32px\",\n },\n /** Styles applied to the page selector input container. */\n pageJump: {\n display: \"inline-block\",\n marginRight: `4px`,\n [`& .${inputClasses.inputRoot}`]: {\n [`& $pageSizeInput`]: {\n paddingLeft: `4px`,\n paddingRight: `4px`,\n margin: 0,\n textAlign: \"center\",\n borderRadius: theme.radii.base,\n MozAppearance: \"textfield\",\n \"&:focus\": {\n backgroundColor: hoverColor,\n },\n \"&:hover\": {\n cursor: \"pointer\",\n },\n },\n },\n },\n /** Styles passed down to the page selector Input component as `input`. */\n pageSizeInput: {},\n /** Styles passed down to the page selector Input root. */\n pageSizeInputRoot: {},\n /** Styles passed down to the page selector Input component as `container`. */\n pageSizeInputContainer: {},\n});\n"],"names":["baseDropdownClasses","inputClasses"],"mappings":";;;;;AAQA,MAAM,aAAa,MAAM,OAAO;AAEzB,MAAM,EAAE,eAAe,eAAe,cAAc,gBAAgB;AAAA;AAAA,EAEzE,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,WAAW,MAAM,MAAM;AAAA,IACvB,CAAC,kBAAkB,GAAG;AAAA,MACpB,GAAI,MAAM,WAAW;AAAA,MACrB,WAAW;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,CAAC,2BAA2B,GA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AAS;AAAA,IACT,aAAa;AAAA,IACb,CAAC,MAAMC,gBAAa,SAAS,EAAE,GAAG;AAAA,MAChC,CAAC,kBAAkB,GAAG;AAAA,QACpB,aAAa;AAAA,QACb,cAAc;AAAA,QACd,QAAQ;AAAA,QACR,WAAW;AAAA,QACX,cAAc,MAAM,MAAM;AAAA,QAC1B,eAAe;AAAA,QACf,WAAW;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,QACA,WAAW;AAAA,UACT,QAAQ;AAAA,QACV;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAEA,eAAe,CAAC;AAAA;AAAA,EAEhB,mBAAmB,CAAC;AAAA;AAAA,EAEpB,wBAAwB,CAAC;AAC3B,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Pagination.styles.js","sources":["../../../src/Pagination/Pagination.styles.tsx"],"sourcesContent":["import { CSSProperties } from \"react\";\n\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { inputClasses } from \"../Input\";\nimport { createClasses } from \"../utils/classes\";\nimport { baseDropdownClasses } from \"../BaseDropdown\";\n\nconst hoverColor = theme.colors.atmo3;\n\nexport const { staticClasses, useClasses } = createClasses(\"HvPagination\", {\n /** Styles applied to the component root class. */\n root: {\n position: \"relative\",\n zIndex: 1,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"stretch\",\n flexWrap: \"wrap\",\n marginTop: theme.space.sm,\n [`& $pageSizeInput`]: {\n ...(theme.typography.caption2 as CSSProperties),\n \"&:focus\": {\n padding: 0,\n },\n },\n [`& $pageSizeInputContainer`]: {\n width: 24,\n minWidth: 24,\n maxWidth: theme.spacing(8),\n },\n [`&& $pageSizeInputRoot`]: {\n backgroundColor: \"transparent\",\n height: \"24px\",\n \"&:focus, &:focus-within, &:hover\": {\n backgroundColor: hoverColor,\n },\n },\n },\n /** Styles applied to the page size selector container. */\n pageSizeOptions: {\n display: \"flex\",\n position: \"absolute\",\n height: 24,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n left: \"0\",\n },\n pageSizeHeader: {\n height: 24,\n display: \"flex\",\n alignItems: \"center\",\n [`& .${baseDropdownClasses.arrowContainer}`]: {\n marginTop: -2,\n },\n },\n pageSizeRoot: {\n width: \"auto\",\n },\n /** Styles applied to the element that holds the labels for the page size selector */\n pageSizeTextContainer: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: \"24px\",\n padding: \"8px 0\",\n ...(theme.typography.caption2 as CSSProperties),\n },\n totalPagesTextContainer: {\n ...(theme.typography.caption2 as CSSProperties),\n },\n /** Styles applied to the page size selector dropdown element. */\n pageSizeOptionsSelect: {\n display: \"inline-block\",\n margin: `0px ${theme.space.xs}`,\n width: \"auto\",\n\n ...(theme.typography.caption2 as CSSProperties),\n },\n /** Styles applied to the page navigation container. */\n pageNavigator: {\n display: \"flex\",\n alignItems: \"center\",\n height: \"32px\",\n gap: 8,\n },\n /** Styles applied to each navigation `HvButton` icon container. */\n iconContainer: {\n padding: 0,\n },\n /** Styles applied to each navigation icon. */\n icon: {},\n /** Styles applied to the central page information container. */\n pageInfo: {\n display: \"inline-block\",\n whiteSpace: \"nowrap\",\n height: \"32px\",\n lineHeight: \"32px\",\n },\n /** Styles applied to the page selector input container. */\n pageJump: {\n display: \"inline-block\",\n marginRight: `4px`,\n [`& .${inputClasses.inputRoot}`]: {\n [`& $pageSizeInput`]: {\n paddingLeft: `4px`,\n paddingRight: `4px`,\n margin: 0,\n textAlign: \"center\",\n borderRadius: theme.radii.base,\n MozAppearance: \"textfield\",\n \"&:focus\": {\n backgroundColor: hoverColor,\n },\n \"&:hover\": {\n cursor: \"pointer\",\n },\n },\n },\n },\n /** Styles passed down to the page selector Input component as `input`. */\n pageSizeInput: {},\n /** Styles passed down to the page selector Input root. */\n pageSizeInputRoot: {},\n /** Styles passed down to the page selector Input component as `container`. */\n pageSizeInputContainer: {},\n});\n"],"names":["baseDropdownClasses","inputClasses"],"mappings":";;;;;AAQA,MAAM,aAAa,MAAM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,MAAM,MAAM,EAAE;AAAA,IAC7B,OAAO;AAAA,IAEP,GAAI,MAAM,WAAW;AAAA,EACvB;AAAA;AAAA,EAEA,eAAe;AAAA,IACb,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,KAAK;AAAA,EACP;AAAA;AAAA,EAEA,eAAe;AAAA,IACb,SAAS;AAAA,EACX;AAAA;AAAA,EAEA,MAAM,CAAC;AAAA;AAAA,EAEP,UAAU;AAAA,IACR,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,YAAY;AAAA,EACd;AAAA;AAAA,EAEA,UAAU;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,IACb,CAAC,MAAMC,gBAAa,SAAS,EAAE,GAAG;AAAA,MAChC,CAAC,kBAAkB,GAAG;AAAA,QACpB,aAAa;AAAA,QACb,cAAc;AAAA,QACd,QAAQ;AAAA,QACR,WAAW;AAAA,QACX,cAAc,MAAM,MAAM;AAAA,QAC1B,eAAe;AAAA,QACf,WAAW;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,QACA,WAAW;AAAA,UACT,QAAQ;AAAA,QACV;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAEA,eAAe,CAAC;AAAA;AAAA,EAEhB,mBAAmB,CAAC;AAAA;AAAA,EAEpB,wBAAwB,CAAC;AAC3B,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../src/Pagination/Select.tsx"],"sourcesContent":["import { SyntheticEvent, useState } from \"react\";\n\nimport { HvBaseDropdown, HvBaseDropdownProps } from \"../BaseDropdown\";\nimport { HvSelectionList, HvSelectionListProps } from \"../SelectionList\";\nimport { HvPanel } from \"../Panel\";\nimport { HvListItem, HvListItemProps } from \"../ListContainer\";\n\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\n\nimport { useClasses } from \"./Select.styles\";\n\nexport const Option = ({ ...props }: Partial<HvListItemProps>) => (\n <HvListItem {...props} />\n);\n\nexport interface HvPaginationSelectProps\n extends Omit<HvBaseDropdownProps, \"onChange\"> {\n onChange: (event: React.SyntheticEvent, val: number) => void;\n value: number;\n}\n\nconst HvSelect = (props: HvPaginationSelectProps) => {\n const {\n className,\n classes: classesProp,\n onChange,\n disabled,\n value,\n children,\n ...others\n } = useDefaultProps(\"HvPaginationSelect\", props);\n const { classes } = useClasses(classesProp);\n const [open, setOpen] = useState(false);\n\n const handleSelect: HvSelectionListProps[\"onChange\"] = (evt, val) => {\n onChange?.(evt, val);\n setOpen(false);\n };\n\n const handleToggle: HvBaseDropdownProps[\"onToggle\"] = (_evt, s) => {\n setOpen(s);\n };\n\n const setFocusToContent: HvBaseDropdownProps[\"onContainerCreation\"] = (\n containerRef\n ) => {\n const listItems =\n containerRef != null ? [...containerRef.getElementsByTagName(\"li\")] : [];\n listItems.every((listItem) => {\n if (listItem.tabIndex >= 0) {\n listItem.focus();\n return false;\n }\n return true;\n });\n };\n\n return (\n <HvBaseDropdown\n className={className}\n classes={{\n selection: classes.selection,\n header: classes.header,\n headerOpen: classes.headerOpen,\n }}\n expanded={open}\n onToggle={handleToggle}\n onContainerCreation={setFocusToContent}\n placeholder={value}\n disabled={disabled}\n variableWidth\n {...others}\n >\n <HvPanel>\n <HvSelectionList value={value} onChange={handleSelect}>\n {children}\n </HvSelectionList>\n </HvPanel>\n </HvBaseDropdown>\n );\n};\n\nexport default HvSelect;\n"],"names":[],"mappings":";;;;;;;;AAWa,MAAA,SAAS,CAAC,EAAE,GAAG,MAC1B,MAAA,oBAAC,YAAY,EAAA,GAAG,OAAO;AASzB,MAAM,WAAW,CAAC,UAAmC;AAC7C,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,sBAAsB,KAAK;AAC/C,QAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AAC1C,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AAEhC,QAAA,eAAiD,CAAC,KAAK,QAAQ;AACnE,eAAW,KAAK,GAAG;AACnB,YAAQ,KAAK;AAAA,EAAA;AAGT,QAAA,eAAgD,CAAC,MAAM,MAAM;AACjE,YAAQ,CAAC;AAAA,EAAA;AAGL,QAAA,oBAAgE,CACpE,iBACG;AACG,UAAA,YACJ,gBAAgB,OAAO,CAAC,GAAG,aAAa,qBAAqB,IAAI,CAAC,IAAI;AAC9D,cAAA,MAAM,CAAC,aAAa;AACxB,UAAA,SAAS,YAAY,GAAG;AAC1B,iBAAS,MAAM;AACR,eAAA;AAAA,MACT;AACO,aAAA;AAAA,IAAA,CACR;AAAA,EAAA;AAID,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAS;AAAA,QACP,WAAW,QAAQ;AAAA,QACnB,QAAQ,QAAQ;AAAA,QAChB,YAAY,QAAQ;AAAA,
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../src/Pagination/Select.tsx"],"sourcesContent":["import { SyntheticEvent, useState } from \"react\";\n\nimport { HvBaseDropdown, HvBaseDropdownProps } from \"../BaseDropdown\";\nimport { HvSelectionList, HvSelectionListProps } from \"../SelectionList\";\nimport { HvPanel } from \"../Panel\";\nimport { HvListItem, HvListItemProps } from \"../ListContainer\";\n\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\n\nimport { useClasses } from \"./Select.styles\";\n\nexport const Option = ({ ...props }: Partial<HvListItemProps>) => (\n <HvListItem {...props} />\n);\n\nexport interface HvPaginationSelectProps\n extends Omit<HvBaseDropdownProps, \"onChange\"> {\n onChange: (event: React.SyntheticEvent, val: number) => void;\n value: number;\n}\n\nconst HvSelect = (props: HvPaginationSelectProps) => {\n const {\n className,\n classes: classesProp,\n onChange,\n disabled,\n value,\n children,\n ...others\n } = useDefaultProps(\"HvPaginationSelect\", props);\n const { classes } = useClasses(classesProp);\n const [open, setOpen] = useState(false);\n\n const handleSelect: HvSelectionListProps[\"onChange\"] = (evt, val) => {\n onChange?.(evt, val);\n setOpen(false);\n };\n\n const handleToggle: HvBaseDropdownProps[\"onToggle\"] = (_evt, s) => {\n setOpen(s);\n };\n\n const setFocusToContent: HvBaseDropdownProps[\"onContainerCreation\"] = (\n containerRef\n ) => {\n const listItems =\n containerRef != null ? [...containerRef.getElementsByTagName(\"li\")] : [];\n listItems.every((listItem) => {\n if (listItem.tabIndex >= 0) {\n listItem.focus();\n return false;\n }\n return true;\n });\n };\n\n return (\n <HvBaseDropdown\n className={className}\n classes={{\n selection: classes.selection,\n header: classes.header,\n headerOpen: classes.headerOpen,\n root: classes.root,\n }}\n expanded={open}\n onToggle={handleToggle}\n onContainerCreation={setFocusToContent}\n placeholder={value}\n disabled={disabled}\n variableWidth\n {...others}\n >\n <HvPanel>\n <HvSelectionList value={value} onChange={handleSelect}>\n {children}\n </HvSelectionList>\n </HvPanel>\n </HvBaseDropdown>\n );\n};\n\nexport default HvSelect;\n"],"names":[],"mappings":";;;;;;;;AAWa,MAAA,SAAS,CAAC,EAAE,GAAG,MAC1B,MAAA,oBAAC,YAAY,EAAA,GAAG,OAAO;AASzB,MAAM,WAAW,CAAC,UAAmC;AAC7C,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,sBAAsB,KAAK;AAC/C,QAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AAC1C,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AAEhC,QAAA,eAAiD,CAAC,KAAK,QAAQ;AACnE,eAAW,KAAK,GAAG;AACnB,YAAQ,KAAK;AAAA,EAAA;AAGT,QAAA,eAAgD,CAAC,MAAM,MAAM;AACjE,YAAQ,CAAC;AAAA,EAAA;AAGL,QAAA,oBAAgE,CACpE,iBACG;AACG,UAAA,YACJ,gBAAgB,OAAO,CAAC,GAAG,aAAa,qBAAqB,IAAI,CAAC,IAAI;AAC9D,cAAA,MAAM,CAAC,aAAa;AACxB,UAAA,SAAS,YAAY,GAAG;AAC1B,iBAAS,MAAM;AACR,eAAA;AAAA,MACT;AACO,aAAA;AAAA,IAAA,CACR;AAAA,EAAA;AAID,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAS;AAAA,QACP,WAAW,QAAQ;AAAA,QACnB,QAAQ,QAAQ;AAAA,QAChB,YAAY,QAAQ;AAAA,QACpB,MAAM,QAAQ;AAAA,MAChB;AAAA,MACA,UAAU;AAAA,MACV,UAAU;AAAA,MACV,qBAAqB;AAAA,MACrB,aAAa;AAAA,MACb;AAAA,MACA,eAAa;AAAA,MACZ,GAAG;AAAA,MAEJ,UAAA,oBAAC,WACC,UAAC,oBAAA,iBAAA,EAAgB,OAAc,UAAU,cACtC,UACH,EACF,CAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAA,aAAe;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { theme } from "@hitachivantara/uikit-styles";
|
|
2
2
|
import { createClasses } from "../utils/classes.js";
|
|
3
3
|
const { useClasses } = createClasses("HvPaginationSelect", {
|
|
4
|
+
root: {},
|
|
4
5
|
header: {
|
|
5
6
|
backgroundColor: "transparent",
|
|
6
7
|
borderColor: theme.colors.secondary_80,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.styles.js","sources":["../../../src/Pagination/Select.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { useClasses } = createClasses(\"HvPaginationSelect\", {\n header: {\n backgroundColor: \"transparent\",\n borderColor: theme.colors.secondary_80,\n \"&:hover\": {\n borderColor: theme.colors.secondary_80,\n },\n },\n selection: {\n padding: theme.spacing(0, \"md\", 0, \"xs\"),\n },\n headerOpen: {\n backgroundColor: theme.colors.atmo1,\n },\n});\n"],"names":[],"mappings":";;AAIO,MAAM,EAAE,WAAA,IAAe,cAAc,sBAAsB;AAAA,EAChE,QAAQ;AAAA,IACN,iBAAiB;AAAA,IACjB,aAAa,MAAM,OAAO;AAAA,IAC1B,WAAW;AAAA,MACT,aAAa,MAAM,OAAO;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,WAAW;AAAA,IACT,SAAS,MAAM,QAAQ,GAAG,MAAM,GAAG,IAAI;AAAA,EACzC;AAAA,EACA,YAAY;AAAA,IACV,iBAAiB,MAAM,OAAO;AAAA,EAChC;AACF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Select.styles.js","sources":["../../../src/Pagination/Select.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { useClasses } = createClasses(\"HvPaginationSelect\", {\n root: {},\n header: {\n backgroundColor: \"transparent\",\n borderColor: theme.colors.secondary_80,\n \"&:hover\": {\n borderColor: theme.colors.secondary_80,\n },\n },\n selection: {\n padding: theme.spacing(0, \"md\", 0, \"xs\"),\n },\n headerOpen: {\n backgroundColor: theme.colors.atmo1,\n },\n});\n"],"names":[],"mappings":";;AAIO,MAAM,EAAE,WAAA,IAAe,cAAc,sBAAsB;AAAA,EAChE,MAAM,CAAC;AAAA,EACP,QAAQ;AAAA,IACN,iBAAiB;AAAA,IACjB,aAAa,MAAM,OAAO;AAAA,IAC1B,WAAW;AAAA,MACT,aAAa,MAAM,OAAO;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,WAAW;AAAA,IACT,SAAS,MAAM,QAAQ,GAAG,MAAM,GAAG,IAAI;AAAA,EACzC;AAAA,EACA,YAAY;AAAA,IACV,iBAAiB,MAAM,OAAO;AAAA,EAChC;AACF,CAAC;"}
|
|
@@ -53,7 +53,7 @@ const { staticClasses, useClasses } = createClasses("HvTableSection", {
|
|
|
53
53
|
// Remove border for the last table row
|
|
54
54
|
[`& .${staticClasses$3.root}`]: {
|
|
55
55
|
"&:last-child": {
|
|
56
|
-
[`& .${staticClasses$4.root}`]: {
|
|
56
|
+
[`& .${staticClasses$4.root}`]: { borderBottom: "none" }
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
[`& .${staticClasses$4.root}`]: {
|
|
@@ -79,6 +79,12 @@ const { staticClasses, useClasses } = createClasses("HvTableSection", {
|
|
|
79
79
|
},
|
|
80
80
|
[`& .${staticClasses$6.pageSizeOptions}`]: {
|
|
81
81
|
left: theme.space.sm
|
|
82
|
+
},
|
|
83
|
+
[`& .${staticClasses$6.pageSizeHeader}`]: {
|
|
84
|
+
border: "none",
|
|
85
|
+
"&:hover": {
|
|
86
|
+
border: "none"
|
|
87
|
+
}
|
|
82
88
|
}
|
|
83
89
|
},
|
|
84
90
|
hidden: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableSection.styles.js","sources":["../../../src/TableSection/TableSection.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { bulkActionsClasses } from \"../BulkActions\";\nimport { paginationClasses } from \"../Pagination\";\nimport { tableCellClasses } from \"../Table/TableCell\";\nimport { tableContainerClasses } from \"../Table/TableContainer\";\nimport { tableHeaderClasses } from \"../Table/TableHeader\";\nimport { createClasses } from \"../utils/classes\";\nimport { tableRowClasses } from \"../Table/TableRow\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableSection\", {\n root: {},\n header: {\n // Only apply the border to divide the header and content when both are displayed\n \"+ div\": { borderTop: `1px solid ${theme.colors.atmo3}` },\n },\n actions: {\n right: theme.space.sm,\n },\n content: {\n marginTop: 0,\n padding: 0,\n\n // Apply border radius to the first child if there's not an header\n \"&:first-of-type\": {\n \"& > :first-of-type\": {\n borderTopLeftRadius: theme.radii.round,\n borderTopRightRadius: theme.radii.round,\n },\n },\n\n \"& > :last-child\": {\n borderBottomLeftRadius: theme.radii.round,\n borderBottomRightRadius: theme.radii.round,\n },\n\n [`& .${tableContainerClasses.root}`]: {\n paddingBottom: 0,\n },\n\n [`& .${tableHeaderClasses.head}`]: {\n backgroundColor: theme.colors.atmo2,\n borderBottomColor: theme.colors.atmo3,\n [`&.${tableHeaderClasses.variantCheckbox}`]: {\n borderRight: \"none\",\n },\n [`&.${tableHeaderClasses.variantActions}`]: {\n borderLeft: \"none\",\n },\n },\n\n // Remove border for the last table row\n [`& .${tableRowClasses.root}`]: {\n \"&:last-child\": {\n [`& .${tableCellClasses.root}`]: {
|
|
1
|
+
{"version":3,"file":"TableSection.styles.js","sources":["../../../src/TableSection/TableSection.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { bulkActionsClasses } from \"../BulkActions\";\nimport { paginationClasses } from \"../Pagination\";\nimport { tableCellClasses } from \"../Table/TableCell\";\nimport { tableContainerClasses } from \"../Table/TableContainer\";\nimport { tableHeaderClasses } from \"../Table/TableHeader\";\nimport { createClasses } from \"../utils/classes\";\nimport { tableRowClasses } from \"../Table/TableRow\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableSection\", {\n root: {},\n header: {\n // Only apply the border to divide the header and content when both are displayed\n \"+ div\": { borderTop: `1px solid ${theme.colors.atmo3}` },\n },\n actions: {\n right: theme.space.sm,\n },\n content: {\n marginTop: 0,\n padding: 0,\n\n // Apply border radius to the first child if there's not an header\n \"&:first-of-type\": {\n \"& > :first-of-type\": {\n borderTopLeftRadius: theme.radii.round,\n borderTopRightRadius: theme.radii.round,\n },\n },\n\n \"& > :last-child\": {\n borderBottomLeftRadius: theme.radii.round,\n borderBottomRightRadius: theme.radii.round,\n },\n\n [`& .${tableContainerClasses.root}`]: {\n paddingBottom: 0,\n },\n\n [`& .${tableHeaderClasses.head}`]: {\n backgroundColor: theme.colors.atmo2,\n borderBottomColor: theme.colors.atmo3,\n [`&.${tableHeaderClasses.variantCheckbox}`]: {\n borderRight: \"none\",\n },\n [`&.${tableHeaderClasses.variantActions}`]: {\n borderLeft: \"none\",\n },\n },\n\n // Remove border for the last table row\n [`& .${tableRowClasses.root}`]: {\n \"&:last-child\": {\n [`& .${tableCellClasses.root}`]: { borderBottom: \"none\" },\n },\n },\n\n [`& .${tableCellClasses.root}`]: {\n borderBottomColor: theme.colors.atmo3,\n },\n\n [`& .${tableCellClasses.variantCheckbox}`]: {\n borderRight: \"none\",\n },\n\n [`& .${tableCellClasses.variantActions}`]: {\n borderLeft: \"none\",\n },\n\n [`& .${bulkActionsClasses.root}`]: {\n marginBottom: 0,\n border: \"none\",\n borderBottom: `1px solid ${theme.colors.atmo3}`,\n padding: theme.spacing(\"xs\", \"sm\"),\n },\n\n [`& .${paginationClasses.root}`]: {\n margin: 0,\n backgroundColor: theme.colors.atmo2,\n padding: theme.space.xs,\n borderTop: `1px solid ${theme.colors.atmo3}`,\n },\n\n [`& .${paginationClasses.pageSizeOptions}`]: {\n left: theme.space.sm,\n },\n [`& .${paginationClasses.pageSizeHeader}`]: {\n border: \"none\",\n \"&:hover\": {\n border: \"none\",\n },\n },\n },\n hidden: {},\n raisedHeader: {\n \"+ div\": {\n paddingTop: 0,\n },\n },\n spaceTop: { paddingTop: 0 },\n});\n"],"names":["tableContainerClasses","tableHeaderClasses","tableRowClasses","tableCellClasses","bulkActionsClasses","paginationClasses"],"mappings":";;;;;;;;;;;;;;;;AAUO,MAAM,EAAE,eAAe,eAAe,cAAc,kBAAkB;AAAA,EAC3E,MAAM,CAAC;AAAA,EACP,QAAQ;AAAA;AAAA,IAEN,SAAS,EAAE,WAAW,aAAa,MAAM,OAAO,KAAK,GAAG;AAAA,EAC1D;AAAA,EACA,SAAS;AAAA,IACP,OAAO,MAAM,MAAM;AAAA,EACrB;AAAA,EACA,SAAS;AAAA,IACP,WAAW;AAAA,IACX,SAAS;AAAA;AAAA,IAGT,mBAAmB;AAAA,MACjB,sBAAsB;AAAA,QACpB,qBAAqB,MAAM,MAAM;AAAA,QACjC,sBAAsB,MAAM,MAAM;AAAA,MACpC;AAAA,IACF;AAAA,IAEA,mBAAmB;AAAA,MAC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K;AAAA,IAC5C;AAAA,IAEA,CAAC,MAAMA,gBAAkB,eAAe,EAAE,GAAG;AAAA,MAC3C,MAAM,MAAM,MAAM;AAAA,IACpB;AAAA,IACA,CAAC,MAAMA,gBAAkB,cAAc,EAAE,GAAG;AAAA,MAC1C,QAAQ;AAAA,MACR,WAAW;AAAA,QACT,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF;AAAA,EACA,QAAQ,CAAC;AAAA,EACT,cAAc;AAAA,IACZ,SAAS;AAAA,MACP,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EACA,UAAU,EAAE,YAAY,EAAE;AAC5B,CAAC;"}
|
|
@@ -17,14 +17,18 @@ const HvProvider = ({
|
|
|
17
17
|
themes,
|
|
18
18
|
theme,
|
|
19
19
|
colorMode,
|
|
20
|
+
emotionCache: emotionCacheProp,
|
|
20
21
|
classNameKey = defaultCacheKey
|
|
21
22
|
}) => {
|
|
22
23
|
const scopedRootId = useUniqueId(void 0, scopedRootPrefix);
|
|
23
24
|
const themesList = processThemes(themes);
|
|
24
|
-
const emotionCache = useMemo(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const emotionCache = useMemo(() => {
|
|
26
|
+
if (emotionCacheProp)
|
|
27
|
+
return emotionCacheProp;
|
|
28
|
+
if (classNameKey === defaultCacheKey)
|
|
29
|
+
return defaultEmotionCache;
|
|
30
|
+
return createCache({ key: classNameKey, prepend: true });
|
|
31
|
+
}, [classNameKey, emotionCacheProp]);
|
|
28
32
|
return /* @__PURE__ */ jsxs(CacheProvider, { value: emotionCache, children: [
|
|
29
33
|
/* @__PURE__ */ jsx(
|
|
30
34
|
Global,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\n\nimport createCache from \"@emotion/cache\";\nimport {\n css as cssReact,\n Global,\n CacheProvider,\n ClassNames,\n} from \"@emotion/react\";\n\nimport {\n CssBaseline,\n CssScopedBaseline,\n getThemesVars,\n HvThemeStructure,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { getElementById } from \"../utils/document\";\nimport { processThemes } from \"../utils/theme\";\nimport { HvTheme } from \"../types/theme\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\n\nimport {\n HvThemeProvider,\n defaultCacheKey,\n defaultEmotionCache,\n} from \"./ThemeProvider\";\n\n// Provider props\nexport interface HvProviderProps {\n /**\n * Your component tree.\n */\n children?: React.ReactNode;\n /**\n * Id of your root element.\n */\n rootElementId?: string;\n /**\n * By default the baseline styles are applied globally, `global`, to the application for the UI Kit components to work properly.\n * If you need to scope the baseline styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the baseline to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the baseline will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n * If you are providing your own baseline styles, you can set this property to `none` to disable the baseline styles.\n */\n cssBaseline?: \"global\" | \"scoped\" | \"none\";\n /**\n * By default the theme styles are applied globally, `global`, to the application.\n * If you need to scope the theme styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the theme to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the theme will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n */\n cssTheme?: \"global\" | \"scoped\";\n /**\n * The string used to prefix the class names and uniquely identify them. The key can only contain lower case alphabetical characters.\n * This is useful to avoid class name collisions.\n *\n * If no value is provided, the default is
|
|
1
|
+
{"version":3,"file":"Provider.js","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\n\nimport createCache, { EmotionCache } from \"@emotion/cache\";\nimport {\n css as cssReact,\n Global,\n CacheProvider,\n ClassNames,\n} from \"@emotion/react\";\n\nimport {\n CssBaseline,\n CssScopedBaseline,\n getThemesVars,\n HvThemeStructure,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { getElementById } from \"../utils/document\";\nimport { processThemes } from \"../utils/theme\";\nimport { HvTheme } from \"../types/theme\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\n\nimport {\n HvThemeProvider,\n defaultCacheKey,\n defaultEmotionCache,\n} from \"./ThemeProvider\";\n\n// Provider props\nexport interface HvProviderProps {\n /**\n * Your component tree.\n */\n children?: React.ReactNode;\n /**\n * Id of your root element.\n */\n rootElementId?: string;\n /**\n * By default the baseline styles are applied globally, `global`, to the application for the UI Kit components to work properly.\n * If you need to scope the baseline styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the baseline to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the baseline will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n * If you are providing your own baseline styles, you can set this property to `none` to disable the baseline styles.\n */\n cssBaseline?: \"global\" | \"scoped\" | \"none\";\n /**\n * By default the theme styles are applied globally, `global`, to the application.\n * If you need to scope the theme styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the theme to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the theme will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n */\n cssTheme?: \"global\" | \"scoped\";\n /**\n * The string used to prefix the class names and uniquely identify them. The key can only contain lower case alphabetical characters.\n * This is useful to avoid class name collisions.\n *\n * If `emotionCache` is passed, this is value is ignored.\n *\n * @default \"hv\"\n */\n classNameKey?: string;\n /**\n * The emotion cache instance to use. If no value is provided, the default cache is used.\n */\n emotionCache?: EmotionCache;\n /**\n * List of themes to be used by UI Kit.\n * You can provide your own themes created with the `createTheme` utility and/or the default themes `ds3` and `ds5` provided by UI Kit.\n *\n * If no value is provided, the `ds5` theme will be used.\n */\n themes?: (HvTheme | HvThemeStructure)[];\n /**\n * The active theme. It must be one of the themes passed to `themes`.\n *\n * If no value is provided, the first theme from the `themes` list is used. If no `themes` list is provided, the `ds5` theme will be used.\n */\n theme?: string;\n /**\n * The active color mode. It must be one of the color modes of the active theme.\n *\n * If no value is provided, the first color mode defined in the active theme is used.\n * For the default themes `ds3` and `ds5`, the `dawn` color mode is the one used.\n */\n colorMode?: string;\n}\n\nconst scopedRootPrefix = \"hv-uikit-scoped-root\" as const;\n\n/**\n * Enables theming capabilities and makes cross-component theme properties available down the tree.\n */\nexport const HvProvider = ({\n children,\n rootElementId,\n cssBaseline = \"global\",\n cssTheme = \"global\",\n themes,\n theme,\n colorMode,\n emotionCache: emotionCacheProp,\n classNameKey = defaultCacheKey,\n}: HvProviderProps) => {\n const scopedRootId = useUniqueId(undefined, scopedRootPrefix);\n\n // Themes\n const themesList: (HvTheme | HvThemeStructure)[] = processThemes(themes);\n\n // Emotion cache\n // Moves UI Kit styles to the top of the <head> so they're loaded first\n // This enables users to override the UI Kit styles if necessary\n const emotionCache = useMemo(() => {\n if (emotionCacheProp) return emotionCacheProp;\n // reuse the default shared cache if `classNameKey` is the same\n if (classNameKey === defaultCacheKey) return defaultEmotionCache;\n\n return createCache({ key: classNameKey, prepend: true });\n }, [classNameKey, emotionCacheProp]);\n\n return (\n <CacheProvider value={emotionCache}>\n <Global\n styles={cssReact`\n ${\n cssBaseline === \"global\" && {\n [`@layer hv-uikit-baseline`]: {\n ...CssBaseline,\n },\n }\n }\n ${getThemesVars(themesList)}\n `}\n />\n <HvThemeProvider\n themes={themesList}\n theme={theme || themesList[0].name}\n emotionCache={emotionCache}\n colorMode={colorMode || Object.keys(themesList[0].colors.modes)[0]}\n themeRootId={\n cssTheme === \"scoped\" ? rootElementId || scopedRootId : undefined\n }\n >\n <ClassNames>\n {({ css }) => {\n if (cssBaseline === \"scoped\") {\n const rootElement = getElementById(rootElementId);\n\n if (rootElement) {\n rootElement.classList.add(\n css({\n [`@layer ${rootElementId}-baseline`]: {\n ...CssScopedBaseline,\n },\n })\n );\n }\n }\n\n return (cssTheme === \"scoped\" || cssBaseline === \"scoped\") &&\n !rootElementId ? (\n <div\n id={scopedRootId}\n className={\n cssBaseline === \"scoped\"\n ? css({\n [`@layer ${rootElementId}-baseline`]: {\n ...CssScopedBaseline,\n },\n })\n : undefined\n }\n >\n {children}\n </div>\n ) : (\n children\n );\n }}\n </ClassNames>\n </HvThemeProvider>\n </CacheProvider>\n );\n};\n"],"names":["cssReact","css"],"mappings":";;;;;;;;;;AAwFA,MAAM,mBAAmB;AAKlB,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,eAAe;AACjB,MAAuB;AACf,QAAA,eAAe,YAAY,QAAW,gBAAgB;AAGtD,QAAA,aAA6C,cAAc,MAAM;AAKjE,QAAA,eAAe,QAAQ,MAAM;AAC7B,QAAA;AAAyB,aAAA;AAE7B,QAAI,iBAAiB;AAAwB,aAAA;AAE7C,WAAO,YAAY,EAAE,KAAK,cAAc,SAAS,MAAM;AAAA,EAAA,GACtD,CAAC,cAAc,gBAAgB,CAAC;AAGjC,SAAA,qBAAC,eAAc,EAAA,OAAO,cACpB,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAQA;AAAAA,YAEJ,gBAAgB,YAAY;AAAA,UAC1B,CAAC,0BAA0B,GAAG;AAAA,YAC5B,GAAG;AAAA,UACL;AAAA,QAAA,CAEJ;AAAA,YACE,cAAc,UAAU,CAAC;AAAA;AAAA,MAAA;AAAA,IAE/B;AAAA,IACA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR,OAAO,SAAS,WAAW,CAAC,EAAE;AAAA,QAC9B;AAAA,QACA,WAAW,aAAa,OAAO,KAAK,WAAW,CAAC,EAAE,OAAO,KAAK,EAAE,CAAC;AAAA,QACjE,aACE,aAAa,WAAW,iBAAiB,eAAe;AAAA,QAG1D,UAAC,oBAAA,YAAA,EACE,UAAC,CAAA,EAAE,KAAAC,WAAU;AACZ,cAAI,gBAAgB,UAAU;AACtB,kBAAA,cAAc,eAAe,aAAa;AAEhD,gBAAI,aAAa;AACf,0BAAY,UAAU;AAAA,gBACpBA,KAAI;AAAA,kBACF,CAAC,UAAU,aAAa,WAAW,GAAG;AAAA,oBACpC,GAAG;AAAA,kBACL;AAAA,gBAAA,CACD;AAAA,cAAA;AAAA,YAEL;AAAA,UACF;AAEA,kBAAQ,aAAa,YAAY,gBAAgB,aAC/C,CAAC,gBACD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI;AAAA,cACJ,WACE,gBAAgB,WACZA,KAAI;AAAA,gBACF,CAAC,UAAU,aAAa,WAAW,GAAG;AAAA,kBACpC,GAAG;AAAA,gBACL;AAAA,cACD,CAAA,IACD;AAAA,cAGL;AAAA,YAAA;AAAA,UAGH,IAAA;AAAA,QAAA,GAGN;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4753,7 +4753,7 @@ export declare type HvPropGetter<D extends object = Record<string, unknown>, H e
|
|
|
4753
4753
|
/**
|
|
4754
4754
|
* Enables theming capabilities and makes cross-component theme properties available down the tree.
|
|
4755
4755
|
*/
|
|
4756
|
-
export declare const HvProvider: ({ children, rootElementId, cssBaseline, cssTheme, themes, theme, colorMode, classNameKey, }: HvProviderProps) => JSX_3.Element;
|
|
4756
|
+
export declare const HvProvider: ({ children, rootElementId, cssBaseline, cssTheme, themes, theme, colorMode, emotionCache: emotionCacheProp, classNameKey, }: HvProviderProps) => JSX_3.Element;
|
|
4757
4757
|
|
|
4758
4758
|
export declare interface HvProviderProps {
|
|
4759
4759
|
/**
|
|
@@ -4783,9 +4783,15 @@ export declare interface HvProviderProps {
|
|
|
4783
4783
|
* The string used to prefix the class names and uniquely identify them. The key can only contain lower case alphabetical characters.
|
|
4784
4784
|
* This is useful to avoid class name collisions.
|
|
4785
4785
|
*
|
|
4786
|
-
* If
|
|
4786
|
+
* If `emotionCache` is passed, this is value is ignored.
|
|
4787
|
+
*
|
|
4788
|
+
* @default "hv"
|
|
4787
4789
|
*/
|
|
4788
4790
|
classNameKey?: string;
|
|
4791
|
+
/**
|
|
4792
|
+
* The emotion cache instance to use. If no value is provided, the default cache is used.
|
|
4793
|
+
*/
|
|
4794
|
+
emotionCache?: EmotionCache;
|
|
4789
4795
|
/**
|
|
4790
4796
|
* List of themes to be used by UI Kit.
|
|
4791
4797
|
* You can provide your own themes created with the `createTheme` utility and/or the default themes `ds3` and `ds5` provided by UI Kit.
|
|
@@ -7889,6 +7895,7 @@ export declare const paginationClasses: {
|
|
|
7889
7895
|
totalPagesTextContainer: "HvPagination-totalPagesTextContainer";
|
|
7890
7896
|
pageNavigator: "HvPagination-pageNavigator";
|
|
7891
7897
|
iconContainer: "HvPagination-iconContainer";
|
|
7898
|
+
pageSizeRoot: "HvPagination-pageSizeRoot";
|
|
7892
7899
|
pageInfo: "HvPagination-pageInfo";
|
|
7893
7900
|
pageJump: "HvPagination-pageJump";
|
|
7894
7901
|
pageSizeInput: "HvPagination-pageSizeInput";
|
|
@@ -9692,7 +9699,7 @@ declare const useClasses_45: (classesProp?: Partial<Record<"label" | "descriptio
|
|
|
9692
9699
|
cx: (...args: any) => string;
|
|
9693
9700
|
};
|
|
9694
9701
|
|
|
9695
|
-
declare const useClasses_46: (classesProp?: Partial<Record<"root" | "icon" | "pageSizeOptions" | "pageSizeHeader" | "pageSizeTextContainer" | "pageSizeOptionsSelect" | "totalPagesTextContainer" | "pageNavigator" | "iconContainer" | "pageInfo" | "pageJump" | "pageSizeInput" | "pageSizeInputRoot" | "pageSizeInputContainer", string>>, addStatic?: boolean) => {
|
|
9702
|
+
declare const useClasses_46: (classesProp?: Partial<Record<"root" | "icon" | "pageSizeOptions" | "pageSizeHeader" | "pageSizeTextContainer" | "pageSizeOptionsSelect" | "totalPagesTextContainer" | "pageNavigator" | "iconContainer" | "pageSizeRoot" | "pageInfo" | "pageJump" | "pageSizeInput" | "pageSizeInputRoot" | "pageSizeInputContainer", string>>, addStatic?: boolean) => {
|
|
9696
9703
|
classes: {
|
|
9697
9704
|
root: string;
|
|
9698
9705
|
icon: string;
|
|
@@ -9703,6 +9710,7 @@ declare const useClasses_46: (classesProp?: Partial<Record<"root" | "icon" | "pa
|
|
|
9703
9710
|
totalPagesTextContainer: string;
|
|
9704
9711
|
pageNavigator: string;
|
|
9705
9712
|
iconContainer: string;
|
|
9713
|
+
pageSizeRoot: string;
|
|
9706
9714
|
pageInfo: string;
|
|
9707
9715
|
pageJump: string;
|
|
9708
9716
|
pageSizeInput: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/uikit-react-core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.53.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Hitachi Vantara UI Kit Team",
|
|
6
6
|
"description": "Core React components for the NEXT Design System.",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"access": "public",
|
|
64
64
|
"directory": "package"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "f2efcbaf56056d1491e3625f587a6de525c12adc",
|
|
67
67
|
"main": "dist/cjs/index.cjs",
|
|
68
68
|
"exports": {
|
|
69
69
|
".": {
|