@designbasekorea/wordpress-ui 0.1.4 → 0.1.6

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.
@@ -2,7 +2,8 @@
2
2
 
3
3
  이 문서는 `@designbasekorea/wordpress-ui`를 WordPress 플러그인과 테마의 관리자 화면에 적용하는 표준 가이드입니다.
4
4
 
5
- 이 가이드의 기준 배포 버전은 `0.1.4`입니다. 플러그인 또는 테마의 lockfile과
5
+ 이 가이드의 기준 배포 버전은 `0.1.6`입니다. `@designbasekorea/ui-wc@0.8.7`과
6
+ 같은 세트를 사용하세요. 플러그인 또는 테마의 lockfile과
6
7
  vendor 산출물도 같은 버전으로 맞추고, 버전을 올릴 때마다 아래 검증 명령을 다시
7
8
  실행합니다.
8
9
 
@@ -39,7 +40,7 @@ WordPress plugin/theme
39
40
 
40
41
  ### 1.1 WordPress 전역 관리자와 플러그인 내부 shell의 경계
41
42
 
42
- `AdminShell`과 `AdminSidebar`는 플러그인 또는 테마 내부 화면을 위한 것입니다. 다음 전역 요소는 수정하지 않습니다.
43
+ `db-admin-shell`과 React `AdminShell`은 플러그인 또는 테마 **내부 화면**을 위한 것입니다. 다음 전역 요소는 수정하지 않습니다.
43
44
 
44
45
  - `#adminmenu`
45
46
  - `#wpadminbar`
@@ -62,7 +63,7 @@ WordPress plugin/theme
62
63
  ### 2.1 Node 프로젝트에 설치
63
64
 
64
65
  ```bash
65
- npm install @designbasekorea/wordpress-ui@0.1.4
66
+ npm install @designbasekorea/wordpress-ui@0.1.6
66
67
  ```
67
68
 
68
69
  WordPress 서버가 npm을 실행하는 것이 아닙니다. 라이브러리를 설치한 뒤 플러그인 또는 테마 빌드 과정에서 배포에 필요한 파일을 포함해야 합니다.
@@ -143,7 +144,7 @@ require_once __DIR__ . '/vendor/wordpress-ui/wordpress-ui.php';
143
144
 
144
145
  final class MyPlugin_Admin_Assets
