@databiosphere/findable-ui 29.0.2 → 30.0.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.
Files changed (205) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +22 -0
  3. package/lib/common/categories/config/types.d.ts +28 -0
  4. package/lib/common/categories/config/utils.d.ts +31 -0
  5. package/lib/common/categories/config/utils.js +29 -0
  6. package/lib/common/categories/models/range/typeGuards.d.ts +14 -0
  7. package/lib/common/categories/models/range/typeGuards.js +18 -0
  8. package/lib/common/categories/models/range/types.d.ts +15 -0
  9. package/lib/common/categories/models/range/types.js +1 -0
  10. package/lib/common/categories/models/range/utils.d.ts +23 -0
  11. package/lib/common/categories/models/range/utils.js +41 -0
  12. package/lib/common/categories/models/select/utils.d.ts +8 -0
  13. package/lib/common/categories/models/select/utils.js +16 -0
  14. package/lib/common/categories/models/types.d.ts +6 -0
  15. package/lib/common/categories/models/types.js +1 -0
  16. package/lib/common/categories/views/common/types.d.ts +10 -0
  17. package/lib/common/categories/views/common/types.js +1 -0
  18. package/lib/common/categories/views/range/typeGuards.d.ts +8 -0
  19. package/lib/common/categories/views/range/typeGuards.js +8 -0
  20. package/lib/common/categories/views/range/types.d.ts +19 -0
  21. package/lib/common/categories/views/range/types.js +1 -0
  22. package/lib/common/categories/views/range/utils.d.ts +12 -0
  23. package/lib/common/categories/views/range/utils.js +24 -0
  24. package/lib/common/categories/views/select/typeGuards.d.ts +8 -0
  25. package/lib/common/categories/views/select/typeGuards.js +8 -0
  26. package/lib/common/categories/views/select/types.d.ts +7 -0
  27. package/lib/common/categories/views/select/types.js +1 -0
  28. package/lib/common/categories/views/types.d.ts +13 -0
  29. package/lib/common/categories/views/types.js +8 -0
  30. package/lib/common/entities.d.ts +5 -2
  31. package/lib/components/DataDictionary/components/Table/components/BasicCell/basicCell.d.ts +3 -2
  32. package/lib/components/DataDictionary/components/Table/components/BasicCell/basicCell.js +6 -2
  33. package/lib/components/DataDictionary/components/Table/components/BasicCell/utils.d.ts +9 -0
  34. package/lib/components/DataDictionary/components/Table/components/BasicCell/utils.js +12 -0
  35. package/lib/components/DataDictionary/dataDictionary.styles.js +2 -3
  36. package/lib/components/Filter/components/Filter/filter.d.ts +2 -2
  37. package/lib/components/Filter/components/Filter/filter.js +11 -3
  38. package/lib/components/Filter/components/Filter/stories/args.d.ts +5 -0
  39. package/lib/components/Filter/components/Filter/stories/args.js +19 -0
  40. package/lib/components/Filter/components/Filter/stories/filter.stories.d.ts +8 -0
  41. package/lib/components/Filter/components/Filter/stories/filter.stories.js +21 -0
  42. package/lib/components/Filter/components/FilterMenu/filterMenu.js +2 -2
  43. package/lib/components/Filter/components/FilterMenu/filterMenu.styles.d.ts +1 -1
  44. package/lib/components/Filter/components/FilterMenu/filterMenu.styles.js +1 -1
  45. package/lib/components/Filter/components/FilterRange/constants.d.ts +0 -2
  46. package/lib/components/Filter/components/FilterRange/constants.js +0 -5
  47. package/lib/components/Filter/components/FilterRange/filterRange.d.ts +1 -1
  48. package/lib/components/Filter/components/FilterRange/filterRange.js +50 -21
  49. package/lib/components/Filter/components/FilterRange/filterRange.styles.js +58 -10
  50. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/constants.d.ts +5 -0
  51. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/constants.js +5 -0
  52. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/hook.d.ts +2 -2
  53. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/hook.js +32 -7
  54. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/schema.d.ts +6 -0
  55. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/schema.js +50 -0
  56. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/types.d.ts +26 -3
  57. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/types.js +6 -1
  58. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/utils.d.ts +15 -0
  59. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/utils.js +25 -0
  60. package/lib/components/Filter/components/FilterRange/stories/args.d.ts +3 -0
  61. package/lib/components/Filter/components/FilterRange/stories/args.js +13 -0
  62. package/lib/components/Filter/components/FilterRange/stories/filterRange.stories.js +2 -2
  63. package/lib/components/Filter/components/FilterRange/types.d.ts +10 -6
  64. package/lib/components/Filter/components/FilterRange/types.js +1 -6
  65. package/lib/components/Filter/components/FilterRange/utils.d.ts +8 -0
  66. package/lib/components/Filter/components/FilterRange/utils.js +15 -0
  67. package/lib/components/Filter/components/FilterTag/stories/args.d.ts +5 -0
  68. package/lib/components/Filter/components/FilterTag/stories/args.js +17 -0
  69. package/lib/components/Filter/components/FilterTag/stories/filterTag.stories.d.ts +8 -0
  70. package/lib/components/Filter/components/FilterTag/stories/filterTag.stories.js +21 -0
  71. package/lib/components/Filter/components/FilterTag/utils.d.ts +10 -0
  72. package/lib/components/Filter/components/FilterTag/utils.js +40 -0
  73. package/lib/components/Filter/components/Filters/filters.d.ts +2 -2
  74. package/lib/components/Filter/components/Filters/filters.js +15 -8
  75. package/lib/components/Filter/components/Filters/stories/args.d.ts +3 -0
  76. package/lib/components/Filter/components/Filters/stories/args.js +15 -0
  77. package/lib/components/Filter/components/Filters/stories/constants.d.ts +22 -0
  78. package/lib/components/Filter/components/Filters/stories/constants.js +134 -0
  79. package/lib/components/Filter/components/Filters/stories/filters.stories.d.ts +6 -0
  80. package/lib/components/Filter/components/Filters/stories/filters.stories.js +15 -0
  81. package/lib/components/Filter/components/SearchAllFilters/components/VariableSizeList/VariableSizeList.d.ts +1 -1
  82. package/lib/components/Filter/components/SearchAllFilters/components/VariableSizeList/VariableSizeList.js +5 -5
  83. package/lib/components/Filter/components/SearchAllFilters/components/VariableSizeListItem/variableSizeListItem.js +2 -1
  84. package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.d.ts +3 -2
  85. package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.js +6 -4
  86. package/lib/components/Filter/components/VariableSizeListItem/variableSizeListItem.js +2 -1
  87. package/lib/components/Index/components/EntitiesView/components/ChartView/utils.js +2 -0
  88. package/lib/components/Index/table/hook.js +4 -0
  89. package/lib/components/Table/columnDef/accessorFn/typeGuards.d.ts +9 -0
  90. package/lib/components/Table/columnDef/accessorFn/typeGuards.js +10 -0
  91. package/lib/components/Table/common/utils.d.ts +2 -2
  92. package/lib/components/Table/common/utils.js +28 -13
  93. package/lib/components/Table/components/TableCell/components/ChipCell/chipCell.d.ts +3 -0
  94. package/lib/components/Table/components/TableCell/components/ChipCell/chipCell.js +8 -0
  95. package/lib/components/Table/components/TableCell/components/LinkCell/linkCell.d.ts +4 -0
  96. package/lib/components/Table/components/TableCell/components/LinkCell/linkCell.js +21 -0
  97. package/lib/components/Table/components/TableCell/components/LinkCell/stories/args.d.ts +6 -0
  98. package/lib/components/Table/components/TableCell/components/LinkCell/stories/args.js +27 -0
  99. package/lib/components/Table/components/TableCell/components/LinkCell/stories/linkCell.stories.d.ts +9 -0
  100. package/lib/components/Table/components/TableCell/components/LinkCell/stories/linkCell.stories.js +18 -0
  101. package/lib/components/Table/components/TableCell/components/LinkCell/stories/types.d.ts +3 -0
  102. package/lib/components/Table/components/TableCell/components/LinkCell/stories/types.js +1 -0
  103. package/lib/components/Table/components/TableCell/components/LinkCell/utils.d.ts +22 -0
  104. package/lib/components/Table/components/TableCell/components/LinkCell/utils.js +45 -0
  105. package/lib/components/Table/featureOptions/facetedColumn/getFacetedMinMaxValues.d.ts +8 -0
  106. package/lib/components/Table/featureOptions/facetedColumn/getFacetedMinMaxValues.js +46 -0
  107. package/lib/components/common/Link/typeGuards.d.ts +13 -0
  108. package/lib/components/common/Link/typeGuards.js +21 -0
  109. package/lib/config/entities.d.ts +2 -11
  110. package/lib/hooks/useCategoryFilter.d.ts +8 -13
  111. package/lib/hooks/useCategoryFilter.js +31 -28
  112. package/lib/providers/exploreState/entities.d.ts +5 -3
  113. package/lib/providers/exploreState/payloads/entities.d.ts +6 -2
  114. package/lib/providers/exploreState.d.ts +3 -2
  115. package/lib/providers/exploreState.js +1 -1
  116. package/lib/tests/utils.d.ts +24 -0
  117. package/lib/tests/utils.js +34 -0
  118. package/lib/theme/common/components.js +19 -1
  119. package/lib/views/ExploreView/exploreView.js +10 -8
  120. package/package.json +2 -1
  121. package/src/common/categories/config/types.ts +42 -0
  122. package/src/common/categories/config/utils.ts +47 -0
  123. package/src/common/categories/models/range/typeGuards.ts +24 -0
  124. package/src/common/categories/models/range/types.ts +17 -0
  125. package/src/common/categories/models/range/utils.ts +51 -0
  126. package/src/common/categories/models/select/utils.ts +23 -0
  127. package/src/common/categories/models/types.ts +7 -0
  128. package/src/common/categories/views/common/types.ts +11 -0
  129. package/src/common/categories/views/range/typeGuards.ts +13 -0
  130. package/src/common/categories/views/range/types.ts +21 -0
  131. package/src/common/categories/views/range/utils.ts +35 -0
  132. package/src/common/categories/views/select/typeGuards.ts +13 -0
  133. package/src/common/categories/views/select/types.ts +8 -0
  134. package/src/common/categories/views/types.ts +15 -0
  135. package/src/common/entities.ts +10 -5
  136. package/src/components/DataDictionary/components/Table/components/BasicCell/basicCell.tsx +12 -4
  137. package/src/components/DataDictionary/components/Table/components/BasicCell/utils.ts +13 -0
  138. package/src/components/DataDictionary/dataDictionary.styles.ts +2 -3
  139. package/src/components/Filter/components/Filter/filter.tsx +38 -13
  140. package/src/components/Filter/components/Filter/stories/args.ts +24 -0
  141. package/src/components/Filter/components/Filter/stories/filter.stories.tsx +32 -0
  142. package/src/components/Filter/components/FilterMenu/filterMenu.styles.ts +1 -1
  143. package/src/components/Filter/components/FilterMenu/filterMenu.tsx +7 -3
  144. package/src/components/Filter/components/FilterRange/constants.ts +0 -7
  145. package/src/components/Filter/components/FilterRange/filterRange.styles.ts +58 -14
  146. package/src/components/Filter/components/FilterRange/filterRange.tsx +112 -40
  147. package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/constants.ts +5 -0
  148. package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/hook.ts +51 -10
  149. package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/schema.ts +60 -0
  150. package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/types.ts +34 -3
  151. package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/utils.ts +32 -0
  152. package/src/components/Filter/components/FilterRange/stories/args.ts +16 -0
  153. package/src/components/Filter/components/FilterRange/stories/filterRange.stories.tsx +2 -2
  154. package/src/components/Filter/components/FilterRange/types.ts +12 -6
  155. package/src/components/Filter/components/FilterRange/utils.ts +16 -0
  156. package/src/components/Filter/components/FilterTag/stories/args.ts +22 -0
  157. package/src/components/Filter/components/FilterTag/stories/filterTag.stories.tsx +32 -0
  158. package/src/components/Filter/components/FilterTag/utils.ts +57 -0
  159. package/src/components/Filter/components/Filters/filters.tsx +21 -12
  160. package/src/components/Filter/components/Filters/stories/args.ts +24 -0
  161. package/src/components/Filter/components/Filters/stories/constants.ts +151 -0
  162. package/src/components/Filter/components/Filters/stories/filters.stories.tsx +24 -0
  163. package/src/components/Filter/components/SearchAllFilters/components/VariableSizeList/VariableSizeList.tsx +32 -29
  164. package/src/components/Filter/components/SearchAllFilters/components/VariableSizeListItem/variableSizeListItem.tsx +9 -1
  165. package/src/components/Filter/components/SearchAllFilters/searchAllFilters.tsx +12 -6
  166. package/src/components/Filter/components/VariableSizeListItem/variableSizeListItem.tsx +2 -1
  167. package/src/components/Index/components/EntitiesView/components/ChartView/utils.ts +2 -0
  168. package/src/components/Index/table/hook.ts +4 -0
  169. package/src/components/Table/columnDef/accessorFn/typeGuards.ts +15 -0
  170. package/src/components/Table/common/utils.ts +37 -16
  171. package/src/components/Table/components/TableCell/components/ChipCell/chipCell.tsx +14 -0
  172. package/src/components/Table/components/TableCell/components/LinkCell/linkCell.tsx +64 -0
  173. package/src/components/Table/components/TableCell/components/LinkCell/stories/args.ts +35 -0
  174. package/src/components/Table/components/TableCell/components/LinkCell/stories/linkCell.stories.tsx +32 -0
  175. package/src/components/Table/components/TableCell/components/LinkCell/stories/types.ts +4 -0
  176. package/src/components/Table/components/TableCell/components/LinkCell/utils.ts +59 -0
  177. package/src/components/Table/featureOptions/facetedColumn/getFacetedMinMaxValues.ts +64 -0
  178. package/src/components/common/Link/typeGuards.ts +35 -0
  179. package/src/config/entities.ts +1 -14
  180. package/src/hooks/useCategoryFilter.ts +56 -53
  181. package/src/providers/exploreState/entities.ts +3 -3
  182. package/src/providers/exploreState/initializer/utils.ts +1 -1
  183. package/src/providers/exploreState/payloads/entities.ts +5 -2
  184. package/src/providers/exploreState.tsx +5 -3
  185. package/src/tests/utils.ts +44 -0
  186. package/src/theme/common/components.ts +19 -1
  187. package/src/views/ExploreView/exploreView.tsx +17 -22
  188. package/tests/filter.test.tsx +100 -0
  189. package/tests/filterRange.test.tsx +331 -46
  190. package/tests/filters.test.tsx +61 -0
  191. package/tests/getFacetedMinMaxValues.test.ts +166 -0
  192. package/tests/linkCell.test.tsx +89 -0
  193. package/lib/components/DataDictionary/components/Table/components/BasicCell/types.d.ts +0 -3
  194. package/lib/components/Filter/components/Filter/filter.stories.d.ts +0 -25
  195. package/lib/components/Filter/components/Filter/filter.stories.js +0 -42
  196. package/lib/components/Filter/components/FilterTag/filterTag.stories.d.ts +0 -16
  197. package/lib/components/Filter/components/FilterTag/filterTag.stories.js +0 -17
  198. package/lib/components/Filter/components/Filters/filters.stories.d.ts +0 -6
  199. package/lib/components/Filter/components/Filters/filters.stories.js +0 -91
  200. package/src/components/DataDictionary/components/Table/components/BasicCell/types.ts +0 -7
  201. package/src/components/Filter/components/Filter/filter.stories.tsx +0 -52
  202. package/src/components/Filter/components/FilterTag/filterTag.stories.tsx +0 -23
  203. package/src/components/Filter/components/Filters/filters.stories.tsx +0 -101
  204. package/tests/filterRangeMock.test.tsx +0 -38
  205. /package/lib/{components/DataDictionary/components/Table/components/BasicCell → common/categories/config}/types.js +0 -0
