Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: performant-software/react-components
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.2.15
Choose a base ref
...
head repository: performant-software/react-components
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 6,317 additions and 255 deletions.
  1. +4 −0 .github/workflows/storybook.yml
  2. +4 −4 README.md
  3. +3 −2 package.json
  4. +3 −3 packages/controlled-vocabulary/package.json
  5. +1 −2 packages/controlled-vocabulary/src/components/ReferenceCodeModal.js
  6. +2 −2 packages/controlled-vocabulary/src/components/ReferenceTableModal.js
  7. +4 −3 packages/core-data/package.json
  8. +128 −0 packages/core-data/src/components/AccordionItemsList.js
  9. +60 −0 packages/core-data/src/components/Button.js
  10. +24 −0 packages/core-data/src/components/ButtonGroup.js
  11. +61 −0 packages/core-data/src/components/Checkbox.js
  12. +179 −0 packages/core-data/src/components/Combobox.js
  13. +7 −0 packages/core-data/src/components/FacetListsGrouped.js
  14. +41 −5 packages/core-data/src/components/FacetStateContextProvider.js
  15. +18 −5 packages/core-data/src/components/FacetTimeline.js
  16. +35 −0 packages/core-data/src/components/HeaderImage.js
  17. +69 −0 packages/core-data/src/components/HitsPerPage.js
  18. +137 −0 packages/core-data/src/components/Icon.js
  19. +103 −0 packages/core-data/src/components/Input.js
  20. +39 −0 packages/core-data/src/components/KeyValueList.js
  21. +11 −2 packages/core-data/src/components/LayerMenu.js
  22. +140 −0 packages/core-data/src/components/Pagination.js
  23. +9 −3 packages/core-data/src/components/PersistentSearchStateContextProvider.js
  24. +68 −0 packages/core-data/src/components/Pill.js
  25. +15 −44 packages/core-data/src/components/PlaceDetails.js
  26. +59 −0 packages/core-data/src/components/RecordDetailBreadcrumbs.js
  27. +137 −0 packages/core-data/src/components/RecordDetailHeader.js
  28. +43 −0 packages/core-data/src/components/RecordDetailItem.js
  29. +118 −0 packages/core-data/src/components/RecordDetailPanel.js
  30. +42 −0 packages/core-data/src/components/RecordDetailTitle.js
  31. +3 −1 packages/core-data/src/components/RelatedItem.js
  32. +0 −1 packages/core-data/src/components/RelatedPeople.js
  33. +130 −0 packages/core-data/src/components/SearchList.js
  34. +118 −0 packages/core-data/src/components/SearchListItem.js
  35. +13 −14 packages/core-data/src/components/SearchResultsLayer.js
  36. +149 −0 packages/core-data/src/components/SearchResultsTable.js
  37. +103 −0 packages/core-data/src/components/SelectRecordPanel.js
  38. +312 −0 packages/core-data/src/components/Slider.js
  39. +11 −0 packages/core-data/src/hooks/CoreData.js
  40. +36 −9 packages/core-data/src/hooks/ProgressiveSearch.js
  41. +5 −0 packages/core-data/src/hooks/Typesense.js
  42. +36 −0 packages/core-data/src/i18n/en.json
  43. +26 −0 packages/core-data/src/i18n/i18n.js
  44. +11 −0 packages/core-data/src/icons/BulletIcon.js
  45. +11 −0 packages/core-data/src/icons/Checkbox.js
  46. +11 −0 packages/core-data/src/icons/CheckboxFilled.js
  47. +11 −0 packages/core-data/src/icons/CloseIcon.js
  48. +11 −0 packages/core-data/src/icons/DateIcon.js
  49. +11 −0 packages/core-data/src/icons/DownIcon.js
  50. +11 −0 packages/core-data/src/icons/ExportIcon.js
  51. +11 −0 packages/core-data/src/icons/FiltersIcon.js
  52. +11 −0 packages/core-data/src/icons/GenderIcon.js
  53. +11 −0 packages/core-data/src/icons/InfoIcon.js
  54. +11 −0 packages/core-data/src/icons/LeftArrowIcon.js
  55. +11 −0 packages/core-data/src/icons/LeftIcon.js
  56. +11 −0 packages/core-data/src/icons/ListIcon.js
  57. +11 −0 packages/core-data/src/icons/LocationIcon.js
  58. +11 −0 packages/core-data/src/icons/OccupationIcon.js
  59. +11 −0 packages/core-data/src/icons/ParticipantsIcon.js
  60. +11 −0 packages/core-data/src/icons/PersonIcon.js
  61. +11 −0 packages/core-data/src/icons/ResetIcon.js
  62. +11 −0 packages/core-data/src/icons/RightIcon.js
  63. +11 −0 packages/core-data/src/icons/SearchIcon.js
  64. +11 −0 packages/core-data/src/icons/TableIcon.js
  65. +12 −0 packages/core-data/src/icons/TimelineIcon.js
  66. +11 −0 packages/core-data/src/icons/ZoomInIcon.js
  67. +11 −0 packages/core-data/src/icons/ZoomOutIcon.js
  68. +12 −1 packages/core-data/src/index.css
  69. +21 −1 packages/core-data/src/index.js
  70. +19 −0 packages/core-data/src/services/Organizations.js
  71. +42 −0 packages/core-data/src/styles/AccordionItemsList.css
  72. +3 −0 packages/core-data/src/styles/Combobox.css
  73. +18 −0 packages/core-data/src/types/RelatedRecord.js
  74. +35 −0 packages/core-data/src/types/RelatedRecordsList.js
  75. +2 −1 packages/core-data/src/types/RuntimeConfig.js
  76. +8 −0 packages/core-data/src/types/SearchList.js
  77. +2 −1 packages/core-data/src/utils/Peripleo.js
  78. +78 −40 packages/core-data/src/utils/Typesense.js
  79. +12 −10 packages/core-data/tailwind.config.js
  80. +2 −2 packages/geospatial/package.json
  81. +3 −0 packages/geospatial/src/components/GeocodingControl.css
  82. +1 −0 packages/geospatial/src/components/GeocodingControl.js
  83. +6 −3 packages/geospatial/src/components/MapDraw.js
  84. +2 −2 packages/semantic-ui/package.json
  85. +9 −0 packages/semantic-ui/src/components/DatetimeLocalInput.css
  86. +44 −0 packages/semantic-ui/src/components/DatetimeLocalInput.js
  87. +12 −0 packages/semantic-ui/src/components/Facet.js
  88. +4 −0 packages/semantic-ui/src/components/FacetList.css
  89. +32 −13 packages/semantic-ui/src/components/FacetList.js
  90. +4 −0 packages/semantic-ui/src/components/FacetSlider.css
  91. +78 −21 packages/semantic-ui/src/components/FacetSlider.js
  92. +2 −1 packages/semantic-ui/src/components/LazyAudio.js
  93. +3 −2 packages/semantic-ui/src/components/LazyImage.js
  94. +13 −5 packages/semantic-ui/src/components/LazyMedia.js
  95. +2 −1 packages/semantic-ui/src/components/LazyVideo.js
  96. +3 −0 packages/semantic-ui/src/i18n/en.json
  97. +1 −0 packages/semantic-ui/src/index.js
  98. +1 −1 packages/shared/package.json
  99. +1 −0 packages/shared/src/index.js
  100. +1 −1 packages/shared/src/transforms/NestedAttributesTransform.js
  101. +33 −7 packages/shared/src/utils/Object.js
  102. +16 −0 packages/shared/src/utils/UserDefinedFields.js
  103. +26 −0 packages/shared/test/utils/Object.spec.js
  104. +1 −0 packages/storybook/.storybook/main.js
  105. +13 −0 packages/storybook/.storybook/preview.js
  106. +1 −0 packages/storybook/package.json
  107. +145 −0 packages/storybook/src/core-data/AccordionItemsList.stories.js
  108. +79 −0 packages/storybook/src/core-data/Button.stories.js
  109. +66 −0 packages/storybook/src/core-data/ButtonGroup.stories.js
  110. +68 −0 packages/storybook/src/core-data/Checkbox.stories.js
  111. +81 −0 packages/storybook/src/core-data/Combobox.stories.js
  112. +0 −1 packages/storybook/src/core-data/FacetSlider.stories.js
  113. +16 −12 packages/storybook/src/core-data/FacetTimeline.stories.js
  114. +16 −0 packages/storybook/src/core-data/HeaderImage.stories.js
  115. +173 −0 packages/storybook/src/core-data/Icon.stories.js
  116. +64 −0 packages/storybook/src/core-data/Input.stories.js
  117. +21 −0 packages/storybook/src/core-data/KeyValueList.stories.js
  118. +47 −0 packages/storybook/src/core-data/Pill.stories.js
  119. +29 −0 packages/storybook/src/core-data/RecordDetailBreadcrumbs.stories.js
  120. +107 −0 packages/storybook/src/core-data/RecordDetailHeader.stories.js
  121. +16 −0 packages/storybook/src/core-data/RecordDetailItem.stories.js
  122. +299 −0 packages/storybook/src/core-data/RecordDetailPanel.stories.js
  123. +29 −0 packages/storybook/src/core-data/RecordDetailTitle.stories.js
  124. +0 −1 packages/storybook/src/core-data/RelatedMedia.stories.js
  125. +259 −0 packages/storybook/src/core-data/SearchList.stories.js
  126. +93 −0 packages/storybook/src/core-data/SearchResultsTable.stories.js
  127. +45 −0 packages/storybook/src/core-data/SelectRecordPanel.stories.js
  128. +116 −0 packages/storybook/src/core-data/Slider.stories.js
  129. +74 −1 packages/storybook/src/semantic-ui/FacetList.stories.js
  130. +15 −0 packages/storybook/src/semantic-ui/FacetSlider.stories.js
  131. +16 −0 packages/storybook/src/utils/Array.js
  132. +25 −1 packages/storybook/src/utils/Environment.js
  133. +3 −3 packages/user-defined-fields/package.json
  134. +3 −10 packages/user-defined-fields/src/constants/DataTypes.js
  135. +1 −1 packages/visualize/package.json
  136. +1 −1 react-components.json
  137. +1,073 −11 yarn.lock
