@designbasekorea/wordpress-ui 0.1.0 → 0.1.2

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,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { HTMLAttributes, ReactNode, FormEvent } from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
3
  import { DbAccordion } from '@designbasekorea/ui-wc/components/db-accordion';
4
4
  import { DbAnimationBackground } from '@designbasekorea/ui-wc/components/db-animation-background';
5
5
  import { DbAvatar } from '@designbasekorea/ui-wc/components/db-avatar';
@@ -83,28 +83,16 @@ interface AdminNavItem {
83
83
  badge?: string | number;
84
84
  }
85
85
  interface AdminBreadcrumb {
86
+ id?: string;
86
87
  label: string;
87
88
  href?: string;
88
- }
89
- interface AdminTab {
90
- id: string;
91
- label: string;
89
+ active?: boolean;
92
90
  disabled?: boolean;
93
91
  }
94
- interface AdminTableSort {
95
- column: string;
96
- direction: 'asc' | 'desc';
97
- }
98
- interface AdminTableColumn<Row> {
99
- id: string;
100
- header: string;
101
- key?: keyof Row;
102
- sortable?: boolean;
103
- width?: string;
104
- }
105
92
 
106
93
  interface AdminLayoutContextValue {
107
94
  hasSidebar: boolean;
95
+ isMobile: boolean;
108
96
  sidebarOpen: boolean;
109
97
  toggleSidebar: () => void;
110
98
  closeSidebar: () => void;
@@ -114,121 +102,53 @@ interface AdminWrapperProps {
114
102
  children?: ReactNode;
115
103
  className?: string;
116
104
  }
117
- interface AdminSidebarProps {
118
- items: AdminNavItem[];
119
- title?: string;
120
- footer?: ReactNode;
121
- className?: string;
122
- }
123
105
  interface AdminShellProps {
124
106
  children?: ReactNode;
125
107
  sidebar?: ReactNode;
126
108
  sidebarItems?: AdminNavItem[];
127
109
  sidebarTitle?: string;
128
- sidebarFooter?: ReactNode;
129
110
  className?: string;
130
111
  defaultSidebarOpen?: boolean;
131
112
  sidebarOpen?: boolean;
132
113
  onSidebarOpenChange?: (open: boolean) => void;
133
114
  }
134
- interface AdminPageHeaderProps {
135
- title: ReactNode;
136
- icon?: string;
137
- description?: ReactNode;
138
- breadcrumbs?: AdminBreadcrumb[];
139
- actions?: ReactNode;
140
- backHref?: string;
141
- backLabel?: string;
142
- onBack?: () => void;
143
- menuLabel?: string;
144
- showMenuToggle?: boolean;
145
- className?: string;
146
- }
147
115
  interface AdminPageContentProps {
148
116
  children?: ReactNode;
149
117
  maxWidth?: 'none' | 'm' | 'l' | 'xl';
150
- density?: 'comfortable' | 'compact';
151
118
  className?: string;
152
119
  }
153
- interface AdminSectionProps {
154
- title?: ReactNode;
155
- description?: ReactNode;
120
+ interface AdminPageHeaderProps {
121
+ title: string;
122
+ subtitle?: string;
123
+ description?: string;
124
+ breadcrumbs?: AdminBreadcrumb[] | string;
156
125
  actions?: ReactNode;
126
+ meta?: ReactNode;
157
127
  children?: ReactNode;
158
- collapsible?: boolean;
159
- defaultOpen?: boolean;
160
- className?: string;
161
- }
162
- interface AdminFilterBarOption {
163
- value: string;
164
- label: string;
165
- }
166
- interface AdminFilterBarProps {
167
- children?: ReactNode;
168
- actions?: ReactNode;
169
- activeFilterCount?: number;
170
- applyLabel?: string;
171
- resetLabel?: string;
172
- searchPlaceholder?: string;
173
- searchValue?: string;
174
- onSearchChange?: (value: string) => void;
175
- statusPlaceholder?: string;
176
- statusOptions?: AdminFilterBarOption[];
177
- statusValue?: string;
178
- onStatusChange?: (value: string) => void;
179
- onSubmit?: (event: FormEvent<HTMLFormElement>) => void;
180
- onReset?: (event: FormEvent<HTMLFormElement>) => void;
181
- className?: string;
182
- }
183
- interface AdminTabsProps {
184
- tabs: AdminTab[];
185
- activeTab?: string;
186
- onChange?: (id: string) => void;
187
- className?: string;
188
- }
189
- interface AdminStateProps {
190
- title?: ReactNode;
191
- description?: ReactNode;
192
- action?: ReactNode;
193
- className?: string;
194
- }
195
- interface AdminDataTableProps<Row> {
196
- columns: Array<AdminTableColumn<Row> & {
197
- render?: (row: Row, index: number) => ReactNode;
198
- }>;
199
- rows: Row[];
200
- rowKey?: (row: Row, index: number) => string | number;
201
- sort?: AdminTableSort;
202
- onSort?: (sort: AdminTableSort) => void;
203
- actions?: (row: Row, index: number) => ReactNode;
204
- loading?: boolean;
205
- emptyState?: ReactNode;
206
- error?: ReactNode;
207
- caption?: string;
208
- className?: string;
209
- }
210
- interface AdminIconProps {
211
- name: string;
212
- size?: number;
128
+ showMenuButton?: boolean;
129
+ menuButtonLabel?: string;
130
+ variant?: 'default' | 'minimal';
131
+ align?: 'center' | 'left';
132
+ showBackButton?: boolean;
133
+ backFallbackHref?: string;
134
+ backLabel?: string;
213
135
  className?: string;
136
+ onBack?: (event: Event) => void;
214
137
  }
215
- declare function AdminIcon({ name, size, className }: AdminIconProps): react_jsx_runtime.JSX.Element | null;
138
+ /** WordPress admin 최외곽 wrapper. ui-wc 컴포넌트는 안에서 사용합니다. */
216
139
  declare function AdminWrapper({ children, className }: AdminWrapperProps): react_jsx_runtime.JSX.Element;
217
- declare function AdminSidebar({ items, title, footer, className }: AdminSidebarProps): react_jsx_runtime.JSX.Element;
218
- declare function AdminShell({ children, sidebar, sidebarItems, sidebarTitle, sidebarFooter, className, defaultSidebarOpen, sidebarOpen: controlledSidebarOpen, onSidebarOpenChange, }: AdminShellProps): react_jsx_runtime.JSX.Element;
140
+ /** 모바일 overlay 사이드바를 PageHeader minimal meta 슬롯에 넣는 메뉴 버튼 */
141
+ declare function AdminShellMenuButton({ label }: {
142
+ label?: string;
143
+ }): react_jsx_runtime.JSX.Element | null;
144
+ /** ui-wc PageHeader(minimal) + 모바일 메뉴(meta) / 액션(cta). 스타일은 db-page-header가 담당합니다. */
145
+ declare function AdminPageHeader({ title, subtitle, description, breadcrumbs, actions, meta, children, showMenuButton, menuButtonLabel, variant, align, showBackButton, backFallbackHref, backLabel, className, onBack, }: AdminPageHeaderProps): react_jsx_runtime.JSX.Element;
146
+ declare function AdminShell({ children, sidebar, sidebarItems, sidebarTitle, className, defaultSidebarOpen, sidebarOpen: controlledSidebarOpen, onSidebarOpenChange, }: AdminShellProps): react_jsx_runtime.JSX.Element;
219
147
  declare function AdminPage({ children, className }: {
220
148
  children?: ReactNode;
221
149
  className?: string;
222
150
  }): react_jsx_runtime.JSX.Element;
223
- declare function AdminPageHeader({ title, icon, description, breadcrumbs, actions, backHref, backLabel, onBack, menuLabel, showMenuToggle, className, }: AdminPageHeaderProps): react_jsx_runtime.JSX.Element;
224
- declare function AdminPageContent({ children, maxWidth, density, className }: AdminPageContentProps): react_jsx_runtime.JSX.Element;
225
- declare function AdminSection({ title, description, actions, children, collapsible, defaultOpen, className }: AdminSectionProps): react_jsx_runtime.JSX.Element;
226
- declare function AdminFilterBar({ children, actions, activeFilterCount, applyLabel, resetLabel, searchPlaceholder, searchValue, onSearchChange, statusPlaceholder, statusOptions, statusValue, onStatusChange, onSubmit, onReset, className, }: AdminFilterBarProps): react_jsx_runtime.JSX.Element;
227
- declare function AdminTabs({ tabs: items, activeTab, onChange, className }: AdminTabsProps): react_jsx_runtime.JSX.Element;
228
- declare function AdminDataTable<Row>({ columns, rows, rowKey, sort, onSort, actions, loading, emptyState, error, caption, className }: AdminDataTableProps<Row>): react_jsx_runtime.JSX.Element;
229
- declare function AdminEmptyState({ title, description, action, className }: AdminStateProps): react_jsx_runtime.JSX.Element;
230
- declare function AdminLoadingState({ title, description, className }: AdminStateProps): react_jsx_runtime.JSX.Element;
231
- declare function AdminErrorState({ title, description, action, className }: AdminStateProps): react_jsx_runtime.JSX.Element;
151
+ declare function AdminPageContent({ children, maxWidth, className }: AdminPageContentProps): react_jsx_runtime.JSX.Element;
232
152
 
233
- export { Accordion, AdminDataTable, AdminEmptyState, AdminErrorState, AdminFilterBar, AdminIcon, AdminLoadingState, AdminPage, AdminPageContent, AdminPageHeader, AdminSection, AdminShell, AdminSidebar, AdminTabs, AdminWrapper, Alert, AnimationBackground, Avatar, Badge, Banner, Breadcrumbs, Button, Checkbox, Chip, Drawer, Dropdown, EmptyState, Input, Logo, MenuItem, Modal, PageHeader, Pagination, REGISTERED_PRIMITIVES, Radio, SearchBar, Section, SegmentControl, Select, Sidebar, Skeleton, Spinner, Table, Tabs, Textarea, Toast, Toggle, useAdminLayout };
234
- export type { AdminDataTableProps, AdminFilterBarOption, AdminFilterBarProps, AdminIconProps, AdminLayoutContextValue, AdminPageContentProps, AdminPageHeaderProps, AdminSectionProps, AdminShellProps, AdminSidebarProps, AdminStateProps, AdminTabsProps, AdminWrapperProps, DbEventHandler, PrimitiveProps };
153
+ export { Accordion, AdminPage, AdminPageContent, AdminPageHeader, AdminShell, AdminShellMenuButton, AdminWrapper, Alert, AnimationBackground, Avatar, Badge, Banner, Breadcrumbs, Button, Checkbox, Chip, Drawer, Dropdown, EmptyState, Input, Logo, MenuItem, Modal, PageHeader, Pagination, REGISTERED_PRIMITIVES, Radio, SearchBar, Section, SegmentControl, Select, Sidebar, Skeleton, Spinner, Table, Tabs, Textarea, Toast, Toggle, useAdminLayout };
154
+ export type { AdminLayoutContextValue, AdminPageContentProps, AdminPageHeaderProps, AdminShellProps, AdminWrapperProps, DbEventHandler, PrimitiveProps };