@@ -0,0 +1,21 @@
1
+ import { Link as MLink, Typography } from "@mui/material";
2
+ import React from "react";
3
+ import { isValidUrl } from "../../../../../../common/utils";
4
+ import { TYPOGRAPHY_PROPS } from "../../../../../../styles/common/mui/typography";
5
+ import { isClientSideNavigation } from "../../../../../Links/common/utils";
6
+ import { getComponent, getRelAttribute, getTargetAttribute } from "./utils";
7
+ export const LinkCell = ({ getValue, }) => {
8
+ const props = getValue();
9
+ if (!props)
10
+ return null;
11
+ const { children, className, color, href = "", rel, target, underline, ...linkProps } = props;
12
+ // Determine if the href should use client-side navigation.
13
+ const isClientSide = isClientSideNavigation(href);
14
+ // Determine if the href is valid.
15
+ const isValid = isClientSide || isValidUrl(href);
16
+ // If the href is invalid, return a Typography component.
17
+ if (!isValid)
18
+ return (React.createElement(Typography, { className: className, color: TYPOGRAPHY_PROPS.COLOR.INHERIT, component: "span", variant: TYPOGRAPHY_PROPS.VARIANT.INHERIT, ...linkProps }, children));
19
+ // If the href is valid, return a Link component.
20
+ return (React.createElement(MLink, { className: className, color: color, component: getComponent(href, isClientSide), href: href, rel: getRelAttribute(rel, isClientSide), target: getTargetAttribute(target, isClientSide), underline: underline, ...linkProps }, children));
21
+ };
@@ -0,0 +1,6 @@
1
+ import { ComponentProps } from "react";
2
+ import { LinkCell } from "../linkCell";
3
+ export declare const CLIENT_SIDE_ARGS: Partial<ComponentProps<typeof LinkCell>>;
4
+ export declare const EXTERNAL_ARGS: Partial<ComponentProps<typeof LinkCell>>;
5
+ export declare const INVALID_ARGS: Partial<ComponentProps<typeof LinkCell>>;
6
+ export declare const WITH_CUSTOM_STYLE_ARGS: Partial<ComponentProps<typeof LinkCell>>;
@@ -0,0 +1,27 @@
1
+ import { TYPOGRAPHY_PROPS } from "../../../../../../../styles/common/mui/typography";
2
+ export const CLIENT_SIDE_ARGS = {
3
+ getValue: (() => ({
4
+ children: "Explore",
5
+ href: "/",
6
+ })),
7
+ };
8
+ export const EXTERNAL_ARGS = {
9
+ getValue: (() => ({
10
+ children: "Explore",
11
+ href: "https://www.example.com",
12
+ })),
13
+ };
14
+ export const INVALID_ARGS = {
15
+ getValue: (() => ({
16
+ children: "Explore",
17
+ })),
18
+ };
19
+ export const WITH_CUSTOM_STYLE_ARGS = {
20
+ getValue: (() => ({
21
+ children: "Explore",
22
+ color: "success",
23
+ href: "/",
24
+ underline: "none",
25
+ variant: TYPOGRAPHY_PROPS.VARIANT.TEXT_BODY_SMALL_400,
26
+ })),
27
+ };
@@ -0,0 +1,9 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { LinkCell } from "../linkCell";
3
+ declare const meta: Meta<typeof LinkCell>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const ClientSide: Story;
7
+ export declare const External: Story;
8
+ export declare const Invalid: Story;
9
+ export declare const WithCustomStyle: Story;
@@ -0,0 +1,18 @@
1
+ import { LinkCell } from "../linkCell";
2
+ import { CLIENT_SIDE_ARGS, EXTERNAL_ARGS, INVALID_ARGS, WITH_CUSTOM_STYLE_ARGS, } from "./args";
3
+ const meta = {
4
+ component: LinkCell,
5
+ };
6
+ export default meta;
7
+ export const ClientSide = {
8
+ args: CLIENT_SIDE_ARGS,
9
+ };
10
+ export const External = {
11
+ args: EXTERNAL_ARGS,
12
+ };
13
+ export const Invalid = {
14
+ args: INVALID_ARGS,
15
+ };
16
+ export const WithCustomStyle = {
17
+ args: WITH_CUSTOM_STYLE_ARGS,
18
+ };
@@ -0,0 +1,3 @@
1
+ import { LinkProps } from "@mui/material";
2
+ import { CellContext, RowData } from "@tanstack/react-table";
3
+ export type GetValue = CellContext<RowData, LinkProps>["getValue"];
@@ -0,0 +1,22 @@
1
+ import { ElementType } from "react";
2
+ /**
3
+ * Returns the component to use for a link based on the given href and client-side navigation flag.
4
+ * @param href - The href attribute to use.
5
+ * @param isClientSide - Whether the link is a client-side navigation.
6
+ * @returns The component to use for the link.
7
+ */
8
+ export declare function getComponent(href: string, isClientSide: boolean): ElementType;
9
+ /**
10
+ * Returns the rel attribute for a link based on the given rel and client-side navigation flag.
11
+ * @param rel - The rel attribute to use.
12
+ * @param isClientSideNavigation - Whether the link is a client-side navigation.
13
+ * @returns The rel attribute for the link.
14
+ */
15
+ export declare function getRelAttribute(rel: string | undefined, isClientSideNavigation: boolean): string;
16
+ /**
17
+ * Returns the target attribute for a link based on the given target and client-side navigation flag.
18
+ * @param target - The target attribute to use.
19
+ * @param isClientSideNavigation - Whether the link is a client-side navigation.
20
+ * @returns The target attribute for the link.
21
+ */
22
+ export declare function getTargetAttribute(target: string | undefined, isClientSideNavigation: boolean): string;
@@ -0,0 +1,45 @@
1
+ import Link from "next/link";
2
+ import { isValidUrl } from "../../../../../../common/utils";
3
+ import { ANCHOR_TARGET, REL_ATTRIBUTE, } from "../../../../../Links/common/entities";
4
+ import { assertAnchorRelAttribute, assertAnchorTargetAttribute, } from "../../../../../common/Link/typeGuards";
5
+ /**
6
+ * Returns the component to use for a link based on the given href and client-side navigation flag.
7
+ * @param href - The href attribute to use.
8
+ * @param isClientSide - Whether the link is a client-side navigation.
9
+ * @returns The component to use for the link.
10
+ */
11
+ export function getComponent(href, isClientSide) {
12
+ if (isClientSide)
13
+ return Link; // Use Next/Link for client-side navigation.
14
+ if (isValidUrl(href))
15
+ return "a"; // Use anchor tag for external links.
16
+ return "span"; // Use span for invalid links.
17
+ }
18
+ /**
19
+ * Returns the rel attribute for a link based on the given rel and client-side navigation flag.
20
+ * @param rel - The rel attribute to use.
21
+ * @param isClientSideNavigation - Whether the link is a client-side navigation.
22
+ * @returns The rel attribute for the link.
23
+ */
24
+ export function getRelAttribute(rel, isClientSideNavigation) {
25
+ if (rel) {
26
+ assertAnchorRelAttribute(rel);
27
+ return rel;
28
+ }
29
+ return isClientSideNavigation
30
+ ? REL_ATTRIBUTE.NO_OPENER
31
+ : REL_ATTRIBUTE.NO_OPENER_NO_REFERRER;
32
+ }
33
+ /**
34
+ * Returns the target attribute for a link based on the given target and client-side navigation flag.
35
+ * @param target - The target attribute to use.
36
+ * @param isClientSideNavigation - Whether the link is a client-side navigation.
37
+ * @returns The target attribute for the link.
38
+ */
39
+ export function getTargetAttribute(target, isClientSideNavigation) {
40
+ if (target) {
41
+ assertAnchorTargetAttribute(target);
42
+ return target;
43
+ }
44
+ return isClientSideNavigation ? ANCHOR_TARGET.SELF : ANCHOR_TARGET.BLANK;
45
+ }
@@ -0,0 +1,8 @@
1
+ import { RowData, Table } from "@tanstack/react-table";
2
+ /**
3
+ * Returns an array of two numbers, the minimum and maximum values for the column, or undefined if the column does not exist or has no values.
4
+ * Customized version of the default getFacetedMinMaxValues function from tanstack table handling mixed null and possible NaN values.
5
+ * See https://tanstack.com/table/v8/docs/api/features/column-faceting#getfacetedminmaxvalues.
6
+ * @returns An array of two numbers, the minimum and maximum values for the column, or undefined if the column does not exist or has no values.
7
+ */
8
+ export declare function getFacetedMinMaxValues<TData extends RowData>(): (table: Table<TData>, columnId: string) => () => undefined | [number, number];
@@ -0,0 +1,46 @@
1
+ import { getMemoOptions, memo } from "@tanstack/react-table";
2
+ /**
3
+ * Returns an array of two numbers, the minimum and maximum values for the column, or undefined if the column does not exist or has no values.
4
+ * Customized version of the default getFacetedMinMaxValues function from tanstack table handling mixed null and possible NaN values.
5
+ * See https://tanstack.com/table/v8/docs/api/features/column-faceting#getfacetedminmaxvalues.
6
+ * @returns An array of two numbers, the minimum and maximum values for the column, or undefined if the column does not exist or has no values.
7
+ */
8
+ export function getFacetedMinMaxValues() {
9
+ // eslint-disable-next-line sonarjs/cognitive-complexity -- Customized copy of tanstack table function.
10
+ return (table, columnId) => memo(() => [table.getColumn(columnId)?.getFacetedRowModel()], (facetedRowModel) => {
11
+ if (!facetedRowModel)
12
+ return undefined;
13
+ // Initialize with the smallest and largest possible numbers.
14
+ const facetedMinMaxValues = [Infinity, -Infinity];
15
+ for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
16
+ const values = facetedRowModel.flatRows[i].getUniqueValues(columnId);
17
+ for (let j = 0; j < values.length; j++) {
18
+ const value = values[j];
19
+ // Convert value to a number.
20
+ const numericValue = Number(value);
21
+ // Skip null and NaN values.
22
+ if (value === null || isNaN(numericValue))
23
+ continue;
24
+ if (numericValue < facetedMinMaxValues[0]) {
25
+ facetedMinMaxValues[0] = numericValue;
26
+ }
27
+ if (numericValue > facetedMinMaxValues[1]) {
28
+ facetedMinMaxValues[1] = numericValue;
29
+ }
30
+ }
31
+ }
32
+ // Return undefined if all values are null or NaN.
33
+ if (facetedMinMaxValues[0] === Infinity &&
34
+ facetedMinMaxValues[1] === -Infinity) {
35
+ return undefined;
36
+ }
37
+ // Normalize -0 to 0.
38
+ if (Object.is(facetedMinMaxValues[0], -0)) {
39
+ facetedMinMaxValues[0] = 0;
40
+ }
41
+ if (Object.is(facetedMinMaxValues[1], -0)) {
42
+ facetedMinMaxValues[1] = 0;
43
+ }
44
+ return facetedMinMaxValues;
45
+ }, getMemoOptions(table.options, "debugTable", "getFacetedMinMaxValues"));
46
+ }
@@ -0,0 +1,13 @@
1
+ import { ANCHOR_TARGET, REL_ATTRIBUTE } from "../../Links/common/entities";
2
+ /**
3
+ * Asserts that the given value is a valid REL_ATTRIBUTE.
4
+ * @param value - Value to assert.
5
+ * @throws Error if the value is not a valid REL_ATTRIBUTE.
6
+ */
7
+ export declare function assertAnchorRelAttribute(value: string): asserts value is REL_ATTRIBUTE;
8
+ /**
9
+ * Asserts that the given value is a valid ANCHOR_TARGET.
10
+ * @param value - Value to assert.
11
+ * @throws Error if the value is not a valid ANCHOR_TARGET.
12
+ */
13
+ export declare function assertAnchorTargetAttribute(value: string): asserts value is ANCHOR_TARGET;
@@ -0,0 +1,21 @@
1
+ import { ANCHOR_TARGET, REL_ATTRIBUTE } from "../../Links/common/entities";
2
+ /**
3
+ * Asserts that the given value is a valid REL_ATTRIBUTE.
4
+ * @param value - Value to assert.
5
+ * @throws Error if the value is not a valid REL_ATTRIBUTE.
6
+ */
7
+ export function assertAnchorRelAttribute(value) {
8
+ if (!Object.values(REL_ATTRIBUTE).includes(value)) {
9
+ throw new Error(`Expecting rel attribute: ${value} to be one of ${Object.values(REL_ATTRIBUTE)}`);
10
+ }
11
+ }
12
+ /**
13
+ * Asserts that the given value is a valid ANCHOR_TARGET.
14
+ * @param value - Value to assert.
15
+ * @throws Error if the value is not a valid ANCHOR_TARGET.
16
+ */
17
+ export function assertAnchorTargetAttribute(value) {
18
+ if (!Object.values(ANCHOR_TARGET).includes(value)) {
19
+ throw new Error(`Expecting anchor target: ${value} to be one of ${Object.values(ANCHOR_TARGET)}`);
20
+ }
21
+ }
@@ -1,7 +1,8 @@
1
1
  import { TabProps as MTabProps, Theme, ThemeOptions } from "@mui/material";
