@pega/cosmos-react-build 7.0.0-build.9.2 → 7.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +7 -7
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.styles.js +27 -27
- package/lib/components/AppShell/Header/AppHeader.styles.js.map +1 -1
- package/lib/components/AppShell/Header/BranchButton.d.ts.map +1 -1
- package/lib/components/AppShell/Header/BranchButton.js +22 -22
- package/lib/components/AppShell/Header/BranchButton.js.map +1 -1
- package/lib/components/DynamicInput/BooleanControl.d.ts +9 -0
- package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -0
- package/lib/components/DynamicInput/BooleanControl.js +24 -0
- package/lib/components/DynamicInput/BooleanControl.js.map +1 -0
- package/lib/components/DynamicInput/DynamicInput.d.ts +7 -0
- package/lib/components/DynamicInput/DynamicInput.d.ts.map +1 -0
- package/lib/components/DynamicInput/DynamicInput.js +116 -0
- package/lib/components/DynamicInput/DynamicInput.js.map +1 -0
- package/lib/components/DynamicInput/DynamicInput.styles.d.ts +5 -0
- package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -0
- package/lib/components/DynamicInput/DynamicInput.styles.js +59 -0
- package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -0
- package/lib/components/DynamicInput/DynamicInput.test-ids.d.ts +2 -0
- package/lib/components/DynamicInput/DynamicInput.test-ids.d.ts.map +1 -0
- package/lib/components/DynamicInput/DynamicInput.test-ids.js +9 -0
- package/lib/components/DynamicInput/DynamicInput.test-ids.js.map +1 -0
- package/lib/components/DynamicInput/DynamicInput.types.d.ts +75 -0
- package/lib/components/DynamicInput/DynamicInput.types.d.ts.map +1 -0
- package/lib/components/DynamicInput/DynamicInput.types.js +2 -0
- package/lib/components/DynamicInput/DynamicInput.types.js.map +1 -0
- package/lib/components/DynamicInput/SourceButton.d.ts +14 -0
- package/lib/components/DynamicInput/SourceButton.d.ts.map +1 -0
- package/lib/components/DynamicInput/SourceButton.js +14 -0
- package/lib/components/DynamicInput/SourceButton.js.map +1 -0
- package/lib/components/DynamicInput/index.d.ts +3 -0
- package/lib/components/DynamicInput/index.d.ts.map +1 -0
- package/lib/components/DynamicInput/index.js +3 -0
- package/lib/components/DynamicInput/index.js.map +1 -0
- package/lib/components/DynamicInput/utils.d.ts +7 -0
- package/lib/components/DynamicInput/utils.d.ts.map +1 -0
- package/lib/components/DynamicInput/utils.js +38 -0
- package/lib/components/DynamicInput/utils.js.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +493 -493
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
- package/lib/components/FieldReference/FieldReference.styles.d.ts +12 -0
- package/lib/components/FieldReference/FieldReference.styles.d.ts.map +1 -0
- package/lib/components/FieldReference/FieldReference.styles.js +169 -0
- package/lib/components/FieldReference/FieldReference.styles.js.map +1 -0
- package/lib/components/FieldReference/FieldReference.test-ids.d.ts +3 -0
- package/lib/components/FieldReference/FieldReference.test-ids.d.ts.map +1 -0
- package/lib/components/FieldReference/FieldReference.test-ids.js +13 -0
- package/lib/components/FieldReference/FieldReference.test-ids.js.map +1 -0
- package/lib/components/FieldReference/FieldReference.types.d.ts +131 -0
- package/lib/components/FieldReference/FieldReference.types.d.ts.map +1 -0
- package/lib/components/FieldReference/FieldReference.types.js +2 -0
- package/lib/components/FieldReference/FieldReference.types.js.map +1 -0
- package/lib/components/FieldReference/FieldReferenceDisplay.d.ts +7 -0
- package/lib/components/FieldReference/FieldReferenceDisplay.d.ts.map +1 -0
- package/lib/components/FieldReference/FieldReferenceDisplay.js +25 -0
- package/lib/components/FieldReference/FieldReferenceDisplay.js.map +1 -0
- package/lib/components/FieldReference/FieldReferenceInput.d.ts +7 -0
- package/lib/components/FieldReference/FieldReferenceInput.d.ts.map +1 -0
- package/lib/components/FieldReference/FieldReferenceInput.js +345 -0
- package/lib/components/FieldReference/FieldReferenceInput.js.map +1 -0
- package/lib/components/FieldReference/FieldReferenceMenuList.d.ts +6 -0
- package/lib/components/FieldReference/FieldReferenceMenuList.d.ts.map +1 -0
- package/lib/components/FieldReference/FieldReferenceMenuList.js +66 -0
- package/lib/components/FieldReference/FieldReferenceMenuList.js.map +1 -0
- package/lib/components/FieldReference/helpers.d.ts +13 -0
- package/lib/components/FieldReference/helpers.d.ts.map +1 -0
- package/lib/components/FieldReference/helpers.js +96 -0
- package/lib/components/FieldReference/helpers.js.map +1 -0
- package/lib/components/FieldReference/index.d.ts +7 -0
- package/lib/components/FieldReference/index.d.ts.map +1 -0
- package/lib/components/FieldReference/index.js +5 -0
- package/lib/components/FieldReference/index.js.map +1 -0
- package/lib/components/FieldReference/typeIconMapping.d.ts +80 -0
- package/lib/components/FieldReference/typeIconMapping.d.ts.map +1 -0
- package/lib/components/FieldReference/typeIconMapping.js +22 -0
- package/lib/components/FieldReference/typeIconMapping.js.map +1 -0
- package/lib/components/IconTile/IconTile.d.ts +5 -0
- package/lib/components/IconTile/IconTile.d.ts.map +1 -0
- package/lib/components/IconTile/IconTile.js +8 -0
- package/lib/components/IconTile/IconTile.js.map +1 -0
- package/lib/components/IconTile/IconTile.styles.d.ts +7 -0
- package/lib/components/IconTile/IconTile.styles.d.ts.map +1 -0
- package/lib/components/IconTile/IconTile.styles.js +68 -0
- package/lib/components/IconTile/IconTile.styles.js.map +1 -0
- package/lib/components/IconTile/IconTile.types.d.ts +27 -0
- package/lib/components/IconTile/IconTile.types.d.ts.map +1 -0
- package/lib/components/IconTile/IconTile.types.js +2 -0
- package/lib/components/IconTile/IconTile.types.js.map +1 -0
- package/lib/components/IconTile/Tiles/Ai.d.ts +5 -0
- package/lib/components/IconTile/Tiles/Ai.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/Ai.js +7 -0
- package/lib/components/IconTile/Tiles/Ai.js.map +1 -0
- package/lib/components/IconTile/Tiles/Automation.d.ts +5 -0
- package/lib/components/IconTile/Tiles/Automation.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/Automation.js +7 -0
- package/lib/components/IconTile/Tiles/Automation.js.map +1 -0
- package/lib/components/IconTile/Tiles/AutomationAppend.d.ts +5 -0
- package/lib/components/IconTile/Tiles/AutomationAppend.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/AutomationAppend.js +7 -0
- package/lib/components/IconTile/Tiles/AutomationAppend.js.map +1 -0
- package/lib/components/IconTile/Tiles/AutomationCall.d.ts +5 -0
- package/lib/components/IconTile/Tiles/AutomationCall.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/AutomationCall.js +7 -0
- package/lib/components/IconTile/Tiles/AutomationCall.js.map +1 -0
- package/lib/components/IconTile/Tiles/AutomationForEach.d.ts +5 -0
- package/lib/components/IconTile/Tiles/AutomationForEach.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/AutomationForEach.js +7 -0
- package/lib/components/IconTile/Tiles/AutomationForEach.js.map +1 -0
- package/lib/components/IconTile/Tiles/AutomationReturn.d.ts +5 -0
- package/lib/components/IconTile/Tiles/AutomationReturn.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/AutomationReturn.js +7 -0
- package/lib/components/IconTile/Tiles/AutomationReturn.js.map +1 -0
- package/lib/components/IconTile/Tiles/AutomationSet.d.ts +5 -0
- package/lib/components/IconTile/Tiles/AutomationSet.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/AutomationSet.js +7 -0
- package/lib/components/IconTile/Tiles/AutomationSet.js.map +1 -0
- package/lib/components/IconTile/Tiles/Case.d.ts +5 -0
- package/lib/components/IconTile/Tiles/Case.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/Case.js +7 -0
- package/lib/components/IconTile/Tiles/Case.js.map +1 -0
- package/lib/components/IconTile/Tiles/CaseGoTo.d.ts +5 -0
- package/lib/components/IconTile/Tiles/CaseGoTo.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/CaseGoTo.js +7 -0
- package/lib/components/IconTile/Tiles/CaseGoTo.js.map +1 -0
- package/lib/components/IconTile/Tiles/CaseProcess.d.ts +5 -0
- package/lib/components/IconTile/Tiles/CaseProcess.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/CaseProcess.js +7 -0
- package/lib/components/IconTile/Tiles/CaseProcess.js.map +1 -0
- package/lib/components/IconTile/Tiles/CaseSla.d.ts +5 -0
- package/lib/components/IconTile/Tiles/CaseSla.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/CaseSla.js +7 -0
- package/lib/components/IconTile/Tiles/CaseSla.js.map +1 -0
- package/lib/components/IconTile/Tiles/CaseStage.d.ts +5 -0
- package/lib/components/IconTile/Tiles/CaseStage.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/CaseStage.js +7 -0
- package/lib/components/IconTile/Tiles/CaseStage.js.map +1 -0
- package/lib/components/IconTile/Tiles/CaseWait.d.ts +5 -0
- package/lib/components/IconTile/Tiles/CaseWait.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/CaseWait.js +7 -0
- package/lib/components/IconTile/Tiles/CaseWait.js.map +1 -0
- package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts +5 -0
- package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/LogicDecisionStep.js +7 -0
- package/lib/components/IconTile/Tiles/LogicDecisionStep.js.map +1 -0
- package/lib/components/IconTile/Tiles/LogicFunction.d.ts +5 -0
- package/lib/components/IconTile/Tiles/LogicFunction.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/LogicFunction.js +7 -0
- package/lib/components/IconTile/Tiles/LogicFunction.js.map +1 -0
- package/lib/components/IconTile/Tiles/LogicValidation.d.ts +5 -0
- package/lib/components/IconTile/Tiles/LogicValidation.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/LogicValidation.js +7 -0
- package/lib/components/IconTile/Tiles/LogicValidation.js.map +1 -0
- package/lib/components/IconTile/Tiles/LogicWhen.d.ts +5 -0
- package/lib/components/IconTile/Tiles/LogicWhen.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/LogicWhen.js +7 -0
- package/lib/components/IconTile/Tiles/LogicWhen.js.map +1 -0
- package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RuleAuthenticate.js +7 -0
- package/lib/components/IconTile/Tiles/RuleAuthenticate.js.map +1 -0
- package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RuleConfiguration.js +7 -0
- package/lib/components/IconTile/Tiles/RuleConfiguration.js.map +1 -0
- package/lib/components/IconTile/Tiles/RuleConnector.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RuleConnector.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RuleConnector.js +7 -0
- package/lib/components/IconTile/Tiles/RuleConnector.js.map +1 -0
- package/lib/components/IconTile/Tiles/RuleDataPage.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RuleDataPage.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RuleDataPage.js +7 -0
- package/lib/components/IconTile/Tiles/RuleDataPage.js.map +1 -0
- package/lib/components/IconTile/Tiles/RuleField.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RuleField.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RuleField.js +7 -0
- package/lib/components/IconTile/Tiles/RuleField.js.map +1 -0
- package/lib/components/IconTile/Tiles/RuleInsight.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RuleInsight.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RuleInsight.js +7 -0
- package/lib/components/IconTile/Tiles/RuleInsight.js.map +1 -0
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.js +7 -0
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.js.map +1 -0
- package/lib/components/IconTile/Tiles/RuleLiveData.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RuleLiveData.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RuleLiveData.js +7 -0
- package/lib/components/IconTile/Tiles/RuleLiveData.js.map +1 -0
- package/lib/components/IconTile/Tiles/RuleParagraph.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RuleParagraph.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RuleParagraph.js +7 -0
- package/lib/components/IconTile/Tiles/RuleParagraph.js.map +1 -0
- package/lib/components/IconTile/Tiles/RulePermission.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RulePermission.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RulePermission.js +7 -0
- package/lib/components/IconTile/Tiles/RulePermission.js.map +1 -0
- package/lib/components/IconTile/Tiles/RulePersona.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RulePersona.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RulePersona.js +7 -0
- package/lib/components/IconTile/Tiles/RulePersona.js.map +1 -0
- package/lib/components/IconTile/Tiles/RulePortal.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RulePortal.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RulePortal.js +7 -0
- package/lib/components/IconTile/Tiles/RulePortal.js.map +1 -0
- package/lib/components/IconTile/Tiles/RuleRecord.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RuleRecord.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RuleRecord.js +7 -0
- package/lib/components/IconTile/Tiles/RuleRecord.js.map +1 -0
- package/lib/components/IconTile/Tiles/RuleSystem.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RuleSystem.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RuleSystem.js +7 -0
- package/lib/components/IconTile/Tiles/RuleSystem.js.map +1 -0
- package/lib/components/IconTile/Tiles/RuleView.d.ts +5 -0
- package/lib/components/IconTile/Tiles/RuleView.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/RuleView.js +7 -0
- package/lib/components/IconTile/Tiles/RuleView.js.map +1 -0
- package/lib/components/IconTile/Tiles/Task.d.ts +5 -0
- package/lib/components/IconTile/Tiles/Task.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/Task.js +7 -0
- package/lib/components/IconTile/Tiles/Task.js.map +1 -0
- package/lib/components/IconTile/Tiles/TaskAction.d.ts +5 -0
- package/lib/components/IconTile/Tiles/TaskAction.d.ts.map +1 -0
- package/lib/components/IconTile/Tiles/TaskAction.js +7 -0
- package/lib/components/IconTile/Tiles/TaskAction.js.map +1 -0
- package/lib/components/IconTile/index.d.ts +36 -0
- package/lib/components/IconTile/index.d.ts.map +1 -0
- package/lib/components/IconTile/index.js +36 -0
- package/lib/components/IconTile/index.js.map +1 -0
- package/lib/components/ObjectSelect/ObjectSummary.d.ts.map +1 -1
- package/lib/components/ObjectSelect/ObjectSummary.js +18 -18
- package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +5 -5
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/RuleSelect/RuleSelect.d.ts +5 -0
- package/lib/components/RuleSelect/RuleSelect.d.ts.map +1 -0
- package/lib/components/RuleSelect/RuleSelect.js +76 -0
- package/lib/components/RuleSelect/RuleSelect.js.map +1 -0
- package/lib/components/RuleSelect/RuleSelect.types.d.ts +56 -0
- package/lib/components/RuleSelect/RuleSelect.types.d.ts.map +1 -0
- package/lib/components/RuleSelect/RuleSelect.types.js +2 -0
- package/lib/components/RuleSelect/RuleSelect.types.js.map +1 -0
- package/lib/components/RuleSelect/index.d.ts +3 -0
- package/lib/components/RuleSelect/index.d.ts.map +1 -0
- package/lib/components/RuleSelect/index.js +3 -0
- package/lib/components/RuleSelect/index.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -1
- package/package.json +8 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":";AAyBA,eAAO,MAAM,WAAW,yGAStB,CAAC;AAIH,eAAO,MAAM,0BAA0B,qOAiBrC,CAAC;AAIH,eAAO,MAAM,gBAAgB,yGAK3B,CAAC;AAIH,eAAO,MAAM,UAAU;aACZ,OAAO;aACP,OAAO;SAoCjB,CAAC;AAIF,eAAO,MAAM,SAAS,yGAkIrB,CAAC;AAIF,eAAO,MAAM,uBAAuB;;
|
|
1
|
+
{"version":3,"file":"AppShell.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":";AAyBA,eAAO,MAAM,WAAW,yGAStB,CAAC;AAIH,eAAO,MAAM,0BAA0B,qOAiBrC,CAAC;AAIH,eAAO,MAAM,gBAAgB,yGAK3B,CAAC;AAIH,eAAO,MAAM,UAAU;aACZ,OAAO;aACP,OAAO;SAoCjB,CAAC;AAIF,eAAO,MAAM,SAAS,yGAkIrB,CAAC;AAIF,eAAO,MAAM,uBAAuB;;SAgBlC,CAAC;AAIH,eAAO,MAAM,iBAAiB;;SAwE7B,CAAC;AAIF,eAAO,MAAM,aAAa,wGAAc,CAAC"}
|
|
@@ -185,15 +185,15 @@ StyledNav.defaultProps = defaultThemeProp;
|
|
|
185
185
|
export const StyledAppShellCaretIcon = styled(Icon)(({ nestedListCollapsed, theme }) => {
|
|
186
186
|
const { rtl } = useDirection();
|
|
187
187
|
return css `
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
transition-property: transform;
|
|
189
|
+
transition-duration: ${theme.base.animation.speed};
|
|
190
|
+
transition-timing-function: ${theme.base.animation.timing.ease};
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
${nestedListCollapsed === false &&
|
|
193
193
|
css `
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
transform: rotateZ(${rtl ? '-90deg' : '90deg'});
|
|
195
|
+
`}
|
|
196
|
+
`;
|
|
197
197
|
});
|
|
198
198
|
StyledAppShellCaretIcon.defaultProps = defaultThemeProp;
|
|
199
199
|
export const StyledNavListItem = styled.li(({ activeTreeRoot, theme }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,IAAI,EACL,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,iEAAiE,CAAC;AAEzE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,QAAQ,GAAG,MAAM,CAAC;AACxB,MAAM,YAAY,GAAG,OAAO,CAAC;AAE7B,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClD,MAAM,WAAW,GAAG,QAAQ,C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AAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;;;UAG9C,cAAc;QAChB,GAAG,CAAA;mBACQ,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;8BACjB,gBAAgB;SACrC;;UAEC,uBAAuB;;kBAEf,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;YAC/B,OAAO;QACT,GAAG,CAAA;;WAEF;;qBAEU,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;;;;UAI9B,UAAU;4BACQ,QAAQ;;;;;;iBAMnB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;4BACjB,gBAAgB;;KAEvC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { lighten, rgba } from 'polished';\nimport { useContext } from 'react';\n\nimport {\n tryCatch,\n defaultThemeProp,\n Button,\n StyledIcon,\n useDirection,\n calculateFontSize,\n Icon\n} from '@pega/cosmos-react-core';\nimport {\n StyledToggleIcon,\n StyledNodeText,\n StyledNodeInteraction,\n StyledStandardTree\n} from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';\n\nimport AppShellContext from './AppShellContext';\n\nconst navWidth = '3rem';\nconst navOpenWidth = '14rem';\n\nexport const StyledUtils = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n padding-block: ${theme.base.spacing};\n border-block-start: 0.0625rem solid ${borderColor};\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellToggleButton = styled(Button)(({ theme }) => {\n return css`\n background-color: ${theme.base.palette.dark};\n color: ${theme.base.palette.light};\n border: none;\n\n ${StyledIcon} {\n width: 1.25rem;\n height: 1.25rem;\n font-weight: bold;\n }\n\n &:enabled:focus,\n :not([disabled]):focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledAppShellToggleButton.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(() => {\n return css`\n height: 100%;\n overflow-y: auto;\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledMain = styled.main<{\n navOpen: boolean;\n hideNav: boolean;\n}>(\n ({\n navOpen,\n hideNav,\n theme: {\n base: { animation, breakpoints, palette }\n }\n }) => {\n return css`\n position: relative;\n min-height: calc(100vh - 6rem);\n background-color: ${palette['app-background']};\n margin-inline-start: ${navWidth};\n transition: margin-inline-start ${`${animation.speed} ${animation.timing.ease}`};\n\n @media (pointer: coarse) {\n min-height: calc(100vh - 8rem);\n }\n\n @media (min-width: ${breakpoints.md}) {\n min-height: calc(100vh - 3rem);\n }\n\n ${navOpen &&\n css`\n margin-inline-start: ${navOpenWidth};\n `}\n\n ${hideNav &&\n css`\n transition-duration: 0s;\n margin-inline-start: 0;\n `}\n `;\n }\n);\n\nStyledMain.defaultProps = defaultThemeProp;\n\nexport const StyledNav = styled.nav(\n ({\n theme: {\n base: {\n breakpoints,\n colors,\n palette,\n animation,\n spacing,\n shadow,\n 'custom-scrollbar': customScrollbar,\n 'border-radius': borderRadius,\n 'font-size': fontSize,\n 'font-scale': fontScale\n },\n components: { 'app-shell': appShell }\n }\n }) => {\n const { navState } = useContext(AppShellContext);\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n position: fixed;\n z-index: 1;\n height: calc(100vh - 6rem);\n background: ${appShell.nav['background-color']};\n width: ${navState === 'opening' || navState === 'open' ? navOpenWidth : navWidth};\n transition: width ${animation.speed} ${animation.timing.ease};\n display: flex;\n\n ${StyledStandardTree} {\n background-color: ${palette.dark};\n\n ${StyledNodeText}, ${StyledToggleIcon} {\n color: rgba(255, 255, 255, 0.7);\n font-size: ${fontSizes.s};\n }\n\n ${StyledNodeInteraction} {\n padding-block-start: calc(0.5 * ${spacing});\n padding-block-end: calc(0.5 * ${spacing});\n\n &:hover {\n background: rgba(255, 255, 255, 0.1);\n\n ${StyledNodeText} {\n color: ${palette.light};\n }\n }\n\n &:focus {\n box-shadow: ${shadow['focus-inset']};\n }\n\n &[aria-current='page'],\n &[aria-current='true'] {\n background: rgba(255, 255, 255, 0.05);\n\n ${StyledNodeText} {\n color: ${colors.blue.light};\n }\n }\n }\n\n &:has(:focus-visible) {\n box-shadow: inset 0 0 0 0.125rem #71c1ff99;\n }\n }\n\n ${customScrollbar &&\n css`\n * {\n scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);\n scrollbar-width: thin;\n }\n\n @supports not ((scrollbar-width: thin) or (scrollbar-color: black white)) {\n /* stylelint-disable unit-allowed-list */\n\n *::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n *::-webkit-scrollbar-track {\n background-color: rgba(0, 0, 0, 0.2);\n }\n\n *::-webkit-scrollbar-corner {\n background-color: rgba(0, 0, 0, 0.2);\n border-bottom-right-radius: inherit;\n }\n\n *::-webkit-scrollbar-thumb {\n background-color: transparent;\n border: 3px solid transparent;\n border-radius: calc(1.125 * ${borderRadius});\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.6);\n }\n\n *::-webkit-scrollbar-thumb:hover {\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.7);\n }\n\n *::-webkit-scrollbar-track:horizontal {\n border-bottom-left-radius: inherit;\n }\n\n *::-webkit-scrollbar-track:vertical {\n border-top-right-radius: inherit;\n }\n\n /* stylelint-disable-next-line selector-pseudo-class-no-unknown */\n *::-webkit-scrollbar-track:not(:corner-present) {\n border-bottom-right-radius: inherit;\n }\n\n /* stylelint-enable unit-allowed-list */\n }\n `}\n\n @media (pointer: coarse) {\n height: calc(100vh - 8rem);\n }\n\n @media (min-width: ${breakpoints.md}) {\n height: calc(100vh - 3rem);\n }\n `;\n }\n);\n\nStyledNav.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellCaretIcon = styled(Icon)<{ nestedListCollapsed?: boolean }>(\n ({ nestedListCollapsed, theme }) => {\n const { rtl } = useDirection();\n\n return css`\n transition-property: transform;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${nestedListCollapsed === false &&\n css`\n transform: rotateZ(${rtl ? '-90deg' : '90deg'});\n `}\n `;\n }\n);\n\nStyledAppShellCaretIcon.defaultProps = defaultThemeProp;\n\nexport const StyledNavListItem = styled.li<{ activeTreeRoot?: boolean }>(\n ({ activeTreeRoot, theme }) => {\n const { navOpen } = useContext(AppShellContext);\n const activeBackground = tryCatch(() =>\n rgba('#000000', theme.base.transparency['transparent-4'])\n );\n\n return css`\n display: block;\n position: relative;\n ${StyledIcon} {\n font-size: 1.25rem;\n }\n\n > :first-child {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n padding: calc(1.25 * ${theme.base.spacing}) 0;\n white-space: nowrap;\n color: rgba(255, 255, 255, 0.7);\n cursor: pointer;\n font-weight: ${theme.base['font-weight']['semi-bold']};\n text-decoration: none;\n\n span {\n overflow: hidden;\n color: inherit;\n }\n\n &:hover,\n &:focus {\n color: ${theme.base.palette.light};\n background: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${activeTreeRoot &&\n css`\n color: ${theme.base.colors.blue.light};\n background-color: ${activeBackground};\n `}\n\n ${StyledAppShellCaretIcon}:last-child {\n position: absolute;\n left: ${navOpen ? 'auto' : '100%'};\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n `}\n margin: 0;\n opacity: ${navOpen ? '1' : '0'};\n transition-property: opacity;\n }\n\n ${StyledIcon}:first-child {\n margin: 0 calc((${navWidth} - 1.125rem) / 2);\n }\n }\n\n &[aria-current='page'] > :first-child,\n &[aria-current='true'] > :first-child {\n color: ${theme.base.colors.blue.light};\n background-color: ${activeBackground};\n }\n `;\n }\n);\n\nStyledNavListItem.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.ul``;\n"]}
|
|
1
|
+
{"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,IAAI,EACL,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,iEAAiE,CAAC;AAEzE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,QAAQ,GAAG,MAAM,CAAC;AACxB,MAAM,YAAY,GAAG,OAAO,CAAC;AAE7B,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClD,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE,CAChC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CACpE,CAAC;IAEF,OAAO,GAAG,CAAA;qBACS,KAAK,CAAC,IAAI,CAAC,OAAO;0CACG,WAAW;GAClD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,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,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;4BACjB,gBAAgB;;KAEvC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { lighten, rgba } from 'polished';\nimport { useContext } from 'react';\n\nimport {\n tryCatch,\n defaultThemeProp,\n Button,\n StyledIcon,\n useDirection,\n calculateFontSize,\n Icon\n} from '@pega/cosmos-react-core';\nimport {\n StyledToggleIcon,\n StyledNodeText,\n StyledNodeInteraction,\n StyledStandardTree\n} from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';\n\nimport AppShellContext from './AppShellContext';\n\nconst navWidth = '3rem';\nconst navOpenWidth = '14rem';\n\nexport const StyledUtils = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n padding-block: ${theme.base.spacing};\n border-block-start: 0.0625rem solid ${borderColor};\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellToggleButton = styled(Button)(({ theme }) => {\n return css`\n background-color: ${theme.base.palette.dark};\n color: ${theme.base.palette.light};\n border: none;\n\n ${StyledIcon} {\n width: 1.25rem;\n height: 1.25rem;\n font-weight: bold;\n }\n\n &:enabled:focus,\n :not([disabled]):focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledAppShellToggleButton.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(() => {\n return css`\n height: 100%;\n overflow-y: auto;\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledMain = styled.main<{\n navOpen: boolean;\n hideNav: boolean;\n}>(\n ({\n navOpen,\n hideNav,\n theme: {\n base: { animation, breakpoints, palette }\n }\n }) => {\n return css`\n position: relative;\n min-height: calc(100vh - 6rem);\n background-color: ${palette['app-background']};\n margin-inline-start: ${navWidth};\n transition: margin-inline-start ${`${animation.speed} ${animation.timing.ease}`};\n\n @media (pointer: coarse) {\n min-height: calc(100vh - 8rem);\n }\n\n @media (min-width: ${breakpoints.md}) {\n min-height: calc(100vh - 3rem);\n }\n\n ${navOpen &&\n css`\n margin-inline-start: ${navOpenWidth};\n `}\n\n ${hideNav &&\n css`\n transition-duration: 0s;\n margin-inline-start: 0;\n `}\n `;\n }\n);\n\nStyledMain.defaultProps = defaultThemeProp;\n\nexport const StyledNav = styled.nav(\n ({\n theme: {\n base: {\n breakpoints,\n colors,\n palette,\n animation,\n spacing,\n shadow,\n 'custom-scrollbar': customScrollbar,\n 'border-radius': borderRadius,\n 'font-size': fontSize,\n 'font-scale': fontScale\n },\n components: { 'app-shell': appShell }\n }\n }) => {\n const { navState } = useContext(AppShellContext);\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n position: fixed;\n z-index: 1;\n height: calc(100vh - 6rem);\n background: ${appShell.nav['background-color']};\n width: ${navState === 'opening' || navState === 'open' ? navOpenWidth : navWidth};\n transition: width ${animation.speed} ${animation.timing.ease};\n display: flex;\n\n ${StyledStandardTree} {\n background-color: ${palette.dark};\n\n ${StyledNodeText}, ${StyledToggleIcon} {\n color: rgba(255, 255, 255, 0.7);\n font-size: ${fontSizes.s};\n }\n\n ${StyledNodeInteraction} {\n padding-block-start: calc(0.5 * ${spacing});\n padding-block-end: calc(0.5 * ${spacing});\n\n &:hover {\n background: rgba(255, 255, 255, 0.1);\n\n ${StyledNodeText} {\n color: ${palette.light};\n }\n }\n\n &:focus {\n box-shadow: ${shadow['focus-inset']};\n }\n\n &[aria-current='page'],\n &[aria-current='true'] {\n background: rgba(255, 255, 255, 0.05);\n\n ${StyledNodeText} {\n color: ${colors.blue.light};\n }\n }\n }\n\n &:has(:focus-visible) {\n box-shadow: inset 0 0 0 0.125rem #71c1ff99;\n }\n }\n\n ${customScrollbar &&\n css`\n * {\n scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);\n scrollbar-width: thin;\n }\n\n @supports not ((scrollbar-width: thin) or (scrollbar-color: black white)) {\n /* stylelint-disable unit-allowed-list */\n\n *::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n *::-webkit-scrollbar-track {\n background-color: rgba(0, 0, 0, 0.2);\n }\n\n *::-webkit-scrollbar-corner {\n background-color: rgba(0, 0, 0, 0.2);\n border-bottom-right-radius: inherit;\n }\n\n *::-webkit-scrollbar-thumb {\n background-color: transparent;\n border: 3px solid transparent;\n border-radius: calc(1.125 * ${borderRadius});\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.6);\n }\n\n *::-webkit-scrollbar-thumb:hover {\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.7);\n }\n\n *::-webkit-scrollbar-track:horizontal {\n border-bottom-left-radius: inherit;\n }\n\n *::-webkit-scrollbar-track:vertical {\n border-top-right-radius: inherit;\n }\n\n /* stylelint-disable-next-line selector-pseudo-class-no-unknown */\n *::-webkit-scrollbar-track:not(:corner-present) {\n border-bottom-right-radius: inherit;\n }\n\n /* stylelint-enable unit-allowed-list */\n }\n `}\n\n @media (pointer: coarse) {\n height: calc(100vh - 8rem);\n }\n\n @media (min-width: ${breakpoints.md}) {\n height: calc(100vh - 3rem);\n }\n `;\n }\n);\n\nStyledNav.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellCaretIcon = styled(Icon)<{ nestedListCollapsed?: boolean }>(({\n nestedListCollapsed,\n theme\n}) => {\n const { rtl } = useDirection();\n\n return css`\n transition-property: transform;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${nestedListCollapsed === false &&\n css`\n transform: rotateZ(${rtl ? '-90deg' : '90deg'});\n `}\n `;\n});\n\nStyledAppShellCaretIcon.defaultProps = defaultThemeProp;\n\nexport const StyledNavListItem = styled.li<{ activeTreeRoot?: boolean }>(\n ({ activeTreeRoot, theme }) => {\n const { navOpen } = useContext(AppShellContext);\n const activeBackground = tryCatch(() =>\n rgba('#000000', theme.base.transparency['transparent-4'])\n );\n\n return css`\n display: block;\n position: relative;\n ${StyledIcon} {\n font-size: 1.25rem;\n }\n\n > :first-child {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n padding: calc(1.25 * ${theme.base.spacing}) 0;\n white-space: nowrap;\n color: rgba(255, 255, 255, 0.7);\n cursor: pointer;\n font-weight: ${theme.base['font-weight']['semi-bold']};\n text-decoration: none;\n\n span {\n overflow: hidden;\n color: inherit;\n }\n\n &:hover,\n &:focus {\n color: ${theme.base.palette.light};\n background: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${activeTreeRoot &&\n css`\n color: ${theme.base.colors.blue.light};\n background-color: ${activeBackground};\n `}\n\n ${StyledAppShellCaretIcon}:last-child {\n position: absolute;\n left: ${navOpen ? 'auto' : '100%'};\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n `}\n margin: 0;\n opacity: ${navOpen ? '1' : '0'};\n transition-property: opacity;\n }\n\n ${StyledIcon}:first-child {\n margin: 0 calc((${navWidth} - 1.125rem) / 2);\n }\n }\n\n &[aria-current='page'] > :first-child,\n &[aria-current='true'] > :first-child {\n color: ${theme.base.colors.blue.light};\n background-color: ${activeBackground};\n }\n `;\n }\n);\n\nStyledNavListItem.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.ul``;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.styles.ts"],"names":[],"mappings":";AAEA,OAAO,EAAoB,IAAI,EAAE,IAAI,EAAuB,MAAM,yBAAyB,CAAC;AAI5F,eAAO,MAAM,eAAe,4GA8B3B,CAAC;AAIF,eAAO,MAAM,oBAAoB,yGAkBhC,CAAC;AAIF,eAAO,MAAM,iBAAiB,0QAa5B,CAAC;AAIH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"AppHeader.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.styles.ts"],"names":[],"mappings":";AAEA,OAAO,EAAoB,IAAI,EAAE,IAAI,EAAuB,MAAM,yBAAyB,CAAC;AAI5F,eAAO,MAAM,eAAe,4GA8B3B,CAAC;AAIF,eAAO,MAAM,oBAAoB,yGAkBhC,CAAC;AAIF,eAAO,MAAM,iBAAiB,0QAa5B,CAAC;AAIH,eAAO,MAAM,gBAAgB,oOAc3B,CAAC;AAEH,eAAO,MAAM,aAAa,0GAIzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAAO,IA4B9B,CAAC;AAIH,eAAO,MAAM,qBAAqB,yGA0BjC,CAAC;AAIF,eAAO,MAAM,oBAAoB,yGAmBhC,CAAC;AAIF,eAAO,MAAM,aAAa,EAAE,OAAO,IAUjC,CAAC;AAIH,eAAO,MAAM,gBAAgB,EAAE,OAAO,IAKpC,CAAC"}
|
|
@@ -59,14 +59,14 @@ export const StyledBrandButton = styled(BareButton)(({ theme }) => {
|
|
|
59
59
|
StyledBrandButton.defaultProps = defaultThemeProp;
|
|
60
60
|
export const StyledBrandImage = styled(Image)(({ theme: { base: { breakpoints } } }) => {
|
|
61
61
|
return css `
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
height: 1.5rem;
|
|
63
|
+
max-width: 17ch;
|
|
64
|
+
display: none;
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
@media (min-width: ${breakpoints.sm}) {
|
|
67
|
+
display: unset;
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
70
|
});
|
|
71
71
|
export const StyledContext = styled.span `
|
|
72
72
|
overflow: hidden;
|
|
@@ -75,28 +75,28 @@ export const StyledContext = styled.span `
|
|
|
75
75
|
`;
|
|
76
76
|
export const StyledTabs = styled(Tabs)(({ theme: { base: { breakpoints, 'font-weight': fontWeight } } }) => {
|
|
77
77
|
return css `
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
[role='tab'][aria-selected='false'] > span {
|
|
88
|
-
font-weight: ${fontWeight['semi-bold']};
|
|
89
|
-
}
|
|
90
|
-
[role='tab']:hover,
|
|
91
|
-
[role='tab']:focus,
|
|
92
|
-
[role='tab']:active {
|
|
93
|
-
box-shadow: none;
|
|
78
|
+
display: none;
|
|
79
|
+
border: none;
|
|
80
|
+
min-height: 3rem;
|
|
81
|
+
[role='tab'] {
|
|
82
|
+
height: auto;
|
|
83
|
+
span:first-of-type {
|
|
84
|
+
text-transform: none;
|
|
94
85
|
}
|
|
86
|
+
}
|
|
87
|
+
[role='tab'][aria-selected='false'] > span {
|
|
88
|
+
font-weight: ${fontWeight['semi-bold']};
|
|
89
|
+
}
|
|
90
|
+
[role='tab']:hover,
|
|
91
|
+
[role='tab']:focus,
|
|
92
|
+
[role='tab']:active {
|
|
93
|
+
box-shadow: none;
|
|
94
|
+
}
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
@media (min-width: ${breakpoints.md}) {
|
|
97
|
+
display: inherit;
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
100
|
});
|
|
101
101
|
StyledTabs.defaultProps = defaultThemeProp;
|
|
102
102
|
export const StyledAppHeaderSearch = styled.div(({ theme: { base: { spacing, breakpoints, 'content-width': contentWidth } } }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.styles.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE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AAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, Text, Tabs, Image, StyledButton } from '@pega/cosmos-react-core';\nimport { StyledAppHeaderSearchForm } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nexport const StyledAppHeader = styled.header(\n ({\n theme: {\n base: { palette, breakpoints, 'z-index': zIndex }\n }\n }) => {\n return css`\n height: 6rem;\n border-bottom: 0.0625rem solid ${palette['border-line']};\n background-color: ${palette['primary-background']};\n position: sticky;\n top: 0;\n z-index: calc(${zIndex.drawer + 1});\n & > div {\n height: 50%;\n }\n\n @media (pointer: coarse) {\n height: 8rem;\n }\n\n @media (min-width: ${breakpoints.md}) {\n height: 3rem;\n\n & > div {\n height: 100%;\n }\n }\n `;\n }\n);\n\nStyledAppHeader.defaultProps = defaultThemeProp;\n\nexport const StyledBrandContainer = styled.div(\n ({\n theme: {\n base: { 'hit-area': hitArea, breakpoints, spacing }\n }\n }) => {\n return css`\n max-width: calc(100% - calc(3 * ${hitArea.mouse}));\n\n @media (min-width: ${breakpoints.xs}) and (pointer: coarse) {\n max-width: calc(100% - calc(3 * ${hitArea.mouse}) - calc(2 * ${spacing}));\n }\n\n @media (min-width: ${breakpoints.md}) {\n max-width: 30%;\n }\n `;\n }\n);\n\nStyledBrandContainer.defaultProps = defaultThemeProp;\n\nexport const StyledBrandButton = styled(BareButton)(({ theme }) => {\n return css`\n text-decoration: none;\n min-width: 0;\n\n & > div:last-child {\n min-width: 0;\n }\n\n &:not([disabled]):focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledBrandButton.defaultProps = defaultThemeProp;\n\nexport const StyledBrandImage = styled(Image)(({\n theme: {\n base: { breakpoints }\n }\n}) => {\n return css`\n height: 1.5rem;\n max-width: 17ch;\n display: none;\n\n @media (min-width: ${breakpoints.sm}) {\n display: unset;\n }\n `;\n});\n\nexport const StyledContext = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nexport const StyledTabs: typeof Tabs = styled(Tabs)(({\n theme: {\n base: { breakpoints, 'font-weight': fontWeight }\n }\n}) => {\n return css`\n display: none;\n border: none;\n min-height: 3rem;\n [role='tab'] {\n height: auto;\n span:first-of-type {\n text-transform: none;\n }\n }\n [role='tab'][aria-selected='false'] > span {\n font-weight: ${fontWeight['semi-bold']};\n }\n [role='tab']:hover,\n [role='tab']:focus,\n [role='tab']:active {\n box-shadow: none;\n }\n\n @media (min-width: ${breakpoints.md}) {\n display: inherit;\n }\n `;\n});\n\nStyledTabs.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderSearch = styled.div(\n ({\n theme: {\n base: { spacing, breakpoints, 'content-width': contentWidth }\n }\n }) => {\n return css`\n padding-block: ${spacing};\n width: 100%;\n ${StyledAppHeaderSearchForm} {\n margin-inline-start: 0;\n max-width: 100%;\n }\n\n @media (min-width: ${breakpoints.md}) {\n ${StyledAppHeaderSearchForm} {\n margin-inline-start: auto;\n max-width: ${contentWidth.lg};\n }\n\n ${StyledButton} {\n display: none;\n }\n }\n `;\n }\n);\n\nStyledAppHeaderSearch.defaultProps = defaultThemeProp;\n\nexport const StyledUtilsContainer = styled.div(\n ({\n theme: {\n base: { spacing, breakpoints }\n }\n }) => {\n return css`\n width: 100%;\n & > div,\n & > span,\n & > button {\n margin-inline-start: ${spacing};\n }\n\n @media (min-width: ${breakpoints.md}) {\n width: auto;\n }\n `;\n }\n);\n\nStyledUtilsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledAppName: typeof Text = styled(Text)(({ theme }) => {\n return css`\n max-width: ${theme.base['content-width'].sm};\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ${theme.base.palette['foreground-color']};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n margin-inline-start: 0;\n `;\n});\n\nStyledAppName.defaultProps = defaultThemeProp;\n\nexport const StyledAppVersion: typeof Text = styled(Text)(({ theme }) => {\n return css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n margin-inline-start: 0;\n `;\n});\n\nStyledAppVersion.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BranchButton.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/BranchButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EACL,MAAM,EAcP,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAQlF,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC;IAChE,6CAA6C;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,KAAK,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAC/B,iCAAiC;IACjC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,kBAAkB,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"BranchButton.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/BranchButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EACL,MAAM,EAcP,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAQlF,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC;IAChE,6CAA6C;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,KAAK,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAC/B,iCAAiC;IACjC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,kBAAkB,EAAE,OAAO,MAqDtC,CAAC;AAmBH,eAAO,MAAM,cAAc,8JAIzB,CAAC;AAgBH,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAoEtD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -15,36 +15,36 @@ export const StyledBranchButton = styled(Button)(({ theme, branchVariant }) => {
|
|
|
15
15
|
const countColor = branchVariant === 'success' ? colors.white : foreground;
|
|
16
16
|
const buttonColor = tryCatch(() => readableColor(backgroundColor));
|
|
17
17
|
return css `
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
flex-shrink: 0;
|
|
19
|
+
background-color: ${backgroundColor};
|
|
20
|
+
border-color: ${borderColor};
|
|
21
|
+
color: ${buttonColor};
|
|
22
|
+
padding-inline-start: ${spacing};
|
|
23
|
+
padding-inline-end: ${spacing};
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
&:hover {
|
|
26
|
+
background-color: ${backgroundColor};
|
|
27
|
+
box-shadow: ${focus};
|
|
28
|
+
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
svg {
|
|
31
|
+
height: 1rem;
|
|
32
|
+
width: 1rem;
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
${StyledCount} {
|
|
36
|
+
background-color: ${countBgColor};
|
|
37
|
+
color: ${countColor};
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
40
|
});
|
|
41
41
|
StyledBranchButton.defaultProps = defaultThemeProp;
|
|
42
42
|
const StyledBranchButtonPopover = styled(Popover)(({ theme: { base: { spacing, 'content-width': contentWidth } } }) => {
|
|
43
43
|
const minWidth = `calc(${contentWidth.xs} + (2 * ${spacing}))`;
|
|
44
44
|
return css `
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
min-width: ${minWidth};
|
|
46
|
+
max-width: calc(${minWidth} + 5ch);
|
|
47
|
+
`;
|
|
48
48
|
});
|
|
49
49
|
StyledBranchButtonPopover.defaultProps = defaultThemeProp;
|
|
50
50
|
export const StyledWarnIcon = styled(Icon)(({ theme }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BranchButton.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/BranchButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,aAAa,EACb,OAAO,EACP,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,kBAAkB,MAAM,yEAAyE,CAAC;AAC9G,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AACnG,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE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AE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,aAC/D,KAAC,IAAI,IAAC,IAAI,EAAC,kBAAkB,GAAG,EAC/B,CAAC,OAAO,IAAI,CACX,8BACE,KAAC,oBAAoB,cAAE,IAAI,GAAwB,EAClD,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CACtB,KAAC,cAAc,IAAC,IAAI,EAAC,YAAY,GAAG,CACrC,CAAC,CAAC,CAAC,CACF,KAAK,KAAK,SAAS,IAAI,KAAC,KAAK,cAAE,KAAK,GAAS,CAC9C,IACA,CACJ,EACD,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,IACrB,GACY,EACrB,KAAC,yBAAyB,IACxB,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EAC9C,EAAE,EAAC,gBAAgB,EACnB,kBAAkB,QAClB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,QAAQ,EAChB,GAAG,EAAE,aAAa,YAElB,KAAC,IAAI,IACH,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,EAAE,EACZ,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EACjC,cAAc,EAAE,QAAQ,IAAI,SAAS,GACrC,GACwB,IAC3B,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { useState } from 'react';\nimport type { FunctionComponent, KeyboardEvent } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\n\nimport {\n Button,\n defaultThemeProp,\n Flex,\n Icon,\n Menu,\n Count,\n Popover,\n readableColor,\n useDirection,\n useElement,\n registerIcon,\n useOuterEvent,\n useI18n,\n tryCatch\n} from '@pega/cosmos-react-core';\nimport type { CountProps, MenuProps, StatusProps } from '@pega/cosmos-react-core';\nimport * as nodesDownSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/nodes-down-solid.icon';\nimport * as warnSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/warn-solid.icon';\nimport * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\nimport { StyledCount } from '@pega/cosmos-react-core/lib/components/Badges/Count';\n\nregisterIcon(nodesDownSolidIcon, warnSolidIcon, caretDownIcon);\n\nexport interface BranchButtonProps {\n /** The text for the BranchButton also used to set the aria-label. */\n text: string;\n /** Determines the variant for the BranchButton. */\n variant?: Extract<StatusProps['variant'], 'success' | 'urgent'>;\n /** Only display the branch and caret icon */\n compact?: boolean;\n /** The total count representing the number of unmerged changes. */\n count?: CountProps['children'];\n /** An array of MenuItemProps. */\n items: MenuProps['items'];\n}\n\nexport const StyledBranchButton: typeof Button = styled(Button)(\n ({\n theme,\n branchVariant\n }: {\n theme: DefaultTheme;\n branchVariant: BranchButtonProps['variant'];\n }) => {\n const {\n base: {\n colors,\n palette: { 'primary-background': primaryBackground },\n shadow: { focus },\n spacing\n },\n components: {\n badges: {\n status,\n count: {\n default: { background, foreground }\n }\n }\n }\n } = theme;\n\n const backgroundColor = branchVariant ? status[branchVariant].background : primaryBackground;\n const borderColor = !branchVariant ? colors.gray.medium : 'transparent';\n const countBgColor = branchVariant === 'success' ? colors.green.medium : background;\n const countColor = branchVariant === 'success' ? colors.white : foreground;\n const buttonColor = tryCatch(() => readableColor(backgroundColor));\n\n return css`\n flex-shrink: 0;\n background-color: ${backgroundColor};\n border-color: ${borderColor};\n color: ${buttonColor};\n padding-inline-start: ${spacing};\n padding-inline-end: ${spacing};\n\n &:hover {\n background-color: ${backgroundColor};\n box-shadow: ${focus};\n }\n\n svg {\n height: 1rem;\n width: 1rem;\n }\n\n ${StyledCount} {\n background-color: ${countBgColor};\n color: ${countColor};\n }\n `;\n }\n);\n\nStyledBranchButton.defaultProps = defaultThemeProp;\n\nconst StyledBranchButtonPopover = styled(Popover)(\n ({\n theme: {\n base: { spacing, 'content-width': contentWidth }\n }\n }) => {\n const minWidth = `calc(${contentWidth.xs} + (2 * ${spacing}))`;\n\n return css`\n min-width: ${minWidth};\n max-width: calc(${minWidth} + 5ch);\n `;\n }\n);\n\nStyledBranchButtonPopover.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.colors.red.medium};\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nconst StyledEllipsizedText = styled.span(({ theme }) => {\n return css`\n max-width: ${theme.base['content-width'].xs};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.5;\n `;\n});\n\nStyledEllipsizedText.defaultProps = defaultThemeProp;\n\nconst BranchButton: FunctionComponent<BranchButtonProps> = (props: BranchButtonProps) => {\n const { text, variant, count, compact = false, items = [] } = props;\n\n const [open, setOpen] = useState(false);\n\n const [popoverEl, setPopoverRef] = useElement<HTMLElement>();\n const [buttonEl, setButtonEl] = useElement<HTMLElement>();\n const { rtl } = useDirection();\n const t = useI18n();\n\n useOuterEvent('mousedown', [popoverEl, buttonEl], () => {\n if (open) setOpen(false);\n });\n\n let ariaLabel = t('branch_with_no_changes', [text]);\n if (variant === 'success') {\n ariaLabel = t('branch_with_no_potential_conflicts', [text, count ?? 0]);\n } else if (variant === 'urgent') {\n ariaLabel = t('branch_with_potential_conflicts', [text]);\n }\n\n return (\n <>\n <StyledBranchButton\n ref={setButtonEl}\n aria-expanded={open}\n aria-haspopup='menu'\n aria-controls='branch-popover'\n aria-label={ariaLabel}\n branchVariant={variant}\n label={!open && compact ? text : undefined}\n onClick={() => setOpen(cur => !cur)}\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'Escape') setOpen(false);\n }}\n >\n <Flex container={{ alignItems: 'center', gap: compact ? 1 : 0.5 }}>\n <Icon name='nodes-down-solid' />\n {!compact && (\n <>\n <StyledEllipsizedText>{text}</StyledEllipsizedText>\n {variant === 'urgent' ? (\n <StyledWarnIcon name='warn-solid' />\n ) : (\n count !== undefined && <Count>{count}</Count>\n )}\n </>\n )}\n <Icon name='caret-down' />\n </Flex>\n </StyledBranchButton>\n <StyledBranchButtonPopover\n placement={rtl ? 'bottom-end' : 'bottom-start'}\n id='branch-popover'\n hideOnTargetHidden\n show={open}\n target={buttonEl}\n ref={setPopoverRef}\n >\n <Menu\n items={items}\n scrollAt={20}\n onItemClick={() => setOpen(false)}\n focusControlEl={buttonEl || undefined}\n />\n </StyledBranchButtonPopover>\n </>\n );\n};\n\nexport default BranchButton;\n"]}
|
|
1
|
+
{"version":3,"file":"BranchButton.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/BranchButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,aAAa,EACb,OAAO,EACP,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,kBAAkB,MAAM,yEAAyE,CAAC;AAC9G,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AACnG,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAElF,YAAY,CAAC,kBAAkB,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;AAe/D,MAAM,CAAC,MAAM,kBAAkB,GAAkB,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAC/D,KAAK,EACL,aAAa,EAId,EAAE,EAAE;IACH,MAAM,EACJ,IAAI,EAAE,EACJ,MAAM,EACN,OAAO,EAAE,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,EACpD,MAAM,EAAE,EAAE,KAAK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K,KAAK,SAAS,IAAI,KAAC,KAAK,cAAE,KAAK,GAAS,CAC9C,IACA,CACJ,EACD,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,IACrB,GACY,EACrB,KAAC,yBAAyB,IACxB,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EAC9C,EAAE,EAAC,gBAAgB,EACnB,kBAAkB,QAClB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,QAAQ,EAChB,GAAG,EAAE,aAAa,YAElB,KAAC,IAAI,IACH,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,EAAE,EACZ,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EACjC,cAAc,EAAE,QAAQ,IAAI,SAAS,GACrC,GACwB,IAC3B,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { useState } from 'react';\nimport type { FunctionComponent, KeyboardEvent } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\n\nimport {\n Button,\n defaultThemeProp,\n Flex,\n Icon,\n Menu,\n Count,\n Popover,\n readableColor,\n useDirection,\n useElement,\n registerIcon,\n useOuterEvent,\n useI18n,\n tryCatch\n} from '@pega/cosmos-react-core';\nimport type { CountProps, MenuProps, StatusProps } from '@pega/cosmos-react-core';\nimport * as nodesDownSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/nodes-down-solid.icon';\nimport * as warnSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/warn-solid.icon';\nimport * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\nimport { StyledCount } from '@pega/cosmos-react-core/lib/components/Badges/Count';\n\nregisterIcon(nodesDownSolidIcon, warnSolidIcon, caretDownIcon);\n\nexport interface BranchButtonProps {\n /** The text for the BranchButton also used to set the aria-label. */\n text: string;\n /** Determines the variant for the BranchButton. */\n variant?: Extract<StatusProps['variant'], 'success' | 'urgent'>;\n /** Only display the branch and caret icon */\n compact?: boolean;\n /** The total count representing the number of unmerged changes. */\n count?: CountProps['children'];\n /** An array of MenuItemProps. */\n items: MenuProps['items'];\n}\n\nexport const StyledBranchButton: typeof Button = styled(Button)(({\n theme,\n branchVariant\n}: {\n theme: DefaultTheme;\n branchVariant: BranchButtonProps['variant'];\n}) => {\n const {\n base: {\n colors,\n palette: { 'primary-background': primaryBackground },\n shadow: { focus },\n spacing\n },\n components: {\n badges: {\n status,\n count: {\n default: { background, foreground }\n }\n }\n }\n } = theme;\n\n const backgroundColor = branchVariant ? status[branchVariant].background : primaryBackground;\n const borderColor = !branchVariant ? colors.gray.medium : 'transparent';\n const countBgColor = branchVariant === 'success' ? colors.green.medium : background;\n const countColor = branchVariant === 'success' ? colors.white : foreground;\n const buttonColor = tryCatch(() => readableColor(backgroundColor));\n\n return css`\n flex-shrink: 0;\n background-color: ${backgroundColor};\n border-color: ${borderColor};\n color: ${buttonColor};\n padding-inline-start: ${spacing};\n padding-inline-end: ${spacing};\n\n &:hover {\n background-color: ${backgroundColor};\n box-shadow: ${focus};\n }\n\n svg {\n height: 1rem;\n width: 1rem;\n }\n\n ${StyledCount} {\n background-color: ${countBgColor};\n color: ${countColor};\n }\n `;\n});\n\nStyledBranchButton.defaultProps = defaultThemeProp;\n\nconst StyledBranchButtonPopover = styled(Popover)(({\n theme: {\n base: { spacing, 'content-width': contentWidth }\n }\n}) => {\n const minWidth = `calc(${contentWidth.xs} + (2 * ${spacing}))`;\n\n return css`\n min-width: ${minWidth};\n max-width: calc(${minWidth} + 5ch);\n `;\n});\n\nStyledBranchButtonPopover.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.colors.red.medium};\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nconst StyledEllipsizedText = styled.span(({ theme }) => {\n return css`\n max-width: ${theme.base['content-width'].xs};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.5;\n `;\n});\n\nStyledEllipsizedText.defaultProps = defaultThemeProp;\n\nconst BranchButton: FunctionComponent<BranchButtonProps> = (props: BranchButtonProps) => {\n const { text, variant, count, compact = false, items = [] } = props;\n\n const [open, setOpen] = useState(false);\n\n const [popoverEl, setPopoverRef] = useElement<HTMLElement>();\n const [buttonEl, setButtonEl] = useElement<HTMLElement>();\n const { rtl } = useDirection();\n const t = useI18n();\n\n useOuterEvent('mousedown', [popoverEl, buttonEl], () => {\n if (open) setOpen(false);\n });\n\n let ariaLabel = t('branch_with_no_changes', [text]);\n if (variant === 'success') {\n ariaLabel = t('branch_with_no_potential_conflicts', [text, count ?? 0]);\n } else if (variant === 'urgent') {\n ariaLabel = t('branch_with_potential_conflicts', [text]);\n }\n\n return (\n <>\n <StyledBranchButton\n ref={setButtonEl}\n aria-expanded={open}\n aria-haspopup='menu'\n aria-controls='branch-popover'\n aria-label={ariaLabel}\n branchVariant={variant}\n label={!open && compact ? text : undefined}\n onClick={() => setOpen(cur => !cur)}\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'Escape') setOpen(false);\n }}\n >\n <Flex container={{ alignItems: 'center', gap: compact ? 1 : 0.5 }}>\n <Icon name='nodes-down-solid' />\n {!compact && (\n <>\n <StyledEllipsizedText>{text}</StyledEllipsizedText>\n {variant === 'urgent' ? (\n <StyledWarnIcon name='warn-solid' />\n ) : (\n count !== undefined && <Count>{count}</Count>\n )}\n </>\n )}\n <Icon name='caret-down' />\n </Flex>\n </StyledBranchButton>\n <StyledBranchButtonPopover\n placement={rtl ? 'bottom-end' : 'bottom-start'}\n id='branch-popover'\n hideOnTargetHidden\n show={open}\n target={buttonEl}\n ref={setPopoverRef}\n >\n <Menu\n items={items}\n scrollAt={20}\n onItemClick={() => setOpen(false)}\n focusControlEl={buttonEl || undefined}\n />\n </StyledBranchButtonPopover>\n </>\n );\n};\n\nexport default BranchButton;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { ConstantProps } from './DynamicInput.types';
|
|
3
|
+
type BooleanControlProps = Pick<ConstantProps, 'booleanLabels' | 'value' | 'onChange'> & {
|
|
4
|
+
id: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const BooleanControl: FC<BooleanControlProps>;
|
|
8
|
+
export default BooleanControl;
|
|
9
|
+
//# sourceMappingURL=BooleanControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BooleanControl.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/BooleanControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,KAAK,mBAAmB,GAAG,IAAI,CAAC,aAAa,EAAE,eAAe,GAAG,OAAO,GAAG,UAAU,CAAC,GAAG;IACvF,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAqC3C,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ComboBox, useI18n } from '@pega/cosmos-react-core';
|
|
3
|
+
const BooleanControl = ({ booleanLabels, value, onChange, id, required, ...restProps }) => {
|
|
4
|
+
const t = useI18n();
|
|
5
|
+
const primaries = booleanLabels === 'always|never' ? [t('always'), t('never')] : [t('true'), t('false')];
|
|
6
|
+
const items = [
|
|
7
|
+
{ id: 'true', primary: primaries[0], selected: value === true },
|
|
8
|
+
{ id: 'false', primary: primaries[1], selected: !value }
|
|
9
|
+
];
|
|
10
|
+
return (_jsx(ComboBox, { ...restProps, selected: {
|
|
11
|
+
items: {
|
|
12
|
+
id: value === true ? items[0].id : items[1].id,
|
|
13
|
+
text: value === true ? items[0].primary : items[1].primary
|
|
14
|
+
}
|
|
15
|
+
}, menu: {
|
|
16
|
+
mode: 'single-select',
|
|
17
|
+
items,
|
|
18
|
+
onItemClick: itemId => {
|
|
19
|
+
onChange(itemId === 'true');
|
|
20
|
+
}
|
|
21
|
+
}, id: id, required: required }));
|
|
22
|
+
};
|
|
23
|
+
export default BooleanControl;
|
|
24
|
+
//# sourceMappingURL=BooleanControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BooleanControl.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/BooleanControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAS5D,MAAM,cAAc,GAA4B,CAAC,EAC/C,aAAa,EACb,KAAK,EACL,QAAQ,EACR,EAAE,EACF,QAAQ,EACR,GAAG,SAAS,EACQ,EAAE,EAAE;IACxB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,SAAS,GACb,aAAa,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAEzF,MAAM,KAAK,GAAG;QACZ,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,KAAK,IAAI,EAAE;QAC/D,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE;KACzD,CAAC;IAEF,OAAO,CACL,KAAC,QAAQ,OACH,SAAS,EACb,QAAQ,EAAE;YACR,KAAK,EAAE;gBACL,EAAE,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC9C,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO;aAC3D;SACF,EACD,IAAI,EAAE;YACJ,IAAI,EAAE,eAAe;YACrB,KAAK;YACL,WAAW,EAAE,MAAM,CAAC,EAAE;gBACpB,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;YAC9B,CAAC;SACF,EACD,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import type { FC } from 'react';\n\nimport { ComboBox, useI18n } from '@pega/cosmos-react-core';\n\nimport type { ConstantProps } from './DynamicInput.types';\n\ntype BooleanControlProps = Pick<ConstantProps, 'booleanLabels' | 'value' | 'onChange'> & {\n id: string;\n required?: boolean;\n};\n\nconst BooleanControl: FC<BooleanControlProps> = ({\n booleanLabels,\n value,\n onChange,\n id,\n required,\n ...restProps\n}: BooleanControlProps) => {\n const t = useI18n();\n const primaries =\n booleanLabels === 'always|never' ? [t('always'), t('never')] : [t('true'), t('false')];\n\n const items = [\n { id: 'true', primary: primaries[0], selected: value === true },\n { id: 'false', primary: primaries[1], selected: !value }\n ];\n\n return (\n <ComboBox\n {...restProps}\n selected={{\n items: {\n id: value === true ? items[0].id : items[1].id,\n text: value === true ? items[0].primary : items[1].primary\n }\n }}\n menu={{\n mode: 'single-select',\n items,\n onItemClick: itemId => {\n onChange(itemId === 'true');\n }\n }}\n id={id}\n required={required}\n />\n );\n};\n\nexport default BooleanControl;\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { DynamicInputProps } from './DynamicInput.types';
|
|
3
|
+
declare const _default: FC<DynamicInputProps> & {
|
|
4
|
+
getTestIds: (testIdProp?: string | null | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["field", "menu", "control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=DynamicInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicInput.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,EAAE,EAAmB,MAAM,OAAO,CAAC;AAwB9D,OAAO,KAAK,EAAE,iBAAiB,EAAU,MAAM,sBAAsB,CAAC;;;;AAkRtE,wBAAiE"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { ThemeOverride, CurrencyInput, DateInput, DateTimeInput, FormField, Input, NumberInput, PhoneInput, TextArea, TimeInput, useI18n, useTestIds, useUID, withTestIds, Icon, VisuallyHiddenText } from '@pega/cosmos-react-core';
|
|
4
|
+
import { RuleSelect } from '../RuleSelect';
|
|
5
|
+
import { FieldReferenceInput } from '../FieldReference';
|
|
6
|
+
import { StyledExpressionControl, StyledDynamicInput } from './DynamicInput.styles';
|
|
7
|
+
import BooleanControl from './BooleanControl';
|
|
8
|
+
import SourceButton from './SourceButton';
|
|
9
|
+
import { getCurrentSource, getSourceIcon } from './utils';
|
|
10
|
+
import { getDynamicInputTestIds } from './DynamicInput.test-ids';
|
|
11
|
+
const DynamicInput = forwardRef(({ testId, label: labelProp, sources, onSourceChange, controls, required, ...restProps }, ref) => {
|
|
12
|
+
const testIds = useTestIds(testId, getDynamicInputTestIds);
|
|
13
|
+
const inputUid = useUID();
|
|
14
|
+
const t = useI18n();
|
|
15
|
+
const label = labelProp ?? t('value');
|
|
16
|
+
const currentSource = getCurrentSource(sources);
|
|
17
|
+
const constantFormat = controls.constant?.format;
|
|
18
|
+
const sourceLabels = {
|
|
19
|
+
Constant: t('constant_label', [
|
|
20
|
+
constantFormat ? t(`dynamicInput_format_${constantFormat}`) : ''
|
|
21
|
+
]),
|
|
22
|
+
Expression: t('expression_label'),
|
|
23
|
+
FieldReference: t('field_reference_label'),
|
|
24
|
+
Rule: t('rule_label')
|
|
25
|
+
};
|
|
26
|
+
const sourceDescriptions = {
|
|
27
|
+
Constant: t('constant_description'),
|
|
28
|
+
Expression: t('expression_description'),
|
|
29
|
+
FieldReference: t('field_reference_description'),
|
|
30
|
+
Rule: t('rule_description')
|
|
31
|
+
};
|
|
32
|
+
let control = _jsx(_Fragment, { children: null });
|
|
33
|
+
if (currentSource === 'Constant' && controls.constant) {
|
|
34
|
+
const { format, props } = controls.constant;
|
|
35
|
+
const { value, onChange, booleanLabels } = props;
|
|
36
|
+
// Note: This is just a typeguard for the value prop.
|
|
37
|
+
if (typeof value === 'string' || value === undefined) {
|
|
38
|
+
if (format === 'Text') {
|
|
39
|
+
control = (_jsx(Input, { "data-testid": testIds.control, id: inputUid, value: value, onChange: (e) => {
|
|
40
|
+
onChange(e.target.value);
|
|
41
|
+
}, required: required }));
|
|
42
|
+
}
|
|
43
|
+
if (format === 'Text (paragraph)') {
|
|
44
|
+
control = (_jsx(TextArea, { "data-testid": testIds.control, id: inputUid, value: value, onChange: (e) => {
|
|
45
|
+
onChange(e.target.value);
|
|
46
|
+
}, required: required }));
|
|
47
|
+
}
|
|
48
|
+
if (format === 'Currency') {
|
|
49
|
+
control = (_jsx(CurrencyInput, { "data-testid": testIds.control, id: inputUid, value: value, onChange: onChange, required: required }));
|
|
50
|
+
}
|
|
51
|
+
if (format === 'Percentage') {
|
|
52
|
+
control = (_jsx(NumberInput, { "data-testid": testIds.control, id: inputUid, value: value, onChange: onChange, showGroupSeparators: false, numberOfDecimals: undefined, required: required }));
|
|
53
|
+
}
|
|
54
|
+
if (format === 'Integer') {
|
|
55
|
+
control = (_jsx(NumberInput, { "data-testid": testIds.control, id: inputUid, value: value, onChange: onChange, showGroupSeparators: false,
|
|
56
|
+
// Note: Getting single occurrence of callback when '.' is entered w/o showDecimal = false.
|
|
57
|
+
showDecimal: false, required: required }));
|
|
58
|
+
}
|
|
59
|
+
if (format === 'Decimal') {
|
|
60
|
+
control = (_jsx(NumberInput, { "data-testid": testIds.control, id: inputUid, value: value, onChange: onChange, required: required }));
|
|
61
|
+
}
|
|
62
|
+
if (format === 'Phone') {
|
|
63
|
+
control = (_jsx(PhoneInput, { "data-testid": testIds.control, id: inputUid, value: value, onChange: onChange, required: required, showCountryCode: true }));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (format === 'Boolean') {
|
|
67
|
+
control = (_jsx(BooleanControl, { "data-testid": testIds.control, id: inputUid, booleanLabels: booleanLabels, value: value, onChange: onChange, required: required }));
|
|
68
|
+
}
|
|
69
|
+
// Note: This is just a typeguard for the value prop.
|
|
70
|
+
if (typeof value === 'string' ||
|
|
71
|
+
typeof value === 'number' ||
|
|
72
|
+
value instanceof Date ||
|
|
73
|
+
value === undefined) {
|
|
74
|
+
if (format === 'DateTime') {
|
|
75
|
+
control = (_jsx(DateTimeInput, { "data-testid": testIds.control, id: inputUid, value: value, required: required }));
|
|
76
|
+
}
|
|
77
|
+
if (format === 'Date') {
|
|
78
|
+
control = _jsx(DateInput, { "data-testid": testIds.control, id: inputUid, required: required });
|
|
79
|
+
}
|
|
80
|
+
if (format === 'Time') {
|
|
81
|
+
control = _jsx(TimeInput, { "data-testid": testIds.control, id: inputUid, required: required });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else if (currentSource === 'Rule' && controls.rule) {
|
|
86
|
+
control = (_jsx(RuleSelect, { ...controls.rule.props, "data-testid": testIds.control, id: inputUid, required: required }));
|
|
87
|
+
}
|
|
88
|
+
else if (currentSource === 'Expression' && controls.expression) {
|
|
89
|
+
const ExpressionControl = controls.expression.component;
|
|
90
|
+
const controlProps = controls.expression.props;
|
|
91
|
+
control = (_jsx(StyledExpressionControl, { container: true, children: _jsx(ExpressionControl, { ...controlProps, "data-testid": testIds.control, id: inputUid, required: required }) }));
|
|
92
|
+
}
|
|
93
|
+
else if (currentSource === 'FieldReference' && controls.fieldReference) {
|
|
94
|
+
control = (_jsx(FieldReferenceInput, { ...controls.fieldReference.props, "data-testid": testIds.control, id: inputUid, required: required }));
|
|
95
|
+
}
|
|
96
|
+
return (_jsxs(ThemeOverride, { theme: { base: { 'icon-set': 'streamline' } }, children: [_jsx(FormField, { label: label, labelFor: inputUid, required: required, ...restProps, ref: ref, testId: testIds.field, children: _jsxs(StyledDynamicInput, { children: [_jsx(SourceButton, { testId: testIds.menu, sources: sources, constantFormat: controls.constant?.format, icon: currentSource
|
|
97
|
+
? getSourceIcon({
|
|
98
|
+
source: currentSource,
|
|
99
|
+
format: currentSource === 'Constant' ? controls.constant?.format : undefined
|
|
100
|
+
})
|
|
101
|
+
: undefined, menuItems: sources.map(config => {
|
|
102
|
+
const type = config.type;
|
|
103
|
+
return {
|
|
104
|
+
id: type,
|
|
105
|
+
primary: sourceLabels[config.type],
|
|
106
|
+
secondary: [sourceDescriptions[type]],
|
|
107
|
+
visual: (_jsx(Icon, { name: getSourceIcon({
|
|
108
|
+
source: type,
|
|
109
|
+
format: type === 'Constant' ? constantFormat : undefined
|
|
110
|
+
}), set: 'streamline' })),
|
|
111
|
+
selected: config.selected
|
|
112
|
+
};
|
|
113
|
+
}), onSourceChange: onSourceChange, "aria-describedby": `${inputUid}-selected-source` }), control] }) }), _jsx(VisuallyHiddenText, { id: `${inputUid}-selected-source`, children: currentSource ? t('selected_noun', [sourceLabels[currentSource]]) : '' })] }));
|
|
114
|
+
});
|
|
115
|
+
export default withTestIds(DynamicInput, getDynamicInputTestIds);
|
|
116
|
+
//# sourceMappingURL=DynamicInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicInput.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EACL,aAAa,EACb,aAAa,EACb,SAAS,EACT,aAAa,EACb,SAAS,EACT,KAAK,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,MAAM,EACN,WAAW,EACX,IAAI,EACJ,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,YAAY,GAA0B,UAAU,CACpD,CACE,EACE,MAAM,EACN,KAAK,EAAE,SAAS,EAChB,OAAO,EACP,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,GAAG,SAAS,EACuB,EACrC,GAA6B,EAC7B,EAAE;IACF,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,KAAK,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,gBAA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C","sourcesContent":["import { forwardRef } from 'react';\nimport type { ChangeEvent, FC, PropsWithoutRef } from 'react';\n\nimport {\n ThemeOverride,\n CurrencyInput,\n DateInput,\n DateTimeInput,\n FormField,\n Input,\n NumberInput,\n PhoneInput,\n TextArea,\n TimeInput,\n useI18n,\n useTestIds,\n useUID,\n withTestIds,\n Icon,\n VisuallyHiddenText\n} from '@pega/cosmos-react-core';\n\nimport { RuleSelect } from '../RuleSelect';\nimport { FieldReferenceInput } from '../FieldReference';\n\nimport type { DynamicInputProps, Source } from './DynamicInput.types';\nimport { StyledExpressionControl, StyledDynamicInput } from './DynamicInput.styles';\nimport BooleanControl from './BooleanControl';\nimport SourceButton from './SourceButton';\nimport { getCurrentSource, getSourceIcon } from './utils';\nimport { getDynamicInputTestIds } from './DynamicInput.test-ids';\n\nconst DynamicInput: FC<DynamicInputProps> = forwardRef(\n (\n {\n testId,\n label: labelProp,\n sources,\n onSourceChange,\n controls,\n required,\n ...restProps\n }: PropsWithoutRef<DynamicInputProps>,\n ref: DynamicInputProps['ref']\n ) => {\n const testIds = useTestIds(testId, getDynamicInputTestIds);\n const inputUid = useUID();\n const t = useI18n();\n\n const label = labelProp ?? t('value');\n const currentSource = getCurrentSource(sources);\n const constantFormat = controls.constant?.format;\n const sourceLabels: { [key in Source]: string } = {\n Constant: t('constant_label', [\n constantFormat ? t(`dynamicInput_format_${constantFormat}`) : ''\n ]),\n Expression: t('expression_label'),\n FieldReference: t('field_reference_label'),\n Rule: t('rule_label')\n };\n const sourceDescriptions: { [key in Source]: string } = {\n Constant: t('constant_description'),\n Expression: t('expression_description'),\n FieldReference: t('field_reference_description'),\n Rule: t('rule_description')\n };\n\n let control: JSX.Element = <>{null}</>;\n\n if (currentSource === 'Constant' && controls.constant) {\n const { format, props } = controls.constant;\n const { value, onChange, booleanLabels } = props;\n // Note: This is just a typeguard for the value prop.\n if (typeof value === 'string' || value === undefined) {\n if (format === 'Text') {\n control = (\n <Input\n data-testid={testIds.control}\n id={inputUid}\n value={value}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n onChange(e.target.value);\n }}\n required={required}\n />\n );\n }\n\n if (format === 'Text (paragraph)') {\n control = (\n <TextArea\n data-testid={testIds.control}\n id={inputUid}\n value={value}\n onChange={(e: ChangeEvent<HTMLTextAreaElement>) => {\n onChange(e.target.value);\n }}\n required={required}\n />\n );\n }\n\n if (format === 'Currency') {\n control = (\n <CurrencyInput\n data-testid={testIds.control}\n id={inputUid}\n value={value}\n onChange={onChange}\n required={required}\n />\n );\n }\n\n if (format === 'Percentage') {\n control = (\n <NumberInput\n data-testid={testIds.control}\n id={inputUid}\n value={value}\n onChange={onChange}\n showGroupSeparators={false}\n numberOfDecimals={undefined}\n required={required}\n />\n );\n }\n\n if (format === 'Integer') {\n control = (\n <NumberInput\n data-testid={testIds.control}\n id={inputUid}\n value={value}\n onChange={onChange}\n showGroupSeparators={false}\n // Note: Getting single occurrence of callback when '.' is entered w/o showDecimal = false.\n showDecimal={false}\n required={required}\n />\n );\n }\n\n if (format === 'Decimal') {\n control = (\n <NumberInput\n data-testid={testIds.control}\n id={inputUid}\n value={value}\n onChange={onChange}\n required={required}\n />\n );\n }\n\n if (format === 'Phone') {\n control = (\n <PhoneInput\n data-testid={testIds.control}\n id={inputUid}\n value={value}\n onChange={onChange}\n required={required}\n showCountryCode\n />\n );\n }\n }\n\n if (format === 'Boolean') {\n control = (\n <BooleanControl\n data-testid={testIds.control}\n id={inputUid}\n booleanLabels={booleanLabels}\n value={value}\n onChange={onChange}\n required={required}\n />\n );\n }\n\n // Note: This is just a typeguard for the value prop.\n if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n value instanceof Date ||\n value === undefined\n ) {\n if (format === 'DateTime') {\n control = (\n <DateTimeInput\n data-testid={testIds.control}\n id={inputUid}\n value={value}\n required={required}\n />\n );\n }\n\n if (format === 'Date') {\n control = <DateInput data-testid={testIds.control} id={inputUid} required={required} />;\n }\n\n if (format === 'Time') {\n control = <TimeInput data-testid={testIds.control} id={inputUid} required={required} />;\n }\n }\n } else if (currentSource === 'Rule' && controls.rule) {\n control = (\n <RuleSelect\n {...controls.rule.props}\n data-testid={testIds.control}\n id={inputUid}\n required={required}\n />\n );\n } else if (currentSource === 'Expression' && controls.expression) {\n const ExpressionControl = controls.expression.component;\n const controlProps = controls.expression.props;\n\n control = (\n <StyledExpressionControl container>\n <ExpressionControl\n {...controlProps}\n data-testid={testIds.control}\n id={inputUid}\n required={required}\n />\n </StyledExpressionControl>\n );\n } else if (currentSource === 'FieldReference' && controls.fieldReference) {\n control = (\n <FieldReferenceInput\n {...controls.fieldReference.props}\n data-testid={testIds.control}\n id={inputUid}\n required={required}\n />\n );\n }\n\n return (\n <ThemeOverride theme={{ base: { 'icon-set': 'streamline' } }}>\n <FormField\n label={label}\n labelFor={inputUid}\n required={required}\n {...restProps}\n ref={ref}\n testId={testIds.field}\n >\n <StyledDynamicInput>\n <SourceButton\n testId={testIds.menu}\n sources={sources}\n constantFormat={controls.constant?.format}\n icon={\n currentSource\n ? getSourceIcon({\n source: currentSource,\n format: currentSource === 'Constant' ? controls.constant?.format : undefined\n })\n : undefined\n }\n menuItems={sources.map(config => {\n const type = config.type;\n\n return {\n id: type,\n primary: sourceLabels[config.type],\n secondary: [sourceDescriptions[type]],\n visual: (\n <Icon\n name={getSourceIcon({\n source: type,\n format: type === 'Constant' ? constantFormat : undefined\n })}\n set='streamline'\n />\n ),\n selected: config.selected\n };\n })}\n onSourceChange={onSourceChange}\n aria-describedby={`${inputUid}-selected-source`}\n />\n {control}\n </StyledDynamicInput>\n </FormField>\n\n <VisuallyHiddenText id={`${inputUid}-selected-source`}>\n {currentSource ? t('selected_noun', [sourceLabels[currentSource]]) : ''}\n </VisuallyHiddenText>\n </ThemeOverride>\n );\n }\n);\n\nexport default withTestIds(DynamicInput, getDynamicInputTestIds);\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledExpressionBuilderButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const StyledExpressionControl: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").FlexProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const StyledDynamicInput: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
//# sourceMappingURL=DynamicInput.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicInput.styles.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.styles.ts"],"names":[],"mappings":";AAKA,eAAO,MAAM,6BAA6B,qOAAmB,CAAC;AAC9D,eAAO,MAAM,uBAAuB,mOAAiB,CAAC;AAEtD,eAAO,MAAM,kBAAkB,yGAmD7B,CAAC"}
|