@dimasbaguspm/versaur 0.0.22 → 0.0.24

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.
@@ -0,0 +1,14 @@
1
+ import { ReactNode, HTMLAttributes } from 'react';
2
+ /**
3
+ * Props for PageContent main container
4
+ *
5
+ * A layout component that provides consistent horizontal spacing
6
+ * matching the page-header component, with additional vertical
7
+ * padding for content separation
8
+ */
9
+ export interface PageContentProps extends HTMLAttributes<HTMLDivElement> {
10
+ /**
11
+ * Content to be displayed inside the page content area
12
+ */
13
+ children?: ReactNode;
14
+ }
@@ -0,0 +1,2 @@
1
+ export { PageHeader } from './page-header';
2
+ export * from './types';
@@ -0,0 +1,35 @@
1
+ import { PageHeaderTopProps, PageHeaderBreadcrumbsProps, PageHeaderContentProps, PageHeaderBadgesProps, PageHeaderActionsProps, PageHeaderBottomProps } from './types';
2
+ /**
3
+ * PageHeaderTop - main header area containing breadcrumbs, content, and actions
4
+ */
5
+ export declare const PageHeaderTop: import('react').ForwardRefExoticComponent<PageHeaderTopProps & import('react').RefAttributes<HTMLDivElement>>;
6
+ /**
7
+ * PageHeaderBreadcrumbs - breadcrumbs section
8
+ */
9
+ export declare const PageHeaderBreadcrumbs: import('react').ForwardRefExoticComponent<PageHeaderBreadcrumbsProps & import('react').RefAttributes<HTMLDivElement>>;
10
+ /**
11
+ * PageHeaderContent - content area for title, subtitle, and badges
12
+ */
13
+ export declare const PageHeaderContent: import('react').ForwardRefExoticComponent<PageHeaderContentProps & import('react').RefAttributes<HTMLDivElement>>;
14
+ /**
15
+ * PageHeaderTitle - main title heading
16
+ * Responsive font size: smaller on mobile, larger on desktop
17
+ */
18
+ export declare const PageHeaderTitle: import('react').ForwardRefExoticComponent<import('../../primitive').TextProps & import('react').RefAttributes<HTMLHeadingElement>>;
19
+ /**
20
+ * PageHeaderSubtitle - subtitle/description text
21
+ * Responsive font size and line clamping for mobile
22
+ */
23
+ export declare const PageHeaderSubtitle: import('react').ForwardRefExoticComponent<import('../../primitive').TextProps & import('react').RefAttributes<HTMLParagraphElement>>;
24
+ /**
25
+ * PageHeaderBadges - badges container
26
+ */
27
+ export declare const PageHeaderBadges: import('react').ForwardRefExoticComponent<PageHeaderBadgesProps & import('react').RefAttributes<HTMLDivElement>>;
28
+ /**
29
+ * PageHeaderActions - actions section for buttons and button groups
30
+ */
31
+ export declare const PageHeaderActions: import('react').ForwardRefExoticComponent<PageHeaderActionsProps & import('react').RefAttributes<HTMLDivElement>>;
32
+ /**
33
+ * PageHeaderBottom - bottom section for tabs and filters
34
+ */
35
+ export declare const PageHeaderBottom: import('react').ForwardRefExoticComponent<PageHeaderBottomProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,40 @@
1
+ import { ReactNode } from 'react';
2
+ import { PageHeaderProps } from './types';
3
+ /**
4
+ * PageHeader - Compound layout component for page headers
5
+ *
6
+ * Provides a flexible layout system for page headers that can include:
7
+ * - Breadcrumbs navigation
8
+ * - Title and subtitle
9
+ * - Status badges
10
+ * - Action buttons and button groups
11
+ * - Bottom tabs or filters
12
+ */
13
+ interface PageHeaderRootProps extends Omit<PageHeaderProps, 'title'> {
14
+ /**
15
+ * Simplified API: Page title
16
+ */
17
+ title: ReactNode;
18
+ /**
19
+ * Simplified API: Page subtitle/description
20
+ */
21
+ subtitle?: ReactNode;
22
+ /**
23
+ * Simplified API: Breadcrumbs navigation component
24
+ */
25
+ breadcrumbs?: ReactNode;
26
+ /**
27
+ * Simplified API: Status badges
28
+ */
29
+ badges?: ReactNode;
30
+ /**
31
+ * Simplified API: Action buttons/button groups
32
+ */
33
+ actions?: ReactNode;
34
+ /**
35
+ * Simplified API: Bottom content (tabs, filters)
36
+ */
37
+ tabs?: ReactNode;
38
+ }
39
+ export declare const PageHeader: import('react').ForwardRefExoticComponent<PageHeaderRootProps & import('react').RefAttributes<HTMLElement>>;
40
+ export {};
@@ -0,0 +1,52 @@
1
+ import { TextProps } from '../../primitive';
2
+ import { ReactNode, HTMLAttributes } from 'react';
3
+ /**
4
+ * Props for PageHeader main container
5
+ */
6
+ export interface PageHeaderProps extends HTMLAttributes<HTMLElement> {
7
+ children?: ReactNode;
8
+ }
9
+ /**
10
+ * Props for PageHeaderTop - main header area (breadcrumbs, title, actions)
11
+ */
12
+ export interface PageHeaderTopProps extends HTMLAttributes<HTMLDivElement> {
13
+ children: ReactNode;
14
+ }
15
+ /**
16
+ * Props for PageHeaderBreadcrumbs - breadcrumbs section
17
+ */
18
+ export interface PageHeaderBreadcrumbsProps extends HTMLAttributes<HTMLDivElement> {
19
+ children: ReactNode;
20
+ }
21
+ /**
22
+ * Props for PageHeaderContent - title and subtitle area
23
+ */
24
+ export interface PageHeaderContentProps extends HTMLAttributes<HTMLDivElement> {
25
+ children: ReactNode;
26
+ }
27
+ /**
28
+ * Props for PageHeaderTitle - main title
29
+ */
30
+ export type PageHeaderTitleProps = TextProps;
31
+ /**
32
+ * Props for PageHeaderSubtitle - subtitle/description
33
+ */
34
+ export type PageHeaderSubtitleProps = TextProps;
35
+ /**
36
+ * Props for PageHeaderBadges - badges section
37
+ */
38
+ export interface PageHeaderBadgesProps extends HTMLAttributes<HTMLDivElement> {
39
+ children: ReactNode;
40
+ }
41
+ /**
42
+ * Props for PageHeaderActions - actions section (buttons, button groups)
43
+ */
44
+ export interface PageHeaderActionsProps extends HTMLAttributes<HTMLDivElement> {
45
+ children: ReactNode;
46
+ }
47
+ /**
48
+ * Props for PageHeaderBottom - bottom section (tabs, filters, etc.)
49
+ */
50
+ export interface PageHeaderBottomProps extends HTMLAttributes<HTMLDivElement> {
51
+ children: ReactNode;
52
+ }
@@ -29,7 +29,10 @@ const symbolToSubpath = {
29
29
  "TimePickerInput": "forms",
30
30
  "AppBar": "layouts",
31
31
  "BottomBar": "layouts",
32
+ "ButtonGroup": "layouts",
32
33
  "FormLayout": "layouts",
34
+ "PageContent": "layouts",
35
+ "PageHeader": "layouts",
33
36
  "PageLayout": "layouts",
34
37
  "SideBar": "layouts",
35
38
  "TopBar": "layouts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimasbaguspm/versaur",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "description": "React UI library with Tailwind CSS",
5
5
  "author": "Dimas Bagus Prayogo Mukti<dimas.bagus.pm@gmail.com>",
6
6
  "license": "MIT",
@@ -1,413 +0,0 @@
1
- import { c as i, j as s, a as c } from "./index-DOdDlCoL.js";
2
- import * as f from "react";
3
- import { forwardRef as n } from "react";
4
- import "./image-rectangle-C6cgL8R9.js";
5
- import "./snackbar-DH8jCh2V.js";
6
- import { T as p } from "./text-CRsIInRA.js";
7
- const b = i(
8
- "w-full flex flex-wrap items-center pt-3 mb-3 gap-2 bg-white [&>[data-versaur-appbar-bottom]]:basis-full [&>[data-versaur-appbar-bottom]]:w-full [&:has([data-versaur-appbar-bottom])>[data-versaur-appbar-leading]]:pl-4 [&:has([data-versaur-appbar-bottom])>[data-versaur-appbar-trailing]]:pr-4 [&:not(:has([data-versaur-appbar-bottom]))]:px-4",
9
- {
10
- variants: {
11
- variant: {
12
- primary: "",
13
- secondary: "",
14
- tertiary: "",
15
- ghost: "",
16
- neutral: ""
17
- }
18
- },
19
- defaultVariants: {
20
- variant: "primary"
21
- }
22
- }
23
- ), g = i(
24
- "flex flex-col justify-center min-w-0 flex-grow",
25
- {
26
- variants: {
27
- placement: {
28
- start: "items-start",
29
- center: "items-center",
30
- end: "items-end"
31
- }
32
- },
33
- defaultVariants: {
34
- placement: "start"
35
- }
36
- }
37
- ), v = n(
38
- ({ children: e, className: a }, t) => /* @__PURE__ */ s.jsx(
39
- "div",
40
- {
41
- ref: t,
42
- "data-versaur-appbar-bottom": !0,
43
- className: c("w-full flex items-center min-h-[2.5rem] mt-2", a),
44
- children: e
45
- }
46
- )
47
- ), y = n(
48
- ({ children: e, className: a }, t) => /* @__PURE__ */ s.jsx(
49
- "div",
50
- {
51
- ref: t,
52
- className: c("flex items-center", a),
53
- "data-versaur-appbar-leading": !0,
54
- children: e
55
- }
56
- )
57
- ), h = n(({ children: e, ...a }, t) => /* @__PURE__ */ s.jsx(
58
- p,
59
- {
60
- ...a,
61
- as: "h1",
62
- ref: t,
63
- fontSize: "lg",
64
- fontWeight: "semibold",
65
- ellipsis: !0,
66
- clamp: 1,
67
- children: e
68
- }
69
- )), B = n(({ children: e, ...a }, t) => /* @__PURE__ */ s.jsx(
70
- p,
71
- {
72
- ...a,
73
- ref: t,
74
- as: "p",
75
- fontSize: "xs",
76
- fontWeight: "normal",
77
- ellipsis: !0,
78
- clamp: 1,
79
- color: "gray",
80
- children: e
81
- }
82
- )), j = n(
83
- ({ children: e, className: a }, t) => /* @__PURE__ */ s.jsx(
84
- "div",
85
- {
86
- ref: t,
87
- className: c("flex items-center justify-end gap-2", a),
88
- "data-versaur-appbar-trailing": !0,
89
- children: e
90
- }
91
- )
92
- ), N = n(
93
- ({ children: e, className: a, placement: t }, r) => /* @__PURE__ */ s.jsx(
94
- "div",
95
- {
96
- ref: r,
97
- className: c(g({ placement: t }), a),
98
- children: e
99
- }
100
- )
101
- ), w = ({
102
- children: e,
103
- className: a,
104
- variant: t = "primary"
105
- }) => /* @__PURE__ */ s.jsx(
106
- "header",
107
- {
108
- className: c(b({ variant: t }), a),
109
- role: "banner",
110
- children: e
111
- }
112
- ), ta = Object.assign(w, {
113
- Leading: y,
114
- Headline: h,
115
- Subtitle: B,
116
- Trailing: j,
117
- Center: N,
118
- Bottom: v
119
- }), S = i(
120
- "sticky bottom-0 left-0 w-full flex justify-between items-center bg-white border-t border-border shadow-xs z-40 safe-bottom px-8 py-1",
121
- {
122
- variants: {
123
- variant: {
124
- primary: "",
125
- secondary: "",
126
- ghost: "",
127
- neutral: "",
128
- tertiary: ""
129
- },
130
- size: {
131
- sm: "h-12 text-sm",
132
- md: "h-16 text-base",
133
- lg: "h-20 text-lg"
134
- }
135
- },
136
- defaultVariants: {
137
- variant: "primary",
138
- size: "md"
139
- }
140
- }
141
- ), T = i(
142
- "flex flex-col items-center justify-center gap-1 px-2 py-1",
143
- {
144
- variants: {
145
- active: {
146
- true: "font-semibold text-primary",
147
- false: "text-ghost"
148
- }
149
- },
150
- defaultVariants: {
151
- active: !1
152
- }
153
- }
154
- ), L = n(
155
- ({ icon: e, label: a, active: t = !1, className: r, ...o }, l) => /* @__PURE__ */ s.jsxs(
156
- "div",
157
- {
158
- ref: l,
159
- "aria-current": t ? "page" : void 0,
160
- className: T({ active: t, className: r }),
161
- ...o,
162
- children: [
163
- e,
164
- a && /* @__PURE__ */ s.jsx("span", { className: "text-xs mt-0.5", children: a })
165
- ]
166
- }
167
- )
168
- ), V = ({
169
- children: e,
170
- variant: a = "primary",
171
- size: t = "md",
172
- className: r,
173
- ...o
174
- }) => /* @__PURE__ */ s.jsx(
175
- "nav",
176
- {
177
- role: "navigation",
178
- "aria-label": "Bottom navigation",
179
- className: S({ variant: a, size: t, className: r }),
180
- ...o,
181
- children: e
182
- }
183
- ), ea = Object.assign(V, {
184
- Item: L
185
- }), A = i(
186
- "w-full flex items-center px-6 py-4 mb-6 border-b border-border shadow-xs bg-white",
187
- {
188
- variants: {},
189
- defaultVariants: {}
190
- }
191
- ), R = i("flex items-center gap-3 min-w-0 flex-1"), I = i("flex items-center gap-2 ml-auto"), C = i(
192
- "px-2.5 py-1.5 rounded-md text-sm cursor-pointer transition-colors",
193
- {
194
- variants: {
195
- active: {
196
- true: "bg-primary/10 text-primary",
197
- false: "hover:text-primary text-ghost"
198
- }
199
- },
200
- defaultVariants: {
201
- active: !1
202
- }
203
- }
204
- ), k = i("flex items-center gap-2 ml-4"), z = i("flex items-center gap-2 mr-4"), F = n(
205
- function({ children: a, className: t, ...r }, o) {
206
- return /* @__PURE__ */ s.jsx("nav", { ref: o, className: k({ className: t }), ...r, children: a });
207
- }
208
- ), O = n(
209
- function({ children: a, className: t, ...r }, o) {
210
- return /* @__PURE__ */ s.jsx("div", { ref: o, className: z({ className: t }), ...r, children: a });
211
- }
212
- ), P = n(
213
- function({ children: a, className: t, ...r }, o) {
214
- return /* @__PURE__ */ s.jsx("div", { ref: o, className: R({ className: t }), ...r, children: a });
215
- }
216
- ), G = n(
217
- function({ children: a, className: t, ...r }, o) {
218
- return /* @__PURE__ */ s.jsx("div", { ref: o, className: I({ className: t }), ...r, children: a });
219
- }
220
- ), W = n(
221
- function({ children: a, className: t, active: r, ...o }, l) {
222
- return /* @__PURE__ */ s.jsx(
223
- "div",
224
- {
225
- ref: l,
226
- className: C({ active: r, className: t }),
227
- "aria-current": r ? "page" : void 0,
228
- ...o,
229
- children: a
230
- }
231
- );
232
- }
233
- ), H = n(
234
- ({ children: e, className: a, ...t }, r) => /* @__PURE__ */ s.jsx("header", { ref: r, className: A({ className: a }), ...t, children: e })
235
- ), sa = Object.assign(H, {
236
- Leading: P,
237
- Trailing: G,
238
- NavItem: W,
239
- Nav: F,
240
- Actions: O
241
- }), M = i("w-full mx-auto relative", {
242
- variants: {
243
- type: {
244
- desktop: "max-w-7xl px-6 pb-10",
245
- tablet: "max-w-3xl px-4",
246
- mobile: "w-full"
247
- }
248
- },
249
- defaultVariants: {
250
- type: "desktop"
251
- }
252
- }), ra = f.forwardRef(
253
- function({ type: a = "desktop", className: t, children: r, ...o }, l) {
254
- return /* @__PURE__ */ s.jsx(
255
- "div",
256
- {
257
- ref: l,
258
- className: c(M({ type: a }), t),
259
- ...o,
260
- children: r
261
- }
262
- );
263
- }
264
- ), E = i("grid w-full gap-4 grid-cols-12"), $ = i("", {
265
- variants: {
266
- span: {
267
- 1: "col-span-1",
268
- 2: "col-span-2",
269
- 3: "col-span-3",
270
- 4: "col-span-4",
271
- 5: "col-span-5",
272
- 6: "col-span-6",
273
- 7: "col-span-7",
274
- 8: "col-span-8",
275
- 9: "col-span-9",
276
- 10: "col-span-10",
277
- 11: "col-span-11",
278
- 12: "col-span-12"
279
- }
280
- },
281
- defaultVariants: {
282
- span: "4"
283
- }
284
- }), q = n(
285
- function({ className: a, children: t, ...r }, o) {
286
- return /* @__PURE__ */ s.jsx(
287
- "div",
288
- {
289
- ref: o,
290
- className: c(E(), a),
291
- ...r,
292
- children: t
293
- }
294
- );
295
- }
296
- ), D = n(
297
- function({ span: a = 4, className: t, children: r, ...o }, l) {
298
- const m = Math.min(12, Math.max(1, a));
299
- return /* @__PURE__ */ s.jsx(
300
- "div",
301
- {
302
- ref: l,
303
- className: c(
304
- $({ span: `${m}` }),
305
- t
306
- ),
307
- ...o,
308
- children: r
309
- }
310
- );
311
- }
312
- ), oa = Object.assign(q, {
313
- Column: D
314
- }), x = i(
315
- "flex items-center gap-2 px-4 py-2 rounded-md hover:text-primary focus:outline-none transition-colors",
316
- {
317
- variants: {
318
- active: {
319
- true: "bg-primary/10 text-primary",
320
- false: "text-ghost"
321
- },
322
- disabled: {
323
- true: "opacity-50 pointer-events-none",
324
- false: ""
325
- }
326
- },
327
- defaultVariants: {
328
- active: !1,
329
- disabled: !1
330
- }
331
- }
332
- ), J = n(
333
- (e, a) => {
334
- const { icon: t, children: r, href: o, onClick: l, active: m, ...u } = e;
335
- if (typeof o == "string") {
336
- const d = u;
337
- return /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsxs(
338
- "a",
339
- {
340
- ref: a,
341
- href: o,
342
- className: x({
343
- disabled: !!e["aria-disabled"],
344
- active: m
345
- }),
346
- ...d,
347
- children: [
348
- t,
349
- /* @__PURE__ */ s.jsx(p, { as: "span", color: "inherit", fontSize: "sm", children: r })
350
- ]
351
- }
352
- ) });
353
- } else {
354
- const d = u;
355
- return /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsxs(
356
- "button",
357
- {
358
- ref: a,
359
- type: "button",
360
- onClick: l,
361
- className: c(
362
- x({ disabled: !!d.disabled, active: m }),
363
- "w-full text-left"
364
- ),
365
- ...d,
366
- children: [
367
- t,
368
- /* @__PURE__ */ s.jsx(p, { as: "span", color: "inherit", fontSize: "sm", children: r })
369
- ]
370
- }
371
- ) });
372
- }
373
- }
374
- ), K = n(
375
- function({ children: a, label: t, ...r }, o) {
376
- return /* @__PURE__ */ s.jsxs("li", { ref: o, className: "flex flex-col gap-2 mt-2", ...r, children: [
377
- /* @__PURE__ */ s.jsx(
378
- p,
379
- {
380
- as: "h2",
381
- fontSize: "xs",
382
- fontWeight: "semibold",
383
- color: "gray",
384
- className: "px-2",
385
- children: t
386
- }
387
- ),
388
- /* @__PURE__ */ s.jsx("ul", { className: "flex flex-col gap-1", children: a })
389
- ] });
390
- }
391
- ), Q = n(
392
- ({ children: e, ...a }, t) => /* @__PURE__ */ s.jsx(
393
- "nav",
394
- {
395
- ref: t,
396
- className: "w-56 bg-background border-r border-border flex flex-col my-2",
397
- "aria-label": "Sidebar",
398
- ...a,
399
- children: /* @__PURE__ */ s.jsx("div", { className: "flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-border scrollbar-track-background", children: /* @__PURE__ */ s.jsx("ul", { className: "flex flex-col gap-1 mx-2", children: e }) })
400
- }
401
- )
402
- ), na = Object.assign(Q, {
403
- Item: J,
404
- Group: K
405
- });
406
- export {
407
- ta as A,
408
- ea as B,
409
- oa as F,
410
- ra as P,
411
- na as S,
412
- sa as T
413
- };