2
2
  import { CellContext, ColumnDef, ColumnMeta, ColumnSort, GroupingState, RowData, Table, TableOptions } from "@tanstack/react-table";
3
3
  import { JSXElementConstructor, ReactNode } from "react";
4
- import { DataDictionaryAnnotation, DataDictionaryConfig, SelectCategoryValueView, SelectedFilter } from "../common/entities";
4
+ import { CategoryConfig } from "../common/categories/config/types";
5
+ import { DataDictionaryAnnotation, DataDictionaryConfig, SelectedFilter } from "../common/entities";
5
6
  import { HeroTitle } from "../components/common/Title/title";
6
7
  import { FooterProps } from "../components/Layout/components/Footer/footer";
7
8
  import { HeaderProps } from "../components/Layout/components/Header/header";
@@ -66,16 +67,6 @@ export interface CategoryGroup {
66
67
  categoryConfigs: CategoryConfig[];
67
68
  label?: string;
68
69
  }
69
- /**
70
- * Model of category configured in site config.
71
- */
72
- export interface CategoryConfig {
73
- annotation?: DataDictionaryAnnotation;
74
- enableChartView?: boolean;
75
- key: string;
76
- label: string;
77
- mapSelectCategoryValue?: (selectCategoryValue: SelectCategoryValueView) => SelectCategoryValueView;
78
- }
79
70
  /**
80
71
  * Column configuration.
81
72
  * TanStack ColumnDef properties not currently supported include:
@@ -1,21 +1,15 @@
1
- import { CategoryKey, CategoryValueKey, Filters, SelectCategory, SelectCategoryValue, SelectCategoryView } from "../common/entities";
2
- import { CategoryConfig } from "../config/entities";
1
+ import { CategoryConfig } from "../common/categories/config/types";
2
+ import { Category } from "../common/categories/models/types";
3
+ import { CategoryView, VIEW_KIND } from "../common/categories/views/types";
4
+ import { CategoryKey, CategoryValueKey, Filters, SelectCategoryValue } from "../common/entities";
3
5
  /**
4
6
  * State backing filter functionality and calculations. Converted to view model for display.
5
7
  */
