@procore/core-react 12.24.0 → 12.25.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/CHANGELOG.md +12 -0
- package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
- package/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/AvatarStack/AvatarStack.styles.js +7 -7
- package/dist/Badge/Badge.styles.js +2 -2
- package/dist/BadgePill/BadgePill.styles.js +4 -4
- package/dist/Banner/Banner.styles.js +10 -10
- package/dist/Box/Box.styles.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
- package/dist/Button/Button.styles.js +5 -5
- package/dist/Calendar/Calendar.styles.js +8 -8
- package/dist/Card/Card.styles.js +1 -1
- package/dist/Checkbox/Checkbox.styles.js +6 -6
- package/dist/Checkbox/CheckboxTooltip.js +1 -1
- package/dist/ContactItem/ContactItem.styles.js +5 -5
- package/dist/Content/Content.styles.js +2 -2
- package/dist/DateInput/DateInput.styles.js +6 -6
- package/dist/DetailPage/DetailPage.styles.js +7 -7
- package/dist/Dropdown/Dropdown.styles.js +3 -3
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
- package/dist/Dropzone/Dropzone.js +1 -1
- package/dist/Dropzone/Dropzone.styles.js +9 -9
- package/dist/EmptyState/EmptyState.styles.js +6 -6
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.styles.js +4 -4
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
- package/dist/FileSelect/FileSelect.styles.js +2 -2
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
- package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
- package/dist/FileToken/FileToken.styles.js +4 -4
- package/dist/FilterToken/FilterToken.styles.js +5 -5
- package/dist/FlexList/FlexList.styles.js +1 -1
- package/dist/Form/Form.styles.js +14 -14
- package/dist/Form/StyledFormikForm.styles.js +2 -2
- package/dist/Form/stories/util.js +3 -0
- package/dist/Form/stories/util.js.map +1 -1
- package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
- package/dist/Grid/Grid.styles.js +2 -2
- package/dist/GroupSelect/GroupSelect.styles.js +1 -1
- package/dist/Input/Input.styles.js +1 -1
- package/dist/Link/Link.styles.js +1 -1
- package/dist/ListPage/ListPage.styles.js +8 -8
- package/dist/Loader/Loader.styles.js +2 -2
- package/dist/MenuImperative/MenuImperative.styles.js +10 -10
- package/dist/Modal/Modal.js +1 -0
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/Modal/Modal.styles.js +13 -13
- package/dist/Modal/storyHelpers.d.ts +1 -0
- package/dist/Modal/storyHelpers.js +160 -85
- package/dist/Modal/storyHelpers.js.map +1 -1
- package/dist/MultiSelect/MultiSelect.styles.js +6 -6
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/NextTile/NextTile.js +29 -4
- package/dist/NextTile/NextTile.js.map +1 -1
- package/dist/NextTile/NextTile.types.d.ts +15 -0
- package/dist/NextTile/NextTile.types.js.map +1 -1
- package/dist/NextTile/index.d.ts +2 -0
- package/dist/NextTile/index.js +2 -0
- package/dist/NextTile/index.js.map +1 -0
- package/dist/Notation/Notation.js +1 -1
- package/dist/NumberInput/NumberInput.styles.js +7 -7
- package/dist/Overlay/OverlayArrow.styles.js +1 -1
- package/dist/PageLayout/PageLayout.styles.js +16 -16
- package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
- package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
- package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
- package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
- package/dist/Pagination/Pagination.styles.js +5 -5
- package/dist/Pagination/PaginationSelect.js +1 -0
- package/dist/Pagination/PaginationSelect.js.map +1 -1
- package/dist/Panel/Panel.styles.js +11 -11
- package/dist/Pill/Pill.styles.js +2 -2
- package/dist/PillSelect/PillSelect.styles.js +4 -4
- package/dist/Popover/Popover.styles.js +2 -2
- package/dist/Portal/Portal.styles.js +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +2 -2
- package/dist/RadioButton/RadioButton.styles.js +3 -3
- package/dist/Required/Required.styles.js +3 -3
- package/dist/Search/Search.styles.js +5 -5
- package/dist/Section/Section.styles.js +7 -7
- package/dist/SegmentedController/SegmentedController.d.ts +5 -0
- package/dist/SegmentedController/SegmentedController.js +49 -30
- package/dist/SegmentedController/SegmentedController.js.map +1 -1
- package/dist/SegmentedController/SegmentedController.styles.js +4 -4
- package/dist/Select/Select.styles.js +7 -7
- package/dist/Semantic/Semantic.styles.js +9 -9
- package/dist/Slider/Slider.styles.js +5 -5
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.js +37 -37
- package/dist/Switch/Switch.styles.js +4 -4
- package/dist/Table/Table.styles.js +28 -28
- package/dist/TableShelf/TableShelf.styles.js +5 -5
- package/dist/Tabs/Tabs.styles.js +15 -15
- package/dist/Tearsheet/Tearsheet.styles.js +5 -5
- package/dist/TextArea/TextArea.styles.js +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/Tile/Tile.styles.d.ts +1 -0
- package/dist/Tile/Tile.styles.js +19 -12
- package/dist/Tile/Tile.styles.js.map +1 -1
- package/dist/Tile/index.d.ts +1 -1
- package/dist/Tile/index.js.map +1 -1
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Toast/Toast.styles.js +3 -3
- package/dist/ToggleButton/ToggleButton.styles.js +1 -1
- package/dist/Token/Token.styles.js +3 -3
- package/dist/ToolHeader/ToolHeader.styles.js +6 -6
- package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
- package/dist/Tooltip/Tooltip.styles.js +2 -2
- package/dist/Tree/Tree.styles.js +9 -9
- package/dist/Typeahead/Typeahead.styles.js +3 -3
- package/dist/Typography/Typography.styles.js +1 -1
- package/dist/Typography/Typography.table.story.js +2 -2
- package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
- package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
- package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
- package/dist/_typedoc/Badge/Badge.types.json +6 -6
- package/dist/_typedoc/Banner/Banner.types.json +13 -13
- package/dist/_typedoc/Box/Box.types.json +68 -68
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +13 -13
- package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
- package/dist/_typedoc/Card/Card.types.json +6 -6
- package/dist/_typedoc/Checkbox/Checkbox.types.json +9 -9
- package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
- package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
- package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
- package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
- package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +30 -30
- package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
- package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
- package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
- package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
- package/dist/_typedoc/Flex/Flex.types.json +27 -27
- package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
- package/dist/_typedoc/Form/Form.types.json +741 -741
- package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
- package/dist/_typedoc/Grid/Grid.types.json +8 -8
- package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
- package/dist/_typedoc/Input/Input.types.json +2 -2
- package/dist/_typedoc/Link/Link.types.json +4 -4
- package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
- package/dist/_typedoc/Menu/Menu.types.json +62 -62
- package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
- package/dist/_typedoc/Modal/Modal.types.json +46 -46
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
- package/dist/_typedoc/NextTile/NextTile.types.json +363 -0
- package/dist/_typedoc/Notation/Notation.types.json +4 -4
- package/dist/_typedoc/NumberInput/NumberInput.types.json +37 -37
- package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +32 -32
- package/dist/_typedoc/PageLayout/PageLayout.types.json +29 -29
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +28 -28
- package/dist/_typedoc/Pill/Pill.types.json +2 -2
- package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
- package/dist/_typedoc/Popover/Popover.types.json +15 -15
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
- package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
- package/dist/_typedoc/Required/Required.types.json +5 -5
- package/dist/_typedoc/Search/Search.types.json +18 -18
- package/dist/_typedoc/Section/Section.types.json +15 -15
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
- package/dist/_typedoc/Select/Select.types.json +60 -60
- package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
- package/dist/_typedoc/Slider/Slider.types.json +6 -6
- package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
- package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +12 -12
- package/dist/_typedoc/Switch/Switch.types.json +3 -3
- package/dist/_typedoc/Table/Table.types.json +101 -101
- package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
- package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
- package/dist/_typedoc/TextEditor/TextEditor.types.json +9 -9
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
- package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
- package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
- package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
- package/dist/_typedoc/Tile/Tile.types.json +8 -263
- package/dist/_typedoc/Title/Title.types.json +1 -1
- package/dist/_typedoc/Toast/Toast.types.json +4 -4
- package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
- package/dist/_typedoc/Token/Token.types.json +4 -4
- package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
- package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
- package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
- package/dist/_typedoc/Tree/Tree.types.json +86 -86
- package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
- package/dist/_typedoc/Typography/Typography.types.json +9 -9
- package/dist/_typedoc/_utils/types.json +3 -3
- package/dist/_utils/propsTypedoc.d.ts +1 -0
- package/dist/_utils/propsTypedoc.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -17,7 +17,7 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
|
|
|
17
17
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
18
18
|
import { useCheckbox, useCheckboxGroupItem } from '@react-aria/checkbox';
|
|
19
19
|
import { useFocusRing } from '@react-aria/focus';
|
|
20
|
-
import { mergeProps } from '@react-aria/utils';
|
|
20
|
+
import { mergeProps, useId } from '@react-aria/utils';
|
|
21
21
|
import { VisuallyHidden } from '@react-aria/visually-hidden';
|
|
22
22
|
import React from 'react';
|
|
23
23
|
import { useToggleState } from 'react-stately';
|
|
@@ -116,6 +116,7 @@ export var LinkTile = /*#__PURE__*/React.forwardRef(function LinkTile(_ref6, ref
|
|
|
116
116
|
});
|
|
117
117
|
function noop() {}
|
|
118
118
|
var CheckboxTile_ = /*#__PURE__*/React.forwardRef(function CheckboxTile(_ref7, ref) {
|
|
119
|
+
var _props$role;
|
|
119
120
|
var _ref7$disabled = _ref7.disabled,
|
|
120
121
|
disabled = _ref7$disabled === void 0 ? false : _ref7$disabled,
|
|
121
122
|
checked = _ref7.checked,
|
|
@@ -147,21 +148,45 @@ var CheckboxTile_ = /*#__PURE__*/React.forwardRef(function CheckboxTile(_ref7, r
|
|
|
147
148
|
isFocusVisible = _useFocusRing.isFocusVisible;
|
|
148
149
|
var isDisabled = isGroup ? groupState.isDisabled || disabled : disabled;
|
|
149
150
|
var isSelected = isGroup ? groupState.isSelected(props.value) : state.isSelected;
|
|
151
|
+
var labelId = props['aria-labelledby'];
|
|
152
|
+
var fallbackId = useId();
|
|
150
153
|
return /*#__PURE__*/React.createElement(StyledSelectableTile, {
|
|
151
154
|
$disabled: isDisabled,
|
|
152
155
|
$selected: isSelected,
|
|
153
156
|
$focused: isFocusVisible,
|
|
154
157
|
$orientation: orientation,
|
|
155
|
-
|
|
158
|
+
$layoutless: true,
|
|
156
159
|
className: className,
|
|
157
160
|
style: style
|
|
161
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
162
|
+
role: (_props$role = props.role) !== null && _props$role !== void 0 ? _props$role : 'checkbox',
|
|
163
|
+
"aria-labelledby": labelId !== null && labelId !== void 0 ? labelId : fallbackId,
|
|
164
|
+
"aria-checked": isSelected,
|
|
165
|
+
"aria-disabled": isDisabled,
|
|
166
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
167
|
+
onClick: function onClick() {
|
|
168
|
+
if (!isDisabled) {
|
|
169
|
+
var _inputRef$current;
|
|
170
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.click();
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
onKeyDown: function onKeyDown(e) {
|
|
174
|
+
if (e.code === 'Space' || e.code === 'Enter') {
|
|
175
|
+
e.preventDefault();
|
|
176
|
+
if (!isDisabled) {
|
|
177
|
+
var _inputRef$current2;
|
|
178
|
+
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.click();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
158
182
|
}, /*#__PURE__*/React.createElement(VisuallyHidden, null, /*#__PURE__*/React.createElement("input", _extends({}, mergeProps(isGroup ? inputGroupItemProps : inputProps, focusProps), {
|
|
159
|
-
ref: mergeRefs(inputRef, ref)
|
|
183
|
+
ref: mergeRefs(inputRef, ref),
|
|
184
|
+
tabIndex: -1
|
|
160
185
|
}))), /*#__PURE__*/React.createElement(TileContext.Provider, {
|
|
161
186
|
value: {
|
|
162
187
|
orientation: orientation
|
|
163
188
|
}
|
|
164
|
-
}, props.children));
|
|
189
|
+
}, props.children)));
|
|
165
190
|
});
|
|
166
191
|
function TileInner(_ref8, ref) {
|
|
167
192
|
var _ref8$role = _ref8.role,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextTile.js","names":["useCheckbox","useCheckboxGroupItem","useFocusRing","mergeProps","VisuallyHidden","React","useToggleState","CheckboxGroupContext","StyledActions","StyledFooter","StyledHeroMedia","StyledHeroOverlay","StyledHeroText","StyledInteractableTile","StyledLinkTile","StyledSelectableTile","StyledTileContent","addSubcomponents","mergeRefs","heroTextGridTemplateColumns","TileContext","createContext","orientation","HeroMedia","forwardRef","_ref","ref","children","_ref$overlay","overlay","onOverlayClick","props","_objectWithoutProperties","_excluded","_React$useContext","useContext","heroRef","useRef","useLayoutEffect","_heroRef$current","_heroRef$current$pare","current","parentElement","style","removeProperty","createElement","_extends","$orientation","onClick","HeroText","_ref2","_excluded2","_React$useContext2","_heroRef$current2","_heroRef$current2$par","setProperty","Content","Footer","_ref3","_excluded3","Actions","_ref4","_excluded4","InteractableTile","_ref5","_excluded5","Provider","value","LinkTile","_ref6","_excluded6","noop","CheckboxTile_","CheckboxTile","_ref7","_ref7$disabled","disabled","checked","defaultChecked","className","props_","_excluded7","_objectSpread","isDisabled","isSelected","defaultSelected","inputRef","groupState","isGroup","Boolean","_useCheckboxGroupItem","inputGroupItemProps","inputProps","state","_useCheckbox","_useFocusRing","focusProps","isFocusVisible","$disabled","$selected","$focused","as","TileInner","_ref8","_ref8$role","role","_excluded8","Tile_","NextTile"],"sources":["../../src/NextTile/NextTile.tsx"],"sourcesContent":["import { useCheckbox, useCheckboxGroupItem } from '@react-aria/checkbox'\nimport { useFocusRing } from '@react-aria/focus'\nimport { mergeProps } from '@react-aria/utils'\nimport { VisuallyHidden } from '@react-aria/visually-hidden'\nimport React from 'react'\nimport type { CheckboxGroupState } from 'react-stately'\nimport { useToggleState } from 'react-stately'\nimport { CheckboxGroupContext } from '../CheckboxGroup/CheckboxGroup'\nimport { StyledActions } from '../Content/Content.styles'\nimport {\n StyledFooter,\n StyledHeroMedia,\n StyledHeroOverlay,\n StyledHeroText,\n StyledInteractableTile,\n StyledLinkTile,\n StyledSelectableTile,\n StyledTileContent,\n} from '../Tile/Tile.styles'\nimport { addSubcomponents } from '../_utils/addSubcomponents'\nimport { mergeRefs } from '../_utils/mergeRefs'\nimport type { Props } from '../_utils/types'\nimport type {\n CheckboxTileProps,\n HeroMediaProps,\n HeroTextProps,\n InteractableTileProps,\n LinkTileProps,\n Roles,\n TileCommonProps,\n TileProps,\n TileRef,\n} from './NextTile.types'\n\nconst heroTextGridTemplateColumns = 'auto 1fr'\n\nconst TileContext = React.createContext<\n Pick<TileCommonProps<'none'>, 'orientation'>\n>({\n orientation: 'portrait',\n})\n\nconst HeroMedia = React.forwardRef<HTMLDivElement, HeroMediaProps>(\n function HeroMedia(\n { children, overlay = false, onOverlayClick, ...props },\n ref\n ) {\n const { orientation } = React.useContext(TileContext)\n const heroRef = React.useRef<HTMLDivElement>(null)\n\n React.useLayoutEffect(() => {\n if (orientation === 'landscape') {\n heroRef.current?.parentElement?.style.removeProperty(\n '--core-tile-grid-template-columns'\n )\n }\n }, [orientation])\n\n return (\n <StyledHeroMedia\n ref={mergeRefs(heroRef, ref)}\n $orientation={orientation}\n {...props}\n >\n {overlay && <StyledHeroOverlay onClick={onOverlayClick} />}\n {children}\n </StyledHeroMedia>\n )\n }\n)\n\nconst HeroText = React.forwardRef<HTMLDivElement, HeroTextProps>(\n function HeroText({ children, ...props }, ref) {\n const { orientation } = React.useContext(TileContext)\n const heroRef = React.useRef<HTMLDivElement>(null)\n\n React.useLayoutEffect(() => {\n if (orientation === 'landscape') {\n heroRef.current?.parentElement?.style.setProperty(\n '--core-tile-grid-template-columns',\n heroTextGridTemplateColumns\n )\n }\n }, [orientation])\n\n return (\n <StyledHeroText\n ref={mergeRefs(heroRef, ref)}\n $orientation={orientation}\n {...props}\n >\n {children}\n </StyledHeroText>\n )\n }\n)\n\nconst Content = React.forwardRef<HTMLDivElement, HeroTextProps>(\n function Content(props, ref) {\n return <StyledTileContent ref={ref} {...props} />\n }\n)\n\nconst Footer = React.forwardRef<HTMLDivElement, Props>(function Footer(\n { children, ...props },\n ref\n) {\n return (\n <StyledFooter ref={ref} {...props}>\n {children}\n </StyledFooter>\n )\n})\n\nconst Actions = React.forwardRef<HTMLDivElement, Props>(function Actions(\n { children, ...props },\n ref\n) {\n return (\n <StyledActions ref={ref} {...props}>\n {children}\n </StyledActions>\n )\n})\n\nexport const InteractableTile = React.forwardRef<\n HTMLDivElement,\n Omit<InteractableTileProps, 'role'>\n>(function InteractableTile({ orientation, children, ...props }, ref) {\n return (\n <StyledInteractableTile ref={ref} $orientation={orientation} {...props}>\n <TileContext.Provider value={{ orientation }}>\n {children}\n </TileContext.Provider>\n </StyledInteractableTile>\n )\n})\n\nexport const LinkTile = React.forwardRef<\n HTMLAnchorElement,\n Omit<LinkTileProps, 'role'>\n>(function LinkTile({ orientation, children, ...props }, ref) {\n return (\n <StyledLinkTile ref={ref} $orientation={orientation} {...props}>\n <TileContext.Provider value={{ orientation }}>\n {children}\n </TileContext.Provider>\n </StyledLinkTile>\n )\n})\nfunction noop() {}\n\nconst CheckboxTile_ = React.forwardRef<HTMLInputElement, CheckboxTileProps>(\n function CheckboxTile(\n {\n disabled = false,\n checked,\n defaultChecked,\n orientation,\n style,\n className,\n ...props_\n },\n ref\n ) {\n const props = {\n ...props_,\n isDisabled: disabled,\n isSelected: checked,\n defaultSelected: defaultChecked,\n }\n const inputRef = React.useRef<HTMLInputElement>(null)\n // Group hooks\n const groupState = React.useContext(\n CheckboxGroupContext\n ) as CheckboxGroupState\n const isGroup = Boolean(groupState)\n const { inputProps: inputGroupItemProps } = useCheckboxGroupItem(\n props,\n groupState ?? { isSelected: noop },\n inputRef\n )\n // Single hooks\n const state = useToggleState(props)\n const { inputProps } = useCheckbox(props, state, inputRef)\n // common hooks\n const { focusProps, isFocusVisible } = useFocusRing()\n\n const isDisabled = isGroup ? groupState.isDisabled || disabled : disabled\n const isSelected = isGroup\n ? groupState.isSelected(props.value)\n : state.isSelected\n\n return (\n <StyledSelectableTile\n $disabled={isDisabled}\n $selected={isSelected}\n $focused={isFocusVisible}\n $orientation={orientation}\n as=\"label\"\n className={className}\n style={style}\n >\n <VisuallyHidden>\n <input\n {...mergeProps(\n isGroup ? inputGroupItemProps : inputProps,\n focusProps\n )}\n ref={mergeRefs(inputRef, ref)}\n />\n </VisuallyHidden>\n <TileContext.Provider value={{ orientation }}>\n {props.children}\n </TileContext.Provider>\n </StyledSelectableTile>\n )\n }\n)\n\nfunction TileInner<Role extends Roles = 'none'>(\n { role = 'none', ...props }: TileProps<Role>,\n ref: TileRef<Role>\n) {\n switch (role) {\n case 'none':\n return (\n <InteractableTile\n ref={ref as React.Ref<HTMLDivElement>}\n {...(props as Omit<InteractableTileProps, 'role'>)}\n />\n )\n case 'link':\n return (\n <LinkTile\n ref={ref as React.Ref<HTMLAnchorElement>}\n {...(props as Omit<LinkTileProps, 'role'>)}\n />\n )\n case 'checkbox':\n return (\n <CheckboxTile_\n ref={ref as React.Ref<HTMLInputElement>}\n {...(props as Omit<CheckboxTileProps, 'role'>)}\n />\n )\n default:\n return null\n }\n}\n\nconst Tile_ = React.forwardRef(TileInner) as <Role extends Roles = 'none'>(\n props: TileProps<Role> & { ref?: TileRef<Role> }\n) => ReturnType<typeof TileInner>\n\n/**\n * <NextTile role={checkbox}/> can be used as single checkbox as well as in group.\n *\n * Single\n * ```\n * <NextTile role={checkbox} value=\"ThomasAnderson\" onChange=((value) => console.log(value) />\n * <NextTile role={checkbox} value=\"WhiteRabbit\" onChange=((value) => console.log(value) />\n * ```\n *\n * Group\n * ```\n * <CheckboxGroup label=\"Matrix\" onChange=((value) => console.log(value)>\n * <NextTile role={checkbox} value=\"ThomasAnderson\"/>\n * <NextTile role={checkbox} value=\"WhiteRabbit\"/>\n * </CheckboxGroup>\n * ```\n *\n * @since 11.6.0\n */\nexport const NextTile = addSubcomponents(\n { Actions, Content, Footer, HeroText, HeroMedia },\n Tile_\n)\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAASA,WAAW,EAAEC,oBAAoB,QAAQ,sBAAsB;AACxE,SAASC,YAAY,QAA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K,CACX,CAAC;IAEN,KAAK,UAAU;MACb,oBACE1B,KAAA,CAAAwC,aAAA,CAAC2B,aAAa,EAAA1B,QAAA;QACZpB,GAAG,EAAEA;MAAmC,GACnCK,KAAK,CACX,CAAC;IAEN;MACE,OAAO,IAAI;EACf;AACF;AAEA,IAAM4E,KAAK,gBAAGtG,KAAK,CAACmB,UAAU,CAAC8E,SAAS,CAEP;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMM,QAAQ,GAAG3F,gBAAgB,CACtC;EAAE2C,OAAO,EAAPA,OAAO;EAAEJ,OAAO,EAAPA,OAAO;EAAEC,MAAM,EAANA,MAAM;EAAER,QAAQ,EAARA,QAAQ;EAAE1B,SAAS,EAATA;AAAU,CAAC,EACjDoF,KACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"NextTile.js","names":["useCheckbox","useCheckboxGroupItem","useFocusRing","mergeProps","useId","VisuallyHidden","React","useToggleState","CheckboxGroupContext","StyledActions","StyledFooter","StyledHeroMedia","StyledHeroOverlay","StyledHeroText","StyledInteractableTile","StyledLinkTile","StyledSelectableTile","StyledTileContent","addSubcomponents","mergeRefs","heroTextGridTemplateColumns","TileContext","createContext","orientation","HeroMedia","forwardRef","_ref","ref","children","_ref$overlay","overlay","onOverlayClick","props","_objectWithoutProperties","_excluded","_React$useContext","useContext","heroRef","useRef","useLayoutEffect","_heroRef$current","_heroRef$current$pare","current","parentElement","style","removeProperty","createElement","_extends","$orientation","onClick","HeroText","_ref2","_excluded2","_React$useContext2","_heroRef$current2","_heroRef$current2$par","setProperty","Content","Footer","_ref3","_excluded3","Actions","_ref4","_excluded4","InteractableTile","_ref5","_excluded5","Provider","value","LinkTile","_ref6","_excluded6","noop","CheckboxTile_","CheckboxTile","_ref7","_props$role","_ref7$disabled","disabled","checked","defaultChecked","className","props_","_excluded7","_objectSpread","isDisabled","isSelected","defaultSelected","inputRef","groupState","isGroup","Boolean","_useCheckboxGroupItem","inputGroupItemProps","inputProps","state","_useCheckbox","_useFocusRing","focusProps","isFocusVisible","labelId","fallbackId","$disabled","$selected","$focused","$layoutless","role","tabIndex","_inputRef$current","click","onKeyDown","e","code","preventDefault","_inputRef$current2","TileInner","_ref8","_ref8$role","_excluded8","Tile_","NextTile"],"sources":["../../src/NextTile/NextTile.tsx"],"sourcesContent":["import { useCheckbox, useCheckboxGroupItem } from '@react-aria/checkbox'\nimport { useFocusRing } from '@react-aria/focus'\nimport { mergeProps, useId } from '@react-aria/utils'\nimport { VisuallyHidden } from '@react-aria/visually-hidden'\nimport React from 'react'\nimport type { CheckboxGroupState } from 'react-stately'\nimport { useToggleState } from 'react-stately'\nimport { CheckboxGroupContext } from '../CheckboxGroup/CheckboxGroup'\nimport { StyledActions } from '../Content/Content.styles'\nimport {\n StyledFooter,\n StyledHeroMedia,\n StyledHeroOverlay,\n StyledHeroText,\n StyledInteractableTile,\n StyledLinkTile,\n StyledSelectableTile,\n StyledTileContent,\n} from '../Tile/Tile.styles'\nimport { addSubcomponents } from '../_utils/addSubcomponents'\nimport { mergeRefs } from '../_utils/mergeRefs'\nimport type { Props } from '../_utils/types'\nimport type {\n CheckboxTileProps,\n HeroMediaProps,\n HeroTextProps,\n InteractableTileProps,\n LinkTileProps,\n Roles,\n TileCommonProps,\n TileProps,\n TileRef,\n} from './NextTile.types'\n\nconst heroTextGridTemplateColumns = 'auto 1fr'\n\nconst TileContext = React.createContext<\n Pick<TileCommonProps<'none'>, 'orientation'>\n>({\n orientation: 'portrait',\n})\n\nconst HeroMedia = React.forwardRef<HTMLDivElement, HeroMediaProps>(\n function HeroMedia(\n { children, overlay = false, onOverlayClick, ...props },\n ref\n ) {\n const { orientation } = React.useContext(TileContext)\n const heroRef = React.useRef<HTMLDivElement>(null)\n\n React.useLayoutEffect(() => {\n if (orientation === 'landscape') {\n heroRef.current?.parentElement?.style.removeProperty(\n '--core-tile-grid-template-columns'\n )\n }\n }, [orientation])\n\n return (\n <StyledHeroMedia\n ref={mergeRefs(heroRef, ref)}\n $orientation={orientation}\n {...props}\n >\n {overlay && <StyledHeroOverlay onClick={onOverlayClick} />}\n {children}\n </StyledHeroMedia>\n )\n }\n)\n\nconst HeroText = React.forwardRef<HTMLDivElement, HeroTextProps>(\n function HeroText({ children, ...props }, ref) {\n const { orientation } = React.useContext(TileContext)\n const heroRef = React.useRef<HTMLDivElement>(null)\n\n React.useLayoutEffect(() => {\n if (orientation === 'landscape') {\n heroRef.current?.parentElement?.style.setProperty(\n '--core-tile-grid-template-columns',\n heroTextGridTemplateColumns\n )\n }\n }, [orientation])\n\n return (\n <StyledHeroText\n ref={mergeRefs(heroRef, ref)}\n $orientation={orientation}\n {...props}\n >\n {children}\n </StyledHeroText>\n )\n }\n)\n\nconst Content = React.forwardRef<HTMLDivElement, HeroTextProps>(\n function Content(props, ref) {\n return <StyledTileContent ref={ref} {...props} />\n }\n)\n\nconst Footer = React.forwardRef<HTMLDivElement, Props>(function Footer(\n { children, ...props },\n ref\n) {\n return (\n <StyledFooter ref={ref} {...props}>\n {children}\n </StyledFooter>\n )\n})\n\nconst Actions = React.forwardRef<HTMLDivElement, Props>(function Actions(\n { children, ...props },\n ref\n) {\n return (\n <StyledActions ref={ref} {...props}>\n {children}\n </StyledActions>\n )\n})\n\nexport const InteractableTile = React.forwardRef<\n HTMLDivElement,\n Omit<InteractableTileProps, 'role'>\n>(function InteractableTile({ orientation, children, ...props }, ref) {\n return (\n <StyledInteractableTile ref={ref} $orientation={orientation} {...props}>\n <TileContext.Provider value={{ orientation }}>\n {children}\n </TileContext.Provider>\n </StyledInteractableTile>\n )\n})\n\nexport const LinkTile = React.forwardRef<\n HTMLAnchorElement,\n Omit<LinkTileProps, 'role'>\n>(function LinkTile({ orientation, children, ...props }, ref) {\n return (\n <StyledLinkTile ref={ref} $orientation={orientation} {...props}>\n <TileContext.Provider value={{ orientation }}>\n {children}\n </TileContext.Provider>\n </StyledLinkTile>\n )\n})\nfunction noop() {}\n\nconst CheckboxTile_ = React.forwardRef<HTMLInputElement, CheckboxTileProps>(\n function CheckboxTile(\n {\n disabled = false,\n checked,\n defaultChecked,\n orientation,\n style,\n className,\n ...props_\n },\n ref\n ) {\n const props = {\n ...props_,\n isDisabled: disabled,\n isSelected: checked,\n defaultSelected: defaultChecked,\n }\n const inputRef = React.useRef<HTMLInputElement>(null)\n // Group hooks\n const groupState = React.useContext(\n CheckboxGroupContext\n ) as CheckboxGroupState\n const isGroup = Boolean(groupState)\n const { inputProps: inputGroupItemProps } = useCheckboxGroupItem(\n props,\n groupState ?? { isSelected: noop },\n inputRef\n )\n // Single hooks\n const state = useToggleState(props)\n const { inputProps } = useCheckbox(props, state, inputRef)\n // common hooks\n const { focusProps, isFocusVisible } = useFocusRing()\n\n const isDisabled = isGroup ? groupState.isDisabled || disabled : disabled\n const isSelected = isGroup\n ? groupState.isSelected(props.value)\n : state.isSelected\n\n const labelId = props['aria-labelledby']\n const fallbackId = useId()\n\n return (\n <StyledSelectableTile\n $disabled={isDisabled}\n $selected={isSelected}\n $focused={isFocusVisible}\n $orientation={orientation}\n $layoutless\n className={className}\n style={style}\n >\n <div\n role={props.role ?? 'checkbox'}\n aria-labelledby={labelId ?? fallbackId}\n aria-checked={isSelected}\n aria-disabled={isDisabled}\n tabIndex={isDisabled ? -1 : 0}\n onClick={() => {\n if (!isDisabled) {\n inputRef.current?.click()\n }\n }}\n onKeyDown={(e) => {\n if (e.code === 'Space' || e.code === 'Enter') {\n e.preventDefault()\n if (!isDisabled) {\n inputRef.current?.click()\n }\n }\n }}\n >\n <VisuallyHidden>\n <input\n {...mergeProps(\n isGroup ? inputGroupItemProps : inputProps,\n focusProps\n )}\n ref={mergeRefs(inputRef, ref)}\n tabIndex={-1}\n />\n </VisuallyHidden>\n <TileContext.Provider\n value={{\n orientation,\n }}\n >\n {props.children}\n </TileContext.Provider>\n </div>\n </StyledSelectableTile>\n )\n }\n)\n\nfunction TileInner<Role extends Roles = 'none'>(\n { role = 'none', ...props }: TileProps<Role>,\n ref: TileRef<Role>\n) {\n switch (role) {\n case 'none':\n return (\n <InteractableTile\n ref={ref as React.Ref<HTMLDivElement>}\n {...(props as Omit<InteractableTileProps, 'role'>)}\n />\n )\n case 'link':\n return (\n <LinkTile\n ref={ref as React.Ref<HTMLAnchorElement>}\n {...(props as Omit<LinkTileProps, 'role'>)}\n />\n )\n case 'checkbox':\n return (\n <CheckboxTile_\n ref={ref as React.Ref<HTMLInputElement>}\n {...(props as Omit<CheckboxTileProps, 'role'>)}\n />\n )\n default:\n return null\n }\n}\n\nconst Tile_ = React.forwardRef(TileInner) as <Role extends Roles = 'none'>(\n props: TileProps<Role> & { ref?: TileRef<Role> }\n) => ReturnType<typeof TileInner>\n\n/**\n * <NextTile role={checkbox}/> can be used as single checkbox as well as in group.\n *\n * Single\n * ```\n * <NextTile role={checkbox} value=\"ThomasAnderson\" onChange=((value) => console.log(value) />\n * <NextTile role={checkbox} value=\"WhiteRabbit\" onChange=((value) => console.log(value) />\n * ```\n *\n * Group\n * ```\n * <CheckboxGroup label=\"Matrix\" onChange=((value) => console.log(value)>\n * <NextTile role={checkbox} value=\"ThomasAnderson\"/>\n * <NextTile role={checkbox} value=\"WhiteRabbit\"/>\n * </CheckboxGroup>\n * ```\n *\n * @since 11.6.0\n */\nexport const NextTile = addSubcomponents(\n { Actions, Content, Footer, HeroText, HeroMedia },\n Tile_\n)\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAASA,WAAW,EAAEC,oBAAoB,QAAQ,sBAAsB;AACxE,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,UAAU,EAAEC,KAAK,QAAQ,mBAAmB;AACrD,SAASC,cAAc,QAAQ,6BAA6B;AAC5D,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,oBAAoB,QAAQ,gCAAgC;AACrE,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SACEC,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APA,OAAO;EAAEC,MAAM,EAANA,MAAM;EAAER,QAAQ,EAARA,QAAQ;EAAE1B,SAAS,EAATA;AAAU,CAAC,EACjD+F,KACF,CAAC"}
|
|
@@ -19,6 +19,11 @@ export interface TileCommonProps<Role extends Roles> extends Props {
|
|
|
19
19
|
role?: Role;
|
|
20
20
|
}
|
|
21
21
|
export interface CheckboxTileProps extends Omit<AriaCheckboxProps, 'isDisabled' | 'children' | 'defaultSelected' | 'isSelected'>, TileCommonProps<'checkbox'> {
|
|
22
|
+
/**
|
|
23
|
+
* For tiles acting as checkboxes.
|
|
24
|
+
* @since 11.6.0
|
|
25
|
+
*/
|
|
26
|
+
role?: 'checkbox';
|
|
22
27
|
/**
|
|
23
28
|
* Whether the element should be selected (uncontrolled).
|
|
24
29
|
* Only for single checkbox, doesn't work in CheckboxGroup.
|
|
@@ -43,8 +48,18 @@ export interface CheckboxTileProps extends Omit<AriaCheckboxProps, 'isDisabled'
|
|
|
43
48
|
value: string;
|
|
44
49
|
}
|
|
45
50
|
export interface InteractableTileProps extends TileCommonProps<'none'>, Omit<DivAttributes, 'role'> {
|
|
51
|
+
/**
|
|
52
|
+
* For a neutral tile with no special interactive behavior.
|
|
53
|
+
* @since 11.6.0
|
|
54
|
+
*/
|
|
55
|
+
role?: 'none';
|
|
46
56
|
}
|
|
47
57
|
export interface LinkTileProps extends TileCommonProps<'link'>, Omit<AnchorAttributes, 'role'> {
|
|
58
|
+
/**
|
|
59
|
+
* For tiles acting as links.
|
|
60
|
+
* @since 11.6.0
|
|
61
|
+
*/
|
|
62
|
+
role?: 'link';
|
|
48
63
|
}
|
|
49
64
|
export declare type TileProps<Role extends Roles = 'none'> = Role extends 'link' ? LinkTileProps : Role extends 'checkbox' ? CheckboxTileProps : Role extends 'none' ? InteractableTileProps : TileCommonProps<Role>;
|
|
50
65
|
export interface RefMap extends Record<Roles, React.ElementType> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextTile.types.js","names":[],"sources":["../../src/NextTile/NextTile.types.ts"],"sourcesContent":["import type { AriaCheckboxProps } from '@react-types/checkbox'\nimport type React from 'react'\nimport type { AnchorAttributes, DivAttributes, Props } from '../_utils/types'\n\nexport interface HeroTextProps extends Props {}\nexport interface HeroMediaProps extends Props {\n overlay?: boolean\n onOverlayClick?: React.MouseEventHandler<HTMLDivElement>\n}\n\nexport type Roles = 'none' | 'link' | 'checkbox'\n\nexport interface TileCommonProps<Role extends Roles> extends Props {\n /**\n * @since 11.6.0\n */\n orientation: 'portrait' | 'landscape'\n /**\n * @since 11.6.0\n */\n role?: Role\n}\n\nexport interface CheckboxTileProps\n extends Omit<\n AriaCheckboxProps,\n 'isDisabled' | 'children' | 'defaultSelected' | 'isSelected'\n >,\n TileCommonProps<'checkbox'> {\n /**\n * Whether the element should be selected (uncontrolled).\n * Only for single checkbox, doesn't work in CheckboxGroup.\n *\n * @since 11.6.0\n */\n defaultChecked?: boolean\n /**\n * Whether the element should be selected (controlled).\n * Only for single checkbox, doesn't work in CheckboxGroup.\n *\n * @since 11.6.0\n */\n checked?: boolean\n /**\n * @since 11.6.0\n */\n disabled?: boolean\n /**\n * @since 11.6.0\n */\n value: string\n}\n\nexport interface InteractableTileProps\n extends TileCommonProps<'none'>,\n Omit<DivAttributes, 'role'> {}\n\nexport interface LinkTileProps\n extends TileCommonProps<'link'>,\n Omit<AnchorAttributes, 'role'> {}\n\nexport type TileProps<Role extends Roles = 'none'> = Role extends 'link'\n ? LinkTileProps\n : Role extends 'checkbox'\n ? CheckboxTileProps\n : Role extends 'none'\n ? InteractableTileProps\n : TileCommonProps<Role>\n\nexport interface RefMap extends Record<Roles, React.ElementType> {\n none: 'div'\n link: 'a'\n checkbox: 'input'\n}\n\nexport type TileRef<C extends Roles> = React.ComponentPropsWithRef<\n RefMap[C]\n>['ref']\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"NextTile.types.js","names":[],"sources":["../../src/NextTile/NextTile.types.ts"],"sourcesContent":["import type { AriaCheckboxProps } from '@react-types/checkbox'\nimport type React from 'react'\nimport type { AnchorAttributes, DivAttributes, Props } from '../_utils/types'\n\nexport interface HeroTextProps extends Props {}\nexport interface HeroMediaProps extends Props {\n overlay?: boolean\n onOverlayClick?: React.MouseEventHandler<HTMLDivElement>\n}\n\nexport type Roles = 'none' | 'link' | 'checkbox'\n\nexport interface TileCommonProps<Role extends Roles> extends Props {\n /**\n * @since 11.6.0\n */\n orientation: 'portrait' | 'landscape'\n /**\n * @since 11.6.0\n */\n role?: Role\n}\n\nexport interface CheckboxTileProps\n extends Omit<\n AriaCheckboxProps,\n 'isDisabled' | 'children' | 'defaultSelected' | 'isSelected'\n >,\n TileCommonProps<'checkbox'> {\n /**\n * For tiles acting as checkboxes.\n * @since 11.6.0\n */\n role?: 'checkbox'\n /**\n * Whether the element should be selected (uncontrolled).\n * Only for single checkbox, doesn't work in CheckboxGroup.\n *\n * @since 11.6.0\n */\n defaultChecked?: boolean\n /**\n * Whether the element should be selected (controlled).\n * Only for single checkbox, doesn't work in CheckboxGroup.\n *\n * @since 11.6.0\n */\n checked?: boolean\n /**\n * @since 11.6.0\n */\n disabled?: boolean\n /**\n * @since 11.6.0\n */\n value: string\n}\n\nexport interface InteractableTileProps\n extends TileCommonProps<'none'>,\n Omit<DivAttributes, 'role'> {\n /**\n * For a neutral tile with no special interactive behavior.\n * @since 11.6.0\n */\n role?: 'none'\n}\n\nexport interface LinkTileProps\n extends TileCommonProps<'link'>,\n Omit<AnchorAttributes, 'role'> {\n /**\n * For tiles acting as links.\n * @since 11.6.0\n */\n role?: 'link'\n}\n\nexport type TileProps<Role extends Roles = 'none'> = Role extends 'link'\n ? LinkTileProps\n : Role extends 'checkbox'\n ? CheckboxTileProps\n : Role extends 'none'\n ? InteractableTileProps\n : TileCommonProps<Role>\n\nexport interface RefMap extends Record<Roles, React.ElementType> {\n none: 'div'\n link: 'a'\n checkbox: 'input'\n}\n\nexport type TileRef<C extends Roles> = React.ComponentPropsWithRef<\n RefMap[C]\n>['ref']\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["InteractableTile","LinkTile","NextTile"],"sources":["../../src/NextTile/index.ts"],"sourcesContent":["export { InteractableTile, LinkTile, NextTile } from './NextTile'\nexport type {\n CheckboxTileProps,\n HeroMediaProps,\n HeroTextProps,\n InteractableTileProps,\n LinkTileProps,\n TileCommonProps,\n TileProps,\n} from './NextTile.types'\n"],"mappings":"AAAA,SAASA,gBAAgB,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,YAAY"}
|
|
@@ -14,7 +14,7 @@ var variantColorMap = {
|
|
|
14
14
|
};
|
|
15
15
|
var StyledNotation = /*#__PURE__*/styled.i.withConfig({
|
|
16
16
|
displayName: "StyledNotation",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_25_0__sc-160q1m6-0"
|
|
18
18
|
})(["", " color:", ";font-style:italic;"], getTypographyIntent('small'), function (_ref) {
|
|
19
19
|
var $variant = _ref.$variant;
|
|
20
20
|
return $variant ? colors[variantColorMap[$variant]] : colors.gray15;
|
|
@@ -12,37 +12,37 @@ var inputBgColor = colors.white;
|
|
|
12
12
|
var inputBorder = "".concat(colors.gray70, " solid 1px");
|
|
13
13
|
var StyledRootAddon = /*#__PURE__*/styled.span.withConfig({
|
|
14
14
|
displayName: "StyledRootAddon",
|
|
15
|
-
componentId: "core-
|
|
15
|
+
componentId: "core-12_25_0__sc-1782nvg-0"
|
|
16
16
|
})(["display:inline-flex;align-items:center;height:100%;position:absolute;top:0;color:", ";", ";"], function (_ref) {
|
|
17
17
|
var disabled = _ref.disabled;
|
|
18
18
|
return disabled ? colors.gray70 : colors.gray45;
|
|
19
19
|
}, getTypographyIntent('body'));
|
|
20
20
|
export var StyledPrefix = /*#__PURE__*/styled(StyledRootAddon).withConfig({
|
|
21
21
|
displayName: "StyledPrefix",
|
|
22
|
-
componentId: "core-
|
|
22
|
+
componentId: "core-12_25_0__sc-1782nvg-1"
|
|
23
23
|
})(["left:", "px;"], spacing.md);
|
|
24
24
|
export var StyledSuffix = /*#__PURE__*/styled(StyledRootAddon).withConfig({
|
|
25
25
|
displayName: "StyledSuffix",
|
|
26
|
-
componentId: "core-
|
|
26
|
+
componentId: "core-12_25_0__sc-1782nvg-2"
|
|
27
27
|
})(["right:", "px;"], function (_ref2) {
|
|
28
28
|
var $withIncrementer = _ref2.$withIncrementer;
|
|
29
29
|
return $withIncrementer ? spacing.md + incrementerWidth : spacing.md;
|
|
30
30
|
});
|
|
31
31
|
export var StyledIncrementerWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
32
32
|
displayName: "StyledIncrementerWrapper",
|
|
33
|
-
componentId: "core-
|
|
33
|
+
componentId: "core-12_25_0__sc-1782nvg-3"
|
|
34
34
|
})(["display:flex;flex-direction:column;position:absolute;top:1px;right:1px;height:100%;"]);
|
|
35
35
|
export var StyledIncrementerButton = /*#__PURE__*/styled.button.withConfig({
|
|
36
36
|
displayName: "StyledIncrementerButton",
|
|
37
|
-
componentId: "core-
|
|
37
|
+
componentId: "core-12_25_0__sc-1782nvg-4"
|
|
38
38
|
})(["display:inline-flex;justify-content:center;align-items:center;width:", "px;height:calc(50% - 1px);border:none;border-radius:0px;outline:none;background-color:", ";padding:0;cursor:pointer;&:first-child,&:last-child{border-left:", ";&:disabled{border-color:", ";background-color:", ";}}&:first-child{border-top-right-radius:2px;}&:last-child{border-top:", ";border-bottom-right-radius:2px;}svg{fill:", ";}&:hover{svg{fill:", ";}}&:disabled{cursor:default;svg{fill:", ";}}"], incrementerWidth, inputBgColor, inputBorder, colors.gray70, colors.gray94, inputBorder, colors.gray45, colors.gray10, colors.gray70);
|
|
39
39
|
export var StyledInput = /*#__PURE__*/styled(Input).withConfig({
|
|
40
40
|
displayName: "StyledInput",
|
|
41
|
-
componentId: "core-
|
|
41
|
+
componentId: "core-12_25_0__sc-1782nvg-5"
|
|
42
42
|
})([""]);
|
|
43
43
|
export var StyledWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
44
44
|
displayName: "StyledWrapper",
|
|
45
|
-
componentId: "core-
|
|
45
|
+
componentId: "core-12_25_0__sc-1782nvg-6"
|
|
46
46
|
})(["position:relative;", ""], function (_ref3) {
|
|
47
47
|
var $hasIncrementer = _ref3.$hasIncrementer;
|
|
48
48
|
return $hasIncrementer && css(["", "{padding-right:", "px;}"], StyledInput, spacing.md + incrementerWidth);
|
|
@@ -2,6 +2,6 @@ import styled from 'styled-components';
|
|
|
2
2
|
export var arrowSize = 8;
|
|
3
3
|
export var StyledArrow = /*#__PURE__*/styled.div.withConfig({
|
|
4
4
|
displayName: "StyledArrow",
|
|
5
|
-
componentId: "core-
|
|
5
|
+
componentId: "core-12_25_0__sc-1epxw7u-0"
|
|
6
6
|
})(["position:absolute;background:inherit;width:", "px;height:", "px;transform:rotate(45deg);"], arrowSize, arrowSize);
|
|
7
7
|
//# sourceMappingURL=OverlayArrow.styles.js.map
|
|
@@ -11,52 +11,52 @@ var outerPageSpacing = spacing.lg;
|
|
|
11
11
|
var outerPageSpacingSmaller = spacing.md;
|
|
12
12
|
export var StyledPageHeader = /*#__PURE__*/styled.div.withConfig({
|
|
13
13
|
displayName: "StyledPageHeader",
|
|
14
|
-
componentId: "core-
|
|
14
|
+
componentId: "core-12_25_0__sc-1cvdbsv-0"
|
|
15
15
|
})(["padding-top:", "px;padding-right:", "px;padding-left:", "px;@media ", "{padding-right:", "px;padding-left:", "px;}", ""], headerVerticalSpacing, outerPageSpacing, outerPageSpacing, mediaBreakpointsDown.tabletMd, outerPageSpacingSmaller, outerPageSpacingSmaller, function (_ref) {
|
|
16
16
|
var $transparent = _ref.$transparent;
|
|
17
17
|
return !$transparent && css(["", " background-color:", ";"], getShadow(1.5), colors.white);
|
|
18
18
|
});
|
|
19
19
|
var StyledPageHeaderItem = /*#__PURE__*/styled.div.withConfig({
|
|
20
20
|
displayName: "StyledPageHeaderItem",
|
|
21
|
-
componentId: "core-
|
|
21
|
+
componentId: "core-12_25_0__sc-1cvdbsv-1"
|
|
22
22
|
})(["margin-top:", "px;&:first-child{margin-top:0;}"], headerVerticalSpacing);
|
|
23
23
|
export var StyledPageTitle = /*#__PURE__*/styled(StyledPageHeaderItem).withConfig({
|
|
24
24
|
displayName: "StyledPageTitle",
|
|
25
|
-
componentId: "core-
|
|
25
|
+
componentId: "core-12_25_0__sc-1cvdbsv-2"
|
|
26
26
|
})(["&:last-child{padding-bottom:", "px;}"], headerVerticalSpacing);
|
|
27
27
|
export var StyledPageBreadcrumbs = /*#__PURE__*/styled(StyledPageHeaderItem).attrs({
|
|
28
28
|
as: 'nav'
|
|
29
29
|
}).withConfig({
|
|
30
30
|
displayName: "StyledPageBreadcrumbs",
|
|
31
|
-
componentId: "core-
|
|
31
|
+
componentId: "core-12_25_0__sc-1cvdbsv-3"
|
|
32
32
|
})([""]);
|
|
33
33
|
export var StyledPageBanner = /*#__PURE__*/styled(StyledPageHeaderItem).withConfig({
|
|
34
34
|
displayName: "StyledPageBanner",
|
|
35
|
-
componentId: "core-
|
|
35
|
+
componentId: "core-12_25_0__sc-1cvdbsv-4"
|
|
36
36
|
})([""]);
|
|
37
37
|
export var getActions = function getActions() {
|
|
38
38
|
return css(["flex-shrink:0;padding-left:", "px;> button,> a{&:first-child{margin-left:0;}margin-left:", "px;}"], spacing.xl, spacing.sm);
|
|
39
39
|
};
|
|
40
40
|
export var StyledPageActions = /*#__PURE__*/styled.div.withConfig({
|
|
41
41
|
displayName: "StyledPageActions",
|
|
42
|
-
componentId: "core-
|
|
42
|
+
componentId: "core-12_25_0__sc-1cvdbsv-5"
|
|
43
43
|
})(["", ""], getActions());
|
|
44
44
|
export var StyledPageTabs = /*#__PURE__*/styled(StyledPageHeaderItem).withConfig({
|
|
45
45
|
displayName: "StyledPageTabs",
|
|
46
|
-
componentId: "core-
|
|
46
|
+
componentId: "core-12_25_0__sc-1cvdbsv-6"
|
|
47
47
|
})([""]);
|
|
48
48
|
export var StyledBody = /*#__PURE__*/styled.div.withConfig({
|
|
49
49
|
displayName: "StyledBody",
|
|
50
|
-
componentId: "core-
|
|
50
|
+
componentId: "core-12_25_0__sc-1cvdbsv-7"
|
|
51
51
|
})(["padding-top:", "px;padding-left:", "px;padding-right:", "px;@media ", "{padding-top:", "px;padding-left:", "px;padding-right:", "px;}"], outerPageSpacing, outerPageSpacing, outerPageSpacing, mediaBreakpointsDown.tabletMd, outerPageSpacingSmaller, outerPageSpacingSmaller, outerPageSpacingSmaller);
|
|
52
52
|
var navigationWidth = 200;
|
|
53
53
|
export var StyledNavigation = /*#__PURE__*/styled.div.withConfig({
|
|
54
54
|
displayName: "StyledNavigation",
|
|
55
|
-
componentId: "core-
|
|
55
|
+
componentId: "core-12_25_0__sc-1cvdbsv-8"
|
|
56
56
|
})(["float:left;max-height:100vh;min-width:", "px;overflow-y:auto;position:sticky;top:0;width:", "px;", "{padding:20px ", "px 0 0;}@media screen and (max-width:1024px){display:none;}"], navigationWidth, navigationWidth, StyledAnchorNavigation, spacing.sm);
|
|
57
57
|
export var StyledContent = /*#__PURE__*/styled.div.withConfig({
|
|
58
58
|
displayName: "StyledContent",
|
|
59
|
-
componentId: "core-
|
|
59
|
+
componentId: "core-12_25_0__sc-1cvdbsv-9"
|
|
60
60
|
})([""]);
|
|
61
61
|
var panelWidth = 400;
|
|
62
62
|
var zIndexes = {
|
|
@@ -69,7 +69,7 @@ export var animationDuration = {
|
|
|
69
69
|
};
|
|
70
70
|
export var StyledFooter = /*#__PURE__*/styled.div.withConfig({
|
|
71
71
|
displayName: "StyledFooter",
|
|
72
|
-
componentId: "core-
|
|
72
|
+
componentId: "core-12_25_0__sc-1cvdbsv-10"
|
|
73
73
|
})(["background-color:", ";", " position:sticky;bottom:0;z-index:", ";", ""], colors.white, function (_ref2) {
|
|
74
74
|
var $hasShadow = _ref2.$hasShadow;
|
|
75
75
|
return $hasShadow && getShadow(2, 'top');
|
|
@@ -79,7 +79,7 @@ export var StyledFooter = /*#__PURE__*/styled.div.withConfig({
|
|
|
79
79
|
});
|
|
80
80
|
export var StyledAside = /*#__PURE__*/styled.div.withConfig({
|
|
81
81
|
displayName: "StyledAside",
|
|
82
|
-
componentId: "core-
|
|
82
|
+
componentId: "core-12_25_0__sc-1cvdbsv-11"
|
|
83
83
|
})(["", " @media ", "{position:absolute;right:0;}"], function (_ref4) {
|
|
84
84
|
var $closed = _ref4.$closed,
|
|
85
85
|
$open = _ref4.$open;
|
|
@@ -99,7 +99,7 @@ var getPanelAnimation = function getPanelAnimation() {
|
|
|
99
99
|
};
|
|
100
100
|
export var StyledAsidePanel = /*#__PURE__*/styled.div.withConfig({
|
|
101
101
|
displayName: "StyledAsidePanel",
|
|
102
|
-
componentId: "core-
|
|
102
|
+
componentId: "core-12_25_0__sc-1cvdbsv-12"
|
|
103
103
|
})(["", " @media ", "{", "}", " ", " border-left:1px solid ", ";width:", "px;position:fixed;background-color:", ";overflow:auto;z-index:", ";", " ", ""], function (_ref7) {
|
|
104
104
|
var $rightOffset = _ref7.$rightOffset;
|
|
105
105
|
return css(["@media ", "{", " border-left:0;z-index:", ";right:", "px;}"], mediaBreakpointsDown.tabletMd, getShadow(2), zIndexes.panelNarrowScreen, $rightOffset);
|
|
@@ -118,7 +118,7 @@ export var StyledAsidePanel = /*#__PURE__*/styled.div.withConfig({
|
|
|
118
118
|
});
|
|
119
119
|
export var StyledPageMain = /*#__PURE__*/styled.div.withConfig({
|
|
120
120
|
displayName: "StyledPageMain",
|
|
121
|
-
componentId: "core-
|
|
121
|
+
componentId: "core-12_25_0__sc-1cvdbsv-13"
|
|
122
122
|
})(["position:relative;max-width:100%;background-color:", ";", " ", ""], colors.gray96, function () {
|
|
123
123
|
return isIE11() && css(["flex:1 0 0%;"]);
|
|
124
124
|
}, function (_ref10) {
|
|
@@ -133,13 +133,13 @@ export var StyledPageMain = /*#__PURE__*/styled.div.withConfig({
|
|
|
133
133
|
});
|
|
134
134
|
export var StyledPageContainer = /*#__PURE__*/styled.div.withConfig({
|
|
135
135
|
displayName: "StyledPageContainer",
|
|
136
|
-
componentId: "core-
|
|
136
|
+
componentId: "core-12_25_0__sc-1cvdbsv-14"
|
|
137
137
|
})(["display:grid;grid-template-columns:1fr auto;", ""], function () {
|
|
138
138
|
return isIE11() && css(["display:flex;flex-wrap:wrap;"]);
|
|
139
139
|
});
|
|
140
140
|
export var StyledAsideFluidContainer = /*#__PURE__*/styled.div.withConfig({
|
|
141
141
|
displayName: "StyledAsideFluidContainer",
|
|
142
|
-
componentId: "core-
|
|
142
|
+
componentId: "core-12_25_0__sc-1cvdbsv-15"
|
|
143
143
|
})(["", ""], function (_ref11) {
|
|
144
144
|
var $closed = _ref11.$closed,
|
|
145
145
|
$open = _ref11.$open;
|
|
@@ -3,6 +3,6 @@ import { colors } from '../../_styles/colors';
|
|
|
3
3
|
import { spacing } from '../../_styles/spacing';
|
|
4
4
|
export var StyledPageFooter = /*#__PURE__*/styled.footer.withConfig({
|
|
5
5
|
displayName: "StyledPageFooter",
|
|
6
|
-
componentId: "core-
|
|
6
|
+
componentId: "core-12_25_0__sc-1f0zfyf-0"
|
|
7
7
|
})(["display:flex;align-items:center;justify-content:space-between;background-color:", ";padding:", "px;width:100%;box-shadow:0 -2px 6px 0 rgba(0,0,0,0.1);position:sticky;bottom:0;"], colors.white, spacing.lg);
|
|
8
8
|
//# sourceMappingURL=PageFooterTemplate.styles.js.map
|
|
@@ -5,16 +5,16 @@ import { colors } from '../../_styles/colors';
|
|
|
5
5
|
import { spacing } from '../../_styles/spacing';
|
|
6
6
|
export var StyledPageHeader = /*#__PURE__*/styled(Page.Header).withConfig({
|
|
7
7
|
displayName: "StyledPageHeader",
|
|
8
|
-
componentId: "core-
|
|
8
|
+
componentId: "core-12_25_0__sc-1d5kop0-0"
|
|
9
9
|
})(["border-bottom:1px solid ", ";padding-top:", "px;", ""], colors.gray85, spacing.lg, function (p) {
|
|
10
10
|
return p.$hasPaddingBottom && "padding-bottom: ".concat(spacing.lg, "px;");
|
|
11
11
|
});
|
|
12
12
|
export var StyledActions = /*#__PURE__*/styled(Box).withConfig({
|
|
13
13
|
displayName: "StyledActions",
|
|
14
|
-
componentId: "core-
|
|
14
|
+
componentId: "core-12_25_0__sc-1d5kop0-1"
|
|
15
15
|
})(["width:fit-content;"]);
|
|
16
16
|
export var StyledToggleActionBox = /*#__PURE__*/styled(Box).withConfig({
|
|
17
17
|
displayName: "StyledToggleActionBox",
|
|
18
|
-
componentId: "core-
|
|
18
|
+
componentId: "core-12_25_0__sc-1d5kop0-2"
|
|
19
19
|
})(["bottom:", "px;position:relative;padding-left:48px;"], spacing.lg);
|
|
20
20
|
//# sourceMappingURL=PageHeaderTemplate.styles.js.map
|
|
@@ -10,10 +10,10 @@ var panelWidthSmall = 360;
|
|
|
10
10
|
export var mobileBreakpoint = 440;
|
|
11
11
|
export var StyledPageAside = /*#__PURE__*/styled(Page.Aside).withConfig({
|
|
12
12
|
displayName: "StyledPageAside",
|
|
13
|
-
componentId: "core-
|
|
13
|
+
componentId: "core-12_25_0__sc-1p7nu53-0"
|
|
14
14
|
})(["position:sticky;top:0;right:0;max-height:100vh;width:100%;height:100%;@media ", "{position:sticky;max-width:", "px;flex-basis:", "px;}", "{@media ", "{max-width:", "px;}}", "{position:sticky;top:0;right:0;box-shadow:none;animation:none;padding-bottom:68px;@media ", "{width:", "px;}@media (max-width:", "px){padding-bottom:0;}}", "{position:fixed;bottom:0;display:flex;width:100%;max-width:400px;@media ", "{max-width:", "px;}}"], mediaBreakpointsDown.tabletLg, panelWidthSmall, panelWidthSmall, StyledAsideFluidContainer, mediaBreakpointsDown.tabletLg, panelWidthSmall, StyledAsidePanel, mediaBreakpointsDown.tabletLg, panelWidthSmall, mobileBreakpoint, StyledPanelFooter, mediaBreakpointsDown.tabletLg, panelWidthSmall);
|
|
15
15
|
export var StyledModal = /*#__PURE__*/styled(Modal).withConfig({
|
|
16
16
|
displayName: "StyledModal",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_25_0__sc-1p7nu53-1"
|
|
18
18
|
})(["top:", "px;bottom:", "px;max-width:416px;transform:none;", "{max-height:100vh;}@media (max-width:", "px){top:0;bottom:0;left:0;right:0;max-width:100%;}"], spacing.md, spacing.md, StyledModalContent, mobileBreakpoint);
|
|
19
19
|
//# sourceMappingURL=PagePaneTemplate.styles.js.map
|
|
@@ -5,14 +5,14 @@ import { spacing } from '../../_styles/spacing';
|
|
|
5
5
|
export var mobileBreakpoint = 440;
|
|
6
6
|
export var StyledPageWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
7
7
|
displayName: "StyledPageWrapper",
|
|
8
|
-
componentId: "core-
|
|
8
|
+
componentId: "core-12_25_0__sc-uuo7st-0"
|
|
9
9
|
})(["display:flex;flex-direction:column;"]);
|
|
10
10
|
export var StyledPageBodyWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
11
11
|
displayName: "StyledPageBodyWrapper",
|
|
12
|
-
componentId: "core-
|
|
12
|
+
componentId: "core-12_25_0__sc-uuo7st-1"
|
|
13
13
|
})(["display:grid;grid-template-columns:1fr auto;"]);
|
|
14
14
|
export var StyledPageBody = /*#__PURE__*/styled(Page.Body).withConfig({
|
|
15
15
|
displayName: "StyledPageBody",
|
|
16
|
-
componentId: "core-
|
|
16
|
+
componentId: "core-12_25_0__sc-uuo7st-2"
|
|
17
17
|
})(["padding-bottom:", "px;@media ", "{padding:", "px;}"], spacing.lg, mediaBreakpointsDown.desktopMd, spacing.md);
|
|
18
18
|
//# sourceMappingURL=PageTemplate.styles.js.map
|
|
@@ -5,22 +5,22 @@ import { Typography } from '../Typography/Typography';
|
|
|
5
5
|
import { spacing } from '../_styles/spacing';
|
|
6
6
|
export var StyledContainer = /*#__PURE__*/styled.div.withConfig({
|
|
7
7
|
displayName: "StyledContainer",
|
|
8
|
-
componentId: "core-
|
|
8
|
+
componentId: "core-12_25_0__sc-fy34i1-0"
|
|
9
9
|
})(["display:flex;align-items:center;"]);
|
|
10
10
|
export var StyledPageCount = /*#__PURE__*/styled(Typography).withConfig({
|
|
11
11
|
displayName: "StyledPageCount",
|
|
12
|
-
componentId: "core-
|
|
12
|
+
componentId: "core-12_25_0__sc-fy34i1-1"
|
|
13
13
|
})(["margin-right:", "px;"], spacing.xl);
|
|
14
14
|
export var StyledCurrentPage = /*#__PURE__*/styled(Typography).withConfig({
|
|
15
15
|
displayName: "StyledCurrentPage",
|
|
16
|
-
componentId: "core-
|
|
16
|
+
componentId: "core-12_25_0__sc-fy34i1-2"
|
|
17
17
|
})(["margin-right:", "px;"], spacing.sm);
|
|
18
18
|
export var StyledButton = /*#__PURE__*/styled(Button).withConfig({
|
|
19
19
|
displayName: "StyledButton",
|
|
20
|
-
componentId: "core-
|
|
20
|
+
componentId: "core-12_25_0__sc-fy34i1-3"
|
|
21
21
|
})(["margin-left:", "px;"], spacing.sm);
|
|
22
22
|
export var StyledOverlay = /*#__PURE__*/styled(Card).withConfig({
|
|
23
23
|
displayName: "StyledOverlay",
|
|
24
|
-
componentId: "core-
|
|
24
|
+
componentId: "core-12_25_0__sc-fy34i1-4"
|
|
25
25
|
})(["max-height:300px;max-width:248px;"]);
|
|
26
26
|
//# sourceMappingURL=Pagination.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationSelect.js","names":["times","React","DropdownButton","MenuImperative","OverlayTrigger","useOverlayTriggerContext","StyledOverlay","noop","PaginationMenu","forwardRef","_ref","ref","activePage","menuRef","_ref$onSelect","onSelect","onSelect_","pages","props","_objectWithoutProperties","_excluded","ctx","lastItemRef","useRef","hasFooter","useEffect","_menuRef$current","current","highlightFirst","_menuRef$current2","_menuRef$current3","highlightSuggested","highlightSelected","onKeyDown","event","_menuRef$current4","currentPage","highlighted","key","_menuRef$current5","highlight","_menuRef$current6","stopPropagation","highlightLast","selection","hide","children","index","page","createElement","Item","item","selected","shadowStrength","_extends","circular","Fragment","Options","slice","Footer","padding","length","PaginationSelect","_ref2","_ref2$activePage","ariaLabelledby","disabled","id","_ref2$pages","afterShow","_menuRef$current7","_menuRef$current7$el","_menuRef$current7$el$","el","firstChild","focus","e","_menuRef$current8","preventDefault","prev","_menuRef$current9","next","_menuRef$current0","select","role","passA11yPropsToOverlay","autoFocus","overlay","placement","trigger","arrow","variant"],"sources":["../../src/Pagination/PaginationSelect.tsx"],"sourcesContent":["import { times } from 'ramda'\nimport React from 'react'\nimport { DropdownButton } from '../Dropdown/Dropdown'\nimport { MenuImperative } from '../MenuImperative/MenuImperative'\nimport type { MenuRef, Selection } from '../MenuImperative/MenuImperative.types'\nimport {\n OverlayTrigger,\n useOverlayTriggerContext,\n} from '../OverlayTrigger/OverlayTrigger'\nimport { StyledOverlay } from './Pagination.styles'\nimport type { PageSelectProps, PaginationMenuProps } from './Pagination.types'\n\nconst noop = () => {}\n\nconst PaginationMenu = React.forwardRef<HTMLDivElement, PaginationMenuProps>(\n function PaginationMenu(\n { activePage, menuRef, onSelect: onSelect_ = noop, pages, ...props },\n ref\n ) {\n const ctx = useOverlayTriggerContext()\n\n const lastItemRef = React.useRef<HTMLDivElement>(null)\n\n const hasFooter = pages > 10\n\n React.useEffect(() => {\n menuRef.current?.highlightFirst()\n }, [menuRef])\n\n React.useEffect(() => {\n menuRef.current?.highlightSuggested()\n menuRef.current?.highlightSelected()\n }, [menuRef])\n\n function onKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n const currentPage = menuRef.current?.highlighted()\n\n if (event.key === 'ArrowDown' || event.key === 'Down') {\n // when on the second to last item, want to jump to the last item (in the footer)\n if (currentPage === pages - 1 && lastItemRef.current) {\n menuRef.current?.highlight(lastItemRef.current)\n }\n } else if (event.key === 'ArrowUp' || event.key === 'Up') {\n // on the last item (in the footer), want to jump back to the second to last\n // item back in the menu\n if (hasFooter && currentPage === pages) {\n event.stopPropagation()\n menuRef.current?.highlightLast()\n }\n }\n }\n\n function onSelect(selection: Selection) {\n onSelect_(selection)\n\n ctx.hide(selection.event)\n }\n\n const children = times((index: number) => {\n const page = index + 1\n\n return (\n <MenuImperative.Item\n item={page}\n key={index}\n selected={page === activePage}\n ref={lastItemRef}\n >\n {page}\n </MenuImperative.Item>\n )\n }, pages)\n\n return (\n <StyledOverlay ref={ref} shadowStrength={2}>\n <MenuImperative\n circular\n {...props}\n ref={menuRef}\n onKeyDown={onKeyDown}\n onSelect={onSelect}\n >\n {hasFooter ? (\n <>\n <MenuImperative.Options>\n {children.slice(0, -1)}\n </MenuImperative.Options>\n <MenuImperative.Footer padding=\"xs none\">\n {children[children.length - 1]}\n </MenuImperative.Footer>\n </>\n ) : (\n <MenuImperative.Options>{children}</MenuImperative.Options>\n )}\n </MenuImperative>\n </StyledOverlay>\n )\n }\n)\n\nexport const PaginationSelect = React.forwardRef<\n HTMLButtonElement,\n PageSelectProps\n>(function PaginationSelect(\n {\n activePage = 1,\n [`aria-labelledby`]: ariaLabelledby,\n disabled,\n id,\n onSelect,\n pages = 0,\n ...props\n },\n ref\n) {\n const menuRef = React.useRef<MenuRef>(null)\n\n // Safari has an issue with giving focus to buttons after clicking on them\n // if the button or menu do not have focus, the keyboard navigation does not work,\n // so just focus the menu when we open it\n function afterShow() {\n // this is brittle, if MenuImperative dom structure changes this could break\n // but super specific to pagination, not really a concern elsewhere\n ;(menuRef.current?.el?.firstChild as HTMLDivElement)?.focus()\n }\n\n function onKeyDown(e: React.KeyboardEvent<HTMLButtonElement>) {\n if (e.key === 'Up' || e.key === 'ArrowUp') {\n e.preventDefault()\n menuRef.current?.prev()\n } else if (e.key === 'Down' || e.key === 'ArrowDown') {\n e.preventDefault()\n menuRef.current?.next()\n } else if (e.key === 'Enter') {\n e.preventDefault()\n menuRef.current?.select(e)\n }\n }\n\n return (\n <OverlayTrigger\n role=\"listbox\"\n passA11yPropsToOverlay\n autoFocus\n afterShow={afterShow}\n overlay={\n <PaginationMenu\n activePage={activePage}\n menuRef={menuRef}\n onSelect={onSelect}\n pages={pages}\n />\n }\n placement=\"bottom-left\"\n ref={ref}\n trigger=\"click\"\n {...props}\n >\n <DropdownButton\n aria-labelledby={ariaLabelled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O,CAACc,OAAO,cAAAqD,iBAAA,uBAAfA,iBAAA,CAAiBC,IAAI,CAAC,CAAC;IACzB,CAAC,MAAM,IAAIL,CAAC,CAACtC,GAAG,KAAK,OAAO,EAAE;MAAA,IAAA4C,iBAAA;MAC5BN,CAAC,CAACE,cAAc,CAAC,CAAC;MAClB,CAAAI,iBAAA,GAAArE,OAAO,CAACc,OAAO,cAAAuD,iBAAA,uBAAfA,iBAAA,CAAiBC,MAAM,CAACP,CAAC,CAAC;IAC5B;EACF;EAEA,oBACE3E,KAAA,CAAAgD,aAAA,CAAC7C,cAAc,EAAAkD,QAAA;IACb8B,IAAI,EAAC,SAAS;IACdC,sBAAsB;IACtBC,SAAS;IACTjB,SAAS,EAAEA,SAAU;IACrBkB,OAAO,eACLtF,KAAA,CAAAgD,aAAA,CAACzC,cAAc;MACbI,UAAU,EAAEA,UAAW;MACvBC,OAAO,EAAEA,OAAQ;MACjBE,QAAQ,EAAEA,QAAS;MACnBE,KAAK,EAAEA;IAAM,CACd,CACF;IACDuE,SAAS,EAAC,aAAa;IACvB7E,GAAG,EAAEA,GAAI;IACT8E,OAAO,EAAC;EAAO,GACXvE,KAAK,gBAETjB,KAAA,CAAAgD,aAAA,CAAC/C,cAAc;IACb,mBAAiB+D,cAAe;IAChCyB,KAAK;IACLxB,QAAQ,EAAEA,QAAS;IACnBC,EAAE,EAAEA,EAAG;IACPlC,SAAS,EAAEA,SAAU;IACrB0D,OAAO,EAAC;EAAU,GAEjB/E,UACa,CACF,CAAC;AAErB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"PaginationSelect.js","names":["times","React","DropdownButton","MenuImperative","OverlayTrigger","useOverlayTriggerContext","StyledOverlay","noop","PaginationMenu","forwardRef","_ref","ref","activePage","menuRef","_ref$onSelect","onSelect","onSelect_","pages","props","_objectWithoutProperties","_excluded","ctx","lastItemRef","useRef","hasFooter","useEffect","_menuRef$current","current","highlightFirst","_menuRef$current2","_menuRef$current3","highlightSuggested","highlightSelected","onKeyDown","event","_menuRef$current4","currentPage","highlighted","key","_menuRef$current5","highlight","_menuRef$current6","stopPropagation","highlightLast","selection","hide","children","index","page","createElement","Item","item","selected","shadowStrength","_extends","circular","Fragment","Options","slice","Footer","padding","length","PaginationSelect","_ref2","_ref2$activePage","ariaLabelledby","disabled","id","_ref2$pages","afterShow","_menuRef$current7","_menuRef$current7$el","_menuRef$current7$el$","el","firstChild","focus","e","_menuRef$current8","preventDefault","prev","_menuRef$current9","next","_menuRef$current0","select","role","passA11yPropsToOverlay","autoFocus","overlay","placement","trigger","arrow","variant"],"sources":["../../src/Pagination/PaginationSelect.tsx"],"sourcesContent":["import { times } from 'ramda'\nimport React from 'react'\nimport { DropdownButton } from '../Dropdown/Dropdown'\nimport { MenuImperative } from '../MenuImperative/MenuImperative'\nimport type { MenuRef, Selection } from '../MenuImperative/MenuImperative.types'\nimport {\n OverlayTrigger,\n useOverlayTriggerContext,\n} from '../OverlayTrigger/OverlayTrigger'\nimport { StyledOverlay } from './Pagination.styles'\nimport type { PageSelectProps, PaginationMenuProps } from './Pagination.types'\n\nconst noop = () => {}\n\nconst PaginationMenu = React.forwardRef<HTMLDivElement, PaginationMenuProps>(\n function PaginationMenu(\n { activePage, menuRef, onSelect: onSelect_ = noop, pages, ...props },\n ref\n ) {\n const ctx = useOverlayTriggerContext()\n\n const lastItemRef = React.useRef<HTMLDivElement>(null)\n\n const hasFooter = pages > 10\n\n React.useEffect(() => {\n menuRef.current?.highlightFirst()\n }, [menuRef])\n\n React.useEffect(() => {\n menuRef.current?.highlightSuggested()\n menuRef.current?.highlightSelected()\n }, [menuRef])\n\n function onKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n const currentPage = menuRef.current?.highlighted()\n\n if (event.key === 'ArrowDown' || event.key === 'Down') {\n // when on the second to last item, want to jump to the last item (in the footer)\n if (currentPage === pages - 1 && lastItemRef.current) {\n menuRef.current?.highlight(lastItemRef.current)\n }\n } else if (event.key === 'ArrowUp' || event.key === 'Up') {\n // on the last item (in the footer), want to jump back to the second to last\n // item back in the menu\n if (hasFooter && currentPage === pages) {\n event.stopPropagation()\n menuRef.current?.highlightLast()\n }\n }\n }\n\n function onSelect(selection: Selection) {\n onSelect_(selection)\n\n ctx.hide(selection.event)\n }\n\n const children = times((index: number) => {\n const page = index + 1\n\n return (\n <MenuImperative.Item\n item={page}\n key={index}\n selected={page === activePage}\n ref={lastItemRef}\n >\n {page}\n </MenuImperative.Item>\n )\n }, pages)\n\n return (\n <StyledOverlay ref={ref} shadowStrength={2}>\n <MenuImperative\n circular\n {...props}\n ref={menuRef}\n onKeyDown={onKeyDown}\n onSelect={onSelect}\n >\n {hasFooter ? (\n <>\n <MenuImperative.Options>\n {children.slice(0, -1)}\n </MenuImperative.Options>\n <MenuImperative.Footer padding=\"xs none\">\n {children[children.length - 1]}\n </MenuImperative.Footer>\n </>\n ) : (\n <MenuImperative.Options>{children}</MenuImperative.Options>\n )}\n </MenuImperative>\n </StyledOverlay>\n )\n }\n)\n\nexport const PaginationSelect = React.forwardRef<\n HTMLButtonElement,\n PageSelectProps\n>(function PaginationSelect(\n {\n activePage = 1,\n [`aria-labelledby`]: ariaLabelledby,\n disabled,\n id,\n onSelect,\n pages = 0,\n ...props\n },\n ref\n) {\n const menuRef = React.useRef<MenuRef>(null)\n\n // Safari has an issue with giving focus to buttons after clicking on them\n // if the button or menu do not have focus, the keyboard navigation does not work,\n // so just focus the menu when we open it\n function afterShow() {\n // this is brittle, if MenuImperative dom structure changes this could break\n // but super specific to pagination, not really a concern elsewhere\n ;(menuRef.current?.el?.firstChild as HTMLDivElement)?.focus()\n }\n\n function onKeyDown(e: React.KeyboardEvent<HTMLButtonElement>) {\n if (e.key === 'Up' || e.key === 'ArrowUp') {\n e.preventDefault()\n menuRef.current?.prev()\n } else if (e.key === 'Down' || e.key === 'ArrowDown') {\n e.preventDefault()\n menuRef.current?.next()\n } else if (e.key === 'Enter') {\n e.preventDefault()\n menuRef.current?.select(e)\n }\n }\n\n return (\n <OverlayTrigger\n role=\"listbox\"\n passA11yPropsToOverlay\n autoFocus\n afterShow={afterShow}\n overlay={\n <PaginationMenu\n activePage={activePage}\n menuRef={menuRef}\n onSelect={onSelect}\n pages={pages}\n />\n }\n placement=\"bottom-left\"\n ref={ref}\n trigger=\"click\"\n {...props}\n >\n <DropdownButton\n aria-labelledby={ariaLabelledby}\n arrow\n disabled={disabled}\n id={id}\n onKeyDown={onKeyDown}\n role=\"combobox\"\n variant=\"tertiary\"\n >\n {activePage}\n </DropdownButton>\n </OverlayTrigger>\n )\n})\n"],"mappings":";;;;AAAA,SAASA,KAAK,QAAQ,OAAO;AAC7B,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,cAAc,QAAQ,kCAAkC;AAEjE,SACEC,cAAc,EACdC,wBAAwB,QACnB,kCAAkC;AACzC,SAASC,aAAa,QAAQ,qBAAqB;AAGnD,IAAMC,IAAI,GAAG,SAAPA,IAAIA,CAAA,EAAS,CAAC,CAAC;AAErB,IAAMC,cAAc,gBAAGP,KAAK,CAACQ,UAAU,CACrC,SAASD,cAAcA,CAAAE,IAAA,EAErBC,GAAG,EACH;EAAA,IAFEC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IAAAC,aAAA,GAAAJ,IAAA,CAAEK,QAAQ;IAAEC,SAAS,GAAAF,aAAA,cAAGP,IAAI,GAAAO,aAAA;IAAEG,KAAK,GAAAP,IAAA,CAALO,KAAK;IAAKC,KAAK,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA;EAGlE,IAAMC,GAAG,GAAGhB,wBAAwB,CAAC,CAAC;EAEtC,IAAMiB,WAAW,GAAGrB,KAAK,CAACsB,MAAM,CAAiB,IAAI,CAAC;EAEtD,IAAMC,SAAS,GAAGP,KAAK,GAAG,EAAE;EAE5BhB,KAAK,CAACwB,SAAS,CAAC,YAAM;IAAA,IAAAC,gBAAA;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