@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.
Files changed (121) hide show
  1. package/dist/Alert/elements.d.ts +3 -3
  2. package/dist/Anchor/index.d.ts +19 -9
  3. package/dist/Anchor/index.js +9 -6
  4. package/dist/BarChart/BarRow/elements.d.ts +77 -61
  5. package/dist/BarChart/utils/hooks.d.ts +2 -2
  6. package/dist/BarChart/utils/hooks.js +1 -1
  7. package/dist/Box/Box.d.ts +1 -1
  8. package/dist/Box/FlexBox.d.ts +1 -1
  9. package/dist/Box/GridBox.d.ts +2 -1
  10. package/dist/Box/GridBox.js +1 -1
  11. package/dist/Box/props.d.ts +1 -1
  12. package/dist/Button/CTAButton.d.ts +2 -2
  13. package/dist/Button/FillButton.d.ts +4 -4
  14. package/dist/Button/IconButton.d.ts +4 -4
  15. package/dist/Button/StrokeButton.d.ts +4 -4
  16. package/dist/Button/TextButton.d.ts +4 -4
  17. package/dist/Button/shared/InlineIconButton.d.ts +2 -2
  18. package/dist/Button/shared/styles.d.ts +3 -3
  19. package/dist/Button/shared/types.d.ts +1 -1
  20. package/dist/ButtonBase/ButtonBase.d.ts +9 -4
  21. package/dist/ButtonBase/ButtonBase.js +11 -4
  22. package/dist/Card/elements.d.ts +187 -139
  23. package/dist/Card/styles.d.ts +8 -8
  24. package/dist/Coachmark/index.d.ts +1 -1
  25. package/dist/ConnectedForm/ConnectedForm.d.ts +1 -1
  26. package/dist/ConnectedForm/utils.d.ts +3 -3
  27. package/dist/ContentContainer/index.d.ts +1 -1
  28. package/dist/Disclosure/elements.d.ts +20 -14
  29. package/dist/FeatureShimmer/index.js +1 -1
  30. package/dist/FocusTrap/index.d.ts +2 -2
  31. package/dist/Form/SelectDropdown/elements/controls.js +2 -2
  32. package/dist/Form/SelectDropdown/elements/multi-value.js +2 -2
  33. package/dist/Form/SelectDropdown/types/internal.d.ts +2 -2
  34. package/dist/Form/elements/Form.d.ts +15 -15
  35. package/dist/Form/elements/FormGroup.d.ts +2 -2
  36. package/dist/Form/styles/Checkbox-styles.d.ts +1 -1
  37. package/dist/GridForm/GridFormButtons/index.d.ts +4 -4
  38. package/dist/InternalFloatingCard/InternalFloatingCard.d.ts +1 -1
  39. package/dist/Layout/Column.d.ts +1 -1
  40. package/dist/Layout/LayoutGrid.d.ts +1 -1
  41. package/dist/List/ListProvider.d.ts +1 -1
  42. package/dist/List/elements.d.ts +75 -59
  43. package/dist/List/hooks.d.ts +1 -1
  44. package/dist/Menu/Menu.d.ts +1 -1
  45. package/dist/Menu/MenuItem.js +10 -6
  46. package/dist/Menu/elements.d.ts +4 -4
  47. package/dist/Modals/elements.d.ts +1 -1
  48. package/dist/Pagination/AnimatedPaginationButtons.d.ts +58 -42
  49. package/dist/Pagination/EllipsisButton.d.ts +2 -2
  50. package/dist/Pagination/PaginationButton.d.ts +6 -6
  51. package/dist/Pagination/utils.d.ts +58 -42
  52. package/dist/Pagination/utils.js +14 -11
  53. package/dist/Popover/Popover.js +4 -4
  54. package/dist/Popover/elements.d.ts +2 -2
  55. package/dist/Popover/types.d.ts +3 -2
  56. package/dist/PopoverContainer/PopoverContainer.js +9 -13
  57. package/dist/PopoverContainer/hooks.d.ts +15 -4
  58. package/dist/PopoverContainer/hooks.js +31 -24
  59. package/dist/PopoverContainer/types.d.ts +3 -7
  60. package/dist/Tabs/TabButton.d.ts +2 -2
  61. package/dist/Tabs/TabNav.d.ts +1 -1
  62. package/dist/Tabs/TabNavLink.d.ts +2 -2
  63. package/dist/Tag/elements.d.ts +18 -12
  64. package/dist/Tip/InfoTip/InfoTipButton.d.ts +4 -4
  65. package/dist/Tip/InfoTip/styles.d.ts +1 -1
  66. package/dist/Tip/PreviewTip/elements.d.ts +13 -7
  67. package/dist/Tip/ToolTip/elements.d.ts +1 -1
  68. package/dist/Tip/__tests__/helpers.d.ts +3 -3
  69. package/dist/Tip/shared/FloatingTip.js +2 -2
  70. package/dist/Tip/shared/elements.d.ts +3 -3
  71. package/dist/Tip/shared/types.d.ts +2 -2
  72. package/dist/Toggle/elements.d.ts +1 -1
  73. package/dist/Typography/Text.d.ts +2 -2
  74. package/dist/index.d.ts +0 -2
  75. package/dist/index.js +0 -2
  76. package/dist/utils/react.js +2 -1
  77. package/package.json +9 -10
  78. package/dist/DatePicker/Calendar/CalendarBody.d.ts +0 -3
  79. package/dist/DatePicker/Calendar/CalendarBody.js +0 -139
  80. package/dist/DatePicker/Calendar/CalendarFooter.d.ts +0 -3
  81. package/dist/DatePicker/Calendar/CalendarFooter.js +0 -57
  82. package/dist/DatePicker/Calendar/CalendarHeader.d.ts +0 -3
  83. package/dist/DatePicker/Calendar/CalendarHeader.js +0 -46
  84. package/dist/DatePicker/Calendar/CalendarNavLastMonth.d.ts +0 -3
  85. package/dist/DatePicker/Calendar/CalendarNavLastMonth.js +0 -30
  86. package/dist/DatePicker/Calendar/CalendarNavNextMonth.d.ts +0 -3
  87. package/dist/DatePicker/Calendar/CalendarNavNextMonth.js +0 -30
  88. package/dist/DatePicker/Calendar/CalendarWrapper.d.ts +0 -8
  89. package/dist/DatePicker/Calendar/CalendarWrapper.js +0 -27
  90. package/dist/DatePicker/Calendar/index.d.ts +0 -6
  91. package/dist/DatePicker/Calendar/index.js +0 -6
  92. package/dist/DatePicker/Calendar/types.d.ts +0 -77
  93. package/dist/DatePicker/Calendar/types.js +0 -1
  94. package/dist/DatePicker/Calendar/utils/dateGrid.d.ts +0 -38
  95. package/dist/DatePicker/Calendar/utils/dateGrid.js +0 -103
  96. package/dist/DatePicker/Calendar/utils/elements.d.ts +0 -18
  97. package/dist/DatePicker/Calendar/utils/elements.js +0 -116
  98. package/dist/DatePicker/Calendar/utils/format.d.ts +0 -44
  99. package/dist/DatePicker/Calendar/utils/format.js +0 -128
  100. package/dist/DatePicker/Calendar/utils/keyHandler.d.ts +0 -12
  101. package/dist/DatePicker/Calendar/utils/keyHandler.js +0 -126
  102. package/dist/DatePicker/Calendar/utils/validation.d.ts +0 -13
  103. package/dist/DatePicker/Calendar/utils/validation.js +0 -23
  104. package/dist/DatePicker/DatePicker.d.ts +0 -7
  105. package/dist/DatePicker/DatePicker.js +0 -155
  106. package/dist/DatePicker/DatePickerCalendar.d.ts +0 -11
  107. package/dist/DatePicker/DatePickerCalendar.js +0 -163
  108. package/dist/DatePicker/DatePickerContext.d.ts +0 -10
  109. package/dist/DatePicker/DatePickerContext.js +0 -18
  110. package/dist/DatePicker/DatePickerInput.d.ts +0 -16
  111. package/dist/DatePicker/DatePickerInput.js +0 -134
  112. package/dist/DatePicker/index.d.ts +0 -5
  113. package/dist/DatePicker/index.js +0 -5
  114. package/dist/DatePicker/types.d.ts +0 -86
  115. package/dist/DatePicker/types.js +0 -1
  116. package/dist/DatePicker/utils/dateSelect.d.ts +0 -19
  117. package/dist/DatePicker/utils/dateSelect.js +0 -146
  118. package/dist/DatePicker/utils/locale.d.ts +0 -38
  119. package/dist/DatePicker/utils/locale.js +0 -93
  120. package/dist/DatePicker/utils/translations.d.ts +0 -15
  121. 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';