6
8
  export type FilterState = Filters;
7
- /**
8
- * Shape of return value from this useCategoryFilter hook.
9
- */
10
- export interface FilterInstance {
11
- categories: SelectCategoryView[];
12
- filter: FilterState;
13
- onFilter: OnFilterFn;
14
- }
15
9
  /**
16
10
  * Function invoked when selected state of a category value is toggled or range is selected.
17
11
  */
18
- export type OnFilterFn = (categoryKey: CategoryKey, selectedCategoryValue: CategoryValueKey, selected: boolean, categorySection?: string, searchTerm?: string) => void;
12
+ export type OnFilterFn = (categoryKey: CategoryKey, selectedCategoryValue: CategoryValueKey, selected: boolean, categorySection?: string, viewKind?: VIEW_KIND, searchTerm?: string) => void;
19
13
  /**
20
14
  * Build view-specific models from filter state, to facilitate easy rendering.
21
15
  * @param categories - Categories, category value and their counts with the current filter applied.
@@ -23,16 +17,17 @@ export type OnFilterFn = (categoryKey: CategoryKey, selectedCategoryValue: Categ
23
17
  * @param filterState - Current set of selected category and category values.
24
18
  * @returns Array of category view objects.
25
19
  */
26
- export declare function buildCategoryViews(categories: SelectCategory[], categoryConfigs: CategoryConfig[] | undefined, filterState: FilterState): SelectCategoryView[];
20
+ export declare function buildCategoryViews(categories: Category[], categoryConfigs: CategoryConfig[] | undefined, filterState: FilterState): CategoryView[];
27
21
  /**
28
22
  * Build new set of selected filters on de/select of filter.
29
23
  * @param filterState - Current set of selected category and category values.
30
24
  * @param categoryKey - Key of category that has been de/selected.
31
25
  * @param selectedValue - Key of category value that has been de/selected
32
26
  * @param selected - True if value is selected, false if de-selected.
27
+ * @param viewKind - View kind.
33
28
  * @returns New filter state generated from the current set of selected values and the newly selected value.
34
29
  */
