@activecollab/components 2.0.570 → 2.0.572
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/dist/cjs/components/Autocomplete/Styles.js +1 -1
- package/dist/cjs/components/Autocomplete/Styles.js.map +1 -1
- package/dist/cjs/components/Dialog/Styles.js +1 -1
- package/dist/cjs/components/Dialog/Styles.js.map +1 -1
- package/dist/cjs/components/GlobalStyle.js +1 -1
- package/dist/cjs/components/GlobalStyle.js.map +1 -1
- package/dist/cjs/components/Icons/collection/ArrowUpCircle.js +61 -0
- package/dist/cjs/components/Icons/collection/ArrowUpCircle.js.map +1 -0
- package/dist/cjs/components/Icons/collection/Storage.js +61 -0
- package/dist/cjs/components/Icons/collection/Storage.js.map +1 -0
- package/dist/cjs/components/Icons/collection/index.js +14 -0
- package/dist/cjs/components/Icons/collection/index.js.map +1 -1
- package/dist/cjs/components/IdentityMark/Styles.js +7 -0
- package/dist/cjs/components/IdentityMark/Styles.js.map +1 -1
- package/dist/cjs/components/MainMenu/MainMenu.js +25 -13
- package/dist/cjs/components/MainMenu/MainMenu.js.map +1 -1
- package/dist/cjs/components/MainMenu/Styles.js +1 -1
- package/dist/cjs/components/MainMenu/Styles.js.map +1 -1
- package/dist/cjs/components/MainMenu/hooks.js +33 -2
- package/dist/cjs/components/MainMenu/hooks.js.map +1 -1
- package/dist/cjs/components/MainMenu/types.js +2 -1
- package/dist/cjs/components/MainMenu/types.js.map +1 -1
- package/dist/cjs/components/ObjectFormModal/Styles.js +2 -2
- package/dist/cjs/components/ObjectFormModal/Styles.js.map +1 -1
- package/dist/cjs/components/PillButton/PillButton.js +5 -2
- package/dist/cjs/components/PillButton/PillButton.js.map +1 -1
- package/dist/cjs/components/PillButton/Styles.js +3 -1
- package/dist/cjs/components/PillButton/Styles.js.map +1 -1
- package/dist/cjs/components/PillGroup/PillGroup.js.map +1 -1
- package/dist/cjs/components/PillGroup/Styles.js +4 -1
- package/dist/cjs/components/PillGroup/Styles.js.map +1 -1
- package/dist/cjs/components/PresenceCapsule/PresenceCapsule.js +11 -8
- package/dist/cjs/components/PresenceCapsule/PresenceCapsule.js.map +1 -1
- package/dist/cjs/components/PresenceCapsule/Styles.js +7 -8
- package/dist/cjs/components/PresenceCapsule/Styles.js.map +1 -1
- package/dist/cjs/components/PropertyList/Styles.js +1 -1
- package/dist/cjs/components/PropertyList/Styles.js.map +1 -1
- package/dist/cjs/components/Sheet/Sheet.js +5 -2
- package/dist/cjs/components/Sheet/Sheet.js.map +1 -1
- package/dist/cjs/components/Sheet/Styles.js +19 -14
- package/dist/cjs/components/Sheet/Styles.js.map +1 -1
- package/dist/cjs/components/SwatchPalette/swatchPalette.js +1 -1
- package/dist/cjs/components/SwatchPalette/swatchPalette.js.map +1 -1
- package/dist/cjs/components/SwatchPalette/swatchPalette.test.js +1 -1
- package/dist/cjs/components/SwatchPalette/swatchPalette.test.js.map +1 -1
- package/dist/cjs/components/ToastMessage/Styles.js +6 -6
- package/dist/cjs/components/ToastMessage/Styles.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +5 -0
- package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/ViewSwitcher/Styles.js +71 -16
- package/dist/cjs/components/ViewSwitcher/Styles.js.map +1 -1
- package/dist/cjs/components/ViewSwitcher/ViewSwitcher.js +112 -92
- package/dist/cjs/components/ViewSwitcher/ViewSwitcher.js.map +1 -1
- package/dist/cjs/components/ViewSwitcher/ViewSwitcherMenu.js +12 -4
- package/dist/cjs/components/ViewSwitcher/ViewSwitcherMenu.js.map +1 -1
- package/dist/cjs/presentation/shared/ActivityFeed.js +1 -1
- package/dist/cjs/presentation/shared/ActivityFeed.js.map +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.js.map +1 -1
- package/dist/esm/components/Autocomplete/Styles.js +1 -1
- package/dist/esm/components/Autocomplete/Styles.js.map +1 -1
- package/dist/esm/components/Dialog/Styles.js +1 -1
- package/dist/esm/components/Dialog/Styles.js.map +1 -1
- package/dist/esm/components/GlobalStyle.d.ts.map +1 -1
- package/dist/esm/components/GlobalStyle.js +1 -1
- package/dist/esm/components/GlobalStyle.js.map +1 -1
- package/dist/esm/components/Icons/collection/ArrowUpCircle.d.ts +32 -0
- package/dist/esm/components/Icons/collection/ArrowUpCircle.d.ts.map +1 -0
- package/dist/esm/components/Icons/collection/ArrowUpCircle.js +54 -0
- package/dist/esm/components/Icons/collection/ArrowUpCircle.js.map +1 -0
- package/dist/esm/components/Icons/collection/Storage.d.ts +32 -0
- package/dist/esm/components/Icons/collection/Storage.d.ts.map +1 -0
- package/dist/esm/components/Icons/collection/Storage.js +54 -0
- package/dist/esm/components/Icons/collection/Storage.js.map +1 -0
- package/dist/esm/components/Icons/collection/index.d.ts +2 -0
- package/dist/esm/components/Icons/collection/index.d.ts.map +1 -1
- package/dist/esm/components/Icons/collection/index.js +2 -0
- package/dist/esm/components/Icons/collection/index.js.map +1 -1
- package/dist/esm/components/IdentityMark/Styles.d.ts +1 -1
- package/dist/esm/components/IdentityMark/Styles.d.ts.map +1 -1
- package/dist/esm/components/IdentityMark/Styles.js +7 -0
- package/dist/esm/components/IdentityMark/Styles.js.map +1 -1
- package/dist/esm/components/MainMenu/MainMenu.d.ts.map +1 -1
- package/dist/esm/components/MainMenu/MainMenu.js +25 -12
- package/dist/esm/components/MainMenu/MainMenu.js.map +1 -1
- package/dist/esm/components/MainMenu/Styles.d.ts.map +1 -1
- package/dist/esm/components/MainMenu/Styles.js +1 -1
- package/dist/esm/components/MainMenu/Styles.js.map +1 -1
- package/dist/esm/components/MainMenu/hooks.d.ts +1 -0
- package/dist/esm/components/MainMenu/hooks.d.ts.map +1 -1
- package/dist/esm/components/MainMenu/hooks.js +28 -1
- package/dist/esm/components/MainMenu/hooks.js.map +1 -1
- package/dist/esm/components/MainMenu/types.d.ts +1 -0
- package/dist/esm/components/MainMenu/types.d.ts.map +1 -1
- package/dist/esm/components/MainMenu/types.js +2 -1
- package/dist/esm/components/MainMenu/types.js.map +1 -1
- package/dist/esm/components/ObjectFormModal/Styles.js +2 -2
- package/dist/esm/components/ObjectFormModal/Styles.js.map +1 -1
- package/dist/esm/components/PillButton/PillButton.d.ts +3 -1
- package/dist/esm/components/PillButton/PillButton.d.ts.map +1 -1
- package/dist/esm/components/PillButton/PillButton.js +5 -2
- package/dist/esm/components/PillButton/PillButton.js.map +1 -1
- package/dist/esm/components/PillButton/Styles.d.ts.map +1 -1
- package/dist/esm/components/PillButton/Styles.js +3 -1
- package/dist/esm/components/PillButton/Styles.js.map +1 -1
- package/dist/esm/components/PillGroup/PillGroup.d.ts +2 -2
- package/dist/esm/components/PillGroup/PillGroup.d.ts.map +1 -1
- package/dist/esm/components/PillGroup/PillGroup.js.map +1 -1
- package/dist/esm/components/PillGroup/Styles.d.ts.map +1 -1
- package/dist/esm/components/PillGroup/Styles.js +2 -1
- package/dist/esm/components/PillGroup/Styles.js.map +1 -1
- package/dist/esm/components/PresenceCapsule/PresenceCapsule.d.ts +2 -2
- package/dist/esm/components/PresenceCapsule/PresenceCapsule.d.ts.map +1 -1
- package/dist/esm/components/PresenceCapsule/PresenceCapsule.js +11 -8
- package/dist/esm/components/PresenceCapsule/PresenceCapsule.js.map +1 -1
- package/dist/esm/components/PresenceCapsule/Styles.d.ts +1 -3
- package/dist/esm/components/PresenceCapsule/Styles.d.ts.map +1 -1
- package/dist/esm/components/PresenceCapsule/Styles.js +6 -5
- package/dist/esm/components/PresenceCapsule/Styles.js.map +1 -1
- package/dist/esm/components/PropertyList/Styles.js +1 -1
- package/dist/esm/components/PropertyList/Styles.js.map +1 -1
- package/dist/esm/components/Sheet/Sheet.d.ts +2 -0
- package/dist/esm/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/esm/components/Sheet/Sheet.js +6 -3
- package/dist/esm/components/Sheet/Sheet.js.map +1 -1
- package/dist/esm/components/Sheet/Styles.d.ts +1 -0
- package/dist/esm/components/Sheet/Styles.d.ts.map +1 -1
- package/dist/esm/components/Sheet/Styles.js +17 -12
- package/dist/esm/components/Sheet/Styles.js.map +1 -1
- package/dist/esm/components/SwatchPalette/swatchPalette.d.ts +1 -1
- package/dist/esm/components/SwatchPalette/swatchPalette.d.ts.map +1 -1
- package/dist/esm/components/SwatchPalette/swatchPalette.js +1 -1
- package/dist/esm/components/SwatchPalette/swatchPalette.js.map +1 -1
- package/dist/esm/components/SwatchPalette/swatchPalette.test.js +1 -1
- package/dist/esm/components/SwatchPalette/swatchPalette.test.js.map +1 -1
- package/dist/esm/components/ToastMessage/Styles.d.ts.map +1 -1
- package/dist/esm/components/ToastMessage/Styles.js +3 -3
- package/dist/esm/components/ToastMessage/Styles.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +5 -0
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/ViewSwitcher/Styles.d.ts +12 -3
- package/dist/esm/components/ViewSwitcher/Styles.d.ts.map +1 -1
- package/dist/esm/components/ViewSwitcher/Styles.js +70 -15
- package/dist/esm/components/ViewSwitcher/Styles.js.map +1 -1
- package/dist/esm/components/ViewSwitcher/ViewSwitcher.d.ts +7 -2
- package/dist/esm/components/ViewSwitcher/ViewSwitcher.d.ts.map +1 -1
- package/dist/esm/components/ViewSwitcher/ViewSwitcher.js +106 -89
- package/dist/esm/components/ViewSwitcher/ViewSwitcher.js.map +1 -1
- package/dist/esm/components/ViewSwitcher/ViewSwitcherMenu.d.ts +4 -0
- package/dist/esm/components/ViewSwitcher/ViewSwitcherMenu.d.ts.map +1 -1
- package/dist/esm/components/ViewSwitcher/ViewSwitcherMenu.js +13 -5
- package/dist/esm/components/ViewSwitcher/ViewSwitcherMenu.js.map +1 -1
- package/dist/esm/presentation/shared/ActivityFeed.js +1 -1
- package/dist/esm/presentation/shared/ActivityFeed.js.map +1 -1
- package/dist/index.js +954 -693
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","createGlobalStyle","BoxSizingStyle","List","SM","XL","NARROW_SCREEN","COLLAPSED_WIDTH","EXPANDED_WIDTH","TRANSITION","TOGGLE_TRANSITION","MainMenuGlobalStyle","StyledMainMenu","div","withConfig","displayName","componentId","StyledHelpList","StyledFavoritesMenuList"],"sources":["../../../../src/components/MainMenu/Styles.ts"],"sourcesContent":["import styled, { createGlobalStyle } from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { List } from \"../List\";\n\nexport const SM = \"640px\";\nexport const XL = \"1280px\";\nexport const NARROW_SCREEN = `(max-width: ${XL})`;\nexport const COLLAPSED_WIDTH = 72;\nexport const EXPANDED_WIDTH = 240;\n\nconst TRANSITION = \"200ms ease\";\nconst TOGGLE_TRANSITION = \"transform 200ms cubic-bezier(0.4, 0, 0.2, 1)\";\n\n// The popper of a menu sits in a portal, out of reach of the menu styles.\nexport const MainMenuGlobalStyle = createGlobalStyle`\n .c-main-menu-favorites-popper {\n padding: 4px;\n }\n`;\n\nexport const StyledMainMenu = styled.div`\n ${BoxSizingStyle}\n\n /* MainMenu.js \"tw:relative tw:left-2.5 tw:hidden tw:sm:flex tw:flex-col tw:h-full tw:mr-1 tw:shrink-0\" */\n &.c-main-menu--desktop {\n position: relative;\n left: 10px;\n display: none;\n flex-direction: column;\n flex-shrink: 0;\n height: 100%;\n margin-right: 4px;\n\n @media (min-width: ${SM}) {\n display: flex;\n }\n }\n\n /* MainMenuMobile.js \"tw:flex-col tw:h-full tw:w-60\": a block, as wide as the drawer */\n &.c-main-menu--drawer {\n height: 100%;\n }\n\n &.expanded {\n width: ${EXPANDED_WIDTH}px;\n }\n\n &.collapsed {\n width: ${COLLAPSED_WIDTH}px;\n }\n\n &.expanded,\n &.collapsed {\n transition: width ${TRANSITION};\n\n @media (max-width: ${XL}) {\n width: ${COLLAPSED_WIDTH}px;\n }\n }\n\n &.c-main-menu--drawer.c-main-menu--drawer {\n width: ${EXPANDED_WIDTH}px;\n }\n\n .main-menu-panel {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n }\n\n &.main-menu-peek {\n width: ${COLLAPSED_WIDTH}px;\n }\n\n /* The menu sits 10px from the edge, so the backdrop reaches back to cover that strip too. */\n &.main-menu-peek .main-menu-panel {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n z-index: 0;\n width: ${EXPANDED_WIDTH}px;\n clip-path: inset(\n -100px ${EXPANDED_WIDTH - COLLAPSED_WIDTH}px -100px -100px\n );\n transition: clip-path 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);\n\n &::before {\n content: \"\";\n position: absolute;\n inset: 0 0 0 -10px;\n z-index: -1;\n background-color: var(--body-bg-main);\n box-shadow: var(--shadow-popover);\n }\n\n .collapse-expand-menu-icon {\n transform: rotate(180deg);\n }\n }\n\n &.main-menu-peek-open .main-menu-panel {\n clip-path: inset(-100px);\n }\n\n /* A clipped part of the panel takes no pointer, so this strip holds the hover while the clip opens. */\n &.main-menu-peek::after {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: -10px;\n z-index: -1;\n width: ${EXPANDED_WIDTH + 10}px;\n }\n\n @media (prefers-reduced-motion: reduce) {\n &.main-menu-peek .main-menu-panel {\n transition-duration: 1ms;\n }\n }\n\n /* \"main-menu-header tw:-left-2.5 tw:flex tw:items-center tw:overflow-hidden\" */\n .main-menu-header {\n position: relative;\n display: flex;\n align-items: center;\n height: 68px;\n overflow: hidden;\n }\n\n &.c-main-menu--desktop .main-menu-header {\n left: -10px;\n }\n\n .main-logo-url {\n position: absolute;\n left: 30px;\n color: var(--color-secondary);\n transition: all ${TRANSITION};\n\n path {\n fill: var(--color-secondary);\n }\n }\n\n .main-logo-long {\n transition: all ${TRANSITION};\n\n path {\n fill: var(--color-secondary);\n }\n\n #logotype {\n opacity: 1;\n transition: all ${TRANSITION};\n will-change: opacity, transform;\n\n @media (max-width: ${XL}) {\n opacity: 0;\n transform: translateX(-5%);\n }\n }\n }\n\n .main-logo-long__collapsed #logotype {\n opacity: 0;\n transform: translateX(-5%);\n }\n\n /* \"tw:hidden tw:xl:inline-flex collapse-expand-menu tw:h-full tw:justify-center tw:items-center\" */\n .collapse-expand-menu {\n display: none;\n align-items: center;\n justify-content: center;\n width: 0;\n height: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 0;\n background-color: var(--color-secondary);\n cursor: pointer;\n transition: all ${TRANSITION};\n\n @media (min-width: ${XL}) {\n display: inline-flex;\n }\n\n .collapse-expand-menu-icon {\n display: none;\n fill: var(--page-paper-main);\n }\n }\n\n /* Opacity, not visibility: a hidden button cannot take the focus, so Tab would skip it. */\n .main-menu-edit-button.main-menu-edit-button {\n opacity: 0;\n transition: opacity ${TRANSITION};\n }\n\n /* MainMenu.js \"tw:absolute tw:right-1.5 tw:-translate-y-0.5\" and the theme-500 icon */\n .main-menu-header .main-menu-edit-button.main-menu-edit-button {\n position: absolute;\n right: 6px;\n transform: translateY(-2px);\n\n svg {\n fill: var(--color-theme-500);\n }\n\n &:hover svg,\n &:focus-visible svg {\n fill: var(--color-theme-900);\n }\n }\n\n &:hover .main-menu-edit-button.main-menu-edit-button,\n &:has(:focus-visible) .main-menu-edit-button.main-menu-edit-button,\n &.touch .main-menu-edit-button.main-menu-edit-button {\n opacity: 1;\n }\n\n @media (hover: none) {\n .main-menu-edit-button.main-menu-edit-button {\n opacity: 1;\n }\n }\n\n /* Where its section is collapsed the button cannot open the editor, so it stays out of the tab order. */\n &.collapsed .main-menu-edit-button.main-menu-edit-button {\n visibility: hidden;\n }\n\n @media (max-width: ${XL}) {\n &:not(.c-main-menu--drawer) .main-menu-edit-button.main-menu-edit-button {\n visibility: hidden;\n }\n }\n\n &:hover .collapse-expand-menu {\n width: 4px;\n }\n\n .main-menu-header:hover {\n .main-logo-url {\n left: 38px;\n\n @media (max-width: ${XL}) {\n left: 30px;\n }\n }\n\n .collapse-expand-menu {\n width: 16px;\n\n .collapse-expand-menu-icon {\n display: block;\n }\n }\n }\n\n .collapse-expand-menu.collapse-expand-menu:hover {\n width: 24px;\n\n & + .main-logo-url {\n left: 46px;\n\n @media (max-width: ${XL}) {\n left: 30px;\n }\n }\n }\n\n /* \"tw:flex tw:flex-col tw:grow tw:flex-1 tw:h-full tw:overflow-y-auto\" */\n .main-menu-socket {\n display: flex;\n flex: 1 1 0%;\n flex-direction: column;\n height: 100%;\n overflow-y: auto;\n }\n\n /* MainMenuMobile.js \"tw:h-[calc(100dvh-72px)]\" */\n &.c-main-menu--drawer .main-menu-socket {\n height: calc(100dvh - 72px);\n }\n\n /* MainMenuItems.js \"tw:flex tw:min-h-0 tw:grow\" around the scrollbars, and \"tw:my-3 tw:overflow-x-hidden\" */\n .main-menu-items {\n display: flex;\n flex-grow: 1;\n min-height: 0;\n }\n\n .main-menu-items-inner {\n margin: 12px 0;\n overflow-x: hidden;\n }\n\n .main-menu-item-icon {\n flex-shrink: 0;\n fill: var(--color-theme-700);\n opacity: 0.7;\n }\n\n /* MainMenuItemWrapper.js \"main-menu-item tw:flex tw:items-center tw:no-underline tw:h-10 tw:pl-3 tw:pr-1 tw:mx-3\" */\n .main-menu-item {\n display: flex;\n align-items: center;\n height: 40px;\n margin: 0 12px 2px;\n padding: 0 4px 0 12px;\n border-radius: var(--ac-br-8);\n text-decoration: none;\n\n &:hover {\n background-color: var(--color-theme-300);\n transition: all ${TRANSITION};\n\n .main-menu-item-icon {\n fill: var(--color-theme-900);\n opacity: 1;\n }\n\n .main-menu-item-text {\n color: var(--color-theme-900);\n }\n }\n\n &.main-menu-item-current {\n background-color: var(--color-secondary-200);\n\n .main-menu-item-icon {\n fill: var(--color-secondary);\n opacity: 1;\n }\n\n .main-menu-item-text {\n color: var(--color-secondary);\n }\n }\n }\n\n .main-menu-item--between {\n justify-content: space-between;\n }\n\n .main-menu-item-start {\n display: flex;\n align-items: center;\n }\n\n /* MainMenuItemInner.js \"tw:ml-3 tw:truncate tw:min-w-0\" */\n .main-menu-item-label {\n min-width: 0;\n margin-left: 12px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .main-menu-projects {\n position: relative;\n }\n\n /* FavoriteProjectOption.js */\n .main-menu-subnav.main-menu-subnav {\n padding: 2px 0;\n\n .main-menu-subnav-item {\n margin: 0;\n padding-right: 0;\n padding-left: 0;\n\n &:hover {\n background-color: unset;\n }\n }\n\n .main-menu-subnav-item-icon {\n flex-shrink: 0;\n margin-right: 8px;\n opacity: 0.5;\n fill: var(--color-theme-700);\n }\n\n .main-menu-subnav-item-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .main-menu-item {\n width: 100%;\n min-width: 0;\n height: 32px;\n margin-right: 12px;\n margin-left: 22px;\n padding: 8px;\n }\n\n .main-menu-item:hover {\n .main-menu-subnav-item-icon {\n fill: var(--color-theme-900);\n }\n\n .main-menu-subnav-item-text {\n color: var(--color-theme-900);\n }\n }\n\n .main-menu-subnav-item-active,\n .main-menu-subnav-item-active:hover {\n background-color: var(--color-secondary-200);\n\n .main-menu-subnav-item-icon {\n fill: var(--color-secondary);\n }\n\n .main-menu-subnav-item-text {\n color: var(--color-secondary);\n }\n }\n }\n\n .menu-section-text {\n opacity: 0.7;\n }\n\n .main-menu-item-text,\n .menu-section,\n .collapse-expand-menu-icon {\n transition: all ${TRANSITION};\n }\n\n /* \"tw:mb-2 tw:mx-3 tw:pl-3 tw:pr-1 tw:flex tw:justify-between tw:items-center menu-section\" */\n .menu-section {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 0 12px 8px;\n padding: 0 4px 0 12px;\n /* The height clips the heading as it opens and closes, so its text is never squeezed. The 4px keep a focus ring. */\n clip-path: inset(-4px);\n }\n\n &.expanded {\n .main-menu-item-text {\n opacity: 1;\n visibility: visible;\n }\n\n .menu-section {\n max-height: 32px;\n opacity: 1;\n }\n }\n\n &.collapsed {\n .collapse-expand-menu-icon {\n transform: rotate(180deg);\n }\n\n .main-menu-item-text {\n opacity: 0;\n visibility: hidden;\n }\n\n .menu-section {\n max-height: 0;\n opacity: 0;\n }\n }\n\n @media (max-width: ${XL}) {\n &.collapsed .menu-section,\n &.expanded .menu-section {\n max-height: 0;\n opacity: 0;\n }\n\n &.collapsed .main-menu-item-text,\n &.expanded .main-menu-item-text {\n width: 0;\n opacity: 0;\n visibility: hidden;\n }\n\n /* The narrow screen collapses the sidebar, never the drawer. */\n &.c-main-menu--drawer.expanded {\n .menu-section {\n max-height: 32px;\n opacity: 1;\n }\n\n .main-menu-item-text {\n width: auto;\n opacity: 1;\n visibility: visible;\n }\n }\n }\n\n /* FavoriteProjectsMenu.js target */\n .favorite-projects-menu-target {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n display: none;\n align-items: center;\n justify-content: center;\n width: 10px;\n height: 40px;\n border-radius: 4px;\n cursor: pointer;\n\n &.collapsed {\n display: flex;\n }\n\n @media (max-width: ${XL}) {\n display: flex;\n }\n\n svg {\n transform: rotate(180deg);\n }\n }\n\n &.main-menu-can-peek:not(.main-menu-peek-open)\n .favorite-projects-menu-target {\n display: none;\n }\n\n /* Where the drawer toggle sits in the expanded menu. */\n &.main-menu-peek-open .favorite-projects-menu-target.collapsed {\n top: 8px;\n right: 16px;\n width: 24px;\n height: 24px;\n }\n\n .favorite-projects-menu-target:hover {\n background-color: var(--color-theme-300);\n\n svg {\n fill: var(--color-theme-900);\n }\n }\n\n .main-menu-item-current + .favorite-projects-menu-target:hover,\n .favorite-projects-menu-target.open {\n background-color: var(--color-secondary-200);\n\n svg {\n fill: var(--color-secondary);\n }\n }\n\n /* ExpandToggle.jsx \"tw:transition-transform tw:duration-200\", up when expanded */\n .main-menu-toggle {\n flex-shrink: 0;\n transition: ${TOGGLE_TRANSITION};\n\n &.is-closed {\n transform: rotate(180deg);\n }\n }\n\n .favorite-projects-list,\n .favorite-projects-list-target {\n display: flex;\n\n &.collapsed {\n display: none;\n }\n\n @media (max-width: ${XL}) {\n display: none;\n }\n }\n\n .favorite-projects-list-target {\n margin-left: auto;\n }\n\n &.c-main-menu--drawer {\n .favorite-projects-list.favorite-projects-list,\n .favorite-projects-list-target.is-mobile {\n display: flex;\n }\n }\n\n .favorite-projects-list {\n opacity: 1;\n overflow: hidden;\n transition: all ${TRANSITION};\n }\n\n .favorite-projects-list-collapsed {\n opacity: 0;\n transition: all ${TRANSITION};\n }\n\n /* HiddenOptionList.js */\n .show-hidden-options-long {\n display: block;\n margin: 12px 24px;\n cursor: pointer;\n\n &.collapsed {\n display: none;\n }\n\n @media (max-width: ${XL}) {\n display: none;\n }\n }\n\n .show-hidden-options-short {\n display: none;\n margin: 12px 0;\n cursor: pointer;\n\n &.collapsed {\n display: block;\n }\n\n @media (max-width: ${XL}) {\n display: block;\n }\n }\n\n &.c-main-menu--drawer {\n .show-hidden-options-long.show-hidden-options-long {\n display: block;\n }\n\n .show-hidden-options-short.show-hidden-options-short {\n display: none;\n }\n }\n\n /* Shortcuts/List.js */\n .main-menu-shortcuts {\n position: relative;\n }\n\n .shortcuts-expander {\n margin-left: auto;\n cursor: pointer;\n }\n\n .shortcuts-expander-collapsed {\n position: absolute;\n top: -11px;\n right: 0;\n left: 0;\n display: none;\n margin: 0 auto;\n border-radius: 100%;\n background-color: var(--body-bg-main);\n cursor: pointer;\n\n &.collapsed {\n display: block;\n }\n\n @media (max-width: ${XL}) {\n display: block;\n }\n }\n\n .shortcuts-list-separator.c-list-separator {\n margin: 16px 12px 12px;\n transition: margin ${TRANSITION};\n\n &.collapsed {\n margin: 20px 12px;\n }\n\n @media (max-width: ${XL}) {\n margin: 20px 12px;\n }\n }\n\n .add-shortcut {\n cursor: pointer;\n\n .main-menu-item-text.main-menu-item-text {\n color: var(--color-secondary);\n }\n\n .main-menu-item-icon.main-menu-item-icon {\n fill: var(--color-secondary);\n opacity: 1;\n }\n\n &:hover {\n background-color: var(--color-primary-200);\n }\n\n &:focus {\n background-color: var(--color-primary-300);\n outline: none;\n }\n }\n\n /* HelpAndSupportMenu.js target \"tw:relative main-menu-item tw:shrink-0 tw:my-4 tw:hover:cursor-pointer\" */\n .main-menu-item.main-menu-help {\n position: relative;\n flex-shrink: 0;\n margin-top: 16px;\n margin-bottom: 16px;\n\n &:hover {\n cursor: pointer;\n }\n }\n\n .main-menu-help .main-menu-toggle.is-hidden {\n display: none;\n }\n\n /* HelpAndSupportMenu.js \"tw:bg-primary\": a promotion in place of Help & Support */\n .main-menu-item.main-menu-help--promo,\n .main-menu-item.main-menu-help--promo:hover,\n .main-menu-item.main-menu-help--promo.main-menu-item-current {\n background-color: var(--color-primary);\n }\n\n .main-menu-help-promo {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n .main-menu-help-promo-icon {\n flex-shrink: 0;\n fill: var(--page-paper-main);\n }\n\n /* \"tw:flex tw:visible tw:sm:invisible tw:xl:visible\" */\n .main-menu-help-promo-text {\n display: flex;\n visibility: visible;\n\n @media (min-width: ${SM}) {\n visibility: hidden;\n }\n\n @media (min-width: ${XL}) {\n visibility: visible;\n }\n }\n\n /* \"new-features-badge tw:absolute tw:right-1 tw:top-4 tw:sm:top-0 tw:sm:left-0 tw:sm:right-auto tw:ml-auto tw:mr-2\" */\n .main-menu-help-badge.main-menu-help-badge {\n position: absolute;\n top: 16px;\n right: 4px;\n margin-right: 8px;\n margin-left: auto;\n\n @media (min-width: ${SM}) {\n top: 0;\n right: auto;\n left: 0;\n }\n\n &.is-promo {\n right: 6px;\n\n @media (min-width: ${SM}) {\n right: auto;\n }\n }\n\n &.is-static {\n @media (min-width: ${XL}) {\n position: static;\n }\n }\n }\n\n /* MainMenuItemsEditor.js \"tw:flex tw:flex-col tw:min-h-0 tw:grow tw:outline-none\" */\n .main-menu-editor {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n min-height: 0;\n outline: none;\n }\n\n /* Editor/Header.js \"tw:mt-3\" */\n .main-menu-editor-header {\n margin-top: 12px;\n }\n\n .main-menu-editor-action {\n margin-right: 4px;\n }\n\n .main-menu-editor-list {\n display: flex;\n flex-grow: 1;\n min-height: 0;\n }\n\n .main-menu-editor-list-inner {\n overflow-x: hidden;\n }\n\n /* DraggableListItem.js \"tw:pr-3 tw:pl-2 tw:mt-0\" with marginBottom 2px */\n .main-menu-editor-row.c-list-item {\n margin: 0 0 2px;\n padding-right: 12px;\n padding-left: 8px;\n }\n\n .main-menu-editor-row-box {\n width: 100%;\n border-radius: var(--ac-br-8);\n }\n\n .main-menu-editor-row-inner {\n display: flex;\n align-items: center;\n width: 100%;\n }\n\n .main-menu-editor-handle {\n margin-right: 4px;\n cursor: move;\n }\n\n /* Editor/MainMenuItem.js \"main-menu-edit-item tw:h-10 tw:w-full tw:pr-1\" with maxWidth 204px */\n .main-menu-edit-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n max-width: 204px;\n height: 40px;\n padding-right: 4px;\n text-decoration: none;\n }\n\n .main-menu-edit-item-start {\n display: flex;\n align-items: center;\n min-width: 0;\n }\n\n .main-menu-edit-item.hidden {\n .main-menu-item-icon,\n .main-menu-item-text {\n opacity: 0.4;\n }\n }\n\n /* \"tw:flex tw:items-center tw:h-6 tw:mb-2 tw:mx-3 tw:px-3 menu-section-text\" */\n .main-menu-editor-shortcuts-title {\n display: flex;\n align-items: center;\n height: 24px;\n margin: 0 12px 8px;\n padding: 0 12px;\n }\n\n /* MainMenuMobile.js \"tw:absolute tw:right-4 tw:top-4 tw:sm:hidden\" */\n .main-menu-drawer-close {\n position: absolute;\n top: 16px;\n right: 16px;\n\n @media (min-width: ${SM}) {\n display: none;\n }\n }\n`;\n\nStyledMainMenu.displayName = \"StyledMainMenu\";\n\n/* HelpAndSupportMenu.js: \"tw:mt-3\" on the first item, \"tw:mb-3\" on the last, \"tw:shrink-0 tw:mr-3\" on the icons */\nexport const StyledHelpList = styled(List)`\n outline: 2px solid transparent;\n outline-offset: 2px;\n\n .c-list-item > svg:first-child {\n flex-shrink: 0;\n margin-right: 12px;\n }\n\n .c-list-item:first-child {\n margin-top: 12px;\n }\n\n .c-list-item:last-child {\n margin-bottom: 12px;\n }\n\n .main-menu-help-entry-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .main-menu-help-entry-badge {\n margin-left: auto;\n }\n\n /* an entry with a link: \"tw:no-underline\" */\n a.c-list-item {\n text-decoration: none;\n }\n\n .main-menu-help-entry.is-primary {\n color: var(--color-primary);\n\n > svg:first-child {\n fill: var(--color-primary);\n }\n }\n\n /* \"tw:justify-between tw:gap-3\" */\n .main-menu-help-entry-text.has-end {\n margin-right: 12px;\n }\n\n .main-menu-help-entry-end {\n flex-shrink: 0;\n margin-left: auto;\n }\n`;\n\nStyledHelpList.displayName = \"StyledHelpList\";\n\n/* FavoriteProjectsMenu.js \"tw:py-2\", FavoriteProjectMenuOption.js */\nexport const StyledFavoritesMenuList = styled(List)`\n padding: 8px 0;\n\n .c-list-item {\n padding-right: 0;\n padding-left: 0;\n }\n\n .favorite-project-menu-option {\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n width: 100%;\n padding: 0 16px;\n color: var(--color-theme-900);\n text-decoration: none;\n\n svg {\n flex-shrink: 0;\n margin-right: 8px;\n opacity: 0.5;\n }\n\n &.favorite-project-menu-option-active {\n background-color: var(--color-secondary-200);\n\n svg {\n fill: var(--color-secondary);\n }\n\n .favorite-project-menu-option-text {\n color: var(--color-secondary);\n }\n }\n }\n\n .favorite-project-menu-option-text {\n flex: 1;\n padding-right: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n`;\n\nStyledFavoritesMenuList.displayName = \"StyledFavoritesMenuList\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,iBAAiB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WAAA;EAAAC,WAAA;AAAA,ilBAiDzC;AAEDC,cAAc,CAACF,WAAW,GAAG,gBAAgB;;AAE7C;AACA,OAAO,MAAMG,uBAAuB,GAAGlB,MAAM,CAACG,IAAI,CAAC,CAAAW,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,8lBA4ClD;AAEDE,uBAAuB,CAACH,WAAW,GAAG,yBAAyB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","createGlobalStyle","BoxSizingStyle","List","SM","XL","NARROW_SCREEN","COLLAPSED_WIDTH","EXPANDED_WIDTH","TRANSITION","TOGGLE_TRANSITION","MainMenuGlobalStyle","StyledMainMenu","div","withConfig","displayName","componentId","StyledHelpList","StyledFavoritesMenuList"],"sources":["../../../../src/components/MainMenu/Styles.ts"],"sourcesContent":["import styled, { createGlobalStyle } from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { List } from \"../List\";\n\nexport const SM = \"640px\";\nexport const XL = \"1280px\";\nexport const NARROW_SCREEN = `(max-width: ${XL})`;\nexport const COLLAPSED_WIDTH = 72;\nexport const EXPANDED_WIDTH = 240;\n\nconst TRANSITION = \"200ms ease\";\nconst TOGGLE_TRANSITION = \"transform 200ms cubic-bezier(0.4, 0, 0.2, 1)\";\n\n// The popper of a menu sits in a portal, out of reach of the menu styles.\nexport const MainMenuGlobalStyle = createGlobalStyle`\n .c-main-menu-favorites-popper {\n padding: 4px;\n }\n`;\n\nexport const StyledMainMenu = styled.div`\n ${BoxSizingStyle}\n\n /* MainMenu.js \"tw:relative tw:left-2.5 tw:hidden tw:sm:flex tw:flex-col tw:h-full tw:mr-1 tw:shrink-0\" */\n &.c-main-menu--desktop {\n position: relative;\n left: 10px;\n display: none;\n flex-direction: column;\n flex-shrink: 0;\n height: 100%;\n margin-right: 4px;\n\n @media (min-width: ${SM}) {\n display: flex;\n }\n }\n\n /* MainMenuMobile.js \"tw:flex-col tw:h-full tw:w-60\": a block, as wide as the drawer */\n &.c-main-menu--drawer {\n height: 100%;\n }\n\n &.expanded {\n width: ${EXPANDED_WIDTH}px;\n }\n\n &.collapsed {\n width: ${COLLAPSED_WIDTH}px;\n }\n\n &.expanded,\n &.collapsed {\n transition: width ${TRANSITION};\n\n @media (max-width: ${XL}) {\n width: ${COLLAPSED_WIDTH}px;\n }\n }\n\n &.c-main-menu--drawer.c-main-menu--drawer {\n width: ${EXPANDED_WIDTH}px;\n }\n\n .main-menu-panel {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n }\n\n &.main-menu-peek {\n width: ${COLLAPSED_WIDTH}px;\n }\n\n /* The menu sits 10px from the edge, so the backdrop reaches back to cover that strip too. */\n &.main-menu-peek .main-menu-panel {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n z-index: 0;\n width: ${EXPANDED_WIDTH}px;\n clip-path: inset(\n -100px ${EXPANDED_WIDTH - COLLAPSED_WIDTH}px -100px -100px\n );\n transition: clip-path 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);\n\n &::before {\n content: \"\";\n position: absolute;\n inset: 0 0 0 -10px;\n z-index: -1;\n background-color: var(--body-bg-main);\n box-shadow: var(--shadow-popover);\n }\n }\n\n &.main-menu-peek-open .main-menu-panel {\n clip-path: inset(-100px);\n }\n\n /* A clipped part of the panel takes no pointer, so this strip holds the hover while the clip opens. */\n &.main-menu-peek::after {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: -10px;\n z-index: -1;\n width: ${EXPANDED_WIDTH + 10}px;\n }\n\n @media (prefers-reduced-motion: reduce) {\n &.main-menu-peek .main-menu-panel {\n transition-duration: 1ms;\n }\n }\n\n /* \"main-menu-header tw:-left-2.5 tw:flex tw:items-center tw:overflow-hidden\" */\n .main-menu-header {\n position: relative;\n display: flex;\n align-items: center;\n height: 68px;\n overflow: hidden;\n }\n\n &.c-main-menu--desktop .main-menu-header {\n left: -10px;\n }\n\n .main-logo-url {\n position: absolute;\n left: 30px;\n color: var(--color-secondary);\n transition: all ${TRANSITION};\n\n path {\n fill: var(--color-secondary);\n }\n }\n\n .main-logo-long {\n transition: all ${TRANSITION};\n\n path {\n fill: var(--color-secondary);\n }\n\n #logotype {\n opacity: 1;\n transition: all ${TRANSITION};\n will-change: opacity, transform;\n\n @media (max-width: ${XL}) {\n opacity: 0;\n transform: translateX(-5%);\n }\n }\n }\n\n .main-logo-long__collapsed #logotype {\n opacity: 0;\n transform: translateX(-5%);\n }\n\n /* The tab sits in the free strip left of the logo. It floats, so the menu keeps its layout. */\n .main-menu-collapse-tab {\n position: absolute;\n top: 8px;\n left: -10px;\n z-index: 4;\n display: none;\n width: 30px;\n height: 48px;\n margin: 0;\n padding: 0;\n border: 0;\n background: none;\n font: inherit;\n cursor: pointer;\n\n @media (min-width: ${XL}) {\n display: block;\n }\n }\n\n .main-menu-collapse-tab-face {\n position: absolute;\n top: 50%;\n left: 0;\n display: flex;\n align-items: center;\n gap: 6px;\n height: 27px;\n max-width: 4px;\n margin-top: -0.5px;\n padding: 0;\n overflow: hidden;\n border-radius: 0 4px 4px 0;\n background: var(--color-theme-500);\n white-space: nowrap;\n opacity: 0;\n transform: translateY(-50%);\n transition: all 180ms ease;\n }\n\n .main-menu-collapse-tab-icon,\n .main-menu-collapse-tab-label {\n opacity: 0;\n transition: opacity 150ms ease, ${TOGGLE_TRANSITION};\n }\n\n .main-menu-collapse-tab-icon {\n flex-shrink: 0;\n fill: var(--color-theme-700);\n }\n\n .main-menu-collapse-tab.is-collapsed .main-menu-collapse-tab-icon {\n transform: rotate(180deg);\n }\n\n .main-menu-collapse-tab-label {\n color: var(--color-theme-900);\n font-size: 12px;\n font-weight: 600;\n line-height: 16px;\n }\n\n &:hover .main-menu-collapse-tab-face,\n &:has(:focus-visible) .main-menu-collapse-tab-face,\n &.touch .main-menu-collapse-tab-face {\n opacity: 1;\n }\n\n @media (hover: none) {\n .main-menu-collapse-tab-face {\n opacity: 1;\n }\n }\n\n .main-menu-collapse-tab:hover .main-menu-collapse-tab-face,\n .main-menu-collapse-tab:focus-visible .main-menu-collapse-tab-face {\n height: 39px;\n max-width: 120px;\n padding: 0 14px 0 10px;\n border: 1px solid var(--popover-border);\n border-left: 0;\n border-radius: 0 10px 10px 0;\n background: linear-gradient(\n 180deg,\n var(--page-paper-main),\n color-mix(in srgb, var(--page-paper-main) 92%, var(--color-theme-500))\n );\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14), 0 4px 14px rgba(0, 0, 0, 0.145),\n inset 0 1px 0 rgba(255, 255, 255, 0.07);\n opacity: 1;\n }\n\n .main-menu-collapse-tab:hover .main-menu-collapse-tab-icon,\n .main-menu-collapse-tab:hover .main-menu-collapse-tab-label,\n .main-menu-collapse-tab:focus-visible .main-menu-collapse-tab-icon,\n .main-menu-collapse-tab:focus-visible .main-menu-collapse-tab-label {\n opacity: 1;\n }\n\n /* Opacity, not visibility: a hidden button cannot take the focus, so Tab would skip it. */\n .main-menu-edit-button.main-menu-edit-button {\n opacity: 0;\n transition: opacity ${TRANSITION};\n }\n\n /* MainMenu.js \"tw:absolute tw:right-1.5 tw:-translate-y-0.5\" and the theme-500 icon */\n .main-menu-header .main-menu-edit-button.main-menu-edit-button {\n position: absolute;\n right: 6px;\n transform: translateY(-2px);\n\n svg {\n fill: var(--color-theme-500);\n }\n\n &:hover svg,\n &:focus-visible svg {\n fill: var(--color-theme-900);\n }\n }\n\n &:hover .main-menu-edit-button.main-menu-edit-button,\n &:has(:focus-visible) .main-menu-edit-button.main-menu-edit-button,\n &.touch .main-menu-edit-button.main-menu-edit-button {\n opacity: 1;\n }\n\n @media (hover: none) {\n .main-menu-edit-button.main-menu-edit-button {\n opacity: 1;\n }\n }\n\n /* Where its section is collapsed the button cannot open the editor, so it stays out of the tab order. */\n &.collapsed .main-menu-edit-button.main-menu-edit-button {\n visibility: hidden;\n }\n\n @media (max-width: ${XL}) {\n &:not(.c-main-menu--drawer) .main-menu-edit-button.main-menu-edit-button {\n visibility: hidden;\n }\n }\n\n /* \"tw:flex tw:flex-col tw:grow tw:flex-1 tw:h-full tw:overflow-y-auto\" */\n .main-menu-socket {\n display: flex;\n flex: 1 1 0%;\n flex-direction: column;\n height: 100%;\n overflow-y: auto;\n }\n\n /* MainMenuMobile.js \"tw:h-[calc(100dvh-72px)]\" */\n &.c-main-menu--drawer .main-menu-socket {\n height: calc(100dvh - 72px);\n }\n\n /* MainMenuItems.js \"tw:flex tw:min-h-0 tw:grow\" around the scrollbars, and \"tw:my-3 tw:overflow-x-hidden\" */\n .main-menu-items {\n display: flex;\n flex-grow: 1;\n min-height: 0;\n }\n\n .main-menu-items-inner {\n margin: 12px 0;\n overflow-x: hidden;\n }\n\n .main-menu-item-icon {\n flex-shrink: 0;\n fill: var(--color-theme-700);\n opacity: 0.7;\n }\n\n /* MainMenuItemWrapper.js \"main-menu-item tw:flex tw:items-center tw:no-underline tw:h-10 tw:pl-3 tw:pr-1 tw:mx-3\" */\n .main-menu-item {\n display: flex;\n align-items: center;\n height: 40px;\n margin: 0 12px 2px;\n padding: 0 4px 0 12px;\n border-radius: var(--ac-br-8);\n text-decoration: none;\n\n &:hover {\n background-color: var(--color-theme-300);\n transition: all ${TRANSITION};\n\n .main-menu-item-icon {\n fill: var(--color-theme-900);\n opacity: 1;\n }\n\n .main-menu-item-text {\n color: var(--color-theme-900);\n }\n }\n\n &.main-menu-item-current {\n background-color: var(--color-secondary-200);\n\n .main-menu-item-icon {\n fill: var(--color-secondary);\n opacity: 1;\n }\n\n .main-menu-item-text {\n color: var(--color-secondary);\n }\n }\n }\n\n .main-menu-item--between {\n justify-content: space-between;\n }\n\n .main-menu-item-start {\n display: flex;\n align-items: center;\n }\n\n /* MainMenuItemInner.js \"tw:ml-3 tw:truncate tw:min-w-0\" */\n .main-menu-item-label {\n min-width: 0;\n margin-left: 12px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .main-menu-projects {\n position: relative;\n }\n\n /* FavoriteProjectOption.js */\n .main-menu-subnav.main-menu-subnav {\n padding: 2px 0;\n\n .main-menu-subnav-item {\n margin: 0;\n padding-right: 0;\n padding-left: 0;\n\n &:hover {\n background-color: unset;\n }\n }\n\n .main-menu-subnav-item-icon {\n flex-shrink: 0;\n margin-right: 8px;\n opacity: 0.5;\n fill: var(--color-theme-700);\n }\n\n .main-menu-subnav-item-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .main-menu-item {\n width: 100%;\n min-width: 0;\n height: 32px;\n margin-right: 12px;\n margin-left: 22px;\n padding: 8px;\n }\n\n .main-menu-item:hover {\n .main-menu-subnav-item-icon {\n fill: var(--color-theme-900);\n }\n\n .main-menu-subnav-item-text {\n color: var(--color-theme-900);\n }\n }\n\n .main-menu-subnav-item-active,\n .main-menu-subnav-item-active:hover {\n background-color: var(--color-secondary-200);\n\n .main-menu-subnav-item-icon {\n fill: var(--color-secondary);\n }\n\n .main-menu-subnav-item-text {\n color: var(--color-secondary);\n }\n }\n }\n\n .menu-section-text {\n opacity: 0.7;\n }\n\n .main-menu-item-text,\n .menu-section {\n transition: all ${TRANSITION};\n }\n\n /* \"tw:mb-2 tw:mx-3 tw:pl-3 tw:pr-1 tw:flex tw:justify-between tw:items-center menu-section\" */\n .menu-section {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 0 12px 8px;\n padding: 0 4px 0 12px;\n /* The height clips the heading as it opens and closes, so its text is never squeezed. The 4px keep a focus ring. */\n clip-path: inset(-4px);\n }\n\n &.expanded {\n .main-menu-item-text {\n opacity: 1;\n visibility: visible;\n }\n\n .menu-section {\n max-height: 32px;\n opacity: 1;\n }\n }\n\n &.collapsed {\n .main-menu-item-text {\n opacity: 0;\n visibility: hidden;\n }\n\n .menu-section {\n max-height: 0;\n opacity: 0;\n }\n }\n\n @media (max-width: ${XL}) {\n &.collapsed .menu-section,\n &.expanded .menu-section {\n max-height: 0;\n opacity: 0;\n }\n\n &.collapsed .main-menu-item-text,\n &.expanded .main-menu-item-text {\n width: 0;\n opacity: 0;\n visibility: hidden;\n }\n\n /* The narrow screen collapses the sidebar, never the drawer. */\n &.c-main-menu--drawer.expanded {\n .menu-section {\n max-height: 32px;\n opacity: 1;\n }\n\n .main-menu-item-text {\n width: auto;\n opacity: 1;\n visibility: visible;\n }\n }\n }\n\n /* FavoriteProjectsMenu.js target */\n .favorite-projects-menu-target {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n display: none;\n align-items: center;\n justify-content: center;\n width: 10px;\n height: 40px;\n border-radius: 4px;\n cursor: pointer;\n\n &.collapsed {\n display: flex;\n }\n\n @media (max-width: ${XL}) {\n display: flex;\n }\n\n svg {\n transform: rotate(180deg);\n }\n }\n\n &.main-menu-can-peek:not(.main-menu-peek-open)\n .favorite-projects-menu-target {\n display: none;\n }\n\n /* Where the drawer toggle sits in the expanded menu. */\n &.main-menu-peek-open .favorite-projects-menu-target.collapsed {\n top: 8px;\n right: 16px;\n width: 24px;\n height: 24px;\n }\n\n .favorite-projects-menu-target:hover {\n background-color: var(--color-theme-300);\n\n svg {\n fill: var(--color-theme-900);\n }\n }\n\n .main-menu-item-current + .favorite-projects-menu-target:hover,\n .favorite-projects-menu-target.open {\n background-color: var(--color-secondary-200);\n\n svg {\n fill: var(--color-secondary);\n }\n }\n\n /* ExpandToggle.jsx \"tw:transition-transform tw:duration-200\", up when expanded */\n .main-menu-toggle {\n flex-shrink: 0;\n transition: ${TOGGLE_TRANSITION};\n\n &.is-closed {\n transform: rotate(180deg);\n }\n }\n\n .favorite-projects-list,\n .favorite-projects-list-target {\n display: flex;\n\n &.collapsed {\n display: none;\n }\n\n @media (max-width: ${XL}) {\n display: none;\n }\n }\n\n .favorite-projects-list-target {\n margin-left: auto;\n }\n\n &.c-main-menu--drawer {\n .favorite-projects-list.favorite-projects-list,\n .favorite-projects-list-target.is-mobile {\n display: flex;\n }\n }\n\n .favorite-projects-list {\n opacity: 1;\n overflow: hidden;\n transition: all ${TRANSITION};\n }\n\n .favorite-projects-list-collapsed {\n opacity: 0;\n transition: all ${TRANSITION};\n }\n\n /* HiddenOptionList.js */\n .show-hidden-options-long {\n display: block;\n margin: 12px 24px;\n cursor: pointer;\n\n &.collapsed {\n display: none;\n }\n\n @media (max-width: ${XL}) {\n display: none;\n }\n }\n\n .show-hidden-options-short {\n display: none;\n margin: 12px 0;\n cursor: pointer;\n\n &.collapsed {\n display: block;\n }\n\n @media (max-width: ${XL}) {\n display: block;\n }\n }\n\n &.c-main-menu--drawer {\n .show-hidden-options-long.show-hidden-options-long {\n display: block;\n }\n\n .show-hidden-options-short.show-hidden-options-short {\n display: none;\n }\n }\n\n /* Shortcuts/List.js */\n .main-menu-shortcuts {\n position: relative;\n }\n\n .shortcuts-expander {\n margin-left: auto;\n cursor: pointer;\n }\n\n .shortcuts-expander-collapsed {\n position: absolute;\n top: -11px;\n right: 0;\n left: 0;\n display: none;\n margin: 0 auto;\n border-radius: 100%;\n background-color: var(--body-bg-main);\n cursor: pointer;\n\n &.collapsed {\n display: block;\n }\n\n @media (max-width: ${XL}) {\n display: block;\n }\n }\n\n .shortcuts-list-separator.c-list-separator {\n margin: 16px 12px 12px;\n transition: margin ${TRANSITION};\n\n &.collapsed {\n margin: 20px 12px;\n }\n\n @media (max-width: ${XL}) {\n margin: 20px 12px;\n }\n }\n\n .add-shortcut {\n cursor: pointer;\n\n .main-menu-item-text.main-menu-item-text {\n color: var(--color-secondary);\n }\n\n .main-menu-item-icon.main-menu-item-icon {\n fill: var(--color-secondary);\n opacity: 1;\n }\n\n &:hover {\n background-color: var(--color-primary-200);\n }\n\n &:focus {\n background-color: var(--color-primary-300);\n outline: none;\n }\n }\n\n /* HelpAndSupportMenu.js target \"tw:relative main-menu-item tw:shrink-0 tw:my-4 tw:hover:cursor-pointer\" */\n .main-menu-item.main-menu-help {\n position: relative;\n flex-shrink: 0;\n margin-top: 16px;\n margin-bottom: 16px;\n\n &:hover {\n cursor: pointer;\n }\n }\n\n .main-menu-help .main-menu-toggle.is-hidden {\n display: none;\n }\n\n /* HelpAndSupportMenu.js \"tw:bg-primary\": a promotion in place of Help & Support */\n .main-menu-item.main-menu-help--promo,\n .main-menu-item.main-menu-help--promo:hover,\n .main-menu-item.main-menu-help--promo.main-menu-item-current {\n background-color: var(--color-primary);\n }\n\n .main-menu-help-promo {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n .main-menu-help-promo-icon {\n flex-shrink: 0;\n fill: var(--page-paper-main);\n }\n\n /* \"tw:flex tw:visible tw:sm:invisible tw:xl:visible\" */\n .main-menu-help-promo-text {\n display: flex;\n visibility: visible;\n\n @media (min-width: ${SM}) {\n visibility: hidden;\n }\n\n @media (min-width: ${XL}) {\n visibility: visible;\n }\n }\n\n /* \"new-features-badge tw:absolute tw:right-1 tw:top-4 tw:sm:top-0 tw:sm:left-0 tw:sm:right-auto tw:ml-auto tw:mr-2\" */\n .main-menu-help-badge.main-menu-help-badge {\n position: absolute;\n top: 16px;\n right: 4px;\n margin-right: 8px;\n margin-left: auto;\n\n @media (min-width: ${SM}) {\n top: 0;\n right: auto;\n left: 0;\n }\n\n &.is-promo {\n right: 6px;\n\n @media (min-width: ${SM}) {\n right: auto;\n }\n }\n\n &.is-static {\n @media (min-width: ${XL}) {\n position: static;\n }\n }\n }\n\n /* MainMenuItemsEditor.js \"tw:flex tw:flex-col tw:min-h-0 tw:grow tw:outline-none\" */\n .main-menu-editor {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n min-height: 0;\n outline: none;\n }\n\n /* Editor/Header.js \"tw:mt-3\" */\n .main-menu-editor-header {\n margin-top: 12px;\n }\n\n .main-menu-editor-action {\n margin-right: 4px;\n }\n\n .main-menu-editor-list {\n display: flex;\n flex-grow: 1;\n min-height: 0;\n }\n\n .main-menu-editor-list-inner {\n overflow-x: hidden;\n }\n\n /* DraggableListItem.js \"tw:pr-3 tw:pl-2 tw:mt-0\" with marginBottom 2px */\n .main-menu-editor-row.c-list-item {\n margin: 0 0 2px;\n padding-right: 12px;\n padding-left: 8px;\n }\n\n .main-menu-editor-row-box {\n width: 100%;\n border-radius: var(--ac-br-8);\n }\n\n .main-menu-editor-row-inner {\n display: flex;\n align-items: center;\n width: 100%;\n }\n\n .main-menu-editor-handle {\n margin-right: 4px;\n cursor: move;\n }\n\n /* Editor/MainMenuItem.js \"main-menu-edit-item tw:h-10 tw:w-full tw:pr-1\" with maxWidth 204px */\n .main-menu-edit-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n max-width: 204px;\n height: 40px;\n padding-right: 4px;\n text-decoration: none;\n }\n\n .main-menu-edit-item-start {\n display: flex;\n align-items: center;\n min-width: 0;\n }\n\n .main-menu-edit-item.hidden {\n .main-menu-item-icon,\n .main-menu-item-text {\n opacity: 0.4;\n }\n }\n\n /* \"tw:flex tw:items-center tw:h-6 tw:mb-2 tw:mx-3 tw:px-3 menu-section-text\" */\n .main-menu-editor-shortcuts-title {\n display: flex;\n align-items: center;\n height: 24px;\n margin: 0 12px 8px;\n padding: 0 12px;\n }\n\n /* MainMenuMobile.js \"tw:absolute tw:right-4 tw:top-4 tw:sm:hidden\" */\n .main-menu-drawer-close {\n position: absolute;\n top: 16px;\n right: 16px;\n\n @media (min-width: ${SM}) {\n display: none;\n }\n }\n`;\n\nStyledMainMenu.displayName = \"StyledMainMenu\";\n\n/* HelpAndSupportMenu.js: \"tw:mt-3\" on the first item, \"tw:mb-3\" on the last, \"tw:shrink-0 tw:mr-3\" on the icons */\nexport const StyledHelpList = styled(List)`\n outline: 2px solid transparent;\n outline-offset: 2px;\n\n .c-list-item > svg:first-child {\n flex-shrink: 0;\n margin-right: 12px;\n }\n\n .c-list-item:first-child {\n margin-top: 12px;\n }\n\n .c-list-item:last-child {\n margin-bottom: 12px;\n }\n\n .main-menu-help-entry-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .main-menu-help-entry-badge {\n margin-left: auto;\n }\n\n /* an entry with a link: \"tw:no-underline\" */\n a.c-list-item {\n text-decoration: none;\n }\n\n .main-menu-help-entry.is-primary {\n color: var(--color-primary);\n\n > svg:first-child {\n fill: var(--color-primary);\n }\n }\n\n /* \"tw:justify-between tw:gap-3\" */\n .main-menu-help-entry-text.has-end {\n margin-right: 12px;\n }\n\n .main-menu-help-entry-end {\n flex-shrink: 0;\n margin-left: auto;\n }\n`;\n\nStyledHelpList.displayName = \"StyledHelpList\";\n\n/* FavoriteProjectsMenu.js \"tw:py-2\", FavoriteProjectMenuOption.js */\nexport const StyledFavoritesMenuList = styled(List)`\n padding: 8px 0;\n\n .c-list-item {\n padding-right: 0;\n padding-left: 0;\n }\n\n .favorite-project-menu-option {\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n width: 100%;\n padding: 0 16px;\n color: var(--color-theme-900);\n text-decoration: none;\n\n svg {\n flex-shrink: 0;\n margin-right: 8px;\n opacity: 0.5;\n }\n\n &.favorite-project-menu-option-active {\n background-color: var(--color-secondary-200);\n\n svg {\n fill: var(--color-secondary);\n }\n\n .favorite-project-menu-option-text {\n color: var(--color-secondary);\n }\n }\n }\n\n .favorite-project-menu-option-text {\n flex: 1;\n padding-right: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n`;\n\nStyledFavoritesMenuList.displayName = \"StyledFavoritesMenuList\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,iBAAiB,QAAQ,mBAAmB;AAE7D,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,IAAI,QAAQ,SAAS;AAE9B,OAAO,MAAMC,EAAE,GAAG,OAAO;AACzB,OAAO,MAAMC,EAAE,GAAG,QAAQ;AAC1B,OAAO,MAAMC,aAAa,oBAAkBD,EAAE,MAAG;AACjD,OAAO,MAAME,eAAe,GAAG,EAAE;AACjC,OAAO,MAAMC,cAAc,GAAG,GAAG;AAEjC,MAAMC,UAAU,GAAG,YAAY;AAC/B,MAAMC,iBAAiB,GAAG,8CAA8C;;AAExE;AACA,OAAO,MAAMC,mBAAmB,GAAGV,iBAAiB,iDAInD;AAED,OAAO,MAAMW,cAAc,GAAGZ,MAAM,CAACa,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gxWACpCd,cAAc,EAYOE,EAAE,EAWdI,cAAc,EAIdD,eAAe,EAKJE,UAAU,EAETJ,EAAE,EACZE,eAAe,EAKjBC,cAAc,EAWdD,eAAe,EAUfC,cAAc,EAEZA,cAAc,GAAGD,eAAe,EA0BlCC,cAAc,GAAG,EAAE,EA0BVC,UAAU,EAQVA,UAAU,EAQRA,UAAU,EAGPJ,EAAE,EA4BJA,EAAE,EA4BWK,iBAAiB,EA2D7BD,UAAU,EAoCbJ,EAAE,EAkDDI,UAAU,EAkHZA,UAAU,EAuCTJ,EAAE,EA+CAA,EAAE,EA0CTK,iBAAiB,EAeVL,EAAE,EAmBLI,UAAU,EAKVA,UAAU,EAaPJ,EAAE,EAcFA,EAAE,EAwCFA,EAAE,EAOFI,UAAU,EAMVJ,EAAE,EAkEFD,EAAE,EAIFC,EAAE,EAaFD,EAAE,EASAA,EAAE,EAMFC,EAAE,EAiGJD,EAAE,CAI1B;AAEDQ,cAAc,CAACG,WAAW,GAAG,gBAAgB;;AAE7C;AACA,OAAO,MAAME,cAAc,GAAGjB,MAAM,CAACG,IAAI,CAAC,CAAAW,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,ilBAiDzC;AAEDC,cAAc,CAACF,WAAW,GAAG,gBAAgB;;AAE7C;AACA,OAAO,MAAMG,uBAAuB,GAAGlB,MAAM,CAACG,IAAI,CAAC,CAAAW,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,8lBA4ClD;AAEDE,uBAAuB,CAACH,WAAW,GAAG,yBAAyB","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ export declare const useControllable: <T>(value: T | undefined, defaultValue: T,
|
|
|
4
4
|
export declare const useMediaQuery: (query: string) => boolean;
|
|
5
5
|
export declare const useHasOpenPopup: (rootRef: RefObject<HTMLElement>, isWatching: boolean) => boolean;
|
|
6
6
|
export declare const usePointerInside: (rootRef: RefObject<HTMLElement>, isWatching: boolean) => readonly [boolean, (inside: boolean) => void];
|
|
7
|
+
export declare const usePeekHold: (rootRef: RefObject<HTMLElement>) => readonly [boolean, import("react").Dispatch<import("react").SetStateAction<boolean>>];
|
|
7
8
|
export declare const useDialogOpen: (isWatching: boolean, onOpen: () => void) => void;
|
|
8
9
|
export declare const useOpenMenuPointer: (rootRef: RefObject<HTMLElement>, isActive: boolean, onPointer: (inside: boolean) => void) => void;
|
|
9
10
|
/** The states and the labels that the desktop menu and the drawer resolve the same way. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../src/components/MainMenu/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAMV,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,kBAAkB,EAClB,eAAe,EAChB,MAAM,SAAS,CAAC;AAIjB,eAAO,MAAM,eAAe,GAAI,CAAC,EAC/B,OAAO,CAAC,GAAG,SAAS,EACpB,cAAc,CAAC,EACf,WAAW,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,KAC5B,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAgBxB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,OAsB7C,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,SAAS,SAAS,CAAC,WAAW,CAAC,EAC/B,YAAY,OAAO,KAClB,OA2BF,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../src/components/MainMenu/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAMV,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,kBAAkB,EAClB,eAAe,EAChB,MAAM,SAAS,CAAC;AAIjB,eAAO,MAAM,eAAe,GAAI,CAAC,EAC/B,OAAO,CAAC,GAAG,SAAS,EACpB,cAAc,CAAC,EACf,WAAW,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,KAC5B,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAgBxB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,OAsB7C,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,SAAS,SAAS,CAAC,WAAW,CAAC,EAC/B,YAAY,OAAO,KAClB,OA2BF,CAAC;AA6BF,eAAO,MAAM,gBAAgB,GAC3B,SAAS,SAAS,CAAC,WAAW,CAAC,EAC/B,YAAY,OAAO,iCAK2B,OAAO,UA+CtD,CAAC;AAGF,eAAO,MAAM,WAAW,GAAI,SAAS,SAAS,CAAC,WAAW,CAAC,0FAoB1D,CAAC;AAIF,eAAO,MAAM,aAAa,GAAI,YAAY,OAAO,EAAE,QAAQ,MAAM,IAAI,SAuBpE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,SAAS,CAAC,WAAW,CAAC,EAC/B,UAAU,OAAO,EACjB,WAAW,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,SAkBrC,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,eAAe,GAAI,OAAO,kBAAkB;;;8CAvOpC,IAAI;;8CAAJ,IAAI;;;;;CA0RxB,CAAC"}
|
|
@@ -74,6 +74,9 @@ const isPointerOverMenu = (root, event) => {
|
|
|
74
74
|
// The menu sits on the left edge of the page, so the gutter on its left counts too.
|
|
75
75
|
return event.clientX < right && event.clientY >= top && event.clientY < bottom;
|
|
76
76
|
};
|
|
77
|
+
|
|
78
|
+
// The pointer on the tab of a closed menu must not open the peek, because the click there changes the mode.
|
|
79
|
+
const isOnTabOfClosedMenu = (root, event) => !(root != null && root.classList.contains("main-menu-peek")) && Boolean(event.target.closest == null ? void 0 : event.target.closest(".main-menu-collapse-tab"));
|
|
77
80
|
export const usePointerInside = (rootRef, isWatching) => {
|
|
78
81
|
const _useState4 = useState(false),
|
|
79
82
|
isInside = _useState4[0],
|
|
@@ -96,7 +99,11 @@ export const usePointerInside = (rootRef, isWatching) => {
|
|
|
96
99
|
leaveTimer.current = setTimeout(() => setIsInside(false), LEAVE_DELAY_MS);
|
|
97
100
|
}
|
|
98
101
|
};
|
|
99
|
-
const handleOver = event =>
|
|
102
|
+
const handleOver = event => {
|
|
103
|
+
if (!isOnTabOfClosedMenu(rootRef.current, event)) {
|
|
104
|
+
update(isPointerOverMenu(rootRef.current, event));
|
|
105
|
+
}
|
|
106
|
+
};
|
|
100
107
|
const handleOut = event => {
|
|
101
108
|
if (!event.relatedTarget) {
|
|
102
109
|
update(false);
|
|
@@ -113,6 +120,26 @@ export const usePointerInside = (rootRef, isWatching) => {
|
|
|
113
120
|
return [isInside, setPointerInside];
|
|
114
121
|
};
|
|
115
122
|
|
|
123
|
+
// After a collapse the pointer is still over the menu, so only a leave brings the peek back.
|
|
124
|
+
export const usePeekHold = rootRef => {
|
|
125
|
+
const _useState5 = useState(false),
|
|
126
|
+
isHeld = _useState5[0],
|
|
127
|
+
setIsHeld = _useState5[1];
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
if (!isHeld) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
const release = event => {
|
|
133
|
+
if (!isPointerOverMenu(rootRef.current, event)) {
|
|
134
|
+
setIsHeld(false);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
document.addEventListener("mouseover", release, true);
|
|
138
|
+
return () => document.removeEventListener("mouseover", release, true);
|
|
139
|
+
}, [rootRef, isHeld]);
|
|
140
|
+
return [isHeld, setIsHeld];
|
|
141
|
+
};
|
|
142
|
+
|
|
116
143
|
// The listeners run only while the menu is fully open.
|
|
117
144
|
// Every Dialog is a native modal <dialog>, and showModal sends no event to listen for.
|
|
118
145
|
export const useDialogOpen = (isWatching, onOpen) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","names":["useCallback","useEffect","useMemo","useRef","useState","DEFAULT_MAIN_MENU_LABELS","LEAVE_DELAY_MS","useControllable","value","defaultValue","onChange","_useState","own","setOwn","isControlled","undefined","setValue","next","useMediaQuery","query","getMatch","window","matchMedia","matches","_useState2","setMatches","list","update","addEventListener","removeEventListener","useHasOpenPopup","rootRef","isWatching","_useState3","hasOpenPopup","setHasOpenPopup","root","current","Boolean","querySelector","observer","MutationObserver","observe","subtree","attributes","attributeFilter","disconnect","isPointerOverMenu","event","_root$querySelector","document","contains","target","_getBoundingClientRec","getBoundingClientRect","right","top","bottom","clientX","clientY","usePointerInside","_useState4","isInside","setIsInside","leaveTimer","setPointerInside","inside","clearTimeout","setTimeout","handleOver","handleOut","relatedTarget","useDialogOpen","onOpen","check","body","childList","useOpenMenuPointer","isActive","onPointer","handlePointer","useMainMenuData","props","_props$defaultFavorit","_props$defaultShortcu","_props$defaultEditMod","labels","_extends","_useControllable","favoritesExpanded","defaultFavoritesExpanded","onFavoritesExpandedChange","setFavoritesExpanded","_useControllable2","shortcutsExpanded","defaultShortcutsExpanded","onShortcutsExpandedChange","setShortcutsExpanded","_useControllable3","editMode","defaultEditMode","onEditModeChange","setEditMode","editButtonRef","returnFocusRef","enterEditMode","exitEditMode","returnFocus","_editButtonRef$curren","focus"],"sources":["../../../../src/components/MainMenu/hooks.ts"],"sourcesContent":["import {\n RefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport {\n DEFAULT_MAIN_MENU_LABELS,\n IMainMenuDataProps,\n IMainMenuLabels,\n} from \"./types\";\n\nconst LEAVE_DELAY_MS = 150;\n\nexport const useControllable = <T>(\n value: T | undefined,\n defaultValue: T,\n onChange?: (value: T) => void\n): [T, (value: T) => void] => {\n const [own, setOwn] = useState(defaultValue);\n const isControlled = value !== undefined;\n\n const setValue = useCallback(\n (next: T) => {\n if (!isControlled) {\n setOwn(next);\n }\n\n onChange?.(next);\n },\n [isControlled, onChange]\n );\n\n return [isControlled ? value : own, setValue];\n};\n\nexport const useMediaQuery = (query: string): boolean => {\n const getMatch = () =>\n typeof window !== \"undefined\" && typeof window.matchMedia === \"function\"\n ? window.matchMedia(query).matches\n : false;\n const [matches, setMatches] = useState(getMatch);\n\n useEffect(() => {\n if (typeof window.matchMedia !== \"function\") {\n return undefined;\n }\n\n const list = window.matchMedia(query);\n const update = () => setMatches(list.matches);\n\n update();\n list.addEventListener?.(\"change\", update);\n\n return () => list.removeEventListener?.(\"change\", update);\n }, [query]);\n\n return matches;\n};\n\nexport const useHasOpenPopup = (\n rootRef: RefObject<HTMLElement>,\n isWatching: boolean\n): boolean => {\n const [hasOpenPopup, setHasOpenPopup] = useState(false);\n\n useEffect(() => {\n const root = rootRef.current;\n\n if (!isWatching || !root) {\n setHasOpenPopup(false);\n\n return undefined;\n }\n\n const update = () =>\n setHasOpenPopup(Boolean(root.querySelector('[aria-expanded=\"true\"]')));\n const observer = new MutationObserver(update);\n\n update();\n observer.observe(root, {\n subtree: true,\n attributes: true,\n attributeFilter: [\"aria-expanded\"],\n });\n\n return () => observer.disconnect();\n }, [rootRef, isWatching]);\n\n return hasOpenPopup;\n};\n\n// Native events on the document: a React leave misses a node removed under the pointer and counts portals as inside.\n// A popup lays an overlay over the page, so the target alone does not tell where the pointer is.\nconst isPointerOverMenu = (root: HTMLElement | null, event: MouseEvent) => {\n // A modal dialog covers the menu, so the pointer cannot reach the menu.\n if (!root || document.querySelector(\"dialog[open]\")) {\n return false;\n }\n\n if (root.contains(event.target as Node)) {\n return true;\n }\n\n const { right, top, bottom } = (\n root.querySelector(\".main-menu-panel\") ?? root\n ).getBoundingClientRect();\n\n // The menu sits on the left edge of the page, so the gutter on its left counts too.\n return (\n event.clientX < right && event.clientY >= top && event.clientY < bottom\n );\n};\n\nexport const usePointerInside = (\n rootRef: RefObject<HTMLElement>,\n isWatching: boolean\n) => {\n const [isInside, setIsInside] = useState(false);\n const leaveTimer = useRef<ReturnType<typeof setTimeout>>();\n\n const setPointerInside = useCallback((inside: boolean) => {\n clearTimeout(leaveTimer.current);\n setIsInside(inside);\n }, []);\n\n useEffect(() => {\n if (!isWatching) {\n setIsInside(false);\n\n return undefined;\n }\n\n const update = (inside: boolean) => {\n clearTimeout(leaveTimer.current);\n\n if (inside) {\n setIsInside(true);\n } else {\n leaveTimer.current = setTimeout(\n () => setIsInside(false),\n LEAVE_DELAY_MS\n );\n }\n };\n\n const handleOver = (event: MouseEvent) =>\n update(isPointerOverMenu(rootRef.current, event));\n const handleOut = (event: MouseEvent) => {\n if (!event.relatedTarget) {\n update(false);\n }\n };\n\n document.addEventListener(\"mouseover\", handleOver, true);\n document.addEventListener(\"mouseout\", handleOut, true);\n\n return () => {\n clearTimeout(leaveTimer.current);\n document.removeEventListener(\"mouseover\", handleOver, true);\n document.removeEventListener(\"mouseout\", handleOut, true);\n };\n }, [rootRef, isWatching]);\n\n return [isInside, setPointerInside] as const;\n};\n\n// The listeners run only while the menu is fully open.\n// Every Dialog is a native modal <dialog>, and showModal sends no event to listen for.\nexport const useDialogOpen = (isWatching: boolean, onOpen: () => void) => {\n useEffect(() => {\n if (!isWatching) {\n return undefined;\n }\n\n const check = () => {\n if (document.querySelector(\"dialog[open]\")) {\n onOpen();\n }\n };\n const observer = new MutationObserver(check);\n\n check();\n observer.observe(document.body, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"open\"],\n });\n\n return () => observer.disconnect();\n }, [isWatching, onOpen]);\n};\n\nexport const useOpenMenuPointer = (\n rootRef: RefObject<HTMLElement>,\n isActive: boolean,\n onPointer: (inside: boolean) => void\n) => {\n useEffect(() => {\n if (!isActive) {\n return undefined;\n }\n\n const handlePointer = (event: MouseEvent) =>\n onPointer(isPointerOverMenu(rootRef.current, event));\n\n document.addEventListener(\"mousemove\", handlePointer, true);\n document.addEventListener(\"click\", handlePointer, true);\n\n return () => {\n document.removeEventListener(\"mousemove\", handlePointer, true);\n document.removeEventListener(\"click\", handlePointer, true);\n };\n }, [rootRef, isActive, onPointer]);\n};\n\n/** The states and the labels that the desktop menu and the drawer resolve the same way. */\nexport const useMainMenuData = (props: IMainMenuDataProps) => {\n const labels: IMainMenuLabels = useMemo(\n () => ({ ...DEFAULT_MAIN_MENU_LABELS, ...props.labels }),\n [props.labels]\n );\n const [favoritesExpanded, setFavoritesExpanded] = useControllable(\n props.favoritesExpanded,\n props.defaultFavoritesExpanded ?? false,\n props.onFavoritesExpandedChange\n );\n const [shortcutsExpanded, setShortcutsExpanded] = useControllable(\n props.shortcutsExpanded,\n props.defaultShortcutsExpanded ?? true,\n props.onShortcutsExpandedChange\n );\n const [editMode, setEditMode] = useControllable(\n props.editMode,\n props.defaultEditMode ?? false,\n props.onEditModeChange\n );\n const editButtonRef = useRef<HTMLButtonElement>(null);\n const returnFocusRef = useRef(false);\n\n const enterEditMode = useCallback(() => setEditMode(true), [setEditMode]);\n const exitEditMode = useCallback(\n (returnFocus = true) => {\n returnFocusRef.current = returnFocus;\n setEditMode(false);\n },\n [setEditMode]\n );\n\n // Leaving edit mode mounts a new edit button, so the focus moves to it once it is there.\n useEffect(() => {\n if (!editMode && returnFocusRef.current) {\n returnFocusRef.current = false;\n editButtonRef.current?.focus();\n }\n }, [editMode]);\n\n return {\n labels,\n favoritesExpanded,\n setFavoritesExpanded,\n shortcutsExpanded,\n setShortcutsExpanded,\n editMode,\n enterEditMode,\n exitEditMode,\n editButtonRef,\n };\n};\n"],"mappings":";AAAA,SAEEA,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AAEd,SACEC,wBAAwB,QAGnB,SAAS;AAEhB,MAAMC,cAAc,GAAG,GAAG;AAE1B,OAAO,MAAMC,eAAe,GAAGA,CAC7BC,KAAoB,EACpBC,YAAe,EACfC,QAA6B,KACD;EAC5B,MAAAC,SAAA,GAAsBP,QAAQ,CAACK,YAAY,CAAC;IAArCG,GAAG,GAAAD,SAAA;IAAEE,MAAM,GAAAF,SAAA;EAClB,MAAMG,YAA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IACjBG,oBAAoB;IACpBE,QAAQ;IACRM,aAAa;IACbC,YAAY;IACZH;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"hooks.js","names":["useCallback","useEffect","useMemo","useRef","useState","DEFAULT_MAIN_MENU_LABELS","LEAVE_DELAY_MS","useControllable","value","defaultValue","onChange","_useState","own","setOwn","isControlled","undefined","setValue","next","useMediaQuery","query","getMatch","window","matchMedia","matches","_useState2","setMatches","list","update","addEventListener","removeEventListener","useHasOpenPopup","rootRef","isWatching","_useState3","hasOpenPopup","setHasOpenPopup","root","current","Boolean","querySelector","observer","MutationObserver","observe","subtree","attributes","attributeFilter","disconnect","isPointerOverMenu","event","_root$querySelector","document","contains","target","_getBoundingClientRec","getBoundingClientRect","right","top","bottom","clientX","clientY","isOnTabOfClosedMenu","classList","closest","usePointerInside","_useState4","isInside","setIsInside","leaveTimer","setPointerInside","inside","clearTimeout","setTimeout","handleOver","handleOut","relatedTarget","usePeekHold","_useState5","isHeld","setIsHeld","release","useDialogOpen","onOpen","check","body","childList","useOpenMenuPointer","isActive","onPointer","handlePointer","useMainMenuData","props","_props$defaultFavorit","_props$defaultShortcu","_props$defaultEditMod","labels","_extends","_useControllable","favoritesExpanded","defaultFavoritesExpanded","onFavoritesExpandedChange","setFavoritesExpanded","_useControllable2","shortcutsExpanded","defaultShortcutsExpanded","onShortcutsExpandedChange","setShortcutsExpanded","_useControllable3","editMode","defaultEditMode","onEditModeChange","setEditMode","editButtonRef","returnFocusRef","enterEditMode","exitEditMode","returnFocus","_editButtonRef$curren","focus"],"sources":["../../../../src/components/MainMenu/hooks.ts"],"sourcesContent":["import {\n RefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport {\n DEFAULT_MAIN_MENU_LABELS,\n IMainMenuDataProps,\n IMainMenuLabels,\n} from \"./types\";\n\nconst LEAVE_DELAY_MS = 150;\n\nexport const useControllable = <T>(\n value: T | undefined,\n defaultValue: T,\n onChange?: (value: T) => void\n): [T, (value: T) => void] => {\n const [own, setOwn] = useState(defaultValue);\n const isControlled = value !== undefined;\n\n const setValue = useCallback(\n (next: T) => {\n if (!isControlled) {\n setOwn(next);\n }\n\n onChange?.(next);\n },\n [isControlled, onChange]\n );\n\n return [isControlled ? value : own, setValue];\n};\n\nexport const useMediaQuery = (query: string): boolean => {\n const getMatch = () =>\n typeof window !== \"undefined\" && typeof window.matchMedia === \"function\"\n ? window.matchMedia(query).matches\n : false;\n const [matches, setMatches] = useState(getMatch);\n\n useEffect(() => {\n if (typeof window.matchMedia !== \"function\") {\n return undefined;\n }\n\n const list = window.matchMedia(query);\n const update = () => setMatches(list.matches);\n\n update();\n list.addEventListener?.(\"change\", update);\n\n return () => list.removeEventListener?.(\"change\", update);\n }, [query]);\n\n return matches;\n};\n\nexport const useHasOpenPopup = (\n rootRef: RefObject<HTMLElement>,\n isWatching: boolean\n): boolean => {\n const [hasOpenPopup, setHasOpenPopup] = useState(false);\n\n useEffect(() => {\n const root = rootRef.current;\n\n if (!isWatching || !root) {\n setHasOpenPopup(false);\n\n return undefined;\n }\n\n const update = () =>\n setHasOpenPopup(Boolean(root.querySelector('[aria-expanded=\"true\"]')));\n const observer = new MutationObserver(update);\n\n update();\n observer.observe(root, {\n subtree: true,\n attributes: true,\n attributeFilter: [\"aria-expanded\"],\n });\n\n return () => observer.disconnect();\n }, [rootRef, isWatching]);\n\n return hasOpenPopup;\n};\n\n// Native events on the document: a React leave misses a node removed under the pointer and counts portals as inside.\n// A popup lays an overlay over the page, so the target alone does not tell where the pointer is.\nconst isPointerOverMenu = (root: HTMLElement | null, event: MouseEvent) => {\n // A modal dialog covers the menu, so the pointer cannot reach the menu.\n if (!root || document.querySelector(\"dialog[open]\")) {\n return false;\n }\n\n if (root.contains(event.target as Node)) {\n return true;\n }\n\n const { right, top, bottom } = (\n root.querySelector(\".main-menu-panel\") ?? root\n ).getBoundingClientRect();\n\n // The menu sits on the left edge of the page, so the gutter on its left counts too.\n return (\n event.clientX < right && event.clientY >= top && event.clientY < bottom\n );\n};\n\n// The pointer on the tab of a closed menu must not open the peek, because the click there changes the mode.\nconst isOnTabOfClosedMenu = (root: HTMLElement | null, event: MouseEvent) =>\n !root?.classList.contains(\"main-menu-peek\") &&\n Boolean((event.target as Element).closest?.(\".main-menu-collapse-tab\"));\n\nexport const usePointerInside = (\n rootRef: RefObject<HTMLElement>,\n isWatching: boolean\n) => {\n const [isInside, setIsInside] = useState(false);\n const leaveTimer = useRef<ReturnType<typeof setTimeout>>();\n\n const setPointerInside = useCallback((inside: boolean) => {\n clearTimeout(leaveTimer.current);\n setIsInside(inside);\n }, []);\n\n useEffect(() => {\n if (!isWatching) {\n setIsInside(false);\n\n return undefined;\n }\n\n const update = (inside: boolean) => {\n clearTimeout(leaveTimer.current);\n\n if (inside) {\n setIsInside(true);\n } else {\n leaveTimer.current = setTimeout(\n () => setIsInside(false),\n LEAVE_DELAY_MS\n );\n }\n };\n\n const handleOver = (event: MouseEvent) => {\n if (!isOnTabOfClosedMenu(rootRef.current, event)) {\n update(isPointerOverMenu(rootRef.current, event));\n }\n };\n const handleOut = (event: MouseEvent) => {\n if (!event.relatedTarget) {\n update(false);\n }\n };\n\n document.addEventListener(\"mouseover\", handleOver, true);\n document.addEventListener(\"mouseout\", handleOut, true);\n\n return () => {\n clearTimeout(leaveTimer.current);\n document.removeEventListener(\"mouseover\", handleOver, true);\n document.removeEventListener(\"mouseout\", handleOut, true);\n };\n }, [rootRef, isWatching]);\n\n return [isInside, setPointerInside] as const;\n};\n\n// After a collapse the pointer is still over the menu, so only a leave brings the peek back.\nexport const usePeekHold = (rootRef: RefObject<HTMLElement>) => {\n const [isHeld, setIsHeld] = useState(false);\n\n useEffect(() => {\n if (!isHeld) {\n return undefined;\n }\n\n const release = (event: MouseEvent) => {\n if (!isPointerOverMenu(rootRef.current, event)) {\n setIsHeld(false);\n }\n };\n\n document.addEventListener(\"mouseover\", release, true);\n\n return () => document.removeEventListener(\"mouseover\", release, true);\n }, [rootRef, isHeld]);\n\n return [isHeld, setIsHeld] as const;\n};\n\n// The listeners run only while the menu is fully open.\n// Every Dialog is a native modal <dialog>, and showModal sends no event to listen for.\nexport const useDialogOpen = (isWatching: boolean, onOpen: () => void) => {\n useEffect(() => {\n if (!isWatching) {\n return undefined;\n }\n\n const check = () => {\n if (document.querySelector(\"dialog[open]\")) {\n onOpen();\n }\n };\n const observer = new MutationObserver(check);\n\n check();\n observer.observe(document.body, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"open\"],\n });\n\n return () => observer.disconnect();\n }, [isWatching, onOpen]);\n};\n\nexport const useOpenMenuPointer = (\n rootRef: RefObject<HTMLElement>,\n isActive: boolean,\n onPointer: (inside: boolean) => void\n) => {\n useEffect(() => {\n if (!isActive) {\n return undefined;\n }\n\n const handlePointer = (event: MouseEvent) =>\n onPointer(isPointerOverMenu(rootRef.current, event));\n\n document.addEventListener(\"mousemove\", handlePointer, true);\n document.addEventListener(\"click\", handlePointer, true);\n\n return () => {\n document.removeEventListener(\"mousemove\", handlePointer, true);\n document.removeEventListener(\"click\", handlePointer, true);\n };\n }, [rootRef, isActive, onPointer]);\n};\n\n/** The states and the labels that the desktop menu and the drawer resolve the same way. */\nexport const useMainMenuData = (props: IMainMenuDataProps) => {\n const labels: IMainMenuLabels = useMemo(\n () => ({ ...DEFAULT_MAIN_MENU_LABELS, ...props.labels }),\n [props.labels]\n );\n const [favoritesExpanded, setFavoritesExpanded] = useControllable(\n props.favoritesExpanded,\n props.defaultFavoritesExpanded ?? false,\n props.onFavoritesExpandedChange\n );\n const [shortcutsExpanded, setShortcutsExpanded] = useControllable(\n props.shortcutsExpanded,\n props.defaultShortcutsExpanded ?? true,\n props.onShortcutsExpandedChange\n );\n const [editMode, setEditMode] = useControllable(\n props.editMode,\n props.defaultEditMode ?? false,\n props.onEditModeChange\n );\n const editButtonRef = useRef<HTMLButtonElement>(null);\n const returnFocusRef = useRef(false);\n\n const enterEditMode = useCallback(() => setEditMode(true), [setEditMode]);\n const exitEditMode = useCallback(\n (returnFocus = true) => {\n returnFocusRef.current = returnFocus;\n setEditMode(false);\n },\n [setEditMode]\n );\n\n // Leaving edit mode mounts a new edit button, so the focus moves to it once it is there.\n useEffect(() => {\n if (!editMode && returnFocusRef.current) {\n returnFocusRef.current = false;\n editButtonRef.current?.focus();\n }\n }, [editMode]);\n\n return {\n labels,\n favoritesExpanded,\n setFavoritesExpanded,\n shortcutsExpanded,\n setShortcutsExpanded,\n editMode,\n enterEditMode,\n exitEditMode,\n editButtonRef,\n };\n};\n"],"mappings":";AAAA,SAEEA,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AAEd,SACEC,wBAAwB,QAGnB,SAAS;AAEhB,MAAMC,cAAc,GAAG,GAAG;AAE1B,OAAO,MAAMC,eAAe,GAAGA,CAC7BC,KAAoB,EACpBC,YAAe,EACfC,QAA6B,KACD;EAC5B,MAAAC,SAAA,GAAsBP,QAAQ,CAACK,YAAY,CAAC;IAArCG,GAAG,GAAAD,SAAA;IAAEE,MAAM,GAAAF,SAAA;EAClB,MAAMG,YAAY,GAAGN,KAAK,KAAKO,SAAS;EAExC,MAAMC,QAAQ,GAAGhB,WAAW,CACzBiB,IAAO,IAAK;IACX,IAAI,CAACH,YAAY,EAAE;MACjBD,MAAM,CAACI,IAAI,CAAC;IACd;IAEAP,QAAQ,YAARA,QAAQ,CAAGO,IAAI,CAAC;EAClB,CAAC,EACD,CAACH,YAAY,EAAEJ,QAAQ,CACzB,CAAC;EAED,OAAO,CAACI,YAAY,GAAGN,KAAK,GAAGI,GAAG,EAAEI,QAAQ,CAAC;AAC/C,CAAC;AAED,OAAO,MAAME,aAAa,GAAIC,KAAa,IAAc;EACvD,MAAMC,QAAQ,GAAGA,CAAA,KACf,OAAOC,MAAM,KAAK,WAAW,IAAI,OAAOA,MAAM,CAACC,UAAU,KAAK,UAAU,GACpED,MAAM,CAACC,UAAU,CA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AC9B,UAACmH,WAAW,EAAY;IAAA,IAAvBA,WAAW;MAAXA,WAAW,GAAG,IAAI;IAAA;IACjBH,cAAc,CAAC3E,OAAO,GAAG8E,WAAW;IACpCL,WAAW,CAAC,KAAK,CAAC;EACpB,CAAC,EACD,CAACA,WAAW,CACd,CAAC;;EAED;EACA7G,SAAS,CAAC,MAAM;IACd,IAAI,CAAC0G,QAAQ,IAAIK,cAAc,CAAC3E,OAAO,EAAE;MAAA,IAAA+E,qBAAA;MACvCJ,cAAc,CAAC3E,OAAO,GAAG,KAAK;MAC9B,CAAA+E,qBAAA,GAAAL,aAAa,CAAC1E,OAAO,aAArB+E,qBAAA,CAAuBC,KAAK,CAAC,CAAC;IAChC;EACF,CAAC,EAAE,CAACV,QAAQ,CAAC,CAAC;EAEd,OAAO;IACLb,MAAM;IACNG,iBAAiB;IACjBG,oBAAoB;IACpBE,iBAAiB;IACjBG,oBAAoB;IACpBE,QAAQ;IACRM,aAAa;IACbC,YAAY;IACZH;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/MainMenu/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAC/B,sGAAsG;IACtG,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM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,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,KAAK,IAAI,KAAK,SAAS,CAAC;IACpE,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,qDAAqD;IACrD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAClD,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC5D,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["DEFAULT_MAIN_MENU_LABELS","customizeMenu","collapse","menu","edit","shortcuts","addNew","showMore","showLess","more","less","helpAndSupport","editing","restoreDefault","save","cancel","show","hide","delete","restore","close"],"sources":["../../../../src/components/MainMenu/types.ts"],"sourcesContent":["import { ComponentType, MouseEvent, ReactNode, SVGProps } from \"react\";\n\nexport type MainMenuIcon = ComponentType<SVGProps<SVGSVGElement>>;\n\nexport interface MainMenuItemData {\n /** The key of the item, for example \"projects\". The \"projects\" item carries the favorite projects. */\n id: string;\n text: string;\n icon: MainMenuIcon;\n href?: string;\n /** The `id` of the link, for example a target of a feature pointer. */\n elementId?: string;\n /** Marks the item current, besides `currentItem`, for example on a page under another item. */\n current?: boolean;\n /** Opens the link in a new tab with \"_blank\". */\n target?: string;\n rel?: string;\n /** A click on the link, before `onNavigate`. */\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n}\n\nexport interface MainMenuShortcutData {\n id: number | string;\n name: string;\n icon: MainMenuIcon;\n href?: string;\n /** Marks the shortcut current, for example when its page is open. */\n current?: boolean;\n /** Opens the link in a new tab with \"_blank\", for example an external shortcut. */\n target?: string;\n rel?: string;\n /** A click on the link, before `onNavigate`. */\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n}\n\nexport interface MainMenuFavoriteData {\n id: number | string;\n /** The display name, with the project number when the account shows it. */\n name: string;\n href?: string;\n}\n\nexport interface MainMenuHelpEntry {\n id: string;\n text: string;\n icon: MainMenuIcon;\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n /** A count in a red badge after the text, for example the unseen new features. */\n badge?: number;\n /** Makes the entry a link. The menu closes on its click. */\n href?: string;\n target?: string;\n rel?: string;\n /** \"primary\" draws the text and the icon in the primary color, for example a promotion. */\n tone?: \"primary\";\n /** Content at the end of the entry, for example a discount chip. */\n end?: ReactNode;\n /** The `id` of the text, for example a target of a feature pointer. */\n elementId?: string;\n className?: string;\n tabIndex?: number;\n}\n\n/** A promotion in place of the Help & Support item: a primary filled item with its own icon and text. */\nexport interface MainMenuHelpPromo {\n label: string;\n icon: MainMenuIcon;\n}\n\nexport interface MainMenuEditResult {\n hidden: string[];\n deleted: Array<number | string>;\n}\n\nexport interface IMainMenuLabels {\n customizeMenu: string;\n collapse: string;\n menu: string;\n edit: string;\n shortcuts: string;\n addNew: string;\n showMore: string;\n showLess: string;\n more: string;\n less: string;\n helpAndSupport: string;\n editing: string;\n restoreDefault: string;\n save: string;\n cancel: string;\n show: string;\n hide: string;\n delete: string;\n restore: string;\n close: string;\n}\n\nexport const DEFAULT_MAIN_MENU_LABELS: IMainMenuLabels = {\n customizeMenu: \"Customize Menu\",\n collapse: \"Collapse
|
|
1
|
+
{"version":3,"file":"types.js","names":["DEFAULT_MAIN_MENU_LABELS","customizeMenu","collapse","expand","menu","edit","shortcuts","addNew","showMore","showLess","more","less","helpAndSupport","editing","restoreDefault","save","cancel","show","hide","delete","restore","close"],"sources":["../../../../src/components/MainMenu/types.ts"],"sourcesContent":["import { ComponentType, MouseEvent, ReactNode, SVGProps } from \"react\";\n\nexport type MainMenuIcon = ComponentType<SVGProps<SVGSVGElement>>;\n\nexport interface MainMenuItemData {\n /** The key of the item, for example \"projects\". The \"projects\" item carries the favorite projects. */\n id: string;\n text: string;\n icon: MainMenuIcon;\n href?: string;\n /** The `id` of the link, for example a target of a feature pointer. */\n elementId?: string;\n /** Marks the item current, besides `currentItem`, for example on a page under another item. */\n current?: boolean;\n /** Opens the link in a new tab with \"_blank\". */\n target?: string;\n rel?: string;\n /** A click on the link, before `onNavigate`. */\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n}\n\nexport interface MainMenuShortcutData {\n id: number | string;\n name: string;\n icon: MainMenuIcon;\n href?: string;\n /** Marks the shortcut current, for example when its page is open. */\n current?: boolean;\n /** Opens the link in a new tab with \"_blank\", for example an external shortcut. */\n target?: string;\n rel?: string;\n /** A click on the link, before `onNavigate`. */\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n}\n\nexport interface MainMenuFavoriteData {\n id: number | string;\n /** The display name, with the project number when the account shows it. */\n name: string;\n href?: string;\n}\n\nexport interface MainMenuHelpEntry {\n id: string;\n text: string;\n icon: MainMenuIcon;\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n /** A count in a red badge after the text, for example the unseen new features. */\n badge?: number;\n /** Makes the entry a link. The menu closes on its click. */\n href?: string;\n target?: string;\n rel?: string;\n /** \"primary\" draws the text and the icon in the primary color, for example a promotion. */\n tone?: \"primary\";\n /** Content at the end of the entry, for example a discount chip. */\n end?: ReactNode;\n /** The `id` of the text, for example a target of a feature pointer. */\n elementId?: string;\n className?: string;\n tabIndex?: number;\n}\n\n/** A promotion in place of the Help & Support item: a primary filled item with its own icon and text. */\nexport interface MainMenuHelpPromo {\n label: string;\n icon: MainMenuIcon;\n}\n\nexport interface MainMenuEditResult {\n hidden: string[];\n deleted: Array<number | string>;\n}\n\nexport interface IMainMenuLabels {\n customizeMenu: string;\n collapse: string;\n expand: string;\n menu: string;\n edit: string;\n shortcuts: string;\n addNew: string;\n showMore: string;\n showLess: string;\n more: string;\n less: string;\n helpAndSupport: string;\n editing: string;\n restoreDefault: string;\n save: string;\n cancel: string;\n show: string;\n hide: string;\n delete: string;\n restore: string;\n close: string;\n}\n\nexport const DEFAULT_MAIN_MENU_LABELS: IMainMenuLabels = {\n customizeMenu: \"Customize Menu\",\n collapse: \"Collapse\",\n expand: \"Expand\",\n menu: \"MENU\",\n edit: \"Edit\",\n shortcuts: \"SHORTCUTS\",\n addNew: \"Add new\",\n showMore: \"Show more\",\n showLess: \"Show less\",\n more: \"More\",\n less: \"Less\",\n helpAndSupport: \"Help & Support\",\n editing: \"EDITING\",\n restoreDefault: \"Restore Default\",\n save: \"Save\",\n cancel: \"Cancel\",\n show: \"Show\",\n hide: \"Hide\",\n delete: \"Delete\",\n restore: \"Restore\",\n close: \"Close\",\n};\n\n/** The data and the handlers that the desktop menu and the drawer share. */\nexport interface IMainMenuDataProps {\n /** The items in their saved order. */\n items: MainMenuItemData[];\n /** The ids of the hidden items. They show under \"Show more\", and dimmed in the editor. */\n hiddenItems?: string[];\n /** The id of the item of the current page. */\n currentItem?: string;\n /** The favorite projects under the Projects item. */\n favorites?: MainMenuFavoriteData[];\n /** The id of the favorite project of the current page. */\n currentFavorite?: number | string;\n /** The favorite projects show under Projects. Uncontrolled when not set. */\n favoritesExpanded?: boolean;\n defaultFavoritesExpanded?: boolean;\n onFavoritesExpandedChange?: (expanded: boolean) => void;\n /** The shortcuts section. Not set, the menu has no shortcuts section. */\n shortcuts?: MainMenuShortcutData[];\n /** The shortcuts show under their heading. Uncontrolled when not set. */\n shortcutsExpanded?: boolean;\n defaultShortcutsExpanded?: boolean;\n onShortcutsExpandedChange?: (expanded: boolean) => void;\n /** The \"Add new\" row of the shortcuts. */\n onAddShortcut?: () => void;\n /** The groups of the Help & Support menu, with a separator between two groups. */\n helpEntries?: MainMenuHelpEntry[][];\n /** A count in a red badge on the Help & Support item. */\n helpBadge?: number;\n /** The Help & Support item looks current, for example on the New Features page. */\n helpCurrent?: boolean;\n /** Draws the Help & Support item as a promotion. */\n helpPromo?: MainMenuHelpPromo;\n /** The `id` of the Help & Support item, for example a target of a feature pointer. */\n helpId?: string;\n /** A part right above Help & Support, for example a development tool. */\n beforeHelp?: ReactNode;\n /** The `id` of the Show more block, for example a target of a feature pointer. */\n showMoreId?: string;\n /** Draws an editor of the app in place of the DS editor. `exit` leaves edit mode, and moves the focus back to the edit button when `returnFocus` is true. */\n renderEditor?: (exit: (returnFocus?: boolean) => void) => ReactNode;\n /** The editor shows in place of the items. Uncontrolled when not set. */\n editMode?: boolean;\n defaultEditMode?: boolean;\n onEditModeChange?: (editMode: boolean) => void;\n /** Save in the editor. The menu leaves edit mode. */\n onSaveEdit?: (result: MainMenuEditResult) => void;\n /** The link of the logo. */\n homeHref?: string;\n /** A click on any link of the menu, for example to route in the app. */\n onNavigate?: (event: MouseEvent<HTMLAnchorElement>) => void;\n /** A touch screen: the edit button always shows, as under `(hover: none)`. */\n touch?: boolean;\n labels?: Partial<IMainMenuLabels>;\n}\n"],"mappings":"AA+DA;;AAmCA,OAAO,MAAMA,wBAAyC,GAAG;EACvDC,aAAa,EAAE,gBAAgB;EAC/BC,QAAQ,EAAE,UAAU;EACpBC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,SAAS,EAAE,WAAW;EACtBC,MAAM,EAAE,SAAS;EACjBC,QAAQ,EAAE,WAAW;EACrBC,QAAQ,EAAE,WAAW;EACrBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,cAAc,EAAE,gBAAgB;EAChCC,OAAO,EAAE,SAAS;EAClBC,cAAc,EAAE,iBAAiB;EACjCC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE;AACT,CAAC;;AAED","ignoreList":[]}
|
|
@@ -5,11 +5,11 @@ const MAX_HEIGHT = "95vh";
|
|
|
5
5
|
export const StyledObjectFormModalClose = styled.button.withConfig({
|
|
6
6
|
displayName: "Styles__StyledObjectFormModalClose",
|
|
7
7
|
componentId: "sc-vysvjm-0"
|
|
8
|
-
})(["position:absolute;top:-1px;left:calc(100% + 8px);display:flex;align-items:center;justify-content:center;width:48px;height:48px;padding:0;cursor:pointer;background-color:var(--form-modal-surface,var(--color-theme-200));border:1px solid var(--form-modal-border,var(--border-raised));box-shadow:var(--form-modal-shadow,var(--shadow-primary));border-radius:24px;&:hover{filter:brightness(1.1);}svg{width:24px;height:24px;fill:var(--color-theme-700);}"]);
|
|
8
|
+
})(["position:absolute;top:-1px;left:calc(100% + 8px);display:flex;align-items:center;justify-content:center;width:48px;height:48px;padding:0;cursor:pointer;background-color:var(--form-modal-surface,var(--color-theme-200));border:1px solid var(--form-modal-border,var(--border-raised));box-shadow:var(--form-modal-shadow,var(--shadow-primary-simplified));border-radius:24px;&:hover{filter:brightness(1.1);}svg{width:24px;height:24px;fill:var(--color-theme-700);}"]);
|
|
9
9
|
StyledObjectFormModalClose.displayName = "StyledObjectFormModalClose";
|
|
10
10
|
export const StyledObjectFormModal = styled.div.withConfig({
|
|
11
11
|
displayName: "Styles__StyledObjectFormModal",
|
|
12
12
|
componentId: "sc-vysvjm-1"
|
|
13
|
-
})(["flex:0 0 auto;pointer-events:auto;position:relative;width:100%;max-width:", "px;max-height:", ";padding:20px;overflow-y:auto;overscroll-behavior:contain;background-color:var(--form-modal-surface,var(--color-theme-200));color:var(--color-theme-900);border:1px solid var(--form-modal-border,var(--border-raised));box-shadow:var(--form-modal-shadow,var(--shadow-primary));border-radius:24px;&[data-resizing]{overflow:hidden;}", " ", " ", " ", ""], props => props.$maxWidth, MAX_HEIGHT, props => props.$fill && css(["display:flex;flex-direction:column;> :not(.c-object-form-modal-close){min-height:0;}"]), props => props.$closeButton && css(["&,&[data-resizing]{overflow:visible;}&[data-resizing] > :not(.c-object-form-modal-close){overflow:hidden;}"]), FontStyle, BoxSizingStyle);
|
|
13
|
+
})(["flex:0 0 auto;pointer-events:auto;position:relative;width:100%;max-width:", "px;max-height:", ";padding:20px;overflow-y:auto;overscroll-behavior:contain;background-color:var(--form-modal-surface,var(--color-theme-200));color:var(--color-theme-900);border:1px solid var(--form-modal-border,var(--border-raised));box-shadow:var(--form-modal-shadow,var(--shadow-primary-simplified));border-radius:24px;&[data-resizing]{overflow:hidden;}", " ", " ", " ", ""], props => props.$maxWidth, MAX_HEIGHT, props => props.$fill && css(["display:flex;flex-direction:column;> :not(.c-object-form-modal-close){min-height:0;}"]), props => props.$closeButton && css(["&,&[data-resizing]{overflow:visible;}&[data-resizing] > :not(.c-object-form-modal-close){overflow:hidden;}"]), FontStyle, BoxSizingStyle);
|
|
14
14
|
StyledObjectFormModal.displayName = "StyledObjectFormModal";
|
|
15
15
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","MAX_HEIGHT","StyledObjectFormModalClose","button","withConfig","displayName","componentId","StyledObjectFormModal","div","props","$maxWidth","$fill","$closeButton"],"sources":["../../../../src/components/ObjectFormModal/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\nconst MAX_HEIGHT = \"95vh\";\n\nexport const StyledObjectFormModalClose = styled.button`\n position: absolute;\n top: -1px;\n left: calc(100% + 8px);\n display: flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n padding: 0;\n cursor: pointer;\n background-color: var(--form-modal-surface, var(--color-theme-200));\n border: 1px solid var(--form-modal-border, var(--border-raised));\n box-shadow: var(--form-modal-shadow, var(--shadow-primary));\n border-radius: 24px;\n\n &:hover {\n filter: brightness(1.1);\n }\n\n svg {\n width: 24px;\n height: 24px;\n fill: var(--color-theme-700);\n }\n`;\n\nStyledObjectFormModalClose.displayName = \"StyledObjectFormModalClose\";\n\nexport const StyledObjectFormModal = styled.div<{\n $maxWidth: number;\n $fill: boolean;\n $closeButton: boolean;\n}>`\n flex: 0 0 auto;\n pointer-events: auto;\n position: relative;\n width: 100%;\n max-width: ${(props) => props.$maxWidth}px;\n max-height: ${MAX_HEIGHT};\n padding: 20px;\n overflow-y: auto;\n overscroll-behavior: contain;\n background-color: var(--form-modal-surface, var(--color-theme-200));\n color: var(--color-theme-900);\n border: 1px solid var(--form-modal-border, var(--border-raised));\n box-shadow: var(--form-modal-shadow, var(--shadow-primary));\n border-radius: 24px;\n\n &[data-resizing] {\n overflow: hidden;\n }\n\n ${(props) =>\n props.$fill &&\n css`\n display: flex;\n flex-direction: column;\n\n > :not(.c-object-form-modal-close) {\n min-height: 0;\n }\n `}\n\n /* The close button stands beside the surface, so the content clips in place of the surface. */\n ${(props) =>\n props.$closeButton &&\n css`\n &,\n &[data-resizing] {\n overflow: visible;\n }\n\n &[data-resizing] > :not(.c-object-form-modal-close) {\n overflow: hidden;\n }\n `}\n\n ${FontStyle}\n ${BoxSizingStyle}\n`;\n\nStyledObjectFormModal.displayName = \"StyledObjectFormModal\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAExC,MAAMC,UAAU,GAAG,MAAM;AAEzB,OAAO,MAAMC,0BAA0B,GAAGL,MAAM,CAACM,MAAM,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","MAX_HEIGHT","StyledObjectFormModalClose","button","withConfig","displayName","componentId","StyledObjectFormModal","div","props","$maxWidth","$fill","$closeButton"],"sources":["../../../../src/components/ObjectFormModal/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\nconst MAX_HEIGHT = \"95vh\";\n\nexport const StyledObjectFormModalClose = styled.button`\n position: absolute;\n top: -1px;\n left: calc(100% + 8px);\n display: flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n padding: 0;\n cursor: pointer;\n background-color: var(--form-modal-surface, var(--color-theme-200));\n border: 1px solid var(--form-modal-border, var(--border-raised));\n box-shadow: var(--form-modal-shadow, var(--shadow-primary-simplified));\n border-radius: 24px;\n\n &:hover {\n filter: brightness(1.1);\n }\n\n svg {\n width: 24px;\n height: 24px;\n fill: var(--color-theme-700);\n }\n`;\n\nStyledObjectFormModalClose.displayName = \"StyledObjectFormModalClose\";\n\nexport const StyledObjectFormModal = styled.div<{\n $maxWidth: number;\n $fill: boolean;\n $closeButton: boolean;\n}>`\n flex: 0 0 auto;\n pointer-events: auto;\n position: relative;\n width: 100%;\n max-width: ${(props) => props.$maxWidth}px;\n max-height: ${MAX_HEIGHT};\n padding: 20px;\n overflow-y: auto;\n overscroll-behavior: contain;\n background-color: var(--form-modal-surface, var(--color-theme-200));\n color: var(--color-theme-900);\n border: 1px solid var(--form-modal-border, var(--border-raised));\n box-shadow: var(--form-modal-shadow, var(--shadow-primary-simplified));\n border-radius: 24px;\n\n &[data-resizing] {\n overflow: hidden;\n }\n\n ${(props) =>\n props.$fill &&\n css`\n display: flex;\n flex-direction: column;\n\n > :not(.c-object-form-modal-close) {\n min-height: 0;\n }\n `}\n\n /* The close button stands beside the surface, so the content clips in place of the surface. */\n ${(props) =>\n props.$closeButton &&\n css`\n &,\n &[data-resizing] {\n overflow: visible;\n }\n\n &[data-resizing] > :not(.c-object-form-modal-close) {\n overflow: hidden;\n }\n `}\n\n ${FontStyle}\n ${BoxSizingStyle}\n`;\n\nStyledObjectFormModal.displayName = \"StyledObjectFormModal\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAExC,MAAMC,UAAU,GAAG,MAAM;AAEzB,OAAO,MAAMC,0BAA0B,GAAGL,MAAM,CAACM,MAAM,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,idAyBtD;AAEDJ,0BAA0B,CAACG,WAAW,GAAG,4BAA4B;AAErE,OAAO,MAAME,qBAAqB,GAAGV,MAAM,CAACW,GAAG,CAAAJ,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6cAS/BG,KAAK,IAAKA,KAAK,CAACC,SAAS,EACzBT,UAAU,EAcrBQ,KAAK,IACNA,KAAK,CAACE,KAAK,IACXb,GAAG,0FAOF,EAGAW,KAAK,IACNA,KAAK,CAACG,YAAY,IAClBd,GAAG,gHASF,EAEDE,SAAS,EACTD,cAAc,CACjB;AAEDQ,qBAAqB,CAACF,WAAW,GAAG,uBAAuB","ignoreList":[]}
|
|
@@ -2,10 +2,12 @@ import React, { ComponentPropsWithoutRef, ReactElement, ReactNode } from "react"
|
|
|
2
2
|
export interface PillButtonProps extends ComponentPropsWithoutRef<"button"> {
|
|
3
3
|
/** Icon shown while the pill has no value. */
|
|
4
4
|
icon?: ReactElement;
|
|
5
|
+
/** Icon after the placeholder, for example a caret on a pill that opens a menu. */
|
|
6
|
+
endIcon?: ReactElement;
|
|
5
7
|
/** Label shown next to the icon while the pill has no value. */
|
|
6
8
|
placeholder?: ReactNode;
|
|
7
9
|
/** Fill of the pill. "ghost" stays empty until hover, focus, open, or hover of a `c-pill-host` ancestor. "alert" and "warning" look soft and get their own active look, for example an active flag. "accent" has a soft fill and the text of the primary color, for an action that must stand out. */
|
|
8
|
-
tone?: "soft" | "alternate" | "ghost" | "outlined" | "alert" | "warning" | "accent";
|
|
10
|
+
tone?: "soft" | "alternate" | "ghost" | "outlined" | "alert" | "warning" | "accent" | "raised";
|
|
9
11
|
/** Selected or pressed state. */
|
|
10
12
|
active?: boolean;
|
|
11
13
|
/** A square-ish pill that holds only its icon, for example a close button. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillButton.d.ts","sourceRoot":"","sources":["../../../../src/components/PillButton/PillButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,wBAAwB,EAExB,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AAUf,MAAM,WAAW,eAAgB,SAAQ,wBAAwB,CAAC,QAAQ,CAAC;IACzE,8CAA8C;IAC9C,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,gEAAgE;IAChE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,sSAAsS;IACtS,IAAI,CAAC,EACD,MAAM,GACN,WAAW,GACX,OAAO,GACP,UAAU,GACV,OAAO,GACP,SAAS,GACT,QAAQ,CAAC;IACb,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC7B,gKAAgK;IAChK,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC/C,qFAAqF;IACrF,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,2GAA2G;IAC3G,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"PillButton.d.ts","sourceRoot":"","sources":["../../../../src/components/PillButton/PillButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,wBAAwB,EAExB,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AAUf,MAAM,WAAW,eAAgB,SAAQ,wBAAwB,CAAC,QAAQ,CAAC;IACzE,8CAA8C;IAC9C,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,mFAAmF;IACnF,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,gEAAgE;IAChE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,sSAAsS;IACtS,IAAI,CAAC,EACD,MAAM,GACN,WAAW,GACX,OAAO,GACP,UAAU,GACV,OAAO,GACP,SAAS,GACT,QAAQ,GACR,QAAQ,CAAC;IACb,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC7B,gKAAgK;IAChK,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC/C,qFAAqF;IACrF,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,2GAA2G;IAC3G,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,2FAwEtB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["icon", "placeholder", "tone", "active", "iconOnly", "compact", "size", "inset", "dimDisabled", "type", "className", "children"];
|
|
3
|
+
const _excluded = ["icon", "endIcon", "placeholder", "tone", "active", "iconOnly", "compact", "size", "inset", "dimDisabled", "type", "className", "children"];
|
|
4
4
|
import React, { Children, forwardRef } from "react";
|
|
5
5
|
import classnames from "classnames";
|
|
6
6
|
import { StyledPillButton, StyledPillIcon, StyledPillPlaceholder } from "./Styles";
|
|
@@ -19,6 +19,7 @@ import { StyledPillButton, StyledPillIcon, StyledPillPlaceholder } from "./Style
|
|
|
19
19
|
export const PillButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
20
20
|
var _args$ariaLabel;
|
|
21
21
|
let icon = _ref.icon,
|
|
22
|
+
endIcon = _ref.endIcon,
|
|
22
23
|
placeholder = _ref.placeholder,
|
|
23
24
|
_ref$tone = _ref.tone,
|
|
24
25
|
tone = _ref$tone === void 0 ? "soft" : _ref$tone,
|
|
@@ -63,7 +64,9 @@ export const PillButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
63
64
|
className: "c-pill-button__icon"
|
|
64
65
|
}, icon) : null, isEmpty && placeholder && !iconOnly ? /*#__PURE__*/React.createElement(StyledPillPlaceholder, {
|
|
65
66
|
className: "c-pill-button__placeholder"
|
|
66
|
-
}, placeholder) : null, isEmpty ?
|
|
67
|
+
}, placeholder) : null, isEmpty && endIcon && !iconOnly ? /*#__PURE__*/React.createElement(StyledPillIcon, {
|
|
68
|
+
className: "c-pill-button__end-icon"
|
|
69
|
+
}, endIcon) : null, isEmpty ? null : children);
|
|
67
70
|
});
|
|
68
71
|
PillButton.displayName = "PillButton";
|
|
69
72
|
//# sourceMappingURL=PillButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillButton.js","names":["React","Children","forwardRef","classnames","StyledPillButton","StyledPillIcon","StyledPillPlaceholder","PillButton","_ref","ref","_args$ariaLabel","icon","placeholder","_ref$tone","tone","active","_ref$iconOnly","iconOnly","_ref$compact","compact","_ref$size","size","_ref$inset","inset","_ref$dimDisabled","dimDisabled","_ref$type","type","className","children","args","_objectWithoutPropertiesLoose","_excluded","isEmpty","toArray","length","ariaLabel","undefined","createElement","_extends","$tone","$active","Boolean","$empty","$iconOnly","$compact","$size","$inset","$dimDisabled","displayName"],"sources":["../../../../src/components/PillButton/PillButton.tsx"],"sourcesContent":["import React, {\n Children,\n ComponentPropsWithoutRef,\n forwardRef,\n ReactElement,\n ReactNode,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledPillButton,\n StyledPillIcon,\n StyledPillPlaceholder,\n} from \"./Styles\";\n\nexport interface PillButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n /** Icon shown while the pill has no value. */\n icon?: ReactElement;\n /** Label shown next to the icon while the pill has no value. */\n placeholder?: ReactNode;\n /** Fill of the pill. \"ghost\" stays empty until hover, focus, open, or hover of a `c-pill-host` ancestor. \"alert\" and \"warning\" look soft and get their own active look, for example an active flag. \"accent\" has a soft fill and the text of the primary color, for an action that must stand out. */\n tone?:\n | \"soft\"\n | \"alternate\"\n | \"ghost\"\n | \"outlined\"\n | \"alert\"\n | \"warning\"\n | \"accent\";\n /** Selected or pressed state. */\n active?: boolean;\n /** A square-ish pill that holds only its icon, for example a close button. */\n iconOnly?: boolean;\n /** Hide the placeholder and keep the icon, always or only on small screens. */\n compact?: boolean | \"mobile\";\n /** Height: \"medium\" is 26px, \"small\" is 24px like a small Button, \"dense\" is 24px with 12px text and icon, \"xsmall\" is 18px with 10px text like a type chip. */\n size?: \"xsmall\" | \"small\" | \"dense\" | \"medium\";\n /** Side padding. \"tight\" suits a value that draws to its own edges, like avatars. */\n inset?: \"default\" | \"tight\";\n /** Dims a disabled pill. Set false to keep the full look of a read-only indicator, still with no hover. */\n dimDisabled?: boolean;\n}\n\n/**\n * @component PillButton\n * @description\n * A rounded trigger for a field value, for example the assignees, the dates or the label of a task.\n * With no children it shows its icon and placeholder. With children it shows only the children.\n * It forwards its ref and click handler, so a Menu or a Select can use it as a target.\n * Put several pills in a PillGroup to make a segmented control.\n *\n * @example\n * <PillButton icon={<CalendarIcon />} placeholder=\"Dates\" />\n * <PillButton tone=\"ghost\">Sep 24. - 30.</PillButton>\n */\nexport const PillButton = forwardRef<HTMLButtonElement, PillButtonProps>(\n (\n {\n icon,\n placeholder,\n tone = \"soft\",\n active,\n iconOnly = false,\n compact = false,\n size = \"medium\",\n inset = \"default\",\n dimDisabled = true,\n type = \"button\",\n className,\n children,\n ...args\n },\n ref\n ) => {\n const isEmpty = Children.toArray(children).length === 0;\n const ariaLabel =\n args[\"aria-label\"] ??\n (isEmpty && compact && typeof placeholder === \"string\"\n ? placeholder\n : undefined);\n\n return (\n <StyledPillButton\n ref={ref}\n type={type}\n className={classnames(\n \"c-pill-button\",\n `c-pill-button--${tone}`,\n {\n \"c-pill-button--empty\": isEmpty,\n \"c-pill-button--active\": active,\n \"c-pill-button--icon-only\": iconOnly,\n },\n className\n )}\n aria-pressed={active}\n {...args}\n aria-label={ariaLabel}\n $tone={tone}\n $active={Boolean(active)}\n $empty={isEmpty}\n $iconOnly={iconOnly}\n $compact={compact}\n $size={size}\n $inset={inset}\n $dimDisabled={dimDisabled}\n >\n {isEmpty && icon ? (\n <StyledPillIcon className=\"c-pill-button__icon\">\n {icon}\n </StyledPillIcon>\n ) : null}\n {isEmpty && placeholder && !iconOnly ? (\n <StyledPillPlaceholder className=\"c-pill-button__placeholder\">\n {placeholder}\n </StyledPillPlaceholder>\n ) : null}\n {isEmpty ? null : children}\n </StyledPillButton>\n );\n }\n);\n\nPillButton.displayName = \"PillButton\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IACVC,QAAQ,EAERC,UAAU,QAGL,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,gBAAgB,EAChBC,cAAc,EACdC,qBAAqB,QAChB,UAAU;
|
|
1
|
+
{"version":3,"file":"PillButton.js","names":["React","Children","forwardRef","classnames","StyledPillButton","StyledPillIcon","StyledPillPlaceholder","PillButton","_ref","ref","_args$ariaLabel","icon","endIcon","placeholder","_ref$tone","tone","active","_ref$iconOnly","iconOnly","_ref$compact","compact","_ref$size","size","_ref$inset","inset","_ref$dimDisabled","dimDisabled","_ref$type","type","className","children","args","_objectWithoutPropertiesLoose","_excluded","isEmpty","toArray","length","ariaLabel","undefined","createElement","_extends","$tone","$active","Boolean","$empty","$iconOnly","$compact","$size","$inset","$dimDisabled","displayName"],"sources":["../../../../src/components/PillButton/PillButton.tsx"],"sourcesContent":["import React, {\n Children,\n ComponentPropsWithoutRef,\n forwardRef,\n ReactElement,\n ReactNode,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledPillButton,\n StyledPillIcon,\n StyledPillPlaceholder,\n} from \"./Styles\";\n\nexport interface PillButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n /** Icon shown while the pill has no value. */\n icon?: ReactElement;\n /** Icon after the placeholder, for example a caret on a pill that opens a menu. */\n endIcon?: ReactElement;\n /** Label shown next to the icon while the pill has no value. */\n placeholder?: ReactNode;\n /** Fill of the pill. \"ghost\" stays empty until hover, focus, open, or hover of a `c-pill-host` ancestor. \"alert\" and \"warning\" look soft and get their own active look, for example an active flag. \"accent\" has a soft fill and the text of the primary color, for an action that must stand out. */\n tone?:\n | \"soft\"\n | \"alternate\"\n | \"ghost\"\n | \"outlined\"\n | \"alert\"\n | \"warning\"\n | \"accent\"\n | \"raised\";\n /** Selected or pressed state. */\n active?: boolean;\n /** A square-ish pill that holds only its icon, for example a close button. */\n iconOnly?: boolean;\n /** Hide the placeholder and keep the icon, always or only on small screens. */\n compact?: boolean | \"mobile\";\n /** Height: \"medium\" is 26px, \"small\" is 24px like a small Button, \"dense\" is 24px with 12px text and icon, \"xsmall\" is 18px with 10px text like a type chip. */\n size?: \"xsmall\" | \"small\" | \"dense\" | \"medium\";\n /** Side padding. \"tight\" suits a value that draws to its own edges, like avatars. */\n inset?: \"default\" | \"tight\";\n /** Dims a disabled pill. Set false to keep the full look of a read-only indicator, still with no hover. */\n dimDisabled?: boolean;\n}\n\n/**\n * @component PillButton\n * @description\n * A rounded trigger for a field value, for example the assignees, the dates or the label of a task.\n * With no children it shows its icon and placeholder. With children it shows only the children.\n * It forwards its ref and click handler, so a Menu or a Select can use it as a target.\n * Put several pills in a PillGroup to make a segmented control.\n *\n * @example\n * <PillButton icon={<CalendarIcon />} placeholder=\"Dates\" />\n * <PillButton tone=\"ghost\">Sep 24. - 30.</PillButton>\n */\nexport const PillButton = forwardRef<HTMLButtonElement, PillButtonProps>(\n (\n {\n icon,\n endIcon,\n placeholder,\n tone = \"soft\",\n active,\n iconOnly = false,\n compact = false,\n size = \"medium\",\n inset = \"default\",\n dimDisabled = true,\n type = \"button\",\n className,\n children,\n ...args\n },\n ref\n ) => {\n const isEmpty = Children.toArray(children).length === 0;\n const ariaLabel =\n args[\"aria-label\"] ??\n (isEmpty && compact && typeof placeholder === \"string\"\n ? placeholder\n : undefined);\n\n return (\n <StyledPillButton\n ref={ref}\n type={type}\n className={classnames(\n \"c-pill-button\",\n `c-pill-button--${tone}`,\n {\n \"c-pill-button--empty\": isEmpty,\n \"c-pill-button--active\": active,\n \"c-pill-button--icon-only\": iconOnly,\n },\n className\n )}\n aria-pressed={active}\n {...args}\n aria-label={ariaLabel}\n $tone={tone}\n $active={Boolean(active)}\n $empty={isEmpty}\n $iconOnly={iconOnly}\n $compact={compact}\n $size={size}\n $inset={inset}\n $dimDisabled={dimDisabled}\n >\n {isEmpty && icon ? (\n <StyledPillIcon className=\"c-pill-button__icon\">\n {icon}\n </StyledPillIcon>\n ) : null}\n {isEmpty && placeholder && !iconOnly ? (\n <StyledPillPlaceholder className=\"c-pill-button__placeholder\">\n {placeholder}\n </StyledPillPlaceholder>\n ) : null}\n {isEmpty && endIcon && !iconOnly ? (\n <StyledPillIcon className=\"c-pill-button__end-icon\">\n {endIcon}\n </StyledPillIcon>\n ) : null}\n {isEmpty ? null : children}\n </StyledPillButton>\n );\n }\n);\n\nPillButton.displayName = \"PillButton\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IACVC,QAAQ,EAERC,UAAU,QAGL,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,gBAAgB,EAChBC,cAAc,EACdC,qBAAqB,QAChB,UAAU;AAiCjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,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ot":"","sources":["../../../../src/components/PillButton/Styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,UAAU,qBAAqB;IAC7B,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,cAAc,qEAU1B,CAAC;AAIF,eAAO,MAAM,qBAAqB,qEAGjC,CAAC;
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/PillButton/Styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,UAAU,qBAAqB;IAC7B,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,cAAc,qEAU1B,CAAC;AAIF,eAAO,MAAM,qBAAqB,qEAGjC,CAAC;AAqMF,eAAO,MAAM,gBAAgB,0FAgG5B,CAAC"}
|
|
@@ -24,6 +24,8 @@ const toneStyle = tone => {
|
|
|
24
24
|
return css(["background-color:var(--color-theme-300);&:hover,&:focus-visible{background-color:var(--color-theme-400);", "}"], hoverTextStyle);
|
|
25
25
|
case "accent":
|
|
26
26
|
return css(["background-color:color-mix( in srgb,var(--color-primary) 15%,transparent );color:var(--color-primary);", "{color:var(--color-primary);}&:hover,&:focus-visible{background-color:color-mix( in srgb,var(--color-primary) 25%,transparent );color:var(--color-primary);}"], StyledPillIcon);
|
|
27
|
+
case "raised":
|
|
28
|
+
return css(["&&{gap:6px;font-weight:600;}border:1px solid var(--color-theme-400);background-color:var(--color-theme-200);box-shadow:inset 0 1px 0 rgba(255,255,255,0.07);color:var(--color-theme-900);", "{color:inherit;}@supports (color:light-dark(red,red)){border-color:light-dark(var(--color-theme-400),#494e59);background-color:transparent;background-image:linear-gradient( light-dark(#ffffff,#3a3f49),light-dark(#f3f4f6,#31353e) );color:light-dark(var(--color-theme-900),#eceef1);&:hover{background-image:linear-gradient( light-dark(#f8f9fa,#444a55),light-dark(#eceef1,#3a3f49) );}}&:focus-visible{outline:2px solid var(--color-primary);outline-offset:1px;}&[aria-expanded=\"true\"]{background-image:none;}"], StyledPillIcon);
|
|
27
29
|
case "ghost":
|
|
28
30
|
return css(["background-color:transparent;.c-pill-host:hover &.c-pill-button--ghost,&:focus-visible{background-color:var(--pill-background);}.c-pill-host:hover &.c-pill-button--ghost:hover,&:hover{background-color:var(--pill-background-hover);", "}"], hoverTextStyle);
|
|
29
31
|
case "outlined":
|
|
@@ -46,6 +48,6 @@ const xsmallStyle = css(["gap:3px;--c-pill-padding-x:6px;font-size:calc(0.625rem
|
|
|
46
48
|
export const StyledPillButton = styled.button.withConfig({
|
|
47
49
|
displayName: "Styles__StyledPillButton",
|
|
48
50
|
componentId: "sc-14yhio0-2"
|
|
49
|
-
})(["", " ", " display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;max-width:100%;height:", ";margin:0;--c-pill-padding-x:", ";padding:0 var(--c-pill-padding-x);border:none;border-radius:var(--ac-br-rounded);font-size:calc(0.875rem * var(--text-scale,1));font-weight:500;line-height:1;white-space:nowrap;color:", ";cursor:pointer;user-select:none;&:focus{outline:none;}&:disabled{cursor:default;opacity:", ";pointer-events:none;}", " ", " ", " ", " ", " ", " ", " ", " &[aria-haspopup][aria-expanded=\"true\"],.c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"]{", "}"], FontStyle, BoxSizingStyle, props => PILL_HEIGHTS[props.$size], props => props.$inset === "tight" ? "6px" : "10px", props => props.$empty ? "var(--color-theme-700)" : "var(--color-theme-800)", props => props.$dimDisabled ? "50%" : "100%", props => toneStyle(props.$tone), props => props.$tone === "ghost" && props.$empty && css(["", ",", "{opacity:0;}.c-pill-host:hover &.c-pill-button--ghost,&:hover,&:focus-visible,&[aria-expanded=\"true\"]{", ",", "{opacity:1;}}"], StyledPillIcon, StyledPillPlaceholder, StyledPillIcon, StyledPillPlaceholder), props => props.$iconOnly && css(["width:
|
|
51
|
+
})(["", " ", " display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;max-width:100%;height:", ";margin:0;--c-pill-padding-x:", ";padding:0 var(--c-pill-padding-x);border:none;border-radius:var(--ac-br-rounded);font-size:calc(0.875rem * var(--text-scale,1));font-weight:500;line-height:1;white-space:nowrap;color:", ";cursor:pointer;user-select:none;&:focus{outline:none;}&:disabled{cursor:default;opacity:", ";pointer-events:none;}", " ", " ", " ", " ", " ", " ", " ", " &[aria-haspopup][aria-expanded=\"true\"],.c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"]{", "}"], FontStyle, BoxSizingStyle, props => PILL_HEIGHTS[props.$size], props => props.$inset === "tight" ? "6px" : "10px", props => props.$empty ? "var(--color-theme-700)" : "var(--color-theme-800)", props => props.$dimDisabled ? "50%" : "100%", props => toneStyle(props.$tone), props => props.$tone === "ghost" && props.$empty && css(["", ",", "{opacity:0;}.c-pill-host:hover &.c-pill-button--ghost,&:hover,&:focus-visible,&[aria-expanded=\"true\"]{", ",", "{opacity:1;}}"], StyledPillIcon, StyledPillPlaceholder, StyledPillIcon, StyledPillPlaceholder), props => props.$iconOnly && css(["width:", ";padding:0;", " svg{width:16px;height:16px;}"], props.$tone === "raised" ? "28px" : "36px", StyledPillIcon), props => props.$size === "xsmall" && xsmallStyle, props => props.$size === "dense" && denseStyle, props => props.$compact === true && compactStyle, props => props.$compact === "mobile" && css(["@media (max-width:768px){", "}"], compactStyle), props => props.$active && css(["&,&:hover,&:focus-visible{", "}"], activeStyle(props.$tone)), props => activeStyle(props.$tone));
|
|
50
52
|
StyledPillButton.displayName = "StyledPillButton";
|
|
51
53
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","StyledPillIcon","span","withConfig","displayName","componentId","StyledPillPlaceholder","ACTIVE_COLORS","alert","warning","activeColors","tone","activeStyle","hoverTextStyle","toneStyle","compactStyle","PILL_HEIGHTS","xsmall","small","dense","medium","denseStyle","xsmallStyle","StyledPillButton","button","props","$size","$inset","$empty","$dimDisabled","$tone","$iconOnly","$compact","$active"],"sources":["../../../../src/components/PillButton/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { PillButtonProps } from \"./PillButton\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\ninterface StyledPillButtonProps {\n $tone: NonNullable<PillButtonProps[\"tone\"]>;\n $active: boolean;\n $empty: boolean;\n $iconOnly: boolean;\n $compact: PillButtonProps[\"compact\"];\n $size: NonNullable<PillButtonProps[\"size\"]>;\n $inset: NonNullable<PillButtonProps[\"inset\"]>;\n $dimDisabled: boolean;\n}\n\nexport const StyledPillIcon = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n color: var(--color-theme-600);\n\n svg {\n width: 18px;\n height: 18px;\n fill: currentColor;\n }\n`;\n\nStyledPillIcon.displayName = \"StyledPillIcon\";\n\nexport const StyledPillPlaceholder = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nStyledPillPlaceholder.displayName = \"StyledPillPlaceholder\";\n\nconst ACTIVE_COLORS = {\n alert: [\"var(--alert-surface-subtle)\", \"var(--red-alert)\"],\n warning: [\"var(--note-bg)\", \"var(--warning-text)\"],\n};\n\nconst activeColors = (tone: StyledPillButtonProps[\"$tone\"]) =>\n tone === \"alert\" || tone === \"warning\"\n ? ACTIVE_COLORS[tone]\n : [\"var(--pill-background-active)\", \"var(--color-primary)\"];\n\nconst activeStyle = (tone: StyledPillButtonProps[\"$tone\"]) => css`\n background-color: ${activeColors(tone)[0]};\n color: ${activeColors(tone)[1]};\n\n ${StyledPillIcon} {\n color: ${activeColors(tone)[1]};\n }\n\n /* An icon in the value takes the color of the text too, its outline as well. */\n svg {\n fill: currentColor;\n }\n\n svg [stroke]:not([stroke=\"none\"]) {\n stroke: currentColor;\n }\n`;\n\nconst hoverTextStyle = css`\n color: var(--color-theme-900);\n\n ${StyledPillIcon} {\n color: var(--color-theme-900);\n }\n`;\n\nconst toneStyle = (tone: StyledPillButtonProps[\"$tone\"]) => {\n switch (tone) {\n case \"alternate\":\n return css`\n background-color: var(--color-theme-300);\n\n &:hover,\n &:focus-visible {\n background-color: var(--color-theme-400);\n ${hoverTextStyle}\n }\n `;\n case \"accent\":\n return css`\n background-color: color-mix(\n in srgb,\n var(--color-primary) 15%,\n transparent\n );\n color: var(--color-primary);\n\n ${StyledPillIcon} {\n color: var(--color-primary);\n }\n\n &:hover,\n &:focus-visible {\n background-color: color-mix(\n in srgb,\n var(--color-primary) 25%,\n transparent\n );\n color: var(--color-primary);\n }\n `;\n case \"ghost\":\n return css`\n background-color: transparent;\n\n .c-pill-host:hover &.c-pill-button--ghost,\n &:focus-visible {\n background-color: var(--pill-background);\n }\n\n .c-pill-host:hover &.c-pill-button--ghost:hover,\n &:hover {\n background-color: var(--pill-background-hover);\n ${hoverTextStyle}\n }\n `;\n case \"outlined\":\n return css`\n background-color: transparent;\n border: 1px solid var(--color-theme-700);\n\n &:hover,\n &:focus-visible {\n border-color: var(--color-primary);\n color: var(--color-primary);\n\n ${StyledPillIcon} {\n color: var(--color-primary);\n }\n }\n `;\n default:\n return css`\n background-color: var(--pill-background);\n\n &:hover,\n &:focus-visible {\n background-color: var(--pill-background-hover);\n ${hoverTextStyle}\n }\n `;\n }\n};\n\nconst compactStyle = css`\n ${StyledPillPlaceholder} {\n display: none;\n }\n`;\n\nconst PILL_HEIGHTS = {\n xsmall: \"18px\",\n small: \"24px\",\n dense: \"24px\",\n medium: \"26px\",\n};\n\nconst denseStyle = css`\n gap: 4px;\n --c-pill-padding-x: 11px;\n font-size: calc(0.75rem * var(--text-scale, 1));\n\n ${StyledPillIcon} svg {\n width: 12px;\n height: 12px;\n }\n`;\n\n/* The size of a type chip: small caps of an object type or a state switch. */\nconst xsmallStyle = css`\n gap: 3px;\n --c-pill-padding-x: 6px;\n font-size: calc(0.625rem * var(--text-scale, 1));\n font-weight: 600;\n\n ${StyledPillIcon} svg {\n width: 12px;\n height: 12px;\n }\n`;\n\nexport const StyledPillButton = styled.button<StyledPillButtonProps>`\n ${FontStyle}\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n flex-shrink: 0;\n max-width: 100%;\n height: ${(props) => PILL_HEIGHTS[props.$size]};\n margin: 0;\n --c-pill-padding-x: ${(props) => (props.$inset === \"tight\" ? \"6px\" : \"10px\")};\n padding: 0 var(--c-pill-padding-x);\n border: none;\n border-radius: var(--ac-br-rounded);\n font-size: calc(0.875rem * var(--text-scale, 1));\n font-weight: 500;\n line-height: 1;\n white-space: nowrap;\n color: ${(props) =>\n props.$empty ? \"var(--color-theme-700)\" : \"var(--color-theme-800)\"};\n cursor: pointer;\n user-select: none;\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: ${(props) => (props.$dimDisabled ? \"50%\" : \"100%\")};\n pointer-events: none;\n }\n\n ${(props) => toneStyle(props.$tone)}\n\n ${(props) =>\n props.$tone === \"ghost\" &&\n props.$empty &&\n css`\n ${StyledPillIcon}, ${StyledPillPlaceholder} {\n opacity: 0;\n }\n\n .c-pill-host:hover &.c-pill-button--ghost,\n &:hover,\n &:focus-visible,\n &[aria-expanded=\"true\"] {\n ${StyledPillIcon}, ${StyledPillPlaceholder} {\n opacity: 1;\n }\n }\n `}\n\n ${(props) =>\n props.$iconOnly &&\n css`\n width: 36px;\n padding: 0;\n\n ${StyledPillIcon} svg {\n width: 16px;\n height: 16px;\n }\n `}\n\n ${(props) => props.$size === \"xsmall\" && xsmallStyle}\n\n ${(props) => props.$size === \"dense\" && denseStyle}\n\n ${(props) => props.$compact === true && compactStyle}\n\n ${(props) =>\n props.$compact === \"mobile\" &&\n css`\n @media (max-width: 768px) {\n ${compactStyle}\n }\n `}\n\n /* An active pill keeps its look on hover and focus. */\n ${(props) =>\n props.$active &&\n css`\n &,\n &:hover,\n &:focus-visible {\n ${activeStyle(props.$tone)}\n }\n `}\n\n /* Last, so an open trigger shows the active look in every tone. */\n &[aria-haspopup][aria-expanded=\"true\"],\n .c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"] {\n ${(props) => activeStyle(props.$tone)}\n }\n`;\n\nStyledPillButton.displayName = \"StyledPillButton\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAaxC,OAAO,MAAMC,cAAc,GAAGJ,MAAM,CAACK,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qHAUxC;AAEDJ,cAAc,CAACG,WAAW,GAAG,gBAAgB;AAE7C,OAAO,MAAME,qBAAqB,GAAGT,MAAM,CAACK,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,+CAG/C;AAEDC,qBAAq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yle","FontStyle","StyledPillIcon","span","withConfig","displayName","componentId","StyledPillPlaceholder","ACTIVE_COLORS","alert","warning","activeColors","tone","activeStyle","hoverTextStyle","toneStyle","compactStyle","PILL_HEIGHTS","xsmall","small","dense","medium","denseStyle","xsmallStyle","StyledPillButton","button","props","$size","$inset","$empty","$dimDisabled","$tone","$iconOnly","$compact","$active"],"sources":["../../../../src/components/PillButton/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { PillButtonProps } from \"./PillButton\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\ninterface StyledPillButtonProps {\n $tone: NonNullable<PillButtonProps[\"tone\"]>;\n $active: boolean;\n $empty: boolean;\n $iconOnly: boolean;\n $compact: PillButtonProps[\"compact\"];\n $size: NonNullable<PillButtonProps[\"size\"]>;\n $inset: NonNullable<PillButtonProps[\"inset\"]>;\n $dimDisabled: boolean;\n}\n\nexport const StyledPillIcon = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n color: var(--color-theme-600);\n\n svg {\n width: 18px;\n height: 18px;\n fill: currentColor;\n }\n`;\n\nStyledPillIcon.displayName = \"StyledPillIcon\";\n\nexport const StyledPillPlaceholder = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nStyledPillPlaceholder.displayName = \"StyledPillPlaceholder\";\n\nconst ACTIVE_COLORS = {\n alert: [\"var(--alert-surface-subtle)\", \"var(--red-alert)\"],\n warning: [\"var(--note-bg)\", \"var(--warning-text)\"],\n};\n\nconst activeColors = (tone: StyledPillButtonProps[\"$tone\"]) =>\n tone === \"alert\" || tone === \"warning\"\n ? ACTIVE_COLORS[tone]\n : [\"var(--pill-background-active)\", \"var(--color-primary)\"];\n\nconst activeStyle = (tone: StyledPillButtonProps[\"$tone\"]) => css`\n background-color: ${activeColors(tone)[0]};\n color: ${activeColors(tone)[1]};\n\n ${StyledPillIcon} {\n color: ${activeColors(tone)[1]};\n }\n\n /* An icon in the value takes the color of the text too, its outline as well. */\n svg {\n fill: currentColor;\n }\n\n svg [stroke]:not([stroke=\"none\"]) {\n stroke: currentColor;\n }\n`;\n\nconst hoverTextStyle = css`\n color: var(--color-theme-900);\n\n ${StyledPillIcon} {\n color: var(--color-theme-900);\n }\n`;\n\nconst toneStyle = (tone: StyledPillButtonProps[\"$tone\"]) => {\n switch (tone) {\n case \"alternate\":\n return css`\n background-color: var(--color-theme-300);\n\n &:hover,\n &:focus-visible {\n background-color: var(--color-theme-400);\n ${hoverTextStyle}\n }\n `;\n case \"accent\":\n return css`\n background-color: color-mix(\n in srgb,\n var(--color-primary) 15%,\n transparent\n );\n color: var(--color-primary);\n\n ${StyledPillIcon} {\n color: var(--color-primary);\n }\n\n &:hover,\n &:focus-visible {\n background-color: color-mix(\n in srgb,\n var(--color-primary) 25%,\n transparent\n );\n color: var(--color-primary);\n }\n `;\n case \"raised\":\n return css`\n && {\n gap: 6px;\n font-weight: 600;\n }\n\n border: 1px solid var(--color-theme-400);\n background-color: var(--color-theme-200);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);\n color: var(--color-theme-900);\n\n ${StyledPillIcon} {\n color: inherit;\n }\n\n @supports (color: light-dark(red, red)) {\n border-color: light-dark(var(--color-theme-400), #494e59);\n background-color: transparent;\n background-image: linear-gradient(\n light-dark(#ffffff, #3a3f49),\n light-dark(#f3f4f6, #31353e)\n );\n color: light-dark(var(--color-theme-900), #eceef1);\n\n &:hover {\n background-image: linear-gradient(\n light-dark(#f8f9fa, #444a55),\n light-dark(#eceef1, #3a3f49)\n );\n }\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n outline-offset: 1px;\n }\n\n &[aria-expanded=\"true\"] {\n background-image: none;\n }\n `;\n case \"ghost\":\n return css`\n background-color: transparent;\n\n .c-pill-host:hover &.c-pill-button--ghost,\n &:focus-visible {\n background-color: var(--pill-background);\n }\n\n .c-pill-host:hover &.c-pill-button--ghost:hover,\n &:hover {\n background-color: var(--pill-background-hover);\n ${hoverTextStyle}\n }\n `;\n case \"outlined\":\n return css`\n background-color: transparent;\n border: 1px solid var(--color-theme-700);\n\n &:hover,\n &:focus-visible {\n border-color: var(--color-primary);\n color: var(--color-primary);\n\n ${StyledPillIcon} {\n color: var(--color-primary);\n }\n }\n `;\n default:\n return css`\n background-color: var(--pill-background);\n\n &:hover,\n &:focus-visible {\n background-color: var(--pill-background-hover);\n ${hoverTextStyle}\n }\n `;\n }\n};\n\nconst compactStyle = css`\n ${StyledPillPlaceholder} {\n display: none;\n }\n`;\n\nconst PILL_HEIGHTS = {\n xsmall: \"18px\",\n small: \"24px\",\n dense: \"24px\",\n medium: \"26px\",\n};\n\nconst denseStyle = css`\n gap: 4px;\n --c-pill-padding-x: 11px;\n font-size: calc(0.75rem * var(--text-scale, 1));\n\n ${StyledPillIcon} svg {\n width: 12px;\n height: 12px;\n }\n`;\n\n/* The size of a type chip: small caps of an object type or a state switch. */\nconst xsmallStyle = css`\n gap: 3px;\n --c-pill-padding-x: 6px;\n font-size: calc(0.625rem * var(--text-scale, 1));\n font-weight: 600;\n\n ${StyledPillIcon} svg {\n width: 12px;\n height: 12px;\n }\n`;\n\nexport const StyledPillButton = styled.button<StyledPillButtonProps>`\n ${FontStyle}\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n flex-shrink: 0;\n max-width: 100%;\n height: ${(props) => PILL_HEIGHTS[props.$size]};\n margin: 0;\n --c-pill-padding-x: ${(props) => (props.$inset === \"tight\" ? \"6px\" : \"10px\")};\n padding: 0 var(--c-pill-padding-x);\n border: none;\n border-radius: var(--ac-br-rounded);\n font-size: calc(0.875rem * var(--text-scale, 1));\n font-weight: 500;\n line-height: 1;\n white-space: nowrap;\n color: ${(props) =>\n props.$empty ? \"var(--color-theme-700)\" : \"var(--color-theme-800)\"};\n cursor: pointer;\n user-select: none;\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: ${(props) => (props.$dimDisabled ? \"50%\" : \"100%\")};\n pointer-events: none;\n }\n\n ${(props) => toneStyle(props.$tone)}\n\n ${(props) =>\n props.$tone === \"ghost\" &&\n props.$empty &&\n css`\n ${StyledPillIcon}, ${StyledPillPlaceholder} {\n opacity: 0;\n }\n\n .c-pill-host:hover &.c-pill-button--ghost,\n &:hover,\n &:focus-visible,\n &[aria-expanded=\"true\"] {\n ${StyledPillIcon}, ${StyledPillPlaceholder} {\n opacity: 1;\n }\n }\n `}\n\n ${(props) =>\n props.$iconOnly &&\n css`\n width: ${props.$tone === \"raised\" ? \"28px\" : \"36px\"};\n padding: 0;\n\n ${StyledPillIcon} svg {\n width: 16px;\n height: 16px;\n }\n `}\n\n ${(props) => props.$size === \"xsmall\" && xsmallStyle}\n\n ${(props) => props.$size === \"dense\" && denseStyle}\n\n ${(props) => props.$compact === true && compactStyle}\n\n ${(props) =>\n props.$compact === \"mobile\" &&\n css`\n @media (max-width: 768px) {\n ${compactStyle}\n }\n `}\n\n /* An active pill keeps its look on hover and focus. */\n ${(props) =>\n props.$active &&\n css`\n &,\n &:hover,\n &:focus-visible {\n ${activeStyle(props.$tone)}\n }\n `}\n\n /* Last, so an open trigger shows the active look in every tone. */\n &[aria-haspopup][aria-expanded=\"true\"],\n .c-pill-host:hover &[aria-haspopup][aria-expanded=\"true\"] {\n ${(props) => activeStyle(props.$tone)}\n }\n`;\n\nStyledPillButton.displayName = \"StyledPillButton\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAaxC,OAAO,MAAMC,cAAc,GAAGJ,MAAM,CAACK,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qHAUxC;AAEDJ,cAAc,CAACG,WAAW,GAAG,gBAAgB;AAE7C,OAAO,MAAME,qBAAqB,GAAGT,MAAM,CAACK,IAAI,CAAAC,UAAA;EAAAC,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