@designbasekorea/wordpress-ui 0.1.0 → 0.1.3
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/README.md +59 -5
- package/dist/browser.cjs +1 -1
- package/dist/browser.d.ts +14 -2
- package/dist/browser.esm.js +1 -1
- package/dist/browser.iife.js +1 -1
- package/dist/components.cjs +1 -0
- package/dist/components.d.ts +77 -0
- package/dist/components.esm.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +81 -2
- package/dist/index.esm.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.ts +62 -142
- package/dist/react/index.esm.js +1 -1
- package/dist/styles/controls.css +1 -1
- package/dist/styles/shell.css +1 -1
- package/dist/styles.css +1 -1
- package/docs/WORDPRESS-ADMIN-GUIDE.md +26 -7
- package/examples/react.tsx +16 -16
- package/examples/vanilla.html +28 -33
- package/package.json +16 -1
package/dist/react/index.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { HTMLAttributes, ReactNode
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import * as _designbasekorea_ui_wc_components_db_toggle from '@designbasekorea/ui-wc/components/db-toggle';
|
|
4
|
+
import * as _designbasekorea_ui_wc_components_db_toast from '@designbasekorea/ui-wc/components/db-toast';
|
|
5
|
+
import * as _designbasekorea_ui_wc_components_db_textarea from '@designbasekorea/ui-wc/components/db-textarea';
|
|
6
|
+
import * as _designbasekorea_ui_wc_components_db_tabs from '@designbasekorea/ui-wc/components/db-tabs';
|
|
7
|
+
import * as _designbasekorea_ui_wc_components_db_table from '@designbasekorea/ui-wc/components/db-table';
|
|
8
|
+
import * as _designbasekorea_ui_wc_components_db_spinner from '@designbasekorea/ui-wc/components/db-spinner';
|
|
9
|
+
import * as _designbasekorea_ui_wc_components_db_skeleton from '@designbasekorea/ui-wc/components/db-skeleton';
|
|
10
|
+
import * as _designbasekorea_ui_wc_components_db_sidebar from '@designbasekorea/ui-wc/components/db-sidebar';
|
|
11
|
+
import * as _designbasekorea_ui_wc_components_db_select from '@designbasekorea/ui-wc/components/db-select';
|
|
12
|
+
import * as _designbasekorea_ui_wc_components_db_segment_control from '@designbasekorea/ui-wc/components/db-segment-control';
|
|
13
|
+
import * as _designbasekorea_ui_wc_components_db_section from '@designbasekorea/ui-wc/components/db-section';
|
|
14
|
+
import * as _designbasekorea_ui_wc_components_db_search_bar from '@designbasekorea/ui-wc/components/db-search-bar';
|
|
15
|
+
import * as _designbasekorea_ui_wc_components_db_radio from '@designbasekorea/ui-wc/components/db-radio';
|
|
16
|
+
import * as _designbasekorea_ui_wc_components_db_pagination from '@designbasekorea/ui-wc/components/db-pagination';
|
|
17
|
+
import * as _designbasekorea_ui_wc_components_db_page_header from '@designbasekorea/ui-wc/components/db-page-header';
|
|
18
|
+
import * as _designbasekorea_ui_wc_components_db_modal from '@designbasekorea/ui-wc/components/db-modal';
|
|
19
|
+
import * as _designbasekorea_ui_wc_components_db_menu_item from '@designbasekorea/ui-wc/components/db-menu-item';
|
|
20
|
+
import * as _designbasekorea_ui_wc_components_db_logo from '@designbasekorea/ui-wc/components/db-logo';
|
|
21
|
+
import * as _designbasekorea_ui_wc_components_db_input from '@designbasekorea/ui-wc/components/db-input';
|
|
22
|
+
import * as _designbasekorea_ui_wc_components_db_empty_state from '@designbasekorea/ui-wc/components/db-empty-state';
|
|
23
|
+
import * as _designbasekorea_ui_wc_components_db_dropdown from '@designbasekorea/ui-wc/components/db-dropdown';
|
|
24
|
+
import * as _designbasekorea_ui_wc_components_db_drawer from '@designbasekorea/ui-wc/components/db-drawer';
|
|
25
|
+
import * as _designbasekorea_ui_wc_components_db_chip from '@designbasekorea/ui-wc/components/db-chip';
|
|
26
|
+
import * as _designbasekorea_ui_wc_components_db_checkbox from '@designbasekorea/ui-wc/components/db-checkbox';
|
|
27
|
+
import * as _designbasekorea_ui_wc_components_db_button from '@designbasekorea/ui-wc/components/db-button';
|
|
28
|
+
import * as _designbasekorea_ui_wc_components_db_breadcrumbs from '@designbasekorea/ui-wc/components/db-breadcrumbs';
|
|
29
|
+
import * as _designbasekorea_ui_wc_components_db_banner from '@designbasekorea/ui-wc/components/db-banner';
|
|
30
|
+
import * as _designbasekorea_ui_wc_components_db_badge from '@designbasekorea/ui-wc/components/db-badge';
|
|
31
|
+
import * as _designbasekorea_ui_wc_components_db_avatar from '@designbasekorea/ui-wc/components/db-avatar';
|
|
32
|
+
import * as _designbasekorea_ui_wc_components_db_alert from '@designbasekorea/ui-wc/components/db-alert';
|
|
33
|
+
import * as _designbasekorea_ui_wc_components_db_animation_background from '@designbasekorea/ui-wc/components/db-animation-background';
|
|
34
|
+
import * as _designbasekorea_ui_wc_components_db_accordion from '@designbasekorea/ui-wc/components/db-accordion';
|
|
35
35
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
36
36
|
|
|
37
|
-
declare const REGISTERED_PRIMITIVES: (typeof DbAccordion | typeof DbAnimationBackground | typeof DbAlert | typeof DbAvatar | typeof DbBadge | typeof DbBanner | typeof DbBreadcrumbs | typeof DbButton | typeof DbCheckbox | typeof DbChip | typeof DbDrawer | typeof DbDropdown | typeof DbEmptyState | typeof DbInput | typeof DbLogo | typeof DbMenuItem | typeof DbModal | typeof DbPageHeader | typeof DbPagination | typeof DbRadio | typeof DbSearchBar | typeof DbSection | typeof DbSegmentControl | typeof DbSelect | typeof DbSidebar | typeof DbSkeleton | typeof DbSpinner | typeof DbTable | typeof DbTabs | typeof DbTextarea | typeof DbToast | typeof DbToggle)[];
|
|
37
|
+
declare const REGISTERED_PRIMITIVES: (typeof _designbasekorea_ui_wc_components_db_accordion.DbAccordion | typeof _designbasekorea_ui_wc_components_db_animation_background.DbAnimationBackground | typeof _designbasekorea_ui_wc_components_db_alert.DbAlert | typeof _designbasekorea_ui_wc_components_db_avatar.DbAvatar | typeof _designbasekorea_ui_wc_components_db_badge.DbBadge | typeof _designbasekorea_ui_wc_components_db_banner.DbBanner | typeof _designbasekorea_ui_wc_components_db_breadcrumbs.DbBreadcrumbs | typeof _designbasekorea_ui_wc_components_db_button.DbButton | typeof _designbasekorea_ui_wc_components_db_checkbox.DbCheckbox | typeof _designbasekorea_ui_wc_components_db_chip.DbChip | typeof _designbasekorea_ui_wc_components_db_drawer.DbDrawer | typeof _designbasekorea_ui_wc_components_db_dropdown.DbDropdown | typeof _designbasekorea_ui_wc_components_db_empty_state.DbEmptyState | typeof _designbasekorea_ui_wc_components_db_input.DbInput | typeof _designbasekorea_ui_wc_components_db_logo.DbLogo | typeof _designbasekorea_ui_wc_components_db_menu_item.DbMenuItem | typeof _designbasekorea_ui_wc_components_db_modal.DbModal | typeof _designbasekorea_ui_wc_components_db_page_header.DbPageHeader | typeof _designbasekorea_ui_wc_components_db_pagination.DbPagination | typeof _designbasekorea_ui_wc_components_db_radio.DbRadio | typeof _designbasekorea_ui_wc_components_db_search_bar.DbSearchBar | typeof _designbasekorea_ui_wc_components_db_section.DbSection | typeof _designbasekorea_ui_wc_components_db_segment_control.DbSegmentControl | typeof _designbasekorea_ui_wc_components_db_select.DbSelect | typeof _designbasekorea_ui_wc_components_db_sidebar.DbSidebar | typeof _designbasekorea_ui_wc_components_db_skeleton.DbSkeleton | typeof _designbasekorea_ui_wc_components_db_spinner.DbSpinner | typeof _designbasekorea_ui_wc_components_db_table.DbTable | typeof _designbasekorea_ui_wc_components_db_tabs.DbTabs | typeof _designbasekorea_ui_wc_components_db_textarea.DbTextarea | typeof _designbasekorea_ui_wc_components_db_toast.DbToast | typeof _designbasekorea_ui_wc_components_db_toggle.DbToggle)[];
|
|
38
38
|
type DbEventHandler<T = unknown> = (event: CustomEvent<T>) => void;
|
|
39
39
|
type PrimitiveProps = Omit<HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> & {
|
|
40
40
|
children?: ReactNode;
|
|
@@ -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
|
|
154
|
-
title
|
|
155
|
-
|
|
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
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
-
|
|
138
|
+
/** WordPress admin 최외곽 wrapper. ui-wc 컴포넌트는 이 안에서 사용합니다. */
|
|
216
139
|
declare function AdminWrapper({ children, className }: AdminWrapperProps): react_jsx_runtime.JSX.Element;
|
|
217
|
-
|
|
218
|
-
declare function
|
|
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
|
|
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,
|
|
234
|
-
export type {
|
|
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 };
|