@designbasekorea/wordpress-ui 0.1.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/README.md +102 -0
- package/dist/browser.cjs +1 -0
- package/dist/browser.d.ts +82 -0
- package/dist/browser.esm.js +1 -0
- package/dist/browser.iife.js +1 -0
- package/dist/icons.woff +0 -0
- package/dist/icons.woff2 +0 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.esm.js +1 -0
- package/dist/react/index.cjs +1 -0
- package/dist/react/index.d.ts +234 -0
- package/dist/react/index.esm.js +1 -0
- package/dist/styles/controls.css +3898 -0
- package/dist/styles/overlays.css +3896 -0
- package/dist/styles/shell.css +3898 -0
- package/dist/styles.css +3898 -0
- package/docs/WORDPRESS-ADMIN-GUIDE.md +890 -0
- package/examples/react.tsx +55 -0
- package/examples/vanilla.html +80 -0
- package/package.json +113 -0
- package/wordpress-ui.php +65 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode, FormEvent } from 'react';
|
|
3
|
+
import { DbAccordion } from '@designbasekorea/ui-wc/components/db-accordion';
|
|
4
|
+
import { DbAnimationBackground } from '@designbasekorea/ui-wc/components/db-animation-background';
|
|
5
|
+
import { DbAvatar } from '@designbasekorea/ui-wc/components/db-avatar';
|
|
6
|
+
import { DbAlert } from '@designbasekorea/ui-wc/components/db-alert';
|
|
7
|
+
import { DbBadge } from '@designbasekorea/ui-wc/components/db-badge';
|
|
8
|
+
import { DbBanner } from '@designbasekorea/ui-wc/components/db-banner';
|
|
9
|
+
import { DbBreadcrumbs } from '@designbasekorea/ui-wc/components/db-breadcrumbs';
|
|
10
|
+
import { DbButton } from '@designbasekorea/ui-wc/components/db-button';
|
|
11
|
+
import { DbCheckbox } from '@designbasekorea/ui-wc/components/db-checkbox';
|
|
12
|
+
import { DbChip } from '@designbasekorea/ui-wc/components/db-chip';
|
|
13
|
+
import { DbDrawer } from '@designbasekorea/ui-wc/components/db-drawer';
|
|
14
|
+
import { DbEmptyState } from '@designbasekorea/ui-wc/components/db-empty-state';
|
|
15
|
+
import { DbInput } from '@designbasekorea/ui-wc/components/db-input';
|
|
16
|
+
import { DbLogo } from '@designbasekorea/ui-wc/components/db-logo';
|
|
17
|
+
import { DbMenuItem } from '@designbasekorea/ui-wc/components/db-menu-item';
|
|
18
|
+
import { DbModal } from '@designbasekorea/ui-wc/components/db-modal';
|
|
19
|
+
import { DbDropdown } from '@designbasekorea/ui-wc/components/db-dropdown';
|
|
20
|
+
import { DbPageHeader } from '@designbasekorea/ui-wc/components/db-page-header';
|
|
21
|
+
import { DbPagination } from '@designbasekorea/ui-wc/components/db-pagination';
|
|
22
|
+
import { DbRadio } from '@designbasekorea/ui-wc/components/db-radio';
|
|
23
|
+
import { DbSearchBar } from '@designbasekorea/ui-wc/components/db-search-bar';
|
|
24
|
+
import { DbSection } from '@designbasekorea/ui-wc/components/db-section';
|
|
25
|
+
import { DbSegmentControl } from '@designbasekorea/ui-wc/components/db-segment-control';
|
|
26
|
+
import { DbSelect } from '@designbasekorea/ui-wc/components/db-select';
|
|
27
|
+
import { DbSidebar } from '@designbasekorea/ui-wc/components/db-sidebar';
|
|
28
|
+
import { DbSkeleton } from '@designbasekorea/ui-wc/components/db-skeleton';
|
|
29
|
+
import { DbSpinner } from '@designbasekorea/ui-wc/components/db-spinner';
|
|
30
|
+
import { DbTable } from '@designbasekorea/ui-wc/components/db-table';
|
|
31
|
+
import { DbTabs } from '@designbasekorea/ui-wc/components/db-tabs';
|
|
32
|
+
import { DbTextarea } from '@designbasekorea/ui-wc/components/db-textarea';
|
|
33
|
+
import { DbToast } from '@designbasekorea/ui-wc/components/db-toast';
|
|
34
|
+
import { DbToggle } from '@designbasekorea/ui-wc/components/db-toggle';
|
|
35
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
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)[];
|
|
38
|
+
type DbEventHandler<T = unknown> = (event: CustomEvent<T>) => void;
|
|
39
|
+
type PrimitiveProps = Omit<HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> & {
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
};
|
|
43
|
+
declare const Accordion: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
44
|
+
declare const AnimationBackground: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
45
|
+
declare const Alert: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
46
|
+
declare const Avatar: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
47
|
+
declare const Badge: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
48
|
+
declare const Banner: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
49
|
+
declare const Breadcrumbs: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
50
|
+
declare const Button: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
51
|
+
declare const Checkbox: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
52
|
+
declare const Chip: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
53
|
+
declare const Drawer: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
54
|
+
declare const Dropdown: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
55
|
+
declare const EmptyState: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
56
|
+
declare const Input: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
57
|
+
declare const Logo: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
58
|
+
declare const MenuItem: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
59
|
+
declare const Modal: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
60
|
+
declare const PageHeader: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
61
|
+
declare const Pagination: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
62
|
+
declare const Radio: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
63
|
+
declare const SearchBar: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
64
|
+
declare const Section: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
65
|
+
declare const SegmentControl: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
66
|
+
declare const Select: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
67
|
+
declare const Sidebar: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
68
|
+
declare const Skeleton: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
69
|
+
declare const Spinner: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
70
|
+
declare const Table: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
71
|
+
declare const Tabs: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
72
|
+
declare const Textarea: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
73
|
+
declare const Toast: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
74
|
+
declare const Toggle: react.ForwardRefExoticComponent<Omit<PrimitiveProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
75
|
+
|
|
76
|
+
interface AdminNavItem {
|
|
77
|
+
id: string;
|
|
78
|
+
label: string;
|
|
79
|
+
href?: string;
|
|
80
|
+
icon?: string;
|
|
81
|
+
active?: boolean;
|
|
82
|
+
disabled?: boolean;
|
|
83
|
+
badge?: string | number;
|
|
84
|
+
}
|
|
85
|
+
interface AdminBreadcrumb {
|
|
86
|
+
label: string;
|
|
87
|
+
href?: string;
|
|
88
|
+
}
|
|
89
|
+
interface AdminTab {
|
|
90
|
+
id: string;
|
|
91
|
+
label: string;
|
|
92
|
+
disabled?: boolean;
|
|
93
|
+
}
|
|
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
|
+
|
|
106
|
+
interface AdminLayoutContextValue {
|
|
107
|
+
hasSidebar: boolean;
|
|
108
|
+
sidebarOpen: boolean;
|
|
109
|
+
toggleSidebar: () => void;
|
|
110
|
+
closeSidebar: () => void;
|
|
111
|
+
}
|
|
112
|
+
declare function useAdminLayout(): AdminLayoutContextValue;
|
|
113
|
+
interface AdminWrapperProps {
|
|
114
|
+
children?: ReactNode;
|
|
115
|
+
className?: string;
|
|
116
|
+
}
|
|
117
|
+
interface AdminSidebarProps {
|
|
118
|
+
items: AdminNavItem[];
|
|
119
|
+
title?: string;
|
|
120
|
+
footer?: ReactNode;
|
|
121
|
+
className?: string;
|
|
122
|
+
}
|
|
123
|
+
interface AdminShellProps {
|
|
124
|
+
children?: ReactNode;
|
|
125
|
+
sidebar?: ReactNode;
|
|
126
|
+
sidebarItems?: AdminNavItem[];
|
|
127
|
+
sidebarTitle?: string;
|
|
128
|
+
sidebarFooter?: ReactNode;
|
|
129
|
+
className?: string;
|
|
130
|
+
defaultSidebarOpen?: boolean;
|
|
131
|
+
sidebarOpen?: boolean;
|
|
132
|
+
onSidebarOpenChange?: (open: boolean) => void;
|
|
133
|
+
}
|
|
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
|
+
interface AdminPageContentProps {
|
|
148
|
+
children?: ReactNode;
|
|
149
|
+
maxWidth?: 'none' | 'm' | 'l' | 'xl';
|
|
150
|
+
density?: 'comfortable' | 'compact';
|
|
151
|
+
className?: string;
|
|
152
|
+
}
|
|
153
|
+
interface AdminSectionProps {
|
|
154
|
+
title?: ReactNode;
|
|
155
|
+
description?: ReactNode;
|
|
156
|
+
actions?: ReactNode;
|
|
157
|
+
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;
|
|
213
|
+
className?: string;
|
|
214
|
+
}
|
|
215
|
+
declare function AdminIcon({ name, size, className }: AdminIconProps): react_jsx_runtime.JSX.Element | null;
|
|
216
|
+
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;
|
|
219
|
+
declare function AdminPage({ children, className }: {
|
|
220
|
+
children?: ReactNode;
|
|
221
|
+
className?: string;
|
|
222
|
+
}): 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;
|
|
232
|
+
|
|
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 };
|