@pega/cosmos-react-work 5.0.0-dev.4.7 → 5.0.0-dev.4.8
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/package.json +2 -2
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +0 -23
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +0 -1
- package/lib/components/AppAnnouncement/AppAnnouncement.js +0 -93
- package/lib/components/AppAnnouncement/AppAnnouncement.js.map +0 -1
- package/lib/components/AppAnnouncement/index.d.ts +0 -3
- package/lib/components/AppAnnouncement/index.d.ts.map +0 -1
- package/lib/components/AppAnnouncement/index.js +0 -2
- package/lib/components/AppAnnouncement/index.js.map +0 -1
- package/lib/components/Article/Article.d.ts +0 -49
- package/lib/components/Article/Article.d.ts.map +0 -1
- package/lib/components/Article/Article.js +0 -73
- package/lib/components/Article/Article.js.map +0 -1
- package/lib/components/Article/ArticleFooter.d.ts +0 -40
- package/lib/components/Article/ArticleFooter.d.ts.map +0 -1
- package/lib/components/Article/ArticleFooter.js +0 -54
- package/lib/components/Article/ArticleFooter.js.map +0 -1
- package/lib/components/Article/ArticleMeta.d.ts +0 -13
- package/lib/components/Article/ArticleMeta.d.ts.map +0 -1
- package/lib/components/Article/ArticleMeta.js +0 -24
- package/lib/components/Article/ArticleMeta.js.map +0 -1
- package/lib/components/Article/index.d.ts +0 -5
- package/lib/components/Article/index.d.ts.map +0 -1
- package/lib/components/Article/index.js +0 -3
- package/lib/components/Article/index.js.map +0 -1
- package/lib/components/ArticleList/ArticleList.d.ts +0 -6
- package/lib/components/ArticleList/ArticleList.d.ts.map +0 -1
- package/lib/components/ArticleList/ArticleList.js +0 -132
- package/lib/components/ArticleList/ArticleList.js.map +0 -1
- package/lib/components/ArticleList/ArticleList.types.d.ts +0 -87
- package/lib/components/ArticleList/ArticleList.types.d.ts.map +0 -1
- package/lib/components/ArticleList/ArticleList.types.js +0 -2
- package/lib/components/ArticleList/ArticleList.types.js.map +0 -1
- package/lib/components/ArticleList/ArticleListFilter.d.ts +0 -6
- package/lib/components/ArticleList/ArticleListFilter.d.ts.map +0 -1
- package/lib/components/ArticleList/ArticleListFilter.js +0 -61
- package/lib/components/ArticleList/ArticleListFilter.js.map +0 -1
- package/lib/components/ArticleList/ArticleListHeader.d.ts +0 -5
- package/lib/components/ArticleList/ArticleListHeader.d.ts.map +0 -1
- package/lib/components/ArticleList/ArticleListHeader.js +0 -20
- package/lib/components/ArticleList/ArticleListHeader.js.map +0 -1
- package/lib/components/ArticleList/ArticleSummary.d.ts +0 -7
- package/lib/components/ArticleList/ArticleSummary.d.ts.map +0 -1
- package/lib/components/ArticleList/ArticleSummary.js +0 -56
- package/lib/components/ArticleList/ArticleSummary.js.map +0 -1
- package/lib/components/ArticleList/index.d.ts +0 -6
- package/lib/components/ArticleList/index.d.ts.map +0 -1
- package/lib/components/ArticleList/index.js +0 -4
- package/lib/components/ArticleList/index.js.map +0 -1
- package/lib/components/Assignments/Assignments.d.ts +0 -21
- package/lib/components/Assignments/Assignments.d.ts.map +0 -1
- package/lib/components/Assignments/Assignments.js +0 -20
- package/lib/components/Assignments/Assignments.js.map +0 -1
- package/lib/components/Assignments/Assignments.styles.d.ts +0 -8
- package/lib/components/Assignments/Assignments.styles.d.ts.map +0 -1
- package/lib/components/Assignments/Assignments.styles.js +0 -41
- package/lib/components/Assignments/Assignments.styles.js.map +0 -1
- package/lib/components/Assignments/index.d.ts +0 -2
- package/lib/components/Assignments/index.d.ts.map +0 -1
- package/lib/components/Assignments/index.js +0 -2
- package/lib/components/Assignments/index.js.map +0 -1
- package/lib/components/CasePreview/CasePreview.d.ts +0 -27
- package/lib/components/CasePreview/CasePreview.d.ts.map +0 -1
- package/lib/components/CasePreview/CasePreview.js +0 -82
- package/lib/components/CasePreview/CasePreview.js.map +0 -1
- package/lib/components/CasePreview/CasePreview.test-ids.d.ts +0 -2
- package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +0 -1
- package/lib/components/CasePreview/CasePreview.test-ids.js +0 -3
- package/lib/components/CasePreview/CasePreview.test-ids.js.map +0 -1
- package/lib/components/CasePreview/index.d.ts +0 -3
- package/lib/components/CasePreview/index.d.ts.map +0 -1
- package/lib/components/CasePreview/index.js +0 -2
- package/lib/components/CasePreview/index.js.map +0 -1
- package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts +0 -4
- package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +0 -1
- package/lib/components/CaseView/CaseHeader/CaseHeader.js +0 -127
- package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +0 -1
- package/lib/components/CaseView/CaseHeader/Summary.d.ts +0 -6
- package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +0 -1
- package/lib/components/CaseView/CaseHeader/Summary.js +0 -182
- package/lib/components/CaseView/CaseHeader/Summary.js.map +0 -1
- package/lib/components/CaseView/CaseSummary.d.ts +0 -4
- package/lib/components/CaseView/CaseSummary.d.ts.map +0 -1
- package/lib/components/CaseView/CaseSummary.js +0 -18
- package/lib/components/CaseView/CaseSummary.js.map +0 -1
- package/lib/components/CaseView/CaseSummaryFields.d.ts +0 -6
- package/lib/components/CaseView/CaseSummaryFields.d.ts.map +0 -1
- package/lib/components/CaseView/CaseSummaryFields.js +0 -18
- package/lib/components/CaseView/CaseSummaryFields.js.map +0 -1
- package/lib/components/CaseView/CaseView.context.d.ts +0 -5
- package/lib/components/CaseView/CaseView.context.d.ts.map +0 -1
- package/lib/components/CaseView/CaseView.context.js +0 -5
- package/lib/components/CaseView/CaseView.context.js.map +0 -1
- package/lib/components/CaseView/CaseView.d.ts +0 -8
- package/lib/components/CaseView/CaseView.d.ts.map +0 -1
- package/lib/components/CaseView/CaseView.js +0 -421
- package/lib/components/CaseView/CaseView.js.map +0 -1
- package/lib/components/CaseView/CaseView.styles.d.ts +0 -45
- package/lib/components/CaseView/CaseView.styles.d.ts.map +0 -1
- package/lib/components/CaseView/CaseView.styles.js +0 -559
- package/lib/components/CaseView/CaseView.styles.js.map +0 -1
- package/lib/components/CaseView/CaseView.test-ids.d.ts +0 -2
- package/lib/components/CaseView/CaseView.test-ids.d.ts.map +0 -1
- package/lib/components/CaseView/CaseView.test-ids.js +0 -18
- package/lib/components/CaseView/CaseView.test-ids.js.map +0 -1
- package/lib/components/CaseView/CaseView.types.d.ts +0 -98
- package/lib/components/CaseView/CaseView.types.d.ts.map +0 -1
- package/lib/components/CaseView/CaseView.types.js +0 -2
- package/lib/components/CaseView/CaseView.types.js.map +0 -1
- package/lib/components/CaseView/UtilitiesSummary.d.ts +0 -9
- package/lib/components/CaseView/UtilitiesSummary.d.ts.map +0 -1
- package/lib/components/CaseView/UtilitiesSummary.js +0 -53
- package/lib/components/CaseView/UtilitiesSummary.js.map +0 -1
- package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts +0 -9
- package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts.map +0 -1
- package/lib/components/CaseView/UtilitySummaryItemDialog.js +0 -29
- package/lib/components/CaseView/UtilitySummaryItemDialog.js.map +0 -1
- package/lib/components/CaseView/index.d.ts +0 -5
- package/lib/components/CaseView/index.d.ts.map +0 -1
- package/lib/components/CaseView/index.js +0 -4
- package/lib/components/CaseView/index.js.map +0 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +0 -4
- package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +0 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js +0 -86
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +0 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +0 -41
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +0 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +0 -2
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +0 -1
- package/lib/components/ConfigurableLayout/LayoutCell.d.ts +0 -6
- package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +0 -1
- package/lib/components/ConfigurableLayout/LayoutCell.js +0 -64
- package/lib/components/ConfigurableLayout/LayoutCell.js.map +0 -1
- package/lib/components/ConfigurableLayout/defaults.d.ts +0 -4
- package/lib/components/ConfigurableLayout/defaults.d.ts.map +0 -1
- package/lib/components/ConfigurableLayout/defaults.js +0 -4
- package/lib/components/ConfigurableLayout/defaults.js.map +0 -1
- package/lib/components/ConfigurableLayout/index.d.ts +0 -4
- package/lib/components/ConfigurableLayout/index.d.ts.map +0 -1
- package/lib/components/ConfigurableLayout/index.js +0 -3
- package/lib/components/ConfigurableLayout/index.js.map +0 -1
- package/lib/components/ConfigurableLayout/options.d.ts +0 -10
- package/lib/components/ConfigurableLayout/options.d.ts.map +0 -1
- package/lib/components/ConfigurableLayout/options.js +0 -10
- package/lib/components/ConfigurableLayout/options.js.map +0 -1
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +0 -7
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +0 -1
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js +0 -37
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +0 -1
- package/lib/components/Confirmation/Confirmation.d.ts +0 -19
- package/lib/components/Confirmation/Confirmation.d.ts.map +0 -1
- package/lib/components/Confirmation/Confirmation.js +0 -29
- package/lib/components/Confirmation/Confirmation.js.map +0 -1
- package/lib/components/Confirmation/index.d.ts +0 -3
- package/lib/components/Confirmation/index.d.ts.map +0 -1
- package/lib/components/Confirmation/index.js +0 -2
- package/lib/components/Confirmation/index.js.map +0 -1
- package/lib/components/Details/Details.d.ts +0 -38
- package/lib/components/Details/Details.d.ts.map +0 -1
- package/lib/components/Details/Details.js +0 -92
- package/lib/components/Details/Details.js.map +0 -1
- package/lib/components/Details/Details.styles.d.ts +0 -50
- package/lib/components/Details/Details.styles.d.ts.map +0 -1
- package/lib/components/Details/Details.styles.js +0 -204
- package/lib/components/Details/Details.styles.js.map +0 -1
- package/lib/components/Details/Details.test-ids.d.ts +0 -2
- package/lib/components/Details/Details.test-ids.d.ts.map +0 -1
- package/lib/components/Details/Details.test-ids.js +0 -9
- package/lib/components/Details/Details.test-ids.js.map +0 -1
- package/lib/components/Details/DetailsContext.d.ts +0 -9
- package/lib/components/Details/DetailsContext.d.ts.map +0 -1
- package/lib/components/Details/DetailsContext.js +0 -9
- package/lib/components/Details/DetailsContext.js.map +0 -1
- package/lib/components/Details/index.d.ts +0 -4
- package/lib/components/Details/index.d.ts.map +0 -1
- package/lib/components/Details/index.js +0 -4
- package/lib/components/Details/index.js.map +0 -1
- package/lib/components/Glimpse/Glimpse.d.ts +0 -20
- package/lib/components/Glimpse/Glimpse.d.ts.map +0 -1
- package/lib/components/Glimpse/Glimpse.js +0 -12
- package/lib/components/Glimpse/Glimpse.js.map +0 -1
- package/lib/components/Glimpse/index.d.ts +0 -3
- package/lib/components/Glimpse/index.d.ts.map +0 -1
- package/lib/components/Glimpse/index.js +0 -2
- package/lib/components/Glimpse/index.js.map +0 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +0 -6
- package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +0 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.js +0 -83
- package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +0 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +0 -9
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +0 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +0 -199
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +0 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +0 -35
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +0 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js +0 -2
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +0 -1
- package/lib/components/IntelligentGuidance/index.d.ts +0 -3
- package/lib/components/IntelligentGuidance/index.d.ts.map +0 -1
- package/lib/components/IntelligentGuidance/index.js +0 -2
- package/lib/components/IntelligentGuidance/index.js.map +0 -1
- package/lib/components/Predictions/Predictions.d.ts +0 -6
- package/lib/components/Predictions/Predictions.d.ts.map +0 -1
- package/lib/components/Predictions/Predictions.js +0 -68
- package/lib/components/Predictions/Predictions.js.map +0 -1
- package/lib/components/Predictions/Predictions.types.d.ts +0 -23
- package/lib/components/Predictions/Predictions.types.d.ts.map +0 -1
- package/lib/components/Predictions/Predictions.types.js +0 -2
- package/lib/components/Predictions/Predictions.types.js.map +0 -1
- package/lib/components/Predictions/index.d.ts +0 -3
- package/lib/components/Predictions/index.d.ts.map +0 -1
- package/lib/components/Predictions/index.js +0 -2
- package/lib/components/Predictions/index.js.map +0 -1
- package/lib/components/SearchResults/Filter.d.ts +0 -8
- package/lib/components/SearchResults/Filter.d.ts.map +0 -1
- package/lib/components/SearchResults/Filter.js +0 -45
- package/lib/components/SearchResults/Filter.js.map +0 -1
- package/lib/components/SearchResults/SearchResult.d.ts +0 -4
- package/lib/components/SearchResults/SearchResult.d.ts.map +0 -1
- package/lib/components/SearchResults/SearchResult.js +0 -27
- package/lib/components/SearchResults/SearchResult.js.map +0 -1
- package/lib/components/SearchResults/SearchResults.d.ts +0 -6
- package/lib/components/SearchResults/SearchResults.d.ts.map +0 -1
- package/lib/components/SearchResults/SearchResults.js +0 -121
- package/lib/components/SearchResults/SearchResults.js.map +0 -1
- package/lib/components/SearchResults/SearchResults.styles.d.ts +0 -11
- package/lib/components/SearchResults/SearchResults.styles.d.ts.map +0 -1
- package/lib/components/SearchResults/SearchResults.styles.js +0 -88
- package/lib/components/SearchResults/SearchResults.styles.js.map +0 -1
- package/lib/components/SearchResults/SearchResults.types.d.ts +0 -100
- package/lib/components/SearchResults/SearchResults.types.d.ts.map +0 -1
- package/lib/components/SearchResults/SearchResults.types.js +0 -2
- package/lib/components/SearchResults/SearchResults.types.js.map +0 -1
- package/lib/components/SearchResults/index.d.ts +0 -3
- package/lib/components/SearchResults/index.d.ts.map +0 -1
- package/lib/components/SearchResults/index.js +0 -2
- package/lib/components/SearchResults/index.js.map +0 -1
- package/lib/components/Stages/StageGlimpse.d.ts +0 -8
- package/lib/components/Stages/StageGlimpse.d.ts.map +0 -1
- package/lib/components/Stages/StageGlimpse.js +0 -11
- package/lib/components/Stages/StageGlimpse.js.map +0 -1
- package/lib/components/Stages/Stages.d.ts +0 -6
- package/lib/components/Stages/Stages.d.ts.map +0 -1
- package/lib/components/Stages/Stages.js +0 -107
- package/lib/components/Stages/Stages.js.map +0 -1
- package/lib/components/Stages/Stages.styles.d.ts +0 -14
- package/lib/components/Stages/Stages.styles.d.ts.map +0 -1
- package/lib/components/Stages/Stages.styles.js +0 -270
- package/lib/components/Stages/Stages.styles.js.map +0 -1
- package/lib/components/Stages/Stages.types.d.ts +0 -38
- package/lib/components/Stages/Stages.types.d.ts.map +0 -1
- package/lib/components/Stages/Stages.types.js +0 -2
- package/lib/components/Stages/Stages.types.js.map +0 -1
- package/lib/components/Stages/index.d.ts +0 -3
- package/lib/components/Stages/index.d.ts.map +0 -1
- package/lib/components/Stages/index.js +0 -2
- package/lib/components/Stages/index.js.map +0 -1
- package/lib/components/Stakeholders/StakeholderForm.d.ts +0 -7
- package/lib/components/Stakeholders/StakeholderForm.d.ts.map +0 -1
- package/lib/components/Stakeholders/StakeholderForm.js +0 -49
- package/lib/components/Stakeholders/StakeholderForm.js.map +0 -1
- package/lib/components/Stakeholders/Stakeholders.d.ts +0 -6
- package/lib/components/Stakeholders/Stakeholders.d.ts.map +0 -1
- package/lib/components/Stakeholders/Stakeholders.js +0 -220
- package/lib/components/Stakeholders/Stakeholders.js.map +0 -1
- package/lib/components/Stakeholders/Stakeholders.types.d.ts +0 -75
- package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +0 -1
- package/lib/components/Stakeholders/Stakeholders.types.js +0 -2
- package/lib/components/Stakeholders/Stakeholders.types.js.map +0 -1
- package/lib/components/Stakeholders/index.d.ts +0 -3
- package/lib/components/Stakeholders/index.d.ts.map +0 -1
- package/lib/components/Stakeholders/index.js +0 -2
- package/lib/components/Stakeholders/index.js.map +0 -1
- package/lib/components/Tags/Tags.d.ts +0 -34
- package/lib/components/Tags/Tags.d.ts.map +0 -1
- package/lib/components/Tags/Tags.js +0 -230
- package/lib/components/Tags/Tags.js.map +0 -1
- package/lib/components/Tags/index.d.ts +0 -3
- package/lib/components/Tags/index.d.ts.map +0 -1
- package/lib/components/Tags/index.js +0 -2
- package/lib/components/Tags/index.js.map +0 -1
- package/lib/components/Tasks/TaskList.d.ts +0 -39
- package/lib/components/Tasks/TaskList.d.ts.map +0 -1
- package/lib/components/Tasks/TaskList.js +0 -71
- package/lib/components/Tasks/TaskList.js.map +0 -1
- package/lib/components/Tasks/Tasks.d.ts +0 -29
- package/lib/components/Tasks/Tasks.d.ts.map +0 -1
- package/lib/components/Tasks/Tasks.js +0 -52
- package/lib/components/Tasks/Tasks.js.map +0 -1
- package/lib/components/Tasks/Tasks.test-ids.d.ts +0 -4
- package/lib/components/Tasks/Tasks.test-ids.d.ts.map +0 -1
- package/lib/components/Tasks/Tasks.test-ids.js +0 -5
- package/lib/components/Tasks/Tasks.test-ids.js.map +0 -1
- package/lib/components/Tasks/index.d.ts +0 -4
- package/lib/components/Tasks/index.d.ts.map +0 -1
- package/lib/components/Tasks/index.js +0 -4
- package/lib/components/Tasks/index.js.map +0 -1
- package/lib/components/Timeline/Timeline.d.ts +0 -6
- package/lib/components/Timeline/Timeline.d.ts.map +0 -1
- package/lib/components/Timeline/Timeline.js +0 -26
- package/lib/components/Timeline/Timeline.js.map +0 -1
- package/lib/components/Timeline/Timeline.styles.d.ts +0 -21
- package/lib/components/Timeline/Timeline.styles.d.ts.map +0 -1
- package/lib/components/Timeline/Timeline.styles.js +0 -165
- package/lib/components/Timeline/Timeline.styles.js.map +0 -1
- package/lib/components/Timeline/Timeline.types.d.ts +0 -66
- package/lib/components/Timeline/Timeline.types.d.ts.map +0 -1
- package/lib/components/Timeline/Timeline.types.js +0 -2
- package/lib/components/Timeline/Timeline.types.js.map +0 -1
- package/lib/components/Timeline/TimelineItem.d.ts +0 -13
- package/lib/components/Timeline/TimelineItem.d.ts.map +0 -1
- package/lib/components/Timeline/TimelineItem.js +0 -33
- package/lib/components/Timeline/TimelineItem.js.map +0 -1
- package/lib/components/Timeline/TimelineToolbar.d.ts +0 -6
- package/lib/components/Timeline/TimelineToolbar.d.ts.map +0 -1
- package/lib/components/Timeline/TimelineToolbar.js +0 -68
- package/lib/components/Timeline/TimelineToolbar.js.map +0 -1
- package/lib/components/Timeline/index.d.ts +0 -4
- package/lib/components/Timeline/index.d.ts.map +0 -1
- package/lib/components/Timeline/index.js +0 -3
- package/lib/components/Timeline/index.js.map +0 -1
- package/lib/components/Timeline/utils.d.ts +0 -15
- package/lib/components/Timeline/utils.d.ts.map +0 -1
- package/lib/components/Timeline/utils.js +0 -75
- package/lib/components/Timeline/utils.js.map +0 -1
- package/lib/index.d.ts +0 -37
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -38
- package/lib/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-work",
|
|
3
|
-
"version": "5.0.0-dev.4.
|
|
3
|
+
"version": "5.0.0-dev.4.8",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/pegasystems/cosmos-react.git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"build": "tsc -b"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@pega/cosmos-react-core": "5.0.0-dev.4.
|
|
23
|
+
"@pega/cosmos-react-core": "5.0.0-dev.4.8",
|
|
24
24
|
"@types/react": "^17.0.62",
|
|
25
25
|
"@types/react-dom": "^17.0.20",
|
|
26
26
|
"@types/styled-components": "^5.1.26",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, Ref } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps, NoChildrenProp } from '@pega/cosmos-react-core';
|
|
3
|
-
export interface AppAnnouncementProps extends BaseProps, NoChildrenProp {
|
|
4
|
-
/** Heading text for the announcement. */
|
|
5
|
-
heading?: string;
|
|
6
|
-
/** Description text for the announcement. */
|
|
7
|
-
description?: string;
|
|
8
|
-
/** Announcement details to be displayed in form of bulleted list. */
|
|
9
|
-
details?: string[];
|
|
10
|
-
/** Url to open with What's new link. */
|
|
11
|
-
whatsNewLink?: string;
|
|
12
|
-
/** Content to populate the announcement button. */
|
|
13
|
-
whatsNewText?: string;
|
|
14
|
-
/** An image source for the decorative background. */
|
|
15
|
-
image?: string;
|
|
16
|
-
/** Callback when user dismisses the announcements. */
|
|
17
|
-
onDismiss?: () => void;
|
|
18
|
-
ref?: Ref<HTMLElement>;
|
|
19
|
-
}
|
|
20
|
-
export declare const StyledAppAnnouncement: import("styled-components").StyledComponent<"article", import("styled-components").DefaultTheme, Pick<AppAnnouncementProps, "image">, never>;
|
|
21
|
-
declare const AppAnnouncement: FunctionComponent<AppAnnouncementProps & ForwardProps>;
|
|
22
|
-
export default AppAnnouncement;
|
|
23
|
-
//# sourceMappingURL=AppAnnouncement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAI5E,OAAO,EASL,SAAS,EACT,YAAY,EAEZ,cAAc,EACf,MAAM,yBAAyB,CAAC;AAKjC,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,cAAc;IACrE,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB;AAOD,eAAO,MAAM,qBAAqB,8IAoFhC,CAAC;AAIH,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CAkD3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import { readableColor } from 'polished';
|
|
5
|
-
import { Button, StyledButton, Text, Icon, registerIcon, useI18n, tryCatch, defaultThemeProp, useDirection } from '@pega/cosmos-react-core';
|
|
6
|
-
import * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';
|
|
7
|
-
registerIcon(timesIcon);
|
|
8
|
-
const StyledDismissButton = styled.button `
|
|
9
|
-
font-size: 1.25rem;
|
|
10
|
-
border: none;
|
|
11
|
-
`;
|
|
12
|
-
export const StyledAppAnnouncement = styled.article(props => {
|
|
13
|
-
const { theme: { base: { palette: { 'brand-primary': brandBackground }, shadow, spacing }, components: { card: { 'border-radius': borderRadius } } }, image } = props;
|
|
14
|
-
const { end } = useDirection();
|
|
15
|
-
const color = tryCatch(() => readableColor(brandBackground));
|
|
16
|
-
return css `
|
|
17
|
-
padding: calc(2 * ${spacing});
|
|
18
|
-
background: ${brandBackground};
|
|
19
|
-
border-radius: ${borderRadius};
|
|
20
|
-
color: ${color};
|
|
21
|
-
position: relative;
|
|
22
|
-
|
|
23
|
-
&::after {
|
|
24
|
-
background: url('${image}') no-repeat;
|
|
25
|
-
background-position: ${end} bottom;
|
|
26
|
-
background-size: contain;
|
|
27
|
-
background-origin: content-box;
|
|
28
|
-
opacity: 0.2;
|
|
29
|
-
content: '';
|
|
30
|
-
display: block;
|
|
31
|
-
position: absolute;
|
|
32
|
-
width: 50%;
|
|
33
|
-
height: 100%;
|
|
34
|
-
inset-inline-end: 0;
|
|
35
|
-
bottom: 0;
|
|
36
|
-
padding: calc(2 * ${spacing});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
h2 {
|
|
40
|
-
position: relative;
|
|
41
|
-
z-index: 2;
|
|
42
|
-
margin-bottom: ${spacing};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
${StyledDismissButton} {
|
|
46
|
-
position: absolute;
|
|
47
|
-
top: 0.75rem;
|
|
48
|
-
inset-inline-end: 0.75rem;
|
|
49
|
-
color: inherit;
|
|
50
|
-
z-index: 3;
|
|
51
|
-
&:enabled:hover {
|
|
52
|
-
background: #ffffff19;
|
|
53
|
-
}
|
|
54
|
-
&:enabled:focus {
|
|
55
|
-
box-shadow: ${shadow.focus};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
> div {
|
|
60
|
-
width: 75%;
|
|
61
|
-
position: relative;
|
|
62
|
-
z-index: 2;
|
|
63
|
-
|
|
64
|
-
p,
|
|
65
|
-
ul {
|
|
66
|
-
padding-top: calc(2 * ${spacing});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
ul {
|
|
70
|
-
padding-inline-start: calc(2 * ${spacing});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
${StyledButton} {
|
|
74
|
-
margin-top: calc(2 * ${spacing});
|
|
75
|
-
&:enabled:focus,
|
|
76
|
-
&:not([disabled]):focus {
|
|
77
|
-
box-shadow: ${shadow.focus};
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
`;
|
|
82
|
-
});
|
|
83
|
-
StyledAppAnnouncement.defaultProps = defaultThemeProp;
|
|
84
|
-
const AppAnnouncement = forwardRef(function AppAnnouncement(props, ref) {
|
|
85
|
-
const t = useI18n();
|
|
86
|
-
const { heading, description, details, whatsNewLink, whatsNewText = t('app_announcement_whats_new_button_label'), image, onDismiss, ...restProps } = props;
|
|
87
|
-
return (_jsxs(StyledAppAnnouncement, { ...restProps, ref: ref, image: image, children: [onDismiss && (_jsx(Button, { as: StyledDismissButton, variant: 'simple', icon: true, onClick: onDismiss, "aria-label": t('app_announcement_dismiss_button_label_a11y'), children: _jsx(Icon, { name: 'times' }) })), _jsx(Text, { variant: 'h2', children: heading || t('app_announcement_details_list_header') }), _jsxs("div", { children: [description && _jsx("p", { children: description }), details && (_jsx("ul", { children: details.map((item, index) => {
|
|
88
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
89
|
-
return _jsx("li", { children: item }, index);
|
|
90
|
-
}) })), whatsNewLink && (_jsx(Button, { variant: 'secondary', href: whatsNewLink, target: '_blank', children: whatsNewText }))] })] }));
|
|
91
|
-
});
|
|
92
|
-
export default AppAnnouncement;
|
|
93
|
-
//# sourceMappingURL=AppAnnouncement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppAnnouncement.js","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,gBAAgB,EAGhB,YAAY,EAEb,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,8DAA8D,C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G,KAAK,CAAC;IAEV,OAAO,CACL,MAAC,qBAAqB,OAAK,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,aACzD,SAAS,IAAI,CACZ,KAAC,MAAM,IACL,EAAE,EAAE,mBAAmB,EACvB,OAAO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,EAAE,SAAS,gBACN,CAAC,CAAC,4CAA4C,CAAC,YAE3D,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GACd,CACV,EACD,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,OAAO,IAAI,CAAC,CAAC,sCAAsC,CAAC,GAAQ,EAChF,0BACG,WAAW,IAAI,sBAAI,WAAW,GAAK,EACnC,OAAO,IAAI,CACV,uBACG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;4BAC3B,oDAAoD;4BACpD,OAAO,uBAAiB,IAAI,IAAZ,KAAK,CAAa,CAAC;wBACrC,CAAC,CAAC,GACC,CACN,EACA,YAAY,IAAI,CACf,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAC,QAAQ,YAC5D,YAAY,GACN,CACV,IACG,IACgB,CACzB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Button,\n StyledButton,\n Text,\n Icon,\n registerIcon,\n useI18n,\n tryCatch,\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n useDirection,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nregisterIcon(timesIcon);\n\nexport interface AppAnnouncementProps extends BaseProps, NoChildrenProp {\n /** Heading text for the announcement. */\n heading?: string;\n /** Description text for the announcement. */\n description?: string;\n /** Announcement details to be displayed in form of bulleted list. */\n details?: string[];\n /** Url to open with What's new link. */\n whatsNewLink?: string;\n /** Content to populate the announcement button. */\n whatsNewText?: string;\n /** An image source for the decorative background. */\n image?: string;\n /** Callback when user dismisses the announcements. */\n onDismiss?: () => void;\n ref?: Ref<HTMLElement>;\n}\n\nconst StyledDismissButton = styled.button`\n font-size: 1.25rem;\n border: none;\n`;\n\nexport const StyledAppAnnouncement = styled.article<Pick<AppAnnouncementProps, 'image'>>(props => {\n const {\n theme: {\n base: {\n palette: { 'brand-primary': brandBackground },\n shadow,\n spacing\n },\n components: {\n card: { 'border-radius': borderRadius }\n }\n },\n image\n } = props;\n\n const { end } = useDirection();\n const color = tryCatch(() => readableColor(brandBackground));\n\n return css`\n padding: calc(2 * ${spacing});\n background: ${brandBackground};\n border-radius: ${borderRadius};\n color: ${color};\n position: relative;\n\n &::after {\n background: url('${image}') no-repeat;\n background-position: ${end} bottom;\n background-size: contain;\n background-origin: content-box;\n opacity: 0.2;\n content: '';\n display: block;\n position: absolute;\n width: 50%;\n height: 100%;\n inset-inline-end: 0;\n bottom: 0;\n padding: calc(2 * ${spacing});\n }\n\n h2 {\n position: relative;\n z-index: 2;\n margin-bottom: ${spacing};\n }\n\n ${StyledDismissButton} {\n position: absolute;\n top: 0.75rem;\n inset-inline-end: 0.75rem;\n color: inherit;\n z-index: 3;\n &:enabled:hover {\n background: #ffffff19;\n }\n &:enabled:focus {\n box-shadow: ${shadow.focus};\n }\n }\n\n > div {\n width: 75%;\n position: relative;\n z-index: 2;\n\n p,\n ul {\n padding-top: calc(2 * ${spacing});\n }\n\n ul {\n padding-inline-start: calc(2 * ${spacing});\n }\n\n ${StyledButton} {\n margin-top: calc(2 * ${spacing});\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: ${shadow.focus};\n }\n }\n }\n `;\n});\n\nStyledAppAnnouncement.defaultProps = defaultThemeProp;\n\nconst AppAnnouncement: FunctionComponent<AppAnnouncementProps & ForwardProps> = forwardRef(\n function AppAnnouncement(\n props: PropsWithoutRef<AppAnnouncementProps>,\n ref: AppAnnouncementProps['ref']\n ) {\n const t = useI18n();\n const {\n heading,\n description,\n details,\n whatsNewLink,\n whatsNewText = t('app_announcement_whats_new_button_label'),\n image,\n onDismiss,\n ...restProps\n } = props;\n\n return (\n <StyledAppAnnouncement {...restProps} ref={ref} image={image}>\n {onDismiss && (\n <Button\n as={StyledDismissButton}\n variant='simple'\n icon\n onClick={onDismiss}\n aria-label={t('app_announcement_dismiss_button_label_a11y')}\n >\n <Icon name='times' />\n </Button>\n )}\n <Text variant='h2'>{heading || t('app_announcement_details_list_header')}</Text>\n <div>\n {description && <p>{description}</p>}\n {details && (\n <ul>\n {details.map((item, index) => {\n // eslint-disable-next-line react/no-array-index-key\n return <li key={index}>{item}</li>;\n })}\n </ul>\n )}\n {whatsNewLink && (\n <Button variant='secondary' href={whatsNewLink} target='_blank'>\n {whatsNewText}\n </Button>\n )}\n </div>\n </StyledAppAnnouncement>\n );\n }\n);\n\nexport default AppAnnouncement;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { default } from './AppAnnouncement';\nexport type { AppAnnouncementProps } from './AppAnnouncement';\n"]}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ReactNode, FunctionComponent, MouseEvent } from 'react';
|
|
2
|
-
import { MenuItemProps, BaseProps, ForwardProps, NoChildrenProp } from '@pega/cosmos-react-core';
|
|
3
|
-
import { ArticleListHeaderProps } from '../ArticleList/ArticleList.types';
|
|
4
|
-
import { ArticleFooterProps } from './ArticleFooter';
|
|
5
|
-
import { ArticleMetaProps } from './ArticleMeta';
|
|
6
|
-
export interface BaseArticleProps extends BaseProps, NoChildrenProp {
|
|
7
|
-
/** Header to show icon , title and any actions on the container */
|
|
8
|
-
header?: ArticleListHeaderProps;
|
|
9
|
-
/** Control for navigating back */
|
|
10
|
-
backNavigation?: {
|
|
11
|
-
title: string;
|
|
12
|
-
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
-
};
|
|
14
|
-
/** Primary actions which needs to be displayed with an icon */
|
|
15
|
-
primaryActions?: {
|
|
16
|
-
/** Unique id for action, used in onClick callback */
|
|
17
|
-
id: string;
|
|
18
|
-
/** Label for this action, shown in tooltip and used for generating aria-label */
|
|
19
|
-
label: string;
|
|
20
|
-
/** Icon to be displayed in the button */
|
|
21
|
-
icon: string;
|
|
22
|
-
/** Callback triggered when a user clicks of presses enter on the action */
|
|
23
|
-
onClick: (id: string, e: MouseEvent<HTMLButtonElement>) => void;
|
|
24
|
-
}[];
|
|
25
|
-
/** Secondary actions that needs to be pushed under more icon */
|
|
26
|
-
secondaryActions?: {
|
|
27
|
-
id: MenuItemProps['id'];
|
|
28
|
-
text: MenuItemProps['primary'];
|
|
29
|
-
onClick: MenuItemProps['onClick'];
|
|
30
|
-
}[];
|
|
31
|
-
/** Article title */
|
|
32
|
-
title: string;
|
|
33
|
-
/** Array of meta data */
|
|
34
|
-
meta?: ArticleMetaProps;
|
|
35
|
-
/** Article content */
|
|
36
|
-
content: ReactNode;
|
|
37
|
-
/** Footer */
|
|
38
|
-
footer?: ArticleFooterProps;
|
|
39
|
-
/** Prop to check visibility of skeleton */
|
|
40
|
-
loading: boolean;
|
|
41
|
-
}
|
|
42
|
-
export type ArticleProps = (BaseArticleProps & {
|
|
43
|
-
loading?: false;
|
|
44
|
-
}) | (Partial<BaseArticleProps> & {
|
|
45
|
-
loading: true;
|
|
46
|
-
});
|
|
47
|
-
declare const Article: FunctionComponent<ArticleProps & ForwardProps>;
|
|
48
|
-
export default Article;
|
|
49
|
-
//# sourceMappingURL=Article.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Article.d.ts","sourceRoot":"","sources":["../../../src/components/Article/Article.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAGpF,OAAO,EAEL,aAAa,EAKb,SAAS,EACT,YAAY,EACZ,cAAc,EAMf,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAG1E,OAAsB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAoB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAG9D,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,cAAc;IACjE,mEAAmE;IACnE,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,kCAAkC;IAClC,cAAc,CAAC,EAAE;QACf,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;KACrD,CAAC;IACF,+DAA+D;IAC/D,cAAc,CAAC,EAAE;QACf,qDAAqD;QACrD,EAAE,EAAE,MAAM,CAAC;QACX,iFAAiF;QACjF,KAAK,EAAE,MAAM,CAAC;QACd,yCAAyC;QACzC,IAAI,EAAE,MAAM,CAAC;QACb,2EAA2E;QAC3E,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;KACjE,EAAE,CAAC;IACJ,gEAAgE;IAChE,gBAAgB,CAAC,EAAE;QACjB,EAAE,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;QAC/B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;KACnC,EAAE,CAAC;IACJ,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,sBAAsB;IACtB,OAAO,EAAE,SAAS,CAAC;IACnB,aAAa;IACb,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,YAAY,GACpB,CAAC,gBAAgB,GAAG;IAAE,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,GACxC,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AA6DpD,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,GAAG,YAAY,CA0G3D,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import { registerIcon, Flex, MenuButton, Text, defaultThemeProp, Button, Icon, Progress, useI18n, useDirection } from '@pega/cosmos-react-core';
|
|
5
|
-
import * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';
|
|
6
|
-
import * as caretRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-right.icon';
|
|
7
|
-
import ArticleListHeader from '../ArticleList/ArticleListHeader';
|
|
8
|
-
import ArticleFooter from './ArticleFooter';
|
|
9
|
-
import ArticleMeta from './ArticleMeta';
|
|
10
|
-
registerIcon(caretRightIcon, caretLeftIcon);
|
|
11
|
-
const StyledArticleWrapper = styled.div(props => {
|
|
12
|
-
const { theme } = props;
|
|
13
|
-
return css `
|
|
14
|
-
background: ${theme.base.palette['primary-background']};
|
|
15
|
-
padding: calc(1.5 * ${theme.base.spacing});
|
|
16
|
-
border-radius: calc(0.5 * ${theme.base['border-radius']});
|
|
17
|
-
max-height: inherit;
|
|
18
|
-
`;
|
|
19
|
-
});
|
|
20
|
-
const StyledArticleHeader = styled.header `
|
|
21
|
-
flex-shrink: 0;
|
|
22
|
-
`;
|
|
23
|
-
const StyledArticleContent = styled.div(props => {
|
|
24
|
-
const { theme, theme: { base: { spacing } } } = props;
|
|
25
|
-
return css `
|
|
26
|
-
flex-grow: 1;
|
|
27
|
-
overflow-y: auto;
|
|
28
|
-
padding: 0 calc(1.5 * ${spacing});
|
|
29
|
-
margin: 0 calc(-1.5 * ${spacing});
|
|
30
|
-
ul,
|
|
31
|
-
ol {
|
|
32
|
-
padding-left: calc(3 * ${spacing});
|
|
33
|
-
}
|
|
34
|
-
a {
|
|
35
|
-
color: ${theme.components.link.color};
|
|
36
|
-
}
|
|
37
|
-
* {
|
|
38
|
-
margin: revert;
|
|
39
|
-
}
|
|
40
|
-
`;
|
|
41
|
-
});
|
|
42
|
-
const StyledBackNavButton = styled(Button)(({ theme: { base: { spacing } } }) => {
|
|
43
|
-
return css `
|
|
44
|
-
display: flex;
|
|
45
|
-
align-items: start;
|
|
46
|
-
gap: calc(0.5 * ${spacing});
|
|
47
|
-
margin-inline-end: calc(1.5 * ${spacing});
|
|
48
|
-
`;
|
|
49
|
-
});
|
|
50
|
-
StyledArticleContent.defaultProps = defaultThemeProp;
|
|
51
|
-
StyledArticleWrapper.defaultProps = defaultThemeProp;
|
|
52
|
-
StyledBackNavButton.defaultProps = defaultThemeProp;
|
|
53
|
-
const Article = (props) => {
|
|
54
|
-
const { header, meta, title, backNavigation, content, primaryActions, secondaryActions, footer, loading, ...restProps } = props;
|
|
55
|
-
const { rtl, ltr, end, start } = useDirection();
|
|
56
|
-
const t = useI18n();
|
|
57
|
-
const backButtonRef = useRef(null);
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
if (!loading) {
|
|
60
|
-
backButtonRef.current?.focus();
|
|
61
|
-
}
|
|
62
|
-
}, [loading]);
|
|
63
|
-
return (_jsxs(Flex, { ...restProps, container: { direction: 'column', gap: 1 }, as: StyledArticleWrapper, "aria-busy": loading ? true : undefined, children: [header && _jsx(ArticleListHeader, { ...header }), (backNavigation || primaryActions || secondaryActions) && (_jsxs(Flex, { container: { alignItems: 'start' }, item: { grow: 1 }, children: [_jsx(Flex, { container: { pad: [1, undefined, undefined] }, item: { grow: 1 }, children: _jsxs(Button, { as: StyledBackNavButton, onClick: backNavigation?.onClick, variant: 'link', ref: backButtonRef, children: [ltr && _jsx(Icon, { name: `caret-${start}` }), backNavigation?.title, rtl && _jsx(Icon, { name: `caret-${end}` })] }) }), !loading && (_jsxs(_Fragment, { children: [primaryActions?.map(({ id, label, onClick, icon }) => {
|
|
64
|
-
return (_jsx(Button, { onClick: (e) => onClick(id, e), variant: 'simple', label: label, icon: true, children: _jsx(Icon, { name: icon }) }, id));
|
|
65
|
-
}), secondaryActions && (_jsx(MenuButton, { variant: 'simple', text: t('actions'), icon: 'more', iconOnly: true, menu: {
|
|
66
|
-
items: secondaryActions.map(({ text, ...rest }) => ({
|
|
67
|
-
...rest,
|
|
68
|
-
primary: text
|
|
69
|
-
}))
|
|
70
|
-
} }))] }))] })), !loading && (_jsxs(_Fragment, { children: [_jsx(Flex, { container: true, as: StyledArticleHeader, children: _jsx(Text, { variant: 'h2', children: title }) }), meta && (_jsx(Flex, { container: true, item: { shrink: 0 }, children: _jsx(ArticleMeta, { ...meta }) })), _jsx(StyledArticleContent, { children: content }), footer && _jsx(ArticleFooter, { ...footer })] })), _jsx(Progress, { visible: !!loading, placement: 'block', message: t('loading'), liveConfig: { contextualLabel: title ?? t('article_label_a11y') } })] }));
|
|
71
|
-
};
|
|
72
|
-
export default Article;
|
|
73
|
-
//# sourceMappingURL=Article.js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AAC,MAAM,EACX,QAAQ,QACR,IAAI,EAAE;oCACJ,KAAK,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;wCAClD,GAAG,IAAI;wCACP,OAAO,EAAE,IAAI;qCACd,CAAC,CAAC;iCACJ,GACD,CACH,IACA,CACJ,IACI,CACR,EACA,CAAC,OAAO,IAAI,CACX,8BACE,KAAC,IAAI,IAAC,SAAS,QAAC,EAAE,EAAE,mBAAmB,YACrC,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,KAAK,GAAQ,GAC5B,EAEN,IAAI,IAAI,CACP,KAAC,IAAI,IAAC,SAAS,QAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,YACjC,KAAC,WAAW,OAAK,IAAI,GAAI,GACpB,CACR,EAED,KAAC,oBAAoB,cAAE,OAAO,GAAwB,EAErD,MAAM,IAAI,KAAC,aAAa,OAAK,MAAM,GAAI,IACvC,CACJ,EACD,KAAC,QAAQ,IACP,OAAO,EAAE,CAAC,CAAC,OAAO,EAClB,SAAS,EAAC,OAAO,EACjB,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,EACrB,UAAU,EAAE,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC,CAAC,oBAAoB,CAAC,EAAE,GACjE,IACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { ReactNode, FunctionComponent, MouseEvent, useEffect, useRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n registerIcon,\n MenuItemProps,\n Flex,\n MenuButton,\n Text,\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n NoChildrenProp,\n Button,\n Icon,\n Progress,\n useI18n,\n useDirection\n} from '@pega/cosmos-react-core';\nimport * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-right.icon';\n\nimport { ArticleListHeaderProps } from '../ArticleList/ArticleList.types';\nimport ArticleListHeader from '../ArticleList/ArticleListHeader';\n\nimport ArticleFooter, { ArticleFooterProps } from './ArticleFooter';\nimport ArticleMeta, { ArticleMetaProps } from './ArticleMeta';\n\nregisterIcon(caretRightIcon, caretLeftIcon);\nexport interface BaseArticleProps extends BaseProps, NoChildrenProp {\n /** Header to show icon , title and any actions on the container */\n header?: ArticleListHeaderProps;\n /** Control for navigating back */\n backNavigation?: {\n title: string;\n onClick: (e: MouseEvent<HTMLButtonElement>) => void;\n };\n /** Primary actions which needs to be displayed with an icon */\n primaryActions?: {\n /** Unique id for action, used in onClick callback */\n id: string;\n /** Label for this action, shown in tooltip and used for generating aria-label */\n label: string;\n /** Icon to be displayed in the button */\n icon: string;\n /** Callback triggered when a user clicks of presses enter on the action */\n onClick: (id: string, e: MouseEvent<HTMLButtonElement>) => void;\n }[];\n /** Secondary actions that needs to be pushed under more icon */\n secondaryActions?: {\n id: MenuItemProps['id'];\n text: MenuItemProps['primary'];\n onClick: MenuItemProps['onClick'];\n }[];\n /** Article title */\n title: string;\n /** Array of meta data */\n meta?: ArticleMetaProps;\n /** Article content */\n content: ReactNode;\n /** Footer */\n footer?: ArticleFooterProps;\n /** Prop to check visibility of skeleton */\n loading: boolean;\n}\n\nexport type ArticleProps =\n | (BaseArticleProps & { loading?: false })\n | (Partial<BaseArticleProps> & { loading: true });\n\nconst StyledArticleWrapper = styled.div(props => {\n const { theme } = props;\n return css`\n background: ${theme.base.palette['primary-background']};\n padding: calc(1.5 * ${theme.base.spacing});\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n max-height: inherit;\n `;\n});\n\nconst StyledArticleHeader = styled.header`\n flex-shrink: 0;\n`;\n\nconst StyledArticleContent = styled.div(props => {\n const {\n theme,\n theme: {\n base: { spacing }\n }\n } = props;\n\n return css`\n flex-grow: 1;\n overflow-y: auto;\n padding: 0 calc(1.5 * ${spacing});\n margin: 0 calc(-1.5 * ${spacing});\n ul,\n ol {\n padding-left: calc(3 * ${spacing});\n }\n a {\n color: ${theme.components.link.color};\n }\n * {\n margin: revert;\n }\n `;\n});\n\nconst StyledBackNavButton = styled(Button)(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n display: flex;\n align-items: start;\n gap: calc(0.5 * ${spacing});\n margin-inline-end: calc(1.5 * ${spacing});\n `;\n }\n);\n\nStyledArticleContent.defaultProps = defaultThemeProp;\nStyledArticleWrapper.defaultProps = defaultThemeProp;\nStyledBackNavButton.defaultProps = defaultThemeProp;\n\nconst Article: FunctionComponent<ArticleProps & ForwardProps> = (props: ArticleProps) => {\n const {\n header,\n meta,\n title,\n backNavigation,\n content,\n primaryActions,\n secondaryActions,\n footer,\n loading,\n ...restProps\n } = props;\n\n const { rtl, ltr, end, start } = useDirection();\n\n const t = useI18n();\n const backButtonRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (!loading) {\n backButtonRef.current?.focus();\n }\n }, [loading]);\n\n return (\n <Flex\n {...restProps}\n container={{ direction: 'column', gap: 1 }}\n as={StyledArticleWrapper}\n aria-busy={loading ? true : undefined}\n >\n {header && <ArticleListHeader {...header} />}\n {(backNavigation || primaryActions || secondaryActions) && (\n <Flex container={{ alignItems: 'start' }} item={{ grow: 1 }}>\n <Flex container={{ pad: [1, undefined, undefined] }} item={{ grow: 1 }}>\n <Button\n as={StyledBackNavButton}\n onClick={backNavigation?.onClick}\n variant='link'\n ref={backButtonRef}\n >\n {ltr && <Icon name={`caret-${start}`} />}\n {backNavigation?.title}\n {rtl && <Icon name={`caret-${end}`} />}\n </Button>\n </Flex>\n\n {!loading && (\n <>\n {primaryActions?.map(({ id, label, onClick, icon }) => {\n return (\n <Button\n key={id}\n onClick={(e: MouseEvent<HTMLButtonElement>) => onClick(id, e)}\n variant='simple'\n label={label}\n icon\n >\n <Icon name={icon} />\n </Button>\n );\n })}\n {secondaryActions && (\n <MenuButton\n variant='simple'\n text={t('actions')}\n icon='more'\n iconOnly\n menu={{\n items: secondaryActions.map(({ text, ...rest }) => ({\n ...rest,\n primary: text\n }))\n }}\n />\n )}\n </>\n )}\n </Flex>\n )}\n {!loading && (\n <>\n <Flex container as={StyledArticleHeader}>\n <Text variant='h2'>{title}</Text>\n </Flex>\n\n {meta && (\n <Flex container item={{ shrink: 0 }}>\n <ArticleMeta {...meta} />\n </Flex>\n )}\n\n <StyledArticleContent>{content}</StyledArticleContent>\n\n {footer && <ArticleFooter {...footer} />}\n </>\n )}\n <Progress\n visible={!!loading}\n placement='block'\n message={t('loading')}\n liveConfig={{ contextualLabel: title ?? t('article_label_a11y') }}\n />\n </Flex>\n );\n};\n\nexport default Article;\n"]}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, MouseEvent } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps, FileUploadItemProps } from '@pega/cosmos-react-core';
|
|
3
|
-
export interface ArticleTag {
|
|
4
|
-
/** Tag name */
|
|
5
|
-
tagName: string;
|
|
6
|
-
/** Tag id. If not set tagName is treated as id */
|
|
7
|
-
id: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ArticleFooterProps extends BaseProps {
|
|
10
|
-
/** Feedback for this article */
|
|
11
|
-
feedback?: {
|
|
12
|
-
showThanksMessage?: boolean;
|
|
13
|
-
/** Weather the current article is liked or disliked. Used to determine */
|
|
14
|
-
status?: 'liked' | 'disliked';
|
|
15
|
-
/** Callback triggered on click of like or dislike */
|
|
16
|
-
onFeedbackClick: (button: 'like' | 'dislike', e: MouseEvent<HTMLButtonElement>) => void;
|
|
17
|
-
};
|
|
18
|
-
tags?: {
|
|
19
|
-
/** Article tags */
|
|
20
|
-
list: ArticleTag[];
|
|
21
|
-
/** Callback that triggers on click of tag */
|
|
22
|
-
onTagClick?: (id: ArticleTag['id']) => void;
|
|
23
|
-
};
|
|
24
|
-
/** Links to external sites */
|
|
25
|
-
relatedLinks?: {
|
|
26
|
-
title: string;
|
|
27
|
-
href: string;
|
|
28
|
-
}[];
|
|
29
|
-
/** Links to other articles */
|
|
30
|
-
relatedArticles?: {
|
|
31
|
-
id: string;
|
|
32
|
-
title: string;
|
|
33
|
-
onClick: (id: string, e: MouseEvent<HTMLButtonElement>) => void;
|
|
34
|
-
}[];
|
|
35
|
-
/** Attachments */
|
|
36
|
-
attachments?: FileUploadItemProps[];
|
|
37
|
-
}
|
|
38
|
-
declare const ArticleFooter: FunctionComponent<ArticleFooterProps & ForwardProps>;
|
|
39
|
-
export default ArticleFooter;
|
|
40
|
-
//# sourceMappingURL=ArticleFooter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleFooter.d.ts","sourceRoot":"","sources":["../../../src/components/Article/ArticleFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAIL,SAAS,EACT,YAAY,EACZ,mBAAmB,EAOpB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,WAAW,UAAU;IACzB,eAAe;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,gCAAgC;IAChC,QAAQ,CAAC,EAAE;QACT,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,2EAA2E;QAC3E,MAAM,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;QAC9B,qDAAqD;QACrD,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;KACzF,CAAC;IACF,IAAI,CAAC,EAAE;QACL,mBAAmB;QACnB,IAAI,EAAE,UAAU,EAAE,CAAC;QACnB,6CAA6C;QAC7C,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;KAC7C,CAAC;IACF,8BAA8B;IAC9B,YAAY,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjD,8BAA8B;IAC9B,eAAe,CAAC,EAAE;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;KACjE,EAAE,CAAC;IACJ,kBAAkB;IAClB,WAAW,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACrC;AAuCD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAwHvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { createElement as _createElement } from "react";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import { Flex, Tag, defaultThemeProp, Button, Text, Link, useI18n, FileUploadItem, Grid } from '@pega/cosmos-react-core';
|
|
5
|
-
import { StyledTag } from '@pega/cosmos-react-core/lib/components/Badges/Tag';
|
|
6
|
-
const StyledRelatedItemsContainer = styled.div ``;
|
|
7
|
-
const StyledRelatedItemsList = styled.div ``;
|
|
8
|
-
const StyledArticleFooter = styled.div(({ theme }) => {
|
|
9
|
-
return css `
|
|
10
|
-
flex-shrink: 0;
|
|
11
|
-
&::before {
|
|
12
|
-
content: '';
|
|
13
|
-
display: block;
|
|
14
|
-
background: ${theme.base.palette['border-line']};
|
|
15
|
-
height: 0.0625rem;
|
|
16
|
-
margin-bottom: calc(2 * ${theme.base.spacing});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
${StyledRelatedItemsContainer} {
|
|
20
|
-
margin-block-start: ${theme.base.spacing};
|
|
21
|
-
& > ${StyledRelatedItemsList} * {
|
|
22
|
-
margin-inline-start: 0;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
});
|
|
27
|
-
StyledArticleFooter.defaultProps = defaultThemeProp;
|
|
28
|
-
const StyledTags = styled.div(({ theme }) => {
|
|
29
|
-
return css `
|
|
30
|
-
padding: calc(0.25 * ${theme.base.spacing});
|
|
31
|
-
margin: 0 calc(-0.5 * ${theme.base.spacing});
|
|
32
|
-
& > ${StyledTag} {
|
|
33
|
-
margin: calc(0.25 * ${theme.base.spacing});
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
});
|
|
37
|
-
StyledTags.defaultProps = defaultThemeProp;
|
|
38
|
-
const ArticleFooter = (props) => {
|
|
39
|
-
const { tags, relatedLinks, relatedArticles, feedback, attachments, ...restProps } = props;
|
|
40
|
-
const t = useI18n();
|
|
41
|
-
return (_jsxs(Flex, { as: StyledArticleFooter, container: {
|
|
42
|
-
direction: 'column',
|
|
43
|
-
gap: 2
|
|
44
|
-
}, ...restProps, children: [feedback && (_jsx(Flex, { container: { gap: 2, alignItems: 'center' }, children: feedback.showThanksMessage ? (_jsx(Text, { children: t('article_thank_you_for_your_feedback') })) : (_jsxs(_Fragment, { children: [_jsx(Text, { children: t('article_was_this_helpful') }), _jsxs(Flex, { container: true, children: [_jsx(Button, { variant: feedback.status === 'liked' ? 'primary' : 'secondary', onClick: (e) => feedback.onFeedbackClick('like', e), children: t('yes') }), _jsx(Button, { variant: feedback.status === 'disliked' ? 'primary' : 'secondary', onClick: (e) => feedback.onFeedbackClick('dislike', e), children: t('no') })] })] })) })), tags && (_jsx(Flex, { container: { wrap: 'wrap' }, as: StyledTags, children: tags.list.map(tag => (_jsx(Tag, { tabIndex: 0, type: 'pill', variant: 'light', "data-tag-id": tag.id, onClick: tags.onTagClick ? () => tags.onTagClick?.(tag.id) : undefined, rel: 'tag', children: tag.tagName }, tag.id))) })), relatedLinks && (_jsxs(Flex, { as: StyledRelatedItemsContainer, container: { direction: 'column', gap: 1 }, children: [_jsx(Text, { variant: 'h3', children: t('article_related_links') }), _jsx(Flex, { as: StyledRelatedItemsList, container: { direction: 'column', alignItems: 'start', gap: 0.5 }, children: relatedLinks?.map(({ title, href }) => {
|
|
45
|
-
return (_jsx(Link, { href: href, target: '_blank', children: title }, title));
|
|
46
|
-
}) })] })), relatedArticles && (_jsxs(Flex, { as: StyledRelatedItemsContainer, container: { direction: 'column', gap: 1 }, children: [_jsx(Text, { variant: 'h3', children: t('article_more_like_this') }), _jsx(Flex, { as: StyledRelatedItemsList, container: { direction: 'column', alignItems: 'start', gap: 0.5 }, children: relatedArticles?.map(({ id, title, onClick }) => {
|
|
47
|
-
return (_jsx(Button, { variant: 'link', onClick: (e) => onClick(id, e), children: title }, id));
|
|
48
|
-
}) })] })), attachments && (_jsxs(Flex, { as: StyledRelatedItemsContainer, container: { direction: 'column', gap: 1 }, children: [_jsx(Text, { variant: 'h3', children: t('article_attachments') }), _jsx(Grid, { container: {
|
|
49
|
-
cols: 'repeat(auto-fill, minmax(10rem, 1fr))',
|
|
50
|
-
gap: 1
|
|
51
|
-
}, as: 'ul', children: attachments?.map(attachment => (_createElement(FileUploadItem, { ...attachment, key: attachment.name }))) })] }))] }));
|
|
52
|
-
};
|
|
53
|
-
export default ArticleFooter;
|
|
54
|
-
//# sourceMappingURL=ArticleFooter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleFooter.js","sourceRoot":"","sources":["../../../src/components/Article/ArticleFooter.tsx"],"names":[],"mappings":";;AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,GAAG,EACH,gBAAgB,EAIhB,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,cAAc,EACd,IAAI,EACL,MAAM,yBAAyB,CAAC;AACjC,OAAO,EA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,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,YAE5D,KAAK,IAJD,EAAE,CAKA,CACV,CAAC;wBACJ,CAAC,CAAC,GACG,IACF,CACR,EAEA,WAAW,IAAI,CACd,MAAC,IAAI,IAAC,EAAE,EAAE,2BAA2B,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC/E,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,CAAC,CAAC,qBAAqB,CAAC,GAAQ,EACpD,KAAC,IAAI,IACH,SAAS,EAAE;4BACT,IAAI,EAAE,uCAAuC;4BAC7C,GAAG,EAAE,CAAC;yBACP,EACD,EAAE,EAAC,IAAI,YAEN,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAC9B,eAAC,cAAc,OAAK,UAAU,EAAE,GAAG,EAAE,UAAU,CAAC,IAAI,GAAI,CACzD,CAAC,GACG,IACF,CACR,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { FunctionComponent, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n Tag,\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n FileUploadItemProps,\n Button,\n Text,\n Link,\n useI18n,\n FileUploadItem,\n Grid\n} from '@pega/cosmos-react-core';\nimport { StyledTag } from '@pega/cosmos-react-core/lib/components/Badges/Tag';\n\nexport interface ArticleTag {\n /** Tag name */\n tagName: string;\n /** Tag id. If not set tagName is treated as id */\n id: string;\n}\n\nexport interface ArticleFooterProps extends BaseProps {\n /** Feedback for this article */\n feedback?: {\n showThanksMessage?: boolean;\n /** Weather the current article is liked or disliked. Used to determine */\n status?: 'liked' | 'disliked';\n /** Callback triggered on click of like or dislike */\n onFeedbackClick: (button: 'like' | 'dislike', e: MouseEvent<HTMLButtonElement>) => void;\n };\n tags?: {\n /** Article tags */\n list: ArticleTag[];\n /** Callback that triggers on click of tag */\n onTagClick?: (id: ArticleTag['id']) => void;\n };\n /** Links to external sites */\n relatedLinks?: { title: string; href: string }[];\n /** Links to other articles */\n relatedArticles?: {\n id: string;\n title: string;\n onClick: (id: string, e: MouseEvent<HTMLButtonElement>) => void;\n }[];\n /** Attachments */\n attachments?: FileUploadItemProps[];\n}\n\nconst StyledRelatedItemsContainer = styled.div``;\nconst StyledRelatedItemsList = styled.div``;\n\nconst StyledArticleFooter = styled.div(({ theme }) => {\n return css`\n flex-shrink: 0;\n &::before {\n content: '';\n display: block;\n background: ${theme.base.palette['border-line']};\n height: 0.0625rem;\n margin-bottom: calc(2 * ${theme.base.spacing});\n }\n\n ${StyledRelatedItemsContainer} {\n margin-block-start: ${theme.base.spacing};\n & > ${StyledRelatedItemsList} * {\n margin-inline-start: 0;\n }\n }\n `;\n});\n\nStyledArticleFooter.defaultProps = defaultThemeProp;\n\nconst StyledTags = styled.div(({ theme }) => {\n return css`\n padding: calc(0.25 * ${theme.base.spacing});\n margin: 0 calc(-0.5 * ${theme.base.spacing});\n & > ${StyledTag} {\n margin: calc(0.25 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledTags.defaultProps = defaultThemeProp;\n\nconst ArticleFooter: FunctionComponent<ArticleFooterProps & ForwardProps> = (\n props: ArticleFooterProps\n) => {\n const { tags, relatedLinks, relatedArticles, feedback, attachments, ...restProps } = props;\n const t = useI18n();\n\n return (\n <Flex\n as={StyledArticleFooter}\n container={{\n direction: 'column',\n gap: 2\n }}\n {...restProps}\n >\n {feedback && (\n <Flex container={{ gap: 2, alignItems: 'center' }}>\n {feedback.showThanksMessage ? (\n <Text>{t('article_thank_you_for_your_feedback')}</Text>\n ) : (\n <>\n <Text>{t('article_was_this_helpful')}</Text>\n <Flex container>\n <Button\n variant={feedback.status === 'liked' ? 'primary' : 'secondary'}\n onClick={(e: MouseEvent<HTMLButtonElement>) =>\n feedback.onFeedbackClick('like', e)\n }\n >\n {t('yes')}\n </Button>\n <Button\n variant={feedback.status === 'disliked' ? 'primary' : 'secondary'}\n onClick={(e: MouseEvent<HTMLButtonElement>) =>\n feedback.onFeedbackClick('dislike', e)\n }\n >\n {t('no')}\n </Button>\n </Flex>\n </>\n )}\n </Flex>\n )}\n {tags && (\n <Flex container={{ wrap: 'wrap' }} as={StyledTags}>\n {tags.list.map(tag => (\n <Tag\n tabIndex={0}\n type='pill'\n variant='light'\n key={tag.id}\n data-tag-id={tag.id}\n onClick={tags.onTagClick ? () => tags.onTagClick?.(tag.id) : undefined}\n rel='tag'\n >\n {tag.tagName}\n </Tag>\n ))}\n </Flex>\n )}\n\n {relatedLinks && (\n <Flex as={StyledRelatedItemsContainer} container={{ direction: 'column', gap: 1 }}>\n <Text variant='h3'>{t('article_related_links')}</Text>\n <Flex\n as={StyledRelatedItemsList}\n container={{ direction: 'column', alignItems: 'start', gap: 0.5 }}\n >\n {relatedLinks?.map(({ title, href }) => {\n return (\n <Link href={href} target='_blank' key={title}>\n {title}\n </Link>\n );\n })}\n </Flex>\n </Flex>\n )}\n\n {relatedArticles && (\n <Flex as={StyledRelatedItemsContainer} container={{ direction: 'column', gap: 1 }}>\n <Text variant='h3'>{t('article_more_like_this')}</Text>\n <Flex\n as={StyledRelatedItemsList}\n container={{ direction: 'column', alignItems: 'start', gap: 0.5 }}\n >\n {relatedArticles?.map(({ id, title, onClick }) => {\n return (\n <Button\n key={id}\n variant='link'\n onClick={(e: MouseEvent<HTMLButtonElement>) => onClick(id, e)}\n >\n {title}\n </Button>\n );\n })}\n </Flex>\n </Flex>\n )}\n\n {attachments && (\n <Flex as={StyledRelatedItemsContainer} container={{ direction: 'column', gap: 1 }}>\n <Text variant='h3'>{t('article_attachments')}</Text>\n <Grid\n container={{\n cols: 'repeat(auto-fill, minmax(10rem, 1fr))',\n gap: 1\n }}\n as='ul'\n >\n {attachments?.map(attachment => (\n <FileUploadItem {...attachment} key={attachment.name} />\n ))}\n </Grid>\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default ArticleFooter;\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { DateTimeDisplayProps } from '@pega/cosmos-react-core';
|
|
3
|
-
export interface ArticleMetaProps {
|
|
4
|
-
category?: string;
|
|
5
|
-
publishedDate?: DateTimeDisplayProps['value'];
|
|
6
|
-
feedback?: {
|
|
7
|
-
likes: number;
|
|
8
|
-
dislikes: number;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
declare const ArticleMeta: FunctionComponent<ArticleMetaProps>;
|
|
12
|
-
export default ArticleMeta;
|
|
13
|
-
//# sourceMappingURL=ArticleMeta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleMeta.d.ts","sourceRoot":"","sources":["../../../src/components/Article/ArticleMeta.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAEnD,OAAO,EAGL,oBAAoB,EAOrB,MAAM,yBAAyB,CAAC;AAKjC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CA+CpD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { registerIcon, DateTimeDisplay, Flex, Icon, MetaList, Text, VisuallyHiddenText, useI18n } from '@pega/cosmos-react-core';
|
|
4
|
-
import * as thumbsUpSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/thumbs-up-solid.icon';
|
|
5
|
-
registerIcon(thumbsUpSolidIcon);
|
|
6
|
-
const ArticleMeta = ({ category, publishedDate, feedback }) => {
|
|
7
|
-
const t = useI18n();
|
|
8
|
-
const metaItems = useMemo(() => {
|
|
9
|
-
const items = [];
|
|
10
|
-
if (category) {
|
|
11
|
-
items.push(category);
|
|
12
|
-
}
|
|
13
|
-
if (publishedDate) {
|
|
14
|
-
items.push(_jsx(DateTimeDisplay, { value: publishedDate, variant: 'date', format: 'long' }));
|
|
15
|
-
}
|
|
16
|
-
if (feedback) {
|
|
17
|
-
items.push(_jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, children: [_jsxs(Flex, { "aria-label": `${feedback.likes} ${t('likes')}`, container: { gap: 0.5, alignItems: 'center' }, children: [_jsx(Icon, { name: 'thumbs-up-solid' }), _jsxs(Text, { variant: 'secondary', children: [feedback.likes, _jsx(VisuallyHiddenText, { children: t('likes') })] })] }), _jsxs(Flex, { "aria-label": `${feedback.dislikes} ${t('dislikes')}`, container: { gap: 0.5, alignItems: 'center' }, children: [_jsx(Icon, { name: 'thumbs-down-solid' }), _jsxs(Text, { variant: 'secondary', children: [feedback.dislikes, _jsx(VisuallyHiddenText, { children: t('dislikes') })] })] })] }, 'likes'));
|
|
18
|
-
}
|
|
19
|
-
return items;
|
|
20
|
-
}, [category, publishedDate, feedback]);
|
|
21
|
-
return _jsx(MetaList, { items: metaItems });
|
|
22
|
-
};
|
|
23
|
-
export default ArticleMeta;
|
|
24
|
-
//# sourceMappingURL=ArticleMeta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleMeta.js","sourceRoot":"","sources":["../../../src/components/Article/ArticleMeta.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,OAAO,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EACL,YAAY,EACZ,eAAe,EAEf,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,IAAI,EAC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AE,aAE7C,KAAC,IAAI,IAAC,IAAI,EAAC,mBAAmB,GAAG,EACjC,MAAC,IAAI,IAAC,OAAO,EAAC,WAAW,aACtB,QAAQ,CAAC,QAAQ,EAClB,KAAC,kBAAkB,cAAE,CAAC,CAAC,UAAU,CAAC,GAAsB,IACnD,IACF,KApB8C,OAAO,CAqBvD,CACR,CAAC;SACH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;IAExC,OAAO,KAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,GAAI,CAAC;AACxC,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { FunctionComponent, useMemo } from 'react';\n\nimport {\n registerIcon,\n DateTimeDisplay,\n DateTimeDisplayProps,\n Flex,\n Icon,\n MetaList,\n Text,\n VisuallyHiddenText,\n useI18n\n} from '@pega/cosmos-react-core';\nimport * as thumbsUpSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/thumbs-up-solid.icon';\n\nregisterIcon(thumbsUpSolidIcon);\n\nexport interface ArticleMetaProps {\n category?: string;\n publishedDate?: DateTimeDisplayProps['value'];\n feedback?: {\n likes: number;\n dislikes: number;\n };\n}\n\nconst ArticleMeta: FunctionComponent<ArticleMetaProps> = ({\n category,\n publishedDate,\n feedback\n}) => {\n const t = useI18n();\n const metaItems = useMemo(() => {\n const items = [];\n if (category) {\n items.push(category);\n }\n\n if (publishedDate) {\n items.push(<DateTimeDisplay value={publishedDate} variant='date' format='long' />);\n }\n\n if (feedback) {\n items.push(\n <Flex container={{ gap: 1, alignItems: 'center' }} key='likes'>\n <Flex\n aria-label={`${feedback.likes} ${t('likes')}`}\n container={{ gap: 0.5, alignItems: 'center' }}\n >\n <Icon name='thumbs-up-solid' />\n <Text variant='secondary'>\n {feedback.likes}\n <VisuallyHiddenText>{t('likes')}</VisuallyHiddenText>\n </Text>\n </Flex>\n <Flex\n aria-label={`${feedback.dislikes} ${t('dislikes')}`}\n container={{ gap: 0.5, alignItems: 'center' }}\n >\n <Icon name='thumbs-down-solid' />\n <Text variant='secondary'>\n {feedback.dislikes}\n <VisuallyHiddenText>{t('dislikes')}</VisuallyHiddenText>\n </Text>\n </Flex>\n </Flex>\n );\n }\n\n return items;\n }, [category, publishedDate, feedback]);\n\n return <MetaList items={metaItems} />;\n};\n\nexport default ArticleMeta;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Article/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Article/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { default } from './Article';\nexport { default as ArticleFooter } from './ArticleFooter';\nexport type { ArticleProps } from './Article';\nexport type { ArticleTag, ArticleFooterProps } from './ArticleFooter';\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
-
import { ArticleListProps } from './ArticleList.types';
|
|
4
|
-
declare const ArticleList: FunctionComponent<ArticleListProps & ForwardProps>;
|
|
5
|
-
export default ArticleList;
|
|
6
|
-
//# sourceMappingURL=ArticleList.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleList.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleList.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EASlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAIL,YAAY,EASb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAEL,gBAAgB,EAGjB,MAAM,qBAAqB,CAAC;AAuC7B,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CA2MnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|