@softure-ai/theme-notion 0.28.0 → 0.29.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 +8 -0
- package/README.md +2 -1
- package/dist/notion/TabBar.d.ts +3 -1
- package/dist/notion/TabBar.d.ts.map +1 -1
- package/dist/notion/TabBar.js +6 -2
- package/dist/notion/TabBar.js.map +1 -1
- package/package.json +1 -1
- package/src/notion/TabBar.tsx +16 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ Newest first. Each version lists what changed for an app that uses the theme. Wh
|
|
|
4
4
|
production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
|
|
5
5
|
"Definition of done").
|
|
6
6
|
|
|
7
|
+
## 0.29.0
|
|
8
|
+
|
|
9
|
+
- Touch-sized `TabBar`: `size="touch"` draws every tab link at least the touch target (44 x 44 px, `h-touch-target
|
|
10
|
+
min-w-touch-target`, padded `px-3`, `data-size="touch"`) for a phone view, and `tabClassName` is added to every link
|
|
11
|
+
after the size, so one breakpoint class brings the pointer size back on a desktop
|
|
12
|
+
(`tabClassName="md:h-control-height md:min-w-0"`). The bar already scrolls sideways inside itself.
|
|
13
|
+
- Migration: none; the default size renders the same markup as before.
|
|
14
|
+
|
|
7
15
|
## 0.28.0
|
|
8
16
|
|
|
9
17
|
- A grip that shows on hover (#1353): `SortableHandle reveal="hover"` (default `"always"`) hides the grip under a fine
|
package/README.md
CHANGED
|
@@ -169,7 +169,8 @@ and zoom; one row per document with its type, size and an "available offline" ma
|
|
|
169
169
|
(`SelectItem size="touch"`; an item's own `size` wins over its list's). The same rule holds for the dropdown menu
|
|
170
170
|
(`DropdownMenuContent size="touch"`, or `size="touch"` on a `DropdownMenuItem`, `DropdownMenuCheckboxItem`,
|
|
171
171
|
`DropdownMenuRadioItem` or `DropdownMenuSubTrigger`) and the tabs (`TabsList size="touch"` grows to its triggers,
|
|
172
|
-
each at least 44 × 44, or `TabsTrigger size="touch"`). `
|
|
172
|
+
each at least 44 × 44, or `TabsTrigger size="touch"`). `TabBar size="touch"` draws every tab link at least 44 × 44 (`data-size="touch"`), and its
|
|
173
|
+
`tabClassName` goes on every link after the size (`tabClassName="md:h-control-height md:min-w-0"` on a desktop). `AccordionTrigger size="touch"` is at least 44 px high
|
|
173
174
|
whatever its padding, and `DialogContent closeButtonSize="touch"` draws the close button 44 × 44 around the same
|
|
174
175
|
icon. Each sets its height with a plain class, so one breakpoint class brings the pointer size back on a desktop.
|
|
175
176
|
|
package/dist/notion/TabBar.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export interface TabBarProps<Key extends string> {
|
|
|
10
10
|
readonly label: string;
|
|
11
11
|
readonly tabs: readonly TabBarItem<Key>[];
|
|
12
12
|
readonly current: Key;
|
|
13
|
+
readonly size?: "default" | "touch";
|
|
14
|
+
readonly tabClassName?: string;
|
|
13
15
|
}
|
|
14
|
-
export declare function TabBar<Key extends string>({ label, tabs, current }: TabBarProps<Key>): import("react").JSX.Element;
|
|
16
|
+
export declare function TabBar<Key extends string>({ label, tabs, current, size, tabClassName }: TabBarProps<Key>): import("react").JSX.Element;
|
|
15
17
|
//# sourceMappingURL=TabBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../src/notion/TabBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../src/notion/TabBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,UAAU,CAAC,GAAG,SAAS,MAAM;IAE5C,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAE1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,WAAW,CAAC,GAAG,SAAS,MAAM;IAE7C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC;IAEtB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAGpC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAQD,wBAAgB,MAAM,CAAC,GAAG,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAgB,EAAE,YAAY,EAAE,EAAE,WAAW,CAAC,GAAG,CAAC,+BA2BpH"}
|
package/dist/notion/TabBar.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
const TAB_CLASS = "relative inline-flex h-control-height items-center gap-1.5 rounded-md px-2 text-ui-medium whitespace-nowrap text-muted-foreground transition-colors duration-120 after:absolute after:inset-x-0 after:-bottom-1 after:h-0.5 after:bg-foreground after:opacity-0 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none aria-[current=page]:text-foreground aria-[current=page]:after:opacity-100 [&_svg]:size-4 [&_svg]:shrink-0";
|
|
4
|
+
const TOUCH_TAB_CLASS = "h-touch-target min-w-touch-target justify-center px-3";
|
|
2
5
|
// A screen's tabs as line tabs where each tab is a link, so the shown tab lives in the address and survives a reload.
|
|
3
|
-
export function TabBar({ label, tabs, current }) {
|
|
4
|
-
|
|
6
|
+
export function TabBar({ label, tabs, current, size = "default", tabClassName }) {
|
|
7
|
+
const linkClass = cn(TAB_CLASS, size === "touch" && TOUCH_TAB_CLASS, tabClassName);
|
|
8
|
+
return (_jsx("nav", { "aria-label": label, "data-slot": "tab-bar", className: "overflow-x-auto border-b border-border", children: _jsx("ul", { className: "flex gap-1 pb-1", children: tabs.map((tab) => (_jsx("li", { children: _jsxs("a", { href: tab.href, className: linkClass, "data-tab": tab.key, "data-size": size === "touch" ? "touch" : undefined, "aria-current": tab.key === current ? "page" : undefined, children: [tab.icon, tab.label, tab.count === undefined ? null : (_jsx("span", { "data-slot": "tab-bar-count", className: "rounded-xs bg-accent px-1 text-small text-muted-foreground tabular-nums", children: tab.count }))] }) }, tab.key))) }) }));
|
|
5
9
|
}
|
|
6
10
|
//# sourceMappingURL=TabBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBar.js","sourceRoot":"","sources":["../../src/notion/TabBar.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TabBar.js","sourceRoot":"","sources":["../../src/notion/TabBar.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAyBrC,MAAM,SAAS,GACb,ydAAyd,CAAC;AAE5d,MAAM,eAAe,GAAG,uDAAuD,CAAC;AAEhF,sHAAsH;AACtH,MAAM,UAAU,MAAM,CAAqB,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAG,SAAS,EAAE,YAAY,EAAoB;IACnH,MAAM,SAAS,GAAG,EAAE,CAAC,SAAS,EAAE,IAAI,KAAK,OAAO,IAAI,eAAe,EAAE,YAAY,CAAC,CAAC;IACnF,OAAO,CACL,4BAAiB,KAAK,eAAY,SAAS,EAAC,SAAS,EAAC,wCAAwC,YAC5F,aAAI,SAAS,EAAC,iBAAiB,YAC5B,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,uBACE,aACE,IAAI,EAAE,GAAG,CAAC,IAAI,EACd,SAAS,EAAE,SAAS,cACV,GAAG,CAAC,GAAG,eACN,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,kBACnC,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,aAErD,GAAG,CAAC,IAAI,EACR,GAAG,CAAC,KAAK,EACT,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAChC,4BAAgB,eAAe,EAAC,SAAS,EAAC,yEAAyE,YAChH,GAAG,CAAC,KAAK,GACL,CACR,IACC,IAfG,GAAG,CAAC,GAAG,CAgBX,CACN,CAAC,GACC,GACD,CACP,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/theme-notion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "SOFTURE AI Notion theme: shadcn/ui components (new-york v4, Radix, Tailwind CSS v4, lucide) with the Notion design system's tokens and deltas, ready to import.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/src/notion/TabBar.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
|
|
3
5
|
export interface TabBarItem<Key extends string> {
|
|
4
6
|
// Kept on the link as `data-tab`.
|
|
5
7
|
readonly key: Key;
|
|
@@ -16,10 +18,21 @@ export interface TabBarProps<Key extends string> {
|
|
|
16
18
|
readonly label: string;
|
|
17
19
|
readonly tabs: readonly TabBarItem<Key>[];
|
|
18
20
|
readonly current: Key;
|
|
21
|
+
// "touch" draws every tab at least the touch target (44 x 44 px) for a phone view; the default keeps the control's height.
|
|
22
|
+
readonly size?: "default" | "touch";
|
|
23
|
+
// Added to every tab's link after the size, so one breakpoint class brings the pointer size back on a desktop
|
|
24
|
+
// (`size="touch" tabClassName="md:h-control-height md:min-w-0"`).
|
|
25
|
+
readonly tabClassName?: string;
|
|
19
26
|
}
|
|
20
27
|
|
|
28
|
+
const TAB_CLASS =
|
|
29
|
+
"relative inline-flex h-control-height items-center gap-1.5 rounded-md px-2 text-ui-medium whitespace-nowrap text-muted-foreground transition-colors duration-120 after:absolute after:inset-x-0 after:-bottom-1 after:h-0.5 after:bg-foreground after:opacity-0 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none aria-[current=page]:text-foreground aria-[current=page]:after:opacity-100 [&_svg]:size-4 [&_svg]:shrink-0";
|
|
30
|
+
|
|
31
|
+
const TOUCH_TAB_CLASS = "h-touch-target min-w-touch-target justify-center px-3";
|
|
32
|
+
|
|
21
33
|
// A screen's tabs as line tabs where each tab is a link, so the shown tab lives in the address and survives a reload.
|
|
22
|
-
export function TabBar<Key extends string>({ label, tabs, current }: TabBarProps<Key>) {
|
|
34
|
+
export function TabBar<Key extends string>({ label, tabs, current, size = "default", tabClassName }: TabBarProps<Key>) {
|
|
35
|
+
const linkClass = cn(TAB_CLASS, size === "touch" && TOUCH_TAB_CLASS, tabClassName);
|
|
23
36
|
return (
|
|
24
37
|
<nav aria-label={label} data-slot="tab-bar" className="overflow-x-auto border-b border-border">
|
|
25
38
|
<ul className="flex gap-1 pb-1">
|
|
@@ -27,8 +40,9 @@ export function TabBar<Key extends string>({ label, tabs, current }: TabBarProps
|
|
|
27
40
|
<li key={tab.key}>
|
|
28
41
|
<a
|
|
29
42
|
href={tab.href}
|
|
30
|
-
className=
|
|
43
|
+
className={linkClass}
|
|
31
44
|
data-tab={tab.key}
|
|
45
|
+
data-size={size === "touch" ? "touch" : undefined}
|
|
32
46
|
aria-current={tab.key === current ? "page" : undefined}
|
|
33
47
|
>
|
|
34
48
|
{tab.icon}
|