@activecollab/components 2.0.568 → 2.0.570

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/cjs/components/Chip/ChipGroupStyles.js +1 -1
  2. package/dist/cjs/components/Chip/ChipGroupStyles.js.map +1 -1
  3. package/dist/cjs/components/Chip/Styles.js +2 -2
  4. package/dist/cjs/components/Chip/Styles.js.map +1 -1
  5. package/dist/cjs/components/ListSection/Styles.js +1 -1
  6. package/dist/cjs/components/ListSection/Styles.js.map +1 -1
  7. package/dist/cjs/components/MainMenu/MainMenu.js +0 -22
  8. package/dist/cjs/components/MainMenu/MainMenu.js.map +1 -1
  9. package/dist/cjs/components/Menu/Menu.js +3 -0
  10. package/dist/cjs/components/Menu/Menu.js.map +1 -1
  11. package/dist/cjs/components/NoteCard/NoteCard.js +23 -18
  12. package/dist/cjs/components/NoteCard/NoteCard.js.map +1 -1
  13. package/dist/cjs/components/NoteCard/Styles.js +62 -49
  14. package/dist/cjs/components/NoteCard/Styles.js.map +1 -1
  15. package/dist/cjs/components/NotebookCard/NotebookCard.js +45 -0
  16. package/dist/cjs/components/NotebookCard/NotebookCard.js.map +1 -0
  17. package/dist/cjs/components/NotebookCard/Styles.js +49 -0
  18. package/dist/cjs/components/NotebookCard/Styles.js.map +1 -0
  19. package/dist/cjs/components/NotebookCard/index.js +17 -0
  20. package/dist/cjs/components/NotebookCard/index.js.map +1 -0
  21. package/dist/cjs/components/PillButton/PillButton.js.map +1 -1
  22. package/dist/cjs/components/PillButton/Styles.js +5 -1
  23. package/dist/cjs/components/PillButton/Styles.js.map +1 -1
  24. package/dist/cjs/components/Popper/Popper.js +18 -1
  25. package/dist/cjs/components/Popper/Popper.js.map +1 -1
  26. package/dist/cjs/components/PropertyList/PropertyListPopover.js +3 -0
  27. package/dist/cjs/components/PropertyList/PropertyListPopover.js.map +1 -1
  28. package/dist/cjs/components/Select/Select.js +4 -2
  29. package/dist/cjs/components/Select/Select.js.map +1 -1
  30. package/dist/cjs/components/ViewSwitcher/Styles.js +22 -18
  31. package/dist/cjs/components/ViewSwitcher/Styles.js.map +1 -1
  32. package/dist/cjs/components/ViewSwitcher/ViewSwitcher.js +131 -144
  33. package/dist/cjs/components/ViewSwitcher/ViewSwitcher.js.map +1 -1
  34. package/dist/cjs/components/ViewSwitcher/index.js +0 -11
  35. package/dist/cjs/components/ViewSwitcher/index.js.map +1 -1
  36. package/dist/cjs/components/index.js +12 -0
  37. package/dist/cjs/components/index.js.map +1 -1
  38. package/dist/cjs/presentation/invoicing/invoiceObjectList.js +2 -4
  39. package/dist/cjs/presentation/invoicing/invoiceObjectList.js.map +1 -1
  40. package/dist/cjs/presentation/shared/ActivityFeed.js +2 -4
  41. package/dist/cjs/presentation/shared/ActivityFeed.js.map +1 -1
  42. package/dist/cjs/presentation/shared/PageViewSwitcher.js +5 -10
  43. package/dist/cjs/presentation/shared/PageViewSwitcher.js.map +1 -1
  44. package/dist/cjs/presentation/shared/TaskListSettingsDialog.js +3 -2
  45. package/dist/cjs/presentation/shared/TaskListSettingsDialog.js.map +1 -1
  46. package/dist/cjs/presentation/shared/headers.js +4 -8
  47. package/dist/cjs/presentation/shared/headers.js.map +1 -1
  48. package/dist/cjs/presentation/shared/systemSettingsDialog.js +13 -8
  49. package/dist/cjs/presentation/shared/systemSettingsDialog.js.map +1 -1
  50. package/dist/esm/components/Chip/ChipGroupStyles.js +2 -2
  51. package/dist/esm/components/Chip/ChipGroupStyles.js.map +1 -1
  52. package/dist/esm/components/Chip/Styles.d.ts +5 -0
  53. package/dist/esm/components/Chip/Styles.d.ts.map +1 -1
  54. package/dist/esm/components/Chip/Styles.js +1 -1
  55. package/dist/esm/components/Chip/Styles.js.map +1 -1
  56. package/dist/esm/components/ListSection/Styles.js +1 -1
  57. package/dist/esm/components/ListSection/Styles.js.map +1 -1
  58. package/dist/esm/components/MainMenu/MainMenu.d.ts.map +1 -1
  59. package/dist/esm/components/MainMenu/MainMenu.js +0 -20
  60. package/dist/esm/components/MainMenu/MainMenu.js.map +1 -1
  61. package/dist/esm/components/Menu/Menu.d.ts +2 -0
  62. package/dist/esm/components/Menu/Menu.d.ts.map +1 -1
  63. package/dist/esm/components/Menu/Menu.js +3 -0
  64. package/dist/esm/components/Menu/Menu.js.map +1 -1
  65. package/dist/esm/components/NoteCard/NoteCard.d.ts +13 -7
  66. package/dist/esm/components/NoteCard/NoteCard.d.ts.map +1 -1
  67. package/dist/esm/components/NoteCard/NoteCard.js +24 -19
  68. package/dist/esm/components/NoteCard/NoteCard.js.map +1 -1
  69. package/dist/esm/components/NoteCard/Styles.d.ts +7 -6
  70. package/dist/esm/components/NoteCard/Styles.d.ts.map +1 -1
  71. package/dist/esm/components/NoteCard/Styles.js +59 -48
  72. package/dist/esm/components/NoteCard/Styles.js.map +1 -1
  73. package/dist/esm/components/NotebookCard/NotebookCard.d.ts +21 -0
  74. package/dist/esm/components/NotebookCard/NotebookCard.d.ts.map +1 -0
  75. package/dist/esm/components/NotebookCard/NotebookCard.js +35 -0
  76. package/dist/esm/components/NotebookCard/NotebookCard.js.map +1 -0
  77. package/dist/esm/components/NotebookCard/Styles.d.ts +11 -0
  78. package/dist/esm/components/NotebookCard/Styles.d.ts.map +1 -0
  79. package/dist/esm/components/NotebookCard/Styles.js +42 -0
  80. package/dist/esm/components/NotebookCard/Styles.js.map +1 -0
  81. package/dist/esm/components/NotebookCard/index.d.ts +2 -0
  82. package/dist/esm/components/NotebookCard/index.d.ts.map +1 -0
  83. package/dist/esm/components/NotebookCard/index.js +2 -0
  84. package/dist/esm/components/NotebookCard/index.js.map +1 -0
  85. package/dist/esm/components/PillButton/PillButton.d.ts +2 -2
  86. package/dist/esm/components/PillButton/PillButton.d.ts.map +1 -1
  87. package/dist/esm/components/PillButton/PillButton.js.map +1 -1
  88. package/dist/esm/components/PillButton/Styles.d.ts.map +1 -1
  89. package/dist/esm/components/PillButton/Styles.js +3 -1
  90. package/dist/esm/components/PillButton/Styles.js.map +1 -1
  91. package/dist/esm/components/Popper/Popper.d.ts +2 -0
  92. package/dist/esm/components/Popper/Popper.d.ts.map +1 -1
  93. package/dist/esm/components/Popper/Popper.js +16 -1
  94. package/dist/esm/components/Popper/Popper.js.map +1 -1
  95. package/dist/esm/components/PropertyList/PropertyListPopover.d.ts +3 -1
  96. package/dist/esm/components/PropertyList/PropertyListPopover.d.ts.map +1 -1
  97. package/dist/esm/components/PropertyList/PropertyListPopover.js +3 -0
  98. package/dist/esm/components/PropertyList/PropertyListPopover.js.map +1 -1
  99. package/dist/esm/components/Select/Select.d.ts +2 -0
  100. package/dist/esm/components/Select/Select.d.ts.map +1 -1
  101. package/dist/esm/components/Select/Select.js +4 -2
  102. package/dist/esm/components/Select/Select.js.map +1 -1
  103. package/dist/esm/components/ViewSwitcher/Styles.d.ts +6 -3
  104. package/dist/esm/components/ViewSwitcher/Styles.d.ts.map +1 -1
  105. package/dist/esm/components/ViewSwitcher/Styles.js +20 -16
  106. package/dist/esm/components/ViewSwitcher/Styles.js.map +1 -1
  107. package/dist/esm/components/ViewSwitcher/ViewSwitcher.d.ts +9 -12
  108. package/dist/esm/components/ViewSwitcher/ViewSwitcher.d.ts.map +1 -1
  109. package/dist/esm/components/ViewSwitcher/ViewSwitcher.js +124 -139
  110. package/dist/esm/components/ViewSwitcher/ViewSwitcher.js.map +1 -1
  111. package/dist/esm/components/ViewSwitcher/index.d.ts +0 -1
  112. package/dist/esm/components/ViewSwitcher/index.d.ts.map +1 -1
  113. package/dist/esm/components/ViewSwitcher/index.js +0 -1
  114. package/dist/esm/components/ViewSwitcher/index.js.map +1 -1
  115. package/dist/esm/components/index.d.ts +1 -0
  116. package/dist/esm/components/index.d.ts.map +1 -1
  117. package/dist/esm/components/index.js +1 -0
  118. package/dist/esm/components/index.js.map +1 -1
  119. package/dist/esm/presentation/invoicing/invoiceObjectList.d.ts.map +1 -1
  120. package/dist/esm/presentation/invoicing/invoiceObjectList.js +2 -4
  121. package/dist/esm/presentation/invoicing/invoiceObjectList.js.map +1 -1
  122. package/dist/esm/presentation/shared/ActivityFeed.d.ts.map +1 -1
  123. package/dist/esm/presentation/shared/ActivityFeed.js +2 -4
  124. package/dist/esm/presentation/shared/ActivityFeed.js.map +1 -1
  125. package/dist/esm/presentation/shared/PageViewSwitcher.d.ts.map +1 -1
  126. package/dist/esm/presentation/shared/PageViewSwitcher.js +5 -10
  127. package/dist/esm/presentation/shared/PageViewSwitcher.js.map +1 -1
  128. package/dist/esm/presentation/shared/TaskListSettingsDialog.d.ts.map +1 -1
  129. package/dist/esm/presentation/shared/TaskListSettingsDialog.js +3 -2
  130. package/dist/esm/presentation/shared/TaskListSettingsDialog.js.map +1 -1
  131. package/dist/esm/presentation/shared/headers.d.ts.map +1 -1
  132. package/dist/esm/presentation/shared/headers.js +4 -8
  133. package/dist/esm/presentation/shared/headers.js.map +1 -1
  134. package/dist/esm/presentation/shared/systemSettingsDialog.d.ts +22 -1
  135. package/dist/esm/presentation/shared/systemSettingsDialog.d.ts.map +1 -1
  136. package/dist/esm/presentation/shared/systemSettingsDialog.js +12 -7
  137. package/dist/esm/presentation/shared/systemSettingsDialog.js.map +1 -1
  138. package/dist/index.js +469 -493
  139. package/dist/index.js.map +1 -1
  140. package/dist/index.min.js +1 -1
  141. package/dist/index.min.js.map +1 -1
  142. package/package.json +1 -1
  143. package/dist/cjs/components/ViewSwitcher/ViewIllustration.js +0 -127
  144. package/dist/cjs/components/ViewSwitcher/ViewIllustration.js.map +0 -1
  145. package/dist/esm/components/ViewSwitcher/ViewIllustration.d.ts +0 -20
  146. package/dist/esm/components/ViewSwitcher/ViewIllustration.d.ts.map +0 -1
  147. package/dist/esm/components/ViewSwitcher/ViewIllustration.js +0 -91
  148. package/dist/esm/components/ViewSwitcher/ViewIllustration.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Styles.js","names":["styled","BoxSizingStyle","List","StyledViewSwitcher","div","withConfig","displayName","componentId","StyledViewSwitcherTrack","StyledViewSwitcherOption","button","StyledViewSwitcherMenuOption","StyledViewSwitcherMenuIcon","span","StyledViewSwitcherMenuList","StyledViewSwitcherMenuLabel","StyledViewSwitcherPreview","StyledViewSwitcherThumbnail","StyledViewSwitcherOffer"],"sources":["../../../../src/components/ViewSwitcher/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { List } from \"../List\";\n\nexport const StyledViewSwitcher = styled.div`\n ${BoxSizingStyle}\n display: inline-flex;\n flex-shrink: 0;\n`;\n\nStyledViewSwitcher.displayName = \"StyledViewSwitcher\";\n\nexport const StyledViewSwitcherTrack = styled.div`\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: center;\n height: 32px;\n padding: 3px;\n border-radius: var(--ac-br-rounded);\n background-color: var(--color-theme-300);\n`;\n\nStyledViewSwitcherTrack.displayName = \"StyledViewSwitcherTrack\";\n\nexport const StyledViewSwitcherOption = styled.button`\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 26px;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: var(--ac-br-rounded);\n background-color: transparent;\n cursor: pointer;\n outline: none;\n transition: background-color 150ms ease, box-shadow 150ms ease;\n\n svg {\n width: 20px;\n height: 20px;\n fill: var(--color-theme-700);\n }\n\n &:hover {\n background-color: color-mix(\n in srgb,\n var(--color-theme-900) 16%,\n transparent\n );\n }\n\n &[aria-checked=\"true\"] {\n background-color: var(--page-paper-main);\n box-shadow: var(--shadow-float);\n cursor: default;\n\n svg {\n fill: var(--color-theme-900);\n }\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 2px var(--color-primary);\n }\n`;\n\nStyledViewSwitcherOption.displayName = \"StyledViewSwitcherOption\";\n\nexport const StyledViewSwitcherMenuOption = styled.button`\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 26px;\n margin: 0;\n padding: 0 8px 0 12px;\n border: 0;\n border-radius: var(--ac-br-rounded);\n background-color: var(--page-paper-main);\n box-shadow: var(--shadow-float);\n color: var(--color-theme-900);\n font-size: calc(13px * var(--text-scale, 1));\n white-space: nowrap;\n cursor: pointer;\n outline: none;\n\n svg {\n flex-shrink: 0;\n fill: var(--color-theme-900);\n }\n\n &:has(.c-view-switcher-menu__icon) {\n padding-left: 8px;\n }\n\n .c-view-switcher-menu__values {\n display: inline-grid;\n }\n\n .c-view-switcher-menu__value {\n display: inline-flex;\n grid-area: 1 / 1;\n align-items: center;\n gap: 4px;\n visibility: hidden;\n }\n\n .c-view-switcher-menu__value[data-selected=\"true\"] {\n visibility: visible;\n }\n\n .c-view-switcher-menu__icon {\n display: inline-flex;\n flex-shrink: 0;\n }\n\n .c-view-switcher-menu__icon svg {\n width: 20px;\n height: 20px;\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 2px var(--color-primary);\n }\n`;\n\nStyledViewSwitcherMenuOption.displayName = \"StyledViewSwitcherMenuOption\";\n\nexport const StyledViewSwitcherMenuIcon = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n margin-right: 8px;\n fill: var(--color-theme-900);\n`;\n\nStyledViewSwitcherMenuIcon.displayName = \"StyledViewSwitcherMenuIcon\";\n\nexport const StyledViewSwitcherMenuList = styled(List)`\n padding: 8px 0;\n`;\n\nStyledViewSwitcherMenuList.displayName = \"StyledViewSwitcherMenuList\";\n\nexport const StyledViewSwitcherMenuLabel = styled.span`\n flex: 1;\n\n &[data-selected=\"true\"] {\n font-weight: bold;\n color: var(--color-primary);\n }\n`;\n\nStyledViewSwitcherMenuLabel.displayName = \"StyledViewSwitcherMenuLabel\";\n\nexport const StyledViewSwitcherPreview = styled.div`\n ${BoxSizingStyle}\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 180px;\n padding: 10px;\n border: 1px solid var(--border-raised);\n border-radius: var(--ac-br-8);\n background-color: var(--input-background-color);\n box-shadow: var(--shadow-popover);\n pointer-events: none;\n`;\n\nStyledViewSwitcherPreview.displayName = \"StyledViewSwitcherPreview\";\n\nexport const StyledViewSwitcherThumbnail = styled.div`\n ${BoxSizingStyle}\n position: relative;\n width: 100%;\n height: 64px;\n overflow: hidden;\n border-radius: var(--ac-br-4);\n background-color: var(--surface-sheet);\n`;\n\nStyledViewSwitcherThumbnail.displayName = \"StyledViewSwitcherThumbnail\";\n\nexport const StyledViewSwitcherOffer = styled.div`\n ${BoxSizingStyle}\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 260px;\n padding: 10px 14px;\n border: 1px solid var(--border-raised);\n border-radius: var(--ac-br-8);\n background-color: var(--page-paper-main);\n box-shadow: var(--shadow-popover);\n\n .c-view-switcher__offer-title {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .c-view-switcher__offer-title svg {\n width: 18px;\n height: 18px;\n flex-shrink: 0;\n fill: var(--color-primary);\n }\n\n .c-view-switcher__offer-action {\n align-self: flex-start;\n height: 28px;\n padding: 0 10px;\n border-color: var(--border-raised);\n border-radius: var(--ac-br-6);\n color: var(--color-theme-700);\n }\n`;\n\nStyledViewSwitcherOffer.displayName = \"StyledViewSwitcherOffer\";\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,IAAI,QAAQ,SAAS;AAE9B,OAAO,MAAMC,kBAAkB,GAAGH,MAAM,CAACI,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gDACxCN,cAAc,CAGjB;AAEDE,kBAAkB,CAACG,WAAW,GAAG,oBAAoB;AAErD,OAAO,MAAME,uBAAuB,GAAGR,MAAM,CAACI,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,wJAC7CN,cAAc,CAOjB;AAEDO,uBAAuB,CAACF,WAAW,GAAG,yBAAyB;AAE/D,OAAO,MAAMG,wBAAwB,GAAGT,MAAM,CAACU,MAAM,CAAAL,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,knBACj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yframes","BoxSizingStyle","List","PillGroup","VIEW_SWITCHER_PROMPT_MS","VIEW_SWITCHER_RESIZE_MS","VIEW_SWITCHER_APPLIED_MS","VIEW_SWITCHER_LEAVE_MS","StyledViewSwitcher","div","withConfig","displayName","componentId","StyledViewSwitcherTrack","StyledViewSwitcherOption","button","StyledViewSwitcherMenuOption","StyledViewSwitcherMenuIcon","span","StyledViewSwitcherMenuList","StyledViewSwitcherMenuLabel","promptIn","promptOut","promptTimeLeft","appliedIcon","StyledViewSwitcherPromptTitle","StyledViewSwitcherPrompt"],"sources":["../../../../src/components/ViewSwitcher/Styles.ts"],"sourcesContent":["import styled, { keyframes } from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { List } from \"../List\";\nimport { PillGroup } from \"../PillGroup\";\n\nexport const VIEW_SWITCHER_PROMPT_MS = 5000;\nexport const VIEW_SWITCHER_RESIZE_MS = 200;\nexport const VIEW_SWITCHER_APPLIED_MS = 900;\nexport const VIEW_SWITCHER_LEAVE_MS = 150;\n\nexport const StyledViewSwitcher = styled.div`\n ${BoxSizingStyle}\n display: inline-flex;\n flex-shrink: 0;\n`;\n\nStyledViewSwitcher.displayName = \"StyledViewSwitcher\";\n\nexport const StyledViewSwitcherTrack = styled.div`\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: center;\n justify-content: flex-end;\n height: 32px;\n padding: 3px;\n border-radius: var(--ac-br-rounded);\n background-color: var(--color-theme-300);\n transition: width ${VIEW_SWITCHER_RESIZE_MS}ms cubic-bezier(0.4, 0, 0.2, 1);\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n`;\n\nStyledViewSwitcherTrack.displayName = \"StyledViewSwitcherTrack\";\n\nexport const StyledViewSwitcherOption = styled.button`\n ${BoxSizingStyle}\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 26px;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: var(--ac-br-rounded);\n background-color: transparent;\n cursor: pointer;\n outline: none;\n transition: background-color 150ms ease, box-shadow 150ms ease;\n\n svg {\n width: 20px;\n height: 20px;\n fill: var(--color-theme-700);\n }\n\n &:hover {\n background-color: color-mix(\n in srgb,\n var(--color-theme-900) 16%,\n transparent\n );\n }\n\n &[aria-checked=\"true\"] {\n background-color: var(--page-paper-main);\n box-shadow: var(--shadow-float);\n cursor: default;\n\n svg {\n fill: var(--color-theme-900);\n }\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 2px var(--color-primary);\n }\n`;\n\nStyledViewSwitcherOption.displayName = \"StyledViewSwitcherOption\";\n\nexport const StyledViewSwitcherMenuOption = styled.button`\n ${BoxSizingStyle}\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 26px;\n margin: 0;\n padding: 0 8px 0 12px;\n border: 0;\n border-radius: var(--ac-br-rounded);\n background-color: var(--page-paper-main);\n box-shadow: var(--shadow-float);\n color: var(--color-theme-900);\n font-size: calc(13px * var(--text-scale, 1));\n white-space: nowrap;\n cursor: pointer;\n outline: none;\n\n svg {\n flex-shrink: 0;\n fill: var(--color-theme-900);\n }\n\n &:has(.c-view-switcher-menu__icon) {\n padding-left: 8px;\n }\n\n .c-view-switcher-menu__values {\n display: inline-grid;\n }\n\n .c-view-switcher-menu__value {\n display: inline-flex;\n grid-area: 1 / 1;\n align-items: center;\n gap: 4px;\n visibility: hidden;\n }\n\n .c-view-switcher-menu__value[data-selected=\"true\"] {\n visibility: visible;\n }\n\n .c-view-switcher-menu__icon {\n display: inline-flex;\n flex-shrink: 0;\n }\n\n .c-view-switcher-menu__icon svg {\n width: 20px;\n height: 20px;\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 2px var(--color-primary);\n }\n`;\n\nStyledViewSwitcherMenuOption.displayName = \"StyledViewSwitcherMenuOption\";\n\nexport const StyledViewSwitcherMenuIcon = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n margin-right: 8px;\n fill: var(--color-theme-900);\n`;\n\nStyledViewSwitcherMenuIcon.displayName = \"StyledViewSwitcherMenuIcon\";\n\nexport const StyledViewSwitcherMenuList = styled(List)`\n padding: 8px 0;\n`;\n\nStyledViewSwitcherMenuList.displayName = \"StyledViewSwitcherMenuList\";\n\nexport const StyledViewSwitcherMenuLabel = styled.span`\n flex: 1;\n\n &[data-selected=\"true\"] {\n font-weight: bold;\n color: var(--color-primary);\n }\n`;\n\nStyledViewSwitcherMenuLabel.displayName = \"StyledViewSwitcherMenuLabel\";\n\nconst promptIn = keyframes`\n from {\n opacity: 0;\n }\n`;\n\nconst promptOut = keyframes`\n to {\n opacity: 0;\n transform: scale(0.96);\n }\n`;\n\nconst promptTimeLeft = keyframes`\n to {\n transform: scaleX(0);\n }\n`;\n\nconst appliedIcon = keyframes`\n from {\n opacity: 0;\n transform: scale(0.4);\n }\n 60% {\n transform: scale(1.2);\n }\n`;\n\nexport const StyledViewSwitcherPromptTitle = styled.span`\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n`;\n\nStyledViewSwitcherPromptTitle.displayName = \"StyledViewSwitcherPromptTitle\";\n\nexport const StyledViewSwitcherPrompt = styled(PillGroup)`\n flex: 1 0 auto;\n max-width: none;\n animation: ${promptIn} 150ms ease-out;\n\n .c-pill-button:not(.c-pill-button--icon-only) {\n flex: 1 0 auto;\n justify-content: center;\n font-size: calc(0.75rem * var(--text-scale, 1));\n }\n\n & > .c-pill-button:not(.c-pill-button--icon-only) {\n white-space: nowrap;\n }\n\n .c-view-switcher__dismiss {\n position: relative;\n width: 32px;\n overflow: hidden;\n }\n\n /* The fill goes down to nothing when the prompt dismisses itself. */\n .c-view-switcher__dismiss::before {\n content: \"\";\n position: absolute;\n inset: 0;\n background-color: color-mix(in srgb, var(--color-primary) 25%, transparent);\n transform-origin: left;\n animation: ${promptTimeLeft} ${VIEW_SWITCHER_PROMPT_MS}ms linear forwards;\n }\n\n .c-view-switcher__dismiss > * {\n position: relative;\n }\n\n &[data-phase=\"applying\"] {\n pointer-events: none;\n\n .c-pill-button {\n opacity: 0.7;\n }\n\n .c-view-switcher__dismiss::before {\n animation-play-state: paused;\n }\n }\n\n &[data-phase=\"applied\"] {\n pointer-events: none;\n\n .c-pill-button {\n background-color: color-mix(\n in srgb,\n var(--color-primary) 30%,\n transparent\n );\n }\n\n .c-pill-button svg {\n width: 16px;\n height: 16px;\n animation: ${appliedIcon} 250ms ease-out;\n }\n }\n\n &[data-phase=\"leaving\"] {\n pointer-events: none;\n animation: ${promptOut} ${VIEW_SWITCHER_LEAVE_MS}ms ease-in forwards;\n }\n`;\n\nStyledViewSwitcherPrompt.displayName = \"StyledViewSwitcherPrompt\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,SAAS,QAAQ,mBAAmB;AAErD,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,IAAI,QAAQ,SAAS;AAC9B,SAASC,SAAS,QAAQ,cAAc;AAExC,OAAO,MAAMC,uBAAuB,GAAG,IAAI;AAC3C,OAAO,MAAMC,uBAAuB,GAAG,GAAG;AAC1C,OAAO,MAAMC,wBAAwB,GAAG,GAAG;AAC3C,OAAO,MAAMC,sBAAsB,GAAG,GAAG;AAEzC,OAAO,MAAMC,kBAAkB,GAAGT,MAAM,CAACU,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gDACxCX,cAAc,CAGjB;AAEDO,kBAAkB,CAACG,WAAW,GAAG,oBAAoB;AAErD,OAAO,MAAME,uBAAuB,GAAGd,MAAM,CAACU,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2RAC7CX,cAAc,EAQII,uBAAuB,CAK5C;AAEDQ,uBAAuB,CAACF,WAAW,GAAG,yBAAyB;AAE/D,OAAO,MAAMG,wBAAwB,GAAGf,MAAM,CAACgB,MAAM,CAAAL,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,goBACjDX,cAAc,CA2CjB;AAEDa,wBAAwB,CAACH,WAAW,GA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@ -1,17 +1,10 @@
1
1
  import React, { HTMLAttributes, ReactNode } from "react";
2
- import { ViewIllustrationType } from "./ViewIllustration";
3
2
  export interface ViewSwitcherView {
4
3
  id: string;
5
- /** View name: the radio's accessible name and the preview title. */
4
+ /** View name: the radio's accessible name and its tooltip. */
6
5
  label: string;
7
6
  /** DS icon element. */
8
7
  icon: ReactNode;
9
- /** Second line of the preview. */
10
- description?: string;
11
- /** Thumbnail drawn above the preview title. */
12
- preview?: ReactNode;
13
- /** Built-in thumbnail of this kind of view, used when there is no preview. */
14
- illustration?: ViewIllustrationType;
15
8
  }
16
9
  export interface ViewSwitcherProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
17
10
  views: ViewSwitcherView[];
@@ -20,18 +13,22 @@ export interface ViewSwitcherProps extends Omit<HTMLAttributes<HTMLDivElement>,
20
13
  onChange: (id: string) => void;
21
14
  /** Accessible name of the radiogroup. */
22
15
  "aria-label"?: string;
23
- /** Turns on the extra action offered after a switch. */
16
+ /** Turns on the extra action offered after a switch. A result of false shows no confirmation. */
24
17
  onApplyToAll?: (id: string) => unknown;
25
18
  /** Extra action button text. */
26
19
  applyToAllLabel?: string;
27
- /** Title of the extra action popover. Defaults to "Now in {label}". */
20
+ /** Accessible name of the extra action group. Defaults to "Now in {label}". */
28
21
  offerTitle?: (view: ViewSwitcherView) => ReactNode;
22
+ /** Accessible name of the button that dismisses the extra action. */
23
+ dismissLabel?: string;
24
+ /** Text that confirms the extra action. */
25
+ appliedLabel?: string;
29
26
  }
