@pega/cosmos-react-demos 5.0.0-dev.9.3 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/SECURITY.md +11 -0
  2. package/jsx/core/DateTime/DateTimeDisplay.stories.d.ts.map +1 -1
  3. package/jsx/core/DateTime/DateTimeDisplay.stories.jsx +10 -5
  4. package/jsx/core/DateTime/DateTimeDisplay.stories.jsx.map +1 -1
  5. package/jsx/core/Lightbox/Lightbox.mocks.d.ts +15 -8
  6. package/jsx/core/Lightbox/Lightbox.mocks.d.ts.map +1 -1
  7. package/jsx/core/Lightbox/Lightbox.mocks.js +62 -24
  8. package/jsx/core/Lightbox/Lightbox.mocks.js.map +1 -1
  9. package/jsx/core/Lightbox/Lightbox.stories.d.ts.map +1 -1
  10. package/jsx/core/Lightbox/Lightbox.stories.jsx +37 -22
  11. package/jsx/core/Lightbox/Lightbox.stories.jsx.map +1 -1
  12. package/jsx/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -1
  13. package/jsx/core/ListToolbar/ListToolbar.mocks.jsx +13 -21
  14. package/jsx/core/ListToolbar/ListToolbar.mocks.jsx.map +1 -1
  15. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts +7 -2
  16. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
  17. package/jsx/core/ListToolbar/ListToolbar.stories.jsx +30 -9
  18. package/jsx/core/ListToolbar/ListToolbar.stories.jsx.map +1 -1
  19. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts +3 -0
  20. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -1
  21. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.jsx +2 -2
  22. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.jsx.map +1 -1
  23. package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
  24. package/jsx/rte/Editor/Editor.stories.jsx +14 -1
  25. package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
  26. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts +1 -0
  27. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  28. package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx +67 -4
  29. package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -1
  30. package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts +8 -3
  31. package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
  32. package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx +67 -12
  33. package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx.map +1 -1
  34. package/jsx/social/Chat/Chat.mocks.d.ts.map +1 -1
  35. package/jsx/social/Chat/Chat.mocks.js +44 -1
  36. package/jsx/social/Chat/Chat.mocks.js.map +1 -1
  37. package/jsx/social/Chat/Chat.stories.d.ts.map +1 -1
  38. package/jsx/social/Chat/Chat.stories.jsx +0 -1
  39. package/jsx/social/Chat/Chat.stories.jsx.map +1 -1
  40. package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
  41. package/jsx/social/Feed/Feed.stories.jsx +2 -0
  42. package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
  43. package/jsx/work/ArticleList/ArticleBuddy.stories.d.ts +2 -0
  44. package/jsx/work/ArticleList/ArticleBuddy.stories.d.ts.map +1 -1
  45. package/jsx/work/ArticleList/ArticleBuddy.stories.jsx +40 -14
  46. package/jsx/work/ArticleList/ArticleBuddy.stories.jsx.map +1 -1
  47. package/jsx/work/ArticleList/ArticleList.mocks.d.ts +66 -3
  48. package/jsx/work/ArticleList/ArticleList.mocks.d.ts.map +1 -1
  49. package/jsx/work/ArticleList/ArticleList.mocks.js +15 -25
  50. package/jsx/work/ArticleList/ArticleList.mocks.js.map +1 -1
  51. package/jsx/work/ArticleList/ArticleList.stories.d.ts.map +1 -1
  52. package/jsx/work/ArticleList/ArticleList.stories.jsx +41 -20
  53. package/jsx/work/ArticleList/ArticleList.stories.jsx.map +1 -1
  54. package/jsx/work/Assignments/Assignments.stories.jsx +2 -2
  55. package/jsx/work/Assignments/Assignments.stories.jsx.map +1 -1
  56. package/jsx/work/CaseView/CaseView.mocks.d.ts +6 -2
  57. package/jsx/work/CaseView/CaseView.mocks.d.ts.map +1 -1
  58. package/jsx/work/CaseView/CaseView.mocks.jsx +64 -30
  59. package/jsx/work/CaseView/CaseView.mocks.jsx.map +1 -1
  60. package/jsx/work/Stakeholders/Stakeholders.stories.d.ts +4 -1
  61. package/jsx/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
  62. package/jsx/work/Stakeholders/Stakeholders.stories.jsx +14 -6
  63. package/jsx/work/Stakeholders/Stakeholders.stories.jsx.map +1 -1
  64. package/lib/core/DateTime/DateTimeDisplay.stories.d.ts.map +1 -1
  65. package/lib/core/DateTime/DateTimeDisplay.stories.js +10 -5
  66. package/lib/core/DateTime/DateTimeDisplay.stories.js.map +1 -1
  67. package/lib/core/Lightbox/Lightbox.mocks.d.ts +15 -8
  68. package/lib/core/Lightbox/Lightbox.mocks.d.ts.map +1 -1
  69. package/lib/core/Lightbox/Lightbox.mocks.js +64 -24
  70. package/lib/core/Lightbox/Lightbox.mocks.js.map +1 -1
  71. package/lib/core/Lightbox/Lightbox.stories.d.ts.map +1 -1
  72. package/lib/core/Lightbox/Lightbox.stories.js +36 -21
  73. package/lib/core/Lightbox/Lightbox.stories.js.map +1 -1
  74. package/lib/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -1
  75. package/lib/core/ListToolbar/ListToolbar.mocks.js +7 -13
  76. package/lib/core/ListToolbar/ListToolbar.mocks.js.map +1 -1
  77. package/lib/core/ListToolbar/ListToolbar.stories.d.ts +7 -2
  78. package/lib/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
  79. package/lib/core/ListToolbar/ListToolbar.stories.js +30 -9
  80. package/lib/core/ListToolbar/ListToolbar.stories.js.map +1 -1
  81. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts +3 -0
  82. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -1
  83. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js +2 -2
  84. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js.map +1 -1
  85. package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
  86. package/lib/rte/Editor/Editor.stories.js +8 -1
  87. package/lib/rte/Editor/Editor.stories.js.map +1 -1
  88. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts +1 -0
  89. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  90. package/lib/rte/RichTextEditor/RichTextEditor.stories.js +37 -5
  91. package/lib/rte/RichTextEditor/RichTextEditor.stories.js.map +1 -1
  92. package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts +8 -3
  93. package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
  94. package/lib/rte/RichTextEditor/RichTextViewer.stories.js +66 -11
  95. package/lib/rte/RichTextEditor/RichTextViewer.stories.js.map +1 -1
  96. package/lib/social/Chat/Chat.mocks.d.ts.map +1 -1
  97. package/lib/social/Chat/Chat.mocks.js +44 -1
  98. package/lib/social/Chat/Chat.mocks.js.map +1 -1
  99. package/lib/social/Chat/Chat.stories.d.ts.map +1 -1
  100. package/lib/social/Chat/Chat.stories.js +0 -1
  101. package/lib/social/Chat/Chat.stories.js.map +1 -1
  102. package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
  103. package/lib/social/Feed/Feed.stories.js +2 -0
  104. package/lib/social/Feed/Feed.stories.js.map +1 -1
  105. package/lib/work/ArticleList/ArticleBuddy.stories.d.ts +2 -0
  106. package/lib/work/ArticleList/ArticleBuddy.stories.d.ts.map +1 -1
  107. package/lib/work/ArticleList/ArticleBuddy.stories.js +38 -14
  108. package/lib/work/ArticleList/ArticleBuddy.stories.js.map +1 -1
  109. package/lib/work/ArticleList/ArticleList.mocks.d.ts +66 -3
  110. package/lib/work/ArticleList/ArticleList.mocks.d.ts.map +1 -1
  111. package/lib/work/ArticleList/ArticleList.mocks.js +15 -25
  112. package/lib/work/ArticleList/ArticleList.mocks.js.map +1 -1
  113. package/lib/work/ArticleList/ArticleList.stories.d.ts.map +1 -1
  114. package/lib/work/ArticleList/ArticleList.stories.js +41 -20
  115. package/lib/work/ArticleList/ArticleList.stories.js.map +1 -1
  116. package/lib/work/Assignments/Assignments.stories.js +2 -2
  117. package/lib/work/Assignments/Assignments.stories.js.map +1 -1
  118. package/lib/work/CaseView/CaseView.mocks.d.ts +6 -2
  119. package/lib/work/CaseView/CaseView.mocks.d.ts.map +1 -1
  120. package/lib/work/CaseView/CaseView.mocks.js +55 -22
  121. package/lib/work/CaseView/CaseView.mocks.js.map +1 -1
  122. package/lib/work/Stakeholders/Stakeholders.stories.d.ts +4 -1
  123. package/lib/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
  124. package/lib/work/Stakeholders/Stakeholders.stories.js +14 -6
  125. package/lib/work/Stakeholders/Stakeholders.stories.js.map +1 -1
  126. package/package.json +11 -10
