knowidea-ui 0.11.0 → 0.12.1

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.
@@ -1,10 +1,14 @@
1
1
  import type { CSSProperties, ReactNode } from "react";
2
2
  import type { NavItem } from "./NavItems.js";
3
3
  export interface AppShellProps {
4
- /** 画面の切り替え。3〜5 個 */
4
+ /** 画面の切り替え。左にはすべてを出す。bottomItems が無い時は下にも同じ物を出すので 3〜5 個にする(6 個以上だと下ではみ出す) */
5
5
  items: NavItem[];
6
6
  /** 今いる所の id */
7
7
  current?: string;
8
+ /** 下の切り替え(1024px 未満)だけに出す項目。3〜5 個。items が 6 個以上の時は必ず渡し、主な物と「その他」を置く。「その他」は、下に出さない画面を並べた画面へ行く項目で、その画面は使う側が作る */
9
+ bottomItems?: NavItem[];
10
+ /** 下の切り替えで今いる所の id。既定は current。current が bottomItems に無いと下には印が付かないので、その時は「その他」の id を渡す */
11
+ bottomCurrent?: string;
8
12
  /** 左の切り替えの上に出す名前(PC の幅だけ) */
9
13
  brand?: {
10
14
  name: string;
@@ -16,7 +20,7 @@ export interface AppShellProps {
16
20
  header?: ReactNode;
17
21
  /** 左の切り替えの下に置く物(PC の幅だけ) */
18
22
  sideFooter?: ReactNode;
19
- /** 枠の最小の高さ。既定 100dvh。見本の中に置く時に絞る */
23
+ /** 枠の高さ。既定 100dvh。中身が長い時は <main> の中だけが送られる。見本の中に置く時に絞る */
20
24
  minHeight?: string;
21
25
  className?: string;
22
26
  style?: CSSProperties;
@@ -24,6 +28,8 @@ export interface AppShellProps {
24
28
  }
25
29
  /**
26
30
  * 画面の枠。スマホと iPad(1024px 未満)は下に、PC(1024px 以上)は左に画面の切り替えを出す。
27
- * 中身は <main> に入る。切り替えは両方を描き、幅で片方だけを見せる(見えない方は読み上げにも出ない)。
31
+ * 中身は <main> に入り、送られるのは <main> だけ。上の header と下の切り替えは別の段に置き、中身に重ねない。
32
+ * <main> は Tab で止まり、押せる物の無い長い中身も矢印のキーで送れる。
33
+ * 切り替えは両方を描き、幅で片方だけを見せる(見えない方は読み上げにも出ない)。
28
34
  */
29
- export declare function AppShell({ items, current, brand, label, header, sideFooter, minHeight, className, style, children }: AppShellProps): import("react").JSX.Element;
35
+ export declare function AppShell({ items, current, bottomItems, bottomCurrent, brand, label, header, sideFooter, minHeight, className, style, children }: AppShellProps): import("react").JSX.Element;
package/dist/AppShell.js CHANGED
@@ -4,9 +4,11 @@ import { Drawer } from "./Drawer.js";
4
4
  import { cx } from "./utils.js";
5
5
  /**
6
6
  * 画面の枠。スマホと iPad(1024px 未満)は下に、PC(1024px 以上)は左に画面の切り替えを出す。
7
- * 中身は <main> に入る。切り替えは両方を描き、幅で片方だけを見せる(見えない方は読み上げにも出ない)。
7
+ * 中身は <main> に入り、送られるのは <main> だけ。上の header と下の切り替えは別の段に置き、中身に重ねない。
8
+ * <main> は Tab で止まり、押せる物の無い長い中身も矢印のキーで送れる。
9
+ * 切り替えは両方を描き、幅で片方だけを見せる(見えない方は読み上げにも出ない)。
8
10
  */
9
- export function AppShell({ items, current, brand, label = "画面の切り替え", header, sideFooter, minHeight, className, style, children }) {
11
+ export function AppShell({ items, current, bottomItems, bottomCurrent, brand, label = "画面の切り替え", header, sideFooter, minHeight, className, style, children }) {
10
12
  const s = { ...(minHeight ? { "--ki-shell-height": minHeight } : null), ...style };
11
- return (_jsxs("div", { className: cx("ki-shell", className), style: s, children: [_jsx(Drawer, { className: "ki-shell__side", variant: "permanent", items: items, current: current, brand: brand, label: label, footer: sideFooter }), _jsxs("div", { className: "ki-shell__body", children: [header, _jsx("main", { className: "ki-shell__main", children: children })] }), _jsx(BottomNavigation, { className: "ki-shell__bottom", items: items, current: current, label: label, position: "sticky" })] }));
13
+ return (_jsxs("div", { className: cx("ki-shell", className), style: s, children: [_jsx(Drawer, { className: "ki-shell__side", variant: "permanent", items: items, current: current, brand: brand, label: label, footer: sideFooter }), _jsxs("div", { className: "ki-shell__body", children: [header, _jsx("main", { className: "ki-shell__main", tabIndex: 0, children: children })] }), _jsx(BottomNavigation, { className: "ki-shell__bottom", items: bottomItems ?? items, current: bottomCurrent ?? current, label: label })] }));
12
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knowidea-ui",
3
- "version": "0.11.0",
3
+ "version": "0.12.1",
4
4
  "description": "KNOW IDEA UI の React の部品(Base UI が土台)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -45,9 +45,9 @@
45
45
  "peerDependencies": {
46
46
  "react": "^19.0.0",
47
47
  "react-dom": "^19.0.0",
48
- "knowidea-css": "^0.11.0",
49
- "knowidea-tokens": "^0.11.0",
50
- "knowidea-icons": "^0.11.0"
48
+ "knowidea-css": "^0.12.1",
49
+ "knowidea-icons": "^0.12.1",
50
+ "knowidea-tokens": "^0.12.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/react": "19.3.0",
@@ -55,9 +55,9 @@
55
55
  "react": "19.3.0",
56
56
  "react-dom": "19.3.0",
57
57
  "typescript": "5.9.3",
58
- "knowidea-icons": "0.11.0",
59
- "knowidea-css": "0.11.0",
60
- "knowidea-tokens": "0.11.0"
58
+ "knowidea-tokens": "0.12.1",
59
+ "knowidea-icons": "0.12.1",
60
+ "knowidea-css": "0.12.1"
61
61
  },
62
62
  "files": [
63
63
  "dist",