4 changes: 4 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -14,6 +14,10 @@ jobs:
with:
persist-credentials: false
- name: Install and Build 🔧
env:
VITE_TYPESENSE_COLLECTION: ${{ secrets.VITE_TYPESENSE_COLLECTION }}
VITE_TYPESENSE_URL: ${{ secrets.VITE_TYPESENSE_URL }}
VITE_TYPESENSE_SEARCH_KEY: ${{ secrets.VITE_TYPESENSE_SEARCH_KEY }}
run: | # Install npm packages and build the Storybook files
yarn install
yarn build-storybook
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -79,10 +79,10 @@ After all testing has passed, create your release of `0.5.16`. See publishing be

Each of the versions of the individual packages will be kept in sync. The following steps should be taken when publishing a new version of these packages.

1. Commit your changes and create a PR into the `master` branch. Wait until your PR is merged to proceed.
2. Create a [release](https://github.com/performant-software/react-components/releases) in GitHub. Be sure to note any breaking changes, new features, and bug fixes
3. Update the version in `react-components.json`. See Semantic Versioning Guide below to determine the new version.
4. From the project root, run `yarn publish-production`.
1. Update the version in `react-components.json`. See Semantic Versioning Guide below to determine the new version.
2. From the project root, run `yarn publish-release`.
3. Commit your changes and create a PR into the `master` branch. Wait until your PR is merged to proceed.
4. Create a [release](https://github.com/performant-software/react-components/releases) in GitHub. Be sure to note any breaking changes, new features, and bug fixes
5. In GitHub update the "next release" label to "<your_release_number>". This will allow us to go back and see exactly which PRs were included in each release.
6. Create a new "next release" label in GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -16,8 +16,9 @@
"publish-beta": "node --experimental-json-modules ./scripts/publish.js --tag beta"
},
"devDependencies": {
"@babel/core": "^7.17.9",
"babel-jest": "^27.5.1",
"@babel/core": "^7.25.7",
"@babel/preset-env": "^7.25.7",
"babel-jest": "^29.7.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"eslint": "^7.1.0",
"eslint-config-airbnb": "^18.1.0",
6 changes: 3 additions & 3 deletions packages/controlled-vocabulary/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@performant-software/controlled-vocabulary",
"version": "2.2.15",
"version": "2.3.3",
"description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.",
"license": "MIT",
"main": "./dist/index.cjs.js",
@@ -23,8 +23,8 @@
"underscore": "^1.13.2"
},
"peerDependencies": {
"@performant-software/semantic-components": "^2.2.15",
"@performant-software/shared-components": "^2.2.15",
"@performant-software/semantic-components": "^2.3.3",
"@performant-software/shared-components": "^2.3.3",
"react": ">= 16.13.1 < 19.0.0",
"react-dom": ">= 16.13.1 < 19.0.0"
},
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @flow

import { ModalContext } from '@performant-software/semantic-components';
import type { EditContainerProps } from '@performant-software/shared-components';
import { ModalContext, type EditContainerProps } from '@performant-software/shared-components';
import React from 'react';
import { Form, Modal } from 'semantic-ui-react';
import i18n from '../i18n/i18n';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import { EmbeddedList, ModalContext } from '@performant-software/semantic-components';
import type { EditContainerProps } from '@performant-software/shared-components';
import { EmbeddedList } from '@performant-software/semantic-components';
import { ModalContext, type EditContainerProps } from '@performant-software/shared-components';
import React from 'react';
import { Form, Header, Modal } from 'semantic-ui-react';
import i18n from '../i18n/i18n';
7 changes: 4 additions & 3 deletions packages/core-data/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@performant-software/core-data",
"version": "2.2.15",
"version": "2.3.3",
"description": "A package of components used with the Core Data platform.",
"license": "MIT",
"main": "./dist/index.cjs.js",
@@ -31,6 +31,7 @@
"@turf/turf": "^6.5.0",
"clsx": "^2.1.0",
"dequal": "^2.0.3",
"i18next": "^19.4.4",
"instantsearch.js": "^4.66.0",
"lucide-react": "^0.321.0",
"postcss-import": "^16.1.0",
@@ -40,8 +41,8 @@
"underscore": "^1.13.2"
},
"peerDependencies": {
"@performant-software/geospatial": "^2.2.15",
"@performant-software/shared-components": "^2.2.15",
"@performant-software/geospatial": "^2.3.3",
"@performant-software/shared-components": "^2.3.3",
"@peripleo/maplibre": "^0.5.2",
"@peripleo/peripleo": "^0.5.2",
"react": ">= 16.13.1 < 19.0.0",
128 changes: 128 additions & 0 deletions packages/core-data/src/components/AccordionItemsList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// @flow

import * as Accordion from '@radix-ui/react-accordion';
import clsx from 'clsx';
import React from 'react';
import _ from 'underscore';
import Icon from './Icon';
import type { RelatedRecordsList } from '../types/RelatedRecordsList';

type Props = {
/**
* Optional list of classes to be applied to the root element
*/
className?: string,

/**
* If true, will display the number of items in each section after the title
*/
count?: Boolean,

/**
* List of related models to render
*/
items: Array<RelatedRecordsList>
};

/**
* This component renders the passed list of related items in an accordion fashion.
*/
const AccordionItemsList = (props: Props) => (
<Accordion.Root
className={clsx(
'accordion-items-list',
props.className
)}
type='multiple'
>
{ _.map(props.items, (relation, idx) => (
<Accordion.Item key={idx} value={relation.title}>
<Accordion.Header
asChild
>
<h2>
<Accordion.Trigger
className='accordion-list-trigger border-neutral-100 border border-t border-b-0 border-l-0 border-r-0 border-solid rounded-none w-full flex justify-between items-center p-4 text-[15px] font-bold leading-[120%]'
>
{
relation.renderTitle ? (
relation.renderTitle(relation.title, relation.count)
) : (
<span>
{ relation.title }
{ props.count ? (
<span className='ml-2'>
(
{ relation.items.length }
)
</span>
) : null }
</span>
)
}
<Icon
className='accordion-list-chevron'
name='right'
size={18}
/>
</Accordion.Trigger>
</h2>
</Accordion.Header>
<Accordion.Content className='accordion-list-content text-[13px] font-semibold leading-[120%]'>
<ul className={clsx(
{ flex: relation.horizontal },
{ 'flex-row': relation.horizontal },
{ 'flex-wrap': relation.horizontal },
{ 'gap-6': relation.horizontal },
{ 'py-6': relation.horizontal }
)}
>
{
_.map(relation.items, (item, idxx) => (
<>
{
relation.renderItem ? (
relation.renderItem(item)
) : (
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
<li
key={idxx}
onClick={item.onClick}
onKeyDown={item.onClick}
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
tabIndex={item.onClick ? '0' : '-1'}
className={
clsx(
'flex flex-row gap-2 items-baseline px-6 py-2',
{
'hover:bg-neutral-100': item.onClick,
'cursor-pointer': item.onClick
}
)
}
>
{
relation.icon && (
<Icon
name={relation.icon}
size={14}
/>
)
}
<span>
{ item.name }
</span>
</li>
)
}
</>
))
}
</ul>
</Accordion.Content>
</Accordion.Item>
))}
</Accordion.Root>
);

export default AccordionItemsList;
60 changes: 60 additions & 0 deletions packages/core-data/src/components/Button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// @flow

import clsx from 'clsx';
import React from 'react';

type Props = {
/**
* Class name to apply to the root button element.
*/
className?: string,

/**
* Child elements to append to the button.
*/
children: Node,

/**
* If `true`, the button will be assumed to contain a single icon.
*/
icon?: boolean,

/**
* If `true`, the button will display with the primary background color.
*/
primary?: boolean,

/**
* If `true`, the button will display with rounded corners.
*/
rounded?: boolean,

/**
* If `true`, the button will display with the secondary background color.
*/
secondary?: boolean
};

const Button = (props: Props) => (
<button
{...props}
className={clsx(
'flex',
'items-center',
'gap-2',
'py-2',
{ 'px-4': !props.icon },
{ 'rounded-full px-2': props.icon },
{ 'bg-secondary': props.secondary },
{ 'border border-solid border-gray-200': !props.primary },
{ 'bg-primary hover:bg-primary hover:saturate-50 text-white fill-white': props.primary },
{ 'rounded-md': props.rounded },
props.className
)}
type='button'
>
{ props.children }
</button>
);

export default Button;
24 changes: 24 additions & 0 deletions packages/core-data/src/components/ButtonGroup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// @flow

import clsx from 'clsx';
import React from 'react';

type Props = {
children: Node,
className?: string,
rounded?: boolean
};

const ButtonGroup = (props: Props) => (
<div
className={clsx(
'inline-flex',
{ '[&>:first-child]:rounded-s-md [&>:last-child]:rounded-e-md': props.rounded },
props.className
)}
>
{ props.children }
</div>
);

export default ButtonGroup;
61 changes: 61 additions & 0 deletions packages/core-data/src/components/Checkbox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// @flow

import React from 'react';
import * as RadixCheckbox from '@radix-ui/react-checkbox';
import clsx from 'clsx';
import Icon from './Icon';

type Props = {
/**
* Label to show in the aria-label property for screen readers.
*/
ariaLabel: string,
/**
* (Optional) Tailwind classes for the root button component.
*/
className?: string,
/**
* Boolean state of the checkbox.
*/
checked: boolean,
/**
* (Optional) Whether to disable the checkbox.
*/
disabled?: boolean,
/**
* HTML ID to apply to the checkbox
*/
id?: string,
/**
* Callback that determines what to do when the checkbox is clicked.
* @param {boolean} arg
* @returns
*/
onClick: (arg: boolean) => any
}

const Checkbox = (props: Props) => (
<RadixCheckbox.Root
aria-label={props.ariaLabel}
checked={props.checked}
className={clsx(
'rounded-sm hover:bg-transparent',
props.className,
)}
disabled={props.disabled}
id={props.id}
onCheckedChange={props.onClick}
>
<RadixCheckbox.Indicator asChild forceMount>
<Icon
className={clsx(
{ 'fill-primary': props.checked },
{ 'fill-black': !props.checked },
)}
name={props.checked ? 'checkbox_filled' : 'checkbox'}
/>
</RadixCheckbox.Indicator>
</RadixCheckbox.Root>
);

export default Checkbox;
Loading