@papillonarts/components 0.48.0 → 0.49.1
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 +3 -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 +7 -8
- package/build/Legacy/Alert/Alert.type.d.ts.map +1 -1
- package/build/Legacy/Alert/Alert.type.js +1 -24
- package/build/Legacy/Alert/__tests__/Alert.doc.md +2 -2
- package/build/Legacy/Alert/index.d.ts +2 -2
- 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 +3 -2
- 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 +2 -4
- package/build/Legacy/Blankslate/Blankslate.type.d.ts.map +1 -1
- package/build/Legacy/Blankslate/Blankslate.type.js +1 -14
- package/build/Legacy/Blankslate/__tests__/Blankslate.doc.md +1 -1
- 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 +3 -2
- 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 +9 -6
- package/build/Legacy/Breadcrumb/Breadcrumb.type.d.ts.map +1 -1
- package/build/Legacy/Breadcrumb/Breadcrumb.type.js +1 -10
- package/build/Legacy/Breadcrumb/__tests__/Breadcrumb.doc.md +2 -2
- 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 +3 -2
- package/build/Legacy/Button/Button.d.ts.map +1 -1
- package/build/Legacy/Button/Button.js +84 -94
- package/build/Legacy/Button/Button.type.d.ts +12 -19
- package/build/Legacy/Button/Button.type.d.ts.map +1 -1
- package/build/Legacy/Button/Button.type.js +1 -44
- package/build/Legacy/Button/__tests__/Button.doc.md +6 -6
- package/build/Legacy/Button/index.d.ts +2 -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 +3 -2
- package/build/Legacy/Dropdown/Dropdown.d.ts.map +1 -1
- package/build/Legacy/Dropdown/Dropdown.js +49 -50
- package/build/Legacy/Dropdown/Dropdown.type.d.ts +10 -7
- package/build/Legacy/Dropdown/Dropdown.type.d.ts.map +1 -1
- package/build/Legacy/Dropdown/Dropdown.type.js +1 -14
- package/build/Legacy/Dropdown/__tests__/Dropdown.doc.md +1 -1
- 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 +7 -8
- package/build/Legacy/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/build/Legacy/ErrorBoundary/ErrorBoundary.js +32 -48
- package/build/Legacy/ErrorBoundary/ErrorBoundary.type.d.ts +5 -1
- package/build/Legacy/ErrorBoundary/ErrorBoundary.type.d.ts.map +1 -1
- package/build/Legacy/ErrorBoundary/__tests__/ErrorBoundary.doc.md +5 -1
- package/build/Legacy/ErrorBoundary/index.d.ts +1 -0
- package/build/Legacy/ErrorBoundary/index.d.ts.map +1 -1
- 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 +3 -2
- 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 +2 -4
- 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/__tests__/Checkbox.doc.md +1 -1
- 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 +3 -2
- 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 +5 -7
- 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/__tests__/Input.doc.md +4 -4
- 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 +3 -2
- 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 +2 -4
- 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/__tests__/Radio.doc.md +1 -1
- 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 +3 -2
- 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 +7 -7
- 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/__tests__/DisplayTable.doc.md +3 -3
- 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 +3 -2
- 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 +16 -11
- 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/__tests__/FlexGrid.doc.md +3 -3
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- package/build/Legacy/Markdown/Markdown.d.ts.map +1 -1
- package/build/Legacy/Markdown/Markdown.js +22 -14
- 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 +3 -2
- 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 +2 -2
- 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 +3 -2
- 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 +6 -7
- 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/__tests__/TabNav.doc.md +2 -2
- 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 +3 -2
- 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 +4 -6
- 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/__tests__/UnderlineNav.doc.md +1 -1
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighter.d.ts.map +1 -1
- package/build/Legacy/SyntaxHighlighter/SyntaxHighlighter.js +12 -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 +3 -2
- 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 +3 -2
- 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 +3 -2
- 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/Legacy/type.d.ts +25 -2
- package/build/Legacy/type.d.ts.map +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 +5 -5
- package/build/Modern/Link/Link.d.ts.map +1 -1
- package/build/Modern/Link/Link.js +21 -25
- package/build/Modern/Link/index.js +1 -1
- package/build/Modern/Pagination/Pagination.d.ts +6 -6
- package/build/Modern/Pagination/Pagination.d.ts.map +1 -1
- package/build/Modern/Pagination/Pagination.js +69 -82
- package/build/Modern/Pagination/Pagination.model.d.ts +3 -2
- package/build/Modern/Pagination/Pagination.model.d.ts.map +1 -1
- package/build/Modern/Pagination/Pagination.model.js +31 -34
- package/build/Modern/Pagination/__tests__/Pagination.doc.md +2 -2
- package/build/Modern/Pagination/index.js +1 -1
- package/build/Modern/hooks/index.js +2 -2
- package/build/Modern/hooks/useMedia.d.ts +3 -3
- package/build/Modern/hooks/useMedia.d.ts.map +1 -1
- package/build/Modern/hooks/useMedia.js +30 -41
- package/build/Modern/hooks/useRefObjectAsForwardedRef.js +1 -3
- package/build/Modern/hooks/useResponsiveValue.js +6 -10
- package/build/Modern/index.d.ts +2 -2
- package/build/Modern/index.js +1 -1
- package/build/Modern/type.d.ts +1 -0
- package/build/Modern/type.d.ts.map +1 -1
- package/build/Modern/utils/environment.js +1 -2
- package/build/Modern/utils/hasInteractiveNodes.js +11 -15
- package/build/Modern/utils/modern-polymorphic.d.ts +2 -2
- package/build/Modern/utils/modern-polymorphic.d.ts.map +1 -1
- 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.d.ts +2 -1
- package/build/Modern/utils/testing.d.ts.map +1 -1
- package/build/Modern/utils/testing.js +2 -2
- package/build/Modern/utils/types/ComponentProps.d.ts +2 -1
- package/build/Modern/utils/types/ComponentProps.d.ts.map +1 -1
- package/build/Modern/utils/types/Slots.d.ts +2 -1
- package/build/Modern/utils/types/Slots.d.ts.map +1 -1
- package/build/Modern/utils/types/index.js +3 -3
- package/build/Modern/utils/warning.js +4 -7
- package/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import type { ElementType, ForwardedRef } from 'react';
|
|
2
|
+
import type { PolymorphicProps } from '../utils/modern-polymorphic';
|
|
3
3
|
import type { ComponentProps } from '../utils/types';
|
|
4
4
|
type StyledLinkProps<As extends ElementType = 'a'> = {
|
|
5
5
|
as?: As;
|
|
@@ -8,10 +8,10 @@ type StyledLinkProps<As extends ElementType = 'a'> = {
|
|
|
8
8
|
muted?: boolean;
|
|
9
9
|
inline?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare const UnwrappedLink: <As extends ElementType = "a">(props: PolymorphicProps<As, "a", StyledLinkProps>, ref: ForwardedRef<unknown>) => import("react
|
|
12
|
-
export declare const Link: (<As extends ElementType = "a">(props: (
|
|
11
|
+
export declare const UnwrappedLink: <As extends ElementType = "a">(props: PolymorphicProps<As, "a", StyledLinkProps>, ref: ForwardedRef<unknown>) => import("react").JSX.Element;
|
|
12
|
+
export declare const Link: (<As extends ElementType = "a">(props: (import("react").ComponentPropsWithRef<ElementType extends As ? "a" : As> & StyledLinkProps<"a"> extends infer T ? T extends import("react").ComponentPropsWithRef<ElementType extends As ? "a" : As> & StyledLinkProps<"a"> ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
|
|
13
13
|
as?: As;
|
|
14
|
-
} &
|
|
14
|
+
} & import("react").RefAttributes<unknown>) => import("react").ReactNode) & {
|
|
15
15
|
displayName: string;
|
|
16
16
|
};
|
|
17
17
|
export type LinkProps = ComponentProps<typeof Link>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/Modern/Link/Link.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/Modern/Link/Link.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAGlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAGnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGpD,KAAK,eAAe,CAAC,EAAE,SAAS,WAAW,GAAG,GAAG,IAAI;IACnD,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,EAAE,SAAS,WAAW,GAAG,GAAG,EACxD,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,eAAe,CAAC,EACjD,KAAK,YAAY,CAAC,OAAO,CAAC,gCAmC3B,CAAA;AAID,eAAO,MAAM,IAAI,IAzCa,EAAE,SAAS,WAAW;;;;CAyCqB,CAAA;AAEzE,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,IAAI,CAAC,CAAA"}
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.UnwrappedLink = exports.Link = void 0;
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
8
|
var _clsx = require("clsx");
|
|
12
|
-
var _react =
|
|
9
|
+
var _react = require("react");
|
|
13
10
|
var _hooks = require("../hooks");
|
|
14
11
|
var _modernPolymorphic = require("../utils/modern-polymorphic");
|
|
15
12
|
var _LinkModule = _interopRequireDefault(require("./Link.module.scss"));
|
|
16
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
var _excluded = ["as", "className", "inline", "hoverColor"];
|
|
18
14
|
/* eslint-disable @typescript-eslint/consistent-type-definitions */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var innerRef = (0, _react.useRef)(null);
|
|
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);
|
|
30
25
|
(0, _hooks.useRefObjectAsForwardedRef)(ref, innerRef);
|
|
31
26
|
if (process.env.NODE_ENV !== 'production') {
|
|
32
27
|
/**
|
|
@@ -36,22 +31,23 @@ var UnwrappedLink = exports.UnwrappedLink = function UnwrappedLink(props, ref) {
|
|
|
36
31
|
* shaving precious bytes from the output, and avoiding mounting a noop effect
|
|
37
32
|
*/
|
|
38
33
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
39
|
-
(0, _react.useEffect)(
|
|
34
|
+
(0, _react.useEffect)(() => {
|
|
40
35
|
if (innerRef.current && !(innerRef.current instanceof HTMLButtonElement) && !(innerRef.current instanceof HTMLAnchorElement)) {
|
|
41
36
|
console.error('Error: Found `Link` component that renders an inaccessible element', innerRef.current, 'Please ensure `Link` always renders as <a> or <button>');
|
|
42
37
|
}
|
|
43
38
|
}, [innerRef]);
|
|
44
39
|
}
|
|
45
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component,
|
|
46
|
-
className: (0, _clsx.clsx)(className, _LinkModule
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
41
|
+
className: (0, _clsx.clsx)(className, _LinkModule.default.Link),
|
|
47
42
|
"data-muted": restProps.muted,
|
|
48
43
|
"data-inline": inline,
|
|
49
|
-
"data-hover-color": hoverColor
|
|
50
|
-
|
|
44
|
+
"data-hover-color": hoverColor,
|
|
45
|
+
...restProps,
|
|
51
46
|
ref: innerRef
|
|
52
|
-
})
|
|
47
|
+
});
|
|
53
48
|
};
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
exports.UnwrappedLink = UnwrappedLink;
|
|
50
|
+
const LinkComponent = (0, _modernPolymorphic.fixedForwardRef)(UnwrappedLink);
|
|
51
|
+
const Link = exports.Link = Object.assign(LinkComponent, {
|
|
56
52
|
displayName: 'Link'
|
|
57
53
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
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
|
-
children:
|
|
6
|
+
children: ReactNode;
|
|
7
7
|
number: number;
|
|
8
8
|
className: string;
|
|
9
9
|
} & Omit<PageDataProps['props'], 'as' | 'role'>;
|
|
@@ -11,12 +11,12 @@ export type PaginationProps = {
|
|
|
11
11
|
className?: string;
|
|
12
12
|
pageCount: number;
|
|
13
13
|
currentPage: number;
|
|
14
|
-
onPageChange?: (e:
|
|
14
|
+
onPageChange?: (e: MouseEvent, n: number) => void;
|
|
15
15
|
hrefBuilder?: (n: number) => string;
|
|
16
16
|
marginPageCount?: number;
|
|
17
17
|
showPages?: boolean | ResponsiveValue<boolean>;
|
|
18
18
|
surroundingPageCount?: number;
|
|
19
|
-
renderPage?: (props: PageProps) =>
|
|
19
|
+
renderPage?: (props: PageProps) => ReactNode;
|
|
20
20
|
};
|
|
21
|
-
export declare function Pagination({ className, pageCount, currentPage, onPageChange, hrefBuilder, marginPageCount, showPages, surroundingPageCount, renderPage, ...rest }: PaginationProps):
|
|
21
|
+
export declare function Pagination({ className, pageCount, currentPage, onPageChange, hrefBuilder, marginPageCount, showPages, surroundingPageCount, renderPage, ...rest }: PaginationProps): JSX.Element;
|
|
22
22
|
//# sourceMappingURL=Pagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/Modern/Pagination/Pagination.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
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,29 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.Pagination = Pagination;
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
8
|
var _octiconsReact = require("@primer/octicons-react");
|
|
12
9
|
var _clsx = require("clsx");
|
|
13
|
-
var _react =
|
|
10
|
+
var _react = require("react");
|
|
14
11
|
var _useResponsiveValue = require("../hooks/useResponsiveValue");
|
|
15
12
|
var _Pagination = require("./Pagination.model");
|
|
16
13
|
var _PaginationModule = _interopRequireDefault(require("./Pagination.module.scss"));
|
|
17
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
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; } /* eslint-disable @typescript-eslint/consistent-type-definitions */
|
|
22
|
-
var getViewportRangesToHidePages = function getViewportRangesToHidePages(showPages) {
|
|
15
|
+
/* eslint-disable @typescript-eslint/consistent-type-definitions */
|
|
16
|
+
|
|
17
|
+
const getViewportRangesToHidePages = showPages => {
|
|
23
18
|
if (showPages && typeof showPages !== 'boolean') {
|
|
24
|
-
return Object.keys(showPages).filter(
|
|
25
|
-
return !showPages[key];
|
|
26
|
-
});
|
|
19
|
+
return Object.keys(showPages).filter(key => !showPages[key]);
|
|
27
20
|
}
|
|
28
21
|
if (showPages) {
|
|
29
22
|
return [];
|
|
@@ -31,102 +24,96 @@ var getViewportRangesToHidePages = function getViewportRangesToHidePages(showPag
|
|
|
31
24
|
return Object.keys(_useResponsiveValue.viewportRanges);
|
|
32
25
|
}
|
|
33
26
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return onPageChange(e, n);
|
|
53
|
-
};
|
|
54
|
-
}, [onPageChange]);
|
|
55
|
-
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)(() => {
|
|
56
45
|
return (0, _Pagination.buildPaginationModel)(pageCount, currentPage, !!showPages, marginPageCount, surroundingPageCount);
|
|
57
46
|
}, [pageCount, currentPage, showPages, marginPageCount, surroundingPageCount]);
|
|
58
|
-
|
|
59
|
-
return model.map(
|
|
60
|
-
|
|
61
|
-
props
|
|
62
|
-
key
|
|
63
|
-
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));
|
|
64
54
|
if (renderPage && props.as !== 'span') {
|
|
65
|
-
return renderPage(
|
|
66
|
-
key
|
|
55
|
+
return renderPage({
|
|
56
|
+
key,
|
|
67
57
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PageLabel, {
|
|
68
58
|
direction: key,
|
|
69
59
|
children: content
|
|
70
60
|
}),
|
|
71
61
|
number: page.num,
|
|
72
|
-
className: _PaginationModule
|
|
73
|
-
|
|
62
|
+
className: _PaginationModule.default.Page,
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
74
65
|
}
|
|
75
|
-
|
|
66
|
+
const Component = props.as || 'a';
|
|
76
67
|
return (
|
|
77
68
|
/*#__PURE__*/
|
|
78
69
|
// @ts-ignore giving me grief about children and "as" props
|
|
79
|
-
(0, _jsxRuntime.jsx)(Component,
|
|
80
|
-
className: (0, _clsx.clsx)(_PaginationModule
|
|
81
|
-
|
|
70
|
+
(0, _jsxRuntime.jsx)(Component, {
|
|
71
|
+
className: (0, _clsx.clsx)(_PaginationModule.default.Page),
|
|
72
|
+
...props,
|
|
82
73
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PageLabel, {
|
|
83
74
|
direction: key,
|
|
84
75
|
children: content
|
|
85
76
|
})
|
|
86
|
-
}
|
|
77
|
+
}, key)
|
|
87
78
|
);
|
|
88
79
|
});
|
|
89
80
|
}, [model, hrefBuilder, pageChange, renderPage]);
|
|
90
81
|
return children;
|
|
91
82
|
}
|
|
92
|
-
function Pagination(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
marginPageCount: marginPageCount,
|
|
114
|
-
showPages: showPages,
|
|
115
|
-
surroundingPageCount: surroundingPageCount,
|
|
116
|
-
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
|
|
117
104
|
});
|
|
118
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("nav",
|
|
119
|
-
className: (0, _clsx.clsx)(_PaginationModule
|
|
120
|
-
"aria-label": "Pagination"
|
|
121
|
-
|
|
105
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("nav", {
|
|
106
|
+
className: (0, _clsx.clsx)(_PaginationModule.default.PaginationContainer, className),
|
|
107
|
+
"aria-label": "Pagination",
|
|
108
|
+
...rest,
|
|
122
109
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
123
|
-
className: _PaginationModule
|
|
110
|
+
className: _PaginationModule.default.TablePaginationSteps,
|
|
124
111
|
"data-hidden-viewport-ranges": getViewportRangesToHidePages(showPages).join(' '),
|
|
125
112
|
children: pageElements
|
|
126
113
|
})
|
|
127
|
-
})
|
|
114
|
+
});
|
|
128
115
|
}
|
|
129
116
|
function defaultHrefBuilder(pageNum) {
|
|
130
|
-
return
|
|
117
|
+
return `#${pageNum}`;
|
|
131
118
|
}
|
|
132
119
|
function noop() {}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MouseEvent } from 'react';
|
|
1
2
|
export declare function buildPaginationModel(pageCount: number, currentPage: number, showPages: boolean, marginPageCount: number, surroundingPageCount: number): PageType[];
|
|
2
3
|
interface PageType {
|
|
3
4
|
type: string;
|
|
@@ -14,13 +15,13 @@ export interface PageDataProps {
|
|
|
14
15
|
'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false' | boolean;
|
|
15
16
|
'aria-hidden'?: boolean;
|
|
16
17
|
'aria-disabled'?: boolean;
|
|
17
|
-
onClick?: (e:
|
|
18
|
+
onClick?: (e: MouseEvent) => void;
|
|
18
19
|
as?: string;
|
|
19
20
|
role?: string;
|
|
20
21
|
};
|
|
21
22
|
key: string;
|
|
22
23
|
content: string;
|
|
23
24
|
}
|
|
24
|
-
export declare function buildComponentData(page: PageType, hrefBuilder: (n: number) => string, onClick: (e:
|
|
25
|
+
export declare function buildComponentData(page: PageType, hrefBuilder: (n: number) => string, onClick: (e: MouseEvent) => void): PageDataProps;
|
|
25
26
|
export {};
|
|
26
27
|
//# sourceMappingURL=Pagination.model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.model.d.ts","sourceRoot":"","sources":["../../../src/Modern/Pagination/Pagination.model.tsx"],"names":[],"mappings":"AACA,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,OAAO,EAClB,eAAe,EAAE,MAAM,EACvB,oBAAoB,EAAE,MAAM,cAsH7B;AAED,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;QAC5F,aAAa,CAAC,EAAE,OAAO,CAAA;QACvB,eAAe,CAAC,EAAE,OAAO,CAAA;QACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"Pagination.model.d.ts","sourceRoot":"","sources":["../../../src/Modern/Pagination/Pagination.model.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEvC,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,OAAO,EAClB,eAAe,EAAE,MAAM,EACvB,oBAAoB,EAAE,MAAM,cAsH7B;AAED,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;QAC5F,aAAa,CAAC,EAAE,OAAO,CAAA;QACvB,eAAe,CAAC,EAAE,OAAO,CAAA;QACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAA;QACjC,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;IACD,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,GAAG,aAAa,CA4DtI"}
|
|
@@ -1,22 +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 */
|
|
9
|
+
|
|
13
10
|
function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount, surroundingPageCount) {
|
|
14
|
-
|
|
11
|
+
const prev = {
|
|
15
12
|
type: 'PREV',
|
|
16
13
|
num: currentPage - 1,
|
|
17
14
|
disabled: currentPage === 1
|
|
18
15
|
};
|
|
19
|
-
|
|
16
|
+
const next = {
|
|
20
17
|
type: 'NEXT',
|
|
21
18
|
num: currentPage + 1,
|
|
22
19
|
disabled: currentPage === pageCount
|
|
@@ -25,26 +22,27 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
25
22
|
return [prev, next];
|
|
26
23
|
}
|
|
27
24
|
if (pageCount <= 0) {
|
|
28
|
-
return [prev,
|
|
25
|
+
return [prev, {
|
|
26
|
+
...next,
|
|
29
27
|
disabled: true
|
|
30
|
-
}
|
|
28
|
+
}];
|
|
31
29
|
}
|
|
32
|
-
|
|
30
|
+
const pages = [];
|
|
33
31
|
|
|
34
32
|
// number of pages shown on each side of the current page
|
|
35
33
|
// [1, ..., 7, 8, _9_, 10, 11, ..., 15]
|
|
36
34
|
// standardGap: 3
|
|
37
|
-
|
|
35
|
+
const standardGap = surroundingPageCount + marginPageCount;
|
|
38
36
|
|
|
39
37
|
// the maximum number of pages that can be shown at a given time (account for current page, left and right ellipsis)
|
|
40
38
|
// [1, ..., 7, 8, _9_, 10, 11, ..., 15]
|
|
41
39
|
// maxVisiblePages: 9
|
|
42
|
-
|
|
40
|
+
const maxVisiblePages = standardGap + standardGap + 3;
|
|
43
41
|
|
|
44
42
|
// if the number of pages is less than the maximum number of pages that can be shown just return all of them
|
|
45
43
|
if (pageCount <= maxVisiblePages) {
|
|
46
44
|
addPages(1, pageCount, false);
|
|
47
|
-
return [prev
|
|
45
|
+
return [prev, ...pages, next];
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
// startGap is the number of pages hidden by the start ellipsis
|
|
@@ -56,8 +54,8 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
56
54
|
// [1, _2_, 3, 4, 5, 6, ..., 15]
|
|
57
55
|
// startGap = 0
|
|
58
56
|
// startOffset: -3 <--
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
let startGap = 0;
|
|
58
|
+
let startOffset = 0;
|
|
61
59
|
|
|
62
60
|
// When there is overlap
|
|
63
61
|
if (currentPage - standardGap - 1 <= 1) {
|
|
@@ -67,8 +65,8 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
// These are equivalent to startGap and startOffset but at the end of the list
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
let endGap = 0;
|
|
69
|
+
let endOffset = 0;
|
|
72
70
|
|
|
73
71
|
// When there is overlap
|
|
74
72
|
if (pageCount - currentPage - standardGap <= 1) {
|
|
@@ -76,8 +74,8 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
76
74
|
} else {
|
|
77
75
|
endGap = pageCount - currentPage - standardGap;
|
|
78
76
|
}
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
const hasStartEllipsis = startGap > 0;
|
|
78
|
+
const hasEndEllipsis = endGap > 0;
|
|
81
79
|
|
|
82
80
|
// add pages "before" the start ellipsis (if any)
|
|
83
81
|
// [1, ..., 7, 8, _9_, 10, 11, ..., 15]
|
|
@@ -112,16 +110,15 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
112
110
|
// endOffset: 0
|
|
113
111
|
// addPages(15, 15)
|
|
114
112
|
addPages(pageCount - marginPageCount + 1, pageCount);
|
|
115
|
-
return [prev
|
|
113
|
+
return [prev, ...pages, next];
|
|
116
114
|
function addEllipsis(previousPage) {
|
|
117
115
|
pages.push({
|
|
118
116
|
type: 'BREAK',
|
|
119
117
|
num: previousPage + 1
|
|
120
118
|
});
|
|
121
119
|
}
|
|
122
|
-
function addPages(start, end) {
|
|
123
|
-
|
|
124
|
-
for (var i = start; i <= end; i++) {
|
|
120
|
+
function addPages(start, end, precedesBreak = false) {
|
|
121
|
+
for (let i = start; i <= end; i++) {
|
|
125
122
|
pages.push({
|
|
126
123
|
type: 'NUM',
|
|
127
124
|
num: i,
|
|
@@ -132,9 +129,9 @@ function buildPaginationModel(pageCount, currentPage, showPages, marginPageCount
|
|
|
132
129
|
}
|
|
133
130
|
}
|
|
134
131
|
function buildComponentData(page, hrefBuilder, onClick) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
const props = {};
|
|
133
|
+
let content = '';
|
|
134
|
+
let key = '';
|
|
138
135
|
switch (page.type) {
|
|
139
136
|
case 'PREV':
|
|
140
137
|
{
|
|
@@ -152,7 +149,7 @@ function buildComponentData(page, hrefBuilder, onClick) {
|
|
|
152
149
|
href: hrefBuilder(page.num),
|
|
153
150
|
'aria-label': 'Previous Page',
|
|
154
151
|
'data-testid': 'page-prev',
|
|
155
|
-
onClick
|
|
152
|
+
onClick
|
|
156
153
|
});
|
|
157
154
|
}
|
|
158
155
|
break;
|
|
@@ -173,29 +170,29 @@ function buildComponentData(page, hrefBuilder, onClick) {
|
|
|
173
170
|
href: hrefBuilder(page.num),
|
|
174
171
|
'aria-label': 'Next Page',
|
|
175
172
|
'data-testid': 'page-next',
|
|
176
|
-
onClick
|
|
173
|
+
onClick
|
|
177
174
|
});
|
|
178
175
|
}
|
|
179
176
|
break;
|
|
180
177
|
}
|
|
181
178
|
case 'NUM':
|
|
182
179
|
{
|
|
183
|
-
key =
|
|
180
|
+
key = `page-${page.num}`;
|
|
184
181
|
content = String(page.num);
|
|
185
182
|
Object.assign(props, {
|
|
186
183
|
href: hrefBuilder(page.num),
|
|
187
184
|
// We append "..." to the aria-label for pages that preceed a break because screen readers will
|
|
188
185
|
// change the tone the text is read in.
|
|
189
186
|
// This is a slightly nicer experience than skipping a bunch of numbers unexpectedly.
|
|
190
|
-
'aria-label':
|
|
187
|
+
'aria-label': `Page ${page.num}${page.precedesBreak ? '...' : ''}`,
|
|
191
188
|
'aria-current': page.selected ? 'page' : undefined,
|
|
192
|
-
onClick
|
|
189
|
+
onClick
|
|
193
190
|
});
|
|
194
191
|
break;
|
|
195
192
|
}
|
|
196
193
|
case 'BREAK':
|
|
197
194
|
{
|
|
198
|
-
key =
|
|
195
|
+
key = `page-${page.num}-break`;
|
|
199
196
|
content = '…';
|
|
200
197
|
Object.assign(props, {
|
|
201
198
|
as: 'span',
|
|
@@ -204,8 +201,8 @@ function buildComponentData(page, hrefBuilder, onClick) {
|
|
|
204
201
|
}
|
|
205
202
|
}
|
|
206
203
|
return {
|
|
207
|
-
props
|
|
208
|
-
key
|
|
209
|
-
content
|
|
204
|
+
props,
|
|
205
|
+
key,
|
|
206
|
+
content
|
|
210
207
|
};
|
|
211
208
|
}
|
|
@@ -11,12 +11,12 @@ export type PaginationProps = {
|
|
|
11
11
|
className?: string
|
|
12
12
|
pageCount: number
|
|
13
13
|
currentPage: number
|
|
14
|
-
onPageChange?: (e:
|
|
14
|
+
onPageChange?: (e: MouseEvent, n: number) => void
|
|
15
15
|
hrefBuilder?: (n: number) => string
|
|
16
16
|
marginPageCount?: number
|
|
17
17
|
showPages?: boolean | ResponsiveValue<boolean>
|
|
18
18
|
surroundingPageCount?: number
|
|
19
|
-
renderPage?: (props: PageProps) =>
|
|
19
|
+
renderPage?: (props: PageProps) => ReactNode
|
|
20
20
|
}
|
|
21
21
|
```
|
|
22
22
|
|
|
@@ -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.
|
|
@@ -15,7 +15,7 @@ import React from 'react';
|
|
|
15
15
|
export declare function useMedia(mediaQueryString: string, defaultState?: boolean): boolean;
|
|
16
16
|
type MediaQueryFeatures = Record<string, boolean | undefined>;
|
|
17
17
|
interface MatchMediaProps {
|
|
18
|
-
children:
|
|
18
|
+
children: ReactNode;
|
|
19
19
|
features?: MediaQueryFeatures;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -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
|