@knocklabs/react 0.12.1 → 0.13.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/CHANGELOG.md +25 -0
- package/dist/cjs/_virtual/_rolldown/runtime.js +1 -0
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.js +1 -2
- package/dist/cjs/modules/core/components/Button/Button.js +2 -2
- package/dist/cjs/modules/core/components/Button/Button.js.map +1 -1
- package/dist/cjs/modules/core/components/Button/ButtonGroup.js +2 -2
- package/dist/cjs/modules/core/components/Button/ButtonGroup.js.map +1 -1
- package/dist/cjs/modules/core/components/Button/ButtonSpinner.js +2 -2
- package/dist/cjs/modules/core/components/Button/ButtonSpinner.js.map +1 -1
- package/dist/cjs/modules/core/components/Button/index.js +1 -0
- package/dist/cjs/modules/core/components/Icons/Bell.js +2 -2
- package/dist/cjs/modules/core/components/Icons/Bell.js.map +1 -1
- package/dist/cjs/modules/core/components/Icons/CheckmarkCircle.js +2 -2
- package/dist/cjs/modules/core/components/Icons/CheckmarkCircle.js.map +1 -1
- package/dist/cjs/modules/core/components/Icons/ChevronDown.js +2 -2
- package/dist/cjs/modules/core/components/Icons/ChevronDown.js.map +1 -1
- package/dist/cjs/modules/core/components/Icons/CloseCircle.js +2 -2
- package/dist/cjs/modules/core/components/Icons/CloseCircle.js.map +1 -1
- package/dist/cjs/modules/core/components/Icons/index.js +1 -0
- package/dist/cjs/modules/core/components/Spinner/Spinner.js +3 -3
- package/dist/cjs/modules/core/components/Spinner/Spinner.js.map +1 -1
- package/dist/cjs/modules/core/components/Spinner/index.js +1 -0
- package/dist/cjs/modules/core/cx/index.js +2 -2
- package/dist/cjs/modules/core/cx/index.js.map +1 -1
- package/dist/cjs/modules/core/debounce/index.js +2 -2
- package/dist/cjs/modules/core/debounce/index.js.map +1 -1
- package/dist/cjs/modules/core/hooks/index.js +1 -0
- package/dist/cjs/modules/core/hooks/useComponentVisible.js +2 -2
- package/dist/cjs/modules/core/hooks/useComponentVisible.js.map +1 -1
- package/dist/cjs/modules/core/hooks/useOnBottomScroll.js +2 -2
- package/dist/cjs/modules/core/hooks/useOnBottomScroll.js.map +1 -1
- package/dist/cjs/modules/core/index.js +1 -0
- package/dist/cjs/modules/core/utils.js +2 -2
- package/dist/cjs/modules/core/utils.js.map +1 -1
- package/dist/cjs/modules/feed/components/EmptyFeed/EmptyFeed.js +2 -2
- package/dist/cjs/modules/feed/components/EmptyFeed/EmptyFeed.js.map +1 -1
- package/dist/cjs/modules/feed/components/EmptyFeed/index.js +1 -0
- package/dist/cjs/modules/feed/components/NotificationCell/ArchiveButton.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationCell/ArchiveButton.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationCell/Avatar.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationCell/Avatar.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationCell/NotificationCell.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationCell/NotificationCell.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationCell/index.js +1 -0
- package/dist/cjs/modules/feed/components/NotificationFeed/Dropdown.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationFeed/Dropdown.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationFeed/MarkAsRead.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationFeed/MarkAsRead.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeed.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeed.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeedHeader.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeedHeader.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationFeed/index.js +1 -0
- package/dist/cjs/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationFeedContainer/index.js +1 -0
- package/dist/cjs/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationFeedPopover/index.js +1 -0
- package/dist/cjs/modules/feed/components/NotificationIconButton/NotificationIconButton.js +2 -2
- package/dist/cjs/modules/feed/components/NotificationIconButton/NotificationIconButton.js.map +1 -1
- package/dist/cjs/modules/feed/components/NotificationIconButton/index.js +1 -0
- package/dist/cjs/modules/feed/components/UnseenBadge/UnseenBadge.js +2 -2
- package/dist/cjs/modules/feed/components/UnseenBadge/UnseenBadge.js.map +1 -1
- package/dist/cjs/modules/feed/components/UnseenBadge/index.js +1 -0
- package/dist/cjs/modules/feed/index.js +1 -0
- package/dist/cjs/modules/guide/components/Banner/Banner.js +2 -2
- package/dist/cjs/modules/guide/components/Banner/Banner.js.map +1 -1
- package/dist/cjs/modules/guide/components/Banner/index.js +1 -0
- package/dist/cjs/modules/guide/components/Card/Card.js +2 -2
- package/dist/cjs/modules/guide/components/Card/Card.js.map +1 -1
- package/dist/cjs/modules/guide/components/Card/index.js +1 -0
- package/dist/cjs/modules/guide/components/Modal/Modal.js +2 -2
- package/dist/cjs/modules/guide/components/Modal/Modal.js.map +1 -1
- package/dist/cjs/modules/guide/components/Modal/index.js +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/KnockButton.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/KnockButton.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/FocusChin.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/FocusChin.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRowDetails.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRowDetails.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/Kbd.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/Kbd.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/helpers.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/helpers.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/index.js +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/useDraggable.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/useDraggable.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/index.js +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/shared.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/shared.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/styles.inline.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/styles.inline.js.map +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/useToolbarStyles.js +2 -2
- package/dist/cjs/modules/guide/components/Toolbar/useToolbarStyles.js.map +1 -1
- package/dist/cjs/modules/guide/components/helpers.js +2 -2
- package/dist/cjs/modules/guide/components/helpers.js.map +1 -1
- package/dist/cjs/modules/guide/components/index.js +1 -0
- package/dist/cjs/modules/guide/index.js +1 -0
- package/dist/cjs/modules/guide/providers/KnockGuideProvider.js +2 -2
- package/dist/cjs/modules/guide/providers/KnockGuideProvider.js.map +1 -1
- package/dist/cjs/modules/guide/providers/index.js +1 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/index.js +1 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/index.js +1 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/index.js +1 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.js +2 -2
- package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/index.js +1 -0
- package/dist/cjs/modules/ms-teams/index.js +1 -0
- package/dist/cjs/modules/ms-teams/utils.js +2 -2
- package/dist/cjs/modules/ms-teams/utils.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.js +2 -2
- package/dist/cjs/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackAuthButton/SlackAuthButton.js +2 -2
- package/dist/cjs/modules/slack/components/SlackAuthButton/SlackAuthButton.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackAuthButton/index.js +1 -0
- package/dist/cjs/modules/slack/components/SlackAuthContainer/SlackAuthContainer.js +2 -2
- package/dist/cjs/modules/slack/components/SlackAuthContainer/SlackAuthContainer.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackAuthContainer/index.js +1 -0
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.js +2 -2
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackConnectionError.js +2 -2
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackConnectionError.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.js +2 -2
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackChannelCombobox/index.js +1 -0
- package/dist/cjs/modules/slack/components/SlackIcon/SlackIcon.js +2 -2
- package/dist/cjs/modules/slack/components/SlackIcon/SlackIcon.js.map +1 -1
- package/dist/cjs/modules/slack/components/SlackIcon/index.js +1 -0
- package/dist/cjs/modules/slack/index.js +1 -0
- package/dist/cjs/modules/slack/utils.js +2 -2
- package/dist/cjs/modules/slack/utils.js.map +1 -1
- package/dist/cjs/next/KnockGuideLocationSensor.js +2 -2
- package/dist/cjs/next/KnockGuideLocationSensor.js.map +1 -1
- package/dist/cjs/next.js +1 -2
- package/dist/cjs/tanstack/KnockGuideLocationSensor.js +2 -2
- package/dist/cjs/tanstack/KnockGuideLocationSensor.js.map +1 -1
- package/dist/cjs/tanstack.js +1 -2
- package/dist/esm/index.mjs +36 -118
- package/dist/esm/modules/core/components/Button/Button.mjs +28 -21
- package/dist/esm/modules/core/components/Button/Button.mjs.map +1 -1
- package/dist/esm/modules/core/components/Button/ButtonGroup.mjs +11 -9
- package/dist/esm/modules/core/components/Button/ButtonGroup.mjs.map +1 -1
- package/dist/esm/modules/core/components/Button/ButtonSpinner.mjs +13 -10
- package/dist/esm/modules/core/components/Button/ButtonSpinner.mjs.map +1 -1
- package/dist/esm/modules/core/components/Button/index.mjs +3 -0
- package/dist/esm/modules/core/components/Icons/Bell.mjs +26 -10
- package/dist/esm/modules/core/components/Icons/Bell.mjs.map +1 -1
- package/dist/esm/modules/core/components/Icons/CheckmarkCircle.mjs +26 -10
- package/dist/esm/modules/core/components/Icons/CheckmarkCircle.mjs.map +1 -1
- package/dist/esm/modules/core/components/Icons/ChevronDown.mjs +21 -10
- package/dist/esm/modules/core/components/Icons/ChevronDown.mjs.map +1 -1
- package/dist/esm/modules/core/components/Icons/CloseCircle.mjs +18 -10
- package/dist/esm/modules/core/components/Icons/CloseCircle.mjs.map +1 -1
- package/dist/esm/modules/core/components/Icons/index.mjs +5 -0
- package/dist/esm/modules/core/components/Spinner/Spinner.mjs +40 -30
- package/dist/esm/modules/core/components/Spinner/Spinner.mjs.map +1 -1
- package/dist/esm/modules/core/components/Spinner/index.mjs +2 -0
- package/dist/esm/modules/core/cx/index.mjs +6 -5
- package/dist/esm/modules/core/cx/index.mjs.map +1 -1
- package/dist/esm/modules/core/debounce/index.mjs +14 -14
- package/dist/esm/modules/core/debounce/index.mjs.map +1 -1
- package/dist/esm/modules/core/hooks/index.mjs +2 -0
- package/dist/esm/modules/core/hooks/useComponentVisible.mjs +17 -18
- package/dist/esm/modules/core/hooks/useComponentVisible.mjs.map +1 -1
- package/dist/esm/modules/core/hooks/useOnBottomScroll.mjs +21 -21
- package/dist/esm/modules/core/hooks/useOnBottomScroll.mjs.map +1 -1
- package/dist/esm/modules/core/index.mjs +14 -0
- package/dist/esm/modules/core/utils.mjs +10 -11
- package/dist/esm/modules/core/utils.mjs.map +1 -1
- package/dist/esm/modules/feed/components/EmptyFeed/EmptyFeed.mjs +23 -14
- package/dist/esm/modules/feed/components/EmptyFeed/EmptyFeed.mjs.map +1 -1
- package/dist/esm/modules/feed/components/EmptyFeed/index.mjs +2 -0
- package/dist/esm/modules/feed/components/NotificationCell/ArchiveButton.mjs +42 -40
- package/dist/esm/modules/feed/components/NotificationCell/ArchiveButton.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationCell/Avatar.mjs +24 -15
- package/dist/esm/modules/feed/components/NotificationCell/Avatar.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationCell/NotificationCell.mjs +88 -64
- package/dist/esm/modules/feed/components/NotificationCell/NotificationCell.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationCell/index.mjs +3 -0
- package/dist/esm/modules/feed/components/NotificationFeed/Dropdown.mjs +22 -17
- package/dist/esm/modules/feed/components/NotificationFeed/Dropdown.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationFeed/MarkAsRead.mjs +26 -21
- package/dist/esm/modules/feed/components/NotificationFeed/MarkAsRead.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeed.mjs +78 -68
- package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeed.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs +33 -17
- package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationFeed/index.mjs +4 -0
- package/dist/esm/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.mjs +11 -9
- package/dist/esm/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationFeedContainer/index.mjs +2 -0
- package/dist/esm/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs +62 -65
- package/dist/esm/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationFeedPopover/index.mjs +2 -0
- package/dist/esm/modules/feed/components/NotificationIconButton/NotificationIconButton.mjs +22 -17
- package/dist/esm/modules/feed/components/NotificationIconButton/NotificationIconButton.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationIconButton/index.mjs +2 -0
- package/dist/esm/modules/feed/components/UnseenBadge/UnseenBadge.mjs +27 -23
- package/dist/esm/modules/feed/components/UnseenBadge/UnseenBadge.mjs.map +1 -1
- package/dist/esm/modules/feed/components/UnseenBadge/index.mjs +2 -0
- package/dist/esm/modules/feed/index.mjs +18 -0
- package/dist/esm/modules/guide/components/Banner/Banner.mjs +138 -129
- package/dist/esm/modules/guide/components/Banner/Banner.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Banner/index.mjs +2 -0
- package/dist/esm/modules/guide/components/Card/Card.mjs +184 -167
- package/dist/esm/modules/guide/components/Card/Card.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Card/index.mjs +2 -0
- package/dist/esm/modules/guide/components/Modal/Modal.mjs +188 -168
- package/dist/esm/modules/guide/components/Modal/Modal.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Modal/index.mjs +2 -0
- package/dist/esm/modules/guide/components/Toolbar/KnockButton.mjs +46 -24
- package/dist/esm/modules/guide/components/Toolbar/KnockButton.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/FocusChin.mjs +174 -111
- package/dist/esm/modules/guide/components/Toolbar/V2/FocusChin.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.mjs +82 -19
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs +189 -47
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs +229 -143
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRowDetails.mjs +180 -68
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRowDetails.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/Kbd.mjs +17 -14
- package/dist/esm/modules/guide/components/Toolbar/V2/Kbd.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs +315 -159
- package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/helpers.mjs +9 -11
- package/dist/esm/modules/guide/components/Toolbar/V2/helpers.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/index.mjs +2 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/useDraggable.mjs +66 -74
- package/dist/esm/modules/guide/components/Toolbar/V2/useDraggable.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs +136 -192
- package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/index.mjs +3 -0
- package/dist/esm/modules/guide/components/Toolbar/shared.mjs +6 -5
- package/dist/esm/modules/guide/components/Toolbar/shared.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/styles.inline.mjs +6 -0
- package/dist/esm/modules/guide/components/Toolbar/styles.inline.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/useToolbarStyles.mjs +13 -12
- package/dist/esm/modules/guide/components/Toolbar/useToolbarStyles.mjs.map +1 -1
- package/dist/esm/modules/guide/components/helpers.mjs +15 -15
- package/dist/esm/modules/guide/components/helpers.mjs.map +1 -1
- package/dist/esm/modules/guide/components/index.mjs +9 -0
- package/dist/esm/modules/guide/index.mjs +8 -0
- package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs +19 -17
- package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs.map +1 -1
- package/dist/esm/modules/guide/providers/index.mjs +2 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs +78 -52
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/index.mjs +2 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs +33 -16
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/index.mjs +2 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.mjs +60 -28
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.mjs +47 -39
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.mjs +11 -14
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.mjs +23 -11
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.mjs +41 -33
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/index.mjs +2 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.mjs +99 -15
- package/dist/esm/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsIcon/index.mjs +2 -0
- package/dist/esm/modules/ms-teams/index.mjs +7 -0
- package/dist/esm/modules/ms-teams/utils.mjs +6 -5
- package/dist/esm/modules/ms-teams/utils.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.mjs +48 -32
- package/dist/esm/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackAuthButton/SlackAuthButton.mjs +82 -58
- package/dist/esm/modules/slack/components/SlackAuthButton/SlackAuthButton.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackAuthButton/index.mjs +2 -0
- package/dist/esm/modules/slack/components/SlackAuthContainer/SlackAuthContainer.mjs +33 -16
- package/dist/esm/modules/slack/components/SlackAuthContainer/SlackAuthContainer.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackAuthContainer/index.mjs +2 -0
- package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.mjs +100 -66
- package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackConnectionError.mjs +11 -14
- package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackConnectionError.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.mjs +23 -11
- package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackChannelCombobox/index.mjs +2 -0
- package/dist/esm/modules/slack/components/SlackIcon/SlackIcon.mjs +32 -12
- package/dist/esm/modules/slack/components/SlackIcon/SlackIcon.mjs.map +1 -1
- package/dist/esm/modules/slack/components/SlackIcon/index.mjs +2 -0
- package/dist/esm/modules/slack/index.mjs +7 -0
- package/dist/esm/modules/slack/utils.mjs +6 -5
- package/dist/esm/modules/slack/utils.mjs.map +1 -1
- package/dist/esm/next/KnockGuideLocationSensor.mjs +37 -37
- package/dist/esm/next/KnockGuideLocationSensor.mjs.map +1 -1
- package/dist/esm/next.mjs +2 -5
- package/dist/esm/tanstack/KnockGuideLocationSensor.mjs +16 -19
- package/dist/esm/tanstack/KnockGuideLocationSensor.mjs.map +1 -1
- package/dist/esm/tanstack.mjs +2 -5
- package/dist/index.css +1 -1
- package/package.json +12 -14
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/modules/guide/components/Toolbar/styles.css.inline.js +0 -2
- package/dist/cjs/modules/guide/components/Toolbar/styles.css.inline.js.map +0 -1
- package/dist/cjs/next.js.map +0 -1
- package/dist/cjs/tanstack.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/modules/guide/components/Toolbar/styles.css.inline.mjs +0 -5
- package/dist/esm/modules/guide/components/Toolbar/styles.css.inline.mjs.map +0 -1
- package/dist/esm/next.mjs.map +0 -1
- package/dist/esm/tanstack.mjs.map +0 -1
|
@@ -1,112 +1,175 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
import { sharedTooltipProps as e } from "./helpers.mjs";
|
|
2
|
+
import { GUIDE_ROW_DATA_SELECTOR as t } from "./GuideRow.mjs";
|
|
3
|
+
import { Kbd as n } from "./Kbd.mjs";
|
|
4
|
+
import { useGuideContext as r, useStore as i } from "@knocklabs/react-core";
|
|
5
|
+
import * as a from "react";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
import { Button as c } from "@telegraph/button";
|
|
8
|
+
import { Box as l, Stack as u } from "@telegraph/layout";
|
|
9
|
+
import { Tooltip as d } from "@telegraph/tooltip";
|
|
10
|
+
import { Text as f } from "@telegraph/typography";
|
|
11
|
+
import { ChevronLeft as p, ChevronRight as m, X as h } from "lucide-react";
|
|
12
|
+
//#region src/modules/guide/components/Toolbar/V2/FocusChin.tsx
|
|
13
|
+
var g = 60, _ = ",", v = "/", y = (e, n) => {
|
|
14
|
+
requestAnimationFrame(() => {
|
|
15
|
+
let r = e.querySelector(`[${t}="${CSS.escape(n)}"]`);
|
|
16
|
+
if (!r || !(r instanceof HTMLElement)) return;
|
|
17
|
+
let i = e.getBoundingClientRect(), a = r.getBoundingClientRect();
|
|
18
|
+
a.top < i.top ? e.scrollTo({
|
|
19
|
+
top: e.scrollTop - (i.top - a.top) - g,
|
|
20
|
+
behavior: "smooth"
|
|
21
|
+
}) : a.bottom > i.bottom && e.scrollTo({
|
|
22
|
+
top: e.scrollTop + (a.bottom - i.bottom) + g,
|
|
23
|
+
behavior: "smooth"
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}, b = ({ guides: e, currentKey: t, focusGuide: n }) => {
|
|
27
|
+
let r = e.filter((e) => !!e.annotation.selectable.status);
|
|
28
|
+
if (r.length === 0) return;
|
|
29
|
+
if (!t) {
|
|
30
|
+
n(r[r.length - 1].key);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
let i = r.findIndex((e) => e.key === t), a = i <= 0 ? void 0 : r[i - 1];
|
|
34
|
+
a && n(a.key);
|
|
35
|
+
}, x = ({ guides: e, currentKey: t, focusGuide: n }) => {
|
|
36
|
+
let r = e.filter((e) => !!e.annotation.selectable.status);
|
|
37
|
+
if (r.length === 0) return;
|
|
38
|
+
if (!t) {
|
|
39
|
+
n(r[0].key);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
let i = r.findIndex((e) => e.key === t), a = i < 0 || i + 1 > r.length - 1 ? void 0 : r[i + 1];
|
|
43
|
+
a && n(a.key);
|
|
44
|
+
}, S = ({ guides: t, guideListRef: g }) => {
|
|
45
|
+
let { client: S } = r(), { debugSettings: C } = i(S.store, (e) => ({ debugSettings: e.debug })), w = Object.keys(C?.focusedGuideKeys || {}), T = w.length > 0, E = w[0], D = a.useCallback((e) => {
|
|
46
|
+
S.setDebug({
|
|
47
|
+
...S.store.state.debug,
|
|
48
|
+
focusedGuideKeys: { [e]: !0 }
|
|
49
|
+
}), g.current && y(g.current, e);
|
|
50
|
+
}, [S, g]), O = a.useRef({
|
|
51
|
+
guides: t,
|
|
52
|
+
currentKey: E,
|
|
53
|
+
focusGuide: D
|
|
54
|
+
});
|
|
55
|
+
return a.useEffect(() => {
|
|
56
|
+
O.current = {
|
|
57
|
+
guides: t,
|
|
58
|
+
currentKey: E,
|
|
59
|
+
focusGuide: D
|
|
60
|
+
};
|
|
61
|
+
}), a.useEffect(() => {
|
|
62
|
+
let e = (e) => {
|
|
63
|
+
!e.ctrlKey || e.repeat || (e.key === _ ? (e.preventDefault(), b(O.current)) : e.key === v && (e.preventDefault(), x(O.current)));
|
|
64
|
+
};
|
|
65
|
+
return window.addEventListener("keydown", e), () => {
|
|
66
|
+
window.removeEventListener("keydown", e);
|
|
67
|
+
};
|
|
68
|
+
}, []), T ? /* @__PURE__ */ o(l, {
|
|
69
|
+
borderTop: "px",
|
|
70
|
+
px: "3",
|
|
71
|
+
py: "1",
|
|
72
|
+
overflow: "hidden",
|
|
73
|
+
backgroundColor: "blue-2",
|
|
74
|
+
children: /* @__PURE__ */ s(u, {
|
|
75
|
+
align: "center",
|
|
76
|
+
justify: "space-between",
|
|
77
|
+
gap: "4",
|
|
78
|
+
children: [/* @__PURE__ */ s(f, {
|
|
79
|
+
as: "span",
|
|
80
|
+
size: "1",
|
|
81
|
+
weight: "medium",
|
|
82
|
+
color: "blue",
|
|
83
|
+
style: {
|
|
84
|
+
display: "block",
|
|
85
|
+
overflow: "hidden",
|
|
86
|
+
textOverflow: "ellipsis",
|
|
87
|
+
whiteSpace: "nowrap",
|
|
88
|
+
minWidth: 0
|
|
89
|
+
},
|
|
90
|
+
children: ["Focus mode: ", E]
|
|
91
|
+
}), /* @__PURE__ */ s(u, {
|
|
92
|
+
align: "center",
|
|
93
|
+
gap: "1",
|
|
94
|
+
style: { flexShrink: 0 },
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ o(d, {
|
|
97
|
+
label: /* @__PURE__ */ s(f, {
|
|
98
|
+
as: "span",
|
|
99
|
+
size: "1",
|
|
100
|
+
children: ["Focus previous guide", /* @__PURE__ */ s(u, {
|
|
101
|
+
display: "inline-block",
|
|
102
|
+
ml: "3",
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ o(n, { children: "ctrl" }),
|
|
105
|
+
" + ",
|
|
106
|
+
/* @__PURE__ */ o(n, { children: "," })
|
|
107
|
+
]
|
|
108
|
+
})]
|
|
109
|
+
}),
|
|
110
|
+
...e,
|
|
111
|
+
children: /* @__PURE__ */ o(c, {
|
|
112
|
+
size: "0",
|
|
113
|
+
variant: "ghost",
|
|
114
|
+
color: "blue",
|
|
115
|
+
leadingIcon: {
|
|
116
|
+
icon: p,
|
|
117
|
+
alt: "Previous guide"
|
|
118
|
+
},
|
|
119
|
+
onClick: () => b(O.current)
|
|
120
|
+
})
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ o(d, {
|
|
123
|
+
label: /* @__PURE__ */ s(f, {
|
|
124
|
+
as: "span",
|
|
125
|
+
size: "1",
|
|
126
|
+
children: ["Focus next guide", /* @__PURE__ */ s(u, {
|
|
127
|
+
display: "inline-block",
|
|
128
|
+
ml: "3",
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ o(n, { children: "ctrl" }),
|
|
131
|
+
" + ",
|
|
132
|
+
/* @__PURE__ */ o(n, { children: "/" })
|
|
133
|
+
]
|
|
134
|
+
})]
|
|
135
|
+
}),
|
|
136
|
+
...e,
|
|
137
|
+
children: /* @__PURE__ */ o(c, {
|
|
138
|
+
size: "0",
|
|
139
|
+
variant: "ghost",
|
|
140
|
+
color: "blue",
|
|
141
|
+
leadingIcon: {
|
|
142
|
+
icon: m,
|
|
143
|
+
alt: "Next guide"
|
|
144
|
+
},
|
|
145
|
+
onClick: () => x(O.current)
|
|
146
|
+
})
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ o(d, {
|
|
149
|
+
label: "Exit focus mode",
|
|
150
|
+
...e,
|
|
151
|
+
children: /* @__PURE__ */ o(c, {
|
|
152
|
+
size: "0",
|
|
153
|
+
variant: "ghost",
|
|
154
|
+
color: "blue",
|
|
155
|
+
leadingIcon: {
|
|
156
|
+
icon: h,
|
|
157
|
+
alt: "Clear focus"
|
|
158
|
+
},
|
|
159
|
+
onClick: () => {
|
|
160
|
+
S.setDebug({
|
|
161
|
+
...C,
|
|
162
|
+
focusedGuideKeys: {}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
})]
|
|
169
|
+
})
|
|
170
|
+
}) : null;
|
|
108
171
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
//# sourceMappingURL=FocusChin.mjs.map
|
|
172
|
+
//#endregion
|
|
173
|
+
export { S as FocusChin };
|
|
174
|
+
|
|
175
|
+
//# sourceMappingURL=FocusChin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusChin.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/FocusChin.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport { ChevronLeft, ChevronRight, X } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { GUIDE_ROW_DATA_SELECTOR } from \"./GuideRow\";\nimport { Kbd } from \"./Kbd\";\nimport { sharedTooltipProps } from \"./helpers\";\nimport { InspectionResultOk } from \"./useInspectGuideClientStore\";\n\n// Extra scroll overshoot so the focused guide plus ~1-2 neighbors are visible,\n// reducing how often consecutive next/prev clicks trigger a scroll.\nconst SCROLL_OVERSHOOT = 60;\n\nconst FOCUS_PREV_HOTKEY = \",\";\nconst FOCUS_NEXT_HOTKEY = \"/\";\n\nconst maybeScrollGuideIntoView = (container: HTMLElement, guideKey: string) => {\n requestAnimationFrame(() => {\n const el = container.querySelector(\n `[${GUIDE_ROW_DATA_SELECTOR}=\"${CSS.escape(guideKey)}\"]`,\n );\n if (!el || !(el instanceof HTMLElement)) return;\n\n const containerRect = container.getBoundingClientRect();\n const elRect = el.getBoundingClientRect();\n\n if (elRect.top < containerRect.top) {\n container.scrollTo({\n top:\n container.scrollTop -\n (containerRect.top - elRect.top) -\n SCROLL_OVERSHOOT,\n behavior: \"smooth\",\n });\n } else if (elRect.bottom > containerRect.bottom) {\n container.scrollTo({\n top:\n container.scrollTop +\n (elRect.bottom - containerRect.bottom) +\n SCROLL_OVERSHOOT,\n behavior: \"smooth\",\n });\n }\n });\n};\n\ntype FocusNav = {\n guides: InspectionResultOk[\"guides\"];\n currentKey: string | undefined;\n focusGuide: (guideKey: string) => void;\n};\n\nconst focusPrev = ({ guides, currentKey, focusGuide }: FocusNav) => {\n const selectableGuides = guides.filter(\n (g) => !!g.annotation.selectable.status,\n );\n if (selectableGuides.length === 0) return;\n\n if (!currentKey) {\n focusGuide(selectableGuides[selectableGuides.length - 1]!.key);\n return;\n }\n\n const currIndex = selectableGuides.findIndex((g) => g.key === currentKey);\n const prevGuide =\n currIndex <= 0 ? undefined : selectableGuides[currIndex - 1];\n if (!prevGuide) return;\n focusGuide(prevGuide.key);\n};\n\nconst focusNext = ({ guides, currentKey, focusGuide }: FocusNav) => {\n const selectableGuides = guides.filter(\n (g) => !!g.annotation.selectable.status,\n );\n if (selectableGuides.length === 0) return;\n\n if (!currentKey) {\n focusGuide(selectableGuides[0]!.key);\n return;\n }\n\n const currIndex = selectableGuides.findIndex((g) => g.key === currentKey);\n const nextGuide =\n currIndex < 0 || currIndex + 1 > selectableGuides.length - 1\n ? undefined\n : selectableGuides[currIndex + 1];\n if (!nextGuide) return;\n focusGuide(nextGuide.key);\n};\n\ntype Props = {\n guides: InspectionResultOk[\"guides\"];\n guideListRef: React.RefObject<HTMLDivElement | null>;\n};\n\nexport const FocusChin = ({ guides, guideListRef }: Props) => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug,\n }));\n\n const focusedKeys = Object.keys(debugSettings?.focusedGuideKeys || {});\n const isFocused = focusedKeys.length > 0;\n const currentKey = focusedKeys[0];\n\n const focusGuide = React.useCallback(\n (guideKey: string) => {\n client.setDebug({\n ...client.store.state.debug,\n focusedGuideKeys: { [guideKey]: true },\n });\n if (guideListRef.current) {\n maybeScrollGuideIntoView(guideListRef.current, guideKey);\n }\n },\n [client, guideListRef],\n );\n\n // Latest-ref so the window keydown listener below can attach once and always\n // read the current guides / focused key without needing to re-subscribe.\n const latestRef = React.useRef<FocusNav>({ guides, currentKey, focusGuide });\n React.useEffect(() => {\n latestRef.current = { guides, currentKey, focusGuide };\n });\n\n React.useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (!e.ctrlKey || e.repeat) return;\n if (e.key === FOCUS_PREV_HOTKEY) {\n e.preventDefault();\n focusPrev(latestRef.current);\n } else if (e.key === FOCUS_NEXT_HOTKEY) {\n e.preventDefault();\n focusNext(latestRef.current);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, []);\n\n if (!isFocused) {\n return null;\n }\n\n return (\n <Box\n borderTop=\"px\"\n px=\"3\"\n py=\"1\"\n overflow=\"hidden\"\n backgroundColor=\"blue-2\"\n >\n <Stack align=\"center\" justify=\"space-between\" gap=\"4\">\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color=\"blue\"\n style={{\n display: \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n minWidth: 0,\n }}\n >\n Focus mode: {currentKey}\n </Text>\n <Stack align=\"center\" gap=\"1\" style={{ flexShrink: 0 }}>\n <Tooltip\n label={\n <Text as=\"span\" size=\"1\">\n Focus previous guide\n <Stack display=\"inline-block\" ml=\"3\">\n <Kbd>ctrl</Kbd> + <Kbd>,</Kbd>\n </Stack>\n </Text>\n }\n {...sharedTooltipProps}\n >\n <Button\n size=\"0\"\n variant=\"ghost\"\n color=\"blue\"\n leadingIcon={{ icon: ChevronLeft, alt: \"Previous guide\" }}\n onClick={() => focusPrev(latestRef.current)}\n />\n </Tooltip>\n <Tooltip\n label={\n <Text as=\"span\" size=\"1\">\n Focus next guide\n <Stack display=\"inline-block\" ml=\"3\">\n <Kbd>ctrl</Kbd> + <Kbd>/</Kbd>\n </Stack>\n </Text>\n }\n {...sharedTooltipProps}\n >\n <Button\n size=\"0\"\n variant=\"ghost\"\n color=\"blue\"\n leadingIcon={{ icon: ChevronRight, alt: \"Next guide\" }}\n onClick={() => focusNext(latestRef.current)}\n />\n </Tooltip>\n <Tooltip label=\"Exit focus mode\" {...sharedTooltipProps}>\n <Button\n size=\"0\"\n variant=\"ghost\"\n color=\"blue\"\n leadingIcon={{ icon: X, alt: \"Clear focus\" }}\n onClick={() => {\n client.setDebug({ ...debugSettings, focusedGuideKeys: {} });\n }}\n />\n </Tooltip>\n </Stack>\n </Stack>\n </Box>\n );\n};\n"],"names":["SCROLL_OVERSHOOT","FOCUS_PREV_HOTKEY","FOCUS_NEXT_HOTKEY","maybeScrollGuideIntoView","container","guideKey","requestAnimationFrame","el","querySelector","GUIDE_ROW_DATA_SELECTOR","CSS","escape","HTMLElement","containerRect","getBoundingClientRect","elRect","top","scrollTo","scrollTop","behavior","bottom","focusPrev","guides","currentKey","focusGuide","selectableGuides","filter","g","annotation","selectable","status","length","key","currIndex","findIndex","prevGuide","undefined","focusNext","nextGuide","FocusChin","guideListRef","client","useGuideContext","debugSettings","useStore","store","state","debug","focusedKeys","Object","keys","focusedGuideKeys","isFocused","React","useCallback","setDebug","current","latestRef","useRef","useEffect","handleKeyDown","e","ctrlKey","repeat","preventDefault","addEventListener","removeEventListener","Box","Stack","Text","display","overflow","textOverflow","whiteSpace","minWidth","flexShrink","Tooltip","Kbd","sharedTooltipProps","Button","icon","ChevronLeft","alt","ChevronRight","X"],"mappings":";;;;;;;;;;AAeA,MAAMA,IAAmB,IAEnBC,IAAoB,KACpBC,IAAoB,KAEpBC,IAA2BA,CAACC,GAAwBC,MAAqB;AAC7EC,wBAAsB,MAAM;AACpBC,UAAAA,IAAKH,EAAUI,cACnB,IAAIC,CAAuB,KAAKC,IAAIC,OAAON,CAAQ,CAAC,IACtD;AACA,QAAI,CAACE,KAAM,EAAEA,aAAcK,aAAc;AAEnCC,UAAAA,IAAgBT,EAAUU,sBAAsB,GAChDC,IAASR,EAAGO,sBAAsB;AAEpCC,IAAAA,EAAOC,MAAMH,EAAcG,MAC7BZ,EAAUa,SAAS;AAAA,MACjBD,KACEZ,EAAUc,aACTL,EAAcG,MAAMD,EAAOC,OAC5BhB;AAAAA,MACFmB,UAAU;AAAA,IAAA,CACX,IACQJ,EAAOK,SAASP,EAAcO,UACvChB,EAAUa,SAAS;AAAA,MACjBD,KACEZ,EAAUc,aACTH,EAAOK,SAASP,EAAcO,UAC/BpB;AAAAA,MACFmB,UAAU;AAAA,IAAA,CACX;AAAA,EACH,CACD;AACH,GAQME,IAAYA,CAAC;AAAA,EAAEC,QAAAA;AAAAA,EAAQ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M7C,EAAUoB,EAAUD,OAAO,EAAA,CAAE,CAEhD,GACC,gBAAAH,EAAA,cAAAuB,GAAA,EAAQ,OAAM,mBAAsBE,GAAAA,KACnC,gBAAAzB,EAAA,cAAC0B,GACC,EAAA,MAAK,KACL,SAAQ,SACR,OAAM,QACN,aAAa;AAAA,IAAEC,MAAMI;AAAAA,IAAGF,KAAK;AAAA,EAAc,GAC3C,SAAS,MAAM;AACbzC,IAAAA,EAAOc,SAAS;AAAA,MAAE,GAAGZ;AAAAA,MAAeQ,kBAAkB,CAAA;AAAA,IAAC,CAAG;AAAA,EAAA,EAC1D,CAAA,CAEN,CACF,CACF,CACF,IA/EO;AAiFX;"}
|
|
1
|
+
{"version":3,"file":"FocusChin.mjs","names":[],"sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/FocusChin.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport { ChevronLeft, ChevronRight, X } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { GUIDE_ROW_DATA_SELECTOR } from \"./GuideRow\";\nimport { Kbd } from \"./Kbd\";\nimport { sharedTooltipProps } from \"./helpers\";\nimport { InspectionResultOk } from \"./useInspectGuideClientStore\";\n\n// Extra scroll overshoot so the focused guide plus ~1-2 neighbors are visible,\n// reducing how often consecutive next/prev clicks trigger a scroll.\nconst SCROLL_OVERSHOOT = 60;\n\nconst FOCUS_PREV_HOTKEY = \",\";\nconst FOCUS_NEXT_HOTKEY = \"/\";\n\nconst maybeScrollGuideIntoView = (container: HTMLElement, guideKey: string) => {\n requestAnimationFrame(() => {\n const el = container.querySelector(\n `[${GUIDE_ROW_DATA_SELECTOR}=\"${CSS.escape(guideKey)}\"]`,\n );\n if (!el || !(el instanceof HTMLElement)) return;\n\n const containerRect = container.getBoundingClientRect();\n const elRect = el.getBoundingClientRect();\n\n if (elRect.top < containerRect.top) {\n container.scrollTo({\n top:\n container.scrollTop -\n (containerRect.top - elRect.top) -\n SCROLL_OVERSHOOT,\n behavior: \"smooth\",\n });\n } else if (elRect.bottom > containerRect.bottom) {\n container.scrollTo({\n top:\n container.scrollTop +\n (elRect.bottom - containerRect.bottom) +\n SCROLL_OVERSHOOT,\n behavior: \"smooth\",\n });\n }\n });\n};\n\ntype FocusNav = {\n guides: InspectionResultOk[\"guides\"];\n currentKey: string | undefined;\n focusGuide: (guideKey: string) => void;\n};\n\nconst focusPrev = ({ guides, currentKey, focusGuide }: FocusNav) => {\n const selectableGuides = guides.filter(\n (g) => !!g.annotation.selectable.status,\n );\n if (selectableGuides.length === 0) return;\n\n if (!currentKey) {\n focusGuide(selectableGuides[selectableGuides.length - 1]!.key);\n return;\n }\n\n const currIndex = selectableGuides.findIndex((g) => g.key === currentKey);\n const prevGuide =\n currIndex <= 0 ? undefined : selectableGuides[currIndex - 1];\n if (!prevGuide) return;\n focusGuide(prevGuide.key);\n};\n\nconst focusNext = ({ guides, currentKey, focusGuide }: FocusNav) => {\n const selectableGuides = guides.filter(\n (g) => !!g.annotation.selectable.status,\n );\n if (selectableGuides.length === 0) return;\n\n if (!currentKey) {\n focusGuide(selectableGuides[0]!.key);\n return;\n }\n\n const currIndex = selectableGuides.findIndex((g) => g.key === currentKey);\n const nextGuide =\n currIndex < 0 || currIndex + 1 > selectableGuides.length - 1\n ? undefined\n : selectableGuides[currIndex + 1];\n if (!nextGuide) return;\n focusGuide(nextGuide.key);\n};\n\ntype Props = {\n guides: InspectionResultOk[\"guides\"];\n guideListRef: React.RefObject<HTMLDivElement | null>;\n};\n\nexport const FocusChin = ({ guides, guideListRef }: Props) => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug,\n }));\n\n const focusedKeys = Object.keys(debugSettings?.focusedGuideKeys || {});\n const isFocused = focusedKeys.length > 0;\n const currentKey = focusedKeys[0];\n\n const focusGuide = React.useCallback(\n (guideKey: string) => {\n client.setDebug({\n ...client.store.state.debug,\n focusedGuideKeys: { [guideKey]: true },\n });\n if (guideListRef.current) {\n maybeScrollGuideIntoView(guideListRef.current, guideKey);\n }\n },\n [client, guideListRef],\n );\n\n // Latest-ref so the window keydown listener below can attach once and always\n // read the current guides / focused key without needing to re-subscribe.\n const latestRef = React.useRef<FocusNav>({ guides, currentKey, focusGuide });\n React.useEffect(() => {\n latestRef.current = { guides, currentKey, focusGuide };\n });\n\n React.useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (!e.ctrlKey || e.repeat) return;\n if (e.key === FOCUS_PREV_HOTKEY) {\n e.preventDefault();\n focusPrev(latestRef.current);\n } else if (e.key === FOCUS_NEXT_HOTKEY) {\n e.preventDefault();\n focusNext(latestRef.current);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, []);\n\n if (!isFocused) {\n return null;\n }\n\n return (\n <Box\n borderTop=\"px\"\n px=\"3\"\n py=\"1\"\n overflow=\"hidden\"\n backgroundColor=\"blue-2\"\n >\n <Stack align=\"center\" justify=\"space-between\" gap=\"4\">\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color=\"blue\"\n style={{\n display: \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n minWidth: 0,\n }}\n >\n Focus mode: {currentKey}\n </Text>\n <Stack align=\"center\" gap=\"1\" style={{ flexShrink: 0 }}>\n <Tooltip\n label={\n <Text as=\"span\" size=\"1\">\n Focus previous guide\n <Stack display=\"inline-block\" ml=\"3\">\n <Kbd>ctrl</Kbd> + <Kbd>,</Kbd>\n </Stack>\n </Text>\n }\n {...sharedTooltipProps}\n >\n <Button\n size=\"0\"\n variant=\"ghost\"\n color=\"blue\"\n leadingIcon={{ icon: ChevronLeft, alt: \"Previous guide\" }}\n onClick={() => focusPrev(latestRef.current)}\n />\n </Tooltip>\n <Tooltip\n label={\n <Text as=\"span\" size=\"1\">\n Focus next guide\n <Stack display=\"inline-block\" ml=\"3\">\n <Kbd>ctrl</Kbd> + <Kbd>/</Kbd>\n </Stack>\n </Text>\n }\n {...sharedTooltipProps}\n >\n <Button\n size=\"0\"\n variant=\"ghost\"\n color=\"blue\"\n leadingIcon={{ icon: ChevronRight, alt: \"Next guide\" }}\n onClick={() => focusNext(latestRef.current)}\n />\n </Tooltip>\n <Tooltip label=\"Exit focus mode\" {...sharedTooltipProps}>\n <Button\n size=\"0\"\n variant=\"ghost\"\n color=\"blue\"\n leadingIcon={{ icon: X, alt: \"Clear focus\" }}\n onClick={() => {\n client.setDebug({ ...debugSettings, focusedGuideKeys: {} });\n }}\n />\n </Tooltip>\n </Stack>\n </Stack>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAeA,IAAM,IAAmB,IAEnB,IAAoB,KACpB,IAAoB,KAEpB,KAA4B,GAAwB,MAAqB;CAC7E,4BAA4B;EAC1B,IAAM,IAAK,EAAU,cACnB,IAAI,EAAwB,IAAI,IAAI,OAAO,CAAQ,EAAE,GACvD;EACA,IAAI,CAAC,KAAM,EAAE,aAAc,cAAc;EAEzC,IAAM,IAAgB,EAAU,sBAAsB,GAChD,IAAS,EAAG,sBAAsB;EAExC,AAAI,EAAO,MAAM,EAAc,MAC7B,EAAU,SAAS;GACjB,KACE,EAAU,aACT,EAAc,MAAM,EAAO,OAC5B;GACF,UAAU;EACZ,CAAC,IACQ,EAAO,SAAS,EAAc,UACvC,EAAU,SAAS;GACjB,KACE,EAAU,aACT,EAAO,SAAS,EAAc,UAC/B;GACF,UAAU;EACZ,CAAC;CAEL,CAAC;AACH,GAQM,KAAa,EAAE,WAAQ,eAAY,oBAA2B;CAClE,IAAM,IAAmB,EAAO,QAC7B,MAAM,CAAC,CAAC,EAAE,WAAW,WAAW,MACnC;CACA,IAAI,EAAiB,WAAW,GAAG;CAEnC,IAAI,CAAC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C;SAAG,kBAAC,GAAD,EAAA,UAAK,IAAM,CAAA;QACxB;SACH;;MAER,GAAI;gBAEJ,kBAAC,GAAD;OACE,MAAK;OACL,SAAQ;OACR,OAAM;OACN,aAAa;QAAE,MAAM;QAAc,KAAK;OAAa;OACrD,eAAe,EAAU,EAAU,OAAO;MAC3C,CAAA;KACM,CAAA;KACT,kBAAC,GAAD;MAAS,OAAM;MAAkB,GAAI;gBACnC,kBAAC,GAAD;OACE,MAAK;OACL,SAAQ;OACR,OAAM;OACN,aAAa;QAAE,MAAM;QAAG,KAAK;OAAc;OAC3C,eAAe;QACb,EAAO,SAAS;SAAE,GAAG;SAAe,kBAAkB,CAAC;QAAE,CAAC;OAC5D;MACD,CAAA;KACM,CAAA;IACJ;KACF;;CACJ,CAAA,IA/EE;AAiFX"}
|
|
@@ -1,19 +1,82 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
1
|
+
import { sharedTooltipProps as e } from "./helpers.mjs";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { Stack as r } from "@telegraph/layout";
|
|
4
|
+
import { Tooltip as i } from "@telegraph/tooltip";
|
|
5
|
+
//#region src/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.tsx
|
|
6
|
+
var a = {
|
|
7
|
+
blue: /* @__PURE__ */ t("svg", {
|
|
8
|
+
width: "8",
|
|
9
|
+
height: "8",
|
|
10
|
+
viewBox: "0 0 8 8",
|
|
11
|
+
"aria-hidden": !0,
|
|
12
|
+
children: /* @__PURE__ */ t("circle", {
|
|
13
|
+
cx: "4",
|
|
14
|
+
cy: "4",
|
|
15
|
+
r: "4",
|
|
16
|
+
fill: "var(--tgph-blue-9)"
|
|
17
|
+
})
|
|
18
|
+
}),
|
|
19
|
+
yellow: /* @__PURE__ */ t("svg", {
|
|
20
|
+
width: "8",
|
|
21
|
+
height: "8",
|
|
22
|
+
viewBox: "0 0 8 8",
|
|
23
|
+
"aria-hidden": !0,
|
|
24
|
+
children: /* @__PURE__ */ t("polygon", {
|
|
25
|
+
points: "4,0.5 7.5,7.5 0.5,7.5",
|
|
26
|
+
fill: "var(--tgph-yellow-9)"
|
|
27
|
+
})
|
|
28
|
+
}),
|
|
29
|
+
gray: /* @__PURE__ */ t("svg", {
|
|
30
|
+
width: "8",
|
|
31
|
+
height: "8",
|
|
32
|
+
viewBox: "0 0 8 8",
|
|
33
|
+
"aria-hidden": !0,
|
|
34
|
+
children: /* @__PURE__ */ t("circle", {
|
|
35
|
+
cx: "4",
|
|
36
|
+
cy: "4",
|
|
37
|
+
r: "2.75",
|
|
38
|
+
fill: "none",
|
|
39
|
+
stroke: "var(--tgph-gray-9)",
|
|
40
|
+
strokeWidth: "2.5"
|
|
41
|
+
})
|
|
42
|
+
}),
|
|
43
|
+
red: /* @__PURE__ */ n("svg", {
|
|
44
|
+
width: "8",
|
|
45
|
+
height: "8",
|
|
46
|
+
viewBox: "0 0 8 8",
|
|
47
|
+
"aria-hidden": !0,
|
|
48
|
+
children: [/* @__PURE__ */ t("line", {
|
|
49
|
+
x1: "1.5",
|
|
50
|
+
y1: "1.5",
|
|
51
|
+
x2: "6.5",
|
|
52
|
+
y2: "6.5",
|
|
53
|
+
stroke: "var(--tgph-red-9)",
|
|
54
|
+
strokeWidth: "2",
|
|
55
|
+
strokeLinecap: "round"
|
|
56
|
+
}), /* @__PURE__ */ t("line", {
|
|
57
|
+
x1: "6.5",
|
|
58
|
+
y1: "1.5",
|
|
59
|
+
x2: "1.5",
|
|
60
|
+
y2: "6.5",
|
|
61
|
+
stroke: "var(--tgph-red-9)",
|
|
62
|
+
strokeWidth: "2",
|
|
63
|
+
strokeLinecap: "round"
|
|
64
|
+
})]
|
|
65
|
+
})
|
|
66
|
+
}, o = ({ color: n, tooltip: o }) => /* @__PURE__ */ t(i, {
|
|
67
|
+
label: o,
|
|
68
|
+
...e,
|
|
69
|
+
children: /* @__PURE__ */ t(r, {
|
|
70
|
+
as: "span",
|
|
71
|
+
align: "center",
|
|
72
|
+
justify: "center",
|
|
73
|
+
display: "inline-flex",
|
|
74
|
+
p: "0_5",
|
|
75
|
+
style: { flexShrink: 0 },
|
|
76
|
+
children: a[n]
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
//#endregion
|
|
80
|
+
export { o as GuideAnnotatedStatusDot };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=GuideAnnotatedStatusDot.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuideAnnotatedStatusDot.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.tsx"],"sourcesContent":["import { Stack } from \"@telegraph/layout\";\nimport { Tooltip } from \"@telegraph/tooltip\";\n\nimport { sharedTooltipProps } from \"./helpers\";\n\nexport type StatusColor = \"blue\" | \"red\" | \"yellow\" | \"gray\";\n\n// Directly copied from the design prototype.\nconst STATUS_SHAPES: Record<StatusColor, React.ReactNode> = {\n blue: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <circle cx=\"4\" cy=\"4\" r=\"4\" fill=\"var(--tgph-blue-9)\" />\n </svg>\n ),\n yellow: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <polygon points=\"4,0.5 7.5,7.5 0.5,7.5\" fill=\"var(--tgph-yellow-9)\" />\n </svg>\n ),\n gray: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <circle\n cx=\"4\"\n cy=\"4\"\n r=\"2.75\"\n fill=\"none\"\n stroke=\"var(--tgph-gray-9)\"\n strokeWidth=\"2.5\"\n />\n </svg>\n ),\n red: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <line\n x1=\"1.5\"\n y1=\"1.5\"\n x2=\"6.5\"\n y2=\"6.5\"\n stroke=\"var(--tgph-red-9)\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n <line\n x1=\"6.5\"\n y1=\"1.5\"\n x2=\"1.5\"\n y2=\"6.5\"\n stroke=\"var(--tgph-red-9)\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n </svg>\n ),\n};\n\nexport const GuideAnnotatedStatusDot = ({\n color,\n tooltip,\n}: {\n color: StatusColor;\n tooltip: string;\n}) => {\n return (\n <Tooltip label={tooltip} {...sharedTooltipProps}>\n <Stack\n as=\"span\"\n align=\"center\"\n justify=\"center\"\n display=\"inline-flex\"\n p=\"0_5\"\n style={{ flexShrink: 0 }}\n >\n {STATUS_SHAPES[color]}\n </Stack>\n </Tooltip>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"GuideAnnotatedStatusDot.mjs","names":[],"sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.tsx"],"sourcesContent":["import { Stack } from \"@telegraph/layout\";\nimport { Tooltip } from \"@telegraph/tooltip\";\n\nimport { sharedTooltipProps } from \"./helpers\";\n\nexport type StatusColor = \"blue\" | \"red\" | \"yellow\" | \"gray\";\n\n// Directly copied from the design prototype.\nconst STATUS_SHAPES: Record<StatusColor, React.ReactNode> = {\n blue: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <circle cx=\"4\" cy=\"4\" r=\"4\" fill=\"var(--tgph-blue-9)\" />\n </svg>\n ),\n yellow: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <polygon points=\"4,0.5 7.5,7.5 0.5,7.5\" fill=\"var(--tgph-yellow-9)\" />\n </svg>\n ),\n gray: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <circle\n cx=\"4\"\n cy=\"4\"\n r=\"2.75\"\n fill=\"none\"\n stroke=\"var(--tgph-gray-9)\"\n strokeWidth=\"2.5\"\n />\n </svg>\n ),\n red: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <line\n x1=\"1.5\"\n y1=\"1.5\"\n x2=\"6.5\"\n y2=\"6.5\"\n stroke=\"var(--tgph-red-9)\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n <line\n x1=\"6.5\"\n y1=\"1.5\"\n x2=\"1.5\"\n y2=\"6.5\"\n stroke=\"var(--tgph-red-9)\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n </svg>\n ),\n};\n\nexport const GuideAnnotatedStatusDot = ({\n color,\n tooltip,\n}: {\n color: StatusColor;\n tooltip: string;\n}) => {\n return (\n <Tooltip label={tooltip} {...sharedTooltipProps}>\n <Stack\n as=\"span\"\n align=\"center\"\n justify=\"center\"\n display=\"inline-flex\"\n p=\"0_5\"\n style={{ flexShrink: 0 }}\n >\n {STATUS_SHAPES[color]}\n </Stack>\n </Tooltip>\n );\n};\n"],"mappings":";;;;;AAQA,IAAM,IAAsD;CAC1D,MACE,kBAAC,OAAD;EAAK,OAAM;EAAI,QAAO;EAAI,SAAQ;EAAU,eAAA;YAC1C,kBAAC,UAAD;GAAQ,IAAG;GAAI,IAAG;GAAI,GAAE;GAAI,MAAK;EAAsB,CAAA;CACpD,CAAA;CAEP,QACE,kBAAC,OAAD;EAAK,OAAM;EAAI,QAAO;EAAI,SAAQ;EAAU,eAAA;YAC1C,kBAAC,WAAD;GAAS,QAAO;GAAwB,MAAK;EAAwB,CAAA;CAClE,CAAA;CAEP,MACE,kBAAC,OAAD;EAAK,OAAM;EAAI,QAAO;EAAI,SAAQ;EAAU,eAAA;YAC1C,kBAAC,UAAD;GACE,IAAG;GACH,IAAG;GACH,GAAE;GACF,MAAK;GACL,QAAO;GACP,aAAY;EACb,CAAA;CACE,CAAA;CAEP,KACE,kBAAC,OAAD;EAAK,OAAM;EAAI,QAAO;EAAI,SAAQ;EAAU,eAAA;YAA5C,CACE,kBAAC,QAAD;GACE,IAAG;GACH,IAAG;GACH,IAAG;GACH,IAAG;GACH,QAAO;GACP,aAAY;GACZ,eAAc;EACf,CAAA,GACD,kBAAC,QAAD;GACE,IAAG;GACH,IAAG;GACH,IAAG;GACH,IAAG;GACH,QAAO;GACP,aAAY;GACZ,eAAc;EACf,CAAA,CACE;;AAET,GAEa,KAA2B,EACtC,UACA,iBAME,kBAAC,GAAD;CAAS,OAAO;CAAS,GAAI;WAC3B,kBAAC,GAAD;EACE,IAAG;EACH,OAAM;EACN,SAAQ;EACR,SAAQ;EACR,GAAE;EACF,OAAO,EAAE,YAAY,EAAE;YAEtB,EAAc;CACV,CAAA;AACA,CAAA"}
|