achery-ui 0.5.2 → 0.5.4
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/index.cjs +30 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +25 -6
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +30 -28
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1003,6 +1003,20 @@ interface SidebarProps {
|
|
|
1003
1003
|
/**
|
|
1004
1004
|
* Content rendered at the bottom of the sidebar — typically user account
|
|
1005
1005
|
* info, a settings link, or version text.
|
|
1006
|
+
*
|
|
1007
|
+
* **Responsive action pattern:** `AppBar` hides its `actions` slot on mobile
|
|
1008
|
+
* via CSS (below 768 px). If those actions must remain accessible on mobile,
|
|
1009
|
+
* pass the same node here so it appears at the foot of the mobile overlay.
|
|
1010
|
+
*
|
|
1011
|
+
* @example
|
|
1012
|
+
* ```tsx
|
|
1013
|
+
* // Month selector: visible in AppBar on desktop, in Sidebar footer on mobile
|
|
1014
|
+
* const isMobile = useIsMobile()
|
|
1015
|
+
* const monthPicker = <MonthSelect value={month} onChange={setMonth} />
|
|
1016
|
+
*
|
|
1017
|
+
* <Sidebar footer={isMobile ? monthPicker : undefined} … />
|
|
1018
|
+
* <AppBar actions={monthPicker} … />
|
|
1019
|
+
* ```
|
|
1006
1020
|
*/
|
|
1007
1021
|
footer?: ReactNode;
|
|
1008
1022
|
/**
|
|
@@ -1083,6 +1097,11 @@ interface AppBarProps {
|
|
|
1083
1097
|
/**
|
|
1084
1098
|
* Arbitrary content inserted after the built-in controls (theme toggle, accent
|
|
1085
1099
|
* picker, new button) and before the avatar. Use for custom action buttons.
|
|
1100
|
+
*
|
|
1101
|
+
* **Mobile note:** the `actions` slot (along with search and `brandSub`) is
|
|
1102
|
+
* hidden via CSS below 768 px. If an action must remain reachable on mobile,
|
|
1103
|
+
* also pass it as `footer` to the accompanying `<Sidebar>` so it appears in
|
|
1104
|
+
* the mobile overlay. See {@link SidebarProps.footer} for a usage example.
|
|
1086
1105
|
*/
|
|
1087
1106
|
actions?: ReactNode;
|
|
1088
1107
|
/** Currently active accent colour — drives the accent picker selection indicator. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1003,6 +1003,20 @@ interface SidebarProps {
|
|
|
1003
1003
|
/**
|
|
1004
1004
|
* Content rendered at the bottom of the sidebar — typically user account
|
|
1005
1005
|
* info, a settings link, or version text.
|
|
1006
|
+
*
|
|
1007
|
+
* **Responsive action pattern:** `AppBar` hides its `actions` slot on mobile
|
|
1008
|
+
* via CSS (below 768 px). If those actions must remain accessible on mobile,
|
|
1009
|
+
* pass the same node here so it appears at the foot of the mobile overlay.
|
|
1010
|
+
*
|
|
1011
|
+
* @example
|
|
1012
|
+
* ```tsx
|
|
1013
|
+
* // Month selector: visible in AppBar on desktop, in Sidebar footer on mobile
|
|
1014
|
+
* const isMobile = useIsMobile()
|
|
1015
|
+
* const monthPicker = <MonthSelect value={month} onChange={setMonth} />
|
|
1016
|
+
*
|
|
1017
|
+
* <Sidebar footer={isMobile ? monthPicker : undefined} … />
|
|
1018
|
+
* <AppBar actions={monthPicker} … />
|
|
1019
|
+
* ```
|
|
1006
1020
|
*/
|
|
1007
1021
|
footer?: ReactNode;
|
|
1008
1022
|
/**
|
|
@@ -1083,6 +1097,11 @@ interface AppBarProps {
|
|
|
1083
1097
|
/**
|
|
1084
1098
|
* Arbitrary content inserted after the built-in controls (theme toggle, accent
|
|
1085
1099
|
* picker, new button) and before the avatar. Use for custom action buttons.
|
|
1100
|
+
*
|
|
1101
|
+
* **Mobile note:** the `actions` slot (along with search and `brandSub`) is
|
|
1102
|
+
* hidden via CSS below 768 px. If an action must remain reachable on mobile,
|
|
1103
|
+
* also pass it as `footer` to the accompanying `<Sidebar>` so it appears in
|
|
1104
|
+
* the mobile overlay. See {@link SidebarProps.footer} for a usage example.
|
|
1086
1105
|
*/
|
|
1087
1106
|
actions?: ReactNode;
|
|
1088
1107
|
/** Currently active accent colour — drives the accent picker selection indicator. */
|
package/dist/index.js
CHANGED
|
@@ -771,9 +771,8 @@ function NavGroup({ label: label4, items, activeId, onItemClick, renderLink, col
|
|
|
771
771
|
] });
|
|
772
772
|
}
|
|
773
773
|
function NavItem({ item: item2, active, onClick, renderLink, collapsed }) {
|
|
774
|
-
const glyphStyle = active ? { filter: "invert(1)" } : void 0;
|
|
775
774
|
const content3 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
776
|
-
item2.glyph ? /* @__PURE__ */ jsx(Glyph, { name: item2.glyph, size: 14,
|
|
775
|
+
item2.glyph ? /* @__PURE__ */ jsx(Glyph, { name: item2.glyph, size: 14, "aria-hidden": "true" }) : /* @__PURE__ */ jsx("span", {}),
|
|
777
776
|
!collapsed && /* @__PURE__ */ jsx("span", { children: item2.label }),
|
|
778
777
|
!collapsed && item2.count !== void 0 && /* @__PURE__ */ jsx("span", { className: item2.countTone === "accent" ? countAccent : navItemCount, children: item2.count })
|
|
779
778
|
] });
|
|
@@ -845,9 +844,10 @@ function Avatar({ initials: initials2, size = "md", tone = "neutral", className
|
|
|
845
844
|
}
|
|
846
845
|
|
|
847
846
|
// src/components/AppBar/AppBar.css.ts
|
|
848
|
-
var accentPicker = "
|
|
849
|
-
var accentSwatch = "
|
|
847
|
+
var accentPicker = "AppBar_accentPicker__uqki99a";
|
|
848
|
+
var accentSwatch = "AppBar_accentSwatch__uqki99b";
|
|
850
849
|
var actions = "AppBar_actions__uqki998";
|
|
850
|
+
var actionsInner = "AppBar_actionsInner__uqki999";
|
|
851
851
|
var appBar = "AppBar_appBar__uqki990";
|
|
852
852
|
var brand = "AppBar_brand__uqki991";
|
|
853
853
|
var brandDivider = "AppBar_brandDivider__uqki993";
|
|
@@ -911,30 +911,32 @@ function AppBar({
|
|
|
911
911
|
searchKbd2 && /* @__PURE__ */ jsx("span", { className: searchKbd, children: searchKbd2 })
|
|
912
912
|
] }),
|
|
913
913
|
/* @__PURE__ */ jsxs("div", { className: actions, children: [
|
|
914
|
-
|
|
915
|
-
"
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
914
|
+
/* @__PURE__ */ jsxs("div", { className: actionsInner, children: [
|
|
915
|
+
onAccentChange && /* @__PURE__ */ jsx("div", { className: accentPicker, role: "group", "aria-label": "Brand colour", children: accentColorNames.map((name) => /* @__PURE__ */ jsx(
|
|
916
|
+
"button",
|
|
917
|
+
{
|
|
918
|
+
className: accentSwatch,
|
|
919
|
+
"data-active": name === accent,
|
|
920
|
+
onClick: () => onAccentChange(name),
|
|
921
|
+
"aria-label": name,
|
|
922
|
+
"aria-pressed": name === accent,
|
|
923
|
+
style: { background: accentColors[name].main }
|
|
924
|
+
},
|
|
925
|
+
name
|
|
926
|
+
)) }),
|
|
927
|
+
onToggleTheme && /* @__PURE__ */ jsx(
|
|
928
|
+
Button,
|
|
929
|
+
{
|
|
930
|
+
variant: "ghost",
|
|
931
|
+
size: "sm",
|
|
932
|
+
glyph: isDark ? "sun" : "moon",
|
|
933
|
+
onClick: onToggleTheme,
|
|
934
|
+
"aria-label": isDark ? "Switch to light mode" : "Switch to dark mode"
|
|
935
|
+
}
|
|
936
|
+
),
|
|
937
|
+
onNewClick && /* @__PURE__ */ jsx(Button, { variant: "accent", size: "sm", glyph: "plus", onClick: onNewClick, children: "New" }),
|
|
938
|
+
actions2
|
|
939
|
+
] }),
|
|
938
940
|
avatarInitials && /* @__PURE__ */ jsx(Avatar, { initials: avatarInitials, size: "sm", tone: "neutral" })
|
|
939
941
|
] })
|
|
940
942
|
] });
|