145
146
  {
146
- private const UI_VERSION = '0.1.4';
147
+ private const UI_VERSION = '0.1.6';
147
148
 
148
149
  public static function init(): void
149
150
  {
@@ -266,15 +267,17 @@ WordPress 플러그인과 테마의 기본 선택지는 vanilla/PHP입니다. Re
266
267
 
267
268
  ### 4.1 페이지 기본 구조
268
269
 
269
- PHP 템플릿은 `.designbase-wp-admin` root `db-page-header`만 선언하고, 화면별
270
- AssetsManager가 `wordpress-ui` runtime과 shell adapter를 enqueue하는 방식을 권장합니다.
271
- adapter는 `ui-wc`의 실제 `db-sidebar`를 생성하고, 설정의 `title`을 사이드바 상단
272
- 플러그인명으로 표시합니다. `db-page-header`를 제외한 root children은 자동으로
273
- `<db-container size="full" padding="l" full-width>` 안에 배치됩니다.
270
+ PHP 템플릿은 `.designbase-wp-admin` root 안에서 `db-admin-shell`을 선언하는 방식을
271
+ 권장합니다. Web Component가 실제 `db-sidebar`, 플러그인명 로고,
272
+ `db-page-header`, 콘텐츠용 `<db-container size="full" padding="l" full-width>`를
273
+ 하나의 패턴으로 렌더링합니다.
274
274
 
275
- `sections`/`items`는 PHP에서 `wp_json_encode()`로 전달하고, 링크·권한·활성 상태는
276
- 소비 플러그인이나 테마가 관리합니다. adapter를 사용하지 않는 수동 구성에서는 아래처럼
277
- `db-sidebar`와 `db-container`를 직접 선언할 있습니다.
275
+ `title`(또는 `brand`) 사이드바 **헤더 로고**입니다. 메뉴는 `items` JSON으로 넘기고,
276
+ 링크·권한·활성 상태는 소비 플러그인이나 테마가 계산합니다. 메뉴를 실제 그룹으로 나눌
277
+ 때만 `sections`를 쓰고, 그룹 제목에 플러그인명을 넣지 않습니다.
278
+
279
+ 직접 자식 `db-page-header`는 헤더로 유지되고, 나머지 자식은 shell이 `db-container`
280
+ 안으로 이동합니다.
278
281
 
279
282
  ```php
280
283
  <?php
@@ -283,7 +286,7 @@ $sidebar_items = [
283
286
  'id' => 'dashboard',
284
287
  'label' => __('대시보드', 'myplugin'),
285
288
  'href' => admin_url('admin.php?page=myplugin'),
286
- 'icon' => 'doughnut-chart',
289
+ 'icon' => 'dashboard',
287
290
  'active' => (($_GET['page'] ?? '') === 'myplugin'),
288
291
  ],
289
292
  [
@@ -296,49 +299,30 @@ $sidebar_items = [
296
299
  ];
297
300
  ?>
298
301
  <div class="wrap designbase-wp-admin myplugin-admin">
299
- <div class="designbase-wp-admin__shell designbase-wp-admin__shell--has-sidebar">
300
- <aside class="designbase-wp-admin__shell-sidebar" aria-label="<?php esc_attr_e('My Plugin 메뉴', 'myplugin'); ?>">
301
- <div class="designbase-wp-admin__shell-brand">
302
- <db-logo type="custom" text="My Plugin" size="s"></db-logo>
303
- </div>
304
- <db-sidebar
305
- size="m"
306
- show-logo="false"
307
- collapsible="false"
308
- full-height
309
- sections='<?php echo esc_attr(wp_json_encode([[
310
- 'id' => 'main',
311
- 'title' => 'My Plugin',
312
- 'items' => $sidebar_items,
313
- ]])); ?>'>
314
- </db-sidebar>
315
- </aside>
316
-
317
- <main class="designbase-wp-admin__shell-main" id="main-content">
318
- <db-page-header
319
- title="<?php esc_attr_e('대시보드', 'myplugin'); ?>"
320
- description="<?php esc_attr_e('플러그인 상태와 최근 작업을 확인합니다.', 'myplugin'); ?>"
321
- variant="minimal"
322
- align="left">
323
- <div slot="actions">
324
- <a class="button button-secondary" href="<?php echo esc_url(admin_url('admin.php?page=myplugin-settings')); ?>">
325
- <?php esc_html_e('설정', 'myplugin'); ?>
326
- </a>
327
- </div>
328
- </db-page-header>
329
-
330
- <db-container size="full" padding="l" full-width>
331
- <!-- db-tabs, db-section, db-table 등을 배치한다. -->
332
- </db-container>
333
- </main>
334
- </div>
302
+ <db-admin-shell
303
+ title="My Plugin"
304
+ items="<?php echo esc_attr(wp_json_encode($sidebar_items)); ?>"
305
+ >
306
+ <db-page-header
307
+ title="<?php esc_attr_e('대시보드', 'myplugin'); ?>"
308
+ description="<?php esc_attr_e('플러그인 상태와 최근 작업을 확인합니다.', 'myplugin'); ?>"
309
+ variant="minimal">
310
+ <a slot="actions" class="button button-secondary" href="<?php echo esc_url(admin_url('admin.php?page=myplugin-settings')); ?>">
311
+ <?php esc_html_e('설정', 'myplugin'); ?>
312
+ </a>
313
+ </db-page-header>
314
+
315
+ <db-section title="<?php esc_attr_e('콘텐츠', 'myplugin'); ?>">
316
+ <!-- db-tabs, db-table 등을 배치한다. db-admin-shell이 db-container로 감싼다. -->
317
+ </db-section>
318
+ </db-admin-shell>
335
319
  </div>
336
320
  ```
337
321
 
338
- 기존 화면을 일괄 재작성하기 어려운 경우에는 동일한 `.designbase-wp-admin` root
339
- `db-page-header`를 유지하고, 소비 플러그인의 작은 vanilla adapter에서 root children을
340
- `designbase-wp-admin__shell`로 감싼 뒤 `db-sidebar`를 생성해도 됩니다. adapter는
341
- 패키지의 Web Component runtime을 대체하지 않으며, 화면별 메뉴 설정만 담당합니다.
322
+ 기존 화면을 일괄 재작성하기 어려운 경우에는 현재 플러그인의 adapter가 기존 root children을
323
+ `db-admin-shell`로 이동하게 두어도 됩니다. adapter는 화면별 메뉴 설정과 root 선택만
324
+ 담당하고, 실제 shell·sidebar·header toggle·content container 렌더링은 패키지의
325
+ Web Component 담당합니다.
342
326
 
343
327
  컴포넌트 스타일을 사용하는 자체 markup은 `.designbase-wp-admin` 내부에 둡니다. 단순한 링크와 form submit은 WordPress의 native `<a>`와 `<button>`을 우선 사용하고, 복합 동작이 필요한 경우에만 Web Component를 사용합니다.
344
328
 
@@ -421,10 +405,10 @@ select?.addEventListener('db-change', (event) => {
421
405
  아이콘은 이모지나 임의의 유니코드 문자를 사용하지 않고 Designbase icons 이름을 사용합니다.
422
406
 
423
407
  ```html
424
- <i class="dbwp-admin-icon icon-dashboard" aria-hidden="true"></i>
425
- <i class="dbwp-admin-icon icon-file-manager" aria-hidden="true"></i>
426
- <i class="dbwp-admin-icon icon-search" aria-hidden="true"></i>
427
- <i class="dbwp-admin-icon icon-settings" aria-hidden="true"></i>
408
+ <i class="icon-dashboard" aria-hidden="true"></i>
409
+ <i class="icon-file-manager" aria-hidden="true"></i>
410
+ <i class="icon-search" aria-hidden="true"></i>
411
+ <i class="icon-settings" aria-hidden="true"></i>
428
412
  ```
429
413
 
430
414
  `styles.css`가 아이콘 폰트와 `@font-face` 규칙을 포함합니다. 아이콘이 보이지 않으면 다음을 확인합니다.
@@ -439,20 +423,21 @@ select?.addEventListener('db-change', (event) => {
439
423
  React는 선택 사항입니다. Gutenberg나 기존 React 앱과 연결해야 하는 화면에서만 사용하고, 일반적인 PHP admin page에는 vanilla entry를 권장합니다.
440
424
 
441
425
  ```bash
442
- npm install @designbasekorea/wordpress-ui@0.1.4 react react-dom
426
+ npm install @designbasekorea/wordpress-ui@0.1.6 react react-dom
443
427
  ```
444
428
 
445
429
  ```tsx
446
430
  import '@designbasekorea/wordpress-ui/styles.css';
447
431
  import {
448
- AdminDataTable,
449
- AdminEmptyState,
450
- AdminFilterBar,
451
432
  AdminPage,
452
433
  AdminPageContent,
453
434
  AdminPageHeader,
454
- AdminSection,
455
435
  AdminShell,
436
+ Button,
437
+ SearchBar,
438
+ Section,
439
+ Select,
440
+ Table,
456
441
  type AdminNavItem,
457
442
  } from '@designbasekorea/wordpress-ui/react';
458
443
 
@@ -463,59 +448,61 @@ const sidebarItems: AdminNavItem[] = [
463
448
 
464
449
  export function MyPluginAdmin() {
465
450
  return (
466
- <div className="designbase-wp-admin">
467
- <AdminShell sidebarItems={sidebarItems} sidebarTitle="My Plugin">
468
- <AdminPage>
469
- <AdminPageHeader
470
- title="콘텐츠 관리"
471
- icon="file-manager"
472
- description="콘텐츠를 검색하고 상태를 관리합니다."
473
- />
474
- <AdminPageContent maxWidth="xl">
475
- <AdminSection title="검색 및 필터">
476
- <AdminFilterBar
477
- searchPlaceholder="제목 검색"
478
- statusPlaceholder="전체 상태"
479
- statusOptions={[
480
- { value: 'all', label: '전체 상태' },
481
- { value: 'published', label: '공개' },
482
- { value: 'draft', label: '임시글' },
483
- ]}
484
- onSubmit={(event) => {
485
- event.preventDefault();
486
- // REST 또는 URL query 변경은 소비 앱이 담당한다.
487
- }}
488
- />
489
- </AdminSection>
490
- <AdminSection title="목록">
491
- <AdminDataTable
492
- columns={[
493
- { id: 'title', header: '제목', key: 'title', sortable: true },
494
- { id: 'status', header: '상태', key: 'status' },
495
- ]}
496
- rows={[]}
497
- emptyState={<AdminEmptyState title="콘텐츠가 없습니다." />}
498
- />
499
- </AdminSection>
500
- </AdminPageContent>
501
- </AdminPage>
502
- </AdminShell>
503
- </div>
451
+ <AdminShell sidebarItems={sidebarItems} sidebarTitle="My Plugin">
452
+ <AdminPageHeader
453
+ title="콘텐츠 관리"
454
+ description="콘텐츠를 검색하고 상태를 관리합니다."
455
+ actions={<Button variant="primary" size="s">새 페이지</Button>}
456
+ />
457
+ <AdminPage>
458
+ <AdminPageContent>
459
+ <Section title="검색 및 필터">
460
+ <form
461
+ className="designbase-wp-admin__filter-bar"
462
+ role="search"
463
+ onSubmit={(event) => {
464
+ event.preventDefault();
465
+ // REST 또는 URL query 변경은 소비 앱이 담당한다.
466
+ }}
467
+ >
468
+ <div className="designbase-wp-admin__filter-bar-toolbar">
469
+ <SearchBar name="search" placeholder="제목 검색" aria-label="제목 검색" />
470
+ <Select
471
+ name="status"
472
+ aria-label="상태"
473
+ options={JSON.stringify([
474
+ { value: 'all', label: '전체 상태' },
475
+ { value: 'published', label: '공개' },
476
+ { value: 'draft', label: '임시글' },
477
+ ])}
478
+ />
479
+ </div>
480
+ </form>
481
+ </Section>
482
+ <Section title="목록" fullWidth>
483
+ <Table
484
+ columns={JSON.stringify([
485
+ { key: 'title', header: '제목', sortable: true },
486
+ { key: 'status', header: '상태' },
487
+ ])}
488
+ data={JSON.stringify([])}
489
+ rowKey="id"
490
+ emptyMessage="콘텐츠가 없습니다."
491
+ />
492
+ </Section>
493
+ </AdminPageContent>
494
+ </AdminPage>
495
+ </AdminShell>
504
496
  );
505
497
  }
506
498
  ```
507
499
 
508
- React adapter의 책임은 관리자 shell과 컴포넌트 조합입니다.
500
+ React adapter의 책임은 관리자 shell과 ui-wc primitives 조합입니다.
509
501
 
510
- - `AdminShell`: 내부 sidebar와 main layout
511
- - `AdminSidebar`: 메뉴, active 상태, badge, 모바일 close
502
+ - `AdminShell`: `sidebarTitle`(사이드바 로고)과 `sidebarItems`(메뉴). 내부에서 `.designbase-wp-admin` root를 만듭니다.
512
503
  - `AdminPage`, `AdminPageContent`: 페이지 폭과 밀도
513
- - `AdminPageHeader`: title, icon, description, breadcrumb, action, back link
514
- - `AdminSection`: 제목, 설명, action, optional collapse
515
- - `AdminFilterBar`: 검색과 상태 필터 표현
516
- - `AdminTabs`: 탭 표현과 active 상태
517
- - `AdminDataTable`: column, row, sort, loading, empty, error 상태 표현
518
- - `AdminEmptyState`, `AdminLoadingState`, `AdminErrorState`: 상태 화면
504
+ - `AdminPageHeader`: title, description, breadcrumb, action. 모바일에서는 메뉴 버튼을 붙입니다.
505
+ - `Section`, `Table`, `SearchBar`, `Select`, `Tabs`, `EmptyState`, `Modal` 등: 같은 패키지의 React primitives. `AdminSection` / `AdminDataTable` / `AdminFilterBar` 같은 별도 래퍼는 없습니다.
519
506
 
520
507
  이 컴포넌트들은 REST 요청, 페이지네이션 API, nonce 갱신, capability 검사를 대신하지 않습니다. React state와 서버 데이터의 생명주기는 플러그인/테마 앱이 소유합니다.
521
508
 
@@ -649,15 +636,15 @@ register_setting('myplugin', 'myplugin_options', [
649
636
 
650
637
  ```text
651
638
  .designbase-wp-admin
652
- └─ AdminShell 또는 dbwp-admin-shell
653
- ├─ AdminSidebar 또는 plugin 내부 nav
639
+ └─ AdminShell 또는 db-admin-shell
640
+ ├─ db-sidebar (title/sidebarTitle = 플러그인명 로고, items = 메뉴)
654
641
  └─ main
655
642
  ├─ AdminPageHeader / db-page-header
656
- ├─ AdminTabs / db-tabs (필요한 경우)
643
+ ├─ Tabs / db-tabs (필요한 경우)
657
644
  └─ AdminPageContent
658
- ├─ AdminSection / db-section
659
- ├─ AdminFilterBar
660
- └─ AdminDataTable 또는 native table
645
+ ├─ Section / db-section
646
+ ├─ form.designbase-wp-admin__filter-bar
647
+ └─ Table / db-table 또는 native table
661
648
  ```
662
649
 
663
650
  ### 7.1 페이지 헤더
@@ -672,7 +659,7 @@ register_setting('myplugin', 'myplugin_options', [
672
659
 
673
660
  ### 7.2 section
674
661
 
675
- 서로 다른 목적의 콘텐츠를 하나의 큰 카드에 몰아넣지 않습니다. 제목·설명·action이 있는 `AdminSection` 또는 `db-section`으로 묶습니다. 접기 상태를 제공할 때에는 키보드로 열고 닫을 수 있어야 하며, 기본 상태는 콘텐츠 중요도에 따라 결정합니다.
662
+ 서로 다른 목적의 콘텐츠를 하나의 큰 카드에 몰아넣지 않습니다. 제목·설명·action이 있는 `Section` 또는 `db-section`으로 묶습니다. 접기 상태를 제공할 때에는 키보드로 열고 닫을 수 있어야 하며, 기본 상태는 콘텐츠 중요도에 따라 결정합니다.
676
663
 
677
664
  ### 7.3 filter bar
678
665
 
@@ -686,13 +673,13 @@ register_setting('myplugin', 'myplugin_options', [
686
673
 
687
674
  ### 7.4 data table
688
675
 
689
- 단순한 표는 native `<table>`을 우선 사용합니다. 정렬·행 action·empty/loading/error가 반복되거나 React 데이터 모델을 사용하는 경우 `AdminDataTable` 또는 `db-table`을 사용합니다.
676
+ 단순한 표는 native `<table>`을 우선 사용합니다. 정렬·행 action·empty/loading/error가 반복되거나 React 데이터 모델을 사용하는 경우 `Table` 또는 `db-table`을 사용합니다.
690
677
 
691
678
  - 열 제목을 `<th>`로 출력합니다.
692
679
  - 행 action은 명확한 accessible name을 사용합니다.
693
680
  - 정렬 방향은 텍스트나 `aria-sort`로 전달합니다.
694
681
  - 로딩 중 기존 데이터가 있으면 전체 레이아웃을 깜빡이지 않고 해당 영역만 busy로 표시합니다.
695
- - 데이터가 없을 때 빈 `<table>`만 보여주지 말고 `AdminEmptyState`를 제공합니다.
682
+ - 데이터가 없을 때 빈 `<table>`만 보여주지 말고 `empty-message` 또는 `EmptyState` / `db-empty-state`를 제공합니다.
696
683
  - 삭제·상태 변경 action은 서버 응답이 성공한 뒤 목록을 갱신합니다.
697
684
 
698
685
  ## 8. 상태 표현과 오류 처리
@@ -701,9 +688,9 @@ register_setting('myplugin', 'myplugin_options', [
701
688
 
702
689
  | 상태 | 사용자에게 보여줄 것 | 권장 구현 |
703
690
  | --- | --- | --- |
704
- | loading | 작업 중임과 예상 영역 | `AdminLoadingState`, `db-spinner`, `db-skeleton` |
705
- | empty | 결과가 없다는 설명과 다음 action | `AdminEmptyState`, `db-empty-state` |
706
- | error | 문제와 재시도 방법 | `AdminErrorState`, `db-alert` |
691
+ | loading | 작업 중임과 예상 영역 | `Spinner` / `db-spinner`, `Skeleton` / `db-skeleton` |
692
+ | empty | 결과가 없다는 설명과 다음 action | `EmptyState` / `db-empty-state`, `db-table`의 `empty-message` |
693
+ | error | 문제와 재시도 방법 | `Alert` / `db-alert` |
707
694
  | success | 저장·삭제 완료 피드백 | toast + 변경된 영역 갱신 |
708
695
  | unauthorized | 권한 부족 안내 | 서버의 403/WordPress 권한 화면과 일치 |
709
696
 
@@ -806,9 +793,9 @@ body { ... }
806
793
  2. 화면 root에 `.designbase-wp-admin`을 추가합니다.
807
794
  3. 해당 화면에만 `styles.css`와 `browser.iife.js`를 enqueue합니다.
808
795
  4. 기존 페이지 header/content 영역을 `AdminPageHeader` 또는 `db-page-header` 구조로 바꿉니다.
809
- 5. 반복되는 section을 `AdminSection` 또는 `db-section`으로 정리합니다.
810
- 6. 검색·필터 화면에 `AdminFilterBar` 또는 native-first filter markup을 적용합니다.
811
- 7. 목록 화면에 `AdminDataTable` 또는 semantic native table을 적용합니다.
796
+ 5. 반복되는 section을 `Section` 또는 `db-section`으로 정리합니다.
797
+ 6. 검색·필터 화면에 `form.designbase-wp-admin__filter-bar`와 `SearchBar`/`db-search-bar`를 적용합니다.
798
+ 7. 목록 화면에 `Table`/`db-table` 또는 semantic native table을 적용합니다.
812
799
  8. loading·empty·error·success 상태를 분리합니다.
813
800
  9. modal, confirm, toast, drawer를 필요한 화면에만 추가합니다.
814
801
  10. REST·AJAX·Settings API·capability 동작은 UI migration 중 변경하지 않고 회귀 테스트합니다.
@@ -910,7 +897,7 @@ import '@designbasekorea/wordpress-ui/browser';
910
897
  import '@designbasekorea/wordpress-ui/styles.css';
911
898
 
912
899
  // React 화면에서만 허용
913
- import { AdminShell, AdminDataTable } from '@designbasekorea/wordpress-ui/react';
900
+ import { AdminShell, Table } from '@designbasekorea/wordpress-ui/react';
914
901
  import { DbButton, DbInput, DbSelect, DbModal } from '@designbasekorea/wordpress-ui/components';
915
902
  // 또는: import { DbButton, DbInput, DbSelect, DbModal } from '@designbasekorea/wordpress-ui';
916
903
 
@@ -7,68 +7,51 @@
7
7
  <link rel="stylesheet" href="../dist/styles.css">
8
8
  </head>
9
9
  <body>
10
- <div class="designbase-wp-admin">
11
- <div class="designbase-wp-admin__shell">
12
- <aside id="example-sidebar" class="designbase-wp-admin__shell-sidebar">
13
- <div class="designbase-wp-admin__sidebar" aria-label="PageNest 메뉴">
14
- <div class="designbase-wp-admin__sidebar-title">PageNest</div>
15
- <nav class="designbase-wp-admin__sidebar-nav">
16
- <a class="designbase-wp-admin__sidebar-link is-active" href="#" aria-current="page"><i class="designbase-wp-admin__icon icon-dashboard" aria-hidden="true"></i><span class="designbase-wp-admin__sidebar-label">대시보드</span></a>
17
- <a class="designbase-wp-admin__sidebar-link" href="#"><i class="designbase-wp-admin__icon icon-file-manager" aria-hidden="true"></i><span class="designbase-wp-admin__sidebar-label">페이지 목록</span></a>
18
- <a class="designbase-wp-admin__sidebar-link" href="#"><i class="designbase-wp-admin__icon icon-settings" aria-hidden="true"></i><span class="designbase-wp-admin__sidebar-label">설정</span></a>
19
- </nav>
20
- <button class="designbase-wp-admin__sidebar-close" type="button" data-sidebar-close>닫기</button>
21
- </div>
22
- </aside>
23
- <main class="designbase-wp-admin__shell-main">
24
- <button
25
- class="designbase-wp-admin__shell-menu-toggle"
26
- type="button"
27
- data-sidebar-toggle="example-sidebar"
28
- aria-controls="example-sidebar"
29
- aria-expanded="false"
30
- ><i class="designbase-wp-admin__icon icon-menu" aria-hidden="true"></i><span class="screen-reader-text">메뉴 열기</span></button>
31
- <div class="designbase-wp-admin__page">
32
- <db-page-header
33
- title="페이지 목록"
34
- description="REST와 권한 상태는 소비자가 소유하고 UI는 상태만 표현합니다."
35
- variant="minimal"
36
- >
37
- <db-button slot="actions" variant="primary" size="s" start-icon="plus" type="button">새 페이지</db-button>
38
- </db-page-header>
10
+ <div class="wrap designbase-wp-admin">
11
+ <db-admin-shell
12
+ id="wordpress-ui-example-shell"
13
+ title="PageNest"
14
+ items='[{"id":"dashboard","label":"대시보드","href":"#dashboard","icon":"dashboard","active":true},{"id":"pages","label":"페이지 목록","href":"#pages","icon":"file-manager","badge":12},{"id":"settings","label":"설정","href":"#settings","icon":"settings"}]'
15
+ >
16
+ <db-page-header
17
+ title="페이지 목록"
18
+ description="db-admin-shell이 db-sidebar, db-page-header, db-container를 하나의 패턴으로 제공합니다."
19
+ variant="minimal"
20
+ >
21
+ <db-button slot="actions" variant="primary" size="s" start-icon="plus" type="button">새 페이지</db-button>
22
+ </db-page-header>
39
23
 
40
- <db-alert variant="info" title="wordpress-ui 예제" message="ui-wc primitives와 관리자 패턴은 이 root 안에서만 동작합니다." closable="false"></db-alert>
24
+ <db-alert
25
+ variant="info"
26
+ title="wordpress-ui 예제"
27
+ message="REST와 권한 상태는 소비 플러그인/테마가 소유하고 UI는 상태만 표현합니다."
28
+ closable="false"
29
+ ></db-alert>
41
30
 
42
- <form class="designbase-wp-admin__filter-bar" role="search">
43
- <div class="designbase-wp-admin__filter-bar__fields">
44
- <db-input type="search" size="s" name="search" placeholder="페이지 검색" aria-label="검색"></db-input>
45
- <db-select size="s" name="status" aria-label="상태" value="all"
46
- options='[{"value":"all","label":"전체 상태"},{"value":"published","label":"공개"},{"value":"draft","label":"초안"}]'></db-select>
47
- </div>
48
- <div class="designbase-wp-admin__filter-bar__actions">
49
- <button class="button button-secondary" type="reset">초기화</button>
50
- <button class="button button-primary" type="submit">적용</button>
51
- </div>
52
- </form>
31
+ <db-section title="검색 및 필터" description="shell이 이 영역을 자동으로 db-container 안에 배치합니다.">
32
+ <form class="designbase-wp-admin__filter-bar" role="search">
33
+ <div class="designbase-wp-admin__filter-bar-toolbar">
34
+ <db-search-bar name="search" placeholder="페이지 검색" aria-label="검색"></db-search-bar>
35
+ <db-select
36
+ name="status"
37
+ aria-label="상태"
38
+ value="all"
39
+ options='[{"value":"all","label":"전체 상태"},{"value":"published","label":"공개"},{"value":"draft","label":"초안"}]'
40
+ ></db-select>
41
+ <db-button variant="secondary" size="s" type="reset">초기화</db-button>
42
+ <db-button variant="primary" size="s" type="submit">적용</db-button>
43
+ </div>
44
+ </form>
45
+ </db-section>
53
46
 
54
- <section class="designbase-wp-admin__section">
55
- <div class="designbase-wp-admin__section-header"><div><h2>최근 페이지</h2><p>예시 테이블은 데이터를 직접 조회하지 않습니다.</p></div></div>
56
- <div class="designbase-wp-admin__section-content">
57
- <div class="designbase-wp-admin__data-table">
58
- <table>
59
- <caption class="screen-reader-text">최근 페이지</caption>
60
- <thead><tr><th scope="col">제목</th><th scope="col">상태</th><th scope="col">수정일</th></tr></thead>
61
- <tbody>
62
- <tr><td>Designbase</td><td><span class="designbase-wp-admin__status is-success">공개</span></td><td>방금 전</td></tr>
63
- <tr><td>새 링크 페이지</td><td><span class="designbase-wp-admin__status">초안</span></td><td>어제</td></tr>
64
- </tbody>
65
- </table>
66
- </div>
67
- </div>
68
- </section>
69
- </div>
70
- </main>
71
- </div>
47
+ <db-section title="최근 페이지" description="데이터 조회와 저장은 소비 플러그인의 책임입니다.">
48
+ <db-table
49
+ columns='[{"key":"title","header":"제목"},{"key":"status","header":"상태"},{"key":"modified","header":"수정일"}]'
50
+ data='[{"title":"Designbase","status":"공개","modified":"방금 전"},{"title":"새 링크 페이지","status":"초안","modified":"어제"}]'
51
+ row-key="title"
52
+ ></db-table>
53
+ </db-section>
54
+ </db-admin-shell>
72
55
  </div>
73
56
  <script src="../dist/browser.iife.js"></script>
74
57
  </body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designbasekorea/wordpress-ui",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "WordPress 관리자용 Designbase UI primitives와 plugin shell patterns",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -74,7 +74,7 @@
74
74
  "build-storybook": "storybook build"
75
75
  },
76
76
  "dependencies": {
77
- "@designbasekorea/ui-wc": "0.8.4"
77
+ "@designbasekorea/ui-wc": "0.8.7"
78
78
  },
79
79
  "peerDependencies": {
80
80
  "react": ">=18.0.0 <20.0.0",