@@ -33,7 +33,8 @@ export const extractTextContent = children => {
33
33
  return '';
34
34
  }
35
35
  if (/*#__PURE__*/isValidElement(child)) {
36
- const textContent = child.props.children ?? child.props.text ?? '';
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.df0cb3.0",
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.df0cb3.0",
8
- "@codecademy/gamut-illustrations": "0.58.10-alpha.df0cb3.0",
9
- "@codecademy/gamut-patterns": "0.10.29-alpha.df0cb3.0",
10
- "@codecademy/gamut-styles": "17.13.2-alpha.df0cb3.0",
11
- "@codecademy/variance": "0.26.2-alpha.df0cb3.0",
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": "^11.18.0",
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,3 +0,0 @@
1
- import * as React from 'react';
2
- import { CalendarBodyProps } from './types';
3
- export declare const CalendarBody: React.FC<CalendarBodyProps>;
@@ -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,3 +0,0 @@
1
- import * as React from 'react';
2
- import { CalendarFooterProps } from './types';
3
- export declare const CalendarFooter: React.FC<CalendarFooterProps>;
@@ -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,3 +0,0 @@
1
- import * as React from 'react';
2
- import { CalendarHeaderProps } from './types';
3
- export declare const CalendarHeader: React.FC<CalendarHeaderProps>;
@@ -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,3 +0,0 @@
1
- import * as React from 'react';
2
- import { CalendarNavProps } from './types';
3
- export declare const CalendarNavLastMonth: React.FC<CalendarNavProps>;
@@ -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,3 +0,0 @@
1
- import * as React from 'react';
2
- import { CalendarNavProps } from './types';
3
- export declare const CalendarNavNextMonth: React.FC<CalendarNavProps>;
@@ -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,6 +0,0 @@
1
- export * from './CalendarWrapper';
2
- export * from './CalendarHeader';
3
- export * from './CalendarBody';
4
- export * from './CalendarFooter';
5
- export * from './CalendarNavLastMonth';
6
- export * from './CalendarNavNextMonth';
@@ -1,6 +0,0 @@
1
- export * from './CalendarWrapper';
2
- export * from './CalendarHeader';
3
- export * from './CalendarBody';
4
- export * from './CalendarFooter';
5
- export * from './CalendarNavLastMonth';
6
- export * from './CalendarNavNextMonth';
@@ -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 {};