ab-nextjs-components 0.4.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -17
- package/README.md +16 -2
- package/ab-app-bar/index.tsx +5 -5
- package/ab-app-bar/styles.module.css +5 -5
- package/ab-bottom-drawer/index.tsx +3 -3
- package/ab-bottom-drawer/styles.module.css +2 -2
- package/ab-bottom-drawer/use-ab-swipe-down.ts +1 -1
- package/ab-breadcrumbs/index.tsx +1 -1
- package/ab-breadcrumbs/styles.module.css +5 -5
- package/ab-button/index.tsx +1 -1
- package/ab-button/styles.module.css +5 -5
- package/ab-callout/index.tsx +1 -1
- package/ab-callout/styles.module.css +1 -1
- package/ab-carousel/helpers.ts +1 -1
- package/ab-carousel/index.tsx +4 -4
- package/ab-carousel/styles.module.css +2 -2
- package/ab-chip/styles.module.css +1 -1
- package/ab-code-block/focus.tsx +63 -0
- package/ab-code-block/index.tsx +55 -28
- package/ab-code-block/styles.module.css +4 -3
- package/ab-content-tabs/index.tsx +25 -3
- package/ab-demo-box/index.tsx +45 -7
- package/ab-demo-box/styles.module.css +19 -7
- package/ab-demo-code/index.tsx +38 -34
- package/ab-demo-code/styles.module.css +3 -41
- package/ab-doc-pager/index.tsx +1 -1
- package/ab-drawer/gestures.ts +1 -1
- package/ab-drawer/index.tsx +12 -4
- package/ab-drawer/kit.module.css +13 -13
- package/ab-drawer/styles.module.css +2 -2
- package/ab-drawer/use-ab-edge-swipe.ts +2 -2
- package/ab-flow-diagram/helpers.ts +2 -2
- package/ab-flow-diagram/index.tsx +2 -2
- package/ab-flow-diagram/styles.module.css +3 -3
- package/ab-icon/builtin.ts +4 -0
- package/ab-icon/helpers.ts +1 -1
- package/ab-icon/index.tsx +3 -3
- package/ab-icon/registrar.tsx +1 -1
- package/ab-icon-button/index.tsx +1 -1
- package/ab-install-snippet/styles.module.css +1 -1
- package/ab-link/index.tsx +2 -2
- package/ab-link/locale.ts +1 -1
- package/ab-list/styles.module.css +1 -1
- package/ab-locale-switcher/index.tsx +6 -6
- package/ab-locale-switcher/styles.module.css +5 -5
- package/ab-mobile-header/index.tsx +6 -6
- package/ab-nav-drawer/index.tsx +11 -6
- package/ab-navbar/index.tsx +1 -1
- package/ab-navbar/styles.module.css +1 -1
- package/ab-navbar/view.tsx +1 -1
- package/ab-package-card/index.tsx +3 -3
- package/ab-package-card/previews.tsx +1 -1
- package/ab-package-card/styles.module.css +2 -2
- package/ab-playground-scene/i18n.module.css +1 -1
- package/ab-playground-scene/icons.tsx +1 -1
- package/ab-playground-scene/index.tsx +4 -4
- package/ab-playground-scene/labels.ts +3 -3
- package/ab-playground-scene/scenes.tsx +4 -4
- package/ab-playground-scene/styles.module.css +6 -6
- package/ab-playground-scene/upgraded.tsx +3 -3
- package/ab-playground-scene/welcome.tsx +1 -1
- package/ab-preview-code/index.tsx +115 -0
- package/ab-preview-code/stage.tsx +153 -0
- package/ab-preview-code/styles.module.css +43 -0
- package/ab-progress-chips/index.tsx +1 -1
- package/ab-search-drawer/index.tsx +4 -4
- package/ab-search-trigger/index.tsx +5 -5
- package/ab-search-trigger/styles.module.css +3 -3
- package/ab-settings-drawer/index.tsx +2 -2
- package/ab-sidebar/active.ts +105 -0
- package/ab-sidebar/index.tsx +10 -6
- package/ab-sidebar/profile-button.tsx +2 -2
- package/ab-sidebar/styles.module.css +4 -4
- package/ab-sidebar/view.tsx +16 -8
- package/ab-theme-mode/index.tsx +3 -3
- package/ab-theme-toggle/index.tsx +6 -6
- package/ab-theme-toggle/styles.module.css +2 -2
- package/ab-toc/index.tsx +3 -3
- package/ab-toc/promo.tsx +2 -2
- package/ab-toc/styles.module.css +1 -1
- package/ab-toc-drawer/index.tsx +1 -1
- package/ab-version-switcher/index.tsx +2 -2
- package/css/dialog.css +1 -1
- package/index.ts +29 -18
- package/package.json +3 -1
- package/server/ab-button/index.tsx +1 -1
- package/server/ab-icon/index.tsx +2 -2
- package/server/ab-sidebar/index.tsx +3 -2
- package/types/index.d.ts +8 -7
|
@@ -41,7 +41,7 @@ import type { ReactElement } from 'react';
|
|
|
41
41
|
// 🔣 server AbIcon (full AbIcons map; no JS shipped)
|
|
42
42
|
import AbIcon from '../ab-icon';
|
|
43
43
|
// 🖼️ shared view (same markup as the client twin)
|
|
44
|
-
import { AbSidebarView,
|
|
44
|
+
import { AbSidebarView, createAbSidebarActive, toAbSidebarSections, type AbSidebarBaseProps } from '../../ab-sidebar/view';
|
|
45
45
|
// 🌍 0.1.13: strip `/fr` from activeHref when `locales` is given (pure helper, server-safe)
|
|
46
46
|
import { stripAbLocalePrefix } from '../../ab-link/locale';
|
|
47
47
|
|
|
@@ -54,7 +54,8 @@ export type AbSidebarProps = AbSidebarBaseProps;
|
|
|
54
54
|
/** 🧭 AbSidebar (server, G40): same markup as the client twin; active state from `activeHref` / legacy `page`. */
|
|
55
55
|
const AbSidebar = (props: AbSidebarProps): ReactElement => {
|
|
56
56
|
const { page, activeHref } = props;
|
|
57
|
-
const
|
|
57
|
+
const isOn = createAbSidebarActive(toAbSidebarSections(props.sections, props.links), activeHref && stripAbLocalePrefix(activeHref, props.locales), props.activeMatch); // 🥇 0.5.0: deepest match by default
|
|
58
|
+
const active = (href: string, value?: string) => (page ? page === value : isOn(href)); // 🎯
|
|
58
59
|
return <AbSidebarView props={props} Icon={AbIcon} active={active} />;
|
|
59
60
|
};
|
|
60
61
|
|
package/types/index.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ export { default as AbBrand } from '../ab-brand/index.tsx';
|
|
|
75
75
|
export { default as AbName } from '../ab-name/index.tsx';
|
|
76
76
|
export { default as AbNavbar } from '../ab-navbar/index.tsx';
|
|
77
77
|
export { default as AbSidebar } from '../ab-sidebar/index.tsx';
|
|
78
|
-
// 📑 0.1.13
|
|
78
|
+
// 📑 0.1.13: AbToc + the panes main-scroller helpers (also at `ab-nextjs-components/ab-toc`)
|
|
79
79
|
export { default as AbToc, getAbMainScroller, AB_MAIN_SCROLLER_SELECTOR } from '../ab-toc/index.tsx';
|
|
80
80
|
// 🆕 0.2.1: the aside "New" card
|
|
81
81
|
export { default as AbTocPromo } from '../ab-toc/promo.tsx';
|
|
@@ -97,14 +97,14 @@ export type { AbConfirmDrawerProps } from '../ab-confirm-drawer/index.tsx';
|
|
|
97
97
|
// 📱 0.1.14 (D40): AbBottomDrawer, the mobile bottom drawer
|
|
98
98
|
export { default as AbBottomDrawer } from '../ab-bottom-drawer/index.tsx';
|
|
99
99
|
export type { AbBottomDrawerProps } from '../ab-bottom-drawer/index.tsx';
|
|
100
|
-
// 👇 0.2.3 (
|
|
100
|
+
// 👇 0.2.3 (Welcome 0.2.21): swipe a bottom sheet down to close
|
|
101
101
|
export { useAbSwipeDown, isAbScrolledInside } from '../ab-bottom-drawer/use-ab-swipe-down.ts';
|
|
102
102
|
export type { UseAbSwipeDownOptions } from '../ab-bottom-drawer/use-ab-swipe-down.ts';
|
|
103
103
|
// 🆕 0.2.0 drawers v2: AbMobileHeader
|
|
104
104
|
export { default as AbMobileHeader } from '../ab-mobile-header/index.tsx';
|
|
105
105
|
export type { AbMobileHeaderProps, AbMobileHeaderThemeMode, AbMobileHeaderLanguage } from '../ab-mobile-header/index.tsx';
|
|
106
106
|
export { AB_MOBILE_HEADER_THEME_CYCLE } from '../ab-mobile-header/index.tsx'; // 🌗 0.2.3
|
|
107
|
-
// 🌗 0.2.3 (
|
|
107
|
+
// 🌗 0.2.3 (Welcome 0.2.21): one shared theme mode for every toggle
|
|
108
108
|
export { AbThemeModeProvider, useAbThemeModeContext, AB_THEME_MODE_ICONS, AB_THEME_ICON_BUTTON_GLYPH } from '../ab-theme-mode/index.tsx';
|
|
109
109
|
export type { AbThemeModeProviderProps, AbThemeModeContextValue } from '../ab-theme-mode/index.tsx';
|
|
110
110
|
// 🆕 0.2.0 drawers v2: AbSearchDrawer
|
|
@@ -138,18 +138,19 @@ export { default as AbProduct } from '../ab-product/index.tsx';
|
|
|
138
138
|
export { default as AbProductItem } from '../ab-product-item/index.tsx';
|
|
139
139
|
export { default as AbDemoBox } from '../ab-demo-box/index.tsx';
|
|
140
140
|
export { default as AbDemoCode } from '../ab-demo-code/index.tsx';
|
|
141
|
+
export { default as AbPreviewCode } from '../ab-preview-code/index.tsx';
|
|
141
142
|
export { default as AbPolygon } from '../server/ab-polygon/index.tsx';
|
|
142
|
-
// 💡 0.3.4 (
|
|
143
|
+
// 💡 0.3.4 (0.2.24 MDX docs): AbCallout
|
|
143
144
|
export { default as AbCallout, AB_CALLOUT_ICONS } from '../ab-callout/index.tsx';
|
|
144
145
|
export type { AbCalloutProps, AbCalloutVariant } from '../ab-callout/index.tsx';
|
|
145
|
-
// 💻 0.3.4 (
|
|
146
|
+
// 💻 0.3.4 (0.2.24 MDX docs): AbCodeBlock (+ its copy island)
|
|
146
147
|
export { default as AbCodeBlock } from '../ab-code-block/index.tsx';
|
|
147
148
|
export { default as AbCodeBlockCopy } from '../ab-code-block/copy.tsx';
|
|
148
149
|
export type { AbCodeBlockCopyProps } from '../ab-code-block/copy.tsx';
|
|
149
150
|
export type { AbCodeBlockProps } from '../ab-code-block/index.tsx';
|
|
150
|
-
// 🗂️ 0.3.4 (
|
|
151
|
+
// 🗂️ 0.3.4 (0.2.24 MDX docs): AbContentTabs + AbContentTab (MDX <Tabs>/<Tab>)
|
|
151
152
|
export { default as AbContentTabs, AbContentTab } from '../ab-content-tabs/index.tsx';
|
|
152
153
|
export type { AbContentTabsProps, AbContentTabProps } from '../ab-content-tabs/index.tsx';
|
|
153
|
-
// ⏮️⏭️ 0.3.4 (
|
|
154
|
+
// ⏮️⏭️ 0.3.4 (0.2.24 MDX docs): AbDocPager
|
|
154
155
|
export { default as AbDocPager } from '../ab-doc-pager/index.tsx';
|
|
155
156
|
export type { AbDocPagerProps, AbDocPagerLink } from '../ab-doc-pager/index.tsx';
|