@papillonarts/components 0.49.0 → 0.49.2
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/LICENSE +1 -1
- package/build/Legacy/Alert/Alert.const.d.ts +4 -0
- package/build/Legacy/Alert/Alert.const.d.ts.map +1 -0
- package/build/Legacy/Alert/Alert.const.js +26 -0
- package/build/Legacy/Alert/Alert.d.ts +2 -2
- package/build/Legacy/Alert/Alert.d.ts.map +1 -1
- package/build/Legacy/Alert/Alert.js +47 -49
- package/build/Legacy/Alert/Alert.type.d.ts +0 -2
- package/build/Legacy/Alert/Alert.type.d.ts.map +1 -1
- package/build/Legacy/Alert/Alert.type.js +1 -24
- package/build/Legacy/Alert/index.d.ts +1 -1
- package/build/Legacy/Alert/index.d.ts.map +1 -1
- package/build/Legacy/Alert/index.js +3 -3
- package/build/Legacy/Blankslate/Blankslate.const.d.ts +4 -0
- package/build/Legacy/Blankslate/Blankslate.const.d.ts.map +1 -0
- package/build/Legacy/Blankslate/Blankslate.const.js +18 -0
- package/build/Legacy/Blankslate/Blankslate.d.ts +1 -1
- package/build/Legacy/Blankslate/Blankslate.d.ts.map +1 -1
- package/build/Legacy/Blankslate/Blankslate.js +17 -14
- package/build/Legacy/Blankslate/Blankslate.type.d.ts +0 -2
- package/build/Legacy/Blankslate/Blankslate.type.d.ts.map +1 -1
- package/build/Legacy/Blankslate/Blankslate.type.js +1 -14
- package/build/Legacy/Blankslate/index.d.ts +1 -1
- package/build/Legacy/Blankslate/index.d.ts.map +1 -1
- package/build/Legacy/Blankslate/index.js +3 -3
- package/build/Legacy/Breadcrumb/Breadcrumb.const.d.ts +4 -0
- package/build/Legacy/Breadcrumb/Breadcrumb.const.d.ts.map +1 -0
- package/build/Legacy/Breadcrumb/Breadcrumb.const.js +14 -0
- package/build/Legacy/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/build/Legacy/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/build/Legacy/Breadcrumb/Breadcrumb.js +50 -46
- package/build/Legacy/Breadcrumb/Breadcrumb.type.d.ts +0 -2
- package/build/Legacy/Breadcrumb/Breadcrumb.type.d.ts.map +1 -1
- package/build/Legacy/Breadcrumb/Breadcrumb.type.js +1 -10
- package/build/Legacy/Breadcrumb/index.d.ts +1 -1
- package/build/Legacy/Breadcrumb/index.d.ts.map +1 -1
- package/build/Legacy/Breadcrumb/index.js +3 -3
- package/build/Legacy/Button/Button.const.d.ts +9 -0
- package/build/Legacy/Button/Button.const.d.ts.map +1 -0
- package/build/Legacy/Button/Button.const.js +48 -0
- package/build/Legacy/Button/Button.d.ts +1 -1
- package/build/Legacy/Button/Button.d.ts.map +1 -1
- package/build/Legacy/Button/Button.js +60 -66
- package/build/Legacy/Button/Button.type.d.ts +0 -7
- package/build/Legacy/Button/Button.type.d.ts.map +1 -1
- package/build/Legacy/Button/Button.type.js +1 -44
- package/build/Legacy/Button/index.d.ts +1 -1
- package/build/Legacy/Button/index.d.ts.map +1 -1
- package/build/Legacy/Button/index.js +8 -8
- package/build/Legacy/Dropdown/Dropdown.const.d.ts +4 -0
- package/build/Legacy/Dropdown/Dropdown.const.d.ts.map +1 -0
- package/build/Legacy/Dropdown/Dropdown.const.js +18 -0
- package/build/Legacy/Dropdown/Dropdown.d.ts +1 -1
- package/build/Legacy/Dropdown/Dropdown.d.ts.map +1 -1
- package/build/Legacy/Dropdown/Dropdown.js +49 -51
- package/build/Legacy/Dropdown/Dropdown.type.d.ts +0 -2
- package/build/Legacy/Dropdown/Dropdown.type.d.ts.map +1 -1
- package/build/Legacy/Dropdown/Dropdown.type.js +1 -14
- package/build/Legacy/Dropdown/index.d.ts +2 -1
- package/build/Legacy/Dropdown/index.d.ts.map +1 -1
- package/build/Legacy/Dropdown/index.js +3 -3
- package/build/Legacy/ErrorBoundary/ErrorBoundary.d.ts +3 -2
- package/build/Legacy/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/build/Legacy/ErrorBoundary/ErrorBoundary.js +31 -45
- package/build/Legacy/ErrorBoundary/index.js +1 -1
- package/build/Legacy/Form/Checkbox/Checkbox.const.d.ts +5 -0
- package/build/Legacy/Form/Checkbox/Checkbox.const.d.ts.map +1 -0
- package/build/Legacy/Form/Checkbox/Checkbox.const.js +22 -0
- package/build/Legacy/Form/Checkbox/Checkbox.d.ts +1 -1
- package/build/Legacy/Form/Checkbox/Checkbox.d.ts.map +1 -1
- package/build/Legacy/Form/Checkbox/Checkbox.js +22 -25
- package/build/Legacy/Form/Checkbox/Checkbox.type.d.ts +0 -3
- package/build/Legacy/Form/Checkbox/Checkbox.type.d.ts.map +1 -1
- package/build/Legacy/Form/Checkbox/Checkbox.type.js +1 -18
- package/build/Legacy/Form/Checkbox/index.d.ts +1 -1
- package/build/Legacy/Form/Checkbox/index.d.ts.map +1 -1
- package/build/Legacy/Form/Checkbox/index.js +3 -3
- package/build/Legacy/Form/Input/Input.const.d.ts +5 -0
- package/build/Legacy/Form/Input/Input.const.d.ts.map +1 -0
- package/build/Legacy/Form/Input/Input.const.js +30 -0
- package/build/Legacy/Form/Input/Input.d.ts +1 -1
- package/build/Legacy/Form/Input/Input.d.ts.map +1 -1
- package/build/Legacy/Form/Input/Input.js +25 -32
- package/build/Legacy/Form/Input/Input.type.d.ts +0 -3
- package/build/Legacy/Form/Input/Input.type.d.ts.map +1 -1
- package/build/Legacy/Form/Input/Input.type.js +1 -26
- package/build/Legacy/Form/Input/index.d.ts +1 -1
- package/build/Legacy/Form/Input/index.d.ts.map +1 -1
- package/build/Legacy/Form/Input/index.js +4 -4
- package/build/Legacy/Form/Radio/Radio.const.d.ts +5 -0
- package/build/Legacy/Form/Radio/Radio.const.d.ts.map +1 -0
- package/build/Legacy/Form/Radio/Radio.const.js +22 -0
- package/build/Legacy/Form/Radio/Radio.d.ts +1 -1
- package/build/Legacy/Form/Radio/Radio.d.ts.map +1 -1
- package/build/Legacy/Form/Radio/Radio.js +19 -24
- package/build/Legacy/Form/Radio/Radio.type.d.ts +0 -3
- package/build/Legacy/Form/Radio/Radio.type.d.ts.map +1 -1
- package/build/Legacy/Form/Radio/Radio.type.js +1 -18
- package/build/Legacy/Form/Radio/index.d.ts +1 -1
- package/build/Legacy/Form/Radio/index.d.ts.map +1 -1
- package/build/Legacy/Form/Radio/index.js +3 -3
- package/build/Legacy/Form/index.js +1 -1
- package/build/Legacy/Grid/DisplayTable/DisplayTable.const.d.ts +3 -0
- package/build/Legacy/Grid/DisplayTable/DisplayTable.const.d.ts.map +1 -0
- package/build/Legacy/Grid/DisplayTable/DisplayTable.const.js +11 -0
- package/build/Legacy/Grid/DisplayTable/DisplayTable.d.ts +1 -1
- package/build/Legacy/Grid/DisplayTable/DisplayTable.d.ts.map +1 -1
- package/build/Legacy/Grid/DisplayTable/DisplayTable.js +26 -31
- package/build/Legacy/Grid/DisplayTable/DisplayTable.type.d.ts +0 -1
- package/build/Legacy/Grid/DisplayTable/DisplayTable.type.d.ts.map +1 -1
- package/build/Legacy/Grid/DisplayTable/DisplayTable.type.js +1 -7
- package/build/Legacy/Grid/DisplayTable/index.js +1 -1
- package/build/Legacy/Grid/FlexGrid/FlexGrid.const.d.ts +5 -0
- package/build/Legacy/Grid/FlexGrid/FlexGrid.const.d.ts.map +1 -0
- package/build/Legacy/Grid/FlexGrid/FlexGrid.const.js +28 -0
- package/build/Legacy/Grid/FlexGrid/FlexGrid.d.ts +1 -1
- package/build/Legacy/Grid/FlexGrid/FlexGrid.d.ts.map +1 -1
- package/build/Legacy/Grid/FlexGrid/FlexGrid.js +148 -167
- package/build/Legacy/Grid/FlexGrid/FlexGrid.type.d.ts +1 -4
- package/build/Legacy/Grid/FlexGrid/FlexGrid.type.d.ts.map +1 -1
- package/build/Legacy/Grid/FlexGrid/FlexGrid.type.js +1 -24
- package/build/Legacy/Grid/FlexGrid/index.d.ts +1 -1
- package/build/Legacy/Grid/FlexGrid/index.d.ts.map +1 -1
- package/build/Legacy/Grid/FlexGrid/index.js +4 -4
- package/build/Legacy/Grid/index.js +1 -1
- package/build/Legacy/Icon/Icon.const.d.ts +656 -0
- package/build/Legacy/Icon/Icon.const.d.ts.map +1 -0
- package/build/Legacy/Icon/Icon.const.js +678 -0
- package/build/Legacy/Icon/Icon.d.ts +1 -1
- package/build/Legacy/Icon/Icon.d.ts.map +1 -1
- package/build/Legacy/Icon/Icon.js +33 -44
- package/build/Legacy/Icon/Icon.part.js +645 -645
- package/build/Legacy/Icon/Icon.type.d.ts +0 -654
- package/build/Legacy/Icon/Icon.type.d.ts.map +1 -1
- package/build/Legacy/Icon/Icon.type.js +1 -674
- package/build/Legacy/Icon/index.d.ts +1 -1
- package/build/Legacy/Icon/index.d.ts.map +1 -1
- package/build/Legacy/Icon/index.js +4 -4
- package/build/Legacy/Label/Label.const.d.ts +6 -0
- package/build/Legacy/Label/Label.const.d.ts.map +1 -0
- package/build/Legacy/Label/Label.const.js +26 -0
- package/build/Legacy/Label/Label.d.ts +1 -1
- package/build/Legacy/Label/Label.d.ts.map +1 -1
- package/build/Legacy/Label/Label.js +16 -15
- package/build/Legacy/Label/Label.type.d.ts +0 -4
- package/build/Legacy/Label/Label.type.d.ts.map +1 -1
- package/build/Legacy/Label/Label.type.js +1 -22
- package/build/Legacy/Label/index.js +1 -1
- package/build/Legacy/Loader/Loader.const.d.ts +4 -0
- package/build/Legacy/Loader/Loader.const.d.ts.map +1 -0
- package/build/Legacy/Loader/Loader.const.js +15 -0
- package/build/Legacy/Loader/Loader.d.ts +1 -1
- package/build/Legacy/Loader/Loader.d.ts.map +1 -1
- package/build/Legacy/Loader/Loader.js +19 -19
- package/build/Legacy/Loader/Loader.type.d.ts +0 -2
- package/build/Legacy/Loader/Loader.type.d.ts.map +1 -1
- package/build/Legacy/Loader/Loader.type.js +1 -11
- package/build/Legacy/Loader/index.d.ts +1 -1
- package/build/Legacy/Loader/index.d.ts.map +1 -1
- package/build/Legacy/Loader/index.js +3 -3
- package/build/Legacy/Markdown/Markdown.const.d.ts +4 -0
- package/build/Legacy/Markdown/Markdown.const.d.ts.map +1 -0
- package/build/Legacy/Markdown/Markdown.const.js +14 -0
- package/build/Legacy/Markdown/Markdown.d.ts +1 -1
- package/build/Legacy/Markdown/Markdown.d.ts.map +1 -1
- package/build/Legacy/Markdown/Markdown.js +20 -16
- package/build/Legacy/Markdown/Markdown.type.d.ts +0 -2
- package/build/Legacy/Markdown/Markdown.type.d.ts.map +1 -1
- package/build/Legacy/Markdown/Markdown.type.js +1 -10
- package/build/Legacy/Markdown/index.js +1 -1
- package/build/Legacy/Navigation/Menu/Menu.const.d.ts +3 -0
- package/build/Legacy/Navigation/Menu/Menu.const.d.ts.map +1 -0
- package/build/Legacy/Navigation/Menu/Menu.const.js +10 -0
- package/build/Legacy/Navigation/Menu/Menu.d.ts +1 -1
- package/build/Legacy/Navigation/Menu/Menu.d.ts.map +1 -1
- package/build/Legacy/Navigation/Menu/Menu.js +40 -42
- package/build/Legacy/Navigation/Menu/Menu.type.d.ts +0 -1
- package/build/Legacy/Navigation/Menu/Menu.type.d.ts.map +1 -1
- package/build/Legacy/Navigation/Menu/Menu.type.js +1 -6
- package/build/Legacy/Navigation/Menu/index.js +1 -1
- package/build/Legacy/Navigation/TabNav/TabNav.const.d.ts +4 -0
- package/build/Legacy/Navigation/TabNav/TabNav.const.d.ts.map +1 -0
- package/build/Legacy/Navigation/TabNav/TabNav.const.js +16 -0
- package/build/Legacy/Navigation/TabNav/TabNav.d.ts +1 -1
- package/build/Legacy/Navigation/TabNav/TabNav.d.ts.map +1 -1
- package/build/Legacy/Navigation/TabNav/TabNav.js +79 -79
- package/build/Legacy/Navigation/TabNav/TabNav.type.d.ts +1 -3
- package/build/Legacy/Navigation/TabNav/TabNav.type.d.ts.map +1 -1
- package/build/Legacy/Navigation/TabNav/TabNav.type.js +1 -12
- package/build/Legacy/Navigation/TabNav/index.d.ts +1 -1
- package/build/Legacy/Navigation/TabNav/index.d.ts.map +1 -1
- package/build/Legacy/Navigation/TabNav/index.js +3 -3
- package/build/Legacy/Navigation/UnderlineNav/UnderlineNav.const.d.ts +5 -0
- package/build/Legacy/Navigation/UnderlineNav/UnderlineNav.const.d.ts.map +1 -0
- package/build/Legacy/Navigation/UnderlineNav/UnderlineNav.const.js +20 -0
- package/build/Legacy/Navigation/UnderlineNav/UnderlineNav.d.ts +1 -1
- package/build/Legacy/Navigation/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/build/Legacy/Navigation/UnderlineNav/UnderlineNav.js +64 -63
- package/build/Legacy/Navigation/UnderlineNav/UnderlineNav.type.d.ts +0 -3
- package/build/Legacy/Navigation/UnderlineNav/UnderlineNav.type.d.ts.map +1 -1
- package/build/Legacy/Navigation/UnderlineNav/UnderlineNav.type.js +1 -16
- package/build/Legacy/Navigation/UnderlineNav/index.d.ts +1 -1
- package/build/Legacy/Navigation/UnderlineNav/index.d.ts.map +1 -1
- package/build/Legacy/Navigation/UnderlineNav/index.js +4 -4
- package/build/Legacy/Navigation/index.js +1 -1
- package/build/Legacy/Pagination/PreviousNext/PreviousNext.const.d.ts +4 -0
- package/build/Legacy/Pagination/PreviousNext/PreviousNext.const.d.ts.map +1 -0
- package/build/Legacy/Pagination/PreviousNext/PreviousNext.const.js +30 -0
- package/build/Legacy/Pagination/PreviousNext/PreviousNext.d.ts +1 -1
- package/build/Legacy/Pagination/PreviousNext/PreviousNext.d.ts.map +1 -1
- package/build/Legacy/Pagination/PreviousNext/PreviousNext.js +46 -40
- package/build/Legacy/Pagination/PreviousNext/PreviousNext.type.d.ts +0 -2
- package/build/Legacy/Pagination/PreviousNext/PreviousNext.type.d.ts.map +1 -1
- package/build/Legacy/Pagination/PreviousNext/PreviousNext.type.js +1 -26
- package/build/Legacy/Pagination/PreviousNext/index.d.ts +1 -1
- package/build/Legacy/Pagination/PreviousNext/index.d.ts.map +1 -1
- package/build/Legacy/Pagination/PreviousNext/index.js +3 -3
- package/build/Legacy/Pagination/index.js +1 -1
- package/build/Legacy/Popover/Popover.const.d.ts +5 -0
- package/build/Legacy/Popover/Popover.const.d.ts.map +1 -0
- package/build/Legacy/Popover/Popover.const.js +29 -0
- package/build/Legacy/Popover/Popover.d.ts +1 -1
- package/build/Legacy/Popover/Popover.d.ts.map +1 -1
- package/build/Legacy/Popover/Popover.js +41 -25
- package/build/Legacy/Popover/Popover.type.d.ts +0 -3
- package/build/Legacy/Popover/Popover.type.d.ts.map +1 -1
- package/build/Legacy/Popover/Popover.type.js +1 -25
- package/build/Legacy/Popover/index.d.ts +1 -1
- package/build/Legacy/Popover/index.d.ts.map +1 -1
- package/build/Legacy/Popover/index.js +4 -4
- package/build/Legacy/Progress/Progress.const.d.ts +4 -0
- package/build/Legacy/Progress/Progress.const.d.ts.map +1 -0
- package/build/Legacy/Progress/Progress.const.js +15 -0
- package/build/Legacy/Progress/Progress.d.ts +1 -1
- package/build/Legacy/Progress/Progress.d.ts.map +1 -1
- package/build/Legacy/Progress/Progress.js +15 -14
- package/build/Legacy/Progress/Progress.type.d.ts +0 -2
- package/build/Legacy/Progress/Progress.type.d.ts.map +1 -1
- package/build/Legacy/Progress/Progress.type.js +1 -11
- package/build/Legacy/Progress/index.d.ts +1 -1
- package/build/Legacy/Progress/index.d.ts.map +1 -1
- package/build/Legacy/Progress/index.js +3 -3
- package/build/Legacy/Select/Select.const.d.ts +4 -0
- package/build/Legacy/Select/Select.const.d.ts.map +1 -0
- package/build/Legacy/Select/Select.const.js +15 -0
- package/build/Legacy/Select/Select.d.ts +1 -1
- package/build/Legacy/Select/Select.d.ts.map +1 -1
- package/build/Legacy/Select/Select.js +31 -35
- package/build/Legacy/Select/Select.type.d.ts +0 -2
- package/build/Legacy/Select/Select.type.d.ts.map +1 -1
- package/build/Legacy/Select/Select.type.js +1 -11
- package/build/Legacy/Select/index.d.ts +1 -1
- package/build/Legacy/Select/index.d.ts.map +1 -1
- package/build/Legacy/Select/index.js +3 -3
- package/build/Legacy/SelectMenu/SelectMenu.const.d.ts +3 -0
- package/build/Legacy/SelectMenu/SelectMenu.const.d.ts.map +1 -0
- package/build/Legacy/SelectMenu/SelectMenu.const.js +10 -0
- package/build/Legacy/SelectMenu/SelectMenu.d.ts +1 -1
- package/build/Legacy/SelectMenu/SelectMenu.d.ts.map +1 -1
- package/build/Legacy/SelectMenu/SelectMenu.js +42 -46
- package/build/Legacy/SelectMenu/SelectMenu.type.d.ts +0 -1
- package/build/Legacy/SelectMenu/SelectMenu.type.d.ts.map +1 -1
- package/build/Legacy/SelectMenu/SelectMenu.type.js +1 -6
- package/build/Legacy/SelectMenu/index.js +1 -1
- package/build/Legacy/Subhead/Subhead.const.d.ts +3 -0
- package/build/Legacy/Subhead/Subhead.const.d.ts.map +1 -0
- package/build/Legacy/Subhead/Subhead.const.js +10 -0
- package/build/Legacy/Subhead/Subhead.d.ts +1 -1
- package/build/Legacy/Subhead/Subhead.d.ts.map +1 -1
- package/build/Legacy/Subhead/Subhead.js +12 -12
- package/build/Legacy/Subhead/Subhead.type.d.ts +0 -1
- package/build/Legacy/Subhead/Subhead.type.d.ts.map +1 -1
- package/build/Legacy/Subhead/Subhead.type.js +1 -6
- package/build/Legacy/Subhead/index.js +1 -1
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighter.const.d.ts +6 -0
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighter.const.d.ts.map +1 -0
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighter.const.js +25 -0
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighter.d.ts +1 -1
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighter.d.ts.map +1 -1
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighter.js +7 -9
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighter.type.d.ts +0 -4
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighter.type.d.ts.map +1 -1
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighter.type.js +1 -21
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighterHLJS.d.ts +1 -1
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighterHLJS.d.ts.map +1 -1
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighterHLJS.js +9 -10
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighterPrism.d.ts +1 -1
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighterPrism.d.ts.map +1 -1
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighterPrism.js +10 -11
- package/build/Legacy/SyntaxHighlighter/index.d.ts +1 -1
- package/build/Legacy/SyntaxHighlighter/index.d.ts.map +1 -1
- package/build/Legacy/SyntaxHighlighter/index.js +5 -5
- package/build/Legacy/Toast/Toast.const.d.ts +4 -0
- package/build/Legacy/Toast/Toast.const.d.ts.map +1 -0
- package/build/Legacy/Toast/Toast.const.js +18 -0
- package/build/Legacy/Toast/Toast.d.ts +1 -1
- package/build/Legacy/Toast/Toast.d.ts.map +1 -1
- package/build/Legacy/Toast/Toast.js +23 -23
- package/build/Legacy/Toast/Toast.type.d.ts +0 -2
- package/build/Legacy/Toast/Toast.type.d.ts.map +1 -1
- package/build/Legacy/Toast/Toast.type.js +1 -14
- package/build/Legacy/Toast/index.d.ts +1 -1
- package/build/Legacy/Toast/index.d.ts.map +1 -1
- package/build/Legacy/Toast/index.js +3 -3
- package/build/Legacy/index.js +1 -1
- package/build/Modern/Avatar/Avatar.d.ts +1 -1
- package/build/Modern/Avatar/Avatar.d.ts.map +1 -1
- package/build/Modern/Avatar/Avatar.js +23 -30
- package/build/Modern/Avatar/index.js +1 -1
- package/build/Modern/AvatarStack/AvatarStack.d.ts +2 -2
- package/build/Modern/AvatarStack/AvatarStack.d.ts.map +1 -1
- package/build/Modern/AvatarStack/AvatarStack.js +53 -57
- package/build/Modern/AvatarStack/index.js +1 -1
- package/build/Modern/Flash/Flash.d.ts +1 -1
- package/build/Modern/Flash/Flash.d.ts.map +1 -1
- package/build/Modern/Flash/Flash.js +13 -17
- package/build/Modern/Flash/index.js +1 -1
- package/build/Modern/Link/Link.d.ts +3 -3
- package/build/Modern/Link/Link.d.ts.map +1 -1
- package/build/Modern/Link/Link.js +20 -22
- package/build/Modern/Link/index.js +1 -1
- package/build/Modern/Pagination/Pagination.d.ts +2 -2
- package/build/Modern/Pagination/Pagination.d.ts.map +1 -1
- package/build/Modern/Pagination/Pagination.js +68 -79
- package/build/Modern/Pagination/Pagination.model.js +30 -34
- package/build/Modern/Pagination/index.js +1 -1
- package/build/Modern/hooks/index.js +2 -2
- package/build/Modern/hooks/useMedia.d.ts +2 -2
- package/build/Modern/hooks/useMedia.d.ts.map +1 -1
- package/build/Modern/hooks/useMedia.js +29 -38
- package/build/Modern/hooks/useRefObjectAsForwardedRef.js +1 -3
- package/build/Modern/hooks/useResponsiveValue.js +6 -10
- package/build/Modern/index.d.ts +1 -1
- package/build/Modern/index.js +1 -1
- package/build/Modern/utils/environment.js +1 -2
- package/build/Modern/utils/hasInteractiveNodes.js +11 -15
- package/build/Modern/utils/modern-polymorphic.js +1 -1
- package/build/Modern/utils/polymorphic.d.ts +1 -1
- package/build/Modern/utils/polymorphic.d.ts.map +1 -1
- package/build/Modern/utils/testing.js +2 -2
- package/build/Modern/utils/types/index.js +3 -3
- package/build/Modern/utils/warning.js +4 -7
- package/build/index.js +2 -2
- package/package.json +4 -4
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.UnwrappedLink = exports.Link = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
8
|
var _clsx = require("clsx");
|
|
11
9
|
var _react = require("react");
|
|
12
10
|
var _hooks = require("../hooks");
|
|
13
11
|
var _modernPolymorphic = require("../utils/modern-polymorphic");
|
|
14
12
|
var _LinkModule = _interopRequireDefault(require("./Link.module.scss"));
|
|
15
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
var _excluded = ["as", "className", "inline", "hoverColor"];
|
|
17
14
|
/* eslint-disable @typescript-eslint/consistent-type-definitions */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
|
|
16
|
+
const UnwrappedLink = (props, ref) => {
|
|
17
|
+
const {
|
|
18
|
+
as: Component = 'a',
|
|
19
|
+
className,
|
|
20
|
+
inline,
|
|
21
|
+
hoverColor,
|
|
22
|
+
...restProps
|
|
23
|
+
} = props;
|
|
24
|
+
const innerRef = (0, _react.useRef)(null);
|
|
28
25
|
(0, _hooks.useRefObjectAsForwardedRef)(ref, innerRef);
|
|
29
26
|
if (process.env.NODE_ENV !== 'production') {
|
|
30
27
|
/**
|
|
@@ -34,22 +31,23 @@ var UnwrappedLink = exports.UnwrappedLink = function UnwrappedLink(props, ref) {
|
|
|
34
31
|
* shaving precious bytes from the output, and avoiding mounting a noop effect
|
|
35
32
|
*/
|
|
36
33
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
37
|
-
(0, _react.useEffect)(
|
|
34
|
+
(0, _react.useEffect)(() => {
|
|
38
35
|
if (innerRef.current && !(innerRef.current instanceof HTMLButtonElement) && !(innerRef.current instanceof HTMLAnchorElement)) {
|
|
39
36
|
console.error('Error: Found `Link` component that renders an inaccessible element', innerRef.current, 'Please ensure `Link` always renders as <a> or <button>');
|
|
40
37
|
}
|
|
41
38
|
}, [innerRef]);
|
|
42
39
|
}
|
|
43
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component,
|
|
44
|
-
className: (0, _clsx.clsx)(className, _LinkModule
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
41
|
+
className: (0, _clsx.clsx)(className, _LinkModule.default.Link),
|
|
45
42
|
"data-muted": restProps.muted,
|
|
46
43
|
"data-inline": inline,
|
|
47
|
-
"data-hover-color": hoverColor
|
|
48
|
-
|
|
44
|
+
"data-hover-color": hoverColor,
|
|
45
|
+
...restProps,
|
|
49
46
|
ref: innerRef
|
|
50
|
-
})
|
|
47
|
+
});
|
|
51
48
|
};
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
exports.UnwrappedLink = UnwrappedLink;
|
|
50
|
+
const LinkComponent = (0, _modernPolymorphic.fixedForwardRef)(UnwrappedLink);
|
|
51
|
+
const Link = exports.Link = Object.assign(LinkComponent, {
|
|
54
52
|
displayName: 'Link'
|
|
55
53
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JSX,
|
|
1
|
+
import type { JSX, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import type { ResponsiveValue } from '../hooks/useResponsiveValue';
|
|
3
|
-
import {
|
|
3
|
+
import type { PageDataProps } from './Pagination.model';
|
|
4
4
|
export type PageProps = {
|
|
5
5
|
key: string;
|
|
6
6
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/Modern/Pagination/Pagination.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/Modern/Pagination/Pagination.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAgBvD,MAAM,MAAM,SAAS,GAAG;IAEtB,GAAG,EAAE,MAAM,CAAA;IAEX,QAAQ,EAAE,SAAS,CAAA;IAEnB,MAAM,EAAE,MAAM,CAAA;IAEd,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,CAAA;AAoE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACjD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IAC9C,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,SAAS,CAAA;CAC7C,CAAA;AAED,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,SAAS,EACT,WAAW,EACX,YAAmB,EACnB,WAAgC,EAChC,eAAmB,EACnB,SAAgB,EAChB,oBAAwB,EACxB,UAAU,EACV,GAAG,IAAI,EACR,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAmB/B"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.Pagination = Pagination;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
8
|
var _octiconsReact = require("@primer/octicons-react");
|
|
11
9
|
var _clsx = require("clsx");
|
|
12
10
|
var _react = require("react");
|
|
@@ -14,14 +12,11 @@ var _useResponsiveValue = require("../hooks/useResponsiveValue");
|
|
|
14
12
|
var _Pagination = require("./Pagination.model");
|
|
15
13
|
var _PaginationModule = _interopRequireDefault(require("./Pagination.module.scss"));
|
|
16
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var getViewportRangesToHidePages = function getViewportRangesToHidePages(showPages) {
|
|
15
|
+
/* eslint-disable @typescript-eslint/consistent-type-definitions */
|
|
16
|
+
|
|
17
|
+
const getViewportRangesToHidePages = showPages => {
|
|
21
18
|
if (showPages && typeof showPages !== 'boolean') {
|
|
22
|
-
return Object.keys(showPages).filter(
|
|
23
|
-
return !showPages[key];
|
|
24
|
-
});
|
|
19
|
+
return Object.keys(showPages).filter(key => !showPages[key]);
|
|
25
20
|
}
|
|
26
21
|
if (showPages) {
|
|
27
22
|
return [];
|
|
@@ -29,102 +24,96 @@ var getViewportRangesToHidePages = function getViewportRangesToHidePages(showPag
|
|
|
29
24
|
return Object.keys(_useResponsiveValue.viewportRanges);
|
|
30
25
|
}
|
|
31
26
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return onPageChange(e, n);
|
|
51
|
-
};
|
|
52
|
-
}, [onPageChange]);
|
|
53
|
-
var model = (0, _react.useMemo)(function () {
|
|
27
|
+
const PageLabel = ({
|
|
28
|
+
children,
|
|
29
|
+
direction
|
|
30
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
31
|
+
children: [direction === 'page-prev' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_octiconsReact.ChevronLeftIcon, {}) : null, children, direction === 'page-next' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_octiconsReact.ChevronRightIcon, {}) : null]
|
|
32
|
+
});
|
|
33
|
+
function usePaginationPages({
|
|
34
|
+
pageCount,
|
|
35
|
+
currentPage,
|
|
36
|
+
onPageChange,
|
|
37
|
+
hrefBuilder,
|
|
38
|
+
marginPageCount,
|
|
39
|
+
showPages,
|
|
40
|
+
surroundingPageCount,
|
|
41
|
+
renderPage
|
|
42
|
+
}) {
|
|
43
|
+
const pageChange = (0, _react.useCallback)(n => e => onPageChange(e, n), [onPageChange]);
|
|
44
|
+
const model = (0, _react.useMemo)(() => {
|
|
54
45
|
return (0, _Pagination.buildPaginationModel)(pageCount, currentPage, !!showPages, marginPageCount, surroundingPageCount);
|
|
55
46
|
}, [pageCount, currentPage, showPages, marginPageCount, surroundingPageCount]);
|
|
56
|
-
|
|
57
|
-
return model.map(
|
|
58
|
-
|
|
59
|
-
props
|
|
60
|
-
key
|
|
61
|
-
content
|
|
47
|
+
const children = (0, _react.useMemo)(() => {
|
|
48
|
+
return model.map(page => {
|
|
49
|
+
const {
|
|
50
|
+
props,
|
|
51
|
+
key,
|
|
52
|
+
content
|
|
53
|
+
} = (0, _Pagination.buildComponentData)(page, hrefBuilder, pageChange(page.num));
|
|
62
54
|
if (renderPage && props.as !== 'span') {
|
|
63
|
-
return renderPage(
|
|
64
|
-
key
|
|
55
|
+
return renderPage({
|
|
56
|
+
key,
|
|
65
57
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PageLabel, {
|
|
66
58
|
direction: key,
|
|
67
59
|
children: content
|
|
68
60
|
}),
|
|
69
61
|
number: page.num,
|
|
70
|
-
className: _PaginationModule
|
|
71
|
-
|
|
62
|
+
className: _PaginationModule.default.Page,
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
72
65
|
}
|
|
73
|
-
|
|
66
|
+
const Component = props.as || 'a';
|
|
74
67
|
return (
|
|
75
68
|
/*#__PURE__*/
|
|
76
69
|
// @ts-ignore giving me grief about children and "as" props
|
|
77
|
-
(0, _jsxRuntime.jsx)(Component,
|
|
78
|
-
className: (0, _clsx.clsx)(_PaginationModule
|
|
79
|
-
|
|
70
|
+
(0, _jsxRuntime.jsx)(Component, {
|
|
71
|
+
className: (0, _clsx.clsx)(_PaginationModule.default.Page),
|
|
72
|
+
...props,
|
|
80
73
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PageLabel, {
|
|
81
74
|
direction: key,
|
|
82
75
|
children: content
|
|
83
76
|
})
|
|
84
|
-
}
|
|
77
|
+
}, key)
|
|
85
78
|
);
|
|
86
79
|
});
|
|
87
80
|
}, [model, hrefBuilder, pageChange, renderPage]);
|
|
88
81
|
return children;
|
|
89
82
|
}
|
|
90
|
-
function Pagination(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
marginPageCount: marginPageCount,
|
|
112
|
-
showPages: showPages,
|
|
113
|
-
surroundingPageCount: surroundingPageCount,
|
|
114
|
-
renderPage: renderPage
|
|
83
|
+
function Pagination({
|
|
84
|
+
className,
|
|
85
|
+
pageCount,
|
|
86
|
+
currentPage,
|
|
87
|
+
onPageChange = noop,
|
|
88
|
+
hrefBuilder = defaultHrefBuilder,
|
|
89
|
+
marginPageCount = 1,
|
|
90
|
+
showPages = true,
|
|
91
|
+
surroundingPageCount = 2,
|
|
92
|
+
renderPage,
|
|
93
|
+
...rest
|
|
94
|
+
}) {
|
|
95
|
+
const pageElements = usePaginationPages({
|
|
96
|
+
pageCount,
|
|
97
|
+
currentPage,
|
|
98
|
+
onPageChange,
|
|
99
|
+
hrefBuilder,
|
|
100
|
+
marginPageCount,
|
|
101
|
+
showPages,
|
|
102
|
+
surroundingPageCount,
|
|
103
|
+
renderPage
|
|
115
104
|
});
|
|
116
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("nav",
|
|
117
|
-
className: (0, _clsx.clsx)(_PaginationModule
|
|
118
|
-
"aria-label": "Pagination"
|
|
119
|
-
|
|
105
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("nav", {
|
|
106
|
+
className: (0, _clsx.clsx)(_PaginationModule.default.PaginationContainer, className),
|
|
107
|
+
"aria-label": "Pagination",
|
|
108
|
+
...rest,
|
|
120
109
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
121
|
-
className: _PaginationModule
|
|
110
|
+
className: _PaginationModule.default.TablePaginationSteps,
|
|
122
111
|
"data-hidden-viewport-ranges": getViewportRangesToHidePages(showPages).join(' '),
|
|
123
112
|
children: pageElements
|
|
124
113
|
})
|
|
125
|
-
})
|
|
114
|
+
});
|
|
126
115
|
}
|
|
127
116
|
function defaultHrefBuilder(pageNum) {
|
|
128
|
-
return
|
|
117
|
+
return `#${pageNum}`;
|
|
129
118
|
}
|
|
130
119
|
function noop() {}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.buildComponentData = buildComponentData;
|
|
8
7
|
exports.buildPaginationModel = buildPaginationModel;
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
8
|
/* eslint-disable @typescript-eslint/no-inferrable-types */
|
|
13
9
|
|
|
14
10
|
function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount, surroundingPageCount) {
|
|
15
|
-
|
|
11
|
+
const prev = {
|
|
16
12
|
type: 'PREV',
|
|
17
13
|
num: currentPage - 1,
|
|
18
14
|
disabled: currentPage === 1
|
|
19
15
|
};
|
|
20
|
-
|
|
16
|
+
const next = {
|
|
21
17
|
type: 'NEXT',
|
|
22
18
|
num: currentPage + 1,
|
|
23
19
|
disabled: currentPage === pageCount
|
|
@@ -26,26 +22,27 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
26
22
|
return [prev, next];
|
|
27
23
|
}
|
|
28
24
|
if (pageCount <= 0) {
|
|
29
|
-
return [prev,
|
|
25
|
+
return [prev, {
|
|
26
|
+
...next,
|
|
30
27
|
disabled: true
|
|
31
|
-
}
|
|
28
|
+
}];
|
|
32
29
|
}
|
|
33
|
-
|
|
30
|
+
const pages = [];
|
|
34
31
|
|
|
35
32
|
// number of pages shown on each side of the current page
|
|
36
33
|
// [1, ..., 7, 8, _9_, 10, 11, ..., 15]
|
|
37
34
|
// standardGap: 3
|
|
38
|
-
|
|
35
|
+
const standardGap = surroundingPageCount + marginPageCount;
|
|
39
36
|
|
|
40
37
|
// the maximum number of pages that can be shown at a given time (account for current page, left and right ellipsis)
|
|
41
38
|
// [1, ..., 7, 8, _9_, 10, 11, ..., 15]
|
|
42
39
|
// maxVisiblePages: 9
|
|
43
|
-
|
|
40
|
+
const maxVisiblePages = standardGap + standardGap + 3;
|
|
44
41
|
|
|
45
42
|
// if the number of pages is less than the maximum number of pages that can be shown just return all of them
|
|
46
43
|
if (pageCount <= maxVisiblePages) {
|
|
47
44
|
addPages(1, pageCount, false);
|
|
48
|
-
return [prev
|
|
45
|
+
return [prev, ...pages, next];
|
|
49
46
|
}
|
|
50
47
|
|
|
51
48
|
// startGap is the number of pages hidden by the start ellipsis
|
|
@@ -57,8 +54,8 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
57
54
|
// [1, _2_, 3, 4, 5, 6, ..., 15]
|
|
58
55
|
// startGap = 0
|
|
59
56
|
// startOffset: -3 <--
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
let startGap = 0;
|
|
58
|
+
let startOffset = 0;
|
|
62
59
|
|
|
63
60
|
// When there is overlap
|
|
64
61
|
if (currentPage - standardGap - 1 <= 1) {
|
|
@@ -68,8 +65,8 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
// These are equivalent to startGap and startOffset but at the end of the list
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
let endGap = 0;
|
|
69
|
+
let endOffset = 0;
|
|
73
70
|
|
|
74
71
|
// When there is overlap
|
|
75
72
|
if (pageCount - currentPage - standardGap <= 1) {
|
|
@@ -77,8 +74,8 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
77
74
|
} else {
|
|
78
75
|
endGap = pageCount - currentPage - standardGap;
|
|
79
76
|
}
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
const hasStartEllipsis = startGap > 0;
|
|
78
|
+
const hasEndEllipsis = endGap > 0;
|
|
82
79
|
|
|
83
80
|
// add pages "before" the start ellipsis (if any)
|
|
84
81
|
// [1, ..., 7, 8, _9_, 10, 11, ..., 15]
|
|
@@ -113,16 +110,15 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
113
110
|
// endOffset: 0
|
|
114
111
|
// addPages(15, 15)
|
|
115
112
|
addPages(pageCount - marginPageCount + 1, pageCount);
|
|
116
|
-
return [prev
|
|
113
|
+
return [prev, ...pages, next];
|
|
117
114
|
function addEllipsis(previousPage) {
|
|
118
115
|
pages.push({
|
|
119
116
|
type: 'BREAK',
|
|
120
117
|
num: previousPage + 1
|
|
121
118
|
});
|
|
122
119
|
}
|
|
123
|
-
function addPages(start, end) {
|
|
124
|
-
|
|
125
|
-
for (var i = start; i <= end; i++) {
|
|
120
|
+
function addPages(start, end, precedesBreak = false) {
|
|
121
|
+
for (let i = start; i <= end; i++) {
|
|
126
122
|
pages.push({
|
|
127
123
|
type: 'NUM',
|
|
128
124
|
num: i,
|
|
@@ -133,9 +129,9 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
133
129
|
}
|
|
134
130
|
}
|
|
135
131
|
function buildComponentData(page, hrefBuilder, onClick) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
const props = {};
|
|
133
|
+
let content = '';
|
|
134
|
+
let key = '';
|
|
139
135
|
switch (page.type) {
|
|
140
136
|
case 'PREV':
|
|
141
137
|
{
|
|
@@ -153,7 +149,7 @@ function buildComponentData(page, hrefBuilder, onClick) {
|
|
|
153
149
|
href: hrefBuilder(page.num),
|
|
154
150
|
'aria-label': 'Previous Page',
|
|
155
151
|
'data-testid': 'page-prev',
|
|
156
|
-
onClick
|
|
152
|
+
onClick
|
|
157
153
|
});
|
|
158
154
|
}
|
|
159
155
|
break;
|
|
@@ -174,29 +170,29 @@ function buildComponentData(page, hrefBuilder, onClick) {
|
|
|
174
170
|
href: hrefBuilder(page.num),
|
|
175
171
|
'aria-label': 'Next Page',
|
|
176
172
|
'data-testid': 'page-next',
|
|
177
|
-
onClick
|
|
173
|
+
onClick
|
|
178
174
|
});
|
|
179
175
|
}
|
|
180
176
|
break;
|
|
181
177
|
}
|
|
182
178
|
case 'NUM':
|
|
183
179
|
{
|
|
184
|
-
key =
|
|
180
|
+
key = `page-${page.num}`;
|
|
185
181
|
content = String(page.num);
|
|
186
182
|
Object.assign(props, {
|
|
187
183
|
href: hrefBuilder(page.num),
|
|
188
184
|
// We append "..." to the aria-label for pages that preceed a break because screen readers will
|
|
189
185
|
// change the tone the text is read in.
|
|
190
186
|
// This is a slightly nicer experience than skipping a bunch of numbers unexpectedly.
|
|
191
|
-
'aria-label':
|
|
187
|
+
'aria-label': `Page ${page.num}${page.precedesBreak ? '...' : ''}`,
|
|
192
188
|
'aria-current': page.selected ? 'page' : undefined,
|
|
193
|
-
onClick
|
|
189
|
+
onClick
|
|
194
190
|
});
|
|
195
191
|
break;
|
|
196
192
|
}
|
|
197
193
|
case 'BREAK':
|
|
198
194
|
{
|
|
199
|
-
key =
|
|
195
|
+
key = `page-${page.num}-break`;
|
|
200
196
|
content = '…';
|
|
201
197
|
Object.assign(props, {
|
|
202
198
|
as: 'span',
|
|
@@ -205,8 +201,8 @@ function buildComponentData(page, hrefBuilder, onClick) {
|
|
|
205
201
|
}
|
|
206
202
|
}
|
|
207
203
|
return {
|
|
208
|
-
props
|
|
209
|
-
key
|
|
210
|
-
content
|
|
204
|
+
props,
|
|
205
|
+
key,
|
|
206
|
+
content
|
|
211
207
|
};
|
|
212
208
|
}
|
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "useMedia", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _useMedia.useMedia;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "useRefObjectAsForwardedRef", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _useRefObjectAsForwardedRef.useRefObjectAsForwardedRef;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* `useMedia` will use the given `mediaQueryString` with `matchMedia` to
|
|
4
4
|
* determine if the document matches the media query string.
|
|
@@ -32,6 +32,6 @@ interface MatchMediaProps {
|
|
|
32
32
|
* <Children />
|
|
33
33
|
* </MatchMedia>
|
|
34
34
|
*/
|
|
35
|
-
export declare function MatchMedia({ children, features }: MatchMediaProps): import("react
|
|
35
|
+
export declare function MatchMedia({ children, features }: MatchMediaProps): import("react").JSX.Element;
|
|
36
36
|
export {};
|
|
37
37
|
//# sourceMappingURL=useMedia.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMedia.d.ts","sourceRoot":"","sources":["../../../src/Modern/hooks/useMedia.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useMedia.d.ts","sourceRoot":"","sources":["../../../src/Modern/hooks/useMedia.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,WAgExE;AAED,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC,CAAA;AAO7D,UAAU,eAAe;IACvB,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,kBAAkB,CAAA;CAC9B;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,QAA0B,EAAE,EAAE,eAAe,+BAGnF"}
|