@flamingo-stack/openframe-frontend-core 0.0.825 → 0.0.826
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/build/export-map.json +1 -1
- package/dist/{case-study-card-IZBMHA6R.cjs → case-study-card-O4IQCJAX.cjs} +5 -5
- package/dist/{chunk-QOAA7ZHB.cjs → chunk-2HQNXX2K.cjs} +2 -2
- package/dist/{chunk-2U7GXE3T.cjs → chunk-2TQJSB62.cjs} +2157 -811
- package/dist/{chunk-NONMZ5WJ.cjs → chunk-2VLPXUQK.cjs} +14 -83
- package/dist/{chunk-7DJWIVQC.cjs → chunk-37OYBX7W.cjs} +36 -36
- package/dist/{chunk-OBQ5WUNG.cjs → chunk-3B6ZE4EZ.cjs} +29 -29
- package/dist/{chunk-AO6YVNAH.cjs → chunk-5AQKXEMI.cjs} +979 -1357
- package/dist/{chunk-25HBH4J6.cjs → chunk-5BM7X4GA.cjs} +2 -2
- package/dist/{chunk-47SHKOCY.cjs → chunk-63T2KKDZ.cjs} +86 -86
- package/dist/{chunk-MHR4C465.cjs → chunk-6G4WRMEM.cjs} +3 -3
- package/dist/{chunk-AUBR3FGY.cjs → chunk-74GWFGH2.cjs} +28 -28
- package/dist/{chunk-467T3LCG.cjs → chunk-7PZQ7SHB.cjs} +49 -32
- package/dist/{chunk-6LVJKPR3.cjs → chunk-AJM4YZTW.cjs} +8 -8
- package/dist/{chunk-2XLPRW7V.cjs → chunk-BIG3O33P.cjs} +6 -2
- package/dist/chunk-BMQLM2NU.cjs +40 -0
- package/dist/{chunk-DVHSYPDB.cjs → chunk-DAKGX2WF.cjs} +2 -2
- package/dist/{chunk-2IWAHBCC.cjs → chunk-DRSFR5AC.cjs} +159 -159
- package/dist/{chunk-IJCSQFLD.cjs → chunk-DU6AF77X.cjs} +83 -121
- package/dist/{chunk-NL34HKLS.cjs → chunk-EJNDTSKY.cjs} +91 -91
- package/dist/{chunk-SBFBNOKU.cjs → chunk-ENMPSEEQ.cjs} +4 -4
- package/dist/{chunk-ZECG6GU5.cjs → chunk-F2J5WN6U.cjs} +2 -2
- package/dist/{chunk-BOS7OIC4.cjs → chunk-GRHF5SWL.cjs} +5 -2
- package/dist/{chunk-Z7BLMJEI.cjs → chunk-GZAPOCKS.cjs} +54 -54
- package/dist/{chunk-5S2GW6YG.cjs → chunk-HJAPXKWK.cjs} +17 -17
- package/dist/{chunk-P25RVNGX.cjs → chunk-HQ4FKHOO.cjs} +249 -108
- package/dist/{chunk-ZRDVFADQ.cjs → chunk-IBD2FPSX.cjs} +75 -9
- package/dist/{chunk-T266OITJ.cjs → chunk-IKWQW3YJ.cjs} +45 -45
- package/dist/{chunk-B7NSH7IK.cjs → chunk-IWQ2LJGW.cjs} +5 -5
- package/dist/{chunk-MALCUN2G.cjs → chunk-JDR72QFU.cjs} +12 -14
- package/dist/{chunk-EHANO6UE.cjs → chunk-K34TTZAE.cjs} +9 -129
- package/dist/{chunk-QDDBOCG3.cjs → chunk-KPGKTEEB.cjs} +2 -2
- package/dist/{chunk-4IY5FKYL.cjs → chunk-MDEOCOIE.cjs} +23 -23
- package/dist/chunk-OEP5KAT6.cjs +56 -0
- package/dist/chunk-OT6P57ZS.cjs +94 -0
- package/dist/{chunk-QQT23JJ7.cjs → chunk-PBHP3FHO.cjs} +4 -4
- package/dist/{chunk-IMMTH3F3.cjs → chunk-PJY3SYCS.cjs} +29 -27
- package/dist/{chunk-N7IDLF2G.cjs → chunk-PWAKRRRO.cjs} +1283 -268
- package/dist/{chunk-UEULXVW2.cjs → chunk-QS6AKUUL.cjs} +22 -22
- package/dist/{chunk-BN7QENV7.cjs → chunk-QYJZDEG7.cjs} +6 -6
- package/dist/{chunk-NPNZAAOB.cjs → chunk-S6UJEW4G.cjs} +2 -2
- package/dist/{chunk-XJMLZ63Y.cjs → chunk-TJG2BJ5J.cjs} +4 -4
- package/dist/{chunk-QOOMUGF2.cjs → chunk-TYJ73DHW.cjs} +15 -15
- package/dist/{chunk-A34UNP5V.cjs → chunk-W4VEDSAX.cjs} +80 -11
- package/dist/{chunk-DNZCSPMU.cjs → chunk-WGMU45NV.cjs} +20 -20
- package/dist/{chunk-APTFXX2C.cjs → chunk-XDHQC4XH.cjs} +46 -46
- package/dist/{cloud-tenants-M4VFFN33.cjs → cloud-tenants-F67KQ5GC.cjs} +108 -106
- package/dist/components/case-studies/index.cjs +124 -122
- package/dist/components/chat/approval-batch-message.d.ts.map +1 -1
- package/dist/components/chat/approval-batch-message.js +2 -2
- package/dist/components/chat/chat-archive-page.d.ts +7 -0
- package/dist/components/chat/chat-archive-page.d.ts.map +1 -1
- package/dist/components/chat/chat-archive-page.js +9 -0
- package/dist/components/chat/chat-composer.d.ts +24 -4
- package/dist/components/chat/chat-composer.d.ts.map +1 -1
- package/dist/components/chat/chat-composer.js +90 -48
- package/dist/components/chat/chat-context-memory-bar.d.ts +4 -1
- package/dist/components/chat/chat-context-memory-bar.d.ts.map +1 -1
- package/dist/components/chat/chat-context-memory-bar.js +8 -5
- package/dist/components/chat/chat-context-picker.d.ts +8 -1
- package/dist/components/chat/chat-context-picker.d.ts.map +1 -1
- package/dist/components/chat/chat-context-picker.js +32 -9
- package/dist/components/chat/chat-header-rename-field.d.ts +18 -0
- package/dist/components/chat/chat-header-rename-field.d.ts.map +1 -0
- package/dist/components/chat/chat-header-rename-field.js +49 -0
- package/dist/components/chat/chat-input.d.ts.map +1 -1
- package/dist/components/chat/chat-input.js +5 -0
- package/dist/components/chat/composer-sheet.d.ts +44 -0
- package/dist/components/chat/composer-sheet.d.ts.map +1 -0
- package/dist/components/chat/composer-sheet.js +140 -0
- package/dist/components/chat/embeddable-chat.d.ts +114 -1
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +328 -215
- package/dist/components/chat/index.cjs +118 -103
- package/dist/components/chat/index.d.ts +6 -0
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +9 -0
- package/dist/components/chat/mingo-chat-day-groups.d.ts +18 -0
- package/dist/components/chat/mingo-chat-day-groups.d.ts.map +1 -0
- package/dist/components/chat/mingo-chat-day-groups.js +45 -0
- package/dist/components/chat/mingo-chat-header.d.ts +34 -6
- package/dist/components/chat/mingo-chat-header.d.ts.map +1 -1
- package/dist/components/chat/mingo-chat-header.js +44 -7
- package/dist/components/chat/mingo-chat-history-section.d.ts +30 -0
- package/dist/components/chat/mingo-chat-history-section.d.ts.map +1 -0
- package/dist/components/chat/mingo-chat-history-section.js +500 -0
- package/dist/components/chat/mingo-chat-history.d.ts +5 -2
- package/dist/components/chat/mingo-chat-history.d.ts.map +1 -1
- package/dist/components/chat/mingo-chat-history.js +26 -30
- package/dist/components/chat/mingo-chat-list-shared.d.ts +136 -0
- package/dist/components/chat/mingo-chat-list-shared.d.ts.map +1 -0
- package/dist/components/chat/mingo-chat-list-shared.js +76 -0
- package/dist/components/chat/mingo-chat-rail.d.ts +19 -51
- package/dist/components/chat/mingo-chat-rail.d.ts.map +1 -1
- package/dist/components/chat/mingo-chat-rail.js +23 -45
- package/dist/components/chat/mingo-edge-light.d.ts +13 -0
- package/dist/components/chat/mingo-edge-light.d.ts.map +1 -0
- package/dist/components/chat/mingo-edge-light.js +17 -0
- package/dist/components/chat/mingo-history-rail.d.ts +5 -4
- package/dist/components/chat/mingo-history-rail.d.ts.map +1 -1
- package/dist/components/chat/mingo-history-rail.js +5 -10
- package/dist/components/chat/mingo-quick-action-wall.d.ts +27 -0
- package/dist/components/chat/mingo-quick-action-wall.d.ts.map +1 -0
- package/dist/components/chat/mingo-quick-action-wall.js +41 -0
- package/dist/components/chat/mingo-welcome.d.ts.map +1 -1
- package/dist/components/chat/mingo-welcome.js +6 -20
- package/dist/components/chat/model-display.d.ts.map +1 -1
- package/dist/components/chat/model-display.js +38 -9
- package/dist/components/chat/tool-execution-display.d.ts.map +1 -1
- package/dist/components/chat/tool-execution-display.js +15 -1
- package/dist/components/chat/types/component.types.d.ts +13 -1
- package/dist/components/chat/types/component.types.d.ts.map +1 -1
- package/dist/components/chat/utils/chat-day-label.d.ts +8 -0
- package/dist/components/chat/utils/chat-day-label.d.ts.map +1 -0
- package/dist/components/chat/utils/chat-day-label.js +21 -0
- package/dist/components/contact/index.cjs +109 -107
- package/dist/components/docs/index.cjs +112 -110
- package/dist/components/embeds/index.cjs +109 -107
- package/dist/components/faq/index.cjs +110 -108
- package/dist/components/features/board/board-column.d.ts +3 -1
- package/dist/components/features/board/board-column.d.ts.map +1 -1
- package/dist/components/features/board/board-column.js +6 -2
- package/dist/components/features/board/board.d.ts +6 -0
- package/dist/components/features/board/board.d.ts.map +1 -1
- package/dist/components/features/board/board.js +14 -3
- package/dist/components/features/board/touch-board.d.ts +1 -1
- package/dist/components/features/board/touch-board.d.ts.map +1 -1
- package/dist/components/features/board/touch-board.js +3 -1
- package/dist/components/features/index.cjs +108 -106
- package/dist/components/features/notifications/approval-request-notification-tile.d.ts +7 -1
- package/dist/components/features/notifications/approval-request-notification-tile.d.ts.map +1 -1
- package/dist/components/features/notifications/approval-request-notification-tile.js +1 -1
- package/dist/components/features/notifications/notification-drawer.d.ts +6 -1
- package/dist/components/features/notifications/notification-drawer.d.ts.map +1 -1
- package/dist/components/features/notifications/notification-drawer.js +3 -2
- package/dist/components/features/notifications/notification-tile.d.ts +4 -1
- package/dist/components/features/notifications/notification-tile.d.ts.map +1 -1
- package/dist/components/features/notifications/notification-tile.js +9 -7
- package/dist/components/features/time-tracker/time-tracker-header-button.d.ts +18 -1
- package/dist/components/features/time-tracker/time-tracker-header-button.d.ts.map +1 -1
- package/dist/components/features/time-tracker/time-tracker-header-button.js +31 -7
- package/dist/components/help-center-pages/index.cjs +217 -215
- package/dist/components/icons-v2-generated/icon-loaders.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/icon-loaders.js +1 -0
- package/dist/components/icons-v2-generated/icon-names.js +1 -1
- package/dist/components/icons-v2-generated/index.cjs +90 -86
- package/dist/components/icons-v2-generated/loaders/dots-loader-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/loaders/dots-loader-icon.js +21 -24
- package/dist/components/icons-v2-generated/logos/index.d.ts +1 -0
- package/dist/components/icons-v2-generated/logos/index.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/logos/index.js +2 -0
- package/dist/components/icons-v2-generated/logos/mingo-logo-icon.d.ts +9 -0
- package/dist/components/icons-v2-generated/logos/mingo-logo-icon.d.ts.map +1 -0
- package/dist/components/icons-v2-generated/logos/mingo-logo-icon.js +36 -0
- package/dist/components/index.cjs +215 -182
- package/dist/components/meeting-scheduler/index.cjs +182 -180
- package/dist/components/navigation/account-popover.d.ts +62 -0
- package/dist/components/navigation/account-popover.d.ts.map +1 -0
- package/dist/components/navigation/account-popover.js +138 -0
- package/dist/components/navigation/app-header.d.ts +36 -2
- package/dist/components/navigation/app-header.d.ts.map +1 -1
- package/dist/components/navigation/app-header.js +28 -24
- package/dist/components/navigation/app-layout-context.d.ts +17 -0
- package/dist/components/navigation/app-layout-context.d.ts.map +1 -1
- package/dist/components/navigation/app-layout-context.js +9 -1
- package/dist/components/navigation/app-layout.d.ts +93 -1
- package/dist/components/navigation/app-layout.d.ts.map +1 -1
- package/dist/components/navigation/app-layout.js +149 -30
- package/dist/components/navigation/header-button.d.ts +11 -1
- package/dist/components/navigation/header-button.d.ts.map +1 -1
- package/dist/components/navigation/header-button.js +16 -5
- package/dist/components/navigation/header-mingo-button.d.ts.map +1 -1
- package/dist/components/navigation/header-mingo-button.js +6 -5
- package/dist/components/navigation/index.cjs +120 -109
- package/dist/components/navigation/index.d.ts +10 -1
- package/dist/components/navigation/index.d.ts.map +1 -1
- package/dist/components/navigation/index.js +8 -0
- package/dist/components/navigation/mingo-ai-button.d.ts.map +1 -1
- package/dist/components/navigation/mingo-ai-button.js +2 -1
- package/dist/components/navigation/mobile-burger-menu.d.ts.map +1 -1
- package/dist/components/navigation/mobile-burger-menu.js +155 -39
- package/dist/components/navigation/navigation-sidebar-grouped.d.ts +57 -0
- package/dist/components/navigation/navigation-sidebar-grouped.d.ts.map +1 -0
- package/dist/components/navigation/navigation-sidebar-grouped.js +365 -0
- package/dist/components/navigation/navigation-sidebar-match.d.ts +37 -0
- package/dist/components/navigation/navigation-sidebar-match.d.ts.map +1 -0
- package/dist/components/navigation/navigation-sidebar-match.js +85 -0
- package/dist/components/navigation/navigation-sidebar-slot.d.ts +7 -0
- package/dist/components/navigation/navigation-sidebar-slot.d.ts.map +1 -0
- package/dist/components/navigation/navigation-sidebar-slot.js +11 -0
- package/dist/components/navigation/navigation-sidebar-toggle.d.ts +7 -1
- package/dist/components/navigation/navigation-sidebar-toggle.d.ts.map +1 -1
- package/dist/components/navigation/navigation-sidebar-toggle.js +52 -23
- package/dist/components/navigation/navigation-sidebar.d.ts +13 -1
- package/dist/components/navigation/navigation-sidebar.d.ts.map +1 -1
- package/dist/components/navigation/navigation-sidebar.js +188 -52
- package/dist/components/navigation/notifications-bell-button.d.ts +28 -0
- package/dist/components/navigation/notifications-bell-button.d.ts.map +1 -0
- package/dist/components/navigation/notifications-bell-button.js +44 -0
- package/dist/components/navigation/ticket-alerts-button.d.ts +7 -1
- package/dist/components/navigation/ticket-alerts-button.d.ts.map +1 -1
- package/dist/components/navigation/ticket-alerts-button.js +3 -2
- package/dist/components/onboarding-guides/index.cjs +111 -109
- package/dist/components/product-demo/index.cjs +119 -117
- package/dist/components/related-content/index.cjs +13 -13
- package/dist/components/tickets/index.cjs +115 -113
- package/dist/components/ui/actions-menu.d.ts +6 -1
- package/dist/components/ui/actions-menu.d.ts.map +1 -1
- package/dist/components/ui/actions-menu.js +6 -2
- package/dist/components/ui/fade-preview.d.ts +8 -0
- package/dist/components/ui/fade-preview.d.ts.map +1 -1
- package/dist/components/ui/fade-preview.js +7 -5
- package/dist/components/ui/index.cjs +136 -111
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/mobile-action-bar.d.ts +14 -0
- package/dist/components/ui/mobile-action-bar.d.ts.map +1 -0
- package/dist/components/ui/mobile-action-bar.js +68 -0
- package/dist/components/ui/no-data/no-data-styles.d.ts +1 -1
- package/dist/components/ui/no-data/no-data-styles.d.ts.map +1 -1
- package/dist/components/ui/no-data/no-data-styles.js +1 -1
- package/dist/components/ui/page-actions.d.ts.map +1 -1
- package/dist/components/ui/page-actions.js +24 -8
- package/dist/components/ui/panel-resize-handle.d.ts +6 -2
- package/dist/components/ui/panel-resize-handle.d.ts.map +1 -1
- package/dist/components/ui/panel-resize-handle.js +6 -3
- package/dist/components/ui/square-avatar.d.ts.map +1 -1
- package/dist/components/ui/square-avatar.js +5 -2
- package/dist/{devices-DW5NDXMD.cjs → devices-SJORCARH.cjs} +109 -107
- package/dist/dots-loader-icon-5JXWD6FB.cjs +7 -0
- package/dist/{embeddable-chat-NBJMXEXB.cjs → embeddable-chat-7Z4CEZJL.cjs} +513 -398
- package/dist/hooks/index.cjs +15 -16
- package/dist/hooks/ui/use-content-breakpoint.d.ts +4 -2
- package/dist/hooks/ui/use-content-breakpoint.d.ts.map +1 -1
- package/dist/{icon-loaders-OLGJZGRP.cjs → icon-loaders-SUPEKMBJ.cjs} +2 -1
- package/dist/index.cjs +154 -121
- package/dist/{knowledge-EYJG2TNW.cjs → knowledge-QXILUVEM.cjs} +109 -107
- package/dist/{logs-2LV7DTSL.cjs → logs-E3KQQQD6.cjs} +118 -115
- package/dist/mingo-logo-icon-WGPBSDTF.cjs +7 -0
- package/dist/{policies-HSDYIQBX.cjs → policies-IOYQY6TF.cjs} +112 -110
- package/dist/{remote-session-BQMTIQTU.cjs → remote-session-QGFG5WAL.cjs} +99 -97
- package/dist/{scripts-UI6V7ANQ.cjs → scripts-E5TWWUNP.cjs} +115 -113
- package/dist/{software-update-WMLY7VHH.cjs → software-update-QZGYG4TD.cjs} +112 -110
- package/dist/{tickets-board-TRXOX77R.cjs → tickets-board-KCH6ITUV.cjs} +95 -94
- package/dist/types/navigation.d.ts +131 -0
- package/dist/types/navigation.d.ts.map +1 -1
- package/dist/utils/index.cjs +65 -25
- package/package.json +1 -1
- package/src/components/chat/approval-batch-message.tsx +3 -2
- package/src/components/chat/chat-archive-page.tsx +16 -0
- package/src/components/chat/chat-composer.tsx +131 -61
- package/src/components/chat/chat-context-memory-bar.tsx +27 -17
- package/src/components/chat/chat-context-picker.tsx +45 -11
- package/src/components/chat/chat-header-rename-field.tsx +68 -0
- package/src/components/chat/chat-input.tsx +9 -1
- package/src/components/chat/composer-sheet.tsx +196 -0
- package/src/components/chat/embeddable-chat.tsx +636 -319
- package/src/components/chat/index.ts +6 -0
- package/src/components/chat/mingo-chat-day-groups.ts +62 -0
- package/src/components/chat/mingo-chat-header.tsx +99 -23
- package/src/components/chat/mingo-chat-history-section.tsx +670 -0
- package/src/components/chat/mingo-chat-history.tsx +31 -45
- package/src/components/chat/mingo-chat-list-shared.tsx +244 -0
- package/src/components/chat/mingo-chat-rail.tsx +45 -97
- package/src/components/chat/mingo-edge-light.tsx +25 -0
- package/src/components/chat/mingo-history-rail.tsx +7 -17
- package/src/components/chat/mingo-quick-action-wall.tsx +64 -0
- package/src/components/chat/mingo-welcome.tsx +5 -19
- package/src/components/chat/model-display.tsx +66 -14
- package/src/components/chat/tool-execution-display.tsx +9 -1
- package/src/components/chat/types/component.types.ts +13 -1
- package/src/components/chat/utils/chat-day-label.ts +24 -0
- package/src/components/features/board/board-column.tsx +8 -0
- package/src/components/features/board/board.tsx +16 -2
- package/src/components/features/board/touch-board.tsx +2 -0
- package/src/components/features/notifications/approval-request-notification-tile.tsx +8 -2
- package/src/components/features/notifications/notification-drawer.tsx +7 -1
- package/src/components/features/notifications/notification-tile.tsx +17 -9
- package/src/components/features/time-tracker/time-tracker-header-button.tsx +53 -6
- package/src/components/icons-v2/icon-colors.json +4 -0
- package/src/components/icons-v2-generated/icon-loaders.ts +1 -0
- package/src/components/icons-v2-generated/icon-names.ts +1 -1
- package/src/components/icons-v2-generated/loaders/dots-loader-icon.tsx +18 -27
- package/src/components/icons-v2-generated/logos/index.ts +1 -0
- package/src/components/icons-v2-generated/logos/mingo-logo-icon.tsx +35 -0
- package/src/components/navigation/account-popover.tsx +198 -0
- package/src/components/navigation/app-header.tsx +74 -33
- package/src/components/navigation/app-layout-context.ts +22 -0
- package/src/components/navigation/app-layout.tsx +290 -24
- package/src/components/navigation/header-button.tsx +27 -5
- package/src/components/navigation/header-mingo-button.tsx +6 -5
- package/src/components/navigation/index.ts +19 -0
- package/src/components/navigation/mingo-ai-button.tsx +2 -3
- package/src/components/navigation/mobile-burger-menu.tsx +219 -53
- package/src/components/navigation/navigation-sidebar-grouped.tsx +554 -0
- package/src/components/navigation/navigation-sidebar-match.ts +152 -0
- package/src/components/navigation/navigation-sidebar-slot.ts +12 -0
- package/src/components/navigation/navigation-sidebar-toggle.tsx +39 -6
- package/src/components/navigation/navigation-sidebar.tsx +278 -61
- package/src/components/navigation/notifications-bell-button.tsx +70 -0
- package/src/components/navigation/ticket-alerts-button.tsx +9 -2
- package/src/components/ui/actions-menu.tsx +19 -3
- package/src/components/ui/fade-preview.tsx +13 -6
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/mobile-action-bar.ts +87 -0
- package/src/components/ui/no-data/no-data-styles.ts +5 -2
- package/src/components/ui/page-actions.tsx +38 -11
- package/src/components/ui/panel-resize-handle.tsx +14 -5
- package/src/components/ui/square-avatar.tsx +5 -2
- package/src/hooks/ui/use-content-breakpoint.ts +4 -2
- package/src/styles/ods-interaction-states.css +68 -0
- package/src/types/navigation.ts +140 -0
- package/dist/chunk-C7GIHB3V.cjs +0 -59
- package/dist/dots-loader-icon-RBLX46X7.cjs +0 -7
- package/dist/{chunk-ZOZR3QI2.cjs → chunk-46547WQW.cjs} +0 -0
- package/dist/{video-file-player-IAMWBKEQ.cjs → video-file-player-IHO66P2Q.cjs} +1 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NavigationSidebarItem,
|
|
3
|
+
NavigationSidebarLocation,
|
|
4
|
+
NavigationSidebarMatch,
|
|
5
|
+
NavigationSidebarMatchRule,
|
|
6
|
+
} from '../../types/navigation';
|
|
7
|
+
|
|
8
|
+
/** `isActive: true` — the host said so, and nothing outranks it. */
|
|
9
|
+
const EXPLICIT_SCORE = Number.POSITIVE_INFINITY;
|
|
10
|
+
/** A `match` function — the host deciding outright, above every declarative rule. */
|
|
11
|
+
const FUNCTION_SCORE = Number.MAX_SAFE_INTEGER;
|
|
12
|
+
|
|
13
|
+
/** `/scripts/` → `/scripts`; the root stays `/`. The app exports with trailing slashes. */
|
|
14
|
+
function normalizePathname(pathname: string): string {
|
|
15
|
+
const trimmed = pathname.replace(/\/+$/, '');
|
|
16
|
+
if (trimmed === '') return '/';
|
|
17
|
+
return trimmed.startsWith('/') ? trimmed : `/${trimmed}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Splits `/monitoring/?tab=policies#x` into a normalized pathname and its query. */
|
|
21
|
+
export function parseNavigationLocation(currentPath: string): NavigationSidebarLocation {
|
|
22
|
+
const hashAt = currentPath.indexOf('#');
|
|
23
|
+
const withoutHash = hashAt >= 0 ? currentPath.slice(0, hashAt) : currentPath;
|
|
24
|
+
const queryAt = withoutHash.indexOf('?');
|
|
25
|
+
return {
|
|
26
|
+
pathname: normalizePathname(queryAt >= 0 ? withoutHash.slice(0, queryAt) : withoutHash),
|
|
27
|
+
searchParams: new URLSearchParams(queryAt >= 0 ? withoutHash.slice(queryAt + 1) : ''),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** A rule written as a URL: its pathname is the prefix, every query pair is required. */
|
|
32
|
+
function toRule(rule: string | NavigationSidebarMatchRule): NavigationSidebarMatchRule {
|
|
33
|
+
if (typeof rule !== 'string') return rule;
|
|
34
|
+
const { pathname, searchParams } = parseNavigationLocation(rule);
|
|
35
|
+
const query: Record<string, string> = {};
|
|
36
|
+
searchParams.forEach((value, key) => {
|
|
37
|
+
query[key] = value;
|
|
38
|
+
});
|
|
39
|
+
return { path: pathname, query };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function segmentCount(pathname: string): number {
|
|
43
|
+
return pathname.split('/').filter(Boolean).length;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* How specifically a rule matches the location, or `null` when it does not.
|
|
48
|
+
* Path segments dominate, then the number of query constraints, then `exact` —
|
|
49
|
+
* so `/scripts/schedules` beats `/scripts`, and `/monitoring?tab=policies`
|
|
50
|
+
* beats a bare `/monitoring`.
|
|
51
|
+
*/
|
|
52
|
+
function scoreRule(rule: NavigationSidebarMatchRule, location: NavigationSidebarLocation): number | null {
|
|
53
|
+
const path = normalizePathname(rule.path);
|
|
54
|
+
const { pathname, searchParams } = location;
|
|
55
|
+
// `/` as a prefix would match every page; it only ever means the root itself.
|
|
56
|
+
const pathMatches =
|
|
57
|
+
rule.exact || path === '/' ? pathname === path : pathname === path || pathname.startsWith(`${path}/`);
|
|
58
|
+
if (!pathMatches) return null;
|
|
59
|
+
|
|
60
|
+
const constraints = Object.entries(rule.query ?? {});
|
|
61
|
+
for (const [key, expected] of constraints) {
|
|
62
|
+
const accepted: ReadonlyArray<string | null> = Array.isArray(expected) ? expected : [expected];
|
|
63
|
+
if (!accepted.includes(searchParams.get(key))) return null;
|
|
64
|
+
}
|
|
65
|
+
return segmentCount(path) * 1000 + constraints.length * 10 + (rule.exact ? 1 : 0);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function scoreMatch(match: NavigationSidebarMatch, location: NavigationSidebarLocation): number | null {
|
|
69
|
+
if (typeof match === 'function') return match(location) ? FUNCTION_SCORE : null;
|
|
70
|
+
// `Array.isArray` does not narrow a ReadonlyArray union, hence the casts.
|
|
71
|
+
const rules = Array.isArray(match)
|
|
72
|
+
? (match as ReadonlyArray<string | NavigationSidebarMatchRule>)
|
|
73
|
+
: [match as string | NavigationSidebarMatchRule];
|
|
74
|
+
let best: number | null = null;
|
|
75
|
+
for (const rule of rules) {
|
|
76
|
+
const score = scoreRule(toRule(rule), location);
|
|
77
|
+
if (score !== null && (best === null || score > best)) best = score;
|
|
78
|
+
}
|
|
79
|
+
return best;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* How strongly an entry claims the current page, or `null` for "not this one".
|
|
84
|
+
* `isActive`, when the host set it, is final either way; otherwise `match` (or
|
|
85
|
+
* the entry's own `path`) is checked against the location, when there is one.
|
|
86
|
+
*/
|
|
87
|
+
export function scoreNavigationItem(
|
|
88
|
+
item: NavigationSidebarItem,
|
|
89
|
+
location: NavigationSidebarLocation | null,
|
|
90
|
+
): number | null {
|
|
91
|
+
if (item.isActive !== undefined) return item.isActive ? EXPLICIT_SCORE : null;
|
|
92
|
+
if (!location) return null;
|
|
93
|
+
const match = item.match ?? item.path;
|
|
94
|
+
return match === undefined ? null : scoreMatch(match, location);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface NavigationActiveState {
|
|
98
|
+
/** The ONE entry that is the current page (a child, in a grouped config), or null. */
|
|
99
|
+
activeId: string | null;
|
|
100
|
+
/**
|
|
101
|
+
* The top-level entry with children that holds the active entry — or is it,
|
|
102
|
+
* when a parent matched itself and none of its children did. The group that
|
|
103
|
+
* is open by default.
|
|
104
|
+
*/
|
|
105
|
+
groupId: string | null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface ResolveNavigationActiveOptions {
|
|
109
|
+
/** Pathname + query of the current page; without it only `isActive` counts. */
|
|
110
|
+
currentPath?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Look into `children` (one level) — the grouped variant. The flat variant
|
|
113
|
+
* never draws children, so it never resolves to one either: with this off the
|
|
114
|
+
* answer is `items.find(item => item.isActive)` for a config that sets
|
|
115
|
+
* `isActive`, exactly as before.
|
|
116
|
+
*/
|
|
117
|
+
includeChildren?: boolean;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Exactly one active entry for the whole tree: the highest-scoring claim, the
|
|
122
|
+
* deeper one on a tie (a parent the host marked active beside its active child
|
|
123
|
+
* yields to the child), the first in document order after that.
|
|
124
|
+
*/
|
|
125
|
+
export function resolveNavigationActive(
|
|
126
|
+
items: readonly NavigationSidebarItem[],
|
|
127
|
+
{ currentPath, includeChildren = false }: ResolveNavigationActiveOptions = {},
|
|
128
|
+
): NavigationActiveState {
|
|
129
|
+
const location = currentPath === undefined ? null : parseNavigationLocation(currentPath);
|
|
130
|
+
const candidates: Array<{ item: NavigationSidebarItem; depth: number; top: NavigationSidebarItem }> = [];
|
|
131
|
+
for (const item of items) {
|
|
132
|
+
candidates.push({ item, depth: 0, top: item });
|
|
133
|
+
if (includeChildren) {
|
|
134
|
+
for (const child of item.children ?? []) candidates.push({ item: child, depth: 1, top: item });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
let best: { id: string; score: number; depth: number; top: NavigationSidebarItem } | null = null;
|
|
139
|
+
for (const { item, depth, top } of candidates) {
|
|
140
|
+
const score = scoreNavigationItem(item, location);
|
|
141
|
+
if (score === null) continue;
|
|
142
|
+
if (!best || score > best.score || (score === best.score && depth > best.depth)) {
|
|
143
|
+
best = { id: item.id, score, depth, top };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (!best) return { activeId: null, groupId: null };
|
|
148
|
+
return {
|
|
149
|
+
activeId: best.id,
|
|
150
|
+
groupId: includeChildren && (best.top.children?.length ?? 0) > 0 ? best.top.id : null,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { NavigationSidebarSlot, NavigationSidebarSlotState } from '../../types/navigation';
|
|
3
|
+
|
|
4
|
+
/** Whether the host passed anything to draw — `false` / `null` count as nothing, like in JSX. */
|
|
5
|
+
export function hasNavigationSidebarSlot(slot: NavigationSidebarSlot | undefined): slot is NavigationSidebarSlot {
|
|
6
|
+
return slot !== undefined && slot !== null && slot !== false;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** A slot's content for the sidebar's current state (see `NavigationSidebarSlot`). */
|
|
10
|
+
export function renderNavigationSidebarSlot(slot: NavigationSidebarSlot, state: NavigationSidebarSlotState): ReactNode {
|
|
11
|
+
return typeof slot === 'function' ? slot(state) : slot;
|
|
12
|
+
}
|
|
@@ -8,16 +8,38 @@ export interface NavigationSidebarToggleProps {
|
|
|
8
8
|
minimized: boolean;
|
|
9
9
|
showLabel: boolean;
|
|
10
10
|
onToggle: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* The grouped variant's footer: a 44px row cell inset like the tree's rows,
|
|
13
|
+
* with their hover and a 20px chevron on their icons' line, and the label
|
|
14
|
+
* beside it. Default false: the flat sidebar's 56px row with a 24px chevron.
|
|
15
|
+
*/
|
|
16
|
+
compact?: boolean;
|
|
11
17
|
}
|
|
12
18
|
|
|
13
|
-
export function NavigationSidebarToggle({
|
|
19
|
+
export function NavigationSidebarToggle({
|
|
20
|
+
minimized,
|
|
21
|
+
showLabel,
|
|
22
|
+
onToggle,
|
|
23
|
+
compact = false,
|
|
24
|
+
}: NavigationSidebarToggleProps) {
|
|
14
25
|
return (
|
|
15
|
-
<div
|
|
26
|
+
<div
|
|
27
|
+
className={cn(
|
|
28
|
+
'border-t border-ods-border',
|
|
29
|
+
compact && 'px-[var(--spacing-system-xsf)] py-[var(--spacing-system-xxs)]',
|
|
30
|
+
)}
|
|
31
|
+
>
|
|
16
32
|
<Button
|
|
17
33
|
variant="row"
|
|
18
34
|
onClick={onToggle}
|
|
19
|
-
|
|
20
|
-
|
|
35
|
+
className={cn(
|
|
36
|
+
// Compact: the tree's row geometry — inset, rounded, the chevron on the
|
|
37
|
+
// rows' icon line in both widths — so the rail's cells are all one kind.
|
|
38
|
+
// Otherwise the sidebar's row height (its entries are `h-14` too).
|
|
39
|
+
compact
|
|
40
|
+
? 'h-11 gap-0 overflow-hidden pl-[var(--spacing-system-xsf)] pr-0 transition-[padding,background-color] duration-300 [transition-timing-function:cubic-bezier(0.2,0,0,1)] @[140px]/of-nav-sidebar:pr-[var(--spacing-system-xsf)] motion-reduce:transition-none'
|
|
41
|
+
: 'h-14',
|
|
42
|
+
)}
|
|
21
43
|
title={minimized ? 'Hide Menu' : undefined}
|
|
22
44
|
aria-label={'Hide Menu'}
|
|
23
45
|
>
|
|
@@ -31,13 +53,24 @@ export function NavigationSidebarToggle({ minimized, showLabel, onToggle }: Navi
|
|
|
31
53
|
Collapsed is the default because container queries are min-width —
|
|
32
54
|
the rail is narrower than every threshold, so it needs no query of
|
|
33
55
|
its own. */}
|
|
34
|
-
<Chevrons03LeftIcon
|
|
56
|
+
<Chevrons03LeftIcon
|
|
57
|
+
className={cn(
|
|
58
|
+
'rotate-180 text-ods-text-secondary transition-transform duration-300 @[140px]/of-nav-sidebar:rotate-0',
|
|
59
|
+
compact ? 'size-5' : 'h-6 w-6',
|
|
60
|
+
)}
|
|
61
|
+
/>
|
|
35
62
|
</div>
|
|
36
63
|
|
|
37
64
|
<span
|
|
38
65
|
className={cn(
|
|
39
66
|
'flex-1 truncate text-left transition-[opacity,margin-left] duration-300 text-h4',
|
|
40
|
-
showLabel
|
|
67
|
+
// Compact: the width, not `showLabel`, says when it is the rail — the
|
|
68
|
+
// label fades as the width crosses 140px, as the rows' labels do.
|
|
69
|
+
compact
|
|
70
|
+
? 'ml-[var(--spacing-system-xs)] min-w-0 opacity-0 duration-150 @[140px]/of-nav-sidebar:opacity-100'
|
|
71
|
+
: showLabel
|
|
72
|
+
? 'ml-[var(--spacing-system-xs)] opacity-100'
|
|
73
|
+
: 'ml-0 opacity-0',
|
|
41
74
|
)}
|
|
42
75
|
aria-hidden={!showLabel}
|
|
43
76
|
>
|