30
27
  /**
31
28
  * @component ViewSwitcher
32
29
  * @description
33
- * Icon-only radiogroup that switches the view of a page. A preview with the view name shows on hover
34
- * and on keyboard focus. With onApplyToAll, a switch offers an extra action under the switcher.
30
+ * Icon-only radiogroup that switches the view of a page. A tooltip shows the view name on hover.
31
+ * With onApplyToAll, a switch replaces the buttons with an extra action for five seconds.
35
32
  *
36
33
  * @example
37
34
  * <ViewSwitcher
@@ -1 +1 @@
1
- {"version":3,"file":"ViewSwitcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ViewSwitcher/ViewSwitcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,cAAc,EAEd,SAAS,EAMV,MAAM,OAAO,CAAC;AAkBf,OAAO,EAAoB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,oBAAoB,CAAC;CACrC;AAED,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACxD,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,gCAAgC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,SAAS,CAAC;CACpD;AAgBD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,YAAY,0FAyTxB,CAAC"}
1
+ {"version":3,"file":"ViewSwitcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ViewSwitcher/ViewSwitcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,cAAc,EAEd,SAAS,EAOV,MAAM,OAAO,CAAC;AAoBf,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACxD,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iGAAiG;IACjG,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,gCAAgC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,SAAS,CAAC;IACnD,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,YAAY,0FAmTxB,CAAC"}
@@ -1,36 +1,18 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["views", "value", "onChange", "aria-label", "onApplyToAll", "applyToAllLabel", "offerTitle", "className", "onKeyDown", "onBlur"];
4
- import React, { forwardRef, useCallback, useEffect, useId, useRef, useState } from "react";
3
+ const _excluded = ["views", "value", "onChange", "aria-label", "onApplyToAll", "applyToAllLabel", "offerTitle", "dismissLabel", "appliedLabel", "className", "onKeyDown", "onBlur"];
4
+ import React, { forwardRef, useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
5
5
  import classnames from "classnames";
6
- import { StyledViewSwitcher, StyledViewSwitcherOffer, StyledViewSwitcherOption, StyledViewSwitcherPreview, StyledViewSwitcherThumbnail, StyledViewSwitcherTrack } from "./Styles";
7
- import { Portal, useLayerContext } from "../../helpers";
8
- import { layers } from "../../utils";
6
+ import { StyledViewSwitcher, StyledViewSwitcherOption, StyledViewSwitcherPrompt, StyledViewSwitcherPromptTitle, StyledViewSwitcherTrack, VIEW_SWITCHER_APPLIED_MS, VIEW_SWITCHER_LEAVE_MS, VIEW_SWITCHER_PROMPT_MS, VIEW_SWITCHER_RESIZE_MS } from "./Styles";
9
7
  import useForkRef from "../../utils/useForkRef";
10
- import { Button } from "../Button";
11
- import { Popper } from "../Popper";
12
- import { Body2, Caption1 } from "../Typography";
13
- import { ViewIllustration } from "./ViewIllustration";
14
- const POPOVER_MODIFIERS = [{
15
- name: "offset",
16
- options: {
17
- offset: [0, 6]
18
- }
19
- }];
20
- const TABBABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
21
- const matchesFocusVisible = element => {
22
- try {
23
- return element.matches(":focus-visible");
24
- } catch (_unused) {
25
- return false;
26
- }
27
- };
28
-
8
+ import { CheckIcon, CloseIcon } from "../Icons";
9
+ import { PillButton } from "../PillButton";
10
+ import { Tooltip } from "../Tooltip";
29
11
  /**
30
12
  * @component ViewSwitcher
31
13
  * @description
32
- * Icon-only radiogroup that switches the view of a page. A preview with the view name shows on hover
33
- * and on keyboard focus. With onApplyToAll, a switch offers an extra action under the switcher.
14
+ * Icon-only radiogroup that switches the view of a page. A tooltip shows the view name on hover.
15
+ * With onApplyToAll, a switch replaces the buttons with an extra action for five seconds.
34
16
  *
35
17
  * @example
36
18
  * <ViewSwitcher
@@ -55,26 +37,30 @@ export const ViewSwitcher = /*#__PURE__*/forwardRef((_ref, ref) => {
55
37
  _ref$applyToAllLabel = _ref.applyToAllLabel,
56
38
  applyToAllLabel = _ref$applyToAllLabel === void 0 ? "Apply to All Projects" : _ref$applyToAllLabel,
57
39
  offerTitle = _ref.offerTitle,
40
+ _ref$dismissLabel = _ref.dismissLabel,
41
+ dismissLabel = _ref$dismissLabel === void 0 ? "Dismiss" : _ref$dismissLabel,
42
+ _ref$appliedLabel = _ref.appliedLabel,
43
+ appliedLabel = _ref$appliedLabel === void 0 ? "Applied" : _ref$appliedLabel,
58
44
  className = _ref.className,
59
45
  onKeyDown = _ref.onKeyDown,
60
46
  onBlur = _ref.onBlur,
61
47
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
62
- const _useLayerContext = useLayerContext(),
63
- _useLayerContext$zInd = _useLayerContext.zIndex,
64
- zIndex = _useLayerContext$zInd === void 0 ? layers.skyscraper : _useLayerContext$zInd;
65
48
  const rootRef = useRef(null);
66
49
  const handleRootRef = useForkRef(rootRef, ref);
67
50
  const trackRef = useRef(null);
68
51
  const optionRefs = useRef({});
69
- const offerRef = useRef(null);
70
52
  const offerActionRef = useRef(null);
71
53
  const _useState = useState(null),
72
- previewId = _useState[0],
73
- setPreviewId = _useState[1];
74
- const _useState2 = useState(null),
75
- offerId = _useState2[0],
76
- setOfferId = _useState2[1];
54
+ offerId = _useState[0],
55
+ setOfferId = _useState[1];
56
+ const _useState2 = useState("open"),
57
+ offerPhase = _useState2[0],
58
+ setOfferPhase = _useState2[1];
77
59
  const offerTitleId = useId();
60
+ const closedWidthRef = useRef(0);
61
+ const wasOfferOpenRef = useRef(false);
62
+ const restoreFocusRef = useRef(false);
63
+ const resizeTimerRef = useRef();
78
64
  const checkedIndex = views.findIndex(_ref2 => {
79
65
  let id = _ref2.id;
80
66
  return id === value;
@@ -84,25 +70,21 @@ export const ViewSwitcher = /*#__PURE__*/forwardRef((_ref, ref) => {
84
70
  let id = _ref3.id;
85
71
  return id === offerId;
86
72
  });
87
- const previewView = offerView ? undefined : views.find(_ref4 => {
88
- let id = _ref4.id;
89
- return id === previewId;
90
- });
91
73
  const select = useCallback(id => {
92
74
  if (id === value) {
93
75
  return;
94
76
  }
95
77
  onChange(id);
96
- setPreviewId(null);
97
78
  if (onApplyToAll) {
79
+ var _trackRef$current$off, _trackRef$current;
80
+ closedWidthRef.current = (_trackRef$current$off = (_trackRef$current = trackRef.current) == null ? void 0 : _trackRef$current.offsetWidth) != null ? _trackRef$current$off : 0;
81
+ setOfferPhase("open");
98
82
  setOfferId(id);
99
83
  }
100
84
  }, [onApplyToAll, onChange, value]);
101
-
102
- // The popovers live in a portal, so "inside" covers them as well as the track.
103
85
  const isInside = node => {
104
- var _rootRef$current, _offerRef$current;
105
- return Boolean(node && (((_rootRef$current = rootRef.current) == null ? void 0 : _rootRef$current.contains(node)) || ((_offerRef$current = offerRef.current) == null ? void 0 : _offerRef$current.contains(node))));
86
+ var _rootRef$current;
87
+ return Boolean(node && ((_rootRef$current = rootRef.current) == null ? void 0 : _rootRef$current.contains(node)));
106
88
  };
107
89
  const focusChecked = useCallback(() => {
108
90
  if (tabStopId) {
@@ -110,6 +92,60 @@ export const ViewSwitcher = /*#__PURE__*/forwardRef((_ref, ref) => {
110
92
  (_optionRefs$current$t = optionRefs.current[tabStopId]) == null || _optionRefs$current$t.focus();
111
93
  }
112
94
  }, [tabStopId]);
95
+ const closeOffer = useCallback(restoreFocus => {
96
+ restoreFocusRef.current = restoreFocus;
97
+ setOfferId(null);
98
+ }, []);
99
+
100
+ // The buttons and the prompt take turns in the track, so the track holds its width from one to the other.
101
+ useLayoutEffect(() => {
102
+ const track = trackRef.current;
103
+ const isOpen = Boolean(offerId);
104
+ const wasOpen = wasOfferOpenRef.current;
105
+ wasOfferOpenRef.current = isOpen;
106
+ if (!track || isOpen === wasOpen) {
107
+ return;
108
+ }
109
+ clearTimeout(resizeTimerRef.current);
110
+ const from = isOpen ? closedWidthRef.current : track.offsetWidth;
111
+ track.style.width = "";
112
+ const natural = track.offsetWidth;
113
+ const to = isOpen ? Math.max(natural, from) : natural;
114
+ track.style.overflow = "hidden";
115
+ track.style.width = from + "px";
116
+ // Without this read the browser skips the start width, and nothing animates.
117
+ void track.offsetWidth;
118
+ track.style.width = to + "px";
119
+ if (isOpen) {
120
+ var _offerActionRef$curre;
121
+ (_offerActionRef$curre = offerActionRef.current) == null || _offerActionRef$curre.focus({
122
+ preventScroll: true
123
+ });
124
+ return;
125
+ }
126
+ resizeTimerRef.current = setTimeout(() => {
127
+ track.style.width = "";
128
+ track.style.overflow = "";
129
+ }, VIEW_SWITCHER_RESIZE_MS);
130
+ if (restoreFocusRef.current) {
131
+ restoreFocusRef.current = false;
132
+ focusChecked();
133
+ }
134
+ }, [focusChecked, offerId]);
135
+ useEffect(() => () => clearTimeout(resizeTimerRef.current), []);
136
+ useEffect(() => {
137
+ if (!offerId || offerPhase === "applying") {
138
+ return undefined;
139
+ }
140
+ if (offerPhase === "leaving") {
141
+ const timer = setTimeout(() => {
142
+ closeOffer(isInside(document.activeElement));
143
+ }, VIEW_SWITCHER_LEAVE_MS);
144
+ return () => clearTimeout(timer);
145
+ }
146
+ const timer = setTimeout(() => setOfferPhase("leaving"), offerPhase === "applied" ? VIEW_SWITCHER_APPLIED_MS : VIEW_SWITCHER_PROMPT_MS);
147
+ return () => clearTimeout(timer);
148
+ }, [closeOffer, offerId, offerPhase]);
113
149
  useEffect(() => {
114
150
  if (!offerId) {
115
151
  return undefined;
@@ -133,11 +169,6 @@ export const ViewSwitcher = /*#__PURE__*/forwardRef((_ref, ref) => {
133
169
  Home: 0,
134
170
  End: last
135
171
  };
136
- if (event.key === "Tab" && !event.shiftKey && offerActionRef.current) {
137
- event.preventDefault();
138
- offerActionRef.current.focus();
139
- return;
140
- }
141
172
  const target = targets[event.key];
142
173
  if (target === undefined) {
143
174
  return;
@@ -149,18 +180,14 @@ export const ViewSwitcher = /*#__PURE__*/forwardRef((_ref, ref) => {
149
180
  };
150
181
  const handleRootKeyDown = event => {
151
182
  onKeyDown == null || onKeyDown(event);
152
- if (event.key !== "Escape" || !offerId && !previewId) {
183
+ if (event.key !== "Escape" || !offerId) {
153
184
  return;
154
185
  }
155
186
 
156
187
  // A native dialog around the switcher would take an Escape that is not prevented as its own close request.
157
188
  event.preventDefault();
158
189
  event.stopPropagation();
159
- setPreviewId(null);
160
- if (offerId) {
161
- setOfferId(null);
162
- focusChecked();
163
- }
190
+ closeOffer(true);
164
191
  };
165
192
  const handleRootBlur = event => {
166
193
  onBlur == null || onBlur(event);
@@ -169,33 +196,22 @@ export const ViewSwitcher = /*#__PURE__*/forwardRef((_ref, ref) => {
169
196
  setOfferId(null);
170
197
  }
171
198
  };
172
- const handleOfferActionKeyDown = event => {
173
- if (event.key !== "Tab") {
174
- return;
175
- }
176
- event.preventDefault();
177
- if (event.shiftKey) {
178
- focusChecked();
199
+ const applyToAll = async () => {
200
+ if (!offerId || !onApplyToAll || offerPhase !== "open") {
179
201
  return;
180
202
  }
181
-
182
- // The offer sits in a portal, so Tab goes on from the switcher in the page.
183
- const next = Array.from(document.querySelectorAll(TABBABLE)).find(element => !isInside(element) && Boolean(rootRef.current && rootRef.current.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_FOLLOWING));
184
- if (next) {
185
- next.focus();
186
- } else {
187
- focusChecked();
188
- setOfferId(null);
203
+ let isApplied = false;
204
+ setOfferPhase("applying");
205
+ try {
206
+ isApplied = (await onApplyToAll(offerId)) !== false;
207
+ } finally {
208
+ setOfferPhase(isApplied ? "applied" : "leaving");
189
209
  }
190
210
  };
191
- const applyToAll = async () => {
192
- if (!offerId || !onApplyToAll) {
193
- return;
211
+ const dismiss = () => {
212
+ if (offerPhase === "open") {
213
+ setOfferPhase("leaving");
194
214
  }
195
- const id = offerId;
196
- focusChecked();
197
- setOfferId(null);
198
- await onApplyToAll(id);
199
215
  };
200
216
  return /*#__PURE__*/React.createElement(StyledViewSwitcher, _extends({
201
217
  ref: handleRootRef,
@@ -204,13 +220,37 @@ export const ViewSwitcher = /*#__PURE__*/forwardRef((_ref, ref) => {
204
220
  onBlur: handleRootBlur
205
221
  }, rest), /*#__PURE__*/React.createElement(StyledViewSwitcherTrack, {
206
222
  ref: trackRef,
207
- role: "radiogroup",
208
- "aria-label": ariaLabel,
223
+ role: offerView ? undefined : "radiogroup",
224
+ "aria-label": offerView ? undefined : ariaLabel,
209
225
  className: "c-view-switcher__track"
210
- }, views.map((view, index) => {
226
+ }, offerView ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledViewSwitcherPromptTitle, {
227
+ id: offerTitleId
228
+ }, offerTitle ? offerTitle(offerView) : "Now in " + offerView.label), /*#__PURE__*/React.createElement(StyledViewSwitcherPrompt, {
229
+ "aria-labelledby": offerTitleId,
230
+ className: "c-view-switcher__prompt",
231
+ "data-phase": offerPhase
232
+ }, /*#__PURE__*/React.createElement(PillButton, {
233
+ ref: offerActionRef,
234
+ type: "button",
235
+ tone: "accent",
236
+ icon: offerPhase === "applied" ? /*#__PURE__*/React.createElement(CheckIcon, null) : undefined,
237
+ placeholder: offerPhase === "applied" ? appliedLabel : applyToAllLabel,
238
+ onClick: applyToAll
239
+ }), offerPhase === "applied" ? null : /*#__PURE__*/React.createElement(PillButton, {
240
+ type: "button",
241
+ tone: "accent",
242
+ iconOnly: true,
243
+ icon: /*#__PURE__*/React.createElement(CloseIcon, null),
244
+ "aria-label": dismissLabel,
245
+ className: "c-view-switcher__dismiss",
246
+ onClick: dismiss
247
+ }))) : null, offerView ? null : views.map((view, index) => {
211
248
  const checked = view.id === value;
212
- return /*#__PURE__*/React.createElement(StyledViewSwitcherOption, {
249
+ return /*#__PURE__*/React.createElement(Tooltip, {
213
250
  key: view.id,
251
+ title: view.label,
252
+ placement: "bottom"
253
+ }, /*#__PURE__*/React.createElement(StyledViewSwitcherOption, {
214
254
  ref: node => {
215
255
  optionRefs.current[view.id] = node;
216
256
  },
@@ -221,64 +261,9 @@ export const ViewSwitcher = /*#__PURE__*/forwardRef((_ref, ref) => {
221
261
  tabIndex: view.id === tabStopId ? 0 : -1,
222
262
  className: "c-view-switcher__option",
223
263
  onClick: () => select(view.id),
224
- onKeyDown: event => handleOptionKeyDown(event, index),
225
- onMouseEnter: () => setPreviewId(view.id),
226
- onMouseLeave: () => setPreviewId(null),
227
- onFocus: event => {
228
- if (matchesFocusVisible(event.currentTarget)) {
229
- setPreviewId(view.id);
230
- }
231
- },
232
- onBlur: () => setPreviewId(null)
233
- }, view.icon);
234
- })), previewView ? /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Popper, {
235
- anchorEl: optionRefs.current[previewView.id],
236
- open: true,
237
- placement: "bottom",
238
- strategy: "fixed",
239
- modifiers: POPOVER_MODIFIERS,
240
- style: {
241
- zIndex
242
- },
243
- "aria-hidden": "true"
244
- }, /*#__PURE__*/React.createElement(StyledViewSwitcherPreview, {
245
- className: "c-view-switcher__preview"
246
- }, previewView.preview ? /*#__PURE__*/React.createElement(StyledViewSwitcherThumbnail, null, previewView.preview) : previewView.illustration ? /*#__PURE__*/React.createElement(StyledViewSwitcherThumbnail, null, /*#__PURE__*/React.createElement(ViewIllustration, {
247
- type: previewView.illustration
248
- })) : null, /*#__PURE__*/React.createElement(Caption1, {
249
- weight: "bold",
250
- color: "primary"
251
- }, previewView.label), previewView.description ? /*#__PURE__*/React.createElement(Caption1, {
252
- color: "tertiary"
253
- }, previewView.description) : null))) : null, offerView ? /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Popper, {
254
- anchorEl: trackRef.current,
255
- open: true,
256
- placement: "bottom",
257
- strategy: "fixed",
258
- modifiers: POPOVER_MODIFIERS,
259
- style: {
260
- zIndex
261
- }
262
- }, /*#__PURE__*/React.createElement(StyledViewSwitcherOffer, {
263
- ref: offerRef,
264
- role: "group",
265
- "aria-labelledby": offerTitleId,
266
- className: "c-view-switcher__offer"
267
- }, /*#__PURE__*/React.createElement("div", {
268
- className: "c-view-switcher__offer-title"
269
- }, offerView.icon, /*#__PURE__*/React.createElement(Body2, {
270
- id: offerTitleId,
271
- weight: "bold",
272
- color: "primary"
273
- }, offerTitle ? offerTitle(offerView) : "Now in " + offerView.label)), /*#__PURE__*/React.createElement(Button, {
274
- type: "button",
275
- variant: "secondary",
276
- size: "small",
277
- ref: offerActionRef,
278
- className: "c-view-switcher__offer-action",
279
- onClick: applyToAll,
280
- onKeyDown: handleOfferActionKeyDown
281
- }, /*#__PURE__*/React.createElement(Caption1, null, applyToAllLabel))))) : null);
264
+ onKeyDown: event => handleOptionKeyDown(event, index)
265
+ }, view.icon));
266
+ })));
282
267
  });
283
268
  ViewSwitcher.displayName = "ViewSwitcher";
284
269
  //# sourceMappingURL=ViewSwitcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewSwitcher.js","names":["React","forwardRef","useCallback","useEffect","useId","useRef","useState","classnames","StyledViewSwitcher","StyledViewSwitcherOffer","StyledViewSwitcherOption","StyledViewSwitcherPreview","StyledViewSwitcherThumbnail","StyledViewSwitcherTrack","Portal","useLayerContext","layers","useForkRef","Button","Popper","Body2","Caption1","ViewIllustration","POPOVER_MODIFIERS","name","options","offset","TABBABLE","matchesFocusVisible","element","matches","_unused","ViewSwitcher","_ref","ref","_views","views","value","onChange","_ref$ariaLabel","ariaLabel","onApplyToAll","_ref$applyToAllLabel","applyToAllLabel","offerTitle","className","onKeyDown","onBlur","rest","_objectWithoutPropertiesLoose","_excluded","_useLayerContext","_useLayerContext$zInd","zIndex","skyscraper","rootRef","handleRootRef","trackRef","optionRefs","offerRef","offerActionRef","_useState","previewId","setPreviewId","_useState2","offerId","setOfferId","offerTitleId","checkedIndex","findIndex","_ref2","id","tabStopId","offerView","find","_ref3","previewView","undefined","_ref4","select","isInside","node","_rootRef$current","_offerRef$current","Boolean","current","contains","focusChecked","_optionRefs$current$t","focus","closeOutside","event","target","document","addEventListener","removeEventListener","handleOptionKeyDown","index","_optionRefs$current$i","last","length","targets","ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End","key","shiftKey","preventDefault","handleRootKeyDown","stopPropagation","handleRootBlur","next","relatedTarget","handleOfferActionKeyDown","Array","from","querySelectorAll","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","applyToAll","createElement","_extends","role","map","view","checked","type","label","tabIndex","onClick","onMouseEnter","onMouseLeave","onFocus","currentTarget","icon","anchorEl","open","placement","strategy","modifiers","style","preview","illustration","weight","color","description","variant","size","displayName"],"sources":["../../../../src/components/ViewSwitcher/ViewSwitcher.tsx"],"sourcesContent":["import React, {\n FocusEvent,\n forwardRef,\n HTMLAttributes,\n KeyboardEvent,\n ReactNode,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledViewSwitcher,\n StyledViewSwitcherOffer,\n StyledViewSwitcherOption,\n StyledViewSwitcherPreview,\n StyledViewSwitcherThumbnail,\n StyledViewSwitcherTrack,\n} from \"./Styles\";\nimport { Portal, useLayerContext } from \"../../helpers\";\nimport { layers } from \"../../utils\";\nimport useForkRef from \"../../utils/useForkRef\";\nimport { Button } from \"../Button\";\nimport { Popper, PopperModifier } from \"../Popper\";\nimport { Body2, Caption1 } from \"../Typography\";\nimport { ViewIllustration, ViewIllustrationType } from \"./ViewIllustration\";\n\nexport interface ViewSwitcherView {\n id: string;\n /** View name: the radio's accessible name and the preview title. */\n label: string;\n /** DS icon element. */\n icon: ReactNode;\n /** Second line of the preview. */\n description?: string;\n /** Thumbnail drawn above the preview title. */\n preview?: ReactNode;\n /** Built-in thumbnail of this kind of view, used when there is no preview. */\n illustration?: ViewIllustrationType;\n}\n\nexport interface ViewSwitcherProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n views: ViewSwitcherView[];\n /** Id of the checked view. */\n value?: string;\n onChange: (id: string) => void;\n /** Accessible name of the radiogroup. */\n \"aria-label\"?: string;\n /** Turns on the extra action offered after a switch. */\n onApplyToAll?: (id: string) => unknown;\n /** Extra action button text. */\n applyToAllLabel?: string;\n /** Title of the extra action popover. Defaults to \"Now in {label}\". */\n offerTitle?: (view: ViewSwitcherView) => ReactNode;\n}\n\nconst POPOVER_MODIFIERS: PopperModifier[] = [\n { name: \"offset\", options: { offset: [0, 6] } },\n];\nconst TABBABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\nconst matchesFocusVisible = (element: Element): boolean => {\n try {\n return element.matches(\":focus-visible\");\n } catch {\n return false;\n }\n};\n\n/**\n * @component ViewSwitcher\n * @description\n * Icon-only radiogroup that switches the view of a page. A preview with the view name shows on hover\n * and on keyboard focus. With onApplyToAll, a switch offers an extra action under the switcher.\n *\n * @example\n * <ViewSwitcher\n * aria-label=\"View\"\n * views={[\n * { id: \"list\", label: \"List View\", icon: <ViewListIcon /> },\n * { id: \"grid\", label: \"Grid View\", icon: <ViewGridIcon /> },\n * ]}\n * value={view}\n * onChange={setView}\n * onApplyToAll={applyToAllProjects}\n * />\n */\nexport const ViewSwitcher = forwardRef<HTMLDivElement, ViewSwitcherProps>(\n (\n {\n views,\n value,\n onChange,\n \"aria-label\": ariaLabel = \"View\",\n onApplyToAll,\n applyToAllLabel = \"Apply to All Projects\",\n offerTitle,\n className,\n onKeyDown,\n onBlur,\n ...rest\n },\n ref\n ) => {\n const { zIndex = layers.skyscraper } = useLayerContext();\n const rootRef = useRef<HTMLDivElement | null>(null);\n const handleRootRef = useForkRef(rootRef, ref);\n const trackRef = useRef<HTMLDivElement | null>(null);\n const optionRefs = useRef<Record<string, HTMLButtonElement | null>>({});\n const offerRef = useRef<HTMLDivElement | null>(null);\n const offerActionRef = useRef<HTMLButtonElement | null>(null);\n const [previewId, setPreviewId] = useState<string | null>(null);\n const [offerId, setOfferId] = useState<string | null>(null);\n const offerTitleId = useId();\n\n const checkedIndex = views.findIndex(({ id }) => id === value);\n const tabStopId = views[checkedIndex >= 0 ? checkedIndex : 0]?.id;\n const offerView = views.find(({ id }) => id === offerId);\n const previewView = offerView\n ? undefined\n : views.find(({ id }) => id === previewId);\n\n const select = useCallback(\n (id: string) => {\n if (id === value) {\n return;\n }\n\n onChange(id);\n setPreviewId(null);\n\n if (onApplyToAll) {\n setOfferId(id);\n }\n },\n [onApplyToAll, onChange, value]\n );\n\n // The popovers live in a portal, so \"inside\" covers them as well as the track.\n const isInside = (node: Node | null): boolean =>\n Boolean(\n node &&\n (rootRef.current?.contains(node) || offerRef.current?.contains(node))\n );\n\n const focusChecked = useCallback(() => {\n if (tabStopId) {\n optionRefs.current[tabStopId]?.focus();\n }\n }, [tabStopId]);\n\n useEffect(() => {\n if (!offerId) {\n return undefined;\n }\n\n const closeOutside = (event: MouseEvent): void => {\n if (!isInside(event.target as Node)) {\n setOfferId(null);\n }\n };\n\n document.addEventListener(\"mousedown\", closeOutside);\n\n return () => document.removeEventListener(\"mousedown\", closeOutside);\n }, [offerId]);\n\n const handleOptionKeyDown = (\n event: KeyboardEvent<HTMLButtonElement>,\n index: number\n ): void => {\n const last = views.length - 1;\n const targets: Record<string, number> = {\n ArrowRight: index === last ? 0 : index + 1,\n ArrowDown: index === last ? 0 : index + 1,\n ArrowLeft: index === 0 ? last : index - 1,\n ArrowUp: index === 0 ? last : index - 1,\n Home: 0,\n End: last,\n };\n if (event.key === \"Tab\" && !event.shiftKey && offerActionRef.current) {\n event.preventDefault();\n offerActionRef.current.focus();\n\n return;\n }\n\n const target = targets[event.key];\n\n if (target === undefined) {\n return;\n }\n\n event.preventDefault();\n\n const { id } = views[target];\n\n optionRefs.current[id]?.focus();\n select(id);\n };\n\n const handleRootKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n onKeyDown?.(event);\n\n if (event.key !== \"Escape\" || (!offerId && !previewId)) {\n return;\n }\n\n // A native dialog around the switcher would take an Escape that is not prevented as its own close request.\n event.preventDefault();\n event.stopPropagation();\n setPreviewId(null);\n\n if (offerId) {\n setOfferId(null);\n focusChecked();\n }\n };\n\n const handleRootBlur = (event: FocusEvent<HTMLDivElement>): void => {\n onBlur?.(event);\n\n const next = event.relatedTarget as Node | null;\n\n if (next && !isInside(next)) {\n setOfferId(null);\n }\n };\n\n const handleOfferActionKeyDown = (\n event: KeyboardEvent<HTMLButtonElement>\n ): void => {\n if (event.key !== \"Tab\") {\n return;\n }\n\n event.preventDefault();\n\n if (event.shiftKey) {\n focusChecked();\n\n return;\n }\n\n // The offer sits in a portal, so Tab goes on from the switcher in the page.\n const next = Array.from(\n document.querySelectorAll<HTMLElement>(TABBABLE)\n ).find(\n (element) =>\n !isInside(element) &&\n Boolean(\n rootRef.current &&\n rootRef.current.compareDocumentPosition(element) &\n Node.DOCUMENT_POSITION_FOLLOWING\n )\n );\n\n if (next) {\n next.focus();\n } else {\n focusChecked();\n setOfferId(null);\n }\n };\n\n const applyToAll = async (): Promise<void> => {\n if (!offerId || !onApplyToAll) {\n return;\n }\n\n const id = offerId;\n\n focusChecked();\n setOfferId(null);\n\n await onApplyToAll(id);\n };\n\n return (\n <StyledViewSwitcher\n ref={handleRootRef}\n className={classnames(\"c-view-switcher\", className)}\n onKeyDown={handleRootKeyDown}\n onBlur={handleRootBlur}\n {...rest}\n >\n <StyledViewSwitcherTrack\n ref={trackRef}\n role=\"radiogroup\"\n aria-label={ariaLabel}\n className=\"c-view-switcher__track\"\n >\n {views.map((view, index) => {\n const checked = view.id === value;\n\n return (\n <StyledViewSwitcherOption\n key={view.id}\n ref={(node: HTMLButtonElement | null) => {\n optionRefs.current[view.id] = node;\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n aria-label={view.label}\n tabIndex={view.id === tabStopId ? 0 : -1}\n className=\"c-view-switcher__option\"\n onClick={() => select(view.id)}\n onKeyDown={(event: KeyboardEvent<HTMLButtonElement>) =>\n handleOptionKeyDown(event, index)\n }\n onMouseEnter={() => setPreviewId(view.id)}\n onMouseLeave={() => setPreviewId(null)}\n onFocus={(event: FocusEvent<HTMLButtonElement>) => {\n if (matchesFocusVisible(event.currentTarget)) {\n setPreviewId(view.id);\n }\n }}\n onBlur={() => setPreviewId(null)}\n >\n {view.icon}\n </StyledViewSwitcherOption>\n );\n })}\n </StyledViewSwitcherTrack>\n {previewView ? (\n <Portal>\n <Popper\n anchorEl={optionRefs.current[previewView.id]}\n open\n placement=\"bottom\"\n strategy=\"fixed\"\n modifiers={POPOVER_MODIFIERS}\n style={{ zIndex }}\n aria-hidden=\"true\"\n >\n <StyledViewSwitcherPreview className=\"c-view-switcher__preview\">\n {previewView.preview ? (\n <StyledViewSwitcherThumbnail>\n {previewView.preview}\n </StyledViewSwitcherThumbnail>\n ) : previewView.illustration ? (\n <StyledViewSwitcherThumbnail>\n <ViewIllustration type={previewView.illustration} />\n </StyledViewSwitcherThumbnail>\n ) : null}\n <Caption1 weight=\"bold\" color=\"primary\">\n {previewView.label}\n </Caption1>\n {previewView.description ? (\n <Caption1 color=\"tertiary\">\n {previewView.description}\n </Caption1>\n ) : null}\n </StyledViewSwitcherPreview>\n </Popper>\n </Portal>\n ) : null}\n {offerView ? (\n <Portal>\n <Popper\n anchorEl={trackRef.current}\n open\n placement=\"bottom\"\n strategy=\"fixed\"\n modifiers={POPOVER_MODIFIERS}\n style={{ zIndex }}\n >\n <StyledViewSwitcherOffer\n ref={offerRef}\n role=\"group\"\n aria-labelledby={offerTitleId}\n className=\"c-view-switcher__offer\"\n >\n <div className=\"c-view-switcher__offer-title\">\n {offerView.icon}\n <Body2 id={offerTitleId} weight=\"bold\" color=\"primary\">\n {offerTitle\n ? offerTitle(offerView)\n : `Now in ${offerView.label}`}\n </Body2>\n </div>\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"small\"\n ref={offerActionRef}\n className=\"c-view-switcher__offer-action\"\n onClick={applyToAll}\n onKeyDown={handleOfferActionKeyDown}\n >\n <Caption1>{applyToAllLabel}</Caption1>\n </Button>\n </StyledViewSwitcherOffer>\n </Popper>\n </Portal>\n ) : null}\n </StyledViewSwitcher>\n );\n }\n);\n\nViewSwitcher.displayName = \"ViewSwitcher\";\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aAAA,CAACnH,uBAAuB;IACtByB,GAAG,EAAEyB,QAAS;IACdmE,IAAI,EAAC,OAAO;IACZ,mBAAiB3D,YAAa;IAC9BtB,SAAS,EAAC;EAAwB,gBAElC7C,KAAA,CAAA4H,aAAA;IAAK/E,SAAS,EAAC;EAA8B,GAC1C4B,SAAS,CAACiE,IAAI,eACf1I,KAAA,CAAA4H,aAAA,CAACxG,KAAK;IAACmD,EAAE,EAAEJ,YAAa;IAACgF,MAAM,EAAC,MAAM;IAACC,KAAK,EAAC;EAAS,GACnDxG,UAAU,GACPA,UAAU,CAAC6B,SAAS,CAAC,eACXA,SAAS,CAAC0D,KACnB,CACJ,CAAC,eACNnI,KAAA,CAAA4H,aAAA,CAAC1G,MAAM;IACLgH,IAAI,EAAC,QAAQ;IACboB,OAAO,EAAC,WAAW;IACnBC,IAAI,EAAC,OAAO;IACZrH,GAAG,EAAE0B,cAAe;IACpBf,SAAS,EAAC,+BAA+B;IACzCwF,OAAO,EAAEV,UAAW;IACpB7E,SAAS,EAAEsE;EAAyB,gBAEpCpH,KAAA,CAAA4H,aAAA,CAACvG,QAAQ,QAAEsB,eAA0B,CAC/B,CACe,CACnB,CACF,CAAC,GACP,IACc,CAAC;AAEzB,CACF,CAAC;AAEDX,YAAY,CAACwH,WAAW,GAAG,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"ViewSwitcher.js","names":["React","forwardRef","useCallback","useEffect","useId","useLayoutEffect","useRef","useState","classnames","StyledViewSwitcher","StyledViewSwitcherOption","StyledViewSwitcherPrompt","StyledViewSwitcherPromptTitle","StyledViewSwitcherTrack","VIEW_SWITCHER_APPLIED_MS","VIEW_SWITCHER_LEAVE_MS","VIEW_SWITCHER_PROMPT_MS","VIEW_SWITCHER_RESIZE_MS","useForkRef","CheckIcon","CloseIcon","PillButton","Tooltip","ViewSwitcher","_ref","ref","_views","views","value","onChange","_ref$ariaLabel","ariaLabel","onApplyToAll","_ref$applyToAllLabel","applyToAllLabel","offerTitle","_ref$dismissLabel","dismissLabel","_ref$appliedLabel","appliedLabel","className","onKeyDown","onBlur","rest","_objectWithoutPropertiesLoose","_excluded","rootRef","handleRootRef","trackRef","optionRefs","offerActionRef","_useState","offerId","setOfferId","_useState2","offerPhase","setOfferPhase","offerTitleId","closedWidthRef","wasOfferOpenRef","restoreFocusRef","resizeTimerRef","checkedIndex","findIndex","_ref2","id","tabStopId","offerView","find","_ref3","select","_trackRef$current$off","_trackRef$current","current","offsetWidth","isInside","node","_rootRef$current","Boolean","contains","focusChecked","_optionRefs$current$t","focus","closeOffer","restoreFocus","track","isOpen","wasOpen","clearTimeout","from","style","width","natural","to","Math","max","overflow","_offerActionRef$curre","preventScroll","setTimeout","undefined","timer","document","activeElement","closeOutside","event","target","addEventListener","removeEventListener","handleOptionKeyDown","index","_optionRefs$current$i","last","length","targets","ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End","key","preventDefault","handleRootKeyDown","stopPropagation","handleRootBlur","next","relatedTarget","applyToAll","isApplied","dismiss","createElement","_extends","role","Fragment","label","type","tone","icon","placeholder","onClick","iconOnly","map","view","checked","title","placement","tabIndex","displayName"],"sources":["../../../../src/components/ViewSwitcher/ViewSwitcher.tsx"],"sourcesContent":["import React, {\n FocusEvent,\n forwardRef,\n HTMLAttributes,\n KeyboardEvent,\n ReactNode,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledViewSwitcher,\n StyledViewSwitcherOption,\n StyledViewSwitcherPrompt,\n StyledViewSwitcherPromptTitle,\n StyledViewSwitcherTrack,\n VIEW_SWITCHER_APPLIED_MS,\n VIEW_SWITCHER_LEAVE_MS,\n VIEW_SWITCHER_PROMPT_MS,\n VIEW_SWITCHER_RESIZE_MS,\n} from \"./Styles\";\nimport useForkRef from \"../../utils/useForkRef\";\nimport { CheckIcon, CloseIcon } from \"../Icons\";\nimport { PillButton } from \"../PillButton\";\nimport { Tooltip } from \"../Tooltip\";\n\nexport interface ViewSwitcherView {\n id: string;\n /** View name: the radio's accessible name and its tooltip. */\n label: string;\n /** DS icon element. */\n icon: ReactNode;\n}\n\nexport interface ViewSwitcherProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n views: ViewSwitcherView[];\n /** Id of the checked view. */\n value?: string;\n onChange: (id: string) => void;\n /** Accessible name of the radiogroup. */\n \"aria-label\"?: string;\n /** Turns on the extra action offered after a switch. A result of false shows no confirmation. */\n onApplyToAll?: (id: string) => unknown;\n /** Extra action button text. */\n applyToAllLabel?: string;\n /** Accessible name of the extra action group. Defaults to \"Now in {label}\". */\n offerTitle?: (view: ViewSwitcherView) => ReactNode;\n /** Accessible name of the button that dismisses the extra action. */\n dismissLabel?: string;\n /** Text that confirms the extra action. */\n appliedLabel?: string;\n}\n\n/**\n * @component ViewSwitcher\n * @description\n * Icon-only radiogroup that switches the view of a page. A tooltip shows the view name on hover.\n * With onApplyToAll, a switch replaces the buttons with an extra action for five seconds.\n *\n * @example\n * <ViewSwitcher\n * aria-label=\"View\"\n * views={[\n * { id: \"list\", label: \"List View\", icon: <ViewListIcon /> },\n * { id: \"grid\", label: \"Grid View\", icon: <ViewGridIcon /> },\n * ]}\n * value={view}\n * onChange={setView}\n * onApplyToAll={applyToAllProjects}\n * />\n */\nexport const ViewSwitcher = forwardRef<HTMLDivElement, ViewSwitcherProps>(\n (\n {\n views,\n value,\n onChange,\n \"aria-label\": ariaLabel = \"View\",\n onApplyToAll,\n applyToAllLabel = \"Apply to All Projects\",\n offerTitle,\n dismissLabel = \"Dismiss\",\n appliedLabel = \"Applied\",\n className,\n onKeyDown,\n onBlur,\n ...rest\n },\n ref\n ) => {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const handleRootRef = useForkRef(rootRef, ref);\n const trackRef = useRef<HTMLDivElement | null>(null);\n const optionRefs = useRef<Record<string, HTMLButtonElement | null>>({});\n const offerActionRef = useRef<HTMLButtonElement | null>(null);\n const [offerId, setOfferId] = useState<string | null>(null);\n const [offerPhase, setOfferPhase] = useState<\n \"open\" | \"applying\" | \"applied\" | \"leaving\"\n >(\"open\");\n const offerTitleId = useId();\n const closedWidthRef = useRef(0);\n const wasOfferOpenRef = useRef(false);\n const restoreFocusRef = useRef(false);\n const resizeTimerRef = useRef<ReturnType<typeof setTimeout>>();\n\n const checkedIndex = views.findIndex(({ id }) => id === value);\n const tabStopId = views[checkedIndex >= 0 ? checkedIndex : 0]?.id;\n const offerView = views.find(({ id }) => id === offerId);\n\n const select = useCallback(\n (id: string) => {\n if (id === value) {\n return;\n }\n\n onChange(id);\n\n if (onApplyToAll) {\n closedWidthRef.current = trackRef.current?.offsetWidth ?? 0;\n setOfferPhase(\"open\");\n setOfferId(id);\n }\n },\n [onApplyToAll, onChange, value]\n );\n\n const isInside = (node: Node | null): boolean =>\n Boolean(node && rootRef.current?.contains(node));\n\n const focusChecked = useCallback(() => {\n if (tabStopId) {\n optionRefs.current[tabStopId]?.focus();\n }\n }, [tabStopId]);\n\n const closeOffer = useCallback((restoreFocus: boolean): void => {\n restoreFocusRef.current = restoreFocus;\n setOfferId(null);\n }, []);\n\n // The buttons and the prompt take turns in the track, so the track holds its width from one to the other.\n useLayoutEffect(() => {\n const track = trackRef.current;\n const isOpen = Boolean(offerId);\n const wasOpen = wasOfferOpenRef.current;\n\n wasOfferOpenRef.current = isOpen;\n\n if (!track || isOpen === wasOpen) {\n return;\n }\n\n clearTimeout(resizeTimerRef.current);\n\n const from = isOpen ? closedWidthRef.current : track.offsetWidth;\n\n track.style.width = \"\";\n\n const natural = track.offsetWidth;\n const to = isOpen ? Math.max(natural, from) : natural;\n\n track.style.overflow = \"hidden\";\n track.style.width = `${from}px`;\n // Without this read the browser skips the start width, and nothing animates.\n void track.offsetWidth;\n track.style.width = `${to}px`;\n\n if (isOpen) {\n offerActionRef.current?.focus({ preventScroll: true });\n\n return;\n }\n\n resizeTimerRef.current = setTimeout(() => {\n track.style.width = \"\";\n track.style.overflow = \"\";\n }, VIEW_SWITCHER_RESIZE_MS);\n\n if (restoreFocusRef.current) {\n restoreFocusRef.current = false;\n focusChecked();\n }\n }, [focusChecked, offerId]);\n\n useEffect(() => () => clearTimeout(resizeTimerRef.current), []);\n\n useEffect(() => {\n if (!offerId || offerPhase === \"applying\") {\n return undefined;\n }\n\n if (offerPhase === \"leaving\") {\n const timer = setTimeout(() => {\n closeOffer(isInside(document.activeElement));\n }, VIEW_SWITCHER_LEAVE_MS);\n\n return () => clearTimeout(timer);\n }\n\n const timer = setTimeout(\n () => setOfferPhase(\"leaving\"),\n offerPhase === \"applied\"\n ? VIEW_SWITCHER_APPLIED_MS\n : VIEW_SWITCHER_PROMPT_MS\n );\n\n return () => clearTimeout(timer);\n }, [closeOffer, offerId, offerPhase]);\n\n useEffect(() => {\n if (!offerId) {\n return undefined;\n }\n\n const closeOutside = (event: MouseEvent): void => {\n if (!isInside(event.target as Node)) {\n setOfferId(null);\n }\n };\n\n document.addEventListener(\"mousedown\", closeOutside);\n\n return () => document.removeEventListener(\"mousedown\", closeOutside);\n }, [offerId]);\n\n const handleOptionKeyDown = (\n event: KeyboardEvent<HTMLButtonElement>,\n index: number\n ): void => {\n const last = views.length - 1;\n const targets: Record<string, number> = {\n ArrowRight: index === last ? 0 : index + 1,\n ArrowDown: index === last ? 0 : index + 1,\n ArrowLeft: index === 0 ? last : index - 1,\n ArrowUp: index === 0 ? last : index - 1,\n Home: 0,\n End: last,\n };\n const target = targets[event.key];\n\n if (target === undefined) {\n return;\n }\n\n event.preventDefault();\n\n const { id } = views[target];\n\n optionRefs.current[id]?.focus();\n select(id);\n };\n\n const handleRootKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n onKeyDown?.(event);\n\n if (event.key !== \"Escape\" || !offerId) {\n return;\n }\n\n // A native dialog around the switcher would take an Escape that is not prevented as its own close request.\n event.preventDefault();\n event.stopPropagation();\n closeOffer(true);\n };\n\n const handleRootBlur = (event: FocusEvent<HTMLDivElement>): void => {\n onBlur?.(event);\n\n const next = event.relatedTarget as Node | null;\n\n if (next && !isInside(next)) {\n setOfferId(null);\n }\n };\n\n const applyToAll = async (): Promise<void> => {\n if (!offerId || !onApplyToAll || offerPhase !== \"open\") {\n return;\n }\n\n let isApplied = false;\n\n setOfferPhase(\"applying\");\n\n try {\n isApplied = (await onApplyToAll(offerId)) !== false;\n } finally {\n setOfferPhase(isApplied ? \"applied\" : \"leaving\");\n }\n };\n\n const dismiss = (): void => {\n if (offerPhase === \"open\") {\n setOfferPhase(\"leaving\");\n }\n };\n\n return (\n <StyledViewSwitcher\n ref={handleRootRef}\n className={classnames(\"c-view-switcher\", className)}\n onKeyDown={handleRootKeyDown}\n onBlur={handleRootBlur}\n {...rest}\n >\n <StyledViewSwitcherTrack\n ref={trackRef}\n role={offerView ? undefined : \"radiogroup\"}\n aria-label={offerView ? undefined : ariaLabel}\n className=\"c-view-switcher__track\"\n >\n {offerView ? (\n <>\n <StyledViewSwitcherPromptTitle id={offerTitleId}>\n {offerTitle\n ? offerTitle(offerView)\n : `Now in ${offerView.label}`}\n </StyledViewSwitcherPromptTitle>\n <StyledViewSwitcherPrompt\n aria-labelledby={offerTitleId}\n className=\"c-view-switcher__prompt\"\n data-phase={offerPhase}\n >\n <PillButton\n ref={offerActionRef}\n type=\"button\"\n tone=\"accent\"\n icon={offerPhase === \"applied\" ? <CheckIcon /> : undefined}\n placeholder={\n offerPhase === \"applied\" ? appliedLabel : applyToAllLabel\n }\n onClick={applyToAll}\n />\n {offerPhase === \"applied\" ? null : (\n <PillButton\n type=\"button\"\n tone=\"accent\"\n iconOnly\n icon={<CloseIcon />}\n aria-label={dismissLabel}\n className=\"c-view-switcher__dismiss\"\n onClick={dismiss}\n />\n )}\n </StyledViewSwitcherPrompt>\n </>\n ) : null}\n {offerView\n ? null\n : views.map((view, index) => {\n const checked = view.id === value;\n\n return (\n <Tooltip key={view.id} title={view.label} placement=\"bottom\">\n <StyledViewSwitcherOption\n ref={(node: HTMLButtonElement | null) => {\n optionRefs.current[view.id] = node;\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n aria-label={view.label}\n tabIndex={view.id === tabStopId ? 0 : -1}\n className=\"c-view-switcher__option\"\n onClick={() => select(view.id)}\n onKeyDown={(event: KeyboardEvent<HTMLButtonElement>) =>\n handleOptionKeyDown(event, index)\n }\n >\n {view.icon}\n </StyledViewSwitcherOption>\n </Tooltip>\n );\n })}\n </StyledViewSwitcherTrack>\n </StyledViewSwitcher>\n );\n }\n);\n\nViewSwitcher.displayName = \"ViewSwitcher\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAEVC,UAAU,EAIVC,WAAW,EACXC,SAAS,EACTC,KAAK,EACLC,eAAe,EACfC,MAAM,EACNC,QAAQ,QACH,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,kBAAkB,EAClBC,wBAAwB,EACxBC,wBAAwB,EACxBC,6BAA6B,EAC7BC,uBAAuB,EACvBC,wBAAwB,EACxBC,sBAAsB,EACtBC,uBAAuB,EACvBC,uBAAuB,QAClB,UAAU;AACjB,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,SAASC,SAAS,EAAEC,SAAS,QAAQ,UAAU;AAC/C,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,OAAO,QAAQ,YAAY;AA8BpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,gBAAGtB,UAAU,CACpC,CAAAuB,IAAA,EAgBEC,GAAG,KACA;EAAA,IAAAC,MAAA;EAAA,IAfDC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IACLC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IAAAC,cAAA,GAAAN,IAAA,CACR,YAAY;IAAEO,SAAS,GAAAD,cAAA,cAAG,MAAM,GAAAA,cAAA;IAChCE,YAAY,GAAAR,IAAA,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A0B;IACpCoG,OAAO,EAAEV;EAAQ,CAClB,CAEqB,CAC1B,CAAC,GACD,IAAI,EACP/D,SAAS,GACN,IAAI,GACJxC,KAAK,CAACmH,GAAG,CAAC,CAACC,IAAI,EAAEjC,KAAK,KAAK;IACzB,MAAMkC,OAAO,GAAGD,IAAI,CAAC9E,EAAE,KAAKrC,KAAK;IAEjC,oBACE5B,KAAA,CAAAmI,aAAA,CAAC7G,OAAO;MAACmG,GAAG,EAAEsB,IAAI,CAAC9E,EAAG;MAACgF,KAAK,EAAEF,IAAI,CAACR,KAAM;MAACW,SAAS,EAAC;IAAQ,gBAC1DlJ,KAAA,CAAAmI,aAAA,CAACzH,wBAAwB;MACvBe,GAAG,EAAGmD,IAA8B,IAAK;QACvC3B,UAAU,CAACwB,OAAO,CAACsE,IAAI,CAAC9E,EAAE,CAAC,GAAGW,IAAI;MACpC,CAAE;MACF4D,IAAI,EAAC,QAAQ;MACbH,IAAI,EAAC,OAAO;MACZ,gBAAcW,OAAQ;MACtB,cAAYD,IAAI,CAACR,KAAM;MACvBY,QAAQ,EAAEJ,IAAI,CAAC9E,EAAE,KAAKC,SAAS,GAAG,CAAC,GAAG,CAAC,CAAE;MACzC1B,SAAS,EAAC,yBAAyB;MACnCoG,OAAO,EAAEA,CAAA,KAAMtE,MAAM,CAACyE,IAAI,CAAC9E,EAAE,CAAE;MAC/BxB,SAAS,EAAGgE,KAAuC,IACjDI,mBAAmB,CAACJ,KAAK,EAAEK,KAAK;IACjC,GAEAiC,IAAI,CAACL,IACkB,CACnB,CAAC;EAEd,CAAC,CACkB,CACP,CAAC;AAEzB,CACF,CAAC;AAEDnH,YAAY,CAAC6H,WAAW,GAAG,cAAc","ignoreList":[]}
@@ -1,4 +1,3 @@
1
1
  export * from "./ViewSwitcher";
2
2
  export * from "./ViewSwitcherMenu";
3
- export * from "./ViewIllustration";
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ViewSwitcher/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ViewSwitcher/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
@@ -1,4 +1,3 @@
1
1
  export * from "./ViewSwitcher";
2
2
  export * from "./ViewSwitcherMenu";
3
- export * from "./ViewIllustration";
4
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ViewSwitcher/index.ts"],"sourcesContent":["export * from \"./ViewSwitcher\";\nexport * from \"./ViewSwitcherMenu\";\nexport * from \"./ViewIllustration\";\n"],"mappings":"AAAA,cAAc,gBAAgB;AAC9B,cAAc,oBAAoB;AAClC,cAAc,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ViewSwitcher/index.ts"],"sourcesContent":["export * from \"./ViewSwitcher\";\nexport * from \"./ViewSwitcherMenu\";\n"],"mappings":"AAAA,cAAc,gBAAgB;AAC9B,cAAc,oBAAoB","ignoreList":[]}
@@ -146,6 +146,7 @@ export * from "./TicketPerforation";
146
146
  export * from "./MessageBubble";
147
147
  export * from "./DockedCard";
148
148
  export * from "./NoteCard";
149
+ export * from "./NotebookCard";
149
150
  export * from "./NotebookTile";
150
151
  export * from "./ListSection";
151
152
  //# sourceMappingURL=index.d.ts.map