@korzun/design 0.0.0-stage → 0.0.2
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/LICENSE +1 -0
- package/README.md +73 -2
- package/dist/component/card/index.d.ts +15 -0
- package/dist/component/card/index.d.ts.map +1 -0
- package/dist/component/card/index.js +34 -0
- package/dist/component/card/index.js.map +1 -0
- package/dist/component/card/style.d.ts +5 -0
- package/dist/component/card/style.d.ts.map +1 -0
- package/dist/component/card/style.js +69 -0
- package/dist/component/card/style.js.map +1 -0
- package/dist/component/card-divider/index.d.ts +10 -0
- package/dist/component/card-divider/index.d.ts.map +1 -0
- package/dist/component/card-divider/index.js +23 -0
- package/dist/component/card-divider/index.js.map +1 -0
- package/dist/component/card-divider/style.d.ts +5 -0
- package/dist/component/card-divider/style.d.ts.map +1 -0
- package/dist/component/card-divider/style.js +48 -0
- package/dist/component/card-divider/style.js.map +1 -0
- package/dist/component/card-row/index.d.ts +6 -0
- package/dist/component/card-row/index.d.ts.map +1 -0
- package/dist/component/card-row/index.js +16 -0
- package/dist/component/card-row/index.js.map +1 -0
- package/dist/component/card-row/style.d.ts +5 -0
- package/dist/component/card-row/style.d.ts.map +1 -0
- package/dist/component/card-row/style.js +13 -0
- package/dist/component/card-row/style.js.map +1 -0
- package/dist/component/collapsible-section/index.d.ts +11 -0
- package/dist/component/collapsible-section/index.d.ts.map +1 -0
- package/dist/component/collapsible-section/index.js +20 -0
- package/dist/component/collapsible-section/index.js.map +1 -0
- package/dist/component/collapsible-section/style.d.ts +5 -0
- package/dist/component/collapsible-section/style.d.ts.map +1 -0
- package/dist/component/collapsible-section/style.js +36 -0
- package/dist/component/collapsible-section/style.js.map +1 -0
- package/dist/component/empty-state/index.d.ts +22 -0
- package/dist/component/empty-state/index.d.ts.map +1 -0
- package/dist/component/empty-state/index.js +19 -0
- package/dist/component/empty-state/index.js.map +1 -0
- package/dist/component/empty-state/style.d.ts +5 -0
- package/dist/component/empty-state/style.d.ts.map +1 -0
- package/dist/component/empty-state/style.js +30 -0
- package/dist/component/empty-state/style.js.map +1 -0
- package/dist/component/index.d.ts +16 -0
- package/dist/component/index.d.ts.map +1 -0
- package/dist/component/index.js +15 -0
- package/dist/component/index.js.map +1 -0
- package/dist/component/meta-line/index.d.ts +21 -0
- package/dist/component/meta-line/index.d.ts.map +1 -0
- package/dist/component/meta-line/index.js +24 -0
- package/dist/component/meta-line/index.js.map +1 -0
- package/dist/component/meta-line/style.d.ts +5 -0
- package/dist/component/meta-line/style.d.ts.map +1 -0
- package/dist/component/meta-line/style.js +35 -0
- package/dist/component/meta-line/style.js.map +1 -0
- package/dist/component/metadata/index.d.ts +6 -0
- package/dist/component/metadata/index.d.ts.map +1 -0
- package/dist/component/metadata/index.js +7 -0
- package/dist/component/metadata/index.js.map +1 -0
- package/dist/component/metadata/style.d.ts +5 -0
- package/dist/component/metadata/style.d.ts.map +1 -0
- package/dist/component/metadata/style.js +20 -0
- package/dist/component/metadata/style.js.map +1 -0
- package/dist/component/metadata-list/index.d.ts +10 -0
- package/dist/component/metadata-list/index.d.ts.map +1 -0
- package/dist/component/metadata-list/index.js +9 -0
- package/dist/component/metadata-list/index.js.map +1 -0
- package/dist/component/metadata-list/style.d.ts +5 -0
- package/dist/component/metadata-list/style.d.ts.map +1 -0
- package/dist/component/metadata-list/style.js +10 -0
- package/dist/component/metadata-list/style.js.map +1 -0
- package/dist/component/nav-desktop/index.d.ts +6 -0
- package/dist/component/nav-desktop/index.d.ts.map +1 -0
- package/dist/component/nav-desktop/index.js +11 -0
- package/dist/component/nav-desktop/index.js.map +1 -0
- package/dist/component/nav-desktop/style.d.ts +5 -0
- package/dist/component/nav-desktop/style.d.ts.map +1 -0
- package/dist/component/nav-desktop/style.js +94 -0
- package/dist/component/nav-desktop/style.js.map +1 -0
- package/dist/component/nav-mobile/index.d.ts +25 -0
- package/dist/component/nav-mobile/index.d.ts.map +1 -0
- package/dist/component/nav-mobile/index.js +153 -0
- package/dist/component/nav-mobile/index.js.map +1 -0
- package/dist/component/nav-mobile/style.d.ts +5 -0
- package/dist/component/nav-mobile/style.d.ts.map +1 -0
- package/dist/component/nav-mobile/style.js +347 -0
- package/dist/component/nav-mobile/style.js.map +1 -0
- package/dist/component/nav-types.d.ts +12 -0
- package/dist/component/nav-types.d.ts.map +1 -0
- package/dist/component/nav-types.js +2 -0
- package/dist/component/nav-types.js.map +1 -0
- package/dist/component/page/index.d.ts +33 -0
- package/dist/component/page/index.d.ts.map +1 -0
- package/dist/component/page/index.js +20 -0
- package/dist/component/page/index.js.map +1 -0
- package/dist/component/page/style.d.ts +10 -0
- package/dist/component/page/style.d.ts.map +1 -0
- package/dist/component/page/style.js +132 -0
- package/dist/component/page/style.js.map +1 -0
- package/dist/component/progress-indicator/index.d.ts +17 -0
- package/dist/component/progress-indicator/index.d.ts.map +1 -0
- package/dist/component/progress-indicator/index.js +19 -0
- package/dist/component/progress-indicator/index.js.map +1 -0
- package/dist/component/progress-indicator/style.d.ts +5 -0
- package/dist/component/progress-indicator/style.d.ts.map +1 -0
- package/dist/component/progress-indicator/style.js +24 -0
- package/dist/component/progress-indicator/style.js.map +1 -0
- package/dist/component/tag/index.d.ts +9 -0
- package/dist/component/tag/index.d.ts.map +1 -0
- package/dist/component/tag/index.js +15 -0
- package/dist/component/tag/index.js.map +1 -0
- package/dist/component/tag/style.d.ts +5 -0
- package/dist/component/tag/style.d.ts.map +1 -0
- package/dist/component/tag/style.js +28 -0
- package/dist/component/tag/style.js.map +1 -0
- package/dist/component/theme-setting/index.d.ts +2 -0
- package/dist/component/theme-setting/index.d.ts.map +1 -0
- package/dist/component/theme-setting/index.js +14 -0
- package/dist/component/theme-setting/index.js.map +1 -0
- package/dist/component/top-fade/index.d.ts +2 -0
- package/dist/component/top-fade/index.d.ts.map +1 -0
- package/dist/component/top-fade/index.js +9 -0
- package/dist/component/top-fade/index.js.map +1 -0
- package/dist/component/top-fade/style.d.ts +5 -0
- package/dist/component/top-fade/style.d.ts.map +1 -0
- package/dist/component/top-fade/style.js +57 -0
- package/dist/component/top-fade/style.js.map +1 -0
- package/dist/control/action-menu-list/index.d.ts +44 -0
- package/dist/control/action-menu-list/index.d.ts.map +1 -0
- package/dist/control/action-menu-list/index.js +9 -0
- package/dist/control/action-menu-list/index.js.map +1 -0
- package/dist/control/action-menu-list/style.d.ts +5 -0
- package/dist/control/action-menu-list/style.d.ts.map +1 -0
- package/dist/control/action-menu-list/style.js +51 -0
- package/dist/control/action-menu-list/style.js.map +1 -0
- package/dist/control/action-menu-list/use-dismiss.d.ts +3 -0
- package/dist/control/action-menu-list/use-dismiss.d.ts.map +1 -0
- package/dist/control/action-menu-list/use-dismiss.js +25 -0
- package/dist/control/action-menu-list/use-dismiss.js.map +1 -0
- package/dist/control/back-button/index.d.ts +6 -0
- package/dist/control/back-button/index.d.ts.map +1 -0
- package/dist/control/back-button/index.js +20 -0
- package/dist/control/back-button/index.js.map +1 -0
- package/dist/control/back-button/style.d.ts +5 -0
- package/dist/control/back-button/style.d.ts.map +1 -0
- package/dist/control/back-button/style.js +26 -0
- package/dist/control/back-button/style.js.map +1 -0
- package/dist/control/button/index.d.ts +36 -0
- package/dist/control/button/index.d.ts.map +1 -0
- package/dist/control/button/index.js +39 -0
- package/dist/control/button/index.js.map +1 -0
- package/dist/control/button/style.d.ts +24 -0
- package/dist/control/button/style.d.ts.map +1 -0
- package/dist/control/button/style.js +370 -0
- package/dist/control/button/style.js.map +1 -0
- package/dist/control/chips-input/index.d.ts +17 -0
- package/dist/control/chips-input/index.d.ts.map +1 -0
- package/dist/control/chips-input/index.js +77 -0
- package/dist/control/chips-input/index.js.map +1 -0
- package/dist/control/chips-input/style.d.ts +10 -0
- package/dist/control/chips-input/style.d.ts.map +1 -0
- package/dist/control/chips-input/style.js +152 -0
- package/dist/control/chips-input/style.js.map +1 -0
- package/dist/control/confirm-modal/index.d.ts +17 -0
- package/dist/control/confirm-modal/index.d.ts.map +1 -0
- package/dist/control/confirm-modal/index.js +22 -0
- package/dist/control/confirm-modal/index.js.map +1 -0
- package/dist/control/confirm-modal/style.d.ts +5 -0
- package/dist/control/confirm-modal/style.d.ts.map +1 -0
- package/dist/control/confirm-modal/style.js +33 -0
- package/dist/control/confirm-modal/style.js.map +1 -0
- package/dist/control/date-time-input/index.d.ts +21 -0
- package/dist/control/date-time-input/index.d.ts.map +1 -0
- package/dist/control/date-time-input/index.js +35 -0
- package/dist/control/date-time-input/index.js.map +1 -0
- package/dist/control/date-time-input/iso-date.d.ts +25 -0
- package/dist/control/date-time-input/iso-date.d.ts.map +1 -0
- package/dist/control/date-time-input/iso-date.js +51 -0
- package/dist/control/date-time-input/iso-date.js.map +1 -0
- package/dist/control/date-time-input/style.d.ts +5 -0
- package/dist/control/date-time-input/style.d.ts.map +1 -0
- package/dist/control/date-time-input/style.js +72 -0
- package/dist/control/date-time-input/style.js.map +1 -0
- package/dist/control/field-list/index.d.ts +26 -0
- package/dist/control/field-list/index.d.ts.map +1 -0
- package/dist/control/field-list/index.js +11 -0
- package/dist/control/field-list/index.js.map +1 -0
- package/dist/control/field-list/style.d.ts +5 -0
- package/dist/control/field-list/style.d.ts.map +1 -0
- package/dist/control/field-list/style.js +43 -0
- package/dist/control/field-list/style.js.map +1 -0
- package/dist/control/index.d.ts +23 -0
- package/dist/control/index.d.ts.map +1 -0
- package/dist/control/index.js +18 -0
- package/dist/control/index.js.map +1 -0
- package/dist/control/number-input/index.d.ts +12 -0
- package/dist/control/number-input/index.d.ts.map +1 -0
- package/dist/control/number-input/index.js +34 -0
- package/dist/control/number-input/index.js.map +1 -0
- package/dist/control/number-input/style.d.ts +5 -0
- package/dist/control/number-input/style.d.ts.map +1 -0
- package/dist/control/number-input/style.js +50 -0
- package/dist/control/number-input/style.js.map +1 -0
- package/dist/control/page-actions-bar/index.d.ts +11 -0
- package/dist/control/page-actions-bar/index.d.ts.map +1 -0
- package/dist/control/page-actions-bar/index.js +26 -0
- package/dist/control/page-actions-bar/index.js.map +1 -0
- package/dist/control/page-actions-bar/style.d.ts +5 -0
- package/dist/control/page-actions-bar/style.d.ts.map +1 -0
- package/dist/control/page-actions-bar/style.js +63 -0
- package/dist/control/page-actions-bar/style.js.map +1 -0
- package/dist/control/page-actions-menu/index.d.ts +7 -0
- package/dist/control/page-actions-menu/index.d.ts.map +1 -0
- package/dist/control/page-actions-menu/index.js +19 -0
- package/dist/control/page-actions-menu/index.js.map +1 -0
- package/dist/control/page-actions-menu/style.d.ts +5 -0
- package/dist/control/page-actions-menu/style.d.ts.map +1 -0
- package/dist/control/page-actions-menu/style.js +33 -0
- package/dist/control/page-actions-menu/style.js.map +1 -0
- package/dist/control/page-footer-actions/index.d.ts +17 -0
- package/dist/control/page-footer-actions/index.d.ts.map +1 -0
- package/dist/control/page-footer-actions/index.js +14 -0
- package/dist/control/page-footer-actions/index.js.map +1 -0
- package/dist/control/page-footer-actions/style.d.ts +5 -0
- package/dist/control/page-footer-actions/style.d.ts.map +1 -0
- package/dist/control/page-footer-actions/style.js +12 -0
- package/dist/control/page-footer-actions/style.js.map +1 -0
- package/dist/control/popover/index.d.ts +27 -0
- package/dist/control/popover/index.d.ts.map +1 -0
- package/dist/control/popover/index.js +58 -0
- package/dist/control/popover/index.js.map +1 -0
- package/dist/control/popover/style.d.ts +5 -0
- package/dist/control/popover/style.d.ts.map +1 -0
- package/dist/control/popover/style.js +8 -0
- package/dist/control/popover/style.js.map +1 -0
- package/dist/control/segmented-control/index.d.ts +55 -0
- package/dist/control/segmented-control/index.d.ts.map +1 -0
- package/dist/control/segmented-control/index.js +107 -0
- package/dist/control/segmented-control/index.js.map +1 -0
- package/dist/control/segmented-control/style.d.ts +5 -0
- package/dist/control/segmented-control/style.d.ts.map +1 -0
- package/dist/control/segmented-control/style.js +149 -0
- package/dist/control/segmented-control/style.js.map +1 -0
- package/dist/control/select/index.d.ts +37 -0
- package/dist/control/select/index.d.ts.map +1 -0
- package/dist/control/select/index.js +138 -0
- package/dist/control/select/index.js.map +1 -0
- package/dist/control/select/style.d.ts +5 -0
- package/dist/control/select/style.d.ts.map +1 -0
- package/dist/control/select/style.js +192 -0
- package/dist/control/select/style.js.map +1 -0
- package/dist/control/switch/index.d.ts +39 -0
- package/dist/control/switch/index.d.ts.map +1 -0
- package/dist/control/switch/index.js +94 -0
- package/dist/control/switch/index.js.map +1 -0
- package/dist/control/switch/style.d.ts +36 -0
- package/dist/control/switch/style.d.ts.map +1 -0
- package/dist/control/switch/style.js +159 -0
- package/dist/control/switch/style.js.map +1 -0
- package/dist/control/text-area/index.d.ts +15 -0
- package/dist/control/text-area/index.d.ts.map +1 -0
- package/dist/control/text-area/index.js +44 -0
- package/dist/control/text-area/index.js.map +1 -0
- package/dist/control/text-area/style.d.ts +5 -0
- package/dist/control/text-area/style.d.ts.map +1 -0
- package/dist/control/text-area/style.js +85 -0
- package/dist/control/text-area/style.js.map +1 -0
- package/dist/control/text-input/index.d.ts +25 -0
- package/dist/control/text-input/index.d.ts.map +1 -0
- package/dist/control/text-input/index.js +43 -0
- package/dist/control/text-input/index.js.map +1 -0
- package/dist/control/text-input/style.d.ts +5 -0
- package/dist/control/text-input/style.d.ts.map +1 -0
- package/dist/control/text-input/style.js +80 -0
- package/dist/control/text-input/style.js.map +1 -0
- package/dist/control/use-modal-dialog/index.d.ts +24 -0
- package/dist/control/use-modal-dialog/index.d.ts.map +1 -0
- package/dist/control/use-modal-dialog/index.js +73 -0
- package/dist/control/use-modal-dialog/index.js.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/is-standalone.d.ts +2 -0
- package/dist/hooks/is-standalone.d.ts.map +1 -0
- package/dist/hooks/is-standalone.js +10 -0
- package/dist/hooks/is-standalone.js.map +1 -0
- package/dist/hooks/use-minimize-on-scroll.d.ts +48 -0
- package/dist/hooks/use-minimize-on-scroll.d.ts.map +1 -0
- package/dist/hooks/use-minimize-on-scroll.js +123 -0
- package/dist/hooks/use-minimize-on-scroll.js.map +1 -0
- package/dist/hooks/use-pull-to-refresh.d.ts +37 -0
- package/dist/hooks/use-pull-to-refresh.d.ts.map +1 -0
- package/dist/hooks/use-pull-to-refresh.js +116 -0
- package/dist/hooks/use-pull-to-refresh.js.map +1 -0
- package/dist/icon/adjustments-horizontal.d.ts +3 -0
- package/dist/icon/adjustments-horizontal.d.ts.map +1 -0
- package/dist/icon/adjustments-horizontal.js +11 -0
- package/dist/icon/adjustments-horizontal.js.map +1 -0
- package/dist/icon/alert-octagon.d.ts +3 -0
- package/dist/icon/alert-octagon.d.ts.map +1 -0
- package/dist/icon/alert-octagon.js +8 -0
- package/dist/icon/alert-octagon.js.map +1 -0
- package/dist/icon/book.d.ts +3 -0
- package/dist/icon/book.d.ts.map +1 -0
- package/dist/icon/book.js +11 -0
- package/dist/icon/book.js.map +1 -0
- package/dist/icon/books.d.ts +3 -0
- package/dist/icon/books.d.ts.map +1 -0
- package/dist/icon/books.js +11 -0
- package/dist/icon/books.js.map +1 -0
- package/dist/icon/check.d.ts +3 -0
- package/dist/icon/check.d.ts.map +1 -0
- package/dist/icon/check.js +8 -0
- package/dist/icon/check.js.map +1 -0
- package/dist/icon/chevron-circle.d.ts +3 -0
- package/dist/icon/chevron-circle.d.ts.map +1 -0
- package/dist/icon/chevron-circle.js +11 -0
- package/dist/icon/chevron-circle.js.map +1 -0
- package/dist/icon/chevron.d.ts +3 -0
- package/dist/icon/chevron.d.ts.map +1 -0
- package/dist/icon/chevron.js +11 -0
- package/dist/icon/chevron.js.map +1 -0
- package/dist/icon/circle-x.d.ts +3 -0
- package/dist/icon/circle-x.d.ts.map +1 -0
- package/dist/icon/circle-x.js +8 -0
- package/dist/icon/circle-x.js.map +1 -0
- package/dist/icon/clock.d.ts +3 -0
- package/dist/icon/clock.d.ts.map +1 -0
- package/dist/icon/clock.js +11 -0
- package/dist/icon/clock.js.map +1 -0
- package/dist/icon/device.d.ts +3 -0
- package/dist/icon/device.d.ts.map +1 -0
- package/dist/icon/device.js +11 -0
- package/dist/icon/device.js.map +1 -0
- package/dist/icon/emoji.d.ts +20 -0
- package/dist/icon/emoji.d.ts.map +1 -0
- package/dist/icon/emoji.js +21 -0
- package/dist/icon/emoji.js.map +1 -0
- package/dist/icon/hand-love-you.d.ts +3 -0
- package/dist/icon/hand-love-you.d.ts.map +1 -0
- package/dist/icon/hand-love-you.js +5 -0
- package/dist/icon/hand-love-you.js.map +1 -0
- package/dist/icon/hand-ok.d.ts +3 -0
- package/dist/icon/hand-ok.d.ts.map +1 -0
- package/dist/icon/hand-ok.js +5 -0
- package/dist/icon/hand-ok.js.map +1 -0
- package/dist/icon/hand-peace.d.ts +3 -0
- package/dist/icon/hand-peace.d.ts.map +1 -0
- package/dist/icon/hand-peace.js +5 -0
- package/dist/icon/hand-peace.js.map +1 -0
- package/dist/icon/hands-clap.d.ts +3 -0
- package/dist/icon/hands-clap.d.ts.map +1 -0
- package/dist/icon/hands-clap.js +5 -0
- package/dist/icon/hands-clap.js.map +1 -0
- package/dist/icon/home.d.ts +3 -0
- package/dist/icon/home.d.ts.map +1 -0
- package/dist/icon/home.js +11 -0
- package/dist/icon/home.js.map +1 -0
- package/dist/icon/index.d.ts +31 -0
- package/dist/icon/index.d.ts.map +1 -0
- package/dist/icon/index.js +30 -0
- package/dist/icon/index.js.map +1 -0
- package/dist/icon/info-circle.d.ts +3 -0
- package/dist/icon/info-circle.d.ts.map +1 -0
- package/dist/icon/info-circle.js +8 -0
- package/dist/icon/info-circle.js.map +1 -0
- package/dist/icon/key.d.ts +3 -0
- package/dist/icon/key.d.ts.map +1 -0
- package/dist/icon/key.js +8 -0
- package/dist/icon/key.js.map +1 -0
- package/dist/icon/list-check.d.ts +3 -0
- package/dist/icon/list-check.d.ts.map +1 -0
- package/dist/icon/list-check.js +11 -0
- package/dist/icon/list-check.js.map +1 -0
- package/dist/icon/more.d.ts +3 -0
- package/dist/icon/more.d.ts.map +1 -0
- package/dist/icon/more.js +11 -0
- package/dist/icon/more.js.map +1 -0
- package/dist/icon/props.d.ts +26 -0
- package/dist/icon/props.d.ts.map +1 -0
- package/dist/icon/props.js +16 -0
- package/dist/icon/props.js.map +1 -0
- package/dist/icon/row-remove.d.ts +3 -0
- package/dist/icon/row-remove.d.ts.map +1 -0
- package/dist/icon/row-remove.js +11 -0
- package/dist/icon/row-remove.js.map +1 -0
- package/dist/icon/search.d.ts +3 -0
- package/dist/icon/search.d.ts.map +1 -0
- package/dist/icon/search.js +11 -0
- package/dist/icon/search.js.map +1 -0
- package/dist/icon/settings.d.ts +3 -0
- package/dist/icon/settings.d.ts.map +1 -0
- package/dist/icon/settings.js +11 -0
- package/dist/icon/settings.js.map +1 -0
- package/dist/icon/spinner.d.ts +3 -0
- package/dist/icon/spinner.d.ts.map +1 -0
- package/dist/icon/spinner.js +10 -0
- package/dist/icon/spinner.js.map +1 -0
- package/dist/icon/thumb-down.d.ts +3 -0
- package/dist/icon/thumb-down.d.ts.map +1 -0
- package/dist/icon/thumb-down.js +5 -0
- package/dist/icon/thumb-down.js.map +1 -0
- package/dist/icon/upload.d.ts +3 -0
- package/dist/icon/upload.d.ts.map +1 -0
- package/dist/icon/upload.js +11 -0
- package/dist/icon/upload.js.map +1 -0
- package/dist/icon/user.d.ts +3 -0
- package/dist/icon/user.d.ts.map +1 -0
- package/dist/icon/user.js +11 -0
- package/dist/icon/user.js.map +1 -0
- package/dist/icon/users.d.ts +3 -0
- package/dist/icon/users.d.ts.map +1 -0
- package/dist/icon/users.js +11 -0
- package/dist/icon/users.js.map +1 -0
- package/dist/icon/x.d.ts +3 -0
- package/dist/icon/x.d.ts.map +1 -0
- package/dist/icon/x.js +11 -0
- package/dist/icon/x.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/theme/context.d.ts +11 -0
- package/dist/theme/context.d.ts.map +1 -0
- package/dist/theme/context.js +7 -0
- package/dist/theme/context.js.map +1 -0
- package/dist/theme/global-styles.d.ts +3 -0
- package/dist/theme/global-styles.d.ts.map +1 -0
- package/dist/theme/global-styles.js +67 -0
- package/dist/theme/global-styles.js.map +1 -0
- package/dist/theme/index.d.ts +11 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +7 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/provider.d.ts +7 -0
- package/dist/theme/provider.d.ts.map +1 -0
- package/dist/theme/provider.js +49 -0
- package/dist/theme/provider.js.map +1 -0
- package/dist/theme/theme.d.ts +262 -0
- package/dist/theme/theme.d.ts.map +1 -0
- package/dist/theme/theme.js +481 -0
- package/dist/theme/theme.js.map +1 -0
- package/dist/theme/use-theme-setting.d.ts +4 -0
- package/dist/theme/use-theme-setting.d.ts.map +1 -0
- package/dist/theme/use-theme-setting.js +7 -0
- package/dist/theme/use-theme-setting.js.map +1 -0
- package/dist/theme/use-theme.d.ts +3 -0
- package/dist/theme/use-theme.d.ts.map +1 -0
- package/dist/theme/use-theme.js +5 -0
- package/dist/theme/use-theme.js.map +1 -0
- package/dist/toast/context.d.ts +5 -0
- package/dist/toast/context.d.ts.map +1 -0
- package/dist/toast/context.js +5 -0
- package/dist/toast/context.js.map +1 -0
- package/dist/toast/hook/index.d.ts +2 -0
- package/dist/toast/hook/index.d.ts.map +1 -0
- package/dist/toast/hook/index.js +2 -0
- package/dist/toast/hook/index.js.map +1 -0
- package/dist/toast/hook/use-toast.d.ts +2 -0
- package/dist/toast/hook/use-toast.d.ts.map +1 -0
- package/dist/toast/hook/use-toast.js +7 -0
- package/dist/toast/hook/use-toast.js.map +1 -0
- package/dist/toast/index.d.ts +3 -0
- package/dist/toast/index.d.ts.map +1 -0
- package/dist/toast/index.js +3 -0
- package/dist/toast/index.js.map +1 -0
- package/dist/toast/provider.d.ts +8 -0
- package/dist/toast/provider.d.ts.map +1 -0
- package/dist/toast/provider.js +57 -0
- package/dist/toast/provider.js.map +1 -0
- package/dist/toast/reducer.d.ts +21 -0
- package/dist/toast/reducer.d.ts.map +1 -0
- package/dist/toast/reducer.js +24 -0
- package/dist/toast/reducer.js.map +1 -0
- package/dist/toast/style.d.ts +5 -0
- package/dist/toast/style.d.ts.map +1 -0
- package/dist/toast/style.js +63 -0
- package/dist/toast/style.js.map +1 -0
- package/dist/toast/toast.d.ts +12 -0
- package/dist/toast/toast.d.ts.map +1 -0
- package/dist/toast/toast.js +17 -0
- package/dist/toast/toast.js.map +1 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +38 -0
- package/dist/utils.js.map +1 -0
- package/package.json +93 -4
- package/src/component/card/index.tsx +123 -0
- package/src/component/card/style.ts +69 -0
- package/src/component/card-divider/index.tsx +74 -0
- package/src/component/card-divider/style.ts +48 -0
- package/src/component/card-row/index.tsx +32 -0
- package/src/component/card-row/style.ts +13 -0
- package/src/component/collapsible-section/index.tsx +58 -0
- package/src/component/collapsible-section/style.ts +36 -0
- package/src/component/empty-state/index.tsx +35 -0
- package/src/component/empty-state/style.ts +30 -0
- package/src/component/index.ts +15 -0
- package/src/component/meta-line/index.tsx +42 -0
- package/src/component/meta-line/style.ts +36 -0
- package/src/component/metadata/index.tsx +15 -0
- package/src/component/metadata/style.ts +20 -0
- package/src/component/metadata-list/index.tsx +15 -0
- package/src/component/metadata-list/style.ts +10 -0
- package/src/component/nav-desktop/index.tsx +43 -0
- package/src/component/nav-desktop/style.ts +94 -0
- package/src/component/nav-mobile/index.tsx +358 -0
- package/src/component/nav-mobile/style.ts +354 -0
- package/src/component/nav-types.ts +13 -0
- package/src/component/page/index.tsx +87 -0
- package/src/component/page/style.ts +133 -0
- package/src/component/progress-indicator/index.tsx +58 -0
- package/src/component/progress-indicator/style.ts +24 -0
- package/src/component/tag/index.tsx +38 -0
- package/src/component/tag/style.ts +28 -0
- package/src/component/theme-setting/index.tsx +24 -0
- package/src/component/top-fade/index.tsx +8 -0
- package/src/component/top-fade/style.ts +58 -0
- package/src/control/action-menu-list/index.tsx +75 -0
- package/src/control/action-menu-list/style.ts +51 -0
- package/src/control/action-menu-list/use-dismiss.ts +29 -0
- package/src/control/back-button/index.tsx +44 -0
- package/src/control/back-button/style.ts +26 -0
- package/src/control/button/index.tsx +148 -0
- package/src/control/button/style.ts +389 -0
- package/src/control/chips-input/index.tsx +168 -0
- package/src/control/chips-input/style.ts +158 -0
- package/src/control/confirm-modal/index.tsx +79 -0
- package/src/control/confirm-modal/style.ts +33 -0
- package/src/control/date-time-input/index.tsx +95 -0
- package/src/control/date-time-input/iso-date.ts +61 -0
- package/src/control/date-time-input/style.ts +72 -0
- package/src/control/field-list/index.tsx +78 -0
- package/src/control/field-list/style.ts +43 -0
- package/src/control/index.ts +23 -0
- package/src/control/number-input/index.tsx +75 -0
- package/src/control/number-input/style.ts +50 -0
- package/src/control/page-actions-bar/index.tsx +68 -0
- package/src/control/page-actions-bar/style.ts +63 -0
- package/src/control/page-actions-menu/index.tsx +49 -0
- package/src/control/page-actions-menu/style.ts +33 -0
- package/src/control/page-footer-actions/index.tsx +50 -0
- package/src/control/page-footer-actions/style.ts +12 -0
- package/src/control/popover/index.tsx +102 -0
- package/src/control/popover/style.ts +8 -0
- package/src/control/segmented-control/index.tsx +193 -0
- package/src/control/segmented-control/style.ts +150 -0
- package/src/control/select/index.tsx +326 -0
- package/src/control/select/style.ts +192 -0
- package/src/control/switch/index.tsx +189 -0
- package/src/control/switch/style.ts +172 -0
- package/src/control/text-area/index.tsx +106 -0
- package/src/control/text-area/style.ts +85 -0
- package/src/control/text-input/index.tsx +124 -0
- package/src/control/text-input/style.ts +80 -0
- package/src/control/use-modal-dialog/index.ts +75 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/is-standalone.ts +11 -0
- package/src/hooks/use-minimize-on-scroll.ts +137 -0
- package/src/hooks/use-pull-to-refresh.ts +133 -0
- package/src/icon/adjustments-horizontal.tsx +48 -0
- package/src/icon/alert-octagon.tsx +31 -0
- package/src/icon/book.tsx +42 -0
- package/src/icon/books.tsx +46 -0
- package/src/icon/check.tsx +31 -0
- package/src/icon/chevron-circle.tsx +40 -0
- package/src/icon/chevron.tsx +39 -0
- package/src/icon/circle-x.tsx +30 -0
- package/src/icon/clock.tsx +41 -0
- package/src/icon/device.tsx +41 -0
- package/src/icon/emoji.tsx +70 -0
- package/src/icon/hand-love-you.tsx +5 -0
- package/src/icon/hand-ok.tsx +5 -0
- package/src/icon/hand-peace.tsx +7 -0
- package/src/icon/hands-clap.tsx +5 -0
- package/src/icon/home.tsx +42 -0
- package/src/icon/index.ts +31 -0
- package/src/icon/info-circle.tsx +30 -0
- package/src/icon/key.tsx +38 -0
- package/src/icon/list-check.tsx +44 -0
- package/src/icon/more.tsx +41 -0
- package/src/icon/props.ts +29 -0
- package/src/icon/row-remove.tsx +41 -0
- package/src/icon/search.tsx +41 -0
- package/src/icon/settings.tsx +41 -0
- package/src/icon/spinner.tsx +36 -0
- package/src/icon/thumb-down.tsx +5 -0
- package/src/icon/upload.tsx +42 -0
- package/src/icon/user.tsx +41 -0
- package/src/icon/users.tsx +43 -0
- package/src/icon/x.tsx +41 -0
- package/src/index.ts +12 -0
- package/src/theme/context.ts +19 -0
- package/src/theme/global-styles.ts +71 -0
- package/src/theme/index.ts +11 -0
- package/src/theme/provider.tsx +74 -0
- package/src/theme/theme.ts +672 -0
- package/src/theme/use-theme-setting.ts +10 -0
- package/src/theme/use-theme.tsx +7 -0
- package/src/toast/context.ts +9 -0
- package/src/toast/hook/index.ts +1 -0
- package/src/toast/hook/use-toast.ts +8 -0
- package/src/toast/index.ts +2 -0
- package/src/toast/provider.tsx +90 -0
- package/src/toast/reducer.ts +41 -0
- package/src/toast/style.ts +63 -0
- package/src/toast/toast.tsx +51 -0
- package/src/utils.ts +47 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { createUseStyles, type Theme } from '../../theme/index.js';
|
|
2
|
+
import { applyTransparency } from '../../utils.js';
|
|
3
|
+
|
|
4
|
+
export const useStyle = createUseStyles((theme: Theme) => ({
|
|
5
|
+
root: {
|
|
6
|
+
display: 'flex',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
justifyContent: 'center',
|
|
9
|
+
padding: `${theme.space.xxl} ${theme.space.xxxxl}`,
|
|
10
|
+
backgroundColor: theme.color.bg.page,
|
|
11
|
+
color: theme.color.text.primary,
|
|
12
|
+
overflow: 'hidden',
|
|
13
|
+
[theme.breakpoint.mobile]: {
|
|
14
|
+
display: 'none',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
items: {
|
|
18
|
+
position: 'relative',
|
|
19
|
+
zIndex: theme.zIndex.header,
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
gap: theme.space.xxl,
|
|
24
|
+
marginTop: '15px', // optical baseline tweak — geometry
|
|
25
|
+
},
|
|
26
|
+
item: {
|
|
27
|
+
position: 'relative',
|
|
28
|
+
display: 'inline-flex',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
gap: theme.space.md,
|
|
32
|
+
color: theme.color.text.primary,
|
|
33
|
+
textDecoration: 'none',
|
|
34
|
+
fontSize: '0.80rem', // nav-specific size; not on the global fontSize scale
|
|
35
|
+
cursor: 'pointer',
|
|
36
|
+
userSelect: 'none',
|
|
37
|
+
'-webkit-user-select': 'none',
|
|
38
|
+
marginTop: '6px', // optical baseline tweak — geometry
|
|
39
|
+
paddingBottom: '4px', // optical baseline tweak — geometry
|
|
40
|
+
borderBottomStyle: 'solid',
|
|
41
|
+
borderBottomWidth: '2px',
|
|
42
|
+
borderBottomColor: 'transparent',
|
|
43
|
+
transitionProperty: 'color, border-bottom-color',
|
|
44
|
+
transitionDuration: '0.1s',
|
|
45
|
+
transitionTimingFunction: 'ease-in',
|
|
46
|
+
'&:hover': {
|
|
47
|
+
transitionDuration: '0s',
|
|
48
|
+
color: applyTransparency(theme.color.text.primary, 0.467), // matches old '#11111177'
|
|
49
|
+
},
|
|
50
|
+
'&$active': {
|
|
51
|
+
color: theme.color.text.primary,
|
|
52
|
+
borderBottomColor: theme.color.text.primary,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
active: {},
|
|
56
|
+
// The positioning context for the badge. Wraps the icon alone, so the badge
|
|
57
|
+
// lands on the ICON's corner rather than the nav item's — which, with the
|
|
58
|
+
// label inside the item, would put it past the end of the text.
|
|
59
|
+
iconWrap: {
|
|
60
|
+
position: 'relative',
|
|
61
|
+
display: 'inline-flex',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
justifyContent: 'center',
|
|
64
|
+
},
|
|
65
|
+
// Both badge forms overhang the icon's top-right corner, the way a platform
|
|
66
|
+
// notification badge does. `pointerEvents: none` so the badge never eats a
|
|
67
|
+
// click meant for the tab beneath it.
|
|
68
|
+
badge: {
|
|
69
|
+
position: 'absolute',
|
|
70
|
+
top: '-6px',
|
|
71
|
+
right: '-8px',
|
|
72
|
+
minWidth: '16px',
|
|
73
|
+
height: '16px',
|
|
74
|
+
padding: `0 ${theme.space.xs}`,
|
|
75
|
+
boxSizing: 'border-box',
|
|
76
|
+
borderRadius: theme.radius.pill,
|
|
77
|
+
backgroundColor: theme.color.danger.default,
|
|
78
|
+
color: theme.color.bg.page,
|
|
79
|
+
fontSize: '0.65rem',
|
|
80
|
+
lineHeight: '16px',
|
|
81
|
+
textAlign: 'center',
|
|
82
|
+
pointerEvents: 'none',
|
|
83
|
+
},
|
|
84
|
+
badgeDot: {
|
|
85
|
+
position: 'absolute',
|
|
86
|
+
top: '-3px',
|
|
87
|
+
right: '-4px',
|
|
88
|
+
width: '8px',
|
|
89
|
+
height: '8px',
|
|
90
|
+
borderRadius: theme.radius.pill,
|
|
91
|
+
backgroundColor: theme.color.danger.default,
|
|
92
|
+
pointerEvents: 'none',
|
|
93
|
+
},
|
|
94
|
+
}));
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import { type CSSProperties, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { Link, useLocation } from 'react-router';
|
|
4
|
+
|
|
5
|
+
import { useMinimizeOnScroll } from '../../hooks/use-minimize-on-scroll.js';
|
|
6
|
+
import { useTheme } from '../../theme/index.js';
|
|
7
|
+
import type { NavItem } from '../nav-types.js';
|
|
8
|
+
import { useStyle } from './style.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* One side of the bar, in both of the shapes it can take.
|
|
12
|
+
*
|
|
13
|
+
* Both shapes are always rendered, which is what makes the swap a MORPH rather
|
|
14
|
+
* than a cross-fade: the pill around them is a single element whose width
|
|
15
|
+
* animates between the two, so the capsule is seen to shrink into the circle
|
|
16
|
+
* instead of one bar fading out while a different one fades in.
|
|
17
|
+
*/
|
|
18
|
+
export interface NavPill {
|
|
19
|
+
/** Destinations shown while this side is expanded. */
|
|
20
|
+
items: NavItem[];
|
|
21
|
+
/** The single destination it collapses to. */
|
|
22
|
+
collapsed: NavItem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface NavMobileProps {
|
|
26
|
+
/** The left-hand side: the app's main destinations. */
|
|
27
|
+
main: NavPill;
|
|
28
|
+
/** The right-hand side: settings. */
|
|
29
|
+
settings: NavPill;
|
|
30
|
+
/** Which side is expanded; the other is a circle. */
|
|
31
|
+
expanded: 'main' | 'settings';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Horizontal geometry measured from the live DOM. */
|
|
35
|
+
interface LensBox {
|
|
36
|
+
/** Active tab's left offset within the capsule. */
|
|
37
|
+
left: number;
|
|
38
|
+
/** Active tab's width (the lens/mask width). */
|
|
39
|
+
width: number;
|
|
40
|
+
/** Full capsule width — pins the blue reveal grid so its columns match the real row. */
|
|
41
|
+
capsuleWidth: number;
|
|
42
|
+
/**
|
|
43
|
+
* The PILL's height, not the capsule's, and the diameter it collapses to.
|
|
44
|
+
*
|
|
45
|
+
* Measured from the pill because the row stretches both pills to a common
|
|
46
|
+
* height: a side whose own content is shorter — a reader's settings side has
|
|
47
|
+
* no expanded destinations at all — would otherwise collapse to a circle
|
|
48
|
+
* smaller than the bar beside it.
|
|
49
|
+
*/
|
|
50
|
+
pillHeight: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const sameBox = (a: LensBox | null, b: LensBox | null): boolean =>
|
|
54
|
+
a != null &&
|
|
55
|
+
b != null &&
|
|
56
|
+
a.left === b.left &&
|
|
57
|
+
a.width === b.width &&
|
|
58
|
+
a.capsuleWidth === b.capsuleWidth &&
|
|
59
|
+
a.pillHeight === b.pillHeight;
|
|
60
|
+
|
|
61
|
+
// Narrow navigation pinned to the bottom of the viewport (mobile only): two frosted
|
|
62
|
+
// "liquid glass" pills, one expanded and one collapsed to a circle. The expanded one's
|
|
63
|
+
// active tab is wrapped by a glass lens that slides between (equal-width) tabs. A blue
|
|
64
|
+
// copy of the tab row, clipped to the lens, reveals the active color only where the lens
|
|
65
|
+
// is. Hidden at and above the desktop breakpoint.
|
|
66
|
+
//
|
|
67
|
+
// Scrolling down MINIMIZES the expanded side to a circle holding the active
|
|
68
|
+
// tab, the way the iOS tab bar gets out of the way of what you are reading;
|
|
69
|
+
// scrolling up, reaching the top, tapping the circle or changing page brings it
|
|
70
|
+
// back. It is the same morph the route-driven collapse uses — one width
|
|
71
|
+
// animating — so the two never fight: a side is a circle when it is not the
|
|
72
|
+
// expanded side OR the bar is minimized. The other side's circle is left as it
|
|
73
|
+
// is, like the search button iOS keeps beside its minimized bar.
|
|
74
|
+
export const NavMobile = ({ main, settings, expanded }: NavMobileProps) => {
|
|
75
|
+
const styles = useStyle();
|
|
76
|
+
const { key } = useLocation();
|
|
77
|
+
const { minimized, expand } = useMinimizeOnScroll({ resetKey: key });
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<nav className={styles.root}>
|
|
81
|
+
<Pill
|
|
82
|
+
pill={main}
|
|
83
|
+
expanded={expanded === 'main'}
|
|
84
|
+
minimized={minimized}
|
|
85
|
+
onExpand={expand}
|
|
86
|
+
styles={styles}
|
|
87
|
+
/>
|
|
88
|
+
<Pill
|
|
89
|
+
pill={settings}
|
|
90
|
+
expanded={expanded === 'settings'}
|
|
91
|
+
minimized={minimized}
|
|
92
|
+
onExpand={expand}
|
|
93
|
+
styles={styles}
|
|
94
|
+
/>
|
|
95
|
+
</nav>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const Pill = ({
|
|
100
|
+
pill,
|
|
101
|
+
expanded,
|
|
102
|
+
minimized,
|
|
103
|
+
onExpand,
|
|
104
|
+
styles,
|
|
105
|
+
}: {
|
|
106
|
+
pill: NavPill;
|
|
107
|
+
expanded: boolean;
|
|
108
|
+
/** The bar has scrolled out of the way; an expanded side shows its active tab alone. */
|
|
109
|
+
minimized: boolean;
|
|
110
|
+
onExpand: () => void;
|
|
111
|
+
styles: ReturnType<typeof useStyle>;
|
|
112
|
+
}) => {
|
|
113
|
+
const theme = useTheme();
|
|
114
|
+
const pillRef = useRef<HTMLDivElement>(null);
|
|
115
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
116
|
+
const [box, setBox] = useState<LensBox | null>(null);
|
|
117
|
+
const [shown, setShown] = useState(false);
|
|
118
|
+
const [ready, setReady] = useState(false);
|
|
119
|
+
|
|
120
|
+
const { items, collapsed } = pill;
|
|
121
|
+
const activeItem = items.find((item) => item.active);
|
|
122
|
+
const activeTo = activeItem?.to;
|
|
123
|
+
const CollapsedIcon = collapsed.Icon;
|
|
124
|
+
|
|
125
|
+
// The three shapes, exactly one of them showing. `open` is the capsule;
|
|
126
|
+
// the two circles split the rest by WHY the side is a circle.
|
|
127
|
+
const open = expanded && !minimized;
|
|
128
|
+
const showMinimized = expanded && minimized;
|
|
129
|
+
// The minimized circle stands for the capsule it replaced, so it wears the
|
|
130
|
+
// tab you are on — where you are is the one thing worth keeping on screen.
|
|
131
|
+
// When the route maps to no tab it falls back to the side's own collapsed
|
|
132
|
+
// glyph rather than showing nothing.
|
|
133
|
+
const MinimizedIcon = activeItem?.Icon ?? CollapsedIcon;
|
|
134
|
+
// Its badge is the active tab's own when it has one — that tab's icon is
|
|
135
|
+
// what is showing, so its count is honest there — and otherwise a dot for
|
|
136
|
+
// whatever the hidden siblings want, the same claim a collapsed side makes.
|
|
137
|
+
const minimizedBadge: NavItem['badge'] =
|
|
138
|
+
activeItem?.badge ?? (items.some((item) => item.badge !== undefined) ? 'dot' : undefined);
|
|
139
|
+
|
|
140
|
+
// Measure the active tab's horizontal box (its vertical extent is fixed in CSS) so
|
|
141
|
+
// the lens can wrap and morph to it, plus the two sizes this pill animates between.
|
|
142
|
+
// Runs after paint so the morph transition starts from the on-screen position. Keeps
|
|
143
|
+
// the last lens box when the route maps to no tab, so the lens fades out / back in
|
|
144
|
+
// place. Re-measures on active-tab/tab-set change, on expand/collapse, and on resize.
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
const container = containerRef.current;
|
|
147
|
+
const pillElement = pillRef.current;
|
|
148
|
+
if (!container || !pillElement) return;
|
|
149
|
+
|
|
150
|
+
const measure = () => {
|
|
151
|
+
const pillBox = pillElement.getBoundingClientRect();
|
|
152
|
+
const containerBox = container.getBoundingClientRect();
|
|
153
|
+
const active = container.querySelector<HTMLElement>('[aria-current="page"]');
|
|
154
|
+
if (!active) {
|
|
155
|
+
// Still record the SIZES. A collapsed pill has no active tab inside it,
|
|
156
|
+
// and an early return here would leave it with no width to animate to.
|
|
157
|
+
setBox((prev) =>
|
|
158
|
+
prev === null
|
|
159
|
+
? { left: 0, width: 0, capsuleWidth: containerBox.width, pillHeight: pillBox.height }
|
|
160
|
+
: { ...prev, capsuleWidth: containerBox.width, pillHeight: pillBox.height }
|
|
161
|
+
);
|
|
162
|
+
setShown(false);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const activeBox = active.getBoundingClientRect();
|
|
166
|
+
const next: LensBox = {
|
|
167
|
+
left: activeBox.left - containerBox.left - container.clientLeft,
|
|
168
|
+
width: activeBox.width,
|
|
169
|
+
capsuleWidth: containerBox.width,
|
|
170
|
+
pillHeight: pillBox.height,
|
|
171
|
+
};
|
|
172
|
+
setBox((prev) => (sameBox(prev, next) ? prev : next));
|
|
173
|
+
setShown(true);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
measure();
|
|
177
|
+
|
|
178
|
+
if (typeof ResizeObserver === 'undefined') return;
|
|
179
|
+
const observer = new ResizeObserver(measure);
|
|
180
|
+
observer.observe(container);
|
|
181
|
+
observer.observe(pillElement);
|
|
182
|
+
return () => observer.disconnect();
|
|
183
|
+
}, [activeTo, items.length, expanded]);
|
|
184
|
+
|
|
185
|
+
// Enable the morph transitions one frame after the first placement, so they are never
|
|
186
|
+
// turned on in the same frame a position or width is first set. Without this a pill
|
|
187
|
+
// would animate its whole width on mount — from the natural capsule width down to a
|
|
188
|
+
// circle — as if the bar were collapsing on arrival.
|
|
189
|
+
useEffect(() => {
|
|
190
|
+
let raf = 0;
|
|
191
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
192
|
+
if (typeof requestAnimationFrame === 'function') {
|
|
193
|
+
raf = requestAnimationFrame(() => setReady(true));
|
|
194
|
+
} else {
|
|
195
|
+
timer = setTimeout(() => setReady(true), 0);
|
|
196
|
+
}
|
|
197
|
+
return () => {
|
|
198
|
+
if (raf) cancelAnimationFrame(raf);
|
|
199
|
+
if (timer) clearTimeout(timer);
|
|
200
|
+
};
|
|
201
|
+
}, []);
|
|
202
|
+
|
|
203
|
+
// The lens slides via transform. The blue reveal is a fixed full-row overlay that
|
|
204
|
+
// never moves — instead a clip-path window (matching the lens box) animates over it,
|
|
205
|
+
// so the blue can't drift relative to the tabs; it's simply unmasked as the lens passes.
|
|
206
|
+
const lensStyle: CSSProperties = box
|
|
207
|
+
? { opacity: shown ? 1 : 0, width: box.width, transform: `translateX(${box.left}px)` }
|
|
208
|
+
: { opacity: 0 };
|
|
209
|
+
const clip = box
|
|
210
|
+
? `inset(${theme.space.xs} ${box.capsuleWidth - box.left - box.width}px ${theme.space.xs} ${box.left}px round ${theme.radius.pill})`
|
|
211
|
+
: undefined;
|
|
212
|
+
const revealStyle: CSSProperties = box
|
|
213
|
+
? { opacity: shown ? 1 : 0, clipPath: clip, WebkitClipPath: clip }
|
|
214
|
+
: { opacity: 0 };
|
|
215
|
+
|
|
216
|
+
// The morph itself: one number, animated. Expanded, the pill is as wide as its capsule
|
|
217
|
+
// naturally is; collapsed, as wide as it is tall, which at `radius.pill` is a circle.
|
|
218
|
+
// Left to CSS until the first measurement, so a pill never renders at a guessed width.
|
|
219
|
+
const pillStyle: CSSProperties | undefined =
|
|
220
|
+
box === null ? undefined : { width: open ? box.capsuleWidth : box.pillHeight };
|
|
221
|
+
|
|
222
|
+
return (
|
|
223
|
+
<div
|
|
224
|
+
ref={pillRef}
|
|
225
|
+
className={cx(styles.pill, { [styles.pillReady]: ready, [styles.pillCollapsed]: !open })}
|
|
226
|
+
style={pillStyle}
|
|
227
|
+
>
|
|
228
|
+
<div className={styles.glass} aria-hidden="true" />
|
|
229
|
+
<div
|
|
230
|
+
ref={containerRef}
|
|
231
|
+
className={cx(styles.capsule, { [styles.capsuleHidden]: !open })}
|
|
232
|
+
// A collapsed pill's destinations are behind a clip, not merely faded:
|
|
233
|
+
// without these they stay in the accessibility tree and the tab order, and a
|
|
234
|
+
// screen reader reads a navigation nobody can see.
|
|
235
|
+
aria-hidden={open ? undefined : true}
|
|
236
|
+
inert={open ? undefined : true}
|
|
237
|
+
>
|
|
238
|
+
<span
|
|
239
|
+
className={cx(styles.lens, { [styles.lensReady]: ready })}
|
|
240
|
+
style={lensStyle}
|
|
241
|
+
aria-hidden="true"
|
|
242
|
+
/>
|
|
243
|
+
{items.map(({ to, label, Icon, active, badge }) => (
|
|
244
|
+
<Link key={to} className={styles.item} aria-current={active ? 'page' : undefined} to={to}>
|
|
245
|
+
<BadgedIcon Icon={Icon} badge={badge} size={14} styles={styles} />
|
|
246
|
+
{label}
|
|
247
|
+
</Link>
|
|
248
|
+
))}
|
|
249
|
+
{/* The badge is repeated in BOTH visible rows, not just on the real
|
|
250
|
+
tab. The real tab is transparent and these rows paint above it, so a
|
|
251
|
+
badge left only there sat under each row's copy of the icon, whose
|
|
252
|
+
strokes showed through it. Here it paints over the icon, as on
|
|
253
|
+
desktop, and the two copies are pixel-aligned like everything else
|
|
254
|
+
in these rows. */}
|
|
255
|
+
<div className={styles.grayLayer} aria-hidden="true">
|
|
256
|
+
{items.map(({ to, label, Icon, badge }) => (
|
|
257
|
+
<span key={to} className={styles.layerItem}>
|
|
258
|
+
<BadgedIcon Icon={Icon} badge={badge} size={14} styles={styles} />
|
|
259
|
+
{label}
|
|
260
|
+
</span>
|
|
261
|
+
))}
|
|
262
|
+
</div>
|
|
263
|
+
<div
|
|
264
|
+
className={cx(styles.reveal, { [styles.revealReady]: ready })}
|
|
265
|
+
style={revealStyle}
|
|
266
|
+
aria-hidden="true"
|
|
267
|
+
>
|
|
268
|
+
{items.map(({ to, label, Icon, badge }) => (
|
|
269
|
+
<span key={to} className={styles.layerItem}>
|
|
270
|
+
<BadgedIcon Icon={Icon} badge={badge} size={14} styles={styles} />
|
|
271
|
+
{label}
|
|
272
|
+
</span>
|
|
273
|
+
))}
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
<Link
|
|
277
|
+
className={cx(styles.collapsedLink, {
|
|
278
|
+
[styles.collapsedHidden]: expanded,
|
|
279
|
+
[styles.collapsedActive]: collapsed.active,
|
|
280
|
+
})}
|
|
281
|
+
// The mirror of the capsule's pair above: whichever shape is not showing
|
|
282
|
+
// is out of the accessibility tree and the tab order, so the bar offers
|
|
283
|
+
// exactly what is on screen and nothing else.
|
|
284
|
+
aria-hidden={expanded ? true : undefined}
|
|
285
|
+
inert={expanded ? true : undefined}
|
|
286
|
+
aria-current={collapsed.active ? 'page' : undefined}
|
|
287
|
+
aria-label={collapsed.label}
|
|
288
|
+
to={collapsed.to}
|
|
289
|
+
>
|
|
290
|
+
{/* Same badge wrapper the capsule's own tabs use. A collapsed side
|
|
291
|
+
hides whatever is inside it, so without this a tab that wanted
|
|
292
|
+
attention would go silent exactly when it could not be seen.
|
|
293
|
+
Only while actually COLLAPSED: this shape stays mounted when the
|
|
294
|
+
side is expanded (it is what the pill morphs back to), and a badge
|
|
295
|
+
left in the document there would double-count the one already
|
|
296
|
+
showing on the tab it stands for. */}
|
|
297
|
+
<BadgedIcon
|
|
298
|
+
Icon={CollapsedIcon}
|
|
299
|
+
badge={expanded ? undefined : collapsed.badge}
|
|
300
|
+
size={18}
|
|
301
|
+
styles={styles}
|
|
302
|
+
/>
|
|
303
|
+
</Link>
|
|
304
|
+
{/* The scrolled-away shape. A BUTTON, not a link to the active tab: you
|
|
305
|
+
are already there, and what a tap on a minimized bar asks for is the
|
|
306
|
+
bar back, not a navigation (which would also push a history entry
|
|
307
|
+
and scroll the page to its top). Hidden by the same pair as the other
|
|
308
|
+
two shapes, so the bar offers one shape at a time. */}
|
|
309
|
+
<button
|
|
310
|
+
type="button"
|
|
311
|
+
className={cx(styles.minimizedButton, {
|
|
312
|
+
[styles.collapsedHidden]: !showMinimized,
|
|
313
|
+
// Lit only when a tab IS selected. Falling back to the stand-in
|
|
314
|
+
// glyph is not a selection, and a lit stand-in told a reader on
|
|
315
|
+
// Settings that something in the main group was.
|
|
316
|
+
[styles.minimizedActive]: activeItem !== undefined,
|
|
317
|
+
})}
|
|
318
|
+
aria-hidden={showMinimized ? undefined : true}
|
|
319
|
+
inert={showMinimized ? undefined : true}
|
|
320
|
+
aria-expanded={false}
|
|
321
|
+
aria-label="Show navigation"
|
|
322
|
+
onClick={onExpand}
|
|
323
|
+
>
|
|
324
|
+
<BadgedIcon
|
|
325
|
+
Icon={MinimizedIcon}
|
|
326
|
+
badge={showMinimized ? minimizedBadge : undefined}
|
|
327
|
+
size={18}
|
|
328
|
+
styles={styles}
|
|
329
|
+
/>
|
|
330
|
+
</button>
|
|
331
|
+
</div>
|
|
332
|
+
);
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* An icon with its badge on the upper-right corner, the way an app badge sits.
|
|
337
|
+
*
|
|
338
|
+
* Same wrapper as `nav-desktop`: the badge is positioned against the ICON, not
|
|
339
|
+
* the whole tab. Anchoring to the tab at a fixed `top`/`right` tracked the
|
|
340
|
+
* tab's geometry rather than the icon's.
|
|
341
|
+
*/
|
|
342
|
+
const BadgedIcon = ({
|
|
343
|
+
Icon,
|
|
344
|
+
badge,
|
|
345
|
+
size,
|
|
346
|
+
styles,
|
|
347
|
+
}: {
|
|
348
|
+
Icon: NavItem['Icon'];
|
|
349
|
+
badge: NavItem['badge'];
|
|
350
|
+
size: number;
|
|
351
|
+
styles: ReturnType<typeof useStyle>;
|
|
352
|
+
}) => (
|
|
353
|
+
<span className={styles.iconWrap}>
|
|
354
|
+
<Icon height={size} width={size} />
|
|
355
|
+
{typeof badge === 'number' && badge > 0 && <span className={styles.badge}>{badge}</span>}
|
|
356
|
+
{badge === 'dot' && <span className={styles.badgeDot} data-testid="nav-badge-dot" />}
|
|
357
|
+
</span>
|
|
358
|
+
);
|