@dimasbaguspm/versaur 0.0.22 → 0.0.23

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,64 +1,46 @@
1
- import { c as d, j as o, a as u } from "./index-DOdDlCoL.js";
1
+ import { c as d, j as s, a as u } from "./index-DOdDlCoL.js";
2
2
  import { forwardRef as f, createContext as x, useContext as g, useState as p, useLayoutEffect as y, useRef as h } from "react";
3
- const w = d(
4
- "flex items-center gap-2 text-sm text-tertiary",
5
- {
6
- variants: {
7
- separator: {
8
- default: "gap-2",
9
- compact: "gap-1"
10
- }
11
- },
12
- defaultVariants: {
13
- separator: "default"
14
- }
15
- }
16
- ), T = d(
17
- "inline-flex items-center gap-1 transition-colors",
18
- {
19
- variants: {
20
- isCurrent: {
21
- true: "font-semibold text-black cursor-default",
22
- false: ""
23
- }
24
- },
25
- defaultVariants: {
26
- isCurrent: !1
27
- }
28
- }
29
- ), j = "mx-1 text-ghost-400 select-none", I = f(function({ children: t, icon: r, isCurrent: a, className: n, ...s }, i) {
30
- return /* @__PURE__ */ o.jsx("li", { className: "flex items-center", children: /* @__PURE__ */ o.jsxs(
3
+ import { I as w } from "./image-rectangle-GA3oWX7A.js";
4
+ import "./snackbar-DH8jCh2V.js";
5
+ import "./text-CRsIInRA.js";
6
+ import { ChevronRight as T } from "lucide-react";
7
+ const j = d(
8
+ "flex items-center gap-2 text-sm text-gray-500"
9
+ ), I = d(
10
+ "inline-flex items-center gap-1 transition-colors hover:underline cursor-pointer"
11
+ ), B = f(function({ children: t, icon: r, isCurrent: a, className: n, ...o }, i) {
12
+ return /* @__PURE__ */ s.jsx("li", { className: "flex items-center", children: /* @__PURE__ */ s.jsxs(
31
13
  "a",
32
14
  {
33
15
  ref: i,
34
16
  "aria-current": a ? "page" : void 0,
35
17
  tabIndex: a ? -1 : 0,
36
- className: u(T({ isCurrent: a }) + n),
37
- ...s,
18
+ className: u(I(), n),
19
+ ...o,
38
20
  children: [
39
- r && /* @__PURE__ */ o.jsx("span", { className: "mr-1 inline-flex", children: r }),
21
+ r && /* @__PURE__ */ s.jsx("span", { className: "mr-1 inline-flex", children: r }),
40
22
  t
41
23
  ]
42
24
  }
43
25
  ) });
44
26
  });
45
- function V() {
46
- return /* @__PURE__ */ o.jsx("span", { className: j, "aria-hidden": "true", children: "/" });
27
+ function C() {
28
+ return /* @__PURE__ */ s.jsx(w, { as: T, size: "xs", color: "inherit" });
47
29
  }
48
- const C = f(
30
+ const V = f(
49
31
  function({ children: t, "aria-label": r = "Breadcrumb", ...a }, n) {
50
- return /* @__PURE__ */ o.jsx("nav", { "aria-label": r, ...a, children: /* @__PURE__ */ o.jsx("ol", { ref: n, className: w(), children: t }) });
32
+ return /* @__PURE__ */ s.jsx("nav", { "aria-label": r, ...a, children: /* @__PURE__ */ s.jsx("ol", { ref: n, className: j(), children: t }) });
51
33
  }
52
- ), O = Object.assign(C, {
53
- Item: I,
54
- Separator: V
34
+ ), W = Object.assign(V, {
35
+ Item: B,
36
+ Separator: C
55
37
  }), v = x(null), m = () => {
56
38
  const e = g(v);
57
39
  if (!e)
58
40
  throw new Error("useTabsContext must be used within a TabsProvider");
59
41
  return e;
60
- }, B = d(
61
- "inline-flex items-center justify-center transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none select-none px-4 py-2 text-base relative",
42
+ }, N = d(
43
+ "inline-flex items-center justify-center transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none select-none px-4 py-2 text-sm relative",
62
44
  {
63
45
  variants: {
64
46
  active: {
@@ -157,7 +139,7 @@ const C = f(
157
139
  variant: "underline"
158
140
  }
159
141
  }
160
- ), N = d(
142
+ ), R = d(
161
143
  "flex flex-row w-full overflow-x-auto whitespace-nowrap",
162
144
  {
163
145
  variants: {
@@ -186,7 +168,7 @@ const C = f(
186
168
  color: "primary"
187
169
  }
188
170
  }
189
- ), R = ({
171
+ ), A = ({
190
172
  value: e,
191
173
  children: t,
192
174
  className: r,
@@ -194,40 +176,40 @@ const C = f(
194
176
  }) => {
195
177
  const {
196
178
  activeTab: n,
197
- setActiveTab: s,
179
+ setActiveTab: o,
198
180
  color: i,
199
- variant: c = "underline"
200
- } = m(), l = n === e;
201
- return /* @__PURE__ */ o.jsx(
181
+ variant: l = "underline"
182
+ } = m(), c = n === e;
183
+ return /* @__PURE__ */ s.jsx(
202
184
  "button",
203
185
  {
204
186
  role: "tab",
205
187
  id: `tabs-trigger-${e}`,
206
- "aria-selected": l,
188
+ "aria-selected": c,
207
189
  "aria-controls": `tabs-content-${e}`,
208
- tabIndex: l ? 0 : -1,
190
+ tabIndex: c ? 0 : -1,
209
191
  className: u(
210
- B({
211
- active: l,
192
+ N({
193
+ active: c,
212
194
  color: i,
213
- variant: c
195
+ variant: l
214
196
  }),
215
197
  r
216
198
  ),
217
- onClick: () => s(e),
199
+ onClick: () => o(e),
218
200
  type: "button",
219
201
  ...a,
220
202
  children: t
221
203
  }
222
204
  );
223
- }, A = ({
205
+ }, E = ({
224
206
  left: e,
225
207
  width: t,
226
208
  className: r,
227
209
  ...a
228
210
  }) => {
229
211
  const { color: n } = m();
230
- return /* @__PURE__ */ o.jsx(
212
+ return /* @__PURE__ */ s.jsx(
231
213
  "div",
232
214
  {
233
215
  "aria-hidden": !0,
@@ -241,19 +223,19 @@ const C = f(
241
223
  }
242
224
  );
243
225
  };
244
- function E(e, t, r) {
226
+ function $(e, t, r) {
245
227
  const [a, n] = p({
246
228
  left: 0,
247
229
  width: 0
248
230
  });
249
231
  return y(() => {
250
232
  if (!t.current) return;
251
- const s = t.current.querySelector(
233
+ const o = t.current.querySelector(
252
234
  `#tabs-trigger-${e}`
253
235
  );
254
- if (s) {
255
- const { offsetLeft: i, offsetWidth: c } = s;
256
- n({ left: i, width: c }), s.scrollIntoView({
236
+ if (o) {
237
+ const { offsetLeft: i, offsetWidth: l } = o;
238
+ n({ left: i, width: l }), o.scrollIntoView({
257
239
  behavior: "smooth",
258
240
  inline: "center",
259
241
  block: "nearest"
@@ -267,32 +249,32 @@ const k = ({
267
249
  children: r,
268
250
  className: a,
269
251
  color: n = "primary",
270
- variant: s = "underline",
252
+ variant: o = "underline",
271
253
  ...i
272
254
  }) => {
273
- const c = {
255
+ const l = {
274
256
  activeTab: e,
275
257
  setActiveTab: t,
276
258
  color: n,
277
- variant: s
278
- }, l = h(null), b = E(e, l, r);
279
- return /* @__PURE__ */ o.jsx(v.Provider, { value: c, children: /* @__PURE__ */ o.jsxs(
259
+ variant: o
260
+ }, c = h(null), b = $(e, c, r);
261
+ return /* @__PURE__ */ s.jsx(v.Provider, { value: l, children: /* @__PURE__ */ s.jsxs(
280
262
  "div",
281
263
  {
282
264
  role: "tablist",
283
265
  className: u(
284
- N({
285
- variant: s
266
+ R({
267
+ variant: o
286
268
  }),
287
269
  a
288
270
  ),
289
- ref: l,
271
+ ref: c,
290
272
  style: { position: "relative" },
291
273
  ...i,
292
274
  children: [
293
275
  r,
294
- s === "underline" && /* @__PURE__ */ o.jsx(
295
- A,
276
+ o === "underline" && /* @__PURE__ */ s.jsx(
277
+ E,
296
278
  {
297
279
  left: b.left,
298
280
  width: b.width
@@ -301,10 +283,10 @@ const k = ({
301
283
  ]
302
284
  }
303
285
  ) });
304
- }, P = Object.assign(k, {
305
- Trigger: R
286
+ }, D = Object.assign(k, {
287
+ Trigger: A
306
288
  });
307
289
  export {
308
- O as B,
309
- P as T
290
+ W as B,
291
+ D as T
310
292
  };
@@ -0,0 +1,27 @@
1
+ import { ButtonGroupProps } from './types';
2
+ /**
3
+ * ButtonGroup provides layout management for buttons with control over
4
+ * positioning, alignment, and fluid behavior
5
+ *
6
+ * @example
7
+ * <ButtonGroup alignment="center" gap="sm">
8
+ * <Button variant="primary">Save</Button>
9
+ * <Button variant="ghost">Cancel</Button>
10
+ * </ButtonGroup>
11
+ *
12
+ * @example
13
+ * // Vertical button group
14
+ * <ButtonGroup orientation="vertical" fluid>
15
+ * <Button variant="primary">Save</Button>
16
+ * <Button variant="secondary">Save as Draft</Button>
17
+ * <Button variant="ghost">Cancel</Button>
18
+ * </ButtonGroup>
19
+ *
20
+ * @example
21
+ * // Fluid buttons with space between
22
+ * <ButtonGroup alignment="between" fluid>
23
+ * <Button variant="ghost">Back</Button>
24
+ * <Button variant="primary">Next</Button>
25
+ * </ButtonGroup>
26
+ */
27
+ export declare const ButtonGroup: import('react').ForwardRefExoticComponent<ButtonGroupProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ export { ButtonGroup } from './button-group';
2
+ export type { ButtonGroupProps } from './types';
@@ -0,0 +1,32 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { VariantProps } from '../../utils/variants';
3
+ import { buttonGroupVariants } from './helpers';
4
+ /**
5
+ * Props for the ButtonGroup component
6
+ */
7
+ export interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof buttonGroupVariants> {
8
+ /**
9
+ * Children (should be Button components)
10
+ */
11
+ children: ReactNode;
12
+ /**
13
+ * Alignment of buttons within the group
14
+ * @default 'start'
15
+ */
16
+ alignment?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
17
+ /**
18
+ * Whether buttons should be fluid (full width)
19
+ * @default false
20
+ */
21
+ fluid?: boolean;
22
+ /**
23
+ * Orientation of the button group
24
+ * @default 'horizontal'
25
+ */
26
+ orientation?: 'horizontal' | 'vertical';
27
+ /**
28
+ * Size of the gap between buttons
29
+ * @default 'md'
30
+ */
31
+ gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
32
+ }
@@ -1,5 +1,7 @@
1
1
  export * from './app-bar';
2
2
  export * from './bottom-bar';
3
+ export * from './button-group';
4
+ export * from './page-header';
3
5
  export * from './top-bar';
4
6
  export * from './page-layout';
5
7
  export * from './form-layout';
@@ -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,9 @@ const symbolToSubpath = {
29
29
  "TimePickerInput": "forms",
30
30
  "AppBar": "layouts",
31
31
  "BottomBar": "layouts",
32
+ "ButtonGroup": "layouts",
32
33
  "FormLayout": "layouts",
34
+ "PageHeader": "layouts",
33
35
  "PageLayout": "layouts",
34
36
  "SideBar": "layouts",
35
37
  "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.23",
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",