@codecademy/gamut 68.2.3-alpha.df0cb3.0 → 68.2.3-alpha.e3cc4a.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/dist/Alert/elements.d.ts +3 -3
- package/dist/Anchor/index.d.ts +19 -9
- package/dist/Anchor/index.js +9 -6
- package/dist/BarChart/BarRow/elements.d.ts +77 -61
- package/dist/BarChart/utils/hooks.d.ts +2 -2
- package/dist/BarChart/utils/hooks.js +1 -1
- package/dist/Box/Box.d.ts +1 -1
- package/dist/Box/FlexBox.d.ts +1 -1
- package/dist/Box/GridBox.d.ts +2 -1
- package/dist/Box/GridBox.js +1 -1
- package/dist/Box/props.d.ts +1 -1
- package/dist/Button/CTAButton.d.ts +2 -2
- package/dist/Button/FillButton.d.ts +4 -4
- package/dist/Button/IconButton.d.ts +4 -4
- package/dist/Button/StrokeButton.d.ts +4 -4
- package/dist/Button/TextButton.d.ts +4 -4
- package/dist/Button/shared/InlineIconButton.d.ts +2 -2
- package/dist/Button/shared/styles.d.ts +3 -3
- package/dist/Button/shared/types.d.ts +1 -1
- package/dist/ButtonBase/ButtonBase.d.ts +9 -4
- package/dist/ButtonBase/ButtonBase.js +11 -4
- package/dist/Card/elements.d.ts +187 -139
- package/dist/Card/styles.d.ts +8 -8
- package/dist/Coachmark/index.d.ts +1 -1
- package/dist/ConnectedForm/ConnectedForm.d.ts +1 -1
- package/dist/ConnectedForm/utils.d.ts +3 -3
- package/dist/ContentContainer/index.d.ts +1 -1
- package/dist/Disclosure/elements.d.ts +20 -14
- package/dist/FeatureShimmer/index.js +1 -1
- package/dist/FocusTrap/index.d.ts +2 -2
- package/dist/Form/SelectDropdown/elements/controls.js +2 -2
- package/dist/Form/SelectDropdown/elements/multi-value.js +2 -2
- package/dist/Form/SelectDropdown/types/internal.d.ts +2 -2
- package/dist/Form/elements/Form.d.ts +15 -15
- package/dist/Form/elements/FormGroup.d.ts +2 -2
- package/dist/Form/styles/Checkbox-styles.d.ts +1 -1
- package/dist/GridForm/GridFormButtons/index.d.ts +4 -4
- package/dist/InternalFloatingCard/InternalFloatingCard.d.ts +1 -1
- package/dist/Layout/Column.d.ts +1 -1
- package/dist/Layout/LayoutGrid.d.ts +1 -1
- package/dist/List/ListProvider.d.ts +1 -1
- package/dist/List/elements.d.ts +75 -59
- package/dist/List/hooks.d.ts +1 -1
- package/dist/Menu/Menu.d.ts +1 -1
- package/dist/Menu/MenuItem.js +10 -6
- package/dist/Menu/elements.d.ts +4 -4
- package/dist/Modals/elements.d.ts +1 -1
- package/dist/Pagination/AnimatedPaginationButtons.d.ts +58 -42
- package/dist/Pagination/EllipsisButton.d.ts +2 -2
- package/dist/Pagination/PaginationButton.d.ts +6 -6
- package/dist/Pagination/utils.d.ts +58 -42
- package/dist/Pagination/utils.js +14 -11
- package/dist/Popover/Popover.js +4 -4
- package/dist/Popover/elements.d.ts +2 -2
- package/dist/Popover/types.d.ts +3 -2
- package/dist/PopoverContainer/PopoverContainer.js +9 -13
- package/dist/PopoverContainer/hooks.d.ts +15 -4
- package/dist/PopoverContainer/hooks.js +31 -24
- package/dist/PopoverContainer/types.d.ts +3 -7
- package/dist/Tabs/TabButton.d.ts +2 -2
- package/dist/Tabs/TabNav.d.ts +1 -1
- package/dist/Tabs/TabNavLink.d.ts +2 -2
- package/dist/Tag/elements.d.ts +18 -12
- package/dist/Tip/InfoTip/InfoTipButton.d.ts +4 -4
- package/dist/Tip/InfoTip/styles.d.ts +1 -1
- package/dist/Tip/PreviewTip/elements.d.ts +13 -7
- package/dist/Tip/ToolTip/elements.d.ts +1 -1
- package/dist/Tip/__tests__/helpers.d.ts +3 -3
- package/dist/Tip/shared/FloatingTip.js +2 -2
- package/dist/Tip/shared/elements.d.ts +3 -3
- package/dist/Tip/shared/types.d.ts +2 -2
- package/dist/Toggle/elements.d.ts +1 -1
- package/dist/Typography/Text.d.ts +2 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/utils/react.js +2 -1
- package/package.json +9 -10
- package/dist/DatePicker/Calendar/CalendarBody.d.ts +0 -3
- package/dist/DatePicker/Calendar/CalendarBody.js +0 -139
- package/dist/DatePicker/Calendar/CalendarFooter.d.ts +0 -3
- package/dist/DatePicker/Calendar/CalendarFooter.js +0 -57
- package/dist/DatePicker/Calendar/CalendarHeader.d.ts +0 -3
- package/dist/DatePicker/Calendar/CalendarHeader.js +0 -46
- package/dist/DatePicker/Calendar/CalendarNavLastMonth.d.ts +0 -3
- package/dist/DatePicker/Calendar/CalendarNavLastMonth.js +0 -30
- package/dist/DatePicker/Calendar/CalendarNavNextMonth.d.ts +0 -3
- package/dist/DatePicker/Calendar/CalendarNavNextMonth.js +0 -30
- package/dist/DatePicker/Calendar/CalendarWrapper.d.ts +0 -8
- package/dist/DatePicker/Calendar/CalendarWrapper.js +0 -27
- package/dist/DatePicker/Calendar/index.d.ts +0 -6
- package/dist/DatePicker/Calendar/index.js +0 -6
- package/dist/DatePicker/Calendar/types.d.ts +0 -77
- package/dist/DatePicker/Calendar/types.js +0 -1
- package/dist/DatePicker/Calendar/utils/dateGrid.d.ts +0 -38
- package/dist/DatePicker/Calendar/utils/dateGrid.js +0 -103
- package/dist/DatePicker/Calendar/utils/elements.d.ts +0 -18
- package/dist/DatePicker/Calendar/utils/elements.js +0 -116
- package/dist/DatePicker/Calendar/utils/format.d.ts +0 -44
- package/dist/DatePicker/Calendar/utils/format.js +0 -128
- package/dist/DatePicker/Calendar/utils/keyHandler.d.ts +0 -12
- package/dist/DatePicker/Calendar/utils/keyHandler.js +0 -126
- package/dist/DatePicker/Calendar/utils/validation.d.ts +0 -13
- package/dist/DatePicker/Calendar/utils/validation.js +0 -23
- package/dist/DatePicker/DatePicker.d.ts +0 -7
- package/dist/DatePicker/DatePicker.js +0 -155
- package/dist/DatePicker/DatePickerCalendar.d.ts +0 -11
- package/dist/DatePicker/DatePickerCalendar.js +0 -163
- package/dist/DatePicker/DatePickerContext.d.ts +0 -10
- package/dist/DatePicker/DatePickerContext.js +0 -18
- package/dist/DatePicker/DatePickerInput.d.ts +0 -16
- package/dist/DatePicker/DatePickerInput.js +0 -134
- package/dist/DatePicker/index.d.ts +0 -5
- package/dist/DatePicker/index.js +0 -5
- package/dist/DatePicker/types.d.ts +0 -86
- package/dist/DatePicker/types.js +0 -1
- package/dist/DatePicker/utils/dateSelect.d.ts +0 -19
- package/dist/DatePicker/utils/dateSelect.js +0 -146
- package/dist/DatePicker/utils/locale.d.ts +0 -38
- package/dist/DatePicker/utils/locale.js +0 -93
- package/dist/DatePicker/utils/translations.d.ts +0 -15
- package/dist/DatePicker/utils/translations.js +0 -10
|
@@ -379,8 +379,8 @@ export type TextProps = TextTruncateProps | TextNoTruncateProps;
|
|
|
379
379
|
export declare const Text: import("react").ForwardRefExoticComponent<(Omit<{
|
|
380
380
|
theme?: import("@emotion/react").Theme;
|
|
381
381
|
as?: React.ElementType;
|
|
382
|
-
} & TextTruncateProps & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "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-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" | "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" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "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" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | keyof import("react").ClassAttributes<HTMLSpanElement>>, "ref"> | Omit<{
|
|
382
|
+
} & TextTruncateProps & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "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-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" | "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" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "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" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | keyof import("react").ClassAttributes<HTMLSpanElement>>, "ref"> | Omit<{
|
|
383
383
|
theme?: import("@emotion/react").Theme;
|
|
384
384
|
as?: React.ElementType;
|
|
385
|
-
} & TextNoTruncateProps & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "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-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" | "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" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "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" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | keyof import("react").ClassAttributes<HTMLSpanElement>>, "ref">) & import("react").RefAttributes<HTMLSpanElement>>;
|
|
385
|
+
} & TextNoTruncateProps & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "slot" | "style" | "title" | "dir" | "children" | "className" | "aria-hidden" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "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-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" | "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" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "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" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | keyof import("react").ClassAttributes<HTMLSpanElement>>, "ref">) & import("react").RefAttributes<HTMLSpanElement>>;
|
|
386
386
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -16,8 +16,6 @@ export * from './Card';
|
|
|
16
16
|
export * from './Coachmark';
|
|
17
17
|
export * from './ConnectedForm';
|
|
18
18
|
export * from './ContentContainer';
|
|
19
|
-
export * from './DatePicker';
|
|
20
|
-
export * from './DatePicker/Calendar';
|
|
21
19
|
export * from './DelayedRenderWrapper';
|
|
22
20
|
export * from './Disclosure';
|
|
23
21
|
export * from './DataList';
|
package/dist/index.js
CHANGED
|
@@ -15,8 +15,6 @@ export * from './Card';
|
|
|
15
15
|
export * from './Coachmark';
|
|
16
16
|
export * from './ConnectedForm';
|
|
17
17
|
export * from './ContentContainer';
|
|
18
|
-
export * from './DatePicker';
|
|
19
|
-
export * from './DatePicker/Calendar';
|
|
20
18
|
export * from './DelayedRenderWrapper';
|
|
21
19
|
export * from './Disclosure';
|
|
22
20
|
export * from './DataList';
|
package/dist/utils/react.js
CHANGED
|
@@ -33,7 +33,8 @@ export const extractTextContent = children => {
|
|
|
33
33
|
return '';
|
|
34
34
|
}
|
|
35
35
|
if (/*#__PURE__*/isValidElement(child)) {
|
|
36
|
-
const
|
|
36
|
+
const props = child.props;
|
|
37
|
+
const textContent = props.children ?? props.text ?? '';
|
|
37
38
|
return extractTextContent(textContent);
|
|
38
39
|
}
|
|
39
40
|
return '';
|
package/package.json
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/gamut",
|
|
3
3
|
"description": "Styleguide & Component library for Codecademy",
|
|
4
|
-
"version": "68.2.3-alpha.
|
|
4
|
+
"version": "68.2.3-alpha.e3cc4a.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@codecademy/gamut-icons": "9.57.3-alpha.
|
|
8
|
-
"@codecademy/gamut-illustrations": "0.58.10-alpha.
|
|
9
|
-
"@codecademy/gamut-patterns": "0.10.29-alpha.
|
|
10
|
-
"@codecademy/gamut-styles": "17.13.2-alpha.
|
|
11
|
-
"@codecademy/variance": "0.26.2-alpha.
|
|
12
|
-
"@formatjs/intl-locale": "^5.3.1",
|
|
7
|
+
"@codecademy/gamut-icons": "9.57.3-alpha.e3cc4a.0",
|
|
8
|
+
"@codecademy/gamut-illustrations": "0.58.10-alpha.e3cc4a.0",
|
|
9
|
+
"@codecademy/gamut-patterns": "0.10.29-alpha.e3cc4a.0",
|
|
10
|
+
"@codecademy/gamut-styles": "17.13.2-alpha.e3cc4a.0",
|
|
11
|
+
"@codecademy/variance": "0.26.2-alpha.e3cc4a.0",
|
|
13
12
|
"@react-aria/interactions": "3.25.0",
|
|
14
13
|
"@types/marked": "^4.0.8",
|
|
15
14
|
"@vidstack/react": "^1.12.12",
|
|
16
15
|
"classnames": "^2.2.5",
|
|
17
|
-
"framer-motion": "^
|
|
16
|
+
"framer-motion": "^12.0.0",
|
|
18
17
|
"html-to-react": "^1.6.0",
|
|
19
18
|
"invariant": "^2.2.4",
|
|
20
19
|
"lodash": "^4.17.23",
|
|
@@ -41,8 +40,8 @@
|
|
|
41
40
|
"peerDependencies": {
|
|
42
41
|
"@emotion/react": "^11.4.0",
|
|
43
42
|
"@emotion/styled": "^11.3.0",
|
|
44
|
-
"react": "^17.0.2 || ^18.3.0",
|
|
45
|
-
"react-dom": "^17.0.2 || ^18.3.0"
|
|
43
|
+
"react": "^17.0.2 || ^18.3.0 || ^19.0.0",
|
|
44
|
+
"react-dom": "^17.0.2 || ^18.3.0 || ^19.0.0"
|
|
46
45
|
},
|
|
47
46
|
"publishConfig": {
|
|
48
47
|
"access": "public"
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useIsoFirstWeekday, useResolvedLocale } from '../utils/locale';
|
|
4
|
-
import { getDatesWithRow, getMonthGrid, isDateDisabled, isDateInRange, isSameDay } from './utils/dateGrid';
|
|
5
|
-
import { CalendarTable, DateCell, TableHeader } from './utils/elements';
|
|
6
|
-
import { formatDateForAriaLabel, getWeekdayNames } from './utils/format';
|
|
7
|
-
import { keyHandler } from './utils/keyHandler';
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
export const CalendarBody = ({
|
|
10
|
-
displayDate,
|
|
11
|
-
selectedDate,
|
|
12
|
-
endDate = null,
|
|
13
|
-
disabledDates = [],
|
|
14
|
-
onDateSelect,
|
|
15
|
-
locale,
|
|
16
|
-
weekStartsOn,
|
|
17
|
-
labelledById,
|
|
18
|
-
focusedDate,
|
|
19
|
-
onFocusedDateChange,
|
|
20
|
-
onDisplayDateChange,
|
|
21
|
-
onEscapeKeyPress,
|
|
22
|
-
hasAdjacentMonthRight,
|
|
23
|
-
hasAdjacentMonthLeft,
|
|
24
|
-
focusGridSync
|
|
25
|
-
}) => {
|
|
26
|
-
const resolvedLocale = useResolvedLocale(locale);
|
|
27
|
-
const firstWeekday = useIsoFirstWeekday(resolvedLocale, weekStartsOn);
|
|
28
|
-
const year = displayDate.getFullYear();
|
|
29
|
-
const month = displayDate.getMonth();
|
|
30
|
-
const weeks = getMonthGrid(year, month, firstWeekday);
|
|
31
|
-
const weekdayLabels = getWeekdayNames('short', resolvedLocale, firstWeekday);
|
|
32
|
-
const weekdayFullNames = getWeekdayNames('long', resolvedLocale, firstWeekday);
|
|
33
|
-
const buttonRefs = useRef(new Map());
|
|
34
|
-
const tableRef = useRef(null);
|
|
35
|
-
const datesWithRow = useMemo(() => getDatesWithRow(weeks), [weeks]);
|
|
36
|
-
const focusTarget = focusedDate ?? selectedDate;
|
|
37
|
-
const isToday = useCallback(date => date !== null && isSameDay(date, new Date()), []);
|
|
38
|
-
const focusButton = useCallback(date => {
|
|
39
|
-
if (date === null) return false;
|
|
40
|
-
const key = new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
|
|
41
|
-
const el = buttonRefs.current.get(key);
|
|
42
|
-
if (!el) return false;
|
|
43
|
-
el.focus();
|
|
44
|
-
return true;
|
|
45
|
-
}, []);
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
// Keep the roving tabindex / focused day aligned with `focusTarget` when it makes sense for a11y.
|
|
48
|
-
if (focusTarget === null) return;
|
|
49
|
-
|
|
50
|
-
// Standalone calendar (e.g. Storybook): always move DOM focus to the active day.
|
|
51
|
-
if (!focusGridSync) {
|
|
52
|
-
focusButton(focusTarget);
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const inGrid = tableRef.current?.contains(document.activeElement);
|
|
56
|
-
const requested = focusGridSync.gridFocusRequested;
|
|
57
|
-
|
|
58
|
-
// Focus is already in this grid (keyboard nav): update which day is focused as `focusTarget` changes.
|
|
59
|
-
if (inGrid) {
|
|
60
|
-
focusButton(focusTarget);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// DatePicker opened via keyboard / ArrowDown: parent asked to move focus into the grid once.
|
|
65
|
-
if (requested) {
|
|
66
|
-
const success = focusButton(focusTarget);
|
|
67
|
-
if (success) {
|
|
68
|
-
focusGridSync.onGridFocusRequestHandled();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
// If !inGrid && !requested (e.g. calendar opened with the mouse): leave focus on the input — do not call focusButton.
|
|
72
|
-
}, [focusTarget, focusButton, focusGridSync]);
|
|
73
|
-
const handleKeyDown = useCallback((e, date) => keyHandler({
|
|
74
|
-
e,
|
|
75
|
-
date,
|
|
76
|
-
onFocusedDateChange,
|
|
77
|
-
datesWithRow,
|
|
78
|
-
month,
|
|
79
|
-
year,
|
|
80
|
-
disabledDates,
|
|
81
|
-
onDateSelect,
|
|
82
|
-
onEscapeKeyPress,
|
|
83
|
-
onDisplayDateChange,
|
|
84
|
-
hasAdjacentMonthRight,
|
|
85
|
-
hasAdjacentMonthLeft
|
|
86
|
-
}), [onFocusedDateChange, datesWithRow, month, year, disabledDates, onDateSelect, onEscapeKeyPress, onDisplayDateChange, hasAdjacentMonthLeft, hasAdjacentMonthRight]);
|
|
87
|
-
const setButtonRef = useCallback((date, el) => {
|
|
88
|
-
const k = new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
|
|
89
|
-
if (el) buttonRefs.current.set(k, el);else buttonRefs.current.delete(k);
|
|
90
|
-
}, []);
|
|
91
|
-
return /*#__PURE__*/_jsxs(CalendarTable, {
|
|
92
|
-
"aria-labelledby": labelledById,
|
|
93
|
-
ref: tableRef,
|
|
94
|
-
role: "grid",
|
|
95
|
-
children: [/*#__PURE__*/_jsx("thead", {
|
|
96
|
-
children: /*#__PURE__*/_jsx("tr", {
|
|
97
|
-
children: weekdayLabels.map((label, i) => /*#__PURE__*/_jsx(TableHeader, {
|
|
98
|
-
abbr: weekdayFullNames[i],
|
|
99
|
-
scope: "col",
|
|
100
|
-
children: label
|
|
101
|
-
}, label))
|
|
102
|
-
})
|
|
103
|
-
}), /*#__PURE__*/_jsx("tbody", {
|
|
104
|
-
children: weeks.map((week, rowIndex) => /*#__PURE__*/_jsx("tr", {
|
|
105
|
-
children: week.map((date, colIndex) => {
|
|
106
|
-
if (date === null) {
|
|
107
|
-
return /*#__PURE__*/_jsx("td", {
|
|
108
|
-
role: "gridcell"
|
|
109
|
-
}, `empty-${rowIndex}-${colIndex}`);
|
|
110
|
-
}
|
|
111
|
-
const selected = isSameDay(date, selectedDate) || isSameDay(date, endDate);
|
|
112
|
-
const range = !!selectedDate && !!endDate;
|
|
113
|
-
const inRange = range && isDateInRange(date, selectedDate, endDate);
|
|
114
|
-
const disabled = isDateDisabled(date, disabledDates);
|
|
115
|
-
const today = isToday(date);
|
|
116
|
-
// this is making the selected date a differnet color bc it is focused, look into further
|
|
117
|
-
const isFocused = focusTarget !== null && isSameDay(date, focusTarget);
|
|
118
|
-
return /*#__PURE__*/_jsx(DateCell, {
|
|
119
|
-
"aria-label": formatDateForAriaLabel(date, resolvedLocale),
|
|
120
|
-
"aria-selected": selected,
|
|
121
|
-
isDisabled: disabled,
|
|
122
|
-
isInRange: inRange,
|
|
123
|
-
isRangeEnd: range && isSameDay(date, endDate),
|
|
124
|
-
isRangeStart: range && isSameDay(date, selectedDate),
|
|
125
|
-
isSelected: selected,
|
|
126
|
-
isToday: today,
|
|
127
|
-
ref: el => setButtonRef(date, el),
|
|
128
|
-
role: "gridcell",
|
|
129
|
-
tabIndex: isFocused ? 0 : -1,
|
|
130
|
-
onClick: () => onDateSelect(date),
|
|
131
|
-
onFocus: () => onFocusedDateChange?.(date),
|
|
132
|
-
onKeyDown: e => handleKeyDown(e, date),
|
|
133
|
-
children: date.getDate()
|
|
134
|
-
}, date.getTime());
|
|
135
|
-
})
|
|
136
|
-
}, week.join('-')))
|
|
137
|
-
})]
|
|
138
|
-
});
|
|
139
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { FlexBox } from '../../Box';
|
|
3
|
-
import { TextButton } from '../../Button';
|
|
4
|
-
import { useResolvedLocale } from '../utils/locale';
|
|
5
|
-
import { DEFAULT_DATE_PICKER_TRANSLATIONS } from '../utils/translations';
|
|
6
|
-
import { getRelativeTodayLabel } from './utils/format';
|
|
7
|
-
|
|
8
|
-
// function formatQuickActionLabel(action: QuickAction): string {
|
|
9
|
-
// const { num, timePeriod } = action;
|
|
10
|
-
// const period =
|
|
11
|
-
// timePeriod === 'day'
|
|
12
|
-
// ? num === 1
|
|
13
|
-
// ? 'day'
|
|
14
|
-
// : 'days'
|
|
15
|
-
// : timePeriod === 'week'
|
|
16
|
-
// ? num === 1
|
|
17
|
-
// ? 'week'
|
|
18
|
-
// : 'weeks'
|
|
19
|
-
// : timePeriod === 'month'
|
|
20
|
-
// ? num === 1
|
|
21
|
-
// ? 'month'
|
|
22
|
-
// : 'months'
|
|
23
|
-
// : num === 1
|
|
24
|
-
// ? 'year'
|
|
25
|
-
// : 'years';
|
|
26
|
-
// return `${num} ${period}`;
|
|
27
|
-
// }
|
|
28
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
-
export const CalendarFooter = ({
|
|
30
|
-
onClearDate,
|
|
31
|
-
onTodayClick,
|
|
32
|
-
locale,
|
|
33
|
-
clearText = DEFAULT_DATE_PICKER_TRANSLATIONS.clearText,
|
|
34
|
-
disabled,
|
|
35
|
-
showClearButton
|
|
36
|
-
}) => {
|
|
37
|
-
const resolvedLocale = useResolvedLocale(locale);
|
|
38
|
-
// const actions = quickActions.slice(0, 3);
|
|
39
|
-
|
|
40
|
-
return /*#__PURE__*/_jsxs(FlexBox, {
|
|
41
|
-
alignItems: "center",
|
|
42
|
-
borderTop: 1,
|
|
43
|
-
justifyContent: "space-between",
|
|
44
|
-
p: 12,
|
|
45
|
-
children: [showClearButton && /*#__PURE__*/_jsx(TextButton, {
|
|
46
|
-
disabled: disabled,
|
|
47
|
-
onClick: () => onClearDate?.(),
|
|
48
|
-
children: clearText
|
|
49
|
-
}), /*#__PURE__*/_jsx(FlexBox, {
|
|
50
|
-
gap: 32,
|
|
51
|
-
children: /*#__PURE__*/_jsx(TextButton, {
|
|
52
|
-
onClick: () => onTodayClick?.(),
|
|
53
|
-
children: getRelativeTodayLabel(resolvedLocale)
|
|
54
|
-
})
|
|
55
|
-
})]
|
|
56
|
-
});
|
|
57
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { FlexBox } from '../../Box';
|
|
3
|
-
import { Text } from '../../Typography';
|
|
4
|
-
import { useResolvedLocale } from '../utils/locale';
|
|
5
|
-
import { CalendarNavLastMonth } from './CalendarNavLastMonth';
|
|
6
|
-
import { CalendarNavNextMonth } from './CalendarNavNextMonth';
|
|
7
|
-
import { formatMonthYear } from './utils/format';
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
export const CalendarHeader = ({
|
|
10
|
-
displayDate,
|
|
11
|
-
locale,
|
|
12
|
-
headingId,
|
|
13
|
-
onDisplayDateChange,
|
|
14
|
-
hideLastNav,
|
|
15
|
-
hideNextNav,
|
|
16
|
-
onLastMonthClick,
|
|
17
|
-
onNextMonthClick
|
|
18
|
-
}) => {
|
|
19
|
-
const resolvedLocale = useResolvedLocale(locale);
|
|
20
|
-
return /*#__PURE__*/_jsxs(FlexBox, {
|
|
21
|
-
alignItems: "center",
|
|
22
|
-
pb: 8,
|
|
23
|
-
children: [!hideLastNav && /*#__PURE__*/_jsx(CalendarNavLastMonth, {
|
|
24
|
-
displayDate: displayDate,
|
|
25
|
-
locale: locale,
|
|
26
|
-
onDisplayDateChange: onDisplayDateChange,
|
|
27
|
-
onLastMonthClick: onLastMonthClick
|
|
28
|
-
}), /*#__PURE__*/_jsx(FlexBox, {
|
|
29
|
-
justifyContent: "center",
|
|
30
|
-
width: "100%",
|
|
31
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
32
|
-
"aria-live": "polite",
|
|
33
|
-
fontSize: 16,
|
|
34
|
-
fontWeight: "title",
|
|
35
|
-
id: headingId,
|
|
36
|
-
textAlign: "center",
|
|
37
|
-
children: formatMonthYear(displayDate, resolvedLocale)
|
|
38
|
-
})
|
|
39
|
-
}), !hideNextNav && /*#__PURE__*/_jsx(CalendarNavNextMonth, {
|
|
40
|
-
displayDate: displayDate,
|
|
41
|
-
locale: locale,
|
|
42
|
-
onDisplayDateChange: onDisplayDateChange,
|
|
43
|
-
onNextMonthClick: onNextMonthClick
|
|
44
|
-
})]
|
|
45
|
-
});
|
|
46
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { MiniChevronLeftIcon } from '@codecademy/gamut-icons';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { IconButton } from '../../Button';
|
|
4
|
-
import { useResolvedLocale } from '../utils/locale';
|
|
5
|
-
import { getRelativeMonthLabels } from './utils/format';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export const CalendarNavLastMonth = ({
|
|
8
|
-
displayDate,
|
|
9
|
-
onDisplayDateChange,
|
|
10
|
-
onLastMonthClick,
|
|
11
|
-
locale
|
|
12
|
-
}) => {
|
|
13
|
-
const resolvedLocale = useResolvedLocale(locale);
|
|
14
|
-
const {
|
|
15
|
-
lastMonth
|
|
16
|
-
} = getRelativeMonthLabels(resolvedLocale);
|
|
17
|
-
const handleLastMonth = () => {
|
|
18
|
-
const lastMonth = new Date(displayDate.getFullYear(), displayDate.getMonth() - 1, 1);
|
|
19
|
-
onDisplayDateChange?.(lastMonth);
|
|
20
|
-
onLastMonthClick?.();
|
|
21
|
-
};
|
|
22
|
-
return /*#__PURE__*/_jsx(IconButton, {
|
|
23
|
-
alignSelf: "flex-start",
|
|
24
|
-
"aria-label": lastMonth,
|
|
25
|
-
icon: MiniChevronLeftIcon,
|
|
26
|
-
size: "small",
|
|
27
|
-
tip: lastMonth,
|
|
28
|
-
onClick: handleLastMonth
|
|
29
|
-
});
|
|
30
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { MiniChevronRightIcon } from '@codecademy/gamut-icons';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { IconButton } from '../../Button';
|
|
4
|
-
import { useResolvedLocale } from '../utils/locale';
|
|
5
|
-
import { getRelativeMonthLabels } from './utils/format';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export const CalendarNavNextMonth = ({
|
|
8
|
-
displayDate,
|
|
9
|
-
onDisplayDateChange,
|
|
10
|
-
onNextMonthClick,
|
|
11
|
-
locale
|
|
12
|
-
}) => {
|
|
13
|
-
const resolvedLocale = useResolvedLocale(locale);
|
|
14
|
-
const {
|
|
15
|
-
nextMonth
|
|
16
|
-
} = getRelativeMonthLabels(resolvedLocale);
|
|
17
|
-
const handleNextMonth = () => {
|
|
18
|
-
const nextMonth = new Date(displayDate.getFullYear(), displayDate.getMonth() + 1, 1);
|
|
19
|
-
onDisplayDateChange?.(nextMonth);
|
|
20
|
-
onNextMonthClick?.();
|
|
21
|
-
};
|
|
22
|
-
return /*#__PURE__*/_jsx(IconButton, {
|
|
23
|
-
alignSelf: "flex-end",
|
|
24
|
-
"aria-label": nextMonth,
|
|
25
|
-
icon: MiniChevronRightIcon,
|
|
26
|
-
size: "small",
|
|
27
|
-
tip: nextMonth,
|
|
28
|
-
onClick: handleNextMonth
|
|
29
|
-
});
|
|
30
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { WithChildrenProp } from '../../utils';
|
|
3
|
-
/**
|
|
4
|
-
* Outer wrapper for the calendar (header + body + footer).
|
|
5
|
-
* Used by DatePickerCalendar to group the calendar content.
|
|
6
|
-
* Renders a CheckerDense pattern shadow at offset left 8, top 8.
|
|
7
|
-
*/
|
|
8
|
-
export declare const CalendarWrapper: React.FC<WithChildrenProp>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { CheckerDense } from '@codecademy/gamut-patterns';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Box } from '../../Box';
|
|
4
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
/**
|
|
6
|
-
* Outer wrapper for the calendar (header + body + footer).
|
|
7
|
-
* Used by DatePickerCalendar to group the calendar content.
|
|
8
|
-
* Renders a CheckerDense pattern shadow at offset left 8, top 8.
|
|
9
|
-
*/
|
|
10
|
-
export const CalendarWrapper = ({
|
|
11
|
-
children
|
|
12
|
-
}) => /*#__PURE__*/_jsxs(Box, {
|
|
13
|
-
position: "relative",
|
|
14
|
-
width: "max-content",
|
|
15
|
-
children: [/*#__PURE__*/_jsx(CheckerDense, {
|
|
16
|
-
left: 8,
|
|
17
|
-
position: "absolute",
|
|
18
|
-
top: 8
|
|
19
|
-
}), /*#__PURE__*/_jsx(Box, {
|
|
20
|
-
bg: "background",
|
|
21
|
-
border: 1,
|
|
22
|
-
borderRadius: "sm",
|
|
23
|
-
position: "relative",
|
|
24
|
-
zIndex: 1,
|
|
25
|
-
children: children
|
|
26
|
-
})]
|
|
27
|
-
});
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { IsoWeekday } from '../utils/locale';
|
|
2
|
-
export interface CalendarBaseProps {
|
|
3
|
-
/** Used for the currently displayed month and year */
|
|
4
|
-
displayDate: Date;
|
|
5
|
-
/** Called when the displayed month changes. Pass the new date (e.g. setDisplayDate) so the calendar updates. */
|
|
6
|
-
onDisplayDateChange: (newDate: Date) => void;
|
|
7
|
-
/**
|
|
8
|
-
* Locale for formatting and `Intl.Locale` APIs. Accepts `Intl.LocalesArgument` (e.g. `'en-US'`,
|
|
9
|
-
* `['en-GB', 'en']`, or a prebuilt `Intl.Locale`). Omitted → runtime default (user agent).
|
|
10
|
-
*/
|
|
11
|
-
locale?: Intl.LocalesArgument;
|
|
12
|
-
/** Dates that should be disabled (unselectable) */
|
|
13
|
-
disabledDates?: Date[];
|
|
14
|
-
}
|
|
15
|
-
export interface CalendarNavProps extends Omit<CalendarBaseProps, 'disabledDates'> {
|
|
16
|
-
/** Called after navigating to previous month. */
|
|
17
|
-
onLastMonthClick?: () => void;
|
|
18
|
-
/** Called after navigating to next month */
|
|
19
|
-
onNextMonthClick?: () => void;
|
|
20
|
-
}
|
|
21
|
-
export interface CalendarHeaderProps extends CalendarNavProps {
|
|
22
|
-
hideLastNav?: boolean;
|
|
23
|
-
hideNextNav?: boolean;
|
|
24
|
-
/** Used for the currently displayed second month and year when in two-month view */
|
|
25
|
-
secondDisplayDate?: Date;
|
|
26
|
-
/** id for the heading (for grid aria-labelledby) */
|
|
27
|
-
headingId: string;
|
|
28
|
-
}
|
|
29
|
-
export interface CalendarBodyProps extends CalendarBaseProps {
|
|
30
|
-
/** Selected start date (single or range start) */
|
|
31
|
-
selectedDate: Date | null;
|
|
32
|
-
/** Selected end date (range only; undefined for single-date mode) */
|
|
33
|
-
endDate?: Date | null;
|
|
34
|
-
/** Called when a date cell is selected */
|
|
35
|
-
onDateSelect: (date: Date) => void;
|
|
36
|
-
/**
|
|
37
|
-
* Force first column to this ISO weekday (1 = Monday … 7 = Sunday). Same scale as
|
|
38
|
-
* `Intl.Locale#getWeekInfo().firstDay`. Omit to use locale (polyfill where needed).
|
|
39
|
-
*/
|
|
40
|
-
weekStartsOn?: IsoWeekday;
|
|
41
|
-
/** Id of the month/year heading (aria-labelledby on grid) */
|
|
42
|
-
labelledById: string;
|
|
43
|
-
/** For keyboard nav: which cell has focus (roving tabindex) */
|
|
44
|
-
focusedDate: Date | null;
|
|
45
|
-
/** Callback when focused date changes (e.g. arrow keys) */
|
|
46
|
-
onFocusedDateChange: (date: Date | null) => void;
|
|
47
|
-
/** Called when the escape key is pressed */
|
|
48
|
-
onEscapeKeyPress?: () => void;
|
|
49
|
-
/** When true (e.g. two-month view), arrow keys move focus to adjacent month without changing visible date. */
|
|
50
|
-
hasAdjacentMonthRight?: boolean;
|
|
51
|
-
/** When true (e.g. two-month view), arrow keys move focus to adjacent month without changing visible date. */
|
|
52
|
-
hasAdjacentMonthLeft?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* When set (DatePicker), only programmatically focuses a day when the grid already has focus
|
|
55
|
-
* or `gridFocusRequested` is true (keyboard open / ArrowDown from input).
|
|
56
|
-
* Omit for standalone calendar stories — keeps legacy behavior (always sync focus to focusedDate).
|
|
57
|
-
*/
|
|
58
|
-
focusGridSync?: {
|
|
59
|
-
gridFocusRequested: boolean;
|
|
60
|
-
signal: boolean;
|
|
61
|
-
onGridFocusRequestHandled: () => void;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
export interface QuickAction {
|
|
65
|
-
num: number;
|
|
66
|
-
timePeriod: 'day' | 'week' | 'month' | 'year';
|
|
67
|
-
onClick: () => void;
|
|
68
|
-
}
|
|
69
|
-
export interface CalendarFooterProps extends Pick<CalendarBaseProps, 'locale'> {
|
|
70
|
-
disabled?: boolean;
|
|
71
|
-
showClearButton?: boolean;
|
|
72
|
-
clearText?: string;
|
|
73
|
-
onClearDate?: () => void;
|
|
74
|
-
onTodayClick?: () => void;
|
|
75
|
-
/** Max 3 quick actions (e.g. "7 days", "1 month") */
|
|
76
|
-
quickActions?: QuickAction[];
|
|
77
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|