@stokr/components-library 4.2.2 → 4.2.4
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/dist/components/Button/Button.styles.d.ts +5 -1
- package/dist/components/CardTabs/CardTabs.styles.d.ts +34 -9
- package/dist/components/Checkbox/Checkbox.d.ts +3 -1
- package/dist/components/Checkbox/Checkbox.styles.d.ts +18 -4
- package/dist/components/Collapsible/Collapsible.styles.d.ts +18 -6
- package/dist/components/CopyToClipboardTooltip/CopyToClipboardTooltip.styles.d.ts +3 -1
- package/dist/components/FAQ/FAQ.d.ts +29 -0
- package/dist/components/FAQ/FAQ.js +18 -18
- package/dist/components/FAQ/FAQ.styles.d.ts +38 -0
- package/dist/components/FAQ/FAQ.styles.js +58 -1
- package/dist/components/InfoIcon/InfoIcon.styles.d.ts +8 -2
- package/dist/components/Input/Input.d.ts +3 -0
- package/dist/components/Input/Input.js +5 -2
- package/dist/components/Input/Input.styles.d.ts +13 -3
- package/dist/components/Input/Input.styles.js +57 -0
- package/dist/components/Input/Select.d.ts +57 -0
- package/dist/components/Input/Select.js +71 -94
- package/dist/components/Input/Select.styles.d.ts +79 -0
- package/dist/components/Input/Select.styles.js +68 -1
- package/dist/components/Lottie/LottieAnimation.d.ts +43 -0
- package/dist/components/Lottie/LottieAnimation.js +0 -12
- package/dist/components/Lottie/LottieAnimation.styles.d.ts +5 -0
- package/dist/components/Lottie/LottieAnimation.styles.js +3 -2
- package/dist/components/MaterialIcon/MaterialIcon.styles.d.ts +25 -5
- package/dist/components/Modal/Modal.js +21 -5
- package/dist/components/Modal/Modal.styles.d.ts +49 -15
- package/dist/components/Modal/Modal.styles.js +4 -3
- package/dist/components/Modal/SideModal.js +7 -71
- package/dist/components/Modal/SideModal.styles.d.ts +12 -4
- package/dist/components/Modal/SideModalParts.d.ts +6 -2
- package/dist/components/Modal/SuccessModal/SuccessModal.d.ts +42 -0
- package/dist/components/Modal/SuccessModal/SuccessModal.js +50 -38
- package/dist/components/Modal/bodyScrollLock.d.ts +6 -0
- package/dist/components/Modal/bodyScrollLock.js +80 -0
- package/dist/components/Section/Section.styles.d.ts +35 -7
- package/dist/components/Skeleton/Skeleton.styles.d.ts +9 -3
- package/dist/components/StepSidebar/MobileStepProgress.d.ts +12 -0
- package/dist/components/StepSidebar/MobileStepProgress.js +14 -0
- package/dist/components/StepSidebar/MobileStepProgress.styles.d.ts +15 -0
- package/dist/components/StepSidebar/MobileStepProgress.styles.js +42 -0
- package/dist/components/StepSidebar/StepProgress.d.ts +14 -0
- package/dist/components/StepSidebar/StepProgress.js +14 -0
- package/dist/components/StepSidebar/StepProgress.styles.d.ts +30 -0
- package/dist/components/StepSidebar/StepProgress.styles.js +103 -0
- package/dist/components/StepSidebar/StepSidebar.d.ts +34 -0
- package/dist/components/StepSidebar/StepSidebar.js +56 -0
- package/dist/components/StepSidebar/StepSidebar.styles.d.ts +54 -0
- package/dist/components/StepSidebar/StepSidebar.styles.js +171 -0
- package/dist/components/StokrLoader/StokrLoader.d.ts +3 -1
- package/dist/components/Text/Text.styles.d.ts +6 -2
- package/dist/components/Tooltip/Tooltip.styles.d.ts +6 -2
- package/dist/index.d.ts +35 -10
- package/dist/index.js +6 -0
- package/dist/styles/borderedField.d.ts +11 -0
- package/dist/styles/borderedField.js +56 -0
- package/dist/styles/rwd.d.ts +3 -1
- package/dist/utils/customHooks.d.ts +11 -4
- package/dist/utils/customHooks.js +14 -22
- package/package.json +13 -3
|
@@ -24,5 +24,9 @@ export interface ButtonProps {
|
|
|
24
24
|
marginTop?: string;
|
|
25
25
|
marginRight?: string;
|
|
26
26
|
}
|
|
27
|
-
export declare const Button: import('styled-components/dist/types').IStyledComponentBase<"web",
|
|
27
|
+
export declare const Button: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('styled-components/dist/types').Merged<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
28
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
29
|
+
}, ButtonProps>, ButtonProps>, "black" | "center" | "hidden" | "color" | "content" | "size" | "style" | "disabled" | "form" | "slot" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "marginTop" | "fluid" | "name" | "type" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "minWidth" | "withMarginBottom" | "secondary" | "onlyText" | "negative" | "outline" | "outlineBlack" | "marginRight"> & Partial<Pick<import('styled-components/dist/types').Merged<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
30
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
31
|
+
}, ButtonProps>, ButtonProps>, "black" | "center" | "hidden" | "color" | "content" | "size" | "style" | "disabled" | "form" | "slot" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "marginTop" | "fluid" | "name" | "type" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "minWidth" | "withMarginBottom" | "secondary" | "onlyText" | "negative" | "outline" | "outlineBlack" | "marginRight">>> & string;
|
|
28
32
|
export default Button;
|
|
@@ -9,21 +9,27 @@ interface HighlightProps {
|
|
|
9
9
|
* The surface behind the active tab, sliding to it. Equal-width tabs let CSS place it from
|
|
10
10
|
* the index alone, so it is exact on the server render too; the list needs `position: relative`.
|
|
11
11
|
*/
|
|
12
|
-
export declare const TabHighlightBase: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').
|
|
12
|
+
export declare const TabHighlightBase: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
13
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
14
|
+
}, HighlightProps>> & string;
|
|
13
15
|
/** Tab label colour eases with the highlight. */
|
|
14
16
|
export declare const tabColorTransition: import('styled-components').RuleSet<object>;
|
|
15
17
|
/**
|
|
16
18
|
* New tab content fades in from a blur. Key it by the active tab so it replays on each
|
|
17
19
|
* switch; `$animate` is off until the first switch, so the page does not fade in on load.
|
|
18
20
|
*/
|
|
19
|
-
export declare const TabContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').
|
|
21
|
+
export declare const TabContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
22
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
23
|
+
}, {
|
|
20
24
|
$animate: boolean;
|
|
21
25
|
}>> & string;
|
|
22
26
|
/**
|
|
23
27
|
* The row's bottom rule shows under every tab but the active one: the sliding white highlight
|
|
24
28
|
* covers it. `$fit`: tabs hug their labels, left-aligned, the rest of the row grey.
|
|
25
29
|
*/
|
|
26
|
-
export declare const TabList: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').
|
|
30
|
+
export declare const TabList: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
31
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
32
|
+
}, {
|
|
27
33
|
$fit?: boolean;
|
|
28
34
|
$scrollMarginTop?: string;
|
|
29
35
|
}>> & string;
|
|
@@ -32,11 +38,24 @@ export declare const TabList: import('styled-components/dist/types').IStyledComp
|
|
|
32
38
|
* edge drawn exactly on the rule lets a hairline of it through (the moving highlight is its own
|
|
33
39
|
* layer, with anti-aliased edges).
|
|
34
40
|
*/
|
|
35
|
-
export declare const TabHighlight: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').
|
|
41
|
+
export declare const TabHighlight: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('styled-components').FastOmit<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
42
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
43
|
+
}, HighlightProps>, "as" | "forwardedAs"> & {
|
|
44
|
+
as?: import('styled-components').WebTarget;
|
|
45
|
+
forwardedAs?: import('styled-components').WebTarget;
|
|
46
|
+
}, "style"> & {
|
|
47
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | (import('react').CSSProperties & {
|
|
48
|
+
[key: `--${string}`]: string | number;
|
|
49
|
+
});
|
|
50
|
+
}> & string;
|
|
36
51
|
/** `$fit` tabs differ in width, so the highlight is placed from the measured active tab. */
|
|
37
|
-
export declare const FitHighlight: import('styled-components/dist/types').IStyledComponentBase<"web",
|
|
52
|
+
export declare const FitHighlight: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
53
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
54
|
+
}> & string;
|
|
38
55
|
/** `$filled`: the active `$fit` tab paints its own surface until the highlight is measured. */
|
|
39
|
-
export declare const Tab: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').
|
|
56
|
+
export declare const Tab: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
57
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
58
|
+
}, {
|
|
40
59
|
$active: boolean;
|
|
41
60
|
$fit?: boolean;
|
|
42
61
|
$stretch?: boolean;
|
|
@@ -46,11 +65,17 @@ export declare const Tab: import('styled-components/dist/types').IStyledComponen
|
|
|
46
65
|
* Never shrinks: in a row that overflows (fit tabs on mobile), it would squeeze to 0.
|
|
47
66
|
* `$edge`: the closing divider of stretched tabs, which below desktop would sit on the card's edge.
|
|
48
67
|
*/
|
|
49
|
-
export declare const TabDivider: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').
|
|
68
|
+
export declare const TabDivider: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
69
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
70
|
+
}, {
|
|
50
71
|
$edge?: boolean;
|
|
51
72
|
}>> & string;
|
|
52
73
|
/** A card whose header is the tab bar . */
|
|
53
|
-
export declare const TabCard: import('styled-components/dist/types').IStyledComponentBase<"web",
|
|
74
|
+
export declare const TabCard: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
75
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
76
|
+
}> & string;
|
|
54
77
|
/** The tab panel's content area: 24px, 16px on mobile (Figma 3582:127370). */
|
|
55
|
-
export declare const TabCardBody: import('styled-components/dist/types').IStyledComponentBase<"web",
|
|
78
|
+
export declare const TabCardBody: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
79
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
80
|
+
}> & string;
|
|
56
81
|
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export declare const CheckBoxCaption: import('styled-components/dist/types').IStyledComponentBase<"web",
|
|
2
|
+
export declare const CheckBoxCaption: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
3
|
+
style?: CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
4
|
+
}> & string;
|
|
3
5
|
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultChecked'> {
|
|
4
6
|
id: string;
|
|
5
7
|
text?: ReactNode;
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
export declare const Wrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').
|
|
1
|
+
export declare const Wrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
2
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
3
|
+
}, {
|
|
2
4
|
$marginTop?: boolean;
|
|
3
5
|
}>> & string;
|
|
4
|
-
export declare const Label: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').
|
|
6
|
+
export declare const Label: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('styled-components').FastOmit<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "style"> & {
|
|
7
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
8
|
+
}, {
|
|
5
9
|
autoHeightLabel?: boolean;
|
|
6
10
|
isUp?: boolean;
|
|
7
11
|
active?: boolean;
|
|
8
12
|
error?: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
$variant?: import('../..').FieldVariant;
|
|
14
|
+
}>, "as" | "forwardedAs"> & {
|
|
15
|
+
as?: import('styled-components').WebTarget;
|
|
16
|
+
forwardedAs?: import('styled-components').WebTarget;
|
|
17
|
+
}, "style"> & {
|
|
18
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | (import('react').CSSProperties & {
|
|
19
|
+
[key: `--${string}`]: string | number;
|
|
20
|
+
});
|
|
21
|
+
}> & string;
|
|
22
|
+
export declare const Input: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
23
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
24
|
+
}, {
|
|
11
25
|
$error?: boolean;
|
|
12
26
|
$large?: boolean;
|
|
13
27
|
$disabled?: boolean;
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
/** Collapsed, it lifts under the pointer as a collapsed section does. */
|
|
2
|
-
export declare const Root: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').
|
|
2
|
+
export declare const Root: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
3
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
4
|
+
}, {
|
|
3
5
|
$open: boolean;
|
|
4
6
|
}>> & string;
|
|
5
|
-
export declare const Header: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').
|
|
7
|
+
export declare const Header: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
8
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
9
|
+
}, {
|
|
6
10
|
$divided: boolean;
|
|
7
11
|
}>> & string;
|
|
8
|
-
export declare const Chevron: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').
|
|
12
|
+
export declare const Chevron: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
13
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
14
|
+
}, {
|
|
9
15
|
$open: boolean;
|
|
10
16
|
}>> & string;
|
|
11
17
|
/** Animates height without measuring: grid rows transition between 0fr and 1fr. */
|
|
12
|
-
export declare const Body: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').
|
|
18
|
+
export declare const Body: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
19
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
20
|
+
}, {
|
|
13
21
|
$open: boolean;
|
|
14
22
|
}>> & string;
|
|
15
|
-
export declare const BodyClip: import('styled-components/dist/types').IStyledComponentBase<"web",
|
|
16
|
-
|
|
23
|
+
export declare const BodyClip: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
24
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
25
|
+
}> & string;
|
|
26
|
+
export declare const BodyInner: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
27
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
28
|
+
}, {
|
|
17
29
|
$divided: boolean;
|
|
18
30
|
}>> & string;
|
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
* forward refs, and floating-ui needs a real DOM node to measure — so the
|
|
4
4
|
* tooltip anchors to this span rather than to the icon itself.
|
|
5
5
|
*/
|
|
6
|
-
export declare const CopyTrigger: import('styled-components/dist/types').IStyledComponentBase<"web",
|
|
6
|
+
export declare const CopyTrigger: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
7
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
8
|
+
}> & string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { FieldVariant } from '../../styles/borderedField';
|
|
3
|
+
import { FaqItems, FaqItem, FaqTitle, FaqContent, FaqText, FaqDropdownIcon } from './FAQ.styles';
|
|
4
|
+
export interface FAQEntry {
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
/** A string or JSX, or an array of strings rendered as a bullet list. */
|
|
7
|
+
content: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface FAQProps {
|
|
10
|
+
items: readonly FAQEntry[];
|
|
11
|
+
/** Do not scroll the opened item into view. */
|
|
12
|
+
noScroll?: boolean;
|
|
13
|
+
/** Ref to a custom scrollbar (in a modal); scrolled to the bottom when an item opens. */
|
|
14
|
+
scrollRef?: RefObject<{
|
|
15
|
+
scrollToBottom: () => void;
|
|
16
|
+
} | null>;
|
|
17
|
+
/** Title style used inside the "view more" modal. */
|
|
18
|
+
modalViewMore?: boolean;
|
|
19
|
+
/** Smaller, indented text for answers given as a list of strings. */
|
|
20
|
+
withTextStyling?: boolean;
|
|
21
|
+
/** Prefix for data-cy: `{prefix}-accordion`, `{prefix}-item-{slug}-toggle`, etc. */
|
|
22
|
+
dataCyPrefix?: string;
|
|
23
|
+
/** `bordered`: each item is a card (sign-up redesign). Default keeps the plain list. */
|
|
24
|
+
variant?: FieldVariant;
|
|
25
|
+
}
|
|
26
|
+
/** Accordion of questions and answers; one item is open at a time. */
|
|
27
|
+
export declare const FAQ: (props: FAQProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export { FaqItems, FaqItem, FaqTitle, FaqContent, FaqText, FaqDropdownIcon };
|
|
29
|
+
export default FAQ;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import { Text } from "../Text/Text.styles.js";
|
|
4
2
|
import { useState } from "react";
|
|
3
|
+
import { Text } from "../Text/Text.styles.js";
|
|
5
4
|
import { scrollToElement } from "../../utils/scrollUtils.js";
|
|
6
5
|
import { FaqItems, FaqItem, FaqTitle, FaqDropdownIcon, FaqContent, FaqText } from "./FAQ.styles.js";
|
|
7
6
|
function slugFromTitle(title) {
|
|
@@ -10,8 +9,17 @@ function slugFromTitle(title) {
|
|
|
10
9
|
return raw.toLowerCase().trim().slice(0, 48).replace(/\s+/g, "-").replace(/[^a-z0-9_-]/g, "");
|
|
11
10
|
}
|
|
12
11
|
const FAQ = (props) => {
|
|
13
|
-
const {
|
|
12
|
+
const {
|
|
13
|
+
items,
|
|
14
|
+
noScroll,
|
|
15
|
+
scrollRef,
|
|
16
|
+
modalViewMore,
|
|
17
|
+
withTextStyling,
|
|
18
|
+
dataCyPrefix = "faq",
|
|
19
|
+
variant = "default"
|
|
20
|
+
} = props;
|
|
14
21
|
const [activeIndex, setActiveIndex] = useState(null);
|
|
22
|
+
const bordered = variant === "bordered";
|
|
15
23
|
const onTitleClick = (e, index) => {
|
|
16
24
|
e.persist();
|
|
17
25
|
const newActiveIndex = activeIndex === index ? null : index;
|
|
@@ -19,7 +27,7 @@ const FAQ = (props) => {
|
|
|
19
27
|
if (!noScroll && newActiveIndex !== null) {
|
|
20
28
|
if (scrollRef?.current) {
|
|
21
29
|
setTimeout(() => {
|
|
22
|
-
scrollRef?.current
|
|
30
|
+
scrollRef?.current?.scrollToBottom();
|
|
23
31
|
}, 0);
|
|
24
32
|
} else {
|
|
25
33
|
scrollToElement(e.target.parentElement, { offset: 20 });
|
|
@@ -35,9 +43,10 @@ const FAQ = (props) => {
|
|
|
35
43
|
return /* @__PURE__ */ jsx(FaqItems, { "data-cy": `${dataCyPrefix}-accordion`, children: items.map((item, index) => {
|
|
36
44
|
const titleSlug = slugFromTitle(item.title);
|
|
37
45
|
const itemCy = titleSlug ? `${dataCyPrefix}-item-${titleSlug}` : `${dataCyPrefix}-item-${index}`;
|
|
46
|
+
const list = Array.isArray(item.content) ? item.content : null;
|
|
38
47
|
return (
|
|
39
48
|
// eslint-disable-next-line @eslint-react/no-array-index-key -- FAQ order is content-defined
|
|
40
|
-
/* @__PURE__ */ jsxs(FaqItem, { "data-cy": `${itemCy}-wrap`, children: [
|
|
49
|
+
/* @__PURE__ */ jsxs(FaqItem, { "data-cy": `${itemCy}-wrap`, $variant: variant, children: [
|
|
41
50
|
/* @__PURE__ */ jsxs(
|
|
42
51
|
FaqTitle,
|
|
43
52
|
{
|
|
@@ -47,30 +56,21 @@ const FAQ = (props) => {
|
|
|
47
56
|
isActive: activeIndex === index,
|
|
48
57
|
onClick: (e) => onTitleClick(e, index),
|
|
49
58
|
modalViewMore,
|
|
59
|
+
$variant: variant,
|
|
50
60
|
children: [
|
|
51
61
|
item.title,
|
|
52
|
-
/* @__PURE__ */ jsx(FaqDropdownIcon, {})
|
|
62
|
+
/* @__PURE__ */ jsx(FaqDropdownIcon, { $variant: variant })
|
|
53
63
|
]
|
|
54
64
|
}
|
|
55
65
|
),
|
|
56
|
-
/* @__PURE__ */ jsx(FaqContent, { "data-cy": `${itemCy}-panel`, isOpened: activeIndex === index, children: !
|
|
66
|
+
/* @__PURE__ */ jsx(FaqContent, { "data-cy": `${itemCy}-panel`, isOpened: activeIndex === index, children: !list ? /* @__PURE__ */ jsx(FaqText, { $variant: variant, children: item.content }) : bordered ? /* @__PURE__ */ jsx(FaqText, { $variant: variant, children: /* @__PURE__ */ jsx("ul", { children: list.map((answer) => /* @__PURE__ */ jsx("li", { children: answer }, answer)) }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
57
67
|
/* @__PURE__ */ jsx("br", {}),
|
|
58
|
-
/* @__PURE__ */ jsx(Text, { style: withTextStyling ? textStyling : {}, children: /* @__PURE__ */ jsx("ul", { children:
|
|
68
|
+
/* @__PURE__ */ jsx(Text, { style: withTextStyling ? textStyling : {}, children: /* @__PURE__ */ jsx("ul", { children: list.map((answer) => /* @__PURE__ */ jsx("li", { children: answer }, answer)) }) })
|
|
59
69
|
] }) })
|
|
60
70
|
] }, index)
|
|
61
71
|
);
|
|
62
72
|
}) });
|
|
63
73
|
};
|
|
64
|
-
FAQ.propTypes = {
|
|
65
|
-
items: PropTypes.arrayOf(
|
|
66
|
-
PropTypes.shape({
|
|
67
|
-
title: PropTypes.node.isRequired,
|
|
68
|
-
content: PropTypes.oneOfType([PropTypes.string, PropTypes.array, PropTypes.node]).isRequired
|
|
69
|
-
})
|
|
70
|
-
).isRequired,
|
|
71
|
-
/** Prefix for data-cy: `{prefix}-accordion`, `{prefix}-item-{slug}-toggle`, etc. */
|
|
72
|
-
dataCyPrefix: PropTypes.string
|
|
73
|
-
};
|
|
74
74
|
export {
|
|
75
75
|
FAQ,
|
|
76
76
|
FaqContent,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { FieldVariant } from '../../styles/borderedField';
|
|
2
|
+
export declare const FaqItems: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
3
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
4
|
+
}> & string;
|
|
5
|
+
export declare const FaqDropdownIcon: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
6
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
7
|
+
}, {
|
|
8
|
+
$variant?: FieldVariant;
|
|
9
|
+
}>, "children"> & Partial<Pick<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
10
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
11
|
+
}, {
|
|
12
|
+
$variant?: FieldVariant;
|
|
13
|
+
}>, "children">>> & string;
|
|
14
|
+
export declare const FaqItem: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
15
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
16
|
+
}, {
|
|
17
|
+
center?: boolean;
|
|
18
|
+
customContainerStyle?: string;
|
|
19
|
+
$variant?: FieldVariant;
|
|
20
|
+
}>> & string;
|
|
21
|
+
export declare const FaqTitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
22
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
23
|
+
}, {
|
|
24
|
+
uppercase?: boolean;
|
|
25
|
+
white?: boolean;
|
|
26
|
+
center?: boolean;
|
|
27
|
+
hideIcon?: boolean;
|
|
28
|
+
isActive?: boolean;
|
|
29
|
+
modalViewMore?: boolean;
|
|
30
|
+
$variant?: FieldVariant;
|
|
31
|
+
}>> & string;
|
|
32
|
+
export declare const FaqContent: any;
|
|
33
|
+
export declare const FaqText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
34
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
35
|
+
}, {
|
|
36
|
+
largeSpacing?: boolean;
|
|
37
|
+
$variant?: FieldVariant;
|
|
38
|
+
}>> & string;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
2
|
import { Collapse } from "react-collapse";
|
|
3
3
|
import theme from "../../styles/theme.js";
|
|
4
|
+
import { colors } from "../../styles/colors.js";
|
|
5
|
+
import { BORDERED_BORDER } from "../../styles/borderedField.js";
|
|
6
|
+
import { space, radius } from "../../styles/spacing.js";
|
|
7
|
+
import { elevation } from "../../styles/elevation.js";
|
|
8
|
+
import { typography } from "../../styles/typography.js";
|
|
4
9
|
import { glyph } from "../MaterialIcon/glyph.js";
|
|
5
10
|
const FaqItems = styled.div`
|
|
6
11
|
position: relative;
|
|
@@ -20,6 +25,15 @@ const FaqDropdownIcon = styled.span.attrs({
|
|
|
20
25
|
margin-top: -10px;
|
|
21
26
|
transform: rotate(0);
|
|
22
27
|
transition: 0.3s transform;
|
|
28
|
+
|
|
29
|
+
${(props) => props.$variant === "bordered" && css`
|
|
30
|
+
width: 16px;
|
|
31
|
+
height: 16px;
|
|
32
|
+
font-size: 16px;
|
|
33
|
+
top: 22px;
|
|
34
|
+
right: ${space[5]};
|
|
35
|
+
margin-top: 0;
|
|
36
|
+
`}
|
|
23
37
|
`;
|
|
24
38
|
const FaqItem = styled.div.withConfig({
|
|
25
39
|
shouldForwardProp: (props) => !["center", "customContainerStyle"].includes(props)
|
|
@@ -28,6 +42,22 @@ const FaqItem = styled.div.withConfig({
|
|
|
28
42
|
margin-top: 30px;
|
|
29
43
|
}
|
|
30
44
|
|
|
45
|
+
${(props) => props.$variant === "bordered" && css`
|
|
46
|
+
padding: 0;
|
|
47
|
+
border: ${BORDERED_BORDER};
|
|
48
|
+
border-radius: ${radius.lg};
|
|
49
|
+
background: ${colors.white};
|
|
50
|
+
box-shadow: ${elevation.xs};
|
|
51
|
+
|
|
52
|
+
.ReactCollapse--collapse {
|
|
53
|
+
transition: height 0.3s ease;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
& + & {
|
|
57
|
+
margin-top: ${space[2]};
|
|
58
|
+
}
|
|
59
|
+
`}
|
|
60
|
+
|
|
31
61
|
${(props) => props.center && `
|
|
32
62
|
text-align:center;
|
|
33
63
|
`}
|
|
@@ -59,6 +89,19 @@ const FaqTitle = styled.button.withConfig({
|
|
|
59
89
|
color: inherit;
|
|
60
90
|
}
|
|
61
91
|
|
|
92
|
+
${(props) => props.$variant === "bordered" && css`
|
|
93
|
+
${typography.bodyMdCallout}
|
|
94
|
+
padding: ${space[5]} 52px ${space[5]} ${space[5]};
|
|
95
|
+
border-radius: ${radius.lg};
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
transition: padding-bottom 0.3s ease;
|
|
98
|
+
${props.isActive && `padding-bottom: ${space[3]};`}
|
|
99
|
+
|
|
100
|
+
&:hover {
|
|
101
|
+
color: ${theme.cBlack};
|
|
102
|
+
}
|
|
103
|
+
`}
|
|
104
|
+
|
|
62
105
|
${(props) => props.uppercase && `
|
|
63
106
|
text-transform:uppercase;
|
|
64
107
|
font-weight:700;
|
|
@@ -121,6 +164,20 @@ const FaqText = styled.div.withConfig({
|
|
|
121
164
|
padding-bottom: 30px;
|
|
122
165
|
|
|
123
166
|
`}
|
|
167
|
+
|
|
168
|
+
${(props) => props.$variant === "bordered" && css`
|
|
169
|
+
padding: 0 ${space[5]} ${space[5]};
|
|
170
|
+
font-size: 14px;
|
|
171
|
+
line-height: 20px;
|
|
172
|
+
font-weight: 400;
|
|
173
|
+
color: ${theme.cBlack};
|
|
174
|
+
|
|
175
|
+
ul {
|
|
176
|
+
margin: 0;
|
|
177
|
+
padding-left: 20px;
|
|
178
|
+
list-style: disc;
|
|
179
|
+
}
|
|
180
|
+
`}
|
|
124
181
|
`;
|
|
125
182
|
export {
|
|
126
183
|
FaqContent,
|
|
@@ -4,9 +4,15 @@ type ContainerProps = {
|
|
|
4
4
|
noMarginRight?: boolean;
|
|
5
5
|
fullWidth?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export declare const Container: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').
|
|
7
|
+
export declare const Container: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
8
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
9
|
+
}, ContainerProps>> & string;
|
|
8
10
|
type IconProps = {
|
|
9
11
|
outline?: boolean;
|
|
10
12
|
};
|
|
11
|
-
export declare const Icon: import('styled-components/dist/types').IStyledComponentBase<"web",
|
|
13
|
+
export declare const Icon: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('styled-components/dist/types').Merged<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
14
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
15
|
+
}, IconProps>, IconProps>, "hidden" | "color" | "content" | "style" | "slot" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "outline"> & Partial<Pick<import('styled-components/dist/types').Merged<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
16
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
17
|
+
}, IconProps>, IconProps>, "hidden" | "color" | "content" | "style" | "slot" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "outline">>> & string;
|
|
12
18
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, InputHTMLAttributes } from 'react';
|
|
2
2
|
import { Wrapper, Label, InputWrap } from './Input.styles';
|
|
3
|
+
import { FieldVariant } from '../../styles/borderedField';
|
|
3
4
|
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value'> {
|
|
4
5
|
id: string;
|
|
5
6
|
name?: string;
|
|
@@ -17,6 +18,8 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
17
18
|
autoHeightLabel?: boolean;
|
|
18
19
|
inputWrapStyle?: CSSProperties;
|
|
19
20
|
wrapperStyle?: CSSProperties;
|
|
21
|
+
/** `bordered`: boxed field with a static label above (sign-up redesign). Default keeps the floating-label look. */
|
|
22
|
+
variant?: FieldVariant;
|
|
20
23
|
}
|
|
21
24
|
/** Text input with a floating label, built for Formik (`onChange`/`onBlur` receive the event). */
|
|
22
25
|
declare const Input: (props: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,6 +18,7 @@ const Input = (props) => {
|
|
|
18
18
|
inputWrapStyle,
|
|
19
19
|
wrapperStyle,
|
|
20
20
|
autoHeightLabel,
|
|
21
|
+
variant = "default",
|
|
21
22
|
// Destructure these so they don't get spread to the input
|
|
22
23
|
onChange: onChangeProp,
|
|
23
24
|
onBlur: onBlurProp,
|
|
@@ -49,7 +50,7 @@ const Input = (props) => {
|
|
|
49
50
|
onFocusProp?.(e);
|
|
50
51
|
checkLabel(true);
|
|
51
52
|
};
|
|
52
|
-
return /* @__PURE__ */ jsxs(Wrapper, { inverted, style: wrapperStyle, children: [
|
|
53
|
+
return /* @__PURE__ */ jsxs(Wrapper, { inverted, style: wrapperStyle, $variant: variant, children: [
|
|
53
54
|
label && /* @__PURE__ */ jsx(
|
|
54
55
|
Label,
|
|
55
56
|
{
|
|
@@ -58,6 +59,7 @@ const Input = (props) => {
|
|
|
58
59
|
error: Boolean(error && touched),
|
|
59
60
|
htmlFor: id,
|
|
60
61
|
autoHeightLabel,
|
|
62
|
+
$variant: variant,
|
|
61
63
|
children: label
|
|
62
64
|
}
|
|
63
65
|
),
|
|
@@ -69,6 +71,7 @@ const Input = (props) => {
|
|
|
69
71
|
disabled,
|
|
70
72
|
style: inputWrapStyle,
|
|
71
73
|
autoHeightLabel,
|
|
74
|
+
$variant: variant,
|
|
72
75
|
children: /* @__PURE__ */ jsx(
|
|
73
76
|
"input",
|
|
74
77
|
{
|
|
@@ -82,7 +85,7 @@ const Input = (props) => {
|
|
|
82
85
|
readOnly,
|
|
83
86
|
placeholder,
|
|
84
87
|
disabled,
|
|
85
|
-
style: { WebkitAppearance: "none", WebkitBorderRadius: 0 },
|
|
88
|
+
style: variant === "bordered" ? { WebkitAppearance: "none" } : { WebkitAppearance: "none", WebkitBorderRadius: 0 },
|
|
86
89
|
...restProps
|
|
87
90
|
}
|
|
88
91
|
)
|