35
- export declare function buildNextFilterState(filterState: FilterState, categoryKey: CategoryKey, selectedValue: CategoryValueKey, selected: boolean): FilterState;
30
+ export declare function buildNextFilterState(filterState: FilterState, categoryKey: CategoryKey, selectedValue: CategoryValueKey, selected: boolean, viewKind?: VIEW_KIND): FilterState;
36
31
  /**
37
32
  * Default function returning select category value, unmodified.
38
33
  * @param selectCategoryValue - Select category value.
@@ -1,3 +1,9 @@
1
+ import { findSelectCategoryConfig } from "../common/categories/config/utils";
2
+ import { isRangeCategory } from "../common/categories/models/range/typeGuards";
3
+ import { buildNextRangeFilterState } from "../common/categories/models/range/utils";
4
+ import { buildNextSelectFilterState } from "../common/categories/models/select/utils";
5
+ import { buildRangeCategoryView } from "../common/categories/views/range/utils";
6
+ import { VIEW_KIND } from "../common/categories/views/types";
1
7
  import { COLLATOR_CASE_INSENSITIVE } from "../common/constants";
2
8
  /**
3
9
  * Build the view-specific model of the given category value.
@@ -17,22 +23,22 @@ function buildCategoryValueView(categoryValue, categorySelectedFilter) {
17
23
  };
18
24
  }
19
25
  /**
20
- * Build the view-specific model of the given category, including the category label pulled from the config.
21
- * @param category - The category to build a view model of.
22
- * @param categoryValueViews - Set of category value view models for the given category.
26
+ * Build the view-specific model of the given select category, including the category label pulled from the config.
27
+ * @param selectCategory - The select category to build a view model of.
28
+ * @param selectCategoryValueViews - Set of select category value view models for the given category.
23
29
  * @param categoryConfigs - Category configs indicating accept list as well as label configuration.
24
- * @returns Full built category value view, ready for display.
30
+ * @returns Full built select category view, ready for display.
25
31
  */
