@pega/cosmos-react-core 5.0.0-dev.9.2 → 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.
- package/SECURITY.md +11 -0
- package/lib/components/AdditionalInfo/AdditionalInfo.d.ts +8 -6
- package/lib/components/AdditionalInfo/AdditionalInfo.d.ts.map +1 -1
- package/lib/components/AdditionalInfo/AdditionalInfo.js +3 -2
- package/lib/components/AdditionalInfo/AdditionalInfo.js.map +1 -1
- package/lib/components/AppShell/AppShell.js +1 -1
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/Drawer.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.js +3 -3
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/Operator.d.ts.map +1 -1
- package/lib/components/AppShell/Operator.js +5 -2
- package/lib/components/AppShell/Operator.js.map +1 -1
- package/lib/components/Badges/Keyboard.d.ts.map +1 -1
- package/lib/components/Badges/Keyboard.js +10 -10
- package/lib/components/Badges/Keyboard.js.map +1 -1
- package/lib/components/Badges/Status.d.ts.map +1 -1
- package/lib/components/Badges/Status.js +2 -0
- package/lib/components/Badges/Status.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts +5 -3
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +22 -15
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/Banner.test-ids.d.ts +2 -0
- package/lib/components/Banner/Banner.test-ids.d.ts.map +1 -0
- package/lib/components/Banner/Banner.test-ids.js +10 -0
- package/lib/components/Banner/Banner.test-ids.js.map +1 -0
- package/lib/components/Button/Button.js +1 -1
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/Configuration/Configuration.d.ts +3 -0
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +20 -12
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Configuration/index.d.ts +1 -0
- package/lib/components/Configuration/index.d.ts.map +1 -1
- package/lib/components/Configuration/index.js +1 -0
- package/lib/components/Configuration/index.js.map +1 -1
- package/lib/components/Configuration/withConfiguration.d.ts +8 -0
- package/lib/components/Configuration/withConfiguration.d.ts.map +1 -0
- package/lib/components/Configuration/withConfiguration.js +9 -0
- package/lib/components/Configuration/withConfiguration.js.map +1 -0
- package/lib/components/DateTime/DateTime.types.d.ts +1 -4
- package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.types.js.map +1 -1
- package/lib/components/DateTime/DurationDisplay.d.ts +7 -3
- package/lib/components/DateTime/DurationDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DurationDisplay.js +2 -2
- package/lib/components/DateTime/DurationDisplay.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts +3 -5
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +2 -17
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts +2 -4
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +33 -84
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +2 -1
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts +3 -0
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +20 -38
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.js +2 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts +5 -0
- package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +14 -6
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +1 -1
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.js +5 -0
- package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +13 -24
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +2 -4
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.js +25 -64
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +3 -2
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +19 -16
- package/lib/components/DateTime/Input/utils.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.js +3 -3
- package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +2 -0
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.js +37 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.js +3 -3
- package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/utils.d.ts +13 -2
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js +7 -13
- package/lib/components/DateTime/utils.js.map +1 -1
- package/lib/components/Dialog/FormDialog.js +1 -1
- package/lib/components/Dialog/FormDialog.js.map +1 -1
- package/lib/components/Dialog/InfoDialog.js +1 -1
- package/lib/components/Dialog/InfoDialog.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts +23 -15
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +3 -3
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts +2 -2
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +5 -2
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +1 -1
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts +1 -0
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +7 -3
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/HTML/HTML.js +1 -1
- package/lib/components/HTML/HTML.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.js +66 -19
- package/lib/components/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.styles.d.ts +3 -3
- package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.styles.js +29 -16
- package/lib/components/Lightbox/Lightbox.styles.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.js +3 -1
- package/lib/components/Lightbox/Lightbox.test-ids.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.d.ts +19 -8
- package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +61 -51
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts +4 -0
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +41 -8
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.js +2 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/Menu/MenuItem.js +1 -1
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +8 -4
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
- package/lib/components/Modal/MinimizedModal.js +3 -3
- package/lib/components/Modal/MinimizedModal.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +4 -4
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/MultiStepForm/FormProgress.styles.d.ts +2 -0
- package/lib/components/MultiStepForm/FormProgress.styles.d.ts.map +1 -1
- package/lib/components/MultiStepForm/FormProgress.styles.js +26 -2
- package/lib/components/MultiStepForm/FormProgress.styles.js.map +1 -1
- package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts +0 -1
- package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts.map +1 -1
- package/lib/components/MultiStepForm/HorizontalFormProgress.js +26 -29
- package/lib/components/MultiStepForm/HorizontalFormProgress.js.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.js +27 -11
- package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
- package/lib/components/NoValue/NoValue.d.ts.map +1 -1
- package/lib/components/NoValue/NoValue.js +6 -1
- package/lib/components/NoValue/NoValue.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +9 -0
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +3 -1
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.js +15 -0
- package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
- package/lib/components/ShortcutManager/ShortcutManager.js +1 -1
- package/lib/components/ShortcutManager/ShortcutManager.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +1 -1
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +16 -8
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/TextArea/TextArea.styles.d.ts +1 -0
- package/lib/components/TextArea/TextArea.styles.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.styles.js +32 -4
- package/lib/components/TextArea/TextArea.styles.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +1 -1
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/hooks/useArrows.d.ts +2 -1
- package/lib/hooks/useArrows.d.ts.map +1 -1
- package/lib/hooks/useArrows.js +47 -22
- package/lib/hooks/useArrows.js.map +1 -1
- package/lib/hooks/useFocusTrap.d.ts.map +1 -1
- package/lib/hooks/useFocusTrap.js +30 -3
- package/lib/hooks/useFocusTrap.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +21 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +21 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +25 -2
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +21 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.js +11 -1
- package/lib/styles/GlobalStyle.js.map +1 -1
- package/lib/utils/focusHeadingOrContainer.d.ts +1 -1
- package/lib/utils/focusHeadingOrContainer.d.ts.map +1 -1
- package/lib/utils/focusHeadingOrContainer.js +1 -1
- package/lib/utils/focusHeadingOrContainer.js.map +1 -1
- package/lib/utils/getFocusables.d.ts +7 -3
- package/lib/utils/getFocusables.d.ts.map +1 -1
- package/lib/utils/getFocusables.js +31 -9
- package/lib/utils/getFocusables.js.map +1 -1
- package/package.json +6 -5
|
@@ -6,6 +6,7 @@ import Popover from '../Popover';
|
|
|
6
6
|
import { StyledText } from '../Text';
|
|
7
7
|
import { calculateFontSize } from '../../styles';
|
|
8
8
|
import { useDirection } from '../../hooks';
|
|
9
|
+
import Flex from '../Flex';
|
|
9
10
|
export const CurrentStepPopover = styled(Popover) `
|
|
10
11
|
max-width: 100%;
|
|
11
12
|
background-color: transparent;
|
|
@@ -42,6 +43,29 @@ export const StyledFill = styled.div(({ theme }) => {
|
|
|
42
43
|
`;
|
|
43
44
|
});
|
|
44
45
|
StyledFill.defaultProps = defaultThemeProp;
|
|
46
|
+
export const StyledFormProgress = styled(Flex)(({ theme }) => {
|
|
47
|
+
const { base: { spacing, 'font-size': fontSize, 'font-scale': fontScale }, components: { text: { h4: { 'font-size': h4fontSize } } } } = theme;
|
|
48
|
+
const fontSizes = calculateFontSize(fontSize, fontScale);
|
|
49
|
+
return css `
|
|
50
|
+
position: relative;
|
|
51
|
+
padding-block-start: calc(${spacing} + ${fontSizes[h4fontSize]} * 1.35);
|
|
52
|
+
`;
|
|
53
|
+
});
|
|
54
|
+
StyledFormProgress.defaultProps = defaultThemeProp;
|
|
55
|
+
export const StyledStepMarkers = styled.ol(({ theme }) => {
|
|
56
|
+
return css `
|
|
57
|
+
list-style-type: none;
|
|
58
|
+
|
|
59
|
+
li {
|
|
60
|
+
display: flex;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:has(:focus-visible) {
|
|
64
|
+
box-shadow: ${theme.base.shadow['focus-group']};
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
});
|
|
68
|
+
StyledStepMarkers.defaultProps = defaultThemeProp;
|
|
45
69
|
export const StepMarker = styled(BareButton)(({ current, depth, prior, theme }) => {
|
|
46
70
|
const { base: { 'font-size': fontSize, 'font-scale': fontScale, animation: { speed: animationSpeed, timing: { ease: animationTiming } }, palette: { interactive, 'primary-background': primaryBackground }, shadow: { focus: focusShadow }, 'hit-area': { 'mouse-min': buttonSize, 'finger-min': touchButtonSize } }, components: { 'form-control': { 'border-color': borderColor } } } = theme;
|
|
47
71
|
const { m: stepMarkerSize } = calculateFontSize(fontSize, fontScale);
|
|
@@ -145,14 +169,14 @@ export const StyledBulletWrapper = styled.div(({ theme, hasNext, prior }) => {
|
|
|
145
169
|
position: relative;
|
|
146
170
|
text-align: center;
|
|
147
171
|
min-width: 2rem;
|
|
148
|
-
padding-block-start: calc(
|
|
172
|
+
padding-block-start: calc(1.15 * ${theme.base.spacing});
|
|
149
173
|
|
|
150
174
|
${hasNext &&
|
|
151
175
|
css `
|
|
152
176
|
&::after {
|
|
153
177
|
content: '';
|
|
154
178
|
position: absolute;
|
|
155
|
-
margin-block-start:
|
|
179
|
+
margin-block-start: 0.85rem;
|
|
156
180
|
inset-inline-start: calc(50% - 0.03125rem);
|
|
157
181
|
width: 0.0625rem;
|
|
158
182
|
height: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormProgress.styles.js","sourceRoot":"","sources":["../../../src/components/MultiStepForm/FormProgress.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;;;;;;QAMzC,UAAU;;;;;CAKjB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAChD,MAAM,EACJ,IAAI,EAAE,EACJ,OAAO,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,EACxC,EACF,GAAG,KAAK,CAAC;IAEV,OAAO,GAAG,CAAA;;;;kBAIM,WAAW;GAC1B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE1C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,G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AC,CAAC,CAAC,WAAW;0CACb,cAAc;;KAEnD;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrD,OAAO,GAAG,CAAA;qBACS,KAAK,CAAC,IAAI,CAAC,OAAO;;GAEpC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { size } from 'polished';\n\nimport { defaultThemeProp } from '../../theme';\nimport BareButton from '../Button/BareButton';\nimport Popover from '../Popover';\nimport { StyledText } from '../Text';\nimport { calculateFontSize } from '../../styles';\nimport { useDirection } from '../../hooks';\n\nimport type { Step } from './MultiStepForm.types';\n\nexport const CurrentStepPopover = styled(Popover)`\n max-width: 100%;\n background-color: transparent;\n z-index: 0;\n box-shadow: none;\n\n & > ${StyledText} {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n`;\n\nexport const StyledBar = styled.div(({ theme }) => {\n const {\n base: {\n palette: { 'border-line': borderColor }\n }\n } = theme;\n\n return css`\n position: absolute;\n width: 100%;\n height: 0.0625rem;\n background: ${borderColor};\n `;\n});\n\nStyledBar.defaultProps = defaultThemeProp;\n\nexport const StyledFill = styled.div(({ theme }) => {\n const {\n base: {\n animation: {\n speed: animationSpeed,\n timing: { ease: animationTiming }\n },\n palette: { interactive }\n }\n } = theme;\n\n const { ltr } = useDirection();\n\n return css`\n position: absolute;\n width: 100%;\n height: 100%;\n background: ${interactive};\n transition: all calc(2 * ${animationSpeed}) ${animationTiming};\n transform: scaleX(var(--fillScale));\n transform-origin: ${ltr ? 0 : '100%'} 0;\n `;\n});\n\nStyledFill.defaultProps = defaultThemeProp;\n\nexport const StepMarker = styled(BareButton)<{\n current: boolean;\n depth: Step['depth'];\n prior: boolean;\n}>(({ current, depth, prior, theme }) => {\n const {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n animation: {\n speed: animationSpeed,\n timing: { ease: animationTiming }\n },\n palette: { interactive, 'primary-background': primaryBackground },\n shadow: { focus: focusShadow },\n 'hit-area': { 'mouse-min': buttonSize, 'finger-min': touchButtonSize }\n },\n components: {\n 'form-control': { 'border-color': borderColor }\n }\n } = theme;\n\n const { m: stepMarkerSize } = calculateFontSize(fontSize, fontScale);\n const smallStepMarkerSize = `calc(${stepMarkerSize} / 1.5)`;\n\n return css`\n position: relative;\n z-index: 1;\n ${size(depth === 1 ? smallStepMarkerSize : stepMarkerSize)}\n border-radius: 100%;\n background: ${primaryBackground};\n border: 0.0625rem solid ${borderColor};\n transition: all calc(2 * ${animationSpeed}) ${animationTiming};\n\n ${current &&\n css`\n background: ${interactive};\n border-color: ${interactive};\n `}\n\n ${prior &&\n css`\n border-color: ${interactive};\n `}\n\n ::after {\n content: '';\n position: absolute;\n inset-block-start: ${depth === 1\n ? `calc((${buttonSize} - ${smallStepMarkerSize}) / -2) `\n : `calc((${buttonSize} - ${stepMarkerSize}) / -2) `};\n inset-inline-start: ${depth === 1\n ? `calc((${buttonSize} - ${smallStepMarkerSize}) / -2) `\n : `calc((${buttonSize} - ${stepMarkerSize}) / -2) `};\n ${size(buttonSize)}\n\n @media (pointer: coarse) {\n inset-block-start: ${depth === 1\n ? `calc((${touchButtonSize} - ${smallStepMarkerSize}) / -2) `\n : `calc((${touchButtonSize} - ${stepMarkerSize}) / -2) `};\n inset-inline-start: ${depth === 1\n ? `calc((${touchButtonSize} - ${smallStepMarkerSize}) / -2) `\n : `calc((${touchButtonSize} - ${stepMarkerSize}) / -2) `};\n ${size(touchButtonSize)}\n }\n }\n\n &:not(:only-child):first-child::after {\n inset-inline-start: 0;\n }\n\n &:not(:only-child):last-child::after {\n inset-inline-start: unset;\n inset-inline-end: 0;\n }\n\n :focus {\n box-shadow: ${focusShadow};\n }\n `;\n});\n\nStepMarker.defaultProps = defaultThemeProp;\n\nexport const StepMarkerIcon = styled.svg<{\n current: boolean;\n depth: Step['depth'];\n prior: boolean;\n}>(({ current, depth, prior, theme }) => {\n const {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n animation: {\n speed: animationSpeed,\n timing: { ease: animationTiming }\n },\n palette: { interactive, 'primary-background': primaryBackground }\n },\n components: {\n 'form-control': { 'border-color': borderColor }\n }\n } = theme;\n\n const { m: stepMarkerSize } = calculateFontSize(fontSize, fontScale);\n const smallStepMarkerSize = `calc(${stepMarkerSize} / 1.5)`;\n\n return css`\n position: relative;\n z-index: 1;\n ${size(depth === 1 ? smallStepMarkerSize : stepMarkerSize)}\n border-radius: 100%;\n background: ${primaryBackground};\n border: 0.0625rem solid ${borderColor};\n transition: all calc(2 * ${animationSpeed}) ${animationTiming};\n\n ${current &&\n css`\n background: ${interactive};\n border-color: ${interactive};\n `}\n\n ${prior &&\n css`\n border-color: ${interactive};\n `}\n\n\n &:not(:only-child):first-child::after {\n inset-inline-start: 0;\n }\n\n &:not(:only-child):last-child::after {\n inset-inline-start: unset;\n inset-inline-end: 0;\n }\n `;\n});\n\nStepMarkerIcon.defaultProps = defaultThemeProp;\n\nexport const StyledBulletWrapper = styled.div<{\n hasNext: boolean;\n prior: boolean;\n}>(({ theme, hasNext, prior }) => {\n const {\n base: {\n animation: { speed: animationSpeed },\n palette: { interactive }\n },\n components: {\n 'form-control': { 'border-color': borderColor }\n }\n } = theme;\n return css`\n position: relative;\n text-align: center;\n min-width: 2rem;\n padding-block-start: calc(0.85 * ${theme.base.spacing});\n\n ${hasNext &&\n css`\n &::after {\n content: '';\n position: absolute;\n margin-block-start: 1.15rem;\n inset-inline-start: calc(50% - 0.03125rem);\n width: 0.0625rem;\n height: 100%;\n background: ${prior ? interactive : borderColor};\n transition: background calc(2 * ${animationSpeed});\n }\n `}\n `;\n});\n\nStyledBulletWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStepText = styled.div(({ theme }) => {\n return css`\n padding-block: ${theme.base.spacing};\n overflow-wrap: break-word;\n `;\n});\n\nStyledStepText.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"FormProgress.styles.js","sourceRoot":"","sources":["../../../src/components/MultiStepForm/FormProgress.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAiB,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,IAAI,MAAM,SAAS,CAAC;AAI3B,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;;;;;;QAMzC,UAAU;;;;;CAKjB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAChD,MAAM,EACJ,IAAI,EAAE,EACJ,OAAO,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,EACxC,EACF,GAAG,KAAK,CAAC;IAEV,OAAO,GAAG,CAAA;;;;kBAIM,WAAW;GAC1B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE1C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjD,MAAM,EACJ,IAAI,EAAE,EACJ,SAAS,EAAE,EACT,KAAK,EAAE,c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cAAc,KAAK,eAAe;;MAE3D,OAAO;QACT,GAAG,CAAA;oBACa,WAAW;sBACT,WAAW;KAC5B;;MAEC,KAAK;QACP,GAAG,CAAA;sBACe,WAAW;KAC5B;;;;;;;;;;;GAWF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAG1C,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;IAC/B,MAAM,EACJ,IAAI,EAAE,EACJ,SAAS,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,EACpC,OAAO,EAAE,EAAE,WAAW,EAAE,EACzB,EACD,UAAU,EAAE,EACV,cAAc,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,EAChD,EACF,GAAG,KAAK,CAAC;IACV,OAAO,GAAG,CAAA;;;;uCAI2B,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEnD,OAAO;QACT,GAAG,CAAA;;;;;;;;sBAQe,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW;0CACb,cAAc;;KAEnD;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrD,OAAO,GAAG,CAAA;qBACS,KAAK,CAAC,IAAI,CAAC,OAAO;;GAEpC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { size } from 'polished';\n\nimport { defaultThemeProp } from '../../theme';\nimport BareButton from '../Button/BareButton';\nimport Popover from '../Popover';\nimport { StyledText } from '../Text';\nimport { calculateFontSize, type FontSize } from '../../styles';\nimport { useDirection } from '../../hooks';\nimport Flex from '../Flex';\n\nimport type { Step } from './MultiStepForm.types';\n\nexport const CurrentStepPopover = styled(Popover)`\n max-width: 100%;\n background-color: transparent;\n z-index: 0;\n box-shadow: none;\n\n & > ${StyledText} {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n`;\n\nexport const StyledBar = styled.div(({ theme }) => {\n const {\n base: {\n palette: { 'border-line': borderColor }\n }\n } = theme;\n\n return css`\n position: absolute;\n width: 100%;\n height: 0.0625rem;\n background: ${borderColor};\n `;\n});\n\nStyledBar.defaultProps = defaultThemeProp;\n\nexport const StyledFill = styled.div(({ theme }) => {\n const {\n base: {\n animation: {\n speed: animationSpeed,\n timing: { ease: animationTiming }\n },\n palette: { interactive }\n }\n } = theme;\n\n const { ltr } = useDirection();\n\n return css`\n position: absolute;\n width: 100%;\n height: 100%;\n background: ${interactive};\n transition: all calc(2 * ${animationSpeed}) ${animationTiming};\n transform: scaleX(var(--fillScale));\n transform-origin: ${ltr ? 0 : '100%'} 0;\n `;\n});\n\nStyledFill.defaultProps = defaultThemeProp;\n\nexport const StyledFormProgress = styled(Flex)(({ theme }) => {\n const {\n base: { spacing, 'font-size': fontSize, 'font-scale': fontScale },\n components: {\n text: {\n h4: { 'font-size': h4fontSize }\n }\n }\n } = theme;\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n position: relative;\n padding-block-start: calc(${spacing} + ${fontSizes[h4fontSize as FontSize]} * 1.35);\n `;\n});\n\nStyledFormProgress.defaultProps = defaultThemeProp;\n\nexport const StyledStepMarkers = styled.ol(({ theme }) => {\n return css`\n list-style-type: none;\n\n li {\n display: flex;\n }\n\n &:has(:focus-visible) {\n box-shadow: ${theme.base.shadow['focus-group']};\n }\n `;\n});\n\nStyledStepMarkers.defaultProps = defaultThemeProp;\n\nexport const StepMarker = styled(BareButton)<{\n current: boolean;\n depth: Step['depth'];\n prior: boolean;\n}>(({ current, depth, prior, theme }) => {\n const {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n animation: {\n speed: animationSpeed,\n timing: { ease: animationTiming }\n },\n palette: { interactive, 'primary-background': primaryBackground },\n shadow: { focus: focusShadow },\n 'hit-area': { 'mouse-min': buttonSize, 'finger-min': touchButtonSize }\n },\n components: {\n 'form-control': { 'border-color': borderColor }\n }\n } = theme;\n\n const { m: stepMarkerSize } = calculateFontSize(fontSize, fontScale);\n const smallStepMarkerSize = `calc(${stepMarkerSize} / 1.5)`;\n\n return css`\n position: relative;\n z-index: 1;\n ${size(depth === 1 ? smallStepMarkerSize : stepMarkerSize)}\n border-radius: 100%;\n background: ${primaryBackground};\n border: 0.0625rem solid ${borderColor};\n transition: all calc(2 * ${animationSpeed}) ${animationTiming};\n\n ${current &&\n css`\n background: ${interactive};\n border-color: ${interactive};\n `}\n\n ${prior &&\n css`\n border-color: ${interactive};\n `}\n\n ::after {\n content: '';\n position: absolute;\n inset-block-start: ${depth === 1\n ? `calc((${buttonSize} - ${smallStepMarkerSize}) / -2) `\n : `calc((${buttonSize} - ${stepMarkerSize}) / -2) `};\n inset-inline-start: ${depth === 1\n ? `calc((${buttonSize} - ${smallStepMarkerSize}) / -2) `\n : `calc((${buttonSize} - ${stepMarkerSize}) / -2) `};\n ${size(buttonSize)}\n\n @media (pointer: coarse) {\n inset-block-start: ${depth === 1\n ? `calc((${touchButtonSize} - ${smallStepMarkerSize}) / -2) `\n : `calc((${touchButtonSize} - ${stepMarkerSize}) / -2) `};\n inset-inline-start: ${depth === 1\n ? `calc((${touchButtonSize} - ${smallStepMarkerSize}) / -2) `\n : `calc((${touchButtonSize} - ${stepMarkerSize}) / -2) `};\n ${size(touchButtonSize)}\n }\n }\n\n &:not(:only-child):first-child::after {\n inset-inline-start: 0;\n }\n\n &:not(:only-child):last-child::after {\n inset-inline-start: unset;\n inset-inline-end: 0;\n }\n\n :focus {\n box-shadow: ${focusShadow};\n }\n `;\n});\n\nStepMarker.defaultProps = defaultThemeProp;\n\nexport const StepMarkerIcon = styled.svg<{\n current: boolean;\n depth: Step['depth'];\n prior: boolean;\n}>(({ current, depth, prior, theme }) => {\n const {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n animation: {\n speed: animationSpeed,\n timing: { ease: animationTiming }\n },\n palette: { interactive, 'primary-background': primaryBackground }\n },\n components: {\n 'form-control': { 'border-color': borderColor }\n }\n } = theme;\n\n const { m: stepMarkerSize } = calculateFontSize(fontSize, fontScale);\n const smallStepMarkerSize = `calc(${stepMarkerSize} / 1.5)`;\n\n return css`\n position: relative;\n z-index: 1;\n ${size(depth === 1 ? smallStepMarkerSize : stepMarkerSize)}\n border-radius: 100%;\n background: ${primaryBackground};\n border: 0.0625rem solid ${borderColor};\n transition: all calc(2 * ${animationSpeed}) ${animationTiming};\n\n ${current &&\n css`\n background: ${interactive};\n border-color: ${interactive};\n `}\n\n ${prior &&\n css`\n border-color: ${interactive};\n `}\n\n\n &:not(:only-child):first-child::after {\n inset-inline-start: 0;\n }\n\n &:not(:only-child):last-child::after {\n inset-inline-start: unset;\n inset-inline-end: 0;\n }\n `;\n});\n\nStepMarkerIcon.defaultProps = defaultThemeProp;\n\nexport const StyledBulletWrapper = styled.div<{\n hasNext: boolean;\n prior: boolean;\n}>(({ theme, hasNext, prior }) => {\n const {\n base: {\n animation: { speed: animationSpeed },\n palette: { interactive }\n },\n components: {\n 'form-control': { 'border-color': borderColor }\n }\n } = theme;\n return css`\n position: relative;\n text-align: center;\n min-width: 2rem;\n padding-block-start: calc(1.15 * ${theme.base.spacing});\n\n ${hasNext &&\n css`\n &::after {\n content: '';\n position: absolute;\n margin-block-start: 0.85rem;\n inset-inline-start: calc(50% - 0.03125rem);\n width: 0.0625rem;\n height: 100%;\n background: ${prior ? interactive : borderColor};\n transition: background calc(2 * ${animationSpeed});\n }\n `}\n `;\n});\n\nStyledBulletWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStepText = styled.div(({ theme }) => {\n return css`\n padding-block: ${theme.base.spacing};\n overflow-wrap: break-word;\n `;\n});\n\nStyledStepText.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -5,7 +5,6 @@ interface FormProgressProps {
|
|
|
5
5
|
steps: MultiStepFormProps['steps'];
|
|
6
6
|
currentStepId: MultiStepFormProps['currentStepId'];
|
|
7
7
|
}
|
|
8
|
-
export declare const StyledFormProgress: import("styled-components").StyledComponent<FunctionComponent<import("../Flex").FlexProps & ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
9
8
|
declare const HorizontalFormProgress: FunctionComponent<FormProgressProps & ForwardProps>;
|
|
10
9
|
export default HorizontalFormProgress;
|
|
11
10
|
//# sourceMappingURL=HorizontalFormProgress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalFormProgress.d.ts","sourceRoot":"","sources":["../../../src/components/MultiStepForm/HorizontalFormProgress.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"HorizontalFormProgress.d.ts","sourceRoot":"","sources":["../../../src/components/MultiStepForm/HorizontalFormProgress.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,OAAO,CAAC;AAG9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAchD,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAC;AAE5D,UAAU,iBAAiB;IACzB,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACnC,aAAa,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,QAAA,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAqH/E,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,40 +1,37 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { remToPx, stripUnit } from 'polished';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import
|
|
5
|
-
import { useElement, useTheme } from '../../hooks';
|
|
6
|
-
import { calculateFontSize } from '../../styles';
|
|
7
|
-
import { defaultThemeProp } from '../../theme';
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { useArrows, useElement, useTheme } from '../../hooks';
|
|
8
5
|
import { tryCatch } from '../../utils';
|
|
9
6
|
import Flex from '../Flex';
|
|
10
7
|
import Text from '../Text';
|
|
11
8
|
import Tooltip from '../Tooltip';
|
|
12
|
-
import { CurrentStepPopover, StepMarker, StyledBar, StyledFill } from './FormProgress.styles';
|
|
13
|
-
export const StyledFormProgress = styled(Flex)(({ theme }) => {
|
|
14
|
-
const { base: { spacing, 'font-size': fontSize, 'font-scale': fontScale }, components: { text: { h4: { 'font-size': h4fontSize } } } } = theme;
|
|
15
|
-
const fontSizes = calculateFontSize(fontSize, fontScale);
|
|
16
|
-
return css `
|
|
17
|
-
position: relative;
|
|
18
|
-
padding-block-start: calc(${spacing} + ${fontSizes[h4fontSize]} * 1.35);
|
|
19
|
-
`;
|
|
20
|
-
});
|
|
21
|
-
StyledFormProgress.defaultProps = defaultThemeProp;
|
|
9
|
+
import { CurrentStepPopover, StepMarker, StyledBar, StyledFill, StyledFormProgress, StyledStepMarkers } from './FormProgress.styles';
|
|
22
10
|
const HorizontalFormProgress = ({ steps, currentStepId, ...restProps }) => {
|
|
23
11
|
const curIdx = steps.findIndex(step => step.id === currentStepId);
|
|
24
12
|
const curStep = steps[curIdx];
|
|
25
13
|
const fillScale = curIdx / (steps.length - 1);
|
|
26
14
|
const [currentStepEl, setCurrentStepEl] = useElement();
|
|
27
15
|
const [stepEls, setStepEls] = useState({});
|
|
16
|
+
const stepsRef = useRef(null);
|
|
28
17
|
const theme = useTheme();
|
|
29
18
|
let popoverPlacement = 'top';
|
|
30
19
|
if (curIdx === 0)
|
|
31
20
|
popoverPlacement = 'top-start';
|
|
32
21
|
else if (curIdx === steps.length - 1)
|
|
33
22
|
popoverPlacement = 'top-end';
|
|
23
|
+
useArrows(stepsRef, {
|
|
24
|
+
selector: 'button',
|
|
25
|
+
cycle: false,
|
|
26
|
+
dir: 'left-right',
|
|
27
|
+
initialFocusElement: currentStepEl
|
|
28
|
+
});
|
|
34
29
|
useEffect(() => {
|
|
35
|
-
|
|
30
|
+
if (stepEls[curStep.id] && stepEls[curStep.id] !== currentStepEl) {
|
|
31
|
+
setCurrentStepEl(stepEls[curStep.id]);
|
|
32
|
+
}
|
|
36
33
|
}, [Object.keys(stepEls), curStep]);
|
|
37
|
-
return (_jsxs(StyledFormProgress, { ...restProps, container: { alignItems: 'center' },
|
|
34
|
+
return (_jsxs(StyledFormProgress, { ...restProps, container: { alignItems: 'center' }, children: [_jsx(CurrentStepPopover, { show: true, target: currentStepEl, placement: popoverPlacement, strategy: 'absolute', portal: false, hideOnTargetHidden: true, modifiers: [
|
|
38
35
|
{
|
|
39
36
|
name: 'offset',
|
|
40
37
|
options: {
|
|
@@ -58,19 +55,19 @@ const HorizontalFormProgress = ({ steps, currentStepId, ...restProps }) => {
|
|
|
58
55
|
padding: 0
|
|
59
56
|
}
|
|
60
57
|
}
|
|
61
|
-
], children: _jsx(Text, { variant: 'h4', children: curStep.name }) }), _jsx(Flex, { container: { justify: 'between', alignItems: 'center' }, item: { grow: 1 }, children: steps.map((step, index) => {
|
|
62
|
-
return (_jsx(StepMarker, { ref: (el) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
], children: _jsx(Text, { variant: 'h4', children: curStep.name }) }), _jsx(Flex, { ref: stepsRef, as: StyledStepMarkers, container: { justify: 'between', alignItems: 'center' }, item: { grow: 1 }, children: steps.map((step, index) => {
|
|
59
|
+
return (_jsx("li", { children: _jsx(StepMarker, { ref: (el) => {
|
|
60
|
+
setStepEls(curr => {
|
|
61
|
+
const newEls = { ...curr };
|
|
62
|
+
if (!el && newEls[step.id]) {
|
|
63
|
+
delete newEls[step.id];
|
|
64
|
+
return newEls;
|
|
65
|
+
}
|
|
66
|
+
if (el)
|
|
67
|
+
return { ...newEls, [step.id]: el };
|
|
67
68
|
return newEls;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return { ...newEls, [step.id]: el };
|
|
71
|
-
return newEls;
|
|
72
|
-
});
|
|
73
|
-
}, "aria-label": step.name, "aria-describedby": step.id, current: index === curIdx, depth: step.depth, prior: index < curIdx, onClick: step.onMarkerClick, children: index !== curIdx && (_jsx(Tooltip, { target: stepEls[step.id], showDelay: 'none', hideDelay: 'short', portal: false, children: step.name })) }, step.id));
|
|
69
|
+
});
|
|
70
|
+
}, id: step.id, "aria-label": step.name, "aria-describedby": step.id, "aria-current": index === curIdx ? 'step' : undefined, current: index === curIdx, depth: step.depth, prior: index < curIdx, onClick: step.onMarkerClick, children: index !== curIdx && (_jsx(Tooltip, { target: stepEls[step.id], showDelay: 'none', hideDelay: 'short', children: step.name })) }) }, step.id));
|
|
74
71
|
}) }), _jsx(StyledBar, { children: _jsx(StyledFill, { style: { '--fillScale': fillScale } }) })] }));
|
|
75
72
|
};
|
|
76
73
|
export default HorizontalFormProgress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalFormProgress.js","sourceRoot":"","sources":["../../../src/components/MultiStepForm/HorizontalFormProgress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"HorizontalFormProgress.js","sourceRoot":"","sources":["../../../src/components/MultiStepForm/HorizontalFormProgress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,SAAS,EAAE,UA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C,UAAU,IAAC,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAmB,GAAI,GAC1D,IACO,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["import { remToPx, stripUnit } from 'polished';\nimport { useEffect, useRef, useState } from 'react';\nimport type { FunctionComponent, CSSProperties } from 'react';\n\nimport { useArrows, useElement, useTheme } from '../../hooks';\nimport type { ForwardProps } from '../../types';\nimport { tryCatch } from '../../utils';\nimport Flex from '../Flex';\nimport Text from '../Text';\nimport Tooltip from '../Tooltip';\n\nimport {\n CurrentStepPopover,\n StepMarker,\n StyledBar,\n StyledFill,\n StyledFormProgress,\n StyledStepMarkers\n} from './FormProgress.styles';\nimport type MultiStepFormProps from './MultiStepForm.types';\n\ninterface FormProgressProps {\n steps: MultiStepFormProps['steps'];\n currentStepId: MultiStepFormProps['currentStepId'];\n}\n\nconst HorizontalFormProgress: FunctionComponent<FormProgressProps & ForwardProps> = ({\n steps,\n currentStepId,\n ...restProps\n}) => {\n const curIdx = steps.findIndex(step => step.id === currentStepId);\n const curStep = steps[curIdx];\n const fillScale = curIdx / (steps.length - 1);\n\n const [currentStepEl, setCurrentStepEl] = useElement();\n const [stepEls, setStepEls] = useState<Record<string, HTMLElement>>({});\n const stepsRef = useRef(null);\n const theme = useTheme();\n\n let popoverPlacement: 'top' | 'top-start' | 'top-end' = 'top';\n if (curIdx === 0) popoverPlacement = 'top-start';\n else if (curIdx === steps.length - 1) popoverPlacement = 'top-end';\n\n useArrows(stepsRef, {\n selector: 'button',\n cycle: false,\n dir: 'left-right',\n initialFocusElement: currentStepEl\n });\n\n useEffect(() => {\n if (stepEls[curStep.id] && stepEls[curStep.id] !== currentStepEl) {\n setCurrentStepEl(stepEls[curStep.id]);\n }\n }, [Object.keys(stepEls), curStep]);\n\n return (\n <StyledFormProgress {...restProps} container={{ alignItems: 'center' }}>\n <CurrentStepPopover\n show\n target={currentStepEl}\n placement={popoverPlacement}\n strategy='absolute'\n portal={false}\n hideOnTargetHidden\n modifiers={[\n {\n name: 'offset',\n options: {\n offset: [\n 0,\n tryCatch(\n () => stripUnit(remToPx(theme.base.spacing)),\n () => 8\n )\n ]\n }\n },\n {\n name: 'placeAndContain',\n enabled: false\n },\n {\n name: 'flip',\n enabled: false\n },\n {\n name: 'preventOverflow',\n options: {\n padding: 0\n }\n }\n ]}\n >\n <Text variant='h4'>{curStep.name}</Text>\n </CurrentStepPopover>\n <Flex\n ref={stepsRef}\n as={StyledStepMarkers}\n container={{ justify: 'between', alignItems: 'center' }}\n item={{ grow: 1 }}\n >\n {steps.map((step, index) => {\n return (\n <li key={step.id}>\n <StepMarker\n ref={(el: HTMLElement | null) => {\n setStepEls(curr => {\n const newEls = { ...curr };\n if (!el && newEls[step.id]) {\n delete newEls[step.id];\n return newEls;\n }\n if (el) return { ...newEls, [step.id]: el };\n return newEls;\n });\n }}\n id={step.id}\n aria-label={step.name}\n aria-describedby={step.id}\n aria-current={index === curIdx ? 'step' : undefined}\n current={index === curIdx}\n depth={step.depth}\n prior={index < curIdx}\n onClick={step.onMarkerClick}\n >\n {index !== curIdx && (\n <Tooltip target={stepEls[step.id]} showDelay='none' hideDelay='short'>\n {step.name}\n </Tooltip>\n )}\n </StepMarker>\n </li>\n );\n })}\n </Flex>\n\n <StyledBar>\n <StyledFill style={{ '--fillScale': fillScale } as CSSProperties} />\n </StyledBar>\n </StyledFormProgress>\n );\n};\n\nexport default HorizontalFormProgress;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiStepForm.d.ts","sourceRoot":"","sources":["../../../src/components/MultiStepForm/MultiStepForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MultiStepForm.d.ts","sourceRoot":"","sources":["../../../src/components/MultiStepForm/MultiStepForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAYhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAWhD,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAC;AAI5D,eAAO,MAAM,UAAU;;;SAkBtB,CAAC;AAIF,eAAO,MAAM,iBAAiB,yGAAe,CAAC;AAE9C,eAAO,MAAM,yBAAyB,iKAqBpC,CAAC;AAIH,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAwK9E,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useRef, useEffect } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import { useAfterInitialEffect, useUID, useI18n, usePrevious, useBreakpoint, useTheme } from '../../hooks';
|
|
4
|
+
import { useAfterInitialEffect, useUID, useI18n, usePrevious, useBreakpoint, useTheme, useConsolidatedRef } from '../../hooks';
|
|
5
5
|
import { getFocusables } from '../../utils';
|
|
6
6
|
import { calculateFontSize } from '../../styles';
|
|
7
7
|
import Flex from '../Flex';
|
|
@@ -49,35 +49,51 @@ export const StyledRequiredFieldLegend = styled(Text)(({ theme }) => {
|
|
|
49
49
|
});
|
|
50
50
|
StyledRequiredFieldLegend.defaultProps = defaultThemeProp;
|
|
51
51
|
export const MultiStepForm = forwardRef(function MultiStepForm({ currentStepId, steps, heading, stepIndicator: stepIndicatorProp = steps.length < 2 ? 'none' : 'horizontal', progress, ...restProps }, ref) {
|
|
52
|
+
const multiStepRef = useConsolidatedRef(ref);
|
|
53
|
+
const progressIndicatorRef = useRef(null);
|
|
52
54
|
const multiStepFormContentRef = useRef(null);
|
|
55
|
+
const multiStepActionsRef = useRef(null);
|
|
53
56
|
const previousId = usePrevious(currentStepId);
|
|
54
57
|
const currentStep = steps.find(step => step.id === currentStepId);
|
|
55
58
|
const headingId = useUID();
|
|
56
59
|
const descriptionId = useUID();
|
|
57
60
|
const t = useI18n();
|
|
58
61
|
const { base: { 'content-width': contentWidth } } = useTheme();
|
|
62
|
+
const isSmallOrAbove = useBreakpoint('sm');
|
|
63
|
+
const stepIndicator = stepIndicatorProp === 'vertical' && !isSmallOrAbove ? 'horizontal' : stepIndicatorProp;
|
|
59
64
|
const setFocus = () => {
|
|
60
65
|
if (progress)
|
|
61
66
|
return;
|
|
62
|
-
|
|
67
|
+
let focusables = [];
|
|
68
|
+
if (stepIndicatorProp === 'horizontal' && progressIndicatorRef.current) {
|
|
69
|
+
focusables = [
|
|
70
|
+
...progressIndicatorRef.current.querySelectorAll(`[id="${currentStepId}"]`)
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
focusables = getFocusables(multiStepFormContentRef);
|
|
75
|
+
}
|
|
63
76
|
focusables[0]?.focus();
|
|
64
77
|
};
|
|
78
|
+
// Set focus if the current step id updates
|
|
65
79
|
useEffect(() => {
|
|
66
|
-
if (previousId === undefined)
|
|
67
|
-
return;
|
|
68
80
|
if (previousId !== currentStepId) {
|
|
69
|
-
|
|
70
|
-
if (focusableElements.length)
|
|
71
|
-
focusableElements[0].focus();
|
|
81
|
+
setFocus();
|
|
72
82
|
}
|
|
73
83
|
}, [currentStepId, previousId]);
|
|
84
|
+
// Set focus if the form content updates while focus is within the actions region of the form
|
|
85
|
+
useAfterInitialEffect(() => {
|
|
86
|
+
if (multiStepActionsRef.current &&
|
|
87
|
+
multiStepActionsRef.current.contains(document.activeElement)) {
|
|
88
|
+
setFocus();
|
|
89
|
+
}
|
|
90
|
+
}, [currentStep.content]);
|
|
91
|
+
// Set focus if a progress state resolves
|
|
74
92
|
useAfterInitialEffect(() => {
|
|
75
93
|
if (!progress) {
|
|
76
94
|
setFocus();
|
|
77
95
|
}
|
|
78
96
|
}, [progress]);
|
|
79
|
-
const isSmallOrAbove = useBreakpoint('sm');
|
|
80
|
-
const stepIndicator = stepIndicatorProp === 'vertical' && !isSmallOrAbove ? 'horizontal' : stepIndicatorProp;
|
|
81
97
|
let areaDef = '';
|
|
82
98
|
switch (stepIndicator) {
|
|
83
99
|
case 'horizontal':
|
|
@@ -102,7 +118,7 @@ export const MultiStepForm = forwardRef(function MultiStepForm({ currentStepId,
|
|
|
102
118
|
areaDef += '"description" ';
|
|
103
119
|
areaDef += '"content"';
|
|
104
120
|
}
|
|
105
|
-
return (_jsxs(StyledForm, { ref:
|
|
121
|
+
return (_jsxs(StyledForm, { ref: multiStepRef, ...restProps, "aria-labelledby": heading ? headingId : undefined, "aria-describedby": currentStep.description ? descriptionId : undefined, heading: !!heading, actions: !!currentStep.actions, children: [heading && (_jsx(Text, { id: headingId, variant: 'h3', children: heading })), _jsxs(Grid, { ref: progressIndicatorRef, container: {
|
|
106
122
|
cols: stepIndicator === 'vertical'
|
|
107
123
|
? `2fr minmax(${contentWidth.xs}, 1fr)`
|
|
108
124
|
: 'minmax(0, 1fr)',
|
|
@@ -110,7 +126,7 @@ export const MultiStepForm = forwardRef(function MultiStepForm({ currentStepId,
|
|
|
110
126
|
gap: 2
|
|
111
127
|
}, inert: progress ? '' : undefined, children: [steps.length > 1 && (_jsxs(Grid, { item: { area: 'stepIndicator' }, children: [stepIndicator === 'horizontal' && (_jsx(Grid, { item: { area: 'stepIndicator' }, as: HorizontalFormProgress, steps: steps, currentStepId: currentStepId })), stepIndicator === 'vertical' && (_jsx(Grid, { item: { area: 'stepIndicator' }, as: VerticalFormProgress, steps: steps, currentStepId: currentStepId })), _jsx(VisuallyHiddenText, { "aria-live": 'polite', children: previousId !== undefined && previousId !== currentStepId
|
|
112
128
|
? t('step_changed_to_name', [currentStep.name])
|
|
113
|
-
: '' })] })), currentStep.banners && _jsx(Grid, { item: { area: 'banners' }, children: currentStep.banners }), currentStep.description && (_jsx(Grid, { item: { area: 'description' }, children: _jsx(HTML, { id: descriptionId, as: 'p', content: currentStep.description }) })), _jsx(Grid, { item: { area: 'content' }, as: StyledFormContent, ref: multiStepFormContentRef, children: currentStep.content }), _jsx(Progress, { visible: !!progress, focusOnVisible: true, placement: 'local', message: typeof progress === 'string' ? progress : undefined })] }), currentStep.actions && (_jsx(Flex, { container: { justify: 'between', alignItems: 'center' }, children: currentStep.actions }))] }));
|
|
129
|
+
: '' })] })), currentStep.banners && _jsx(Grid, { item: { area: 'banners' }, children: currentStep.banners }), currentStep.description && (_jsx(Grid, { item: { area: 'description' }, children: _jsx(HTML, { id: descriptionId, as: 'p', content: currentStep.description }) })), _jsx(Grid, { item: { area: 'content' }, as: StyledFormContent, ref: multiStepFormContentRef, children: currentStep.content }), _jsx(Progress, { visible: !!progress, focusOnVisible: true, placement: 'local', message: typeof progress === 'string' ? progress : undefined })] }), currentStep.actions && (_jsx(Flex, { ref: multiStepActionsRef, container: { justify: 'between', alignItems: 'center' }, children: currentStep.actions }))] }));
|
|
114
130
|
});
|
|
115
131
|
export default MultiStepForm;
|
|
116
132
|
//# sourceMappingURL=MultiStepForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiStepForm.js","sourceRoot":"","sources":["../../../src/components/MultiStepForm/MultiStepForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,qBAAqB,EACrB,MAAM,EACN,OAAO,EACP,WAAW,EACX,aAAa,EACb,QAAQ,EACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,kBAAkB,MAAM,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AAI,EAAE,aAAa,EAAE,YACjC,KAAC,IAAI,IAAC,EAAE,EAAE,aAAa,EAAE,EAAE,EAAC,GAAG,EAAC,OAAO,EAAE,WAAW,CAAC,WAAW,GAAI,GAC/D,CACR,EAED,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,uBAAuB,YACjF,WAAW,CAAC,OAAO,GACf,EAEP,KAAC,QAAQ,IACP,OAAO,EAAE,CAAC,CAAC,QAAQ,EACnB,cAAc,QACd,SAAS,EAAC,OAAO,EACjB,OAAO,EAAE,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC5D,IACG,EACN,WAAW,CAAC,OAAO,IAAI,CACtB,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,YAC1D,WAAW,CAAC,OAAO,GACf,CACR,IACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect } from 'react';\nimport type { FunctionComponent, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n useAfterInitialEffect,\n useUID,\n useI18n,\n usePrevious,\n useBreakpoint,\n useTheme\n} from '../../hooks';\nimport type { ForwardProps } from '../../types';\nimport { getFocusables } from '../../utils';\nimport { calculateFontSize } from '../../styles';\nimport Flex from '../Flex';\nimport Text from '../Text';\nimport HTML from '../HTML';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport Grid, { StyledGrid } from '../Grid';\nimport { defaultThemeProp } from '../../theme';\nimport Progress from '../Progress';\n\nimport type MultiStepFormProps from './MultiStepForm.types';\nimport VerticalFormProgress from './VerticalFormProgress';\nimport HorizontalFormProgress from './HorizontalFormProgress';\n\nexport const StyledForm = styled.form<{ actions?: boolean; heading?: boolean }>(\n ({ actions, heading, theme }) => {\n return css`\n & > ${StyledGrid} {\n position: relative;\n\n ${actions &&\n css`\n padding-block-end: calc(2 * ${theme.base.spacing});\n `}\n\n ${heading &&\n css`\n padding-block-start: calc(2 * ${theme.base.spacing});\n `}\n }\n `;\n }\n);\n\nStyledForm.defaultProps = defaultThemeProp;\n\nexport const StyledFormContent = styled.div``;\n\nexport const StyledRequiredFieldLegend = styled(Text)(({ theme }) => {\n const {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n palette: { urgent }\n }\n } = theme;\n const { xxs: infoFontSize } = calculateFontSize(fontSize, fontScale);\n\n return css`\n font-size: ${infoFontSize};\n font-style: italic;\n\n &::before {\n display: 'inline';\n content: '\\\\00a0*';\n vertical-align: top;\n color: ${urgent};\n }\n `;\n});\n\nStyledRequiredFieldLegend.defaultProps = defaultThemeProp;\n\nexport const MultiStepForm: FunctionComponent<MultiStepFormProps & ForwardProps> = forwardRef(\n function MultiStepForm(\n {\n currentStepId,\n steps,\n heading,\n stepIndicator: stepIndicatorProp = steps.length < 2 ? 'none' : 'horizontal',\n progress,\n ...restProps\n }: PropsWithoutRef<MultiStepFormProps>,\n ref: MultiStepFormProps['ref']\n ) {\n const multiStepFormContentRef = useRef(null);\n\n const previousId = usePrevious(currentStepId);\n const currentStep = steps.find(step => step.id === currentStepId)!;\n const headingId = useUID();\n const descriptionId = useUID();\n const t = useI18n();\n const {\n base: { 'content-width': contentWidth }\n } = useTheme();\n\n const setFocus = () => {\n if (progress) return;\n\n const focusables = getFocusables(multiStepFormContentRef);\n focusables[0]?.focus();\n };\n\n useEffect(() => {\n if (previousId === undefined) return;\n\n if (previousId !== currentStepId) {\n const focusableElements = getFocusables(multiStepFormContentRef);\n\n if (focusableElements.length) focusableElements[0].focus();\n }\n }, [currentStepId, previousId]);\n\n useAfterInitialEffect(() => {\n if (!progress) {\n setFocus();\n }\n }, [progress]);\n\n const isSmallOrAbove = useBreakpoint('sm');\n\n const stepIndicator =\n stepIndicatorProp === 'vertical' && !isSmallOrAbove ? 'horizontal' : stepIndicatorProp;\n\n let areaDef = '';\n switch (stepIndicator) {\n case 'horizontal':\n areaDef += '\"stepIndicator\" ';\n if (currentStep.banners) areaDef += '\"banners\" ';\n if (currentStep.description) areaDef += '\"description\" ';\n areaDef += '\"content\"';\n break;\n case 'vertical':\n if (currentStep.banners) areaDef += '\"banners stepIndicator\" ';\n if (currentStep.description) areaDef += '\"description stepIndicator\" ';\n areaDef += '\"content stepIndicator\"';\n break;\n default:\n if (currentStep.banners) areaDef += '\"banners\" ';\n if (currentStep.description) areaDef += '\"description\" ';\n areaDef += '\"content\"';\n }\n\n return (\n <StyledForm\n ref={ref}\n {...restProps}\n aria-labelledby={heading ? headingId : undefined}\n aria-describedby={currentStep.description ? descriptionId : undefined}\n heading={!!heading}\n actions={!!currentStep.actions}\n >\n {heading && (\n <Text id={headingId} variant='h3'>\n {heading}\n </Text>\n )}\n\n <Grid\n container={{\n cols:\n stepIndicator === 'vertical'\n ? `2fr minmax(${contentWidth.xs}, 1fr)`\n : 'minmax(0, 1fr)',\n areas: areaDef,\n gap: 2\n }}\n inert={progress ? '' : undefined}\n >\n {steps.length > 1 && (\n <Grid item={{ area: 'stepIndicator' }}>\n {stepIndicator === 'horizontal' && (\n <Grid\n item={{ area: 'stepIndicator' }}\n as={HorizontalFormProgress}\n steps={steps}\n currentStepId={currentStepId}\n />\n )}\n {stepIndicator === 'vertical' && (\n <Grid\n item={{ area: 'stepIndicator' }}\n as={VerticalFormProgress}\n steps={steps}\n currentStepId={currentStepId}\n />\n )}\n <VisuallyHiddenText aria-live='polite'>\n {previousId !== undefined && previousId !== currentStepId\n ? t('step_changed_to_name', [currentStep.name])\n : ''}\n </VisuallyHiddenText>\n </Grid>\n )}\n\n {currentStep.banners && <Grid item={{ area: 'banners' }}>{currentStep.banners}</Grid>}\n\n {currentStep.description && (\n <Grid item={{ area: 'description' }}>\n <HTML id={descriptionId} as='p' content={currentStep.description} />\n </Grid>\n )}\n\n <Grid item={{ area: 'content' }} as={StyledFormContent} ref={multiStepFormContentRef}>\n {currentStep.content}\n </Grid>\n\n <Progress\n visible={!!progress}\n focusOnVisible\n placement='local'\n message={typeof progress === 'string' ? progress : undefined}\n />\n </Grid>\n {currentStep.actions && (\n <Flex container={{ justify: 'between', alignItems: 'center' }}>\n {currentStep.actions}\n </Flex>\n )}\n </StyledForm>\n );\n }\n);\n\nexport default MultiStepForm;\n"]}
|
|
1
|
+
{"version":3,"file":"MultiStepForm.js","sourceRoot":"","sources":["../../../src/components/MultiStepForm/MultiStepForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,qBAAqB,EACrB,MAAM,EACN,OAAO,EACP,WAAW,EACX,aAAa,EACb,QAAQ,EACR,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AAGnC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAE9D,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CACnC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EA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OAAO,IAAI,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,YAAG,WAAW,CAAC,OAAO,GAAQ,EAEpF,WAAW,CAAC,WAAW,IAAI,CAC1B,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,YACjC,KAAC,IAAI,IAAC,EAAE,EAAE,aAAa,EAAE,EAAE,EAAC,GAAG,EAAC,OAAO,EAAE,WAAW,CAAC,WAAW,GAAI,GAC/D,CACR,EAED,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,uBAAuB,YACjF,WAAW,CAAC,OAAO,GACf,EAEP,KAAC,QAAQ,IACP,OAAO,EAAE,CAAC,CAAC,QAAQ,EACnB,cAAc,QACd,SAAS,EAAC,OAAO,EACjB,OAAO,EAAE,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC5D,IACG,EACN,WAAW,CAAC,OAAO,IAAI,CACtB,KAAC,IAAI,IAAC,GAAG,EAAE,mBAAmB,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,YACpF,WAAW,CAAC,OAAO,GACf,CACR,IACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect } from 'react';\nimport type { FunctionComponent, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n useAfterInitialEffect,\n useUID,\n useI18n,\n usePrevious,\n useBreakpoint,\n useTheme,\n useConsolidatedRef\n} from '../../hooks';\nimport type { ForwardProps } from '../../types';\nimport { getFocusables } from '../../utils';\nimport { calculateFontSize } from '../../styles';\nimport Flex from '../Flex';\nimport Text from '../Text';\nimport HTML from '../HTML';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport Grid, { StyledGrid } from '../Grid';\nimport { defaultThemeProp } from '../../theme';\nimport Progress from '../Progress';\n\nimport type MultiStepFormProps from './MultiStepForm.types';\nimport VerticalFormProgress from './VerticalFormProgress';\nimport HorizontalFormProgress from './HorizontalFormProgress';\n\nexport const StyledForm = styled.form<{ actions?: boolean; heading?: boolean }>(\n ({ actions, heading, theme }) => {\n return css`\n & > ${StyledGrid} {\n position: relative;\n\n ${actions &&\n css`\n padding-block-end: calc(2 * ${theme.base.spacing});\n `}\n\n ${heading &&\n css`\n padding-block-start: calc(2 * ${theme.base.spacing});\n `}\n }\n `;\n }\n);\n\nStyledForm.defaultProps = defaultThemeProp;\n\nexport const StyledFormContent = styled.div``;\n\nexport const StyledRequiredFieldLegend = styled(Text)(({ theme }) => {\n const {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n palette: { urgent }\n }\n } = theme;\n const { xxs: infoFontSize } = calculateFontSize(fontSize, fontScale);\n\n return css`\n font-size: ${infoFontSize};\n font-style: italic;\n\n &::before {\n display: 'inline';\n content: '\\\\00a0*';\n vertical-align: top;\n color: ${urgent};\n }\n `;\n});\n\nStyledRequiredFieldLegend.defaultProps = defaultThemeProp;\n\nexport const MultiStepForm: FunctionComponent<MultiStepFormProps & ForwardProps> = forwardRef(\n function MultiStepForm(\n {\n currentStepId,\n steps,\n heading,\n stepIndicator: stepIndicatorProp = steps.length < 2 ? 'none' : 'horizontal',\n progress,\n ...restProps\n }: PropsWithoutRef<MultiStepFormProps>,\n ref: MultiStepFormProps['ref']\n ) {\n const multiStepRef = useConsolidatedRef<HTMLFormElement>(ref);\n const progressIndicatorRef = useRef<HTMLDivElement>(null);\n const multiStepFormContentRef = useRef<HTMLDivElement>(null);\n const multiStepActionsRef = useRef<HTMLDivElement>(null);\n\n const previousId = usePrevious(currentStepId);\n const currentStep = steps.find(step => step.id === currentStepId)!;\n const headingId = useUID();\n const descriptionId = useUID();\n const t = useI18n();\n const {\n base: { 'content-width': contentWidth }\n } = useTheme();\n\n const isSmallOrAbove = useBreakpoint('sm');\n\n const stepIndicator =\n stepIndicatorProp === 'vertical' && !isSmallOrAbove ? 'horizontal' : stepIndicatorProp;\n\n const setFocus = () => {\n if (progress) return;\n\n let focusables: HTMLElement[] = [];\n if (stepIndicatorProp === 'horizontal' && progressIndicatorRef.current) {\n focusables = [\n ...progressIndicatorRef.current.querySelectorAll(`[id=\"${currentStepId}\"]`)\n ] as HTMLElement[];\n } else {\n focusables = getFocusables(multiStepFormContentRef);\n }\n focusables[0]?.focus();\n };\n\n // Set focus if the current step id updates\n useEffect(() => {\n if (previousId !== currentStepId) {\n setFocus();\n }\n }, [currentStepId, previousId]);\n\n // Set focus if the form content updates while focus is within the actions region of the form\n useAfterInitialEffect(() => {\n if (\n multiStepActionsRef.current &&\n multiStepActionsRef.current.contains(document.activeElement)\n ) {\n setFocus();\n }\n }, [currentStep.content]);\n\n // Set focus if a progress state resolves\n useAfterInitialEffect(() => {\n if (!progress) {\n setFocus();\n }\n }, [progress]);\n\n let areaDef = '';\n switch (stepIndicator) {\n case 'horizontal':\n areaDef += '\"stepIndicator\" ';\n if (currentStep.banners) areaDef += '\"banners\" ';\n if (currentStep.description) areaDef += '\"description\" ';\n areaDef += '\"content\"';\n break;\n case 'vertical':\n if (currentStep.banners) areaDef += '\"banners stepIndicator\" ';\n if (currentStep.description) areaDef += '\"description stepIndicator\" ';\n areaDef += '\"content stepIndicator\"';\n break;\n default:\n if (currentStep.banners) areaDef += '\"banners\" ';\n if (currentStep.description) areaDef += '\"description\" ';\n areaDef += '\"content\"';\n }\n\n return (\n <StyledForm\n ref={multiStepRef}\n {...restProps}\n aria-labelledby={heading ? headingId : undefined}\n aria-describedby={currentStep.description ? descriptionId : undefined}\n heading={!!heading}\n actions={!!currentStep.actions}\n >\n {heading && (\n <Text id={headingId} variant='h3'>\n {heading}\n </Text>\n )}\n\n <Grid\n ref={progressIndicatorRef}\n container={{\n cols:\n stepIndicator === 'vertical'\n ? `2fr minmax(${contentWidth.xs}, 1fr)`\n : 'minmax(0, 1fr)',\n areas: areaDef,\n gap: 2\n }}\n inert={progress ? '' : undefined}\n >\n {steps.length > 1 && (\n <Grid item={{ area: 'stepIndicator' }}>\n {stepIndicator === 'horizontal' && (\n <Grid\n item={{ area: 'stepIndicator' }}\n as={HorizontalFormProgress}\n steps={steps}\n currentStepId={currentStepId}\n />\n )}\n {stepIndicator === 'vertical' && (\n <Grid\n item={{ area: 'stepIndicator' }}\n as={VerticalFormProgress}\n steps={steps}\n currentStepId={currentStepId}\n />\n )}\n <VisuallyHiddenText aria-live='polite'>\n {previousId !== undefined && previousId !== currentStepId\n ? t('step_changed_to_name', [currentStep.name])\n : ''}\n </VisuallyHiddenText>\n </Grid>\n )}\n\n {currentStep.banners && <Grid item={{ area: 'banners' }}>{currentStep.banners}</Grid>}\n\n {currentStep.description && (\n <Grid item={{ area: 'description' }}>\n <HTML id={descriptionId} as='p' content={currentStep.description} />\n </Grid>\n )}\n\n <Grid item={{ area: 'content' }} as={StyledFormContent} ref={multiStepFormContentRef}>\n {currentStep.content}\n </Grid>\n\n <Progress\n visible={!!progress}\n focusOnVisible\n placement='local'\n message={typeof progress === 'string' ? progress : undefined}\n />\n </Grid>\n {currentStep.actions && (\n <Flex ref={multiStepActionsRef} container={{ justify: 'between', alignItems: 'center' }}>\n {currentStep.actions}\n </Flex>\n )}\n </StyledForm>\n );\n }\n);\n\nexport default MultiStepForm;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoValue.d.ts","sourceRoot":"","sources":["../../../src/components/NoValue/NoValue.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NoValue.d.ts","sourceRoot":"","sources":["../../../src/components/NoValue/NoValue.tsx"],"names":[],"mappings":"AAUA,QAAA,MAAM,OAAO,mBAQZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from 'styled-components';
|
|
2
3
|
import { useI18n } from '../../hooks';
|
|
3
4
|
import VisuallyHiddenText from '../VisuallyHiddenText/VisuallyHiddenText';
|
|
5
|
+
const StyledNoValue = styled.span `
|
|
6
|
+
display: inline-block;
|
|
7
|
+
position: relative;
|
|
8
|
+
`;
|
|
4
9
|
const NoValue = () => {
|
|
5
10
|
const t = useI18n();
|
|
6
|
-
return (_jsxs(
|
|
11
|
+
return (_jsxs(StyledNoValue, { children: [_jsx("span", { "aria-hidden": true, children: "\u2013\u2013" }), _jsx(VisuallyHiddenText, { children: t('no_value') })] }));
|
|
7
12
|
};
|
|
8
13
|
export default NoValue;
|
|
9
14
|
//# sourceMappingURL=NoValue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoValue.js","sourceRoot":"","sources":["../../../src/components/NoValue/NoValue.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,kBAAkB,MAAM,0CAA0C,CAAC;AAE1E,MAAM,OAAO,GAAG,GAAG,EAAE;IACnB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,OAAO,CACL,
|
|
1
|
+
{"version":3,"file":"NoValue.js","sourceRoot":"","sources":["../../../src/components/NoValue/NoValue.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,kBAAkB,MAAM,0CAA0C,CAAC;AAE1E,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAA;;;CAGhC,CAAC;AAEF,MAAM,OAAO,GAAG,GAAG,EAAE;IACnB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,OAAO,CACL,MAAC,aAAa,eACZ,+DAAuC,EACvC,KAAC,kBAAkB,cAAE,CAAC,CAAC,UAAU,CAAC,GAAsB,IAC1C,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import styled from 'styled-components';\n\nimport { useI18n } from '../../hooks';\nimport VisuallyHiddenText from '../VisuallyHiddenText/VisuallyHiddenText';\n\nconst StyledNoValue = styled.span`\n display: inline-block;\n position: relative;\n`;\n\nconst NoValue = () => {\n const t = useI18n();\n return (\n <StyledNoValue>\n <span aria-hidden>––</span>\n <VisuallyHiddenText>{t('no_value')}</VisuallyHiddenText>\n </StyledNoValue>\n );\n};\n\nexport default NoValue;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmB,GAAG,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG1F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAS3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAM3D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAC9C,MAAM,WAAW,YAAY,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,SAAS;IAChF,2IAA2I;IAC3I,MAAM,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAAC;IACxC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;IACtD;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;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AAC,SAAS,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,SAAS;IAChF,2IAA2I;IAC3I,MAAM,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAAC;IACxC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;IACtD;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC;IAChD;;;OAGG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;IAC9C;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC;IAChD;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yGAAyG;IACzG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,kCAAkC;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,uCAAuC;IACvC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAQD,QAAA,MAAM,OAAO,EAAE,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,EAC/C,KAAK,EAAE,YAAY,CAAC,SAAS,CAAC,GAAG,YAAY,KAC1C,YAAY,GAAG,IAwPlB,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
|
@@ -147,15 +147,24 @@ const Popover = forwardRef(function Popover({ show = true, portal = true, target
|
|
|
147
147
|
useEffect(() => {
|
|
148
148
|
if (groupId && show)
|
|
149
149
|
setActive(uid, groupId);
|
|
150
|
+
/**
|
|
151
|
+
* TODO: Remove usages of forceUpdateRef.current?.() below in favor of permanent fix to address following issues:
|
|
152
|
+
* * Resize observer is not running immediately after initial mount
|
|
153
|
+
* * Menu scrollAt is not applied on initial render
|
|
154
|
+
*/
|
|
150
155
|
if (windowIsAvailable) {
|
|
151
156
|
if (timeout.current)
|
|
152
157
|
clearTimeout(timeout.current);
|
|
153
158
|
timeout.current = window.setTimeout(() => {
|
|
154
159
|
setShowPopover(show);
|
|
160
|
+
if (show)
|
|
161
|
+
forceUpdateRef.current?.();
|
|
155
162
|
}, delays[show ? showDelay : hideDelay]);
|
|
156
163
|
}
|
|
157
164
|
else {
|
|
158
165
|
setShowPopover(show);
|
|
166
|
+
if (show)
|
|
167
|
+
forceUpdateRef.current?.();
|
|
159
168
|
}
|
|
160
169
|
}, [show]);
|
|
161
170
|
useEffect(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,MAAM,EACN,SAAS,EACT,OAAO,EACP,QAAQ,EACR,eAAe,EAChB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,MAAM,EACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAG/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA6D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;aACvD;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC;IAExC,MAAM,OAAO,GAAG,CACd,MAAC,aAAa,OACR,SAAS,qBACI,SAAS,EAC1B,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,YAAY,CAAC,EAClC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,KACjC,UAAU,CAAC,MAAM,aAEpB,KAAK,IAAI,KAAC,kBAAkB,IAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,GAAI,EAC1E,QAAQ,IACK,CACjB,CAAC;IAEF,IAAI,CAAC,MAAM,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpF,OAAO,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAChF,CAAC,CAAC,CAAC;AAEH,eAAe,OAAO,CAAC","sourcesContent":["import {\n forwardRef,\n useContext,\n useRef,\n useEffect,\n useMemo,\n useState,\n useLayoutEffect\n} from 'react';\nimport type { PropsWithoutRef, Ref, CSSProperties, ReactElement, ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\nimport { usePopper } from 'react-popper';\nimport type { PopperProps } from 'react-popper';\nimport type { VirtualElement } from '@popperjs/core';\nimport type { OffsetModifier } from '@popperjs/core/lib/modifiers/offset';\n\nimport type { BaseProps, ForwardProps } from '../../types';\nimport {\n useAfterInitialEffect,\n useConfiguration,\n useConsolidatedRef,\n useElement,\n useUID\n} from '../../hooks';\nimport { getRelativeOffset, popoverMap, windowIsAvailable } from '../../utils';\nimport type { ConfigurationProps } from '../Configuration';\n\nimport { PopoverManagerContext } from './PopoverContext';\nimport { StyledPopover, StyledPopoverArrow } from './Popover.styles';\nimport { placeAndContain } from './modifiers';\n\nexport type Delay = 'none' | 'short' | 'long';\nexport interface PopoverProps<Modifiers extends string = string> extends BaseProps {\n /** The DOM element or [virtual element](https://popper.js.org/docs/v2/virtual-elements) that the Popover is positioned in reference to. */\n target: Element | VirtualElement | null;\n /**\n * If true, the Popover will be visible.\n * @default true\n */\n show?: boolean;\n /**\n * If true, the Popover will render outside of the current DOM hierarchy in a [portal](https://reactjs.org/docs/portals.html).\n * @default true\n */\n portal?: boolean | ConfigurationProps['portalTarget'];\n /**\n * Delay on showing the Popover.\n * @default 'none'\n */\n showDelay?: Delay;\n /**\n * Delay on hiding the Popover.\n * @default 'none'\n */\n hideDelay?: Delay;\n /**\n * [React Popper Placement](https://popper.js.org/react-popper/v2/render-props/#placement)\n * @default 'bottom'\n */\n placement?: PopperProps<Modifiers>['placement'];\n /**\n * [React Popper Strategy](https://popper.js.org/react-popper/v2/render-props/#strategy)\n * @default 'absolute'\n */\n strategy?: PopperProps<Modifiers>['strategy'];\n /**\n * [React Popper Modifiers](https://popper.js.org/react-popper/v2/render-props/#modifiers)\n * @default []\n */\n modifiers?: PopperProps<Modifiers>['modifiers'];\n /**\n * If true, an arrow will visually identify from which element the Popover is rendered.\n * @default false\n */\n arrow?: boolean;\n /** The group that the Popover belongs to. Popovers in the same group will be closed when others open. */\n groupId?: string;\n /**\n * If true, the Popover will be visibly hidden when its target leaves the viewport.\n * @default false\n */\n hideOnTargetHidden?: boolean;\n /** Callback that runs when the popover is hidden */\n onHide?: () => void;\n /** The content of the Popover. */\n children: ReactNode;\n /** The ref of the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst delays = {\n none: 0,\n short: 500,\n long: 1000\n};\n\nconst Popover: <Modifiers extends string = string>(\n props: PopoverProps<Modifiers> & ForwardProps\n) => ReactElement | null = forwardRef(function Popover(\n {\n show = true,\n portal = true,\n target,\n placement = 'bottom',\n strategy = 'fixed',\n style,\n modifiers = [],\n arrow = false,\n groupId,\n showDelay = 'none',\n hideDelay = 'none',\n hideOnTargetHidden = false,\n children,\n onHide,\n ...restProps\n }: PropsWithoutRef<PopoverProps> & { style?: CSSProperties },\n ref: PopoverProps['ref']\n) {\n const { portalTarget: configurationPortal } = useConfiguration();\n const { checkActive, setActive, popovers } = useContext(PopoverManagerContext);\n const [popperEl, setPopperEl] = useElement<HTMLDivElement>();\n const popperRef = useConsolidatedRef<HTMLDivElement>(ref, setPopperEl);\n const arrowRef = useRef<HTMLDivElement>(null);\n const forceUpdateRef = useRef<() => void>();\n const initialOffset = useRef<Pick<DOMRect, 'x' | 'y'> | null>(null);\n const [showPopover, setShowPopover] = useState(show);\n const timeout = useRef<number>();\n const uid = useUID();\n const pointerId = useUID();\n\n const resolvedTarget = target instanceof Element ? target : target?.contextElement;\n const portalTarget = typeof portal === 'boolean' ? configurationPortal : portal;\n\n const memoedModifiers = useMemo(() => {\n const flipEnabled = !!modifiers\n .slice()\n .reverse()\n .find(modifier => modifier.name === 'flip' && modifier.enabled !== undefined)?.enabled;\n\n return [\n {\n name: 'computeStyles',\n options: {\n gpuAcceleration: false\n }\n },\n {\n name: 'offset',\n options: {\n offset: [0, arrow ? 5.5 : 2]\n }\n },\n { name: 'hide', enabled: hideOnTargetHidden },\n { name: 'arrow', enabled: arrow, options: { element: arrowRef.current } },\n {\n name: 'preventOverflow',\n options: {\n tether: !modifiers.find(m => m.name === 'sameWidth'),\n padding: 16\n }\n },\n {\n ...placeAndContain,\n enabled: !flipEnabled\n },\n ...modifiers\n ];\n }, [arrow, hideOnTargetHidden, modifiers]);\n\n const offset = useMemo(() => {\n const offsetModifier = [...memoedModifiers]\n .reverse()\n .find(m => m.name === 'offset' && m.enabled !== false) as OffsetModifier | undefined;\n return Array.isArray(offsetModifier?.options?.offset)\n ? offsetModifier?.options?.offset[1] ?? 0\n : 0;\n }, [memoedModifiers]);\n\n const { styles, attributes, forceUpdate } = usePopper(target, popperEl, {\n placement,\n strategy,\n modifiers: memoedModifiers\n });\n\n if (forceUpdate) forceUpdateRef.current = forceUpdate;\n\n // Setter-less useState to avoid re-running these constructors on every render with useRef.\n const [ac] = useState(() => new AbortController());\n const [observedSet] = useState(() => new WeakSet<Element>());\n const [ro] = useState(\n () =>\n new ResizeObserver(entries => {\n let updateQueued = false;\n\n for (const { target: resizeTarget } of entries) {\n // Ignore the first ResizeObserver event for each element since ResizeObserver always fires once when calling .observe().\n if (!observedSet.has(resizeTarget)) {\n observedSet.add(resizeTarget);\n } else if (!updateQueued) {\n updateQueued = true;\n\n if (!ac.signal.aborted) {\n forceUpdateRef.current?.();\n }\n }\n }\n })\n );\n\n useEffect(() => {\n return () => {\n ac.abort();\n ro.disconnect();\n };\n }, []);\n\n useEffect(() => {\n if (!popperEl) return;\n\n ro.observe(popperEl);\n\n return () => {\n ro.unobserve(popperEl);\n };\n }, [popperEl]);\n\n useEffect(() => {\n if (!resolvedTarget) return;\n\n ro.observe(resolvedTarget);\n\n return () => {\n ro.unobserve(resolvedTarget);\n };\n }, [resolvedTarget]);\n\n useLayoutEffect(() => {\n if (resolvedTarget) {\n initialOffset.current = getRelativeOffset(resolvedTarget, document.documentElement);\n } else {\n initialOffset.current = null;\n }\n }, [resolvedTarget]);\n\n useEffect(() => {\n if (!showPopover || !resolvedTarget) return;\n\n let rafId: ReturnType<typeof requestAnimationFrame>;\n\n const checkCoords = () => {\n if (resolvedTarget && initialOffset.current) {\n const newOffset = getRelativeOffset(resolvedTarget, document.documentElement);\n\n if (initialOffset.current.x !== newOffset.x || initialOffset.current.y !== newOffset.y) {\n initialOffset.current = newOffset;\n forceUpdateRef.current?.();\n } else {\n rafId = requestAnimationFrame(checkCoords);\n }\n }\n };\n\n rafId = requestAnimationFrame(checkCoords);\n\n return () => {\n cancelAnimationFrame(rafId);\n };\n }, [showPopover, resolvedTarget]);\n\n useEffect(() => {\n if (groupId && show) setActive(uid, groupId);\n\n if (windowIsAvailable) {\n if (timeout.current) clearTimeout(timeout.current);\n timeout.current = window.setTimeout(() => {\n setShowPopover(show);\n }, delays[show ? showDelay : hideDelay]);\n } else {\n setShowPopover(show);\n }\n }, [show]);\n\n useEffect(() => {\n return () => clearTimeout(timeout.current);\n }, []);\n\n useAfterInitialEffect(() => {\n if (!showPopover) {\n onHide?.();\n }\n }, [showPopover]);\n\n useEffect(() => {\n if (groupId && popovers[groupId] && popovers[groupId] !== uid) {\n setShowPopover(false);\n }\n }, [groupId ? popovers[groupId] : undefined]);\n\n useEffect(() => {\n if (!portal || !resolvedTarget) return;\n\n if (!popoverMap.has(resolvedTarget)) {\n popoverMap.set(resolvedTarget, new Set());\n }\n\n resolvedTarget.toggleAttribute('data-popover-target', true);\n\n popoverMap.get(resolvedTarget)!.add(pointerId);\n\n return () => {\n if (!popoverMap.has(resolvedTarget)) return;\n\n popoverMap.get(resolvedTarget)!.delete(pointerId);\n\n if (popoverMap.get(resolvedTarget)!.size === 0) {\n popoverMap.delete(resolvedTarget);\n resolvedTarget.removeAttribute('data-popover-target');\n }\n };\n }, [portal, resolvedTarget, pointerId]);\n\n const content = (\n <StyledPopover\n {...restProps}\n data-popover-id={pointerId}\n portal={!!(portal && portalTarget)}\n offset={offset}\n ref={popperRef}\n style={{ ...style, ...styles.popper }}\n {...attributes.popper}\n >\n {arrow && <StyledPopoverArrow ref={arrowRef} style={{ ...styles.arrow }} />}\n {children}\n </StyledPopover>\n );\n\n if (!target || !showPopover || (groupId && !checkActive(uid, groupId))) return null;\n\n return portal && portalTarget ? createPortal(content, portalTarget) : content;\n});\n\nexport default Popover;\n"]}
|
|
1
|
+
{"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,MAAM,EACN,SAAS,EACT,OAAO,EACP,QAAQ,EACR,eAAe,EAChB,MAAM,OAAO,CAAC;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AAC;IAEpF,OAAO,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAChF,CAAC,CAAC,CAAC;AAEH,eAAe,OAAO,CAAC","sourcesContent":["import {\n forwardRef,\n useContext,\n useRef,\n useEffect,\n useMemo,\n useState,\n useLayoutEffect\n} from 'react';\nimport type { PropsWithoutRef, Ref, CSSProperties, ReactElement, ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\nimport { usePopper } from 'react-popper';\nimport type { PopperProps } from 'react-popper';\nimport type { VirtualElement } from '@popperjs/core';\nimport type { OffsetModifier } from '@popperjs/core/lib/modifiers/offset';\n\nimport type { BaseProps, ForwardProps } from '../../types';\nimport {\n useAfterInitialEffect,\n useConfiguration,\n useConsolidatedRef,\n useElement,\n useUID\n} from '../../hooks';\nimport { getRelativeOffset, popoverMap, windowIsAvailable } from '../../utils';\nimport type { ConfigurationProps } from '../Configuration';\n\nimport { PopoverManagerContext } from './PopoverContext';\nimport { StyledPopover, StyledPopoverArrow } from './Popover.styles';\nimport { placeAndContain } from './modifiers';\n\nexport type Delay = 'none' | 'short' | 'long';\nexport interface PopoverProps<Modifiers extends string = string> extends BaseProps {\n /** The DOM element or [virtual element](https://popper.js.org/docs/v2/virtual-elements) that the Popover is positioned in reference to. */\n target: Element | VirtualElement | null;\n /**\n * If true, the Popover will be visible.\n * @default true\n */\n show?: boolean;\n /**\n * If true, the Popover will render outside of the current DOM hierarchy in a [portal](https://reactjs.org/docs/portals.html).\n * @default true\n */\n portal?: boolean | ConfigurationProps['portalTarget'];\n /**\n * Delay on showing the Popover.\n * @default 'none'\n */\n showDelay?: Delay;\n /**\n * Delay on hiding the Popover.\n * @default 'none'\n */\n hideDelay?: Delay;\n /**\n * [React Popper Placement](https://popper.js.org/react-popper/v2/render-props/#placement)\n * @default 'bottom'\n */\n placement?: PopperProps<Modifiers>['placement'];\n /**\n * [React Popper Strategy](https://popper.js.org/react-popper/v2/render-props/#strategy)\n * @default 'absolute'\n */\n strategy?: PopperProps<Modifiers>['strategy'];\n /**\n * [React Popper Modifiers](https://popper.js.org/react-popper/v2/render-props/#modifiers)\n * @default []\n */\n modifiers?: PopperProps<Modifiers>['modifiers'];\n /**\n * If true, an arrow will visually identify from which element the Popover is rendered.\n * @default false\n */\n arrow?: boolean;\n /** The group that the Popover belongs to. Popovers in the same group will be closed when others open. */\n groupId?: string;\n /**\n * If true, the Popover will be visibly hidden when its target leaves the viewport.\n * @default false\n */\n hideOnTargetHidden?: boolean;\n /** Callback that runs when the popover is hidden */\n onHide?: () => void;\n /** The content of the Popover. */\n children: ReactNode;\n /** The ref of the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst delays = {\n none: 0,\n short: 500,\n long: 1000\n};\n\nconst Popover: <Modifiers extends string = string>(\n props: PopoverProps<Modifiers> & ForwardProps\n) => ReactElement | null = forwardRef(function Popover(\n {\n show = true,\n portal = true,\n target,\n placement = 'bottom',\n strategy = 'fixed',\n style,\n modifiers = [],\n arrow = false,\n groupId,\n showDelay = 'none',\n hideDelay = 'none',\n hideOnTargetHidden = false,\n children,\n onHide,\n ...restProps\n }: PropsWithoutRef<PopoverProps> & { style?: CSSProperties },\n ref: PopoverProps['ref']\n) {\n const { portalTarget: configurationPortal } = useConfiguration();\n const { checkActive, setActive, popovers } = useContext(PopoverManagerContext);\n const [popperEl, setPopperEl] = useElement<HTMLDivElement>();\n const popperRef = useConsolidatedRef<HTMLDivElement>(ref, setPopperEl);\n const arrowRef = useRef<HTMLDivElement>(null);\n const forceUpdateRef = useRef<() => void>();\n const initialOffset = useRef<Pick<DOMRect, 'x' | 'y'> | null>(null);\n const [showPopover, setShowPopover] = useState(show);\n const timeout = useRef<number>();\n const uid = useUID();\n const pointerId = useUID();\n\n const resolvedTarget = target instanceof Element ? target : target?.contextElement;\n const portalTarget = typeof portal === 'boolean' ? configurationPortal : portal;\n\n const memoedModifiers = useMemo(() => {\n const flipEnabled = !!modifiers\n .slice()\n .reverse()\n .find(modifier => modifier.name === 'flip' && modifier.enabled !== undefined)?.enabled;\n\n return [\n {\n name: 'computeStyles',\n options: {\n gpuAcceleration: false\n }\n },\n {\n name: 'offset',\n options: {\n offset: [0, arrow ? 5.5 : 2]\n }\n },\n { name: 'hide', enabled: hideOnTargetHidden },\n { name: 'arrow', enabled: arrow, options: { element: arrowRef.current } },\n {\n name: 'preventOverflow',\n options: {\n tether: !modifiers.find(m => m.name === 'sameWidth'),\n padding: 16\n }\n },\n {\n ...placeAndContain,\n enabled: !flipEnabled\n },\n ...modifiers\n ];\n }, [arrow, hideOnTargetHidden, modifiers]);\n\n const offset = useMemo(() => {\n const offsetModifier = [...memoedModifiers]\n .reverse()\n .find(m => m.name === 'offset' && m.enabled !== false) as OffsetModifier | undefined;\n return Array.isArray(offsetModifier?.options?.offset)\n ? offsetModifier?.options?.offset[1] ?? 0\n : 0;\n }, [memoedModifiers]);\n\n const { styles, attributes, forceUpdate } = usePopper(target, popperEl, {\n placement,\n strategy,\n modifiers: memoedModifiers\n });\n\n if (forceUpdate) forceUpdateRef.current = forceUpdate;\n\n // Setter-less useState to avoid re-running these constructors on every render with useRef.\n const [ac] = useState(() => new AbortController());\n const [observedSet] = useState(() => new WeakSet<Element>());\n const [ro] = useState(\n () =>\n new ResizeObserver(entries => {\n let updateQueued = false;\n\n for (const { target: resizeTarget } of entries) {\n // Ignore the first ResizeObserver event for each element since ResizeObserver always fires once when calling .observe().\n if (!observedSet.has(resizeTarget)) {\n observedSet.add(resizeTarget);\n } else if (!updateQueued) {\n updateQueued = true;\n\n if (!ac.signal.aborted) {\n forceUpdateRef.current?.();\n }\n }\n }\n })\n );\n\n useEffect(() => {\n return () => {\n ac.abort();\n ro.disconnect();\n };\n }, []);\n\n useEffect(() => {\n if (!popperEl) return;\n\n ro.observe(popperEl);\n\n return () => {\n ro.unobserve(popperEl);\n };\n }, [popperEl]);\n\n useEffect(() => {\n if (!resolvedTarget) return;\n\n ro.observe(resolvedTarget);\n\n return () => {\n ro.unobserve(resolvedTarget);\n };\n }, [resolvedTarget]);\n\n useLayoutEffect(() => {\n if (resolvedTarget) {\n initialOffset.current = getRelativeOffset(resolvedTarget, document.documentElement);\n } else {\n initialOffset.current = null;\n }\n }, [resolvedTarget]);\n\n useEffect(() => {\n if (!showPopover || !resolvedTarget) return;\n\n let rafId: ReturnType<typeof requestAnimationFrame>;\n\n const checkCoords = () => {\n if (resolvedTarget && initialOffset.current) {\n const newOffset = getRelativeOffset(resolvedTarget, document.documentElement);\n\n if (initialOffset.current.x !== newOffset.x || initialOffset.current.y !== newOffset.y) {\n initialOffset.current = newOffset;\n forceUpdateRef.current?.();\n } else {\n rafId = requestAnimationFrame(checkCoords);\n }\n }\n };\n\n rafId = requestAnimationFrame(checkCoords);\n\n return () => {\n cancelAnimationFrame(rafId);\n };\n }, [showPopover, resolvedTarget]);\n\n useEffect(() => {\n if (groupId && show) setActive(uid, groupId);\n\n /**\n * TODO: Remove usages of forceUpdateRef.current?.() below in favor of permanent fix to address following issues:\n * * Resize observer is not running immediately after initial mount\n * * Menu scrollAt is not applied on initial render\n */\n if (windowIsAvailable) {\n if (timeout.current) clearTimeout(timeout.current);\n timeout.current = window.setTimeout(() => {\n setShowPopover(show);\n if (show) forceUpdateRef.current?.();\n }, delays[show ? showDelay : hideDelay]);\n } else {\n setShowPopover(show);\n if (show) forceUpdateRef.current?.();\n }\n }, [show]);\n\n useEffect(() => {\n return () => clearTimeout(timeout.current);\n }, []);\n\n useAfterInitialEffect(() => {\n if (!showPopover) {\n onHide?.();\n }\n }, [showPopover]);\n\n useEffect(() => {\n if (groupId && popovers[groupId] && popovers[groupId] !== uid) {\n setShowPopover(false);\n }\n }, [groupId ? popovers[groupId] : undefined]);\n\n useEffect(() => {\n if (!portal || !resolvedTarget) return;\n\n if (!popoverMap.has(resolvedTarget)) {\n popoverMap.set(resolvedTarget, new Set());\n }\n\n resolvedTarget.toggleAttribute('data-popover-target', true);\n\n popoverMap.get(resolvedTarget)!.add(pointerId);\n\n return () => {\n if (!popoverMap.has(resolvedTarget)) return;\n\n popoverMap.get(resolvedTarget)!.delete(pointerId);\n\n if (popoverMap.get(resolvedTarget)!.size === 0) {\n popoverMap.delete(resolvedTarget);\n resolvedTarget.removeAttribute('data-popover-target');\n }\n };\n }, [portal, resolvedTarget, pointerId]);\n\n const content = (\n <StyledPopover\n {...restProps}\n data-popover-id={pointerId}\n portal={!!(portal && portalTarget)}\n offset={offset}\n ref={popperRef}\n style={{ ...style, ...styles.popper }}\n {...attributes.popper}\n >\n {arrow && <StyledPopoverArrow ref={arrowRef} style={{ ...styles.arrow }} />}\n {children}\n </StyledPopover>\n );\n\n if (!target || !showPopover || (groupId && !checkActive(uid, groupId))) return null;\n\n return portal && portalTarget ? createPortal(content, portalTarget) : content;\n});\n\nexport default Popover;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCheck.d.ts","sourceRoot":"","sources":["../../../src/components/RadioCheck/RadioCheck.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,EAAE,EACF,GAAG,EAIH,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAM3E,MAAM,WAAW,eAAgB,SAAQ,SAAS,EAAE,cAAc;IAChE;;;OAGG;IACH,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxC,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;I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