@heigin/ui 0.0.0-stage → 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.
Files changed (124) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/LICENSE +15 -0
  3. package/README.md +28 -2
  4. package/dist/base.css +44 -0
  5. package/dist/components/crm/activity-timeline.d.ts +23 -0
  6. package/dist/components/crm/activity-timeline.js +41 -0
  7. package/dist/components/crm/approval-card.d.ts +33 -0
  8. package/dist/components/crm/approval-card.js +101 -0
  9. package/dist/components/crm/channel-mark.d.ts +10 -0
  10. package/dist/components/crm/channel-mark.js +57 -0
  11. package/dist/components/crm/conversation-list-item.d.ts +23 -0
  12. package/dist/components/crm/conversation-list-item.js +62 -0
  13. package/dist/components/crm/crm.module.js +161 -0
  14. package/dist/components/crm/deal-stage.d.ts +13 -0
  15. package/dist/components/crm/deal-stage.js +27 -0
  16. package/dist/components/crm/detail-list.d.ts +17 -0
  17. package/dist/components/crm/detail-list.js +35 -0
  18. package/dist/components/crm/filter-chip.d.ts +16 -0
  19. package/dist/components/crm/filter-chip.js +45 -0
  20. package/dist/components/crm/filter-toolbar.d.ts +16 -0
  21. package/dist/components/crm/filter-toolbar.js +42 -0
  22. package/dist/components/crm/metric-card.d.ts +30 -0
  23. package/dist/components/crm/metric-card.js +61 -0
  24. package/dist/components/crm/money-value.d.ts +9 -0
  25. package/dist/components/crm/money-value.js +27 -0
  26. package/dist/components/crm/page-header.d.ts +11 -0
  27. package/dist/components/crm/page-header.js +28 -0
  28. package/dist/components/crm/record-header.d.ts +22 -0
  29. package/dist/components/crm/record-header.js +53 -0
  30. package/dist/components/crm/sidebar-nav.d.ts +33 -0
  31. package/dist/components/crm/sidebar-nav.js +53 -0
  32. package/dist/components/crm/sla-clock.d.ts +11 -0
  33. package/dist/components/crm/sla-clock.js +41 -0
  34. package/dist/components/crm/status-badge.d.ts +94 -0
  35. package/dist/components/crm/status-badge.js +106 -0
  36. package/dist/components/crm/task-row.d.ts +18 -0
  37. package/dist/components/crm/task-row.js +52 -0
  38. package/dist/components/crm/trust-rung-badge.d.ts +14 -0
  39. package/dist/components/crm/trust-rung-badge.js +35 -0
  40. package/dist/components/ui/alert-dialog.d.ts +22 -0
  41. package/dist/components/ui/alert-dialog.js +87 -0
  42. package/dist/components/ui/avatar.d.ts +13 -0
  43. package/dist/components/ui/avatar.js +38 -0
  44. package/dist/components/ui/avatar.module.js +17 -0
  45. package/dist/components/ui/badge.d.ts +12 -0
  46. package/dist/components/ui/badge.js +28 -0
  47. package/dist/components/ui/badge.module.js +25 -0
  48. package/dist/components/ui/button.d.ts +19 -0
  49. package/dist/components/ui/button.js +39 -0
  50. package/dist/components/ui/button.module.js +27 -0
  51. package/dist/components/ui/card.d.ts +19 -0
  52. package/dist/components/ui/card.js +35 -0
  53. package/dist/components/ui/card.module.js +23 -0
  54. package/dist/components/ui/checkbox.d.ts +11 -0
  55. package/dist/components/ui/checkbox.js +47 -0
  56. package/dist/components/ui/choice.module.js +28 -0
  57. package/dist/components/ui/dialog.d.ts +32 -0
  58. package/dist/components/ui/dialog.js +67 -0
  59. package/dist/components/ui/dialog.module.js +39 -0
  60. package/dist/components/ui/drawer.d.ts +20 -0
  61. package/dist/components/ui/drawer.js +44 -0
  62. package/dist/components/ui/dropdown-menu.d.ts +38 -0
  63. package/dist/components/ui/dropdown-menu.js +66 -0
  64. package/dist/components/ui/empty-state.d.ts +12 -0
  65. package/dist/components/ui/empty-state.js +33 -0
  66. package/dist/components/ui/empty-state.module.js +19 -0
  67. package/dist/components/ui/field.d.ts +38 -0
  68. package/dist/components/ui/field.js +77 -0
  69. package/dist/components/ui/field.module.js +17 -0
  70. package/dist/components/ui/icon-button.d.ts +9 -0
  71. package/dist/components/ui/icon-button.js +21 -0
  72. package/dist/components/ui/input.d.ts +8 -0
  73. package/dist/components/ui/input.js +23 -0
  74. package/dist/components/ui/input.module.js +25 -0
  75. package/dist/components/ui/kbd.d.ts +3 -0
  76. package/dist/components/ui/kbd.js +34 -0
  77. package/dist/components/ui/native-select.d.ts +10 -0
  78. package/dist/components/ui/native-select.js +26 -0
  79. package/dist/components/ui/pagination.d.ts +13 -0
  80. package/dist/components/ui/pagination.js +55 -0
  81. package/dist/components/ui/popover.d.ts +17 -0
  82. package/dist/components/ui/popover.js +41 -0
  83. package/dist/components/ui/popup.module.js +39 -0
  84. package/dist/components/ui/radio-group.d.ts +18 -0
  85. package/dist/components/ui/radio-group.js +50 -0
  86. package/dist/components/ui/search-input.d.ts +15 -0
  87. package/dist/components/ui/search-input.js +64 -0
  88. package/dist/components/ui/select.d.ts +27 -0
  89. package/dist/components/ui/select.js +71 -0
  90. package/dist/components/ui/skeleton.d.ts +12 -0
  91. package/dist/components/ui/skeleton.js +23 -0
  92. package/dist/components/ui/skeleton.module.js +15 -0
  93. package/dist/components/ui/spinner.d.ts +8 -0
  94. package/dist/components/ui/spinner.js +19 -0
  95. package/dist/components/ui/spinner.module.js +13 -0
  96. package/dist/components/ui/switch.d.ts +10 -0
  97. package/dist/components/ui/switch.js +35 -0
  98. package/dist/components/ui/table.d.ts +52 -0
  99. package/dist/components/ui/table.js +143 -0
  100. package/dist/components/ui/table.module.js +42 -0
  101. package/dist/components/ui/tabs.d.ts +25 -0
  102. package/dist/components/ui/tabs.js +47 -0
  103. package/dist/components/ui/tabs.module.js +21 -0
  104. package/dist/components/ui/textarea.d.ts +6 -0
  105. package/dist/components/ui/textarea.js +23 -0
  106. package/dist/components/ui/toast.d.ts +30 -0
  107. package/dist/components/ui/toast.js +81 -0
  108. package/dist/components/ui/toast.module.js +21 -0
  109. package/dist/components/ui/tooltip.d.ts +18 -0
  110. package/dist/components/ui/tooltip.js +30 -0
  111. package/dist/components/ui/visually-hidden.d.ts +3 -0
  112. package/dist/components/ui/visually-hidden.js +26 -0
  113. package/dist/index.d.ts +48 -0
  114. package/dist/index.js +50 -0
  115. package/dist/lib/cn.d.ts +2 -0
  116. package/dist/lib/cn.js +7 -0
  117. package/dist/lib/format.d.ts +6 -0
  118. package/dist/lib/format.js +33 -0
  119. package/dist/styles.css +2317 -0
  120. package/dist/tailwind.css +82 -0
  121. package/dist/tokens.css +131 -0
  122. package/dist/tokens.d.ts +339 -0
  123. package/dist/tokens.js +790 -0
  124. package/package.json +54 -4
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** Inner padding. `none` lets tables and lists run edge to edge. */
4
+ padding?: "none" | "sm" | "md" | "lg";
5
+ /** Adds a hover shadow; use when the whole card is a link or button. */
6
+ interactive?: boolean;
7
+ as?: "div" | "section" | "article" | "li";
8
+ }
9
+ /** White surface with hairline border and card shadow. Server-component safe. */
10
+ export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
11
+ export interface CardHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
12
+ title: React.ReactNode;
13
+ description?: React.ReactNode;
14
+ /** Right-aligned actions (buttons, menus). */
15
+ actions?: React.ReactNode;
16
+ /** Heading level for the title. Default 3. */
17
+ level?: 2 | 3 | 4;
18
+ }
19
+ export declare function CardHeader({ title, description, actions, level, className, ...props }: CardHeaderProps): React.JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import card_module_default from "./card.module.js";
3
+ import * as React from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/components/ui/card.tsx
6
+ /** White surface with hairline border and card shadow. Server-component safe. */
7
+ var Card = React.forwardRef(function Card({ padding = "md", interactive = false, as = "div", className, ...props }, ref) {
8
+ return /* @__PURE__ */ jsx(as, {
9
+ ref,
10
+ className: cn(card_module_default.card, card_module_default[`p-${padding}`], interactive && card_module_default.interactive, className),
11
+ ...props
12
+ });
13
+ });
14
+ function CardHeader({ title, description, actions, level = 3, className, ...props }) {
15
+ const Heading = `h${level}`;
16
+ return /* @__PURE__ */ jsxs("div", {
17
+ className: cn(card_module_default.header, className),
18
+ ...props,
19
+ children: [/* @__PURE__ */ jsxs("div", {
20
+ className: card_module_default.headings,
21
+ children: [/* @__PURE__ */ jsx(Heading, {
22
+ className: card_module_default.title,
23
+ children: title
24
+ }), description && /* @__PURE__ */ jsx("p", {
25
+ className: card_module_default.description,
26
+ children: description
27
+ })]
28
+ }), actions && /* @__PURE__ */ jsx("div", {
29
+ className: card_module_default.actions,
30
+ children: actions
31
+ })]
32
+ });
33
+ }
34
+ //#endregion
35
+ export { Card, CardHeader };
@@ -0,0 +1,23 @@
1
+ //#region src/components/ui/card.module.css
2
+ var card = "hg-card-module_card_3wuz1";
3
+ var interactive = "hg-card-module_interactive_ypN14";
4
+ var header = "hg-card-module_header_usMuc";
5
+ var headings = "hg-card-module_headings_DGh1O";
6
+ var title = "hg-card-module_title_RxNJM";
7
+ var description = "hg-card-module_description_7ueJs";
8
+ var actions = "hg-card-module_actions_niBNg";
9
+ var card_module_default = {
10
+ card,
11
+ "p-none": "hg-card-module_p-none_O6FeO",
12
+ "p-sm": "hg-card-module_p-sm_Y-cA8",
13
+ "p-md": "hg-card-module_p-md_MQQwW",
14
+ "p-lg": "hg-card-module_p-lg_0fIre",
15
+ interactive,
16
+ header,
17
+ headings,
18
+ title,
19
+ description,
20
+ actions
21
+ };
22
+ //#endregion
23
+ export { actions, card, card_module_default as default, description, header, headings, interactive, title };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { Checkbox as BaseCheckbox } from "@base-ui/react/checkbox";
3
+ export interface CheckboxProps extends Omit<React.ComponentPropsWithoutRef<typeof BaseCheckbox.Root>, "className" | "render" | "children"> {
4
+ /** Visible label. Omit only when the checkbox is labelled another way (e.g. `aria-label` in a table row). */
5
+ label?: React.ReactNode;
6
+ /** Secondary text under the label. */
7
+ description?: React.ReactNode;
8
+ className?: string;
9
+ }
10
+ /** Checkbox built on Base UI. Supports `checked`, `defaultChecked`, `indeterminate` and `onCheckedChange`. */
11
+ export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ "use client";
3
+ import { cn } from "../../lib/cn.js";
4
+ import choice_module_default from "./choice.module.js";
5
+ import * as React from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Check, Minus } from "lucide-react";
8
+ import { Checkbox } from "@base-ui/react/checkbox";
9
+ //#region src/components/ui/checkbox.tsx
10
+ /** Checkbox built on Base UI. Supports `checked`, `defaultChecked`, `indeterminate` and `onCheckedChange`. */
11
+ var Checkbox$1 = React.forwardRef(function Checkbox$2({ label, description, className, indeterminate, disabled, ...props }, ref) {
12
+ const control = /* @__PURE__ */ jsx(Checkbox.Root, {
13
+ ref,
14
+ indeterminate,
15
+ disabled,
16
+ className: cn(choice_module_default.box, !label && className),
17
+ ...props,
18
+ children: /* @__PURE__ */ jsx(Checkbox.Indicator, {
19
+ className: choice_module_default.indicator,
20
+ keepMounted: false,
21
+ children: indeterminate ? /* @__PURE__ */ jsx(Minus, {
22
+ strokeWidth: 2.5,
23
+ "aria-hidden": "true"
24
+ }) : /* @__PURE__ */ jsx(Check, {
25
+ strokeWidth: 2.5,
26
+ "aria-hidden": "true"
27
+ })
28
+ })
29
+ });
30
+ if (!label) return control;
31
+ return /* @__PURE__ */ jsxs("label", {
32
+ className: cn(choice_module_default.choice, className),
33
+ "data-disabled": disabled ? "" : void 0,
34
+ children: [control, /* @__PURE__ */ jsxs("span", {
35
+ className: choice_module_default.text,
36
+ children: [/* @__PURE__ */ jsx("span", {
37
+ className: choice_module_default.label,
38
+ children: label
39
+ }), description && /* @__PURE__ */ jsx("span", {
40
+ className: choice_module_default.description,
41
+ children: description
42
+ })]
43
+ })]
44
+ });
45
+ });
46
+ //#endregion
47
+ export { Checkbox$1 as Checkbox };
@@ -0,0 +1,28 @@
1
+ //#region src/components/ui/choice.module.css
2
+ var choice = "hg-choice-module_choice_JsFQe";
3
+ var text = "hg-choice-module_text_9O-Yp";
4
+ var label = "hg-choice-module_label_pkhjn";
5
+ var description = "hg-choice-module_description_pzR2R";
6
+ var box = "hg-choice-module_box_yaCNQ";
7
+ var radio = "hg-choice-module_radio_J18Xb";
8
+ var indicator = "hg-choice-module_indicator_-TbbD";
9
+ var radioDot = "hg-choice-module_radioDot_59X-N";
10
+ var group = "hg-choice-module_group_SGCUT";
11
+ var legend = "hg-choice-module_legend_XxXor";
12
+ var thumb = "hg-choice-module_thumb_xGykp";
13
+ var choice_module_default = {
14
+ choice,
15
+ text,
16
+ label,
17
+ description,
18
+ box,
19
+ radio,
20
+ "switch": "hg-choice-module_switch_X9-AC",
21
+ indicator,
22
+ radioDot,
23
+ group,
24
+ legend,
25
+ thumb
26
+ };
27
+ //#endregion
28
+ export { box, choice, choice_module_default as default, description, group, indicator, label, legend, radio, radioDot, text, thumb };
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ import { Dialog as BaseDialog } from "@base-ui/react/dialog";
3
+ /** Root of a modal dialog. Accepts `open`, `defaultOpen` and `onOpenChange`. */
4
+ export declare const Dialog: <Payload>(props: BaseDialog.Root.Props<Payload>) => React.JSX.Element;
5
+ /** Opens the dialog. Use `render={<Button />}` to render a HeiGin Button. */
6
+ export declare const DialogTrigger: BaseDialog.Trigger;
7
+ /** Closes the dialog. Use `render={<Button variant="secondary" />}` for a footer button. */
8
+ export declare const DialogClose: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
9
+ export interface DialogContentProps extends Omit<React.ComponentPropsWithoutRef<typeof BaseDialog.Popup>, "className" | "title"> {
10
+ /** Required: becomes the dialog's accessible name. */
11
+ title: React.ReactNode;
12
+ description?: React.ReactNode;
13
+ /** Action buttons, rendered right-aligned at the bottom. */
14
+ footer?: React.ReactNode;
15
+ size?: "sm" | "md" | "lg";
16
+ /** Hide the top-right close button (Escape and the backdrop still close the dialog). */
17
+ hideClose?: boolean;
18
+ closeLabel?: string;
19
+ className?: string;
20
+ }
21
+ /**
22
+ * The modal surface. Traps focus, closes on Escape and outside click, restores focus to the
23
+ * trigger on close, and locks page scroll while open.
24
+ */
25
+ export declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
26
+ /** @internal Shared by DialogContent and DrawerContent. */
27
+ export declare function DialogHeader({ title, description, hideClose, closeLabel, }: {
28
+ title: React.ReactNode;
29
+ description?: React.ReactNode;
30
+ hideClose: boolean;
31
+ closeLabel: string;
32
+ }): React.JSX.Element;
@@ -0,0 +1,67 @@
1
+ "use client";
2
+ "use client";
3
+ import { cn } from "../../lib/cn.js";
4
+ import { IconButton } from "./icon-button.js";
5
+ import dialog_module_default from "./dialog.module.js";
6
+ import * as React from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { X } from "lucide-react";
9
+ import { Dialog } from "@base-ui/react/dialog";
10
+ //#region src/components/ui/dialog.tsx
11
+ /** Root of a modal dialog. Accepts `open`, `defaultOpen` and `onOpenChange`. */
12
+ var Dialog$1 = Dialog.Root;
13
+ /** Opens the dialog. Use `render={<Button />}` to render a HeiGin Button. */
14
+ var DialogTrigger = Dialog.Trigger;
15
+ /** Closes the dialog. Use `render={<Button variant="secondary" />}` for a footer button. */
16
+ var DialogClose = Dialog.Close;
17
+ /**
18
+ * The modal surface. Traps focus, closes on Escape and outside click, restores focus to the
19
+ * trigger on close, and locks page scroll while open.
20
+ */
21
+ var DialogContent = React.forwardRef(function DialogContent({ title, description, footer, size = "md", hideClose = false, closeLabel = "Close", className, children, ...props }, ref) {
22
+ return /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, { className: dialog_module_default.backdrop }), /* @__PURE__ */ jsxs(Dialog.Popup, {
23
+ ref,
24
+ className: cn(dialog_module_default.dialog, dialog_module_default[size], className),
25
+ ...props,
26
+ children: [
27
+ /* @__PURE__ */ jsx(DialogHeader, {
28
+ title,
29
+ description,
30
+ hideClose,
31
+ closeLabel
32
+ }),
33
+ children !== void 0 && /* @__PURE__ */ jsx("div", {
34
+ className: dialog_module_default.body,
35
+ children
36
+ }),
37
+ footer && /* @__PURE__ */ jsx("div", {
38
+ className: dialog_module_default.footer,
39
+ children: footer
40
+ })
41
+ ]
42
+ })] });
43
+ });
44
+ /** @internal Shared by DialogContent and DrawerContent. */
45
+ function DialogHeader({ title, description, hideClose, closeLabel }) {
46
+ return /* @__PURE__ */ jsxs("div", {
47
+ className: dialog_module_default.header,
48
+ children: [/* @__PURE__ */ jsxs("div", {
49
+ className: dialog_module_default.headings,
50
+ children: [/* @__PURE__ */ jsx(Dialog.Title, {
51
+ className: dialog_module_default.title,
52
+ children: title
53
+ }), description && /* @__PURE__ */ jsx(Dialog.Description, {
54
+ className: dialog_module_default.description,
55
+ children: description
56
+ })]
57
+ }), !hideClose && /* @__PURE__ */ jsx(Dialog.Close, { render: /* @__PURE__ */ jsx(IconButton, {
58
+ label: closeLabel,
59
+ icon: /* @__PURE__ */ jsx(X, { strokeWidth: 1.6 }),
60
+ size: "sm",
61
+ touch: false,
62
+ className: dialog_module_default.close
63
+ }) })]
64
+ });
65
+ }
66
+ //#endregion
67
+ export { Dialog$1 as Dialog, DialogClose, DialogContent, DialogHeader, DialogTrigger };
@@ -0,0 +1,39 @@
1
+ //#region src/components/ui/dialog.module.css
2
+ var backdrop = "hg-dialog-module_backdrop_VjGkS";
3
+ var dialog = "hg-dialog-module_dialog_P2qiW";
4
+ var sm = "hg-dialog-module_sm_UjVn-";
5
+ var md = "hg-dialog-module_md_SA2qi";
6
+ var lg = "hg-dialog-module_lg_xvMRY";
7
+ var header = "hg-dialog-module_header_jWMk3";
8
+ var headings = "hg-dialog-module_headings_dK9UI";
9
+ var title = "hg-dialog-module_title_3Vs9k";
10
+ var description = "hg-dialog-module_description_CHS9A";
11
+ var close = "hg-dialog-module_close_FeAd-";
12
+ var body = "hg-dialog-module_body_P5G2D";
13
+ var footer = "hg-dialog-module_footer_oX4kh";
14
+ var drawer = "hg-dialog-module_drawer_Anoh1";
15
+ var right = "hg-dialog-module_right_ujpiW";
16
+ var left = "hg-dialog-module_left_uFn-l";
17
+ var bottom = "hg-dialog-module_bottom_QwkmD";
18
+ var alertIcon = "hg-dialog-module_alertIcon_9ctsl";
19
+ var dialog_module_default = {
20
+ backdrop,
21
+ dialog,
22
+ sm,
23
+ md,
24
+ lg,
25
+ header,
26
+ headings,
27
+ title,
28
+ description,
29
+ close,
30
+ body,
31
+ footer,
32
+ drawer,
33
+ right,
34
+ left,
35
+ bottom,
36
+ alertIcon
37
+ };
38
+ //#endregion
39
+ export { alertIcon, backdrop, body, bottom, close, dialog_module_default as default, description, dialog, drawer, footer, header, headings, left, lg, md, right, sm, title };
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import { Dialog as BaseDialog } from "@base-ui/react/dialog";
3
+ /** Root of a drawer (a dialog that slides in from an edge). Accepts `open` / `onOpenChange`. */
4
+ export declare const Drawer: <Payload>(props: BaseDialog.Root.Props<Payload>) => React.JSX.Element;
5
+ export declare const DrawerTrigger: BaseDialog.Trigger;
6
+ export declare const DrawerClose: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ export interface DrawerContentProps extends Omit<React.ComponentPropsWithoutRef<typeof BaseDialog.Popup>, "className" | "title"> {
8
+ title: React.ReactNode;
9
+ description?: React.ReactNode;
10
+ footer?: React.ReactNode;
11
+ /** `right` for record details and forms, `left` for mobile navigation, `bottom` for mobile sheets. */
12
+ side?: "right" | "left" | "bottom";
13
+ /** Override the panel width (right/left), e.g. "480px". */
14
+ width?: string;
15
+ hideClose?: boolean;
16
+ closeLabel?: string;
17
+ className?: string;
18
+ }
19
+ /** Edge-anchored modal panel with the same focus management as Dialog. */
20
+ export declare const DrawerContent: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ "use client";
3
+ import { cn } from "../../lib/cn.js";
4
+ import dialog_module_default from "./dialog.module.js";
5
+ import { DialogHeader } from "./dialog.js";
6
+ import * as React from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { Dialog } from "@base-ui/react/dialog";
9
+ //#region src/components/ui/drawer.tsx
10
+ /** Root of a drawer (a dialog that slides in from an edge). Accepts `open` / `onOpenChange`. */
11
+ var Drawer = Dialog.Root;
12
+ var DrawerTrigger = Dialog.Trigger;
13
+ var DrawerClose = Dialog.Close;
14
+ /** Edge-anchored modal panel with the same focus management as Dialog. */
15
+ var DrawerContent = React.forwardRef(function DrawerContent({ title, description, footer, side = "right", width, hideClose = false, closeLabel = "Close", className, children, style, ...props }, ref) {
16
+ return /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, { className: dialog_module_default.backdrop }), /* @__PURE__ */ jsxs(Dialog.Popup, {
17
+ ref,
18
+ "data-side": side,
19
+ className: cn(dialog_module_default.drawer, dialog_module_default[side], className),
20
+ style: {
21
+ ...width ? { "--drawer-width": width } : null,
22
+ ...style
23
+ },
24
+ ...props,
25
+ children: [
26
+ /* @__PURE__ */ jsx(DialogHeader, {
27
+ title,
28
+ description,
29
+ hideClose,
30
+ closeLabel
31
+ }),
32
+ /* @__PURE__ */ jsx("div", {
33
+ className: dialog_module_default.body,
34
+ children
35
+ }),
36
+ footer && /* @__PURE__ */ jsx("div", {
37
+ className: dialog_module_default.footer,
38
+ children: footer
39
+ })
40
+ ]
41
+ })] });
42
+ });
43
+ //#endregion
44
+ export { Drawer, DrawerClose, DrawerContent, DrawerTrigger };
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ import { Menu } from "@base-ui/react/menu";
3
+ /** Root of a dropdown menu. Controls `open` / `onOpenChange` when you need it controlled. */
4
+ export declare const DropdownMenu: typeof Menu.Root;
5
+ export type DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<typeof Menu.Trigger>;
6
+ /**
7
+ * The element that opens the menu. Pass `render={<Button variant="secondary" />}` to use a HeiGin
8
+ * Button (or IconButton) as the trigger; otherwise renders a bare `<button>`.
9
+ */
10
+ export declare const DropdownMenuTrigger: Menu.Trigger;
11
+ export interface DropdownMenuContentProps extends Omit<React.ComponentPropsWithoutRef<typeof Menu.Popup>, "className"> {
12
+ side?: "top" | "bottom" | "left" | "right";
13
+ align?: "start" | "center" | "end";
14
+ sideOffset?: number;
15
+ className?: string;
16
+ }
17
+ /** The floating menu surface. Rendered in a portal, positioned against the trigger. */
18
+ export declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
19
+ export interface DropdownMenuItemProps extends Omit<React.ComponentPropsWithoutRef<typeof Menu.Item>, "className"> {
20
+ icon?: React.ReactNode;
21
+ /** Keyboard shortcut hint shown on the right (display only). */
22
+ shortcut?: string;
23
+ tone?: "default" | "danger";
24
+ className?: string;
25
+ }
26
+ /** A menu action. Use `onClick` to handle selection; the menu closes afterwards. */
27
+ export declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>>;
28
+ /** A thin divider between groups of items. */
29
+ export declare function DropdownMenuSeparator({ className }: {
30
+ className?: string;
31
+ }): React.JSX.Element;
32
+ export interface DropdownMenuGroupProps {
33
+ /** Optional visible heading for the group. */
34
+ label?: React.ReactNode;
35
+ children: React.ReactNode;
36
+ }
37
+ /** Groups related items, optionally under a small heading. */
38
+ export declare function DropdownMenuGroup({ label, children }: DropdownMenuGroupProps): React.JSX.Element;
@@ -0,0 +1,66 @@
1
+ "use client";
2
+ "use client";
3
+ import { cn } from "../../lib/cn.js";
4
+ import popup_module_default from "./popup.module.js";
5
+ import * as React from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Menu } from "@base-ui/react/menu";
8
+ //#region src/components/ui/dropdown-menu.tsx
9
+ /** Root of a dropdown menu. Controls `open` / `onOpenChange` when you need it controlled. */
10
+ var DropdownMenu = Menu.Root;
11
+ /**
12
+ * The element that opens the menu. Pass `render={<Button variant="secondary" />}` to use a HeiGin
13
+ * Button (or IconButton) as the trigger; otherwise renders a bare `<button>`.
14
+ */
15
+ var DropdownMenuTrigger = Menu.Trigger;
16
+ /** The floating menu surface. Rendered in a portal, positioned against the trigger. */
17
+ var DropdownMenuContent = React.forwardRef(function DropdownMenuContent({ side = "bottom", align = "start", sideOffset = 4, className, children, ...props }, ref) {
18
+ return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
19
+ className: popup_module_default.positioner,
20
+ side,
21
+ align,
22
+ sideOffset,
23
+ children: /* @__PURE__ */ jsx(Menu.Popup, {
24
+ ref,
25
+ className: cn(popup_module_default.popup, className),
26
+ ...props,
27
+ children
28
+ })
29
+ }) });
30
+ });
31
+ /** A menu action. Use `onClick` to handle selection; the menu closes afterwards. */
32
+ var DropdownMenuItem = React.forwardRef(function DropdownMenuItem({ icon, shortcut, tone = "default", className, children, ...props }, ref) {
33
+ return /* @__PURE__ */ jsxs(Menu.Item, {
34
+ ref,
35
+ className: cn(popup_module_default.item, tone === "danger" && popup_module_default.itemDanger, className),
36
+ ...props,
37
+ children: [
38
+ icon && /* @__PURE__ */ jsx("span", {
39
+ "aria-hidden": "true",
40
+ style: { display: "inline-flex" },
41
+ children: icon
42
+ }),
43
+ /* @__PURE__ */ jsx("span", {
44
+ className: popup_module_default.itemText,
45
+ children
46
+ }),
47
+ shortcut && /* @__PURE__ */ jsx("kbd", {
48
+ className: popup_module_default.shortcut,
49
+ children: shortcut
50
+ })
51
+ ]
52
+ });
53
+ });
54
+ /** A thin divider between groups of items. */
55
+ function DropdownMenuSeparator({ className }) {
56
+ return /* @__PURE__ */ jsx(Menu.Separator, { className: cn(popup_module_default.separator, className) });
57
+ }
58
+ /** Groups related items, optionally under a small heading. */
59
+ function DropdownMenuGroup({ label, children }) {
60
+ return /* @__PURE__ */ jsxs(Menu.Group, { children: [label && /* @__PURE__ */ jsx(Menu.GroupLabel, {
61
+ className: popup_module_default.groupLabel,
62
+ children: label
63
+ }), children] });
64
+ }
65
+ //#endregion
66
+ export { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ export interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
3
+ icon?: React.ReactNode;
4
+ title: React.ReactNode;
5
+ description?: React.ReactNode;
6
+ /** Primary next step, e.g. a Button. */
7
+ action?: React.ReactNode;
8
+ /** `inline` for inside cards and tables, `page` for whole empty screens. */
9
+ size?: "inline" | "page";
10
+ }
11
+ /** Explains why a view is empty and what to do next. Server-component safe. */
12
+ export declare function EmptyState({ icon, title, description, action, size, className, ...props }: EmptyStateProps): React.JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import empty_state_module_default from "./empty-state.module.js";
3
+ import "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/components/ui/empty-state.tsx
6
+ /** Explains why a view is empty and what to do next. Server-component safe. */
7
+ function EmptyState({ icon, title, description, action, size = "inline", className, ...props }) {
8
+ return /* @__PURE__ */ jsxs("div", {
9
+ className: cn(empty_state_module_default.empty, empty_state_module_default[size], className),
10
+ ...props,
11
+ children: [
12
+ icon && /* @__PURE__ */ jsx("span", {
13
+ className: empty_state_module_default.icon,
14
+ "aria-hidden": "true",
15
+ children: icon
16
+ }),
17
+ /* @__PURE__ */ jsx("p", {
18
+ className: empty_state_module_default.title,
19
+ children: title
20
+ }),
21
+ description && /* @__PURE__ */ jsx("p", {
22
+ className: empty_state_module_default.description,
23
+ children: description
24
+ }),
25
+ action && /* @__PURE__ */ jsx("div", {
26
+ className: empty_state_module_default.action,
27
+ children: action
28
+ })
29
+ ]
30
+ });
31
+ }
32
+ //#endregion
33
+ export { EmptyState };
@@ -0,0 +1,19 @@
1
+ //#region src/components/ui/empty-state.module.css
2
+ var empty = "hg-empty-state-module_empty_afUXX";
3
+ var inline = "hg-empty-state-module_inline_QcQf-";
4
+ var page = "hg-empty-state-module_page_vjTsk";
5
+ var icon = "hg-empty-state-module_icon_u3NpF";
6
+ var title = "hg-empty-state-module_title_IP3hm";
7
+ var description = "hg-empty-state-module_description_1qj9L";
8
+ var action = "hg-empty-state-module_action_YPW3V";
9
+ var empty_state_module_default = {
10
+ empty,
11
+ inline,
12
+ page,
13
+ icon,
14
+ title,
15
+ description,
16
+ action
17
+ };
18
+ //#endregion
19
+ export { action, empty_state_module_default as default, description, empty, icon, inline, page, title };
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ interface FieldContextValue {
3
+ controlId: string;
4
+ describedBy: string | undefined;
5
+ invalid: boolean;
6
+ required: boolean;
7
+ disabled: boolean;
8
+ }
9
+ /** Read the surrounding Field's ids and state. Returns `null` outside a Field. */
10
+ export declare function useField(): FieldContextValue | null;
11
+ /** Merge Field-provided accessibility props with props set directly on a control. */
12
+ export declare function useFieldControlProps<P extends {
13
+ id?: string;
14
+ "aria-describedby"?: string;
15
+ "aria-invalid"?: React.AriaAttributes["aria-invalid"];
16
+ required?: boolean;
17
+ disabled?: boolean;
18
+ }>(props: P): P;
19
+ export interface FieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
20
+ label: React.ReactNode;
21
+ /** Helper text shown under the control. */
22
+ description?: React.ReactNode;
23
+ /** Validation message. When set, the control is marked `aria-invalid` and the message is announced. */
24
+ error?: React.ReactNode;
25
+ required?: boolean;
26
+ disabled?: boolean;
27
+ /** Visually hide the label (it stays available to assistive technology). */
28
+ hideLabel?: boolean;
29
+ /** Override the generated control id. */
30
+ id?: string;
31
+ children: React.ReactNode;
32
+ }
33
+ /**
34
+ * Labels a single form control and wires up `id`, `aria-describedby`, `aria-invalid`,
35
+ * `required` and `disabled` for HeiGin inputs placed inside it.
36
+ */
37
+ export declare const Field: React.ForwardRefExoticComponent<FieldProps & React.RefAttributes<HTMLDivElement>>;
38
+ export {};