package/SECURITY.md ADDED
@@ -0,0 +1,11 @@
1
+ # Reporting Security Issues
2
+
3
+ Pegasystems takes security seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
4
+
5
+ To report a security issue, [email us](mailto:opensource@pega.com;security@pega.com) and include the word "SECURITY" in the subject line.
6
+
7
+ The Pega team will send a response indicating the next steps in handling your report. We may ask for additional information or guidance.
8
+
9
+ ## Learning More About Security
10
+
11
+ To learn more about securing a Pega application or our security capabilities, please see the [security article](https://community.pega.com/knowledgebase/capabilities/security) on Pega Community and the [Pega Trust Center](https://www.pega.com/products/cloud/pega-trust-center).
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeDisplay.stories.d.ts","sourceRoot":"","sources":["../../../src/core/DateTime/DateTimeDisplay.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;;AAE1F,wBAEU;AAEV,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,oBAAoB,CAQ7D,CAAC;AAcF,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,oBAAoB,CAS7D,CAAC"}
1
+ {"version":3,"file":"DateTimeDisplay.stories.d.ts","sourceRoot":"","sources":["../../../src/core/DateTime/DateTimeDisplay.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;;AAE1F,wBAEU;AAEV,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,oBAAoB,CAS7D,CAAC;AAmBF,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,oBAAoB,CAS7D,CAAC"}
@@ -3,17 +3,22 @@ export default {
3
3
  title: 'Core/DateTime'
4
4
  };
5
5
  export const DurationDisplayDemo = (args) => {
6
- return (<DurationDisplay value={args.value} significantUnits={args.significantUnits} unitDisplay={args.unitDisplay}/>);
6
+ return (<DurationDisplay value={args.value} significantUnits={args.significantUnits} unitDisplay={args.unitDisplay} maxPrecision={args.maxPrecision}/>);
7
7
  };
8
8
  DurationDisplayDemo.args = {
9
9
  value: 462553844,
10
- significantUnits: 4,
11
- unitDisplay: undefined
10
+ significantUnits: 5,
11
+ unitDisplay: undefined,
12
+ maxPrecision: undefined
12
13
  };
13
14
  DurationDisplayDemo.argTypes = {
14
15
  value: { control: { type: 'number' } },
15
- significantUnits: { options: [1, 2, 3, 4], control: { type: 'select' } },
16
- unitDisplay: { options: [undefined, 'narrow', 'short', 'long'], control: { type: 'select' } }
16
+ significantUnits: { options: [1, 2, 3, 4, 5], control: { type: 'select' } },
17
+ unitDisplay: { options: [undefined, 'narrow', 'short', 'long'], control: { type: 'select' } },
18
+ maxPrecision: {
19
+ options: [undefined, 'day', 'hour', 'minute', 'second', 'millisecond'],
20
+ control: { type: 'select' }
21
+ }
17
22
  };
18
23
  export const DateTimeDisplayDemo = (args) => {
19
24
  return (<DateTimeDisplay value={args.value} variant={args.variant} format={args.format} clockFormat={args.clockFormat}/>);
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeDisplay.stories.jsx","sourceRoot":"","sources":["../../../src/core/DateTime/DateTimeDisplay.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG3E,eAAe;IACb,KAAK,EAAE,eAAe;CACf,CAAC;AAEV,MAAM,CAAC,MAAM,mBAAmB,GAAkC,CAAC,IAA0B,EAAE,EAAE;IAC/F,OAAO,CACL,CAAC,eAAe,CACd,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAClB,gBAAgB,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CACxC,WAAW,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,EAC9B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,mBAAmB,CAAC,IAAI,GAAG;IACzB,KAAK,EAAE,SAAS;IAChB,gBAAgB,EAAE,CAAC;IACnB,WAAW,EAAE,SAAS;CACvB,CAAC;AAEF,mBAAmB,CAAC,QAAQ,GAAG;IAC7B,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACtC,gBAAgB,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACxE,WAAW,EAAE,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;CAC9F,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAkC,CAAC,IAA0B,EAAE,EAAE;IAC/F,OAAO,CACL,CAAC,eAAe,CACd,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAClB,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CACtB,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CACpB,WAAW,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,EAC9B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,mBAAmB,CAAC,IAAI,GAAG;IACzB,KAAK,EAAE,IAAI,IAAI,EAAE;IACjB,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,OAAO;IACf,WAAW,EAAE,SAAS;CACvB,CAAC;AAEF,mBAAmB,CAAC,QAAQ,GAAG;IAC7B,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IACpC,OAAO,EAAE;QACP,OAAO,EAAE;YACP,MAAM;YACN,UAAU;YACV,MAAM;YACN,MAAM;YACN,OAAO;YACP,MAAM;YACN,WAAW;YACX,aAAa;YACb,UAAU;SACX;QACD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC5B;IACD,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAC9E,WAAW,EAAE;QACX,OAAO,EAAE,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC;QAC5B,OAAO,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;KAClC;CACF,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\n\nimport { DateTimeDisplay, DurationDisplay } from '@pega/cosmos-react-core';\nimport type { DateTimeDisplayProps, DurationDisplayProps } from '@pega/cosmos-react-core';\n\nexport default {\n title: 'Core/DateTime'\n} as Meta;\n\nexport const DurationDisplayDemo: StoryFn<DurationDisplayProps> = (args: DurationDisplayProps) => {\n return (\n <DurationDisplay\n value={args.value}\n significantUnits={args.significantUnits}\n unitDisplay={args.unitDisplay}\n />\n );\n};\n\nDurationDisplayDemo.args = {\n value: 462553844,\n significantUnits: 4,\n unitDisplay: undefined\n};\n\nDurationDisplayDemo.argTypes = {\n value: { control: { type: 'number' } },\n significantUnits: { options: [1, 2, 3, 4], control: { type: 'select' } },\n unitDisplay: { options: [undefined, 'narrow', 'short', 'long'], control: { type: 'select' } }\n};\n\nexport const DateTimeDisplayDemo: StoryFn<DateTimeDisplayProps> = (args: DateTimeDisplayProps) => {\n return (\n <DateTimeDisplay\n value={args.value}\n variant={args.variant}\n format={args.format}\n clockFormat={args.clockFormat}\n />\n );\n};\n\nDateTimeDisplayDemo.args = {\n value: new Date(),\n variant: 'date',\n format: 'short',\n clockFormat: undefined\n};\n\nDateTimeDisplayDemo.argTypes = {\n value: { control: { type: 'date' } },\n variant: {\n options: [\n 'date',\n 'datetime',\n 'time',\n 'week',\n 'month',\n 'year',\n 'monthyear',\n 'quarteryear',\n 'relative'\n ],\n control: { type: 'select' }\n },\n format: { options: ['short', 'long', 'numeric'], control: { type: 'select' } },\n clockFormat: {\n options: [undefined, 12, 24],\n control: { type: 'inline-radio' }\n }\n};\n"]}
1
+ {"version":3,"file":"DateTimeDisplay.stories.jsx","sourceRoot":"","sources":["../../../src/core/DateTime/DateTimeDisplay.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG3E,eAAe;IACb,KAAK,EAAE,eAAe;CACf,CAAC;AAEV,MAAM,CAAC,MAAM,mBAAmB,GAAkC,CAAC,IAA0B,EAAE,EAAE;IAC/F,OAAO,CACL,CAAC,eAAe,CACd,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAClB,gBAAgB,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CAAC;AAEF,mBAAmB,CAAC,IAAI,GAAG;IACzB,KAAK,EAAE,IAAI,IAAI,EAAE;IACjB,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,OAAO;IACf,WAAW,EAAE,SAAS;CACvB,CAAC;AAEF,mBAAmB,CAAC,QAAQ,GAAG;IAC7B,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IACpC,OAAO,EAAE;QACP,OAAO,EAAE;YACP,MAAM;YACN,UAAU;YACV,MAAM;YACN,MAAM;YACN,OAAO;YACP,MAAM;YACN,WAAW;YACX,aAAa;YACb,UAAU;SACX;QACD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC5B;IACD,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAC9E,WAAW,EAAE;QACX,OAAO,EAAE,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC;QAC5B,OAAO,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;KAClC;CACF,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\n\nimport { DateTimeDisplay, DurationDisplay } from '@pega/cosmos-react-core';\nimport type { DateTimeDisplayProps, DurationDisplayProps } from '@pega/cosmos-react-core';\n\nexport default {\n title: 'Core/DateTime'\n} as Meta;\n\nexport const DurationDisplayDemo: StoryFn<DurationDisplayProps> = (args: DurationDisplayProps) => {\n return (\n <DurationDisplay\n value={args.value}\n significantUnits={args.significantUnits}\n unitDisplay={args.unitDisplay}\n maxPrecision={args.maxPrecision}\n />\n );\n};\n\nDurationDisplayDemo.args = {\n value: 462553844,\n significantUnits: 5,\n unitDisplay: undefined,\n maxPrecision: undefined\n};\n\nDurationDisplayDemo.argTypes = {\n value: { control: { type: 'number' } },\n significantUnits: { options: [1, 2, 3, 4, 5], control: { type: 'select' } },\n unitDisplay: { options: [undefined, 'narrow', 'short', 'long'], control: { type: 'select' } },\n maxPrecision: {\n options: [undefined, 'day', 'hour', 'minute', 'second', 'millisecond'],\n control: { type: 'select' }\n }\n};\n\nexport const DateTimeDisplayDemo: StoryFn<DateTimeDisplayProps> = (args: DateTimeDisplayProps) => {\n return (\n <DateTimeDisplay\n value={args.value}\n variant={args.variant}\n format={args.format}\n clockFormat={args.clockFormat}\n />\n );\n};\n\nDateTimeDisplayDemo.args = {\n value: new Date(),\n variant: 'date',\n format: 'short',\n clockFormat: undefined\n};\n\nDateTimeDisplayDemo.argTypes = {\n value: { control: { type: 'date' } },\n variant: {\n options: [\n 'date',\n 'datetime',\n 'time',\n 'week',\n 'month',\n 'year',\n 'monthyear',\n 'quarteryear',\n 'relative'\n ],\n control: { type: 'select' }\n },\n format: { options: ['short', 'long', 'numeric'], control: { type: 'select' } },\n clockFormat: {\n options: [undefined, 12, 24],\n control: { type: 'inline-radio' }\n }\n};\n"]}
@@ -1,15 +1,22 @@
1
- export declare const mockAPIImageResources: {
1
+ export declare const mockData: ({
2
2
  id: string;
3
3
  name: string;
4
4
  description: string;
5
- mime_type: string;
6
- media_url: string;
7
- }[];
8
- export declare const mockBadImageResource: {
5
+ format: string;
6
+ src: string;
7
+ } | {
9
8
  id: string;
10
9
  name: string;
11
10
  description: string;
12
- mime_type: string;
13
- media_url: string;
14
- };
11
+ format: string;
12
+ src: null;
13
+ })[];
14
+ export declare const mockBadResources: {
15
+ id: string;
16
+ name: string;
17
+ description: string;
18
+ src: string;
19
+ format: undefined;
20
+ error: boolean;
21
+ }[];
15
22
  //# sourceMappingURL=Lightbox.mocks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Lightbox.mocks.d.ts","sourceRoot":"","sources":["../../../src/core/Lightbox/Lightbox.mocks.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB;;;;;;GAyDjC,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;CAMhC,CAAC"}
1
+ {"version":3,"file":"Lightbox.mocks.d.ts","sourceRoot":"","sources":["../../../src/core/Lightbox/Lightbox.mocks.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ;;;;;;;;;;;;IAsFpB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;GAS5B,CAAC"}
@@ -1,59 +1,97 @@
1
- export const mockAPIImageResources = [
1
+ export const mockData = [
2
2
  {
3
3
  id: 'photo-1497752531616-c3afd9760a11',
4
4
  name: 'Image 1',
5
5
  description: 'Descriptive text about Image 1',
6
- mime_type: 'image/avif',
7
- media_url: 'https://images.unsplash.com/photo-1497752531616-c3afd9760a11?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80'
6
+ format: 'jpeg',
7
+ src: 'https://images.unsplash.com/photo-1497752531616-c3afd9760a11?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80'
8
+ },
9
+ {
10
+ id: 'pdf-1',
11
+ name: 'Sample-PDF 1',
12
+ description: 'Descriptive text about Dictionary of old Icelandic',
13
+ src: 'https://css4.pub/2015/icelandic/dictionary.pdf',
14
+ format: 'pdf'
8
15
  },
9
16
  {
10
17
  id: 'photo-1470093851219-69951fcbb533',
11
18
  name: 'Image 2',
12
19
  description: 'Descriptive text about Image 2',
13
- mime_type: 'image/avif',
14
- media_url: 'https://images.unsplash.com/photo-1470093851219-69951fcbb533?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80'
20
+ format: 'jpeg',
21
+ src: 'https://images.unsplash.com/photo-1470093851219-69951fcbb533?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80'
15
22
  },
16
23
  {
17
24
  id: 'photo-1447684808650-354ae64db5b8',
18
25
  name: 'Image 3',
19
26
  description: 'Descriptive text about Image 3',
20
- mime_type: 'image/avif',
21
- media_url: 'https://images.unsplash.com/photo-1447684808650-354ae64db5b8?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2094&q=80'
27
+ format: 'jpeg',
28
+ src: 'https://images.unsplash.com/photo-1447684808650-354ae64db5b8?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2094&q=80'
22
29
  },
23
30
  {
24
31
  id: 'photo-1425082661705-1834bfd09dca',
25
32
  name: 'Image 4',
26
33
  description: 'Descriptive text about Image 4',
27
- mime_type: 'image/avif',
28
- media_url: 'https://images.unsplash.com/photo-1425082661705-1834bfd09dca?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2110&q=80'
34
+ format: 'jpeg',
35
+ src: 'https://images.unsplash.com/photo-1425082661705-1834bfd09dca?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2110&q=80'
29
36
  },
30
37
  {
31
38
  id: 'photo-1494256997604-768d1f608cac',
32
39
  name: 'Image 5',
33
40
  description: 'Descriptive text about Image 5',
34
- mime_type: 'image/avif',
35
- media_url: 'https://images.unsplash.com/photo-1494256997604-768d1f608cac?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2301&q=80'
41
+ format: 'jpeg',
42
+ src: 'https://images.unsplash.com/photo-1494256997604-768d1f608cac?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2301&q=80'
36
43
  },
37
44
  {
38
45
  id: 'photo-1500694216671-a4e54fc4b513',
39
46
  name: 'Image 6',
40
47
  description: 'Descriptive text about Image 6',
41
- mime_type: 'image/avif',
42
- media_url: 'https://images.unsplash.com/photo-1500694216671-a4e54fc4b513?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2092&q=80'
48
+ format: 'jpeg',
49
+ src: 'https://images.unsplash.com/photo-1500694216671-a4e54fc4b513?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2092&q=80'
50
+ },
51
+ {
52
+ id: 'doc1',
53
+ name: 'Pega.docx',
54
+ description: 'Descriptive text about Pega document',
55
+ format: 'docx',
56
+ src: null
43
57
  },
44
58
  {
45
- id: 'photo-1638292597251-6fe6b2ba50f9',
46
- name: 'Image 7',
59
+ id: 'ppt2',
60
+ name: 'Pega.odp',
61
+ description: 'Descriptive text about Presentation file',
62
+ format: 'odp',
63
+ src: null
64
+ },
65
+ {
66
+ id: 'attachment_link',
67
+ name: 'Link file',
47
68
  description: 'Descriptive text about Image 7',
48
- mime_type: 'image/avif',
49
- media_url: 'https://images.unsplash.com/photo-1638292597251-6fe6b2ba50f9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1287&q=80'
69
+ format: 'url',
70
+ src: 'https://images.unsplash.com/photo-1638292597251-6fe6b2ba50f9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1287&q=80'
71
+ },
72
+ {
73
+ id: 'generic',
74
+ name: 'Pega file',
75
+ description: 'Descriptive text about file',
76
+ format: '3ds',
77
+ src: null
78
+ },
79
+ {
80
+ id: 'error',
81
+ name: 'Pega file',
82
+ description: 'Error showing content',
83
+ format: 'jpeg',
84
+ src: 'https://images.unsplash.com/photo'
85
+ }
86
+ ];
87
+ export const mockBadResources = [
88
+ {
89
+ id: 'image-error',
90
+ name: 'Some image',
91
+ description: 'Descriptive text about Some image',
92
+ src: '',
93
+ format: undefined,
94
+ error: true
50
95
  }
51
96
  ];
52
- export const mockBadImageResource = {
53
- id: 'error',
54
- name: 'Some image',
55
- description: 'Descriptive text about Some image',
56
- mime_type: 'image/avif',
57
- media_url: ''
58
- };
59
97
  //# sourceMappingURL=Lightbox.mocks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Lightbox.mocks.js","sourceRoot":"","sources":["../../../src/core/Lightbox/Lightbox.mocks.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,SAAS,EAAE,YAAY;QACvB,SAAS,EACP,wIAAwI;KAC3I;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,SAAS,EAAE,YAAY;QACvB,SAAS,EACP,wIAAwI;KAC3I;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,SAAS,EAAE,YAAY;QACvB,SAAS,EACP,wIAAwI;KAC3I;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,SAAS,EAAE,YAAY;QACvB,SAAS,EACP,wIAAwI;KAC3I;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,SAAS,EAAE,YAAY;QACvB,SAAS,EACP,wIAAwI;KAC3I;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,SAAS,EAAE,YAAY;QACvB,SAAS,EACP,wIAAwI;KAC3I;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,SAAS,EAAE,YAAY;QACvB,SAAS,EACP,gKAAgK;KACnK;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,mCAAmC;IAChD,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,EAAE;CACd,CAAC","sourcesContent":["export const mockAPIImageResources = [\n {\n id: 'photo-1497752531616-c3afd9760a11',\n name: 'Image 1',\n description: 'Descriptive text about Image 1',\n mime_type: 'image/avif',\n media_url:\n 'https://images.unsplash.com/photo-1497752531616-c3afd9760a11?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80'\n },\n {\n id: 'photo-1470093851219-69951fcbb533',\n name: 'Image 2',\n description: 'Descriptive text about Image 2',\n mime_type: 'image/avif',\n media_url:\n 'https://images.unsplash.com/photo-1470093851219-69951fcbb533?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80'\n },\n {\n id: 'photo-1447684808650-354ae64db5b8',\n name: 'Image 3',\n description: 'Descriptive text about Image 3',\n mime_type: 'image/avif',\n media_url:\n 'https://images.unsplash.com/photo-1447684808650-354ae64db5b8?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2094&q=80'\n },\n {\n id: 'photo-1425082661705-1834bfd09dca',\n name: 'Image 4',\n description: 'Descriptive text about Image 4',\n mime_type: 'image/avif',\n media_url:\n 'https://images.unsplash.com/photo-1425082661705-1834bfd09dca?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2110&q=80'\n },\n {\n id: 'photo-1494256997604-768d1f608cac',\n name: 'Image 5',\n description: 'Descriptive text about Image 5',\n mime_type: 'image/avif',\n media_url:\n 'https://images.unsplash.com/photo-1494256997604-768d1f608cac?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2301&q=80'\n },\n {\n id: 'photo-1500694216671-a4e54fc4b513',\n name: 'Image 6',\n description: 'Descriptive text about Image 6',\n mime_type: 'image/avif',\n media_url:\n 'https://images.unsplash.com/photo-1500694216671-a4e54fc4b513?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2092&q=80'\n },\n {\n id: 'photo-1638292597251-6fe6b2ba50f9',\n name: 'Image 7',\n description: 'Descriptive text about Image 7',\n mime_type: 'image/avif',\n media_url:\n 'https://images.unsplash.com/photo-1638292597251-6fe6b2ba50f9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1287&q=80'\n }\n];\n\nexport const mockBadImageResource = {\n id: 'error',\n name: 'Some image',\n description: 'Descriptive text about Some image',\n mime_type: 'image/avif',\n media_url: ''\n};\n"]}
1
+ {"version":3,"file":"Lightbox.mocks.js","sourceRoot":"","sources":["../../../src/core/Lightbox/Lightbox.mocks.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,wIAAwI;KAC9I;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,oDAAoD;QACjE,GAAG,EAAE,gDAAgD;QACrD,MAAM,EAAE,KAAK;KACd;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,wIAAwI;KAC9I;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,wIAAwI;KAC9I;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,wIAAwI;KAC9I;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,wIAAwI;KAC9I;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gCAAgC;QAC7C,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,wIAAwI;KAC9I;IACD;QACE,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,sCAAsC;QACnD,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,IAAI;KACV;IACD;QACE,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,0CAA0C;QACvD,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,IAAI;KACV;IACD;QACE,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,gCAAgC;QAC7C,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,gKAAgK;KACtK;IACD;QACE,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,6BAA6B;QAC1C,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,IAAI;KACV;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,uBAAuB;QACpC,MAAM,EAAE,MAAM;QAEd,GAAG,EAAE,mCAAmC;KACzC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B;QACE,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,mCAAmC;QAChD,GAAG,EAAE,EAAE;QACP,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,IAAI;KACZ;CACF,CAAC","sourcesContent":["// cspell:words wordprocessingml\nexport const mockData = [\n {\n id: 'photo-1497752531616-c3afd9760a11',\n name: 'Image 1',\n description: 'Descriptive text about Image 1',\n format: 'jpeg',\n src: 'https://images.unsplash.com/photo-1497752531616-c3afd9760a11?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80'\n },\n {\n id: 'pdf-1',\n name: 'Sample-PDF 1',\n description: 'Descriptive text about Dictionary of old Icelandic',\n src: 'https://css4.pub/2015/icelandic/dictionary.pdf',\n format: 'pdf'\n },\n {\n id: 'photo-1470093851219-69951fcbb533',\n name: 'Image 2',\n description: 'Descriptive text about Image 2',\n format: 'jpeg',\n src: 'https://images.unsplash.com/photo-1470093851219-69951fcbb533?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80'\n },\n {\n id: 'photo-1447684808650-354ae64db5b8',\n name: 'Image 3',\n description: 'Descriptive text about Image 3',\n format: 'jpeg',\n src: 'https://images.unsplash.com/photo-1447684808650-354ae64db5b8?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2094&q=80'\n },\n {\n id: 'photo-1425082661705-1834bfd09dca',\n name: 'Image 4',\n description: 'Descriptive text about Image 4',\n format: 'jpeg',\n src: 'https://images.unsplash.com/photo-1425082661705-1834bfd09dca?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2110&q=80'\n },\n {\n id: 'photo-1494256997604-768d1f608cac',\n name: 'Image 5',\n description: 'Descriptive text about Image 5',\n format: 'jpeg',\n src: 'https://images.unsplash.com/photo-1494256997604-768d1f608cac?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2301&q=80'\n },\n {\n id: 'photo-1500694216671-a4e54fc4b513',\n name: 'Image 6',\n description: 'Descriptive text about Image 6',\n format: 'jpeg',\n src: 'https://images.unsplash.com/photo-1500694216671-a4e54fc4b513?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2092&q=80'\n },\n {\n id: 'doc1',\n name: 'Pega.docx',\n description: 'Descriptive text about Pega document',\n format: 'docx',\n src: null\n },\n {\n id: 'ppt2',\n name: 'Pega.odp',\n description: 'Descriptive text about Presentation file',\n format: 'odp',\n src: null\n },\n {\n id: 'attachment_link',\n name: 'Link file',\n description: 'Descriptive text about Image 7',\n format: 'url',\n src: 'https://images.unsplash.com/photo-1638292597251-6fe6b2ba50f9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1287&q=80'\n },\n {\n id: 'generic',\n name: 'Pega file',\n description: 'Descriptive text about file',\n format: '3ds',\n src: null\n },\n {\n id: 'error',\n name: 'Pega file',\n description: 'Error showing content',\n format: 'jpeg',\n // invalid url\n src: 'https://images.unsplash.com/photo'\n }\n];\n\nexport const mockBadResources = [\n {\n id: 'image-error',\n name: 'Some image',\n description: 'Descriptive text about Some image',\n src: '',\n format: undefined,\n error: true\n }\n];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Lightbox.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Lightbox/Lightbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;;AAQtD,wBAGU;AAEV,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,kBAAkB,CAqDpD,CAAC"}
1
+ {"version":3,"file":"Lightbox.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Lightbox/Lightbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;;AAQtD,wBAMU;AAEV,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,kBAAkB,CAoEpD,CAAC"}
@@ -1,49 +1,64 @@
1
1
  import { useRef, useState } from 'react';
2
2
  import { Button, DateTimeDisplay, Lightbox } from '@pega/cosmos-react-core';
3
- import { mockAPIImageResources, mockBadImageResource } from './Lightbox.mocks';
3
+ import { mockData, mockBadResources } from './Lightbox.mocks';
4
4
  export default {
5
5
  title: 'Core/Lightbox',
6
- component: Lightbox
6
+ component: Lightbox,
7
+ parameters: {
8
+ layout: 'centered'
9
+ }
7
10
  };
8
11
  export const LightboxDemo = (args) => {
9
12
  const demoButtonRef = useRef(null);
10
- const [images, setImages] = useState(null);
13
+ const [open, setOpen] = useState(false);
14
+ const [items, setItems] = useState();
11
15
  const onClick = () => {
12
- setImages((args.error ? [mockBadImageResource] : mockAPIImageResources.slice(0, args.limit)).map(({ id, name, description, mime_type, media_url }) => {
16
+ setItems((args.error ? mockBadResources : mockData.slice(0, args.limit)).map(item => {
13
17
  return {
14
- id,
15
- name,
16
- description,
17
- src: media_url,
18
+ ...item,
18
19
  metadata: [
19
- mime_type.split('/').pop(),
20
+ item.format,
21
+ 'John smith',
20
22
  <DateTimeDisplay value={new Date()} variant='date'/>
21
23
  ]
22
24
  };
23
25
  }));
24
26
  };
25
27
  const onItemDownload = async (id) => {
26
- const a = document.createElement('a');
27
- a.href = await fetch(id)
28
- .then(response => response.blob())
29
- .then(blob => URL.createObjectURL(blob));
30
- a.download = images?.find(image => image.id === id)?.name ?? id;
31
- document.body.appendChild(a);
32
- a.click();
33
- document.body.removeChild(a);
28
+ const currentItem = items?.find(item => item.id === id);
29
+ if (!currentItem)
30
+ return;
31
+ if (currentItem.src) {
32
+ const objectURL = URL.createObjectURL(await (await fetch(currentItem.src)).blob());
33
+ const a = document.createElement('a');
34
+ a.href = objectURL;
35
+ a.download = currentItem.name ?? id;
36
+ document.body.appendChild(a);
37
+ a.click();
38
+ document.body.removeChild(a);
39
+ URL.revokeObjectURL(objectURL);
40
+ }
41
+ };
42
+ const onItemError = (id) => {
43
+ setItems(item => {
44
+ return item?.map(obj => (obj.id === id ? { ...obj, error: true } : obj));
45
+ });
34
46
  };
35
47
  return (<>
36
- <Button ref={demoButtonRef} onClick={onClick}>
48
+ <Button ref={demoButtonRef} onClick={() => {
49
+ setOpen(true);
50
+ onClick();
51
+ }}>
37
52
  Open Lightbox
38
53
  </Button>
39
- {images && (<Lightbox items={images} cycle={args.cycle || undefined} onAfterClose={() => {
40
- setImages(null);
54
+ {open && (<Lightbox items={items ?? []} cycle={args.cycle || undefined} onAfterClose={() => {
55
+ setOpen(false);
41
56
  demoButtonRef.current?.focus();
42
- }} onItemDownload={onItemDownload}/>)}
57
+ }} onItemDownload={onItemDownload} onItemError={onItemError}/>)}
43
58
  </>);
44
59
  };
45
60
  LightboxDemo.args = {
46
- limit: 7,
61
+ limit: 12,
47
62
  cycle: false,
48
63
  error: false
49
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Lightbox.stories.jsx","sourceRoot":"","sources":["../../../src/core/Lightbox/Lightbox.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG5E,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,eAAe;IACb,KAAK,EAAE,eAAe;IACtB,SAAS,EAAE,QAAQ;CACZ,CAAC;AAQV,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,IAAwB,EAAE,EAAE;IACpF,MAAM,aAAa,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IACtD,MAAM,CAAC,MAAM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C;QAC7B,CAAC,CAAC,KAAK,EAAE,CAAC;QACV,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,OAAO,CACL,EACE;MAAA,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAC3C;;MACF,EAAE,MAAM,CACR;MAAA,CAAC,MAAM,IAAI,CACT,CAAC,QAAQ,CACP,KAAK,CAAC,CAAC,MAAM,CAAC,CACd,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,SAAS,CAAC,CAC/B,YAAY,CAAC,CAAC,GAAG,EAAE;gBACjB,SAAS,CAAC,IAAI,CAAC,CAAC;gBAChB,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;YACjC,CAAC,CAAC,CACF,cAAc,CAAC,CAAC,cAAc,CAAC,EAC/B,CACH,CACH;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,IAAI,GAAG;IAClB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;CACb,CAAC;AAEF,YAAY,CAAC,QAAQ,GAAG;IACtB,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACtC,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACvC,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;CACxC,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport { useRef, useState } from 'react';\n\nimport { Button, DateTimeDisplay, Lightbox } from '@pega/cosmos-react-core';\nimport type { LightboxItem, LightboxProps } from '@pega/cosmos-react-core';\n\nimport { mockAPIImageResources, mockBadImageResource } from './Lightbox.mocks';\n\nexport default {\n title: 'Core/Lightbox',\n component: Lightbox\n} as Meta;\n\ninterface LightboxStoryProps {\n limit?: number;\n cycle?: boolean;\n error?: boolean;\n}\n\nexport const LightboxDemo: StoryFn<LightboxStoryProps> = (args: LightboxStoryProps) => {\n const demoButtonRef = useRef<HTMLButtonElement>(null);\n const [images, setImages] = useState<LightboxProps['items'] | null>(null);\n\n const onClick = () => {\n setImages(\n (args.error ? [mockBadImageResource] : mockAPIImageResources.slice(0, args.limit)).map(\n ({ id, name, description, mime_type, media_url }) => {\n return {\n id,\n name,\n description,\n src: media_url,\n metadata: [\n mime_type.split('/').pop(),\n <DateTimeDisplay value={new Date()} variant='date' />\n ]\n };\n }\n )\n );\n };\n\n const onItemDownload = async (id: LightboxItem['id']) => {\n const a = document.createElement('a');\n a.href = await fetch(id)\n .then(response => response.blob())\n .then(blob => URL.createObjectURL(blob));\n\n a.download = images?.find(image => image.id === id)?.name ?? id;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n };\n\n return (\n <>\n <Button ref={demoButtonRef} onClick={onClick}>\n Open Lightbox\n </Button>\n {images && (\n <Lightbox\n items={images}\n cycle={args.cycle || undefined}\n onAfterClose={() => {\n setImages(null);\n demoButtonRef.current?.focus();\n }}\n onItemDownload={onItemDownload}\n />\n )}\n </>\n );\n};\n\nLightboxDemo.args = {\n limit: 7,\n cycle: false,\n error: false\n};\n\nLightboxDemo.argTypes = {\n limit: { control: { type: 'number' } },\n cycle: { control: { type: 'boolean' } },\n error: { control: { type: 'boolean' } }\n};\n"]}
1
+ {"version":3,"file":"Lightbox.stories.jsx","sourceRoot":"","sources":["../../../src/core/Lightbox/Lightbox.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG5E,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,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C;YACjC,CAAC,CAAC,CACF,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,WAAW,CAAC,CAAC,WAAW,CAAC,EACzB,CACH,CACH;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,IAAI,GAAG;IAClB,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;CACb,CAAC;AAEF,YAAY,CAAC,QAAQ,GAAG;IACtB,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACtC,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACvC,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;CACxC,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport { useRef, useState } from 'react';\n\nimport { Button, DateTimeDisplay, Lightbox } from '@pega/cosmos-react-core';\nimport type { LightboxItem, LightboxProps } from '@pega/cosmos-react-core';\n\nimport { mockData, mockBadResources } from './Lightbox.mocks';\n\nexport default {\n title: 'Core/Lightbox',\n component: Lightbox,\n parameters: {\n layout: 'centered'\n }\n} as Meta;\n\ninterface LightboxStoryProps {\n limit?: number;\n cycle?: boolean;\n error?: boolean;\n}\n\nexport const LightboxDemo: StoryFn<LightboxStoryProps> = (args: LightboxStoryProps) => {\n const demoButtonRef = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState<boolean>(false);\n const [items, setItems] = useState<LightboxProps['items']>();\n\n const onClick = () => {\n setItems(\n (args.error ? mockBadResources : mockData.slice(0, args.limit)).map(item => {\n return {\n ...item,\n metadata: [\n item.format,\n 'John smith',\n <DateTimeDisplay value={new Date()} variant='date' />\n ]\n };\n })\n );\n };\n\n const onItemDownload = async (id: LightboxItem['id']) => {\n const currentItem = items?.find(item => item.id === id);\n if (!currentItem) return;\n\n if (currentItem.src) {\n const objectURL = URL.createObjectURL(await (await fetch(currentItem.src)).blob());\n\n const a = document.createElement('a');\n a.href = objectURL;\n a.download = currentItem.name ?? id;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n URL.revokeObjectURL(objectURL);\n }\n };\n\n const onItemError = (id: LightboxItem['id']) => {\n setItems(item => {\n return item?.map(obj => (obj.id === id ? { ...obj, error: true } : obj));\n });\n };\n\n return (\n <>\n <Button\n ref={demoButtonRef}\n onClick={() => {\n setOpen(true);\n onClick();\n }}\n >\n Open Lightbox\n </Button>\n {open && (\n <Lightbox\n items={items ?? []}\n cycle={args.cycle || undefined}\n onAfterClose={() => {\n setOpen(false);\n demoButtonRef.current?.focus();\n }}\n onItemDownload={onItemDownload}\n onItemError={onItemError}\n />\n )}\n </>\n );\n};\n\nLightboxDemo.args = {\n limit: 12,\n cycle: false,\n error: false\n};\n\nLightboxDemo.argTypes = {\n limit: { control: { type: 'number' } },\n cycle: { control: { type: 'boolean' } },\n error: { control: { type: 'boolean' } }\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ListToolbar.mocks.d.ts","sourceRoot":"","sources":["../../../src/core/ListToolbar/ListToolbar.mocks.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sEAAsE,CAAC;AAM9G,eAAO,MAAM,OAAO,EAAE,MAAM,EAIzB,CAAC;AAEJ,eAAO,MAAM,SAAS,EAAE,iBAAiB,CAAC,OAAO,CAIhD,CAAC;AAEF,eAAO,MAAM,0BAA0B,2CAA4C,CAAC;AAwDpF,eAAO,MAAM,cAAc,mCAE1B,CAAC;AAEF,eAAO,MAAM,aAAa,mCAEzB,CAAC"}
1
+ {"version":3,"file":"ListToolbar.mocks.d.ts","sourceRoot":"","sources":["../../../src/core/ListToolbar/ListToolbar.mocks.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sEAAsE,CAAC;AAM9G,eAAO,MAAM,OAAO,EAAE,MAAM,EAIzB,CAAC;AAEJ,eAAO,MAAM,SAAS,EAAE,iBAAiB,CAAC,OAAO,CAIhD,CAAC;AAEF,eAAO,MAAM,0BAA0B,2CAA4C,CAAC;AA8CpF,eAAO,MAAM,cAAc,mCAE1B,CAAC;AAEF,eAAO,MAAM,aAAa,mCAEzB,CAAC"}
@@ -16,34 +16,26 @@ export const mockViews = [
16
16
  export const StagedStateDispatchContext = createContext(() => { });
17
17
  const GroupByMock = () => {
18
18
  return (<Flex container={{ direction: 'column', gap: 2 }}>
19
- <Flex container={{ direction: 'column', gap: 1 }}>
20
- <Flex container={{
21
- justify: 'between',
22
- alignItems: 'center',
23
- direction: 'row',
24
- wrap: 'nowrap',
25
- itemGap: 0.5
26
- }}>
27
- <Flex container={{
19
+ <Flex container={{
28
20
  justify: 'start',
29
21
  alignItems: 'center',
30
22
  direction: 'row',
31
23
  wrap: 'nowrap',
32
24
  itemGap: 0.5
33
25
  }} item={{ grow: 1 }}>
34
- <Icon name='drag'/>
35
- <Flex item={{ grow: 1, basis: '50%' }}>
36
- <FieldSelector fields={[]} value='' onChange={() => { }}/>
37
- </Flex>
38
- <Flex as={Select} item={{ basis: '50%' }}>
39
- <Option> </Option>
40
- <Option>Item A</Option>
41
- </Flex>
42
- </Flex>
43
- <Button aria-label='Delete group' icon variant='simple'>
44
- <Icon name='trash'/>
45
- </Button>
26
+ <Icon name='drag'/>
27
+ <Flex item={{ basis: '50%' }}>
28
+ <FieldSelector fields={[]} value='' onChange={() => { }} aria-label='Field'/>
29
+ </Flex>
30
+ <Flex item={{ basis: '50%' }}>
31
+ <Select label='Select' aria-label='Select'>
32
+ <Option> </Option>
33
+ <Option>Item A</Option>
34
+ </Select>
46
35
  </Flex>
36
+ <Button aria-label='Delete group' icon variant='simple'>
37
+ <Icon name='trash'/>
38
+ </Button>
47
39
  </Flex>
48
40
  <Button variant='link' aria-label='Add a group'>
49
41
  <Flex container={{
@@ -1 +1 @@
1
- {"version":3,"file":"ListToolbar.mocks.jsx","sourceRoot":"","sources":["../../../src/core/ListToolbar/ListToolbar.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,aAAa,MAAM,gGAAgG,CAAC;AAE3H,OAAO,EAAE,UAAU,EAAE,MAAM,qDAAqD,CAAC;AAEjF,MAAM,CAAC,MAAM,OAAO,GAAa,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjF,IAAI;IACJ,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,QAAQ;CACf,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,SAAS,GAA+B;IACnD,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;IAChD,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE;IACjD,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE;CAClD,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CAAmB,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAEpF,MAAM,WAAW,GAAG,GAAG,EAAE;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A,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CACrD;YAAA,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EACpB;UAAA,EAAE,MAAM,CACV;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,CAC7C;QAAA,CAAC,IAAI,CACH,SAAS,CAAC,CAAC;YACT,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,OAAO;YACnB,GAAG,EAAE,CAAC;SACP,CAAC,CACF,EAAE,CAAC,MAAM,CAET;UAAA,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EACjB;UAAA,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CACjB;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,MAAM,CACV;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EAAG,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,OAAO,CAAC,WAAW,CAAC,AAAD,EAAG,CAAC;AACzB,CAAC,CAAC","sourcesContent":["import { createContext } from 'react';\nimport type { Dispatch } from 'react';\n\nimport { Select, Option, Flex, Button, Icon } from '@pega/cosmos-react-core';\nimport type { Action } from '@pega/cosmos-react-core';\nimport type { ViewSelectorProps } from '@pega/cosmos-react-core/lib/components/ListToolbar/ListToolbar.types';\nimport { ConditionBuilder } from '@pega/cosmos-react-condition-builder';\nimport FieldSelector from '@pega/cosmos-react-condition-builder/lib/components/ConditionBuilder/RhsControls/FieldSelector';\n\nimport { demoFields } from '../../condition-builder/ConditionBuilder/props.mock';\n\nexport const actions: Action[] = ['Action 1', 'Action 2', 'Action 3'].map(text => ({\n text,\n id: text,\n icon: 'filter'\n}));\n\nexport const mockViews: ViewSelectorProps['views'] = [\n { id: '1', text: 'Data view 1', selected: true },\n { id: '2', text: 'Data view 2', selected: false },\n { id: '3', text: 'Data view 3', selected: false }\n];\n\nexport const StagedStateDispatchContext = createContext<Dispatch<object>>(() => {});\n\nconst GroupByMock = () => {\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Flex container={{ direction: 'column', gap: 1 }}>\n <Flex\n container={{\n justify: 'between',\n alignItems: 'center',\n direction: 'row',\n wrap: 'nowrap',\n itemGap: 0.5\n }}\n >\n <Flex\n container={{\n justify: 'start',\n alignItems: 'center',\n direction: 'row',\n wrap: 'nowrap',\n itemGap: 0.5\n }}\n item={{ grow: 1 }}\n >\n <Icon name='drag' />\n <Flex item={{ grow: 1, basis: '50%' }}>\n <FieldSelector fields={[]} value='' onChange={() => {}} />\n </Flex>\n <Flex as={Select} item={{ basis: '50%' }}>\n <Option> </Option>\n <Option>Item A</Option>\n </Flex>\n </Flex>\n <Button aria-label='Delete group' icon variant='simple'>\n <Icon name='trash' />\n </Button>\n </Flex>\n </Flex>\n <Button variant='link' aria-label='Add a group'>\n <Flex\n container={{\n inline: true,\n alignItems: 'start',\n gap: 1\n }}\n as='span'\n >\n <Icon name='plus' />\n <span>Add</span>\n </Flex>\n </Button>\n </Flex>\n );\n};\n\nexport const FilterRenderer = () => {\n return <ConditionBuilder fields={demoFields} />;\n};\n\nexport const GroupRenderer = () => {\n return <GroupByMock />;\n};\n"]}
1
+ {"version":3,"file":"ListToolbar.mocks.jsx","sourceRoot":"","sources":["../../../src/core/ListToolbar/ListToolbar.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG7E,OAAO,EAAE,gBA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C;AAClD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,OAAO,CAAC,WAAW,CAAC,AAAD,EAAG,CAAC;AACzB,CAAC,CAAC","sourcesContent":["import { createContext } from 'react';\nimport type { Dispatch } from 'react';\n\nimport { Select, Option, Flex, Button, Icon } from '@pega/cosmos-react-core';\nimport type { Action } from '@pega/cosmos-react-core';\nimport type { ViewSelectorProps } from '@pega/cosmos-react-core/lib/components/ListToolbar/ListToolbar.types';\nimport { ConditionBuilder } from '@pega/cosmos-react-condition-builder';\nimport FieldSelector from '@pega/cosmos-react-condition-builder/lib/components/ConditionBuilder/RhsControls/FieldSelector';\n\nimport { demoFields } from '../../condition-builder/ConditionBuilder/props.mock';\n\nexport const actions: Action[] = ['Action 1', 'Action 2', 'Action 3'].map(text => ({\n text,\n id: text,\n icon: 'filter'\n}));\n\nexport const mockViews: ViewSelectorProps['views'] = [\n { id: '1', text: 'Data view 1', selected: true },\n { id: '2', text: 'Data view 2', selected: false },\n { id: '3', text: 'Data view 3', selected: false }\n];\n\nexport const StagedStateDispatchContext = createContext<Dispatch<object>>(() => {});\n\nconst GroupByMock = () => {\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Flex\n container={{\n justify: 'start',\n alignItems: 'center',\n direction: 'row',\n wrap: 'nowrap',\n itemGap: 0.5\n }}\n item={{ grow: 1 }}\n >\n <Icon name='drag' />\n <Flex item={{ basis: '50%' }}>\n <FieldSelector fields={[]} value='' onChange={() => {}} aria-label='Field' />\n </Flex>\n <Flex item={{ basis: '50%' }}>\n <Select label='Select' aria-label='Select'>\n <Option> </Option>\n <Option>Item A</Option>\n </Select>\n </Flex>\n <Button aria-label='Delete group' icon variant='simple'>\n <Icon name='trash' />\n </Button>\n </Flex>\n <Button variant='link' aria-label='Add a group'>\n <Flex\n container={{\n inline: true,\n alignItems: 'start',\n gap: 1\n }}\n as='span'\n >\n <Icon name='plus' />\n <span>Add</span>\n </Flex>\n </Button>\n </Flex>\n );\n};\n\nexport const FilterRenderer = () => {\n return <ConditionBuilder fields={demoFields} />;\n};\n\nexport const GroupRenderer = () => {\n return <GroupByMock />;\n};\n"]}
@@ -3,10 +3,15 @@ import type { FormControlProps } from '@pega/cosmos-react-core';
3
3
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
4
4
  export default _default;
5
5
  interface ListToolbarStoryProps {
6
- createNewLabel: string;
7
6
  required: FormControlProps['required'];
7
+ info: FormControlProps['info'];
8
+ status: FormControlProps['status'];
9
+ createNewLabel: string;
8
10
  showAdditionalInfo?: boolean;
11
+ numberOfSelected: number;
12
+ bulkButton: boolean;
13
+ bulkButtonLabel: string;
9
14
  }
10
15
  export declare const ListToolbarDemo: StoryFn<ListToolbarStoryProps>;
11
- export declare const SimpleToolbarDemo: StoryFn;
16
+ export declare const SimpleToolbarDemo: StoryFn<ListToolbarStoryProps>;
12
17
  //# sourceMappingURL=ListToolbar.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListToolbar.stories.d.ts","sourceRoot":"","sources":["../../../src/core/ListToolbar/ListToolbar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAWtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;;AAWhE,wBAGU;AAIV,UAAU,qBAAqB;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACvC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,qBAAqB,CAsH1D,CAAC;AAcF,eAAO,MAAM,iBAAiB,EAAE,OAU/B,CAAC"}
1
+ {"version":3,"file":"ListToolbar.stories.d.ts","sourceRoot":"","sources":["../../../src/core/ListToolbar/ListToolbar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAWtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;;AAWhE,wBAaU;AAIV,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACvC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC/B,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,qBAAqB,CAwH1D,CAAC;AAuBF,eAAO,MAAM,iBAAiB,EAAE,OAAO,CAAC,qBAAqB,CAY5D,CAAC"}
@@ -4,7 +4,17 @@ import { Flex, Link, ListToolbar, MenuButton, listToolbarHelpers as helpers } fr
4
4
  import { mockViews, actions, FilterRenderer, StagedStateDispatchContext, GroupRenderer } from './ListToolbar.mocks';
5
5
  export default {
6
6
  title: 'Core/ListToolbar',
7
- component: ListToolbar
7
+ component: ListToolbar,
8
+ args: {
9
+ required: false,
10
+ info: undefined,
11
+ status: undefined
12
+ },
13
+ argTypes: {
14
+ required: { control: { type: 'boolean' } },
15
+ info: { control: { type: 'text' } },
16
+ status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } }
17
+ }
8
18
  };
9
19
  export const ListToolbarDemo = (args) => {
10
20
  const [stagedQueryOptionState, setStagedQueryOptionState] = useState(null);
@@ -79,9 +89,11 @@ export const ListToolbarDemo = (args) => {
79
89
  onSearchChange: setSearchValue
80
90
  }} count={{
81
91
  total: 1146,
82
- selected: 4
83
- }} filter={filterProp} sort={sortProp} group={groupProp} actions={actions} additionalActions={<MenuButton text='Edit'/>} formControlProps={{
92
+ selected: args.numberOfSelected
93
+ }} filter={filterProp} sort={sortProp} group={groupProp} actions={actions} additionalActions={args.bulkButton && <MenuButton text={args.bulkButtonLabel}/>} formControlProps={{
84
94
  required: args.required,
95
+ info: args.info,
96
+ status: args.status,
85
97
  additionalInfo: args.showAdditionalInfo
86
98
  ? {
87
99
  content: (<Flex container={{ direction: 'column', alignItems: 'start', gap: 2 }}>
@@ -106,15 +118,24 @@ export const ListToolbarDemo = (args) => {
106
118
  };
107
119
  ListToolbarDemo.args = {
108
120
  createNewLabel: undefined,
109
- required: false,
110
- showAdditionalInfo: false
121
+ showAdditionalInfo: false,
122
+ numberOfSelected: 4,
123
+ bulkButton: true,
124
+ bulkButtonLabel: 'Edit'
111
125
  };
112
126
  ListToolbarDemo.argTypes = {
113
127
  createNewLabel: { control: { type: 'text' } },
114
- required: { control: { type: 'boolean' } },
115
- showAdditionalInfo: { control: { type: 'boolean' } }
128
+ showAdditionalInfo: { control: { type: 'boolean' } },
129
+ numberOfSelected: { control: { type: 'number' } },
130
+ bulkButton: { control: { type: 'boolean' } },
131
+ bulkButtonLabel: { control: { type: 'text' } }
116
132
  };
117
- export const SimpleToolbarDemo = () => {
118
- return (<ListToolbar name='Top accounts in California' search={{ onSearchSubmit: action('Search submit') }} count={{ total: 212, totalHasMore: true }} actions={actions} formControlProps={{ required: true }}/>);
133
+ export const SimpleToolbarDemo = (args) => {
134
+ return (<ListToolbar name='Top accounts in California' search={{ onSearchSubmit: action('Search submit') }} count={{ total: 212, totalHasMore: true }} actions={actions} formControlProps={args}/>);
135
+ };
136
+ SimpleToolbarDemo.args = {
137
+ required: true,
138
+ info: 'Info message',
139
+ status: 'error'
119
140
  };
120
141
  //# sourceMappingURL=ListToolbar.stories.jsx.map