26
- function buildCategoryView(category, categoryValueViews, categoryConfigs) {
27
- const categoryConfig = findCategoryConfig(category.key, categoryConfigs);
28
- const mapSelectCategoryValue = categoryConfig?.mapSelectCategoryValue || getSelectCategoryValue;
32
+ function buildCategoryView(selectCategory, selectCategoryValueViews, categoryConfigs) {
33
+ const selectCategoryConfig = findSelectCategoryConfig(selectCategory.key, categoryConfigs);
34
+ const mapSelectCategoryValue = selectCategoryConfig?.mapSelectCategoryValue || getSelectCategoryValue;
29
35
  return {
30
- annotation: categoryConfig?.annotation,
31
- enableChartView: categoryConfig?.enableChartView,
36
+ annotation: selectCategoryConfig?.annotation,
37
+ enableChartView: selectCategoryConfig?.enableChartView,
32
38
  isDisabled: false,
33
- key: category.key,
34
- label: getCategoryLabel(category.key, categoryConfig),
35
- values: categoryValueViews.map(mapSelectCategoryValue),
39
+ key: selectCategory.key,
40
+ label: getCategoryLabel(selectCategory.key, selectCategoryConfig),
41
+ values: selectCategoryValueViews.map(mapSelectCategoryValue),
36
42
  };
37
43
  }
38
44
  /**
@@ -52,7 +58,11 @@ export function buildCategoryViews(categories, categoryConfigs, filterState) {
52
58
  const views = acceptListCategories.map((category) => {
53
59
  // Get the set of selected values for this category, if any.
54
60
  const categorySelectedFilter = getCategorySelectedFilter(category.key, filterState);
55
- // Build view models for each category value in this category and sort alpha.
61
+ // Build view model for range categories.
62
+ if (isRangeCategory(category)) {
63
+ return buildRangeCategoryView(category, categoryConfigs, categorySelectedFilter);
64
+ }
65
+ // Build view model for single or multiselect categories.
56
66
  const categoryValueViews = category.values.map((categoryValue) => buildCategoryValueView(categoryValue, categorySelectedFilter));
57
67
  categoryValueViews.sort(sortCategoryValueViews);
58
68
  // Build category view model.
@@ -68,9 +78,10 @@ export function buildCategoryViews(categories, categoryConfigs, filterState) {
68
78
  * @param categoryKey - Key of category that has been de/selected.
69
79
  * @param selectedValue - Key of category value that has been de/selected
70
80
  * @param selected - True if value is selected, false if de-selected.
81
+ * @param viewKind - View kind.
71
82
  * @returns New filter state generated from the current set of selected values and the newly selected value.
72
83
  */
73
- export function buildNextFilterState(filterState, categoryKey, selectedValue, selected) {
84
+ export function buildNextFilterState(filterState, categoryKey, selectedValue, selected, viewKind) {
74
85
  // Check if the selected category already has selected values.
75
86
  const categorySelectedFilter = getCategorySelectedFilter(categoryKey, filterState);
76
87
  // Create a copy of the current filter state. Remove the selected filter for the selected category, if any.
@@ -80,13 +91,14 @@ export function buildNextFilterState(filterState, categoryKey, selectedValue, se
80
91
  categoryKey,
81
92
  value: categorySelectedFilter ? [...categorySelectedFilter.value] : [],
82
93
  };
83
- // Handle case where category value is selected.
84
- if (selected) {
85
- nextCategorySelectedFilter.value.push(selectedValue);
94
+ // Build next filter state for category.
95
+ if (viewKind === VIEW_KIND.RANGE) {
96
+ // Handle range category.
97
+ buildNextRangeFilterState(nextCategorySelectedFilter, selectedValue, selected);
86
98
  }
87
- // Otherwise, category value has been de-selected; remove the selected value from the selected set of values.
88
99
  else {
89
- nextCategorySelectedFilter.value = nextCategorySelectedFilter.value.filter((value) => value !== selectedValue);
100
+ // Handle select category.
101
+ buildNextSelectFilterState(nextCategorySelectedFilter, selectedValue, selected);
90
102
  }
91
103
  // Add the new selected filter for this category to the set of selected filters, if there are selected values for it.
92
104
  if (nextCategorySelectedFilter.value.length) {
@@ -123,15 +135,6 @@ function getCategoryLabel(key, categoryConfig) {
123
135
  export function getSelectCategoryValue(selectCategoryValue) {
124
136
  return selectCategoryValue;
125
137
  }
126
- /**
127
- * Returns the category config for the given category config key.
128
- * @param key - Category config key.
129
- * @param categoryConfigs - Category configs.
130
- * @returns category config.
131
- */
132
- function findCategoryConfig(key, categoryConfigs) {
133
- return categoryConfigs.find((categoryConfig) => categoryConfig.key === key);
134
- }
135
138
  /**
136
139
  * Determine if given category value is selected.
137
140
  * @param categoryValueKey - The key of the category value to check if selected in the filter state.
@@ -1,7 +1,9 @@
1
1
  import { ColumnSort, GroupingState, RowSelectionState, VisibilityState } from "@tanstack/react-table";
2
- import { CategoryValueKey, SelectCategory, SelectCategoryView, SelectedFilter } from "../../common/entities";
2
+ import { CategoryConfig } from "../../common/categories/config/types";
3
+ import { CategoryView } from "../../common/categories/views/types";
4
+ import { CategoryValueKey, SelectCategory, SelectedFilter } from "../../common/entities";
3
5
  import { RowPreviewState } from "../../components/Table/features/RowPreview/entities";
4
- import { CategoryConfig, CategoryGroup, CategoryGroupConfig, EntityPath, SavedFilter } from "../../config/entities";
6
+ import { CategoryGroup, CategoryGroupConfig, EntityPath, SavedFilter } from "../../config/entities";
5
7
  export interface EntityPageState {
6
8
  categoryGroupConfigKey: CategoryGroupConfigKey;
7
9
  columnVisibility: VisibilityState;
@@ -17,7 +19,7 @@ export interface EntityPageStateMapper {
17
19
  export interface EntityState {
18
20
  categoryConfigs?: CategoryConfig[];
19
21
  categoryGroups?: CategoryGroup[];
20
- categoryViews: SelectCategoryView[];
22
+ categoryViews: CategoryView[];
21
23
  filterState: SelectedFilter[];
22
24
  savedFilterByCategoryValueKey?: SavedFilterByCategoryValueKey;
23
25
  savedFilterState: SelectedFilter[];
@@ -1,5 +1,7 @@
1
1
  import { ColumnSort, GroupingState, RowSelectionState } from "@tanstack/react-table";
2
- import { CategoryKey, CategoryValueKey, PaginationDirectionType, SelectCategory, SelectedFilter } from "../../../common/entities";
2
+ import { Category } from "../../../common/categories/models/types";
3
+ import { VIEW_KIND } from "../../../common/categories/views/types";
4
+ import { CategoryKey, CategoryValueKey, PaginationDirectionType, SelectedFilter } from "../../../common/entities";
3
5
  import { RowPreviewState } from "../../../components/Table/features/RowPreview/entities";
4
6
  import { ListItems, PaginationResponse } from "../../exploreState";
5
7
  import { ListItem } from "../entities";
@@ -10,6 +12,7 @@ export interface ApplySavedFilterPayload {
10
12
  categoryKey: CategoryKey;
11
13
  selected: boolean;
12
14
  selectedValue: CategoryValueKey;
15
+ viewKind?: VIEW_KIND;
13
16
  }
14
17
  /**
15
18
  * Paginate table payload.
@@ -29,7 +32,7 @@ export interface ProcessExploreResponsePayload {
29
32
  listItems: ListItems;
30
33
  loading: boolean;
31
34
  paginationResponse: PaginationResponse;
32
- selectCategories?: SelectCategory[];
35
+ selectCategories?: Category[];
33
36
  }
34
37
  /**
35
38
  * Reset explore response payload.
@@ -57,6 +60,7 @@ export interface UpdateFilterPayload {
57
60
  categoryKey: CategoryKey;
58
61
  selected: boolean;
59
62
  selectedValue: CategoryValueKey;
63
+ viewKind?: VIEW_KIND;
60
64
  }
61
65
  /**
62
66
  * Update row preview payload.
@@ -1,6 +1,7 @@
1
1
  import React, { Dispatch, ReactNode } from "react";
2
2
  import { AzulSearchIndex } from "../apis/azul/common/entities";
3
- import { SelectCategoryView, SelectedFilter } from "../common/entities";
3
+ import { CategoryView } from "../common/categories/views/types";
4
+ import { SelectedFilter } from "../common/entities";
4
5
  import { RowPreviewState } from "../components/Table/features/RowPreview/entities";
5
6
  import { CategoryGroup, SiteConfig } from "../config/entities";
6
7
  import { UpdateGroupingAction } from "./exploreState/actions/updateGrouping/types";
@@ -21,7 +22,7 @@ export interface ExploreContext {
21
22
  export type ExploreState = {
22
23
  catalogState: CatalogState;
23
24
  categoryGroups?: CategoryGroup[];
24
- categoryViews: SelectCategoryView[];
25
+ categoryViews: CategoryView[];
25
26
  entityPageState: EntityPageStateMapper;
26
27
  entityStateByCategoryGroupConfigKey: EntityStateByCategoryGroupConfigKey;
27
28
  featureFlagState: FeatureFlagState;
@@ -277,7 +277,7 @@ function exploreReducer(state, action, exploreContext) {
277
277
  * Update filter
278
278
  **/
279
279
  case ExploreActionKind.UpdateFilter: {
280
- const filterState = buildNextFilterState(state.filterState, payload.categoryKey, payload.selectedValue, payload.selected);
280
+ const filterState = buildNextFilterState(state.filterState, payload.categoryKey, payload.selectedValue, payload.selected, payload.viewKind);
281
281
  const rowPreview = closeRowPreview(state.rowPreview);
282
282
  const rowSelection = {};
283
283
  const savedFilterState = []; // Clear saved filter state.
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Retrieves a button by its name.
3
+ * @param name - The name of the button.
4
+ * @returns The button element.
5
+ */
6
+ export declare function getButton<T extends HTMLElement = HTMLElement>(name: string | RegExp): T;
7
+ /**
8
+ * Retrieves an input element by its label text.
9
+ * @param text - The label text of the input element.
10
+ * @returns The input element.
11
+ */
12
+ export declare function getLabelText<T extends HTMLElement = HTMLElement>(text: string): T;
13
+ /**
14
+ * Returns regex that matches the start of the given text.
15
+ * @param text - Text to match.
16
+ * @returns RegExp.
17
+ */
18
+ export declare function getStartsWithRegex(text: string): RegExp;
19
+ /**
20
+ * Retrieves an element by its text content.
21
+ * @param text - The text content of the element.
22
+ * @returns The element.
23
+ */
24
+ export declare function getText<T extends HTMLElement = HTMLElement>(text: string | RegExp): T;
@@ -0,0 +1,34 @@
1
+ import { screen } from "@testing-library/react";
2
+ import { escapeRegExp } from "../common/utils";
3
+ /**
4
+ * Retrieves a button by its name.
5
+ * @param name - The name of the button.
6
+ * @returns The button element.
7
+ */
8
+ export function getButton(name) {
9
+ return screen.getByRole("button", { name });
10
+ }
11
+ /**
12
+ * Retrieves an input element by its label text.
13
+ * @param text - The label text of the input element.
14
+ * @returns The input element.
15
+ */
16
+ export function getLabelText(text) {
17
+ return screen.getByLabelText(text);
18
+ }
19
+ /**
20
+ * Returns regex that matches the start of the given text.
21
+ * @param text - Text to match.
22
+ * @returns RegExp.
23
+ */
24
+ export function getStartsWithRegex(text) {
25
+ return new RegExp(`^${escapeRegExp(text)}`);
26
+ }
27
+ /**
28
+ * Retrieves an element by its text content.
29
+ * @param text - The text content of the element.
30
+ * @returns The element.
31
+ */
32
+ export function getText(text) {
33
+ return screen.getByText(text);
34
+ }
@@ -388,6 +388,14 @@ export const MuiChip = (theme) => {
388
388
  },
389
389
  label: {
390
390
  ...theme.typography[TEXT_BODY_SMALL_400],
391
+ variants: [
392
+ {
393
+ props: { variant: "status" },
394
+ style: {
395
+ ...theme.typography[TEXT_BODY_SMALL_500],
396
+ },
397
+ },
398
+ ],
391
399
  },
392
400
  },
393
401
  variants: [
@@ -467,13 +475,18 @@ export const MuiChip = (theme) => {
467
475
  {
468
476
  props: { variant: "status" },
469
477
  style: {
470
- ...theme.typography[TEXT_BODY_SMALL_500],
471
478
  boxShadow: `0 0 0 2px ${PALETTE.COMMON_WHITE}`,
472
479
  height: 20,
473
480
  maxWidth: "fit-content",
474
481
  minWidth: 0,
475
482
  },
476
483
  },
484
+ {
485
+ props: { color: "default", variant: "status" },
486
+ style: {
487
+ color: PALETTE.INK_LIGHT,
488
+ },
489
+ },
477
490
  ],
478
491
  };
479
492
  };
@@ -858,6 +871,11 @@ export const MuiLink = {
858
871
  textDecorationSkipInk: "none",
859
872
  textUnderlinePosition: "from-font",
860
873
  },
874
+ underlineNone: {
875
+ "&:hover": {
876
+ textDecoration: "none",
877
+ },
878
+ },
861
879
  },
862
880
  